@izara_project/izara-core-library-asynchronous-flow 1.0.32 → 1.0.33
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.33",
|
|
7
7
|
"description": "Shared asynchronous flow logic",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "index.js",
|
|
@@ -21,7 +21,14 @@
|
|
|
21
21
|
"testEnvironment": "node"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"jest": "^30.4.2"
|
|
24
|
+
"jest": "^30.4.2",
|
|
25
|
+
"@izara_project/izara-core-library-core": "^1.0.32",
|
|
26
|
+
"@izara_project/izara-core-library-dynamodb": "^1.0.19",
|
|
27
|
+
"@izara_project/izara-core-library-external-request": "^1.0.30",
|
|
28
|
+
"@izara_project/izara-core-library-logger": "^1.0.9",
|
|
29
|
+
"@izara_project/izara-core-library-sqs": "^1.0.7",
|
|
30
|
+
"@izara_project/izara-core-library-sns": "^1.0.8",
|
|
31
|
+
"@izara_project/izara-shared-core": "^1.0.12"
|
|
25
32
|
},
|
|
26
33
|
"peerDependencies": {
|
|
27
34
|
"@izara_project/izara-core-library-core": "^1.0.32",
|
|
@@ -93,7 +93,7 @@ export function createPendingStepId(identifierId, prefix = '') {
|
|
|
93
93
|
* @returns {string} The parent Flow Id created.
|
|
94
94
|
*/
|
|
95
95
|
export function createParentFlowId(prefix = '') {
|
|
96
|
-
return (prefix ? `${prefix}_` : '') + identifierUuid
|
|
96
|
+
return (prefix ? `${prefix}_` : '') + identifierUuid();
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
|
@@ -638,6 +638,7 @@ export async function removeAwaitingMultipleStep(
|
|
|
638
638
|
export async function createAwaitingMultipleStepsWithAdditionalAttributesAndPublish(
|
|
639
639
|
_izContext,
|
|
640
640
|
messages,
|
|
641
|
+
prefix = '',
|
|
641
642
|
flowType = {},
|
|
642
643
|
additionalAttributes = {},
|
|
643
644
|
pendingStepId
|
|
@@ -649,19 +650,32 @@ export async function createAwaitingMultipleStepsWithAdditionalAttributesAndPubl
|
|
|
649
650
|
const flowTag = flowType.flowTag;
|
|
650
651
|
const serviceTag = flowType.serviceTag;
|
|
651
652
|
|
|
653
|
+
_izContext.logger.debug(
|
|
654
|
+
'[lib:asyncFlow:createAwaitingMultipleStepsWithAdditionalAttributesAndPublish] flowType',
|
|
655
|
+
{
|
|
656
|
+
flowTag,
|
|
657
|
+
serviceTag
|
|
658
|
+
}
|
|
659
|
+
);
|
|
660
|
+
|
|
652
661
|
if (flowTag === undefined || serviceTag === undefined) {
|
|
653
662
|
throw new Error('flowType must have both flowTag and serviceTag');
|
|
654
663
|
}
|
|
655
664
|
|
|
656
665
|
_izContext.logger.debug(
|
|
657
|
-
'Lib:createAwaitingMultipleStepsWithAdditionalAttributesAndPublish',
|
|
666
|
+
'Lib:asyncFlow:createAwaitingMultipleStepsWithAdditionalAttributesAndPublish',
|
|
658
667
|
{ count: messages.length, pendingStepId, flowType }
|
|
659
668
|
);
|
|
660
669
|
|
|
661
|
-
const topicArn = snsSharedLib.
|
|
670
|
+
const topicArn = snsSharedLib.snsTopicArnByFlowSchema(
|
|
662
671
|
_izContext,
|
|
663
672
|
flowType.flowTag,
|
|
664
|
-
flowType.serviceTag
|
|
673
|
+
flowType.serviceTag
|
|
674
|
+
);
|
|
675
|
+
|
|
676
|
+
_izContext.logger.debug(
|
|
677
|
+
'Lib:asyncFlow:createAwaitingMultipleStepsWithAdditionalAttributesAndPublish',
|
|
678
|
+
{ topicArn }
|
|
665
679
|
);
|
|
666
680
|
|
|
667
681
|
const messagesWithParentId = await Promise.all(
|
|
@@ -669,7 +683,7 @@ export async function createAwaitingMultipleStepsWithAdditionalAttributesAndPubl
|
|
|
669
683
|
const parentFlowId = await createNewAwaitingMultipleStep(
|
|
670
684
|
_izContext,
|
|
671
685
|
pendingStepId,
|
|
672
|
-
|
|
686
|
+
prefix,
|
|
673
687
|
additionalAttributes
|
|
674
688
|
);
|
|
675
689
|
return {
|
|
@@ -682,7 +696,7 @@ export async function createAwaitingMultipleStepsWithAdditionalAttributesAndPubl
|
|
|
682
696
|
await Promise.all(
|
|
683
697
|
messagesWithParentId.map(message =>
|
|
684
698
|
sns.publishAsync(_izContext, {
|
|
685
|
-
TopicArn: topicArn
|
|
699
|
+
TopicArn: `${topicArn}_In`,
|
|
686
700
|
Message: JSON.stringify(message),
|
|
687
701
|
MessageAttributes: {}
|
|
688
702
|
})
|