-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into dependabot/npm_and_yarn/apps/dfda-1/cypre…
…ss/request-and-cypress-3.0.1
- Loading branch information
Showing
67 changed files
with
12,374 additions
and
3,037 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Text2Measurements tests | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'libs/text-2-measurements/**' | ||
pull_request: | ||
paths: | ||
- 'libs/text-2-measurements/**' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
cd libs/text-2-measurements | ||
npm ci | ||
- name: Run Tests | ||
run: | | ||
cd libs/text-2-measurements | ||
npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -873,7 +873,7 @@ describe("Login", function () { | |
// TODO: Figure out how to preserve cookie session between requests in tests | ||
this.timeout(5000) | ||
let request = { body: { email: "[email protected]", password: "testing123" } }; | ||
const loginUrl = qm.urlHelper.prefixExpressOriginIfNecessary('/auth/login') | ||
const loginUrl = qm.urlHelper.prefixQMAPIOriginIfNecessary('/auth/login') | ||
var response = await fetch(loginUrl, { | ||
method: 'POST', | ||
headers: { | ||
|
@@ -886,7 +886,7 @@ describe("Login", function () { | |
// qmLog.debug("user:", json) | ||
// qm.assert.equals("testuser", json.user_login); | ||
}) | ||
let apiUrl = qm.urlHelper.prefixExpressOriginIfNecessary("/api/v1/user"); | ||
let apiUrl = qm.urlHelper.prefixQMAPIOriginIfNecessary("/api/v1/user"); | ||
let cookie = response.headers.get('set-cookie'); | ||
function parseCookies(response) { | ||
const raw = response.headers.raw()['set-cookie']; | ||
|
@@ -1003,7 +1003,7 @@ describe("Variables", function () { | |
describe("NFT", function () { | ||
it('can can mint a digital twin nft', async function(done) { | ||
var image = await digitalTwin.generateLifeForceNftImage(); | ||
|
||
done() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Environment variables declared in this file are automatically made available to Prisma. | ||
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema | ||
|
||
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. | ||
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings | ||
|
||
#DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" | ||
DATABASE_URL="file:./your_db.sqlite" | ||
FDAI_API_ORIGIN="https://safe.fdai.earth" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
# Keep environment variables out of version control | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; | ||
|
||
class FDAiClient { | ||
constructor(clientId, clientSecret = "oauth_test_client_secret", | ||
apiOrigin = "https://safe.fdai.earth") { | ||
this.clientId = clientId; | ||
this.clientSecret = clientSecret; | ||
this.apiOrigin = apiOrigin; | ||
} | ||
|
||
apiCall(method, endpoint, data) { | ||
return new Promise((resolve, reject) => { | ||
const xhr = new XMLHttpRequest(); | ||
const url = `${this.apiOrigin}${endpoint}`; | ||
xhr.open(method, url, true); | ||
xhr.setRequestHeader("Content-type", "application/json"); | ||
xhr.setRequestHeader("X-Client-ID", this.clientId); | ||
xhr.setRequestHeader("X-Client-Secret", this.clientSecret); | ||
xhr.onload = () => { | ||
if (xhr.status >= 200 && xhr.status < 400) { | ||
resolve(JSON.parse(xhr.responseText)); | ||
} else { | ||
reject(new Error(xhr.responseText)); | ||
} | ||
}; | ||
xhr.onerror = () => { | ||
reject(new Error("Network error")); | ||
}; | ||
xhr.send(JSON.stringify(data)); | ||
}); | ||
} | ||
|
||
createUser(clientUserId) { | ||
const data = { | ||
clientUserId: clientUserId, | ||
clientId: this.clientId, | ||
clientSecret: this.clientSecret | ||
}; | ||
return this.apiCall("POST", "/api/v1/user", data); | ||
} | ||
} | ||
|
||
module.exports = FDAiClient; |
Oops, something went wrong.