@izara_project/izara-core-library-asynchronous-flow 1.0.43 → 1.0.44
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
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "Sven Mason <thebarbariansven@gmail.com>",
|
|
4
4
|
"license": "AGPL-3.0-or-later",
|
|
5
5
|
"homepage": "https://bitbucket.org/izara-core-libraries/izara-core-library-asynchronous-flow#readme",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.44",
|
|
7
7
|
"description": "Shared asynchronous flow logic",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "index.js",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@izara_project/izara-core-library-core": "^1.0.32",
|
|
19
|
-
"@izara_project/izara-core-library-dynamodb": "^1.0.
|
|
19
|
+
"@izara_project/izara-core-library-dynamodb": "^1.0.21",
|
|
20
20
|
"@izara_project/izara-core-library-external-request": "^1.0.30",
|
|
21
|
-
"@izara_project/izara-core-library-logger": "^1.0.
|
|
21
|
+
"@izara_project/izara-core-library-logger": "^1.0.11",
|
|
22
22
|
"@izara_project/izara-core-library-sns": "^1.0.8",
|
|
23
23
|
"@izara_project/izara-core-library-sqs": "^1.0.7",
|
|
24
24
|
"@izara_project/izara-shared-core": "^1.0.13"
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@izara_project/izara-core-library-logger": "^1.0.9",
|
|
31
31
|
"@izara_project/izara-core-library-sns": "^1.0.8",
|
|
32
32
|
"@izara_project/izara-core-library-sqs": "^1.0.7",
|
|
33
|
-
"@izara_project/izara-shared-core": "^1.0.12"
|
|
33
|
+
"@izara_project/izara-shared-core": "^1.0.12",
|
|
34
|
+
"ws": "^8.16.0"
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -132,7 +132,7 @@ function explodePendingStepId(pendingStepId, prefix = '') {
|
|
|
132
132
|
return pendingStepId;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
const identifierId = pendingStepId.slice(prefix.length);
|
|
135
|
+
const identifierId = pendingStepId.slice(prefix.length + 1);
|
|
136
136
|
if (identifierId === prefix) {
|
|
137
137
|
throw new NoRetryError('IdentifierId should not be like prefix.');
|
|
138
138
|
}
|
|
@@ -307,7 +307,7 @@ async function checkTimeCacheComplete(
|
|
|
307
307
|
if (!fullMainTableName || !keyValues || !timeCacheComplete || !prefix) {
|
|
308
308
|
throw new NoRetryError(
|
|
309
309
|
'fullMainTableName, keyValues, timeCacheComplete' +
|
|
310
|
-
|
|
310
|
+
' and prefix are required'
|
|
311
311
|
);
|
|
312
312
|
}
|
|
313
313
|
|
|
@@ -464,7 +464,7 @@ function validateStartKeyParam(
|
|
|
464
464
|
) {
|
|
465
465
|
throw new NoRetryError(
|
|
466
466
|
'validateStartKeyParam:' +
|
|
467
|
-
|
|
467
|
+
' Invalid partitionKeyFieldName or sortKeyFieldName'
|
|
468
468
|
);
|
|
469
469
|
}
|
|
470
470
|
|
|
@@ -472,7 +472,7 @@ function validateStartKeyParam(
|
|
|
472
472
|
if (!startKey[partitionKeyFieldName] || !startKey[sortKeyFieldName]) {
|
|
473
473
|
throw new NoRetryError(
|
|
474
474
|
'validateStartKeyParam: Invalid startKey,' +
|
|
475
|
-
|
|
475
|
+
' missing partitionKeyFieldName or sortKeyFieldName'
|
|
476
476
|
);
|
|
477
477
|
}
|
|
478
478
|
return startKey;
|
|
@@ -21,7 +21,8 @@ import snsSharedLib from '@izara_project/izara-core-library-sns';
|
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
23
|
createParentFlowId,
|
|
24
|
-
createPendingStepId
|
|
24
|
+
createPendingStepId,
|
|
25
|
+
createAwaitingStepId
|
|
25
26
|
} from './asyncFlowSharedLib.js';
|
|
26
27
|
|
|
27
28
|
function _assertPendingStepId(pendingStepId) {
|
|
@@ -162,7 +163,9 @@ export async function createAwaitingMultipleSteps(
|
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
const awaitingStepId =
|
|
165
|
-
record.awaitingStepId
|
|
166
|
+
createAwaitingStepId(record.awaitingStepId, prefix) ||
|
|
167
|
+
createParentFlowId(prefix);
|
|
168
|
+
|
|
166
169
|
return {
|
|
167
170
|
awaitingStepId,
|
|
168
171
|
additionalAttributes,
|
|
@@ -349,7 +352,7 @@ export async function findAwaitingMultipleStepByPending(
|
|
|
349
352
|
export async function checkAllAwaitingStepsFinishedWithReturnParams(
|
|
350
353
|
_izContext,
|
|
351
354
|
pendingStepId,
|
|
352
|
-
currentAwaitingStepId
|
|
355
|
+
currentAwaitingStepId,
|
|
353
356
|
errorsFound = [],
|
|
354
357
|
returnValues = {},
|
|
355
358
|
settings = { checkIsAllError: false }
|
|
@@ -520,7 +523,7 @@ export async function removeAwaitingMultipleStep(
|
|
|
520
523
|
if (!awaitingStepId || !pendingStepId) {
|
|
521
524
|
throw new NoRetryError(
|
|
522
525
|
'[Lib:removeAwaitingMultipleStep]' +
|
|
523
|
-
|
|
526
|
+
' awaitingStepId or pendingStepId required'
|
|
524
527
|
);
|
|
525
528
|
}
|
|
526
529
|
|