cassproject 5.0.22 → 5.0.23
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 +47 -50
- package/src/com/eduworks/ec/array/EcArray.js +1 -1
- package/src/com/eduworks/ec/array/EcAsyncHelper.js +1 -1
- package/src/com/eduworks/ec/array/EcObject.js +1 -1
- package/src/com/eduworks/ec/crypto/EcAes.js +1 -1
- package/src/com/eduworks/ec/crypto/EcAesCtrAsync.js +20 -22
- package/src/com/eduworks/ec/crypto/EcCrypto.js +8 -4
- package/src/com/eduworks/ec/crypto/EcPk.js +7 -7
- package/src/com/eduworks/ec/crypto/EcPpk.js +7 -7
- package/src/com/eduworks/ec/crypto/EcRsaOaepAsync.js +20 -19
- package/src/com/eduworks/ec/crypto/EcRsaOaepAsyncWorker.js +7 -6
- package/src/com/eduworks/ec/crypto/forgeAsyncNode.js +8 -8
- package/src/com/eduworks/ec/graph/EcDirectedGraph.js +1 -2
- package/src/com/eduworks/ec/graph/EcFrameworkGraph.js +18 -24
- package/src/com/eduworks/ec/promises/helpers.js +1 -3
- package/src/com/eduworks/ec/remote/EcRemote.js +9 -9
- package/src/com/eduworks/ec/task/EcAsyncTask.js +5 -20
- package/src/com/eduworks/ec/task/EcAsyncTaskManager.js +3 -4
- package/src/com/eduworks/ec/task/EcAsyncTaskWorker.js +9 -11
- package/src/com/eduworks/schema/cfd/competency/CfdFramework.js +36 -37
- package/src/com/eduworks/schema/ebac/EbacContact.js +3 -9
- package/src/com/eduworks/schema/ebac/EbacContactGrant.js +3 -9
- package/src/com/eduworks/schema/ebac/EbacCredential.js +3 -9
- package/src/com/eduworks/schema/ebac/EbacCredentialCommit.js +3 -9
- package/src/com/eduworks/schema/ebac/EbacCredentialRequest.js +3 -9
- package/src/com/eduworks/schema/ebac/EbacCredentials.js +3 -9
- package/src/com/eduworks/schema/ebac/EbacEncryptedSecret.js +3 -9
- package/src/com/eduworks/schema/ebac/EbacEncryptedValue.js +5 -12
- package/src/com/eduworks/schema/ebac/EbacSignature.js +1 -6
- package/src/index/env.js +6 -3
- package/src/index/polyfills.js +13 -27
- package/src/org/angles/schema/angles/VideoStory.js +1 -1
- package/src/org/cass/competency/EcCompetency.js +1 -2
- package/src/org/cass/competency/EcDirectory.js +1 -2
- package/src/org/cass/competency/EcFramework.js +9 -12
- package/src/org/cass/exporter/CSVExport.js +12 -13
- package/src/org/cass/importer/ASNImport.js +3 -6
- package/src/org/cass/importer/CSVImport.js +9 -17
- package/src/org/cass/importer/CTDLASNCSVConceptImport.js +25 -121
- package/src/org/cass/importer/CTDLASNCSVImport.js +88 -133
- package/src/org/cass/importer/FrameworkImport.js +16 -30
- package/src/org/cass/importer/MedbiqImport.js +3 -4
- package/src/org/cass/importer/TabStructuredImport.js +6 -6
- package/src/org/cass/profile/EcAssertion.js +40 -51
- package/src/org/cassproject/ebac/identity/EcContactGrant.js +2 -2
- package/src/org/cassproject/ebac/identity/EcIdentityManager.js +56 -62
- package/src/org/cassproject/ebac/identity/remote/EcRemoteIdentityManager.js +51 -62
- package/src/org/cassproject/ebac/identity/remote/OAuth2FileBasedRemoteIdentityManager.js +56 -70
- package/src/org/cassproject/ebac/identity/remote/RemoteIdentityManagerInterface.js +3 -3
- package/src/org/cassproject/ebac/repository/EcEncryptedValue.js +51 -44
- package/src/org/cassproject/ebac/repository/EcRepository.js +228 -301
- package/src/org/cassproject/general/repository/GeneralFile.js +8 -9
- package/src/org/cassproject/schema/cass/competency/Competency.js +10 -11
- package/src/org/cassproject/schema/cass/competency/Framework.js +10 -11
- package/src/org/cassproject/schema/cass/competency/Level.js +10 -11
- package/src/org/cassproject/schema/cass/competency/Relation.js +10 -11
- package/src/org/cassproject/schema/cass/competency/RollupRule.js +7 -7
- package/src/org/cassproject/schema/cass/profile/Assertion.js +20 -27
- package/src/org/cassproject/schema/cass/profile/AssertionEnvelope.js +3 -5
- package/src/org/cassproject/schema/general/EcRemoteLinkedData.js +41 -44
- package/src/org/json/ld/EcLinkedData.js +10 -12
- package/src/org/schema/EcOrganization.js +10 -10
- package/src/org/schema/EcQuestion.js +8 -8
- package/src/org/w3/skos/Concept.js +6 -6
- package/src/org/w3/skos/ConceptScheme.js +6 -6
- package/src/org/w3/skos/EcConcept.js +1 -2
- package/src/org/w3/skos/EcConceptScheme.js +1 -2
- package/src/test/0.start.test.js +1 -1
- package/src/test/0.testLibraries.test.js +172 -0
- package/src/test/1.ASNImport.test.js +122 -0
- package/src/test/1.CSVExport.test.js +57 -0
- package/src/test/1.CSVImport.test.js +185 -0
- package/src/test/1.CTDLASNCSVConceptImport.test.js +348 -0
- package/src/test/1.CTDLASNCSVImport.import.test.js +497 -0
- package/src/test/1.Ebac.schema.test.js +107 -0
- package/src/test/1.EcAssertion.decrypt.test.js +98 -0
- package/src/test/1.EcAssertion.pinned.test.js +160 -0
- package/src/test/1.EcCrypto.formats.test.js +293 -0
- package/src/test/1.EcCrypto.generateUUID.test.js +47 -0
- package/src/test/1.EcEncryptedValue.helpers.test.js +236 -0
- package/src/test/1.EcHelpers.misc.test.js +259 -0
- package/src/test/1.EcIdentityManager.keys.test.js +439 -0
- package/src/test/1.EcOrganization.rekey.test.js +68 -0
- package/src/test/1.EcRemote.responses.test.js +155 -0
- package/src/test/1.EcRemoteIdentityManager.flows.test.js +326 -0
- package/src/test/1.EcRemoteLinkedData.pinned.test.js +473 -0
- package/src/test/1.EcRepository.l0.test.js +14 -5
- package/src/test/1.EcRepository.l1.test.js +16 -7
- package/src/test/1.EcRepository.l2.test.js +20 -11
- package/src/test/1.EcRepository.unit.test.js +961 -0
- package/src/test/1.EcRsaOaep.test.js +2 -12
- package/src/test/1.EcRsaOaepAsync.test.js +2 -12
- package/src/test/1.EcRsaOaepAsyncWorker.test.js +2 -12
- package/src/test/1.EcRsaOaepAsyncWorker.workers.test.js +147 -0
- package/src/test/1.FrameworkImport.test.js +170 -0
- package/src/test/1.MedbiqImport.test.js +92 -0
- package/src/test/1.OAuth2FileBasedRemoteIdentityManager.test.js +399 -0
- package/src/test/1.TabStructuredImport.test.js +61 -0
- package/src/test/1.polyfills.test.js +89 -0
- package/src/test/1.schema.competency.pinned.test.js +384 -0
- package/src/test/3.EcFrameworkGraph.test.js +3 -2
- package/src/test/4.schema.test.js +33 -28
- package/src/test/4.skyId.test.js +4 -2
- package/src/test/cypressValue.js +9 -0
- package/src/test/2.EcCompetency.test.js +0 -17
|
@@ -198,6 +198,22 @@ module.exports = class EcFrameworkGraph extends EcDirectedGraph {
|
|
|
198
198
|
if (success != null)
|
|
199
199
|
success();
|
|
200
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Adds assertions to the competency's meta state array named by key. When propagating (visited has more than
|
|
203
|
+
* one entry), assertions whose registration is already present in either meta state array are skipped.
|
|
204
|
+
* @private
|
|
205
|
+
*/
|
|
206
|
+
addAssertionsToMetaState(competency, assertions, visited, key) {
|
|
207
|
+
let msc = this.getMetaStateCompetency(competency);
|
|
208
|
+
let alreadyAsserted = (assertion) =>
|
|
209
|
+
msc?.positiveAssertion?.some(a => a.registration == assertion.registration) ||
|
|
210
|
+
msc?.negativeAssertion?.some(a => a.registration == assertion.registration);
|
|
211
|
+
for (let assertion of assertions) {
|
|
212
|
+
if (visited.length > 1 && assertion.registration && alreadyAsserted(assertion))
|
|
213
|
+
continue;
|
|
214
|
+
this.addToMetaStateArray(msc, key, assertion);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
201
217
|
async processAssertionsBooleanPerAssertion(
|
|
202
218
|
assertions,
|
|
203
219
|
negative,
|
|
@@ -209,18 +225,7 @@ module.exports = class EcFrameworkGraph extends EcDirectedGraph {
|
|
|
209
225
|
}
|
|
210
226
|
visited.push(competency);
|
|
211
227
|
if (negative) {
|
|
212
|
-
|
|
213
|
-
for (let assertion of assertions) {
|
|
214
|
-
if (visited.length > 1 && assertion.registration && msc?.positiveAssertion?.some(a => a.registration == assertion.registration))
|
|
215
|
-
continue;
|
|
216
|
-
if (visited.length > 1 && assertion.registration && msc?.negativeAssertion?.some(a => a.registration == assertion.registration))
|
|
217
|
-
continue;
|
|
218
|
-
this.addToMetaStateArray(
|
|
219
|
-
msc,
|
|
220
|
-
"negativeAssertion",
|
|
221
|
-
assertion
|
|
222
|
-
);
|
|
223
|
-
}
|
|
228
|
+
this.addAssertionsToMetaState(competency, assertions, visited, "negativeAssertion");
|
|
224
229
|
await Promise.all(
|
|
225
230
|
this.getOutEdges(competency).map(async (alignment) =>
|
|
226
231
|
await this.getCompetency(alignment.target).then(async (t) =>
|
|
@@ -249,18 +254,7 @@ module.exports = class EcFrameworkGraph extends EcDirectedGraph {
|
|
|
249
254
|
)
|
|
250
255
|
);
|
|
251
256
|
} else {
|
|
252
|
-
|
|
253
|
-
for (let assertion of assertions) {
|
|
254
|
-
if (visited.length > 1 && assertion.registration && msc?.positiveAssertion?.some(a => a.registration == assertion.registration))
|
|
255
|
-
continue;
|
|
256
|
-
if (visited.length > 1 && assertion.registration && msc?.negativeAssertion?.some(a => a.registration == assertion.registration))
|
|
257
|
-
continue;
|
|
258
|
-
this.addToMetaStateArray(
|
|
259
|
-
msc,
|
|
260
|
-
"positiveAssertion",
|
|
261
|
-
assertion
|
|
262
|
-
);
|
|
263
|
-
}
|
|
257
|
+
this.addAssertionsToMetaState(competency, assertions, visited, "positiveAssertion");
|
|
264
258
|
await Promise.all(
|
|
265
259
|
this.getInEdges(competency).map(async (alignment) =>
|
|
266
260
|
await this.getCompetency(alignment.source).then(async (t) =>
|
|
@@ -10,9 +10,7 @@ module.exports = {
|
|
|
10
10
|
return p;
|
|
11
11
|
},
|
|
12
12
|
cassReturnNullAsPromise: function (success, failure, error) {
|
|
13
|
-
let p =
|
|
14
|
-
resolve(null);
|
|
15
|
-
});
|
|
13
|
+
let p = Promise.resolve(null);
|
|
16
14
|
if (success !== undefined && success != null && failure !== undefined && failure != null)
|
|
17
15
|
p = p.then(success, failure);
|
|
18
16
|
else if (success !== undefined && success != null)
|
|
@@ -5,7 +5,7 @@ let DEBUG = false;
|
|
|
5
5
|
let isNode = false;
|
|
6
6
|
if (typeof process === 'object') {
|
|
7
7
|
if (typeof process.versions === 'object') {
|
|
8
|
-
if (
|
|
8
|
+
if (process.versions.node !== undefined) {
|
|
9
9
|
isNode = true;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -191,7 +191,7 @@ module.exports = class EcRemote {
|
|
|
191
191
|
|
|
192
192
|
const contentType = response.headers.get("content-type");
|
|
193
193
|
let result = null;
|
|
194
|
-
if (contentType
|
|
194
|
+
if (contentType?.includes("application/json")) {
|
|
195
195
|
result = await response.json();
|
|
196
196
|
} else {
|
|
197
197
|
result = await response.text();
|
|
@@ -210,7 +210,7 @@ module.exports = class EcRemote {
|
|
|
210
210
|
}
|
|
211
211
|
return result;
|
|
212
212
|
}).catch((err) => {
|
|
213
|
-
if (isNode &&
|
|
213
|
+
if (isNode && dns !== undefined) {
|
|
214
214
|
dns.lookup(new URL(url).hostname, ((error, address) => {
|
|
215
215
|
if (error) {
|
|
216
216
|
global.auditLogger.report(global.auditLogger.LogCategory.NETWORK, global.auditLogger.Severity.ERROR, "DNSLookup", url, error);
|
|
@@ -266,7 +266,7 @@ module.exports = class EcRemote {
|
|
|
266
266
|
|
|
267
267
|
const contentType = response.headers.get("content-type");
|
|
268
268
|
let result = null;
|
|
269
|
-
if (contentType
|
|
269
|
+
if (contentType?.includes("application/json")) {
|
|
270
270
|
result = await response.json();
|
|
271
271
|
} else {
|
|
272
272
|
result = await response.text();
|
|
@@ -283,7 +283,7 @@ module.exports = class EcRemote {
|
|
|
283
283
|
else
|
|
284
284
|
throw new Error(response.statusText);
|
|
285
285
|
}
|
|
286
|
-
if (isNode &&
|
|
286
|
+
if (isNode && dns !== undefined) {
|
|
287
287
|
dns.lookup(new URL(url).hostname, ((error, address) => {
|
|
288
288
|
if (error) {
|
|
289
289
|
global.auditLogger.report(global.auditLogger.LogCategory.NETWORK, global.auditLogger.Severity.ERROR, "DNSLookup", url, error);
|
|
@@ -297,7 +297,7 @@ module.exports = class EcRemote {
|
|
|
297
297
|
}
|
|
298
298
|
return result;
|
|
299
299
|
}).catch((err) => {
|
|
300
|
-
if (isNode &&
|
|
300
|
+
if (isNode && dns !== undefined) {
|
|
301
301
|
dns.lookup(new URL(url).hostname, ((error, address) => {
|
|
302
302
|
if (error) {
|
|
303
303
|
global.auditLogger.report(global.auditLogger.LogCategory.NETWORK, global.auditLogger.Severity.ERROR, "DNSLookup", url, error);
|
|
@@ -351,7 +351,7 @@ module.exports = class EcRemote {
|
|
|
351
351
|
}
|
|
352
352
|
const contentType = response.headers.get("content-type");
|
|
353
353
|
let result = null;
|
|
354
|
-
if (contentType
|
|
354
|
+
if (contentType?.includes("application/json")) {
|
|
355
355
|
result = await response.json();
|
|
356
356
|
} else {
|
|
357
357
|
result = await response.text();
|
|
@@ -364,7 +364,7 @@ module.exports = class EcRemote {
|
|
|
364
364
|
}
|
|
365
365
|
return result;
|
|
366
366
|
}).catch((err) => {
|
|
367
|
-
if (isNode &&
|
|
367
|
+
if (isNode && dns !== undefined) {
|
|
368
368
|
dns.lookup(new URL(url).hostname, ((error, address) => {
|
|
369
369
|
if (error) {
|
|
370
370
|
global.auditLogger.report(global.auditLogger.LogCategory.NETWORK, global.auditLogger.Severity.ERROR, "DNSLookup", url, signatureSheet, error);
|
|
@@ -383,7 +383,7 @@ module.exports = class EcRemote {
|
|
|
383
383
|
static upgradeHttpToHttps(url) {
|
|
384
384
|
if (typeof window !== "undefined")
|
|
385
385
|
if (window?.location != null) {
|
|
386
|
-
if (url.
|
|
386
|
+
if (!url.includes(window.location.protocol)) {
|
|
387
387
|
if (window.location.protocol.startsWith("https")) {
|
|
388
388
|
if (!url.startsWith("https:")) {
|
|
389
389
|
url = url.replace("http:", "https:");
|
|
@@ -90,38 +90,23 @@ module.exports = class EcAsyncTask {
|
|
|
90
90
|
return ret;
|
|
91
91
|
}
|
|
92
92
|
invoke0 = function() {
|
|
93
|
-
let
|
|
94
|
-
let ret = this.job.call(this, function() { //NOSONAR -- Not taking that chance.
|
|
95
|
-
that.setComplete();
|
|
96
|
-
});
|
|
93
|
+
let ret = this.job(() => this.setComplete());
|
|
97
94
|
return ret;
|
|
98
95
|
};
|
|
99
96
|
invoke1 = function(arg1) {
|
|
100
|
-
let
|
|
101
|
-
let ret = this.job.call(this, arg1, function () { //NOSONAR -- Not taking that chance.
|
|
102
|
-
that.setComplete();
|
|
103
|
-
});
|
|
97
|
+
let ret = this.job(arg1, () => this.setComplete());
|
|
104
98
|
return ret;
|
|
105
99
|
};
|
|
106
100
|
invoke2 = function(arg1, arg2) {
|
|
107
|
-
let
|
|
108
|
-
let ret = this.job.call(this, arg1, arg2, function () { //NOSONAR -- Not taking that chance.
|
|
109
|
-
that.setComplete();
|
|
110
|
-
});
|
|
101
|
+
let ret = this.job(arg1, arg2, () => this.setComplete());
|
|
111
102
|
return ret;
|
|
112
103
|
};
|
|
113
104
|
invoke3 = function(arg1, arg2, arg3) {
|
|
114
|
-
let
|
|
115
|
-
let ret = this.job.call(this, arg1, arg2, arg3, function () { //NOSONAR -- Not taking that chance.
|
|
116
|
-
that.setComplete();
|
|
117
|
-
});
|
|
105
|
+
let ret = this.job(arg1, arg2, arg3, () => this.setComplete());
|
|
118
106
|
return ret;
|
|
119
107
|
};
|
|
120
108
|
invoke4 = function(arg1, arg2, arg3, arg4) {
|
|
121
|
-
let
|
|
122
|
-
let ret = this.job.call(this, arg1, arg2, arg3, arg4, function() { //NOSONAR -- Not taking that chance.
|
|
123
|
-
that.setComplete();
|
|
124
|
-
});
|
|
109
|
+
let ret = this.job(arg1, arg2, arg3, arg4, () => this.setComplete());
|
|
125
110
|
return ret;
|
|
126
111
|
};
|
|
127
112
|
};
|
|
@@ -6,9 +6,8 @@ module.exports = class EcAsyncTaskManager {
|
|
|
6
6
|
for (let i = 0; i < workerCount; i++) {
|
|
7
7
|
this.workerList.push(new EcAsyncTaskWorker());
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
that.cleanupTasks();
|
|
9
|
+
setInterval(() => {
|
|
10
|
+
this.cleanupTasks();
|
|
12
11
|
}, this.taskCleanupInterval);
|
|
13
12
|
}
|
|
14
13
|
|
|
@@ -48,7 +47,7 @@ module.exports = class EcAsyncTaskManager {
|
|
|
48
47
|
let timeoutSec = task.getTimeout();
|
|
49
48
|
if (
|
|
50
49
|
task.getStart().getTime() <
|
|
51
|
-
|
|
50
|
+
Date.now() - timeoutSec * 1000
|
|
52
51
|
) {
|
|
53
52
|
task.setComplete();
|
|
54
53
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
module.exports = class EcAsyncTaskWorker {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.assignedList = [];
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
that.run();
|
|
4
|
+
this.intervalHandler = setInterval(() => {
|
|
5
|
+
this.run();
|
|
7
6
|
}, this.checkWorkInterval);
|
|
8
7
|
}
|
|
9
8
|
checkWorkInterval = 100;
|
|
@@ -42,19 +41,18 @@ module.exports = class EcAsyncTaskWorker {
|
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
run() {
|
|
45
|
-
|
|
46
|
-
this.taskHandler = Task.immediate(function() {
|
|
44
|
+
this.taskHandler = Task.immediate(() => {
|
|
47
45
|
if (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
!
|
|
46
|
+
this.currentTask != undefined &&
|
|
47
|
+
this.currentTask != null &&
|
|
48
|
+
!this.currentTask.getIsStarted()
|
|
51
49
|
) {
|
|
52
|
-
|
|
50
|
+
this.invoke();
|
|
53
51
|
}
|
|
54
52
|
if (
|
|
55
|
-
|
|
53
|
+
this.currentTask?.getIsComplete()
|
|
56
54
|
) {
|
|
57
|
-
|
|
55
|
+
this.currentTask = this.assignedList.shift();
|
|
58
56
|
}
|
|
59
57
|
});
|
|
60
58
|
}
|
|
@@ -86,53 +86,52 @@ module.exports = class CfdFramework extends EcFramework {
|
|
|
86
86
|
CfdFramework.toRemove[this.shortId()] = remove;
|
|
87
87
|
if (CfdFramework.removed == null) CfdFramework.removed = {};
|
|
88
88
|
CfdFramework.removed[this.shortId()] = 0;
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
EcRepository.DELETE(that, success, failure, repo, eim);
|
|
89
|
+
let onAllRemove = () => {
|
|
90
|
+
EcRepository.DELETE(this, success, failure, repo, eim);
|
|
92
91
|
};
|
|
93
92
|
if (remove == 0) onAllRemove();
|
|
94
93
|
if (this.competency != null && this.competency.length > 0) {
|
|
95
94
|
for (let comp of this.competency) {
|
|
96
95
|
CfdCompetency.get(
|
|
97
96
|
comp,
|
|
98
|
-
|
|
97
|
+
(comp) => {
|
|
99
98
|
comp._delete(
|
|
100
|
-
|
|
101
|
-
CfdFramework.removed[
|
|
102
|
-
CfdFramework.removed[
|
|
99
|
+
(p1) => {
|
|
100
|
+
CfdFramework.removed[this.shortId()] =
|
|
101
|
+
CfdFramework.removed[this.shortId()] + 1;
|
|
103
102
|
if (
|
|
104
|
-
CfdFramework.removed[
|
|
105
|
-
CfdFramework.toRemove[
|
|
103
|
+
CfdFramework.removed[this.shortId()] ==
|
|
104
|
+
CfdFramework.toRemove[this.shortId()]
|
|
106
105
|
)
|
|
107
106
|
onAllRemove();
|
|
108
107
|
},
|
|
109
|
-
|
|
108
|
+
(err) => {
|
|
110
109
|
let error =
|
|
111
110
|
"Error deleting competency (" +
|
|
112
111
|
comp.id +
|
|
113
112
|
"): " +
|
|
114
113
|
err;
|
|
115
114
|
failure(error);
|
|
116
|
-
CfdFramework.removed[
|
|
117
|
-
CfdFramework.removed[
|
|
115
|
+
CfdFramework.removed[this.shortId()] =
|
|
116
|
+
CfdFramework.removed[this.shortId()] + 1;
|
|
118
117
|
if (
|
|
119
|
-
CfdFramework.removed[
|
|
120
|
-
CfdFramework.toRemove[
|
|
118
|
+
CfdFramework.removed[this.shortId()] ==
|
|
119
|
+
CfdFramework.toRemove[this.shortId()]
|
|
121
120
|
)
|
|
122
121
|
onAllRemove();
|
|
123
122
|
},
|
|
124
123
|
repo, eim
|
|
125
124
|
);
|
|
126
125
|
},
|
|
127
|
-
|
|
126
|
+
(err) => {
|
|
128
127
|
let error =
|
|
129
128
|
"Error retrieving competency to delete: " + err;
|
|
130
129
|
failure(error);
|
|
131
|
-
CfdFramework.removed[
|
|
132
|
-
CfdFramework.removed[
|
|
130
|
+
CfdFramework.removed[this.shortId()] =
|
|
131
|
+
CfdFramework.removed[this.shortId()] + 1;
|
|
133
132
|
if (
|
|
134
|
-
CfdFramework.removed[
|
|
135
|
-
CfdFramework.toRemove[
|
|
133
|
+
CfdFramework.removed[this.shortId()] ==
|
|
134
|
+
CfdFramework.toRemove[this.shortId()]
|
|
136
135
|
)
|
|
137
136
|
onAllRemove();
|
|
138
137
|
}, repo, eim
|
|
@@ -143,43 +142,43 @@ module.exports = class CfdFramework extends EcFramework {
|
|
|
143
142
|
for (let rel of this.relation) {
|
|
144
143
|
EcAlignment.get(
|
|
145
144
|
rel,
|
|
146
|
-
|
|
145
|
+
(rel) => {
|
|
147
146
|
rel._delete(
|
|
148
|
-
|
|
149
|
-
CfdFramework.removed[
|
|
150
|
-
CfdFramework.removed[
|
|
147
|
+
(p1) => {
|
|
148
|
+
CfdFramework.removed[this.shortId()] =
|
|
149
|
+
CfdFramework.removed[this.shortId()] + 1;
|
|
151
150
|
if (
|
|
152
|
-
CfdFramework.removed[
|
|
153
|
-
CfdFramework.toRemove[
|
|
151
|
+
CfdFramework.removed[this.shortId()] ==
|
|
152
|
+
CfdFramework.toRemove[this.shortId()]
|
|
154
153
|
)
|
|
155
154
|
onAllRemove();
|
|
156
155
|
},
|
|
157
|
-
|
|
156
|
+
(err) => {
|
|
158
157
|
let error =
|
|
159
158
|
"Error deleting relation (" +
|
|
160
159
|
rel.id +
|
|
161
160
|
"): " +
|
|
162
161
|
err;
|
|
163
162
|
failure(error);
|
|
164
|
-
CfdFramework.removed[
|
|
165
|
-
CfdFramework.removed[
|
|
163
|
+
CfdFramework.removed[this.shortId()] =
|
|
164
|
+
CfdFramework.removed[this.shortId()] + 1;
|
|
166
165
|
if (
|
|
167
|
-
CfdFramework.removed[
|
|
168
|
-
CfdFramework.toRemove[
|
|
166
|
+
CfdFramework.removed[this.shortId()] ==
|
|
167
|
+
CfdFramework.toRemove[this.shortId()]
|
|
169
168
|
)
|
|
170
169
|
onAllRemove();
|
|
171
170
|
}, repo, eim
|
|
172
171
|
);
|
|
173
172
|
},
|
|
174
|
-
|
|
173
|
+
(err) => {
|
|
175
174
|
let error =
|
|
176
175
|
"Error retrieving relationship to delete: " + err;
|
|
177
176
|
failure(error);
|
|
178
|
-
CfdFramework.removed[
|
|
179
|
-
CfdFramework.removed[
|
|
177
|
+
CfdFramework.removed[this.shortId()] =
|
|
178
|
+
CfdFramework.removed[this.shortId()] + 1;
|
|
180
179
|
if (
|
|
181
|
-
CfdFramework.removed[
|
|
182
|
-
CfdFramework.toRemove[
|
|
180
|
+
CfdFramework.removed[this.shortId()] ==
|
|
181
|
+
CfdFramework.toRemove[this.shortId()]
|
|
183
182
|
)
|
|
184
183
|
onAllRemove();
|
|
185
184
|
}
|
|
@@ -187,8 +186,8 @@ module.exports = class CfdFramework extends EcFramework {
|
|
|
187
186
|
}
|
|
188
187
|
}
|
|
189
188
|
if (
|
|
190
|
-
CfdFramework.removed[
|
|
191
|
-
CfdFramework.toRemove[
|
|
189
|
+
CfdFramework.removed[this.shortId()] ==
|
|
190
|
+
CfdFramework.toRemove[this.shortId()]
|
|
192
191
|
)
|
|
193
192
|
onAllRemove();
|
|
194
193
|
};
|
|
@@ -60,9 +60,8 @@ module.exports = class EbacContact extends EcLinkedData {
|
|
|
60
60
|
upgrade() {
|
|
61
61
|
super.upgrade();
|
|
62
62
|
if (EbacContact.TYPE_0_1 == (this.type)) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
me["@context"] = me["@schema"];
|
|
63
|
+
if (this["@context"] == null && this["@schema"] != null)
|
|
64
|
+
this["@context"] = this["@schema"];
|
|
66
65
|
this.setContextAndType(Ebac.context_0_2, EbacContact.TYPE_0_2);
|
|
67
66
|
}
|
|
68
67
|
if (EbacContact.TYPE_0_2 == (this.getFullType())) {
|
|
@@ -73,11 +72,6 @@ module.exports = class EbacContact extends EcLinkedData {
|
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
getTypes() {
|
|
76
|
-
|
|
77
|
-
a.push(EbacContact.TYPE_0_4);
|
|
78
|
-
a.push(EbacContact.TYPE_0_3);
|
|
79
|
-
a.push(EbacContact.TYPE_0_2);
|
|
80
|
-
a.push(EbacContact.TYPE_0_1);
|
|
81
|
-
return a;
|
|
75
|
+
return [EbacContact.TYPE_0_4, EbacContact.TYPE_0_3, EbacContact.TYPE_0_2, EbacContact.TYPE_0_1];
|
|
82
76
|
}
|
|
83
77
|
};
|
|
@@ -55,9 +55,8 @@ module.exports = class EbacContactGrant extends EcRemoteLinkedData {
|
|
|
55
55
|
upgrade() {
|
|
56
56
|
super.upgrade();
|
|
57
57
|
if (EbacContactGrant.TYPE_0_1 == (this.type)) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
me["@context"] = me["@schema"];
|
|
58
|
+
if (this["@context"] == null && this["@schema"] != null)
|
|
59
|
+
this["@context"] = this["@schema"];
|
|
61
60
|
this.setContextAndType(Ebac.context_0_2, EbacContactGrant.TYPE_0_2);
|
|
62
61
|
}
|
|
63
62
|
if (EbacContactGrant.TYPE_0_2 == (this.getFullType())) {
|
|
@@ -68,11 +67,6 @@ module.exports = class EbacContactGrant extends EcRemoteLinkedData {
|
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
getTypes() {
|
|
71
|
-
|
|
72
|
-
a.push(EbacContactGrant.TYPE_0_4);
|
|
73
|
-
a.push(EbacContactGrant.TYPE_0_3);
|
|
74
|
-
a.push(EbacContactGrant.TYPE_0_2);
|
|
75
|
-
a.push(EbacContactGrant.TYPE_0_1);
|
|
76
|
-
return a;
|
|
70
|
+
return [EbacContactGrant.TYPE_0_4, EbacContactGrant.TYPE_0_3, EbacContactGrant.TYPE_0_2, EbacContactGrant.TYPE_0_1];
|
|
77
71
|
}
|
|
78
72
|
};
|
|
@@ -49,9 +49,8 @@ module.exports = class EbacCredential extends EcLinkedData {
|
|
|
49
49
|
upgrade() {
|
|
50
50
|
super.upgrade();
|
|
51
51
|
if (EbacCredential.TYPE_0_1 == (this.type)) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
me["@context"] = me["@schema"];
|
|
52
|
+
if (this["@context"] == null && this["@schema"] != null)
|
|
53
|
+
this["@context"] = this["@schema"];
|
|
55
54
|
this.setContextAndType(Ebac.context_0_2, EbacCredential.TYPE_0_2);
|
|
56
55
|
}
|
|
57
56
|
if (EbacCredential.TYPE_0_2 == (this.getFullType())) {
|
|
@@ -62,11 +61,6 @@ module.exports = class EbacCredential extends EcLinkedData {
|
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
getTypes() {
|
|
65
|
-
|
|
66
|
-
a.push(EbacCredential.TYPE_0_4);
|
|
67
|
-
a.push(EbacCredential.TYPE_0_3);
|
|
68
|
-
a.push(EbacCredential.TYPE_0_2);
|
|
69
|
-
a.push(EbacCredential.TYPE_0_1);
|
|
70
|
-
return a;
|
|
64
|
+
return [EbacCredential.TYPE_0_4, EbacCredential.TYPE_0_3, EbacCredential.TYPE_0_2, EbacCredential.TYPE_0_1];
|
|
71
65
|
}
|
|
72
66
|
};
|
|
@@ -50,9 +50,8 @@ module.exports = class EbacCredentialCommit extends EcLinkedData {
|
|
|
50
50
|
upgrade() {
|
|
51
51
|
super.upgrade();
|
|
52
52
|
if (EbacCredentialCommit.TYPE_0_1 == (this.type)) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
me["@context"] = me["@schema"];
|
|
53
|
+
if (this["@context"] == null && this["@schema"] != null)
|
|
54
|
+
this["@context"] = this["@schema"];
|
|
56
55
|
this.setContextAndType(
|
|
57
56
|
Ebac.context_0_2,
|
|
58
57
|
EbacCredentialCommit.TYPE_0_2
|
|
@@ -72,11 +71,6 @@ module.exports = class EbacCredentialCommit extends EcLinkedData {
|
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
getTypes() {
|
|
75
|
-
|
|
76
|
-
a.push(EbacCredentialCommit.TYPE_0_4);
|
|
77
|
-
a.push(EbacCredentialCommit.TYPE_0_3);
|
|
78
|
-
a.push(EbacCredentialCommit.TYPE_0_2);
|
|
79
|
-
a.push(EbacCredentialCommit.TYPE_0_1);
|
|
80
|
-
return a;
|
|
74
|
+
return [EbacCredentialCommit.TYPE_0_4, EbacCredentialCommit.TYPE_0_3, EbacCredentialCommit.TYPE_0_2, EbacCredentialCommit.TYPE_0_1];
|
|
81
75
|
}
|
|
82
76
|
};
|
|
@@ -35,9 +35,8 @@ module.exports = class EbacCredentialRequest extends EcLinkedData {
|
|
|
35
35
|
upgrade() {
|
|
36
36
|
super.upgrade();
|
|
37
37
|
if (EbacCredentialRequest.TYPE_0_1 == this.type) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
me["@context"] = me["@schema"];
|
|
38
|
+
if (this["@context"] == null && this["@schema"] != null)
|
|
39
|
+
this["@context"] = this["@schema"];
|
|
41
40
|
this.setContextAndType(
|
|
42
41
|
Ebac.context_0_2,
|
|
43
42
|
EbacCredentialRequest.TYPE_0_2
|
|
@@ -57,11 +56,6 @@ module.exports = class EbacCredentialRequest extends EcLinkedData {
|
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
getTypes() {
|
|
60
|
-
|
|
61
|
-
a.push(EbacCredentialRequest.TYPE_0_4);
|
|
62
|
-
a.push(EbacCredentialRequest.TYPE_0_3);
|
|
63
|
-
a.push(EbacCredentialRequest.TYPE_0_2);
|
|
64
|
-
a.push(EbacCredentialRequest.TYPE_0_1);
|
|
65
|
-
return a;
|
|
59
|
+
return [EbacCredentialRequest.TYPE_0_4, EbacCredentialRequest.TYPE_0_3, EbacCredentialRequest.TYPE_0_2, EbacCredentialRequest.TYPE_0_1];
|
|
66
60
|
}
|
|
67
61
|
};
|
|
@@ -48,9 +48,8 @@ module.exports = class EbacCredentials extends EcLinkedData {
|
|
|
48
48
|
upgrade() {
|
|
49
49
|
super.upgrade();
|
|
50
50
|
if (EbacCredentials.TYPE_0_1 == (this.type)) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
me["@context"] = me["@schema"];
|
|
51
|
+
if (this["@context"] == null && this["@schema"] != null)
|
|
52
|
+
this["@context"] = this["@schema"];
|
|
54
53
|
this.setContextAndType(Ebac.context_0_2, EbacCredentials.TYPE_0_2);
|
|
55
54
|
}
|
|
56
55
|
if (EbacCredentials.TYPE_0_2 == (this.getFullType())) {
|
|
@@ -61,11 +60,6 @@ module.exports = class EbacCredentials extends EcLinkedData {
|
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
62
|
getTypes() {
|
|
64
|
-
|
|
65
|
-
a.push(EbacCredentials.TYPE_0_4);
|
|
66
|
-
a.push(EbacCredentials.TYPE_0_3);
|
|
67
|
-
a.push(EbacCredentials.TYPE_0_2);
|
|
68
|
-
a.push(EbacCredentials.TYPE_0_1);
|
|
69
|
-
return a;
|
|
63
|
+
return [EbacCredentials.TYPE_0_4, EbacCredentials.TYPE_0_3, EbacCredentials.TYPE_0_2, EbacCredentials.TYPE_0_1];
|
|
70
64
|
}
|
|
71
65
|
};
|
|
@@ -87,9 +87,8 @@ module.exports = class EbacEncryptedSecret extends EcLinkedData {
|
|
|
87
87
|
upgrade() {
|
|
88
88
|
super.upgrade();
|
|
89
89
|
if (EbacEncryptedSecret.TYPE_0_1 == this.type) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
me["@context"] = me["@schema"];
|
|
90
|
+
if (this["@context"] == null && this["@schema"] != null)
|
|
91
|
+
this["@context"] = this["@schema"];
|
|
93
92
|
this.setContextAndType(
|
|
94
93
|
Ebac.context_0_2,
|
|
95
94
|
EbacEncryptedSecret.TYPE_0_2
|
|
@@ -109,11 +108,6 @@ module.exports = class EbacEncryptedSecret extends EcLinkedData {
|
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
getTypes() {
|
|
112
|
-
|
|
113
|
-
a.push(EbacEncryptedSecret.TYPE_0_4);
|
|
114
|
-
a.push(EbacEncryptedSecret.TYPE_0_3);
|
|
115
|
-
a.push(EbacEncryptedSecret.TYPE_0_2);
|
|
116
|
-
a.push(EbacEncryptedSecret.TYPE_0_1);
|
|
117
|
-
return a;
|
|
111
|
+
return [EbacEncryptedSecret.TYPE_0_4, EbacEncryptedSecret.TYPE_0_3, EbacEncryptedSecret.TYPE_0_2, EbacEncryptedSecret.TYPE_0_1];
|
|
118
112
|
}
|
|
119
113
|
};
|
|
@@ -65,11 +65,10 @@ module.exports = class EbacEncryptedValue extends EcRemoteLinkedData {
|
|
|
65
65
|
*/
|
|
66
66
|
iv = null;
|
|
67
67
|
copyFrom(that) {
|
|
68
|
-
let
|
|
69
|
-
for (let key in me) delete me[key];
|
|
68
|
+
for (let key in this) delete this[key];
|
|
70
69
|
let you = that;
|
|
71
70
|
for (let key in you) {
|
|
72
|
-
if (
|
|
71
|
+
if (this[key] == null) this[key.replace("@", "")] = you[key];
|
|
73
72
|
}
|
|
74
73
|
if (!this.isAny(this.getTypes()))
|
|
75
74
|
throw new Error("Incompatible type: " + this.getFullType());
|
|
@@ -77,9 +76,8 @@ module.exports = class EbacEncryptedValue extends EcRemoteLinkedData {
|
|
|
77
76
|
upgrade() {
|
|
78
77
|
super.upgrade();
|
|
79
78
|
if (EbacEncryptedValue.TYPE_0_1 == this.type) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
me["@context"] = me["@schema"];
|
|
79
|
+
if (this["@context"] == null && this["@schema"] != null)
|
|
80
|
+
this["@context"] = this["@schema"];
|
|
83
81
|
this.setContextAndType(
|
|
84
82
|
Ebac.context_0_2,
|
|
85
83
|
EbacEncryptedValue.TYPE_0_2
|
|
@@ -99,11 +97,6 @@ module.exports = class EbacEncryptedValue extends EcRemoteLinkedData {
|
|
|
99
97
|
}
|
|
100
98
|
}
|
|
101
99
|
getTypes() {
|
|
102
|
-
|
|
103
|
-
a.push(EbacEncryptedValue.TYPE_0_4);
|
|
104
|
-
a.push(EbacEncryptedValue.TYPE_0_3);
|
|
105
|
-
a.push(EbacEncryptedValue.TYPE_0_2);
|
|
106
|
-
a.push(EbacEncryptedValue.TYPE_0_1);
|
|
107
|
-
return a;
|
|
100
|
+
return [EbacEncryptedValue.TYPE_0_4, EbacEncryptedValue.TYPE_0_3, EbacEncryptedValue.TYPE_0_2, EbacEncryptedValue.TYPE_0_1];
|
|
108
101
|
}
|
|
109
102
|
};
|
|
@@ -57,11 +57,6 @@ module.exports = class EbacSignature extends EcLinkedData {
|
|
|
57
57
|
super.upgrade();
|
|
58
58
|
}
|
|
59
59
|
getTypes() {
|
|
60
|
-
|
|
61
|
-
a.push(EbacSignature.TYPE_0_4);
|
|
62
|
-
a.push(EbacSignature.TYPE_0_3);
|
|
63
|
-
a.push(EbacSignature.TYPE_0_2);
|
|
64
|
-
a.push(EbacSignature.TYPE_0_1);
|
|
65
|
-
return a;
|
|
60
|
+
return [EbacSignature.TYPE_0_4, EbacSignature.TYPE_0_3, EbacSignature.TYPE_0_2, EbacSignature.TYPE_0_1];
|
|
66
61
|
}
|
|
67
62
|
};
|
package/src/index/env.js
CHANGED
|
@@ -6,13 +6,16 @@ if (typeof window !== "undefined" && window) {
|
|
|
6
6
|
global.generateUUID = function () {
|
|
7
7
|
var d = new Date().getTime(); //Timestamp
|
|
8
8
|
var d2 = ((typeof performance !== 'undefined') && performance.now && (performance.now() * 1000)) || 0;//Time in microseconds since page-load or 0 if unsupported
|
|
9
|
+
var random = new Uint8Array(32);//One random byte per hex digit
|
|
10
|
+
global.crypto.getRandomValues(random);//Set below; the browser's own crypto in a page
|
|
11
|
+
var i = 0;
|
|
9
12
|
return 'xxxxxxxx-c455-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
10
|
-
var r =
|
|
13
|
+
var r = random[i++] % 16;//random number between 0 and 15
|
|
11
14
|
if (d > 0) {//Use timestamp until depleted
|
|
12
|
-
r = (d + r) % 16
|
|
15
|
+
r = Math.trunc((d + r) % 16);
|
|
13
16
|
d = Math.floor(d / 16);
|
|
14
17
|
} else {//Use microseconds since page-load if supported
|
|
15
|
-
r = (d2 + r) % 16
|
|
18
|
+
r = Math.trunc((d2 + r) % 16);
|
|
16
19
|
d2 = Math.floor(d2 / 16);
|
|
17
20
|
}
|
|
18
21
|
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|