@izara_project/izara-core-library-asynchronous-flow 1.0.37 → 1.0.38
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 +9 -8
- package/src/awaitingMultipleSteps.js +11 -5
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.38",
|
|
7
7
|
"description": "Shared asynchronous flow logic",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "index.js",
|
|
@@ -21,24 +21,25 @@
|
|
|
21
21
|
"testEnvironment": "node"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"
|
|
24
|
+
"@aws-sdk/client-s3": "^3.1077.0",
|
|
25
25
|
"@izara_project/izara-core-library-core": "^1.0.32",
|
|
26
|
-
"@izara_project/izara-core-library-dynamodb": "^1.0.
|
|
26
|
+
"@izara_project/izara-core-library-dynamodb": "^1.0.20",
|
|
27
27
|
"@izara_project/izara-core-library-external-request": "^1.0.30",
|
|
28
28
|
"@izara_project/izara-core-library-logger": "^1.0.9",
|
|
29
|
-
"@izara_project/izara-core-library-sqs": "^1.0.7",
|
|
30
29
|
"@izara_project/izara-core-library-sns": "^1.0.8",
|
|
31
|
-
"@izara_project/izara-
|
|
30
|
+
"@izara_project/izara-core-library-sqs": "^1.0.7",
|
|
31
|
+
"@izara_project/izara-shared-core": "^1.0.13",
|
|
32
|
+
"jest": "^30.4.2",
|
|
33
|
+
"ws": "^8.21.0"
|
|
32
34
|
},
|
|
33
35
|
"peerDependencies": {
|
|
34
36
|
"@izara_project/izara-core-library-core": "^1.0.32",
|
|
35
37
|
"@izara_project/izara-core-library-dynamodb": "^1.0.19",
|
|
36
38
|
"@izara_project/izara-core-library-external-request": "^1.0.30",
|
|
37
39
|
"@izara_project/izara-core-library-logger": "^1.0.9",
|
|
38
|
-
"@izara_project/izara-core-library-sqs": "^1.0.7",
|
|
39
40
|
"@izara_project/izara-core-library-sns": "^1.0.8",
|
|
41
|
+
"@izara_project/izara-core-library-sqs": "^1.0.7",
|
|
40
42
|
"@izara_project/izara-shared-core": "^1.0.12"
|
|
41
43
|
},
|
|
42
|
-
"peerDependenciesMeta": {}
|
|
43
|
-
"dependencies": {}
|
|
44
|
+
"peerDependenciesMeta": {}
|
|
44
45
|
}
|
|
@@ -95,10 +95,10 @@ async function _queryAwaitingStepsByPendingStepId(_izContext, pendingStepId) {
|
|
|
95
95
|
export async function createAwaitingMultipleSteps(
|
|
96
96
|
_izContext,
|
|
97
97
|
pendingStepId,
|
|
98
|
+
records = [],
|
|
98
99
|
options = {}
|
|
99
100
|
) {
|
|
100
101
|
const {
|
|
101
|
-
records = [],
|
|
102
102
|
prefix = '',
|
|
103
103
|
additionalAttributes = {},
|
|
104
104
|
publishConfig = null
|
|
@@ -109,6 +109,12 @@ export async function createAwaitingMultipleSteps(
|
|
|
109
109
|
options
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
+
const formattedPrefix = prefix ? (prefix.endsWith('_') ? prefix : `${prefix}_`) : '';
|
|
113
|
+
const finalPendingStepId =
|
|
114
|
+
formattedPrefix && !pendingStepId.startsWith(formattedPrefix)
|
|
115
|
+
? formattedPrefix + pendingStepId
|
|
116
|
+
: pendingStepId;
|
|
117
|
+
|
|
112
118
|
let finalRecords = records;
|
|
113
119
|
|
|
114
120
|
if (finalRecords.length === 0 && !publishConfig) {
|
|
@@ -152,7 +158,7 @@ export async function createAwaitingMultipleSteps(
|
|
|
152
158
|
awaitingStepId,
|
|
153
159
|
additionalAttributes: itemAttrs
|
|
154
160
|
})),
|
|
155
|
-
|
|
161
|
+
finalPendingStepId,
|
|
156
162
|
{
|
|
157
163
|
complete: false,
|
|
158
164
|
errorsFound: []
|
|
@@ -185,7 +191,7 @@ export async function createAwaitingMultipleStepsWithAdditionalAttributes(
|
|
|
185
191
|
records,
|
|
186
192
|
pendingStepId
|
|
187
193
|
) {
|
|
188
|
-
return createAwaitingMultipleSteps(_izContext, pendingStepId,
|
|
194
|
+
return createAwaitingMultipleSteps(_izContext, pendingStepId, records);
|
|
189
195
|
}
|
|
190
196
|
|
|
191
197
|
export async function createAwaitingMultipleStep(
|
|
@@ -194,7 +200,7 @@ export async function createAwaitingMultipleStep(
|
|
|
194
200
|
prefix = '',
|
|
195
201
|
additionalAttributes = {}
|
|
196
202
|
) {
|
|
197
|
-
return createAwaitingMultipleSteps(_izContext, pendingStepId, {
|
|
203
|
+
return createAwaitingMultipleSteps(_izContext, pendingStepId, [], {
|
|
198
204
|
prefix,
|
|
199
205
|
additionalAttributes
|
|
200
206
|
});
|
|
@@ -208,7 +214,7 @@ export async function createAwaitingMultipleStepsWithAdditionalAttributesAndPubl
|
|
|
208
214
|
additionalAttributes = {},
|
|
209
215
|
pendingStepId
|
|
210
216
|
) {
|
|
211
|
-
return createAwaitingMultipleSteps(_izContext, pendingStepId, {
|
|
217
|
+
return createAwaitingMultipleSteps(_izContext, pendingStepId, [], {
|
|
212
218
|
prefix,
|
|
213
219
|
additionalAttributes,
|
|
214
220
|
publishConfig: {
|