cassproject 5.0.18 → 5.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +12 -9
- package/src/com/eduworks/ec/remote/EcRemote.js +22 -2
- package/src/org/cassproject/ebac/identity/remote/EcRemoteIdentityManager.js +1 -0
- package/src/org/cassproject/ebac/repository/EcRepository.js +1 -4
- package/src/org/cassproject/schema/general/EcRemoteLinkedData.js +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cassproject",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.20",
|
|
4
4
|
"description": "Competency and Skills Service",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"base64-arraybuffer": "^1.0.2",
|
|
159
159
|
"jsonld": "^9.0.0",
|
|
160
160
|
"node-forge": "^1.4.0",
|
|
161
|
-
"papaparse": "^5.
|
|
161
|
+
"papaparse": "^5.7.0",
|
|
162
162
|
"promise-worker": "^2.0.1",
|
|
163
163
|
"web-worker": "1.3.0"
|
|
164
164
|
},
|
|
@@ -184,20 +184,23 @@
|
|
|
184
184
|
},
|
|
185
185
|
"homepage": "https://github.com/cassproject/cass-npm#readme",
|
|
186
186
|
"devDependencies": {
|
|
187
|
-
"@cypress/webpack-preprocessor": "^7.1.
|
|
187
|
+
"@cypress/webpack-preprocessor": "^7.1.2",
|
|
188
188
|
"chai": "^4.5.0",
|
|
189
|
-
"concurrently": "^10.0.
|
|
189
|
+
"concurrently": "^10.0.5",
|
|
190
190
|
"cypress": "15.19.0",
|
|
191
|
-
"cypress-fail-fast": "^8.
|
|
192
|
-
"eslint": "^10.
|
|
191
|
+
"cypress-fail-fast": "^8.2.0",
|
|
192
|
+
"eslint": "^10.12.0",
|
|
193
193
|
"fake-indexeddb": "^6.2.5",
|
|
194
194
|
"mocha": "^11.8.0",
|
|
195
195
|
"node-polyfill-webpack-plugin": "^4.1.0",
|
|
196
196
|
"nodemon": "^3.1.14",
|
|
197
197
|
"nyc": "^18.0.0",
|
|
198
198
|
"sinon": "^21.1.2",
|
|
199
|
-
"wait-on": "^9.1
|
|
200
|
-
"webpack": "^5.
|
|
199
|
+
"wait-on": "^9.5.1",
|
|
200
|
+
"webpack": "^5.111.1"
|
|
201
201
|
},
|
|
202
|
-
"packageManager": "npm@11.3.0+sha512.96eb611483f49c55f7fa74df61b588de9e213f80a256728e6798ddc67176c7b07e4a1cfc7de8922422cbce02543714367037536955221fa451b0c4fefaf20c66"
|
|
202
|
+
"packageManager": "npm@11.3.0+sha512.96eb611483f49c55f7fa74df61b588de9e213f80a256728e6798ddc67176c7b07e4a1cfc7de8922422cbce02543714367037536955221fa451b0c4fefaf20c66",
|
|
203
|
+
"allowScripts": {
|
|
204
|
+
"cypress@15.19.0": true
|
|
205
|
+
}
|
|
203
206
|
}
|
|
@@ -10,16 +10,27 @@ if (typeof process === 'object') {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
let httpFormData = typeof FormData !== 'undefined' ? FormData : undefined;
|
|
13
14
|
if (isNode)
|
|
14
|
-
{
|
|
15
|
-
let undici =
|
|
15
|
+
{
|
|
16
|
+
let undici = null;
|
|
17
|
+
try {
|
|
18
|
+
undici = eval("require('undici');");
|
|
19
|
+
} catch (ex) {
|
|
20
|
+
//undici is optional. Fall back to the platform's fetch and FormData.
|
|
21
|
+
}
|
|
16
22
|
if (undici != null)
|
|
17
23
|
{
|
|
18
24
|
var {setGlobalDispatcher,Agent,fetch} = undici; //NOSONAR - Intentional use of var to allow for global scope.
|
|
25
|
+
//fetch and FormData must come from the same implementation. undici's fetch
|
|
26
|
+
//does not recognize the platform's FormData and serializes it as text/plain.
|
|
27
|
+
httpFormData = undici.FormData;
|
|
19
28
|
setGlobalDispatcher(new Agent({
|
|
20
29
|
allowH2: process.env.HTTP2 != null ? process.env.HTTP2.trim() == 'true' : true
|
|
21
30
|
}))
|
|
22
31
|
}
|
|
32
|
+
else if (typeof globalThis.fetch === 'function')
|
|
33
|
+
var fetch = globalThis.fetch; //NOSONAR - Intentional use of var; the destructuring above hoists `fetch` to module scope, which would otherwise shadow the global with undefined.
|
|
23
34
|
}
|
|
24
35
|
if (typeof window !== 'undefined' && window.fetch != null)
|
|
25
36
|
var fetch = window.fetch; //NOSONAR - Intentional use of var to allow for global scope.
|
|
@@ -50,6 +61,15 @@ const { cassPromisify } = require("../promises/helpers");
|
|
|
50
61
|
* @module com.eduworks.ec
|
|
51
62
|
*/
|
|
52
63
|
module.exports = class EcRemote {
|
|
64
|
+
/**
|
|
65
|
+
* The FormData implementation paired with the fetch implementation EcRemote uses.
|
|
66
|
+
* Always construct multi-part bodies destined for EcRemote.post* with this,
|
|
67
|
+
* not the platform global, or bodies will be serialized as text/plain.
|
|
68
|
+
*
|
|
69
|
+
* @property FormData
|
|
70
|
+
* @static
|
|
71
|
+
*/
|
|
72
|
+
static FormData = httpFormData;
|
|
53
73
|
//See https://github.com/nodejs/node/issues/47130 -- This is a workaround for a bug that causes http 1.1 keep-alive from throwing an error.
|
|
54
74
|
static leTired() {
|
|
55
75
|
if (isNode)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
const {cassPromisify} = require("../../../../../com/eduworks/ec/promises/helpers");
|
|
3
3
|
const EcRemote = require("../../../../../com/eduworks/ec/remote/EcRemote");
|
|
4
|
+
const FormData = EcRemote.FormData;
|
|
4
5
|
const EbacCredentialCommit = require("../../../../../com/eduworks/schema/ebac/EbacCredentialCommit");
|
|
5
6
|
const EbacCredentialRequest = require("../../../../../com/eduworks/schema/ebac/EbacCredentialRequest");
|
|
6
7
|
const EcContact = require("../EcContact");
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
if (typeof process !== 'undefined' && process.version && process.version.startsWith("v16")) {
|
|
2
|
-
console.log("Loading polyfill for FormData.");
|
|
3
|
-
FormData = eval("require('undici').FormData");
|
|
4
|
-
}
|
|
5
1
|
const EcObject = require("../../../../com/eduworks/ec/array/EcObject");
|
|
6
2
|
const EcEncryptedValue = require("./EcEncryptedValue");
|
|
7
3
|
const EcIdentityManager = require("../identity/EcIdentityManager");
|
|
8
4
|
const EcRekeyRequest = require("../identity/EcRekeyRequest");
|
|
9
5
|
const EcArray = require("../../../../com/eduworks/ec/array/EcArray");
|
|
10
6
|
const EcRemote = require("../../../../com/eduworks/ec/remote/EcRemote");
|
|
7
|
+
const FormData = EcRemote.FormData;
|
|
11
8
|
const { cassPromisify, cassReturnAsPromise, cassReturnNullAsPromise } = require("../../../../com/eduworks/ec/promises/helpers");
|
|
12
9
|
const EcRemoteLinkedData = require("../../schema/general/EcRemoteLinkedData");
|
|
13
10
|
const EcCrypto = require("../../../../com/eduworks/ec/crypto/EcCrypto");
|
|
@@ -6,6 +6,7 @@ const EcPpkFacade = require("../../../../com/eduworks/ec/crypto/EcPpkFacade.js")
|
|
|
6
6
|
const EcRsaOaepAsyncWorker = require("../../../../com/eduworks/ec/crypto/EcRsaOaepAsyncWorker.js");
|
|
7
7
|
const EcLinkedData = require("../../../json/ld/EcLinkedData.js");
|
|
8
8
|
const Ebac = require("./Ebac.js");
|
|
9
|
+
const FormData = require("../../../../com/eduworks/ec/remote/EcRemote.js").FormData;
|
|
9
10
|
require("../../general/AuditLogger.js")
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -540,6 +541,19 @@ module.exports = class EcRemoteLinkedData extends EcLinkedData {
|
|
|
540
541
|
types[i].substring(lastSlash + 1) +
|
|
541
542
|
'")';
|
|
542
543
|
}
|
|
544
|
+
//Replace http with https in schema or visa versa and then do it again
|
|
545
|
+
for (let i = 0; i < types.length; i++) {
|
|
546
|
+
if (result != "") result += " OR ";
|
|
547
|
+
let lastSlash = types[i].lastIndexOf("/");
|
|
548
|
+
let context = types[i].substring(0, lastSlash + 1);
|
|
549
|
+
if (context.startsWith("http://")) {
|
|
550
|
+
let httpsContext = context.replace("http://", "https://");
|
|
551
|
+
result += '(@context:"' + httpsContext + '" AND @type:"' + types[i].substring(lastSlash + 1) + '")';
|
|
552
|
+
} else if (context.startsWith("https://")) {
|
|
553
|
+
let httpContext = context.replace("https://", "http://");
|
|
554
|
+
result += '(@context:"' + httpContext + '" AND @type:"' + types[i].substring(lastSlash + 1) + '")';
|
|
555
|
+
}
|
|
556
|
+
}
|
|
543
557
|
return "(" + result + ")";
|
|
544
558
|
}
|
|
545
559
|
asRdfXml(success, failure, signatureSheet) {
|