@cumulus/message 9.4.0 → 9.8.0
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/AsyncOperations.d.ts.map +1 -1
- package/AsyncOperations.js +2 -1
- package/AsyncOperations.js.map +1 -1
- package/Build.d.ts.map +1 -1
- package/Build.js +8 -6
- package/Build.js.map +1 -1
- package/Collections.d.ts.map +1 -1
- package/Collections.js +24 -10
- package/Collections.js.map +1 -1
- package/Executions.d.ts.map +1 -1
- package/Executions.js +25 -15
- package/Executions.js.map +1 -1
- package/Granules.d.ts.map +1 -1
- package/Granules.js +8 -4
- package/Granules.js.map +1 -1
- package/PDRs.js +23 -13
- package/PDRs.js.map +1 -1
- package/Providers.js +4 -2
- package/Providers.js.map +1 -1
- package/Queue.d.ts.map +1 -1
- package/Queue.js +10 -7
- package/Queue.js.map +1 -1
- package/README.md +77 -77
- package/StepFunctions.d.ts.map +1 -1
- package/StepFunctions.js +7 -5
- package/StepFunctions.js.map +1 -1
- package/package.json +7 -7
- package/src/Collections.ts +14 -5
- package/tsconfig.tsbuildinfo +1 -0
- package/workflows.d.ts.map +1 -1
- package/workflows.js +12 -6
- package/workflows.js.map +1 -1
package/AsyncOperations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncOperations.d.ts","sourceRoot":"","sources":["src/AsyncOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,YAC5B,
|
|
1
|
+
{"version":3,"file":"AsyncOperations.d.ts","sourceRoot":"","sources":["src/AsyncOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,YAC5B,QAAQ,cAAc,KAC9B,MAAM,GAAG,SAAmD,CAAC"}
|
package/AsyncOperations.js
CHANGED
|
@@ -9,5 +9,6 @@ exports.getMessageAsyncOperationId = void 0;
|
|
|
9
9
|
*
|
|
10
10
|
* @alias module:AsyncOperations
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
const getMessageAsyncOperationId = (message) => { var _a; return (_a = message.cumulus_meta) === null || _a === void 0 ? void 0 : _a.asyncOperationId; };
|
|
13
|
+
exports.getMessageAsyncOperationId = getMessageAsyncOperationId;
|
|
13
14
|
//# sourceMappingURL=AsyncOperations.js.map
|
package/AsyncOperations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncOperations.js","sourceRoot":"","sources":["src/AsyncOperations.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"AsyncOperations.js","sourceRoot":"","sources":["src/AsyncOperations.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACI,MAAM,0BAA0B,GAAG,CACxC,OAA+B,EACX,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,YAAY,0CAAE,gBAAgB,CAAA,EAAA,CAAC;AAFnD,QAAA,0BAA0B,8BAEyB"}
|
package/Build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Build.d.ts","sourceRoot":"","sources":["src/Build.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC,OAAO,EACL,uBAAuB,EACvB,kCAAkC,EAClC,QAAQ,EACT,MAAM,SAAS,CAAC;AAYjB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB;kBAOb,MAAM;;;yBAGC,kCAAkC;;MAErD,
|
|
1
|
+
{"version":3,"file":"Build.d.ts","sourceRoot":"","sources":["src/Build.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC,OAAO,EACL,uBAAuB,EACvB,kCAAkC,EAClC,QAAQ,EACT,MAAM,SAAS,CAAC;AAYjB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB;kBAOb,MAAM;;;yBAGC,kCAAkC;;MAErD,QAAQ,WASX,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,6BAA6B;wBAUpB,MAAM;qBACT,uBAAuB;aAC/B,MAAM;cACL,QAAQ;;;;;MAKhB,QAAQ,cAmBX,CAAC"}
|
package/Build.js
CHANGED
|
@@ -21,7 +21,7 @@ const uuid_1 = require("uuid");
|
|
|
21
21
|
* @returns {string}
|
|
22
22
|
* @private
|
|
23
23
|
*/
|
|
24
|
-
const createExecutionName = (prefix) => (prefix ? `${prefix}-${uuid_1.v4()}` : uuid_1.v4());
|
|
24
|
+
const createExecutionName = (prefix) => (prefix ? `${prefix}-${(0, uuid_1.v4)()}` : (0, uuid_1.v4)());
|
|
25
25
|
/**
|
|
26
26
|
* Build base message.cumulus_meta for a queued execution.
|
|
27
27
|
*
|
|
@@ -35,7 +35,7 @@ const createExecutionName = (prefix) => (prefix ? `${prefix}-${uuid_1.v4()}` : u
|
|
|
35
35
|
*
|
|
36
36
|
* @private
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
const buildCumulusMeta = ({ stateMachine, asyncOperationId, parentExecutionArn, templateCumulusMeta, executionNamePrefix, }) => {
|
|
39
39
|
const cumulusMeta = {
|
|
40
40
|
...templateCumulusMeta,
|
|
41
41
|
execution_name: createExecutionName(executionNamePrefix),
|
|
@@ -47,6 +47,7 @@ exports.buildCumulusMeta = ({ stateMachine, asyncOperationId, parentExecutionArn
|
|
|
47
47
|
cumulusMeta.asyncOperationId = asyncOperationId;
|
|
48
48
|
return cumulusMeta;
|
|
49
49
|
};
|
|
50
|
+
exports.buildCumulusMeta = buildCumulusMeta;
|
|
50
51
|
/**
|
|
51
52
|
* Build an SQS message from a workflow template for queueing executions.
|
|
52
53
|
*
|
|
@@ -67,8 +68,8 @@ exports.buildCumulusMeta = ({ stateMachine, asyncOperationId, parentExecutionArn
|
|
|
67
68
|
*
|
|
68
69
|
* @alias module:Build
|
|
69
70
|
*/
|
|
70
|
-
|
|
71
|
-
const cumulusMeta = exports.buildCumulusMeta({
|
|
71
|
+
const buildQueueMessageFromTemplate = ({ parentExecutionArn, asyncOperationId, messageTemplate, payload, workflow, customCumulusMeta = {}, customMeta = {}, executionNamePrefix, }) => {
|
|
72
|
+
const cumulusMeta = (0, exports.buildCumulusMeta)({
|
|
72
73
|
asyncOperationId,
|
|
73
74
|
parentExecutionArn,
|
|
74
75
|
stateMachine: workflow.arn,
|
|
@@ -77,12 +78,13 @@ exports.buildQueueMessageFromTemplate = ({ parentExecutionArn, asyncOperationId,
|
|
|
77
78
|
});
|
|
78
79
|
const message = {
|
|
79
80
|
...messageTemplate,
|
|
80
|
-
meta: merge_1.default(messageTemplate.meta, customMeta, {
|
|
81
|
+
meta: (0, merge_1.default)(messageTemplate.meta, customMeta, {
|
|
81
82
|
workflow_name: workflow.name,
|
|
82
83
|
}),
|
|
83
|
-
cumulus_meta: merge_1.default(customCumulusMeta, cumulusMeta),
|
|
84
|
+
cumulus_meta: (0, merge_1.default)(customCumulusMeta, cumulusMeta),
|
|
84
85
|
payload,
|
|
85
86
|
};
|
|
86
87
|
return message;
|
|
87
88
|
};
|
|
89
|
+
exports.buildQueueMessageFromTemplate = buildQueueMessageFromTemplate;
|
|
88
90
|
//# sourceMappingURL=Build.js.map
|
package/Build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Build.js","sourceRoot":"","sources":["src/Build.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AAEb;;;;;;;GAOG;AAEH,yDAAiC;AAEjC,+BAAoC;AAQpC;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,CAAC,MAAe,EAAU,EAAE,CACtD,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,SAAM,
|
|
1
|
+
{"version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ACd,GAAG,eAAe;QAClB,IAAI,EAAE,IAAA,eAAK,EAAC,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE;YAC5C,aAAa,EAAE,QAAQ,CAAC,IAAI;SAC7B,CAAC;QACF,YAAY,EAAE,IAAA,eAAK,EAAC,iBAAiB,EAAE,WAAW,CAAC;QACnD,OAAO;KACR,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AArCW,QAAA,6BAA6B,iCAqCxC"}
|
package/Collections.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collections.d.ts","sourceRoot":"","sources":["src/Collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;GAQG;AAEH,aAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,WAAW,MAAM,WAC3C,CAAC;AAEzB;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,iBAAkB,MAAM;;;
|
|
1
|
+
{"version":3,"file":"Collections.d.ts","sourceRoot":"","sources":["src/Collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;GAQG;AAEH,aAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,WAAW,MAAM,WAC3C,CAAC;AAEzB;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,iBAAkB,MAAM;;;CAe3D,CAAC;AA4BF;;;;;;;;GAQG;AACH,eAAO,MAAM,sCAAsC,YACxC,QAAQ,cAAc,KAC9B,cAAc,GAAG,SAUnB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,YAC5B,QAAQ,cAAc,KAC9B,MAAM,GAAG,SAOX,CAAC"}
|
package/Collections.js
CHANGED
|
@@ -10,7 +10,8 @@ exports.getCollectionIdFromMessage = exports.getCollectionNameAndVersionFromMess
|
|
|
10
10
|
*
|
|
11
11
|
* @alias module:Collections
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
const constructCollectionId = (name, version) => `${name}___${version}`;
|
|
14
|
+
exports.constructCollectionId = constructCollectionId;
|
|
14
15
|
/**
|
|
15
16
|
* Returns the name and version of a collection based on
|
|
16
17
|
* the collectionId used in elasticsearch indexing
|
|
@@ -18,13 +19,24 @@ exports.constructCollectionId = (name, version) => `${name}___${version}`;
|
|
|
18
19
|
* @param {string} collectionId - collectionId used in elasticsearch index
|
|
19
20
|
* @returns {Object} name and version as object
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
version
|
|
26
|
-
}
|
|
22
|
+
const deconstructCollectionId = (collectionId) => {
|
|
23
|
+
let name;
|
|
24
|
+
let version;
|
|
25
|
+
try {
|
|
26
|
+
[name, version] = collectionId.split('___');
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
throw new Error(`invalid collectionId: ${JSON.stringify(collectionId)}`);
|
|
30
|
+
}
|
|
31
|
+
if (name && version) {
|
|
32
|
+
return {
|
|
33
|
+
name,
|
|
34
|
+
version,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
throw new Error(`invalid collectionId: ${collectionId}`);
|
|
27
38
|
};
|
|
39
|
+
exports.deconstructCollectionId = deconstructCollectionId;
|
|
28
40
|
/**
|
|
29
41
|
* Get collection name from execution message.
|
|
30
42
|
*
|
|
@@ -54,7 +66,7 @@ const getCollectionVersionFromMessage = (message) => { var _a, _b; return (_b =
|
|
|
54
66
|
*
|
|
55
67
|
* @alias module:Collections
|
|
56
68
|
*/
|
|
57
|
-
|
|
69
|
+
const getCollectionNameAndVersionFromMessage = (message) => {
|
|
58
70
|
const name = getCollectionNameFromMessage(message);
|
|
59
71
|
const version = getCollectionVersionFromMessage(message);
|
|
60
72
|
if (!name || !version) {
|
|
@@ -65,6 +77,7 @@ exports.getCollectionNameAndVersionFromMessage = (message) => {
|
|
|
65
77
|
version,
|
|
66
78
|
};
|
|
67
79
|
};
|
|
80
|
+
exports.getCollectionNameAndVersionFromMessage = getCollectionNameAndVersionFromMessage;
|
|
68
81
|
/**
|
|
69
82
|
* Get collection ID from execution message.
|
|
70
83
|
*
|
|
@@ -75,12 +88,13 @@ exports.getCollectionNameAndVersionFromMessage = (message) => {
|
|
|
75
88
|
*
|
|
76
89
|
* @alias module:Collections
|
|
77
90
|
*/
|
|
78
|
-
|
|
91
|
+
const getCollectionIdFromMessage = (message) => {
|
|
79
92
|
const collectionName = getCollectionNameFromMessage(message);
|
|
80
93
|
const collectionVersion = getCollectionVersionFromMessage(message);
|
|
81
94
|
if (!collectionName || !collectionVersion) {
|
|
82
95
|
return undefined;
|
|
83
96
|
}
|
|
84
|
-
return exports.constructCollectionId(collectionName, collectionVersion);
|
|
97
|
+
return (0, exports.constructCollectionId)(collectionName, collectionVersion);
|
|
85
98
|
};
|
|
99
|
+
exports.getCollectionIdFromMessage = getCollectionIdFromMessage;
|
|
86
100
|
//# sourceMappingURL=Collections.js.map
|
package/Collections.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collections.js","sourceRoot":"","sources":["src/Collections.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAmBb;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"Collections.js","sourceRoot":"","sources":["src/Collections.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAmBb;;;;;;;;GAQG;AACI,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE,CACrE,GAAG,IAAI,MAAM,OAAO,EAAE,CA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D;AAEF;;;;;;;;;GASG;AACI,MAAM,0BAA0B,GAAG,CACxC,OAA+B,EACX,EAAE;IACtB,MAAM,cAAc,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAC7D,MAAM,iBAAiB,GAAG,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACnE,IAAI,CAAC,cAAc,IAAI,CAAC,iBAAiB,EAAE;QACzC,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,IAAA,6BAAqB,EAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAClE,CAAC,CAAC;AATW,QAAA,0BAA0B,8BASrC"}
|
package/Executions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Executions.d.ts","sourceRoot":"","sources":["src/Executions.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAIzC;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,oBACX,MAAM,iBACR,MAAM,kBAOtB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,iBAAkB,MAAM,WAI1D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,iBAC/B,MAAM,kBAMrB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,YACzB,
|
|
1
|
+
{"version":3,"file":"Executions.d.ts","sourceRoot":"","sources":["src/Executions.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAIzC;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,oBACX,MAAM,iBACR,MAAM,kBAOtB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,iBAAkB,MAAM,WAI1D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,iBAC/B,MAAM,kBAMrB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,YACzB,QAAQ,cAAc,WAOhC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,YAC3B,QAAQ,cAAc,WAOhC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,YACxB,QAAQ,cAAc,kBAUhC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,YAC9B,QAAQ,cAAc,KAC9B,MAAM,GAAG,SAAqD,CAAC;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,YAC1B,QAAQ,cAAc,KAC9B,MAAM,GAAG,SAAkD,CAAC;AAE/D;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,YACpC,QAAQ,cAAc,KAC9B,OAAO,GAAG,SAGZ,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,YACjC,QAAQ,cAAc,KAC9B,OAAO,GAAG,SAGZ,CAAC"}
|
package/Executions.js
CHANGED
|
@@ -24,13 +24,14 @@ const workflows_1 = require("./workflows");
|
|
|
24
24
|
*
|
|
25
25
|
* @alias module:Executions
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
const buildExecutionArn = (stateMachineArn, executionName) => {
|
|
28
28
|
if (stateMachineArn && executionName) {
|
|
29
29
|
const sfArn = stateMachineArn.replace('stateMachine', 'execution');
|
|
30
30
|
return `${sfArn}:${executionName}`;
|
|
31
31
|
}
|
|
32
32
|
return null;
|
|
33
33
|
};
|
|
34
|
+
exports.buildExecutionArn = buildExecutionArn;
|
|
34
35
|
/**
|
|
35
36
|
* Returns execution URL from an execution ARN.
|
|
36
37
|
*
|
|
@@ -39,11 +40,12 @@ exports.buildExecutionArn = (stateMachineArn, executionName) => {
|
|
|
39
40
|
*
|
|
40
41
|
* @alias module:Executions
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
const getExecutionUrlFromArn = (executionArn) => {
|
|
43
44
|
const region = process.env.AWS_DEFAULT_REGION || 'us-east-1';
|
|
44
45
|
return `https://console.aws.amazon.com/states/home?region=${region}`
|
|
45
46
|
+ `#/executions/details/${executionArn}`;
|
|
46
47
|
};
|
|
48
|
+
exports.getExecutionUrlFromArn = getExecutionUrlFromArn;
|
|
47
49
|
/**
|
|
48
50
|
* Get state machine ARN from an execution ARN
|
|
49
51
|
*
|
|
@@ -52,12 +54,13 @@ exports.getExecutionUrlFromArn = (executionArn) => {
|
|
|
52
54
|
*
|
|
53
55
|
* @alias module:Executions
|
|
54
56
|
*/
|
|
55
|
-
|
|
57
|
+
const getStateMachineArnFromExecutionArn = (executionArn) => {
|
|
56
58
|
if (executionArn) {
|
|
57
59
|
return executionArn.replace('execution', 'stateMachine').split(':').slice(0, -1).join(':');
|
|
58
60
|
}
|
|
59
61
|
return null;
|
|
60
62
|
};
|
|
63
|
+
exports.getStateMachineArnFromExecutionArn = getStateMachineArnFromExecutionArn;
|
|
61
64
|
/**
|
|
62
65
|
* Get the execution name from a workflow message.
|
|
63
66
|
*
|
|
@@ -67,13 +70,14 @@ exports.getStateMachineArnFromExecutionArn = (executionArn) => {
|
|
|
67
70
|
*
|
|
68
71
|
* @alias module:Executions
|
|
69
72
|
*/
|
|
70
|
-
|
|
73
|
+
const getMessageExecutionName = (message) => {
|
|
71
74
|
const executionName = message.cumulus_meta.execution_name;
|
|
72
|
-
if (!isString_1.default(executionName)) {
|
|
75
|
+
if (!(0, isString_1.default)(executionName)) {
|
|
73
76
|
throw new Error('cumulus_meta.execution_name not set in message');
|
|
74
77
|
}
|
|
75
78
|
return executionName;
|
|
76
79
|
};
|
|
80
|
+
exports.getMessageExecutionName = getMessageExecutionName;
|
|
77
81
|
/**
|
|
78
82
|
* Get the state machine ARN from a workflow message.
|
|
79
83
|
*
|
|
@@ -83,13 +87,14 @@ exports.getMessageExecutionName = (message) => {
|
|
|
83
87
|
*
|
|
84
88
|
* @alias module:Executions
|
|
85
89
|
*/
|
|
86
|
-
|
|
90
|
+
const getMessageStateMachineArn = (message) => {
|
|
87
91
|
const stateMachineArn = message.cumulus_meta.state_machine;
|
|
88
|
-
if (!isString_1.default(stateMachineArn)) {
|
|
92
|
+
if (!(0, isString_1.default)(stateMachineArn)) {
|
|
89
93
|
throw new Error('cumulus_meta.state_machine not set in message');
|
|
90
94
|
}
|
|
91
95
|
return stateMachineArn;
|
|
92
96
|
};
|
|
97
|
+
exports.getMessageStateMachineArn = getMessageStateMachineArn;
|
|
93
98
|
/**
|
|
94
99
|
* Get the execution ARN from a workflow message.
|
|
95
100
|
*
|
|
@@ -98,14 +103,15 @@ exports.getMessageStateMachineArn = (message) => {
|
|
|
98
103
|
*
|
|
99
104
|
* @alias module:Executions
|
|
100
105
|
*/
|
|
101
|
-
|
|
106
|
+
const getMessageExecutionArn = (message) => {
|
|
102
107
|
try {
|
|
103
|
-
return exports.buildExecutionArn(exports.getMessageStateMachineArn(message), exports.getMessageExecutionName(message));
|
|
108
|
+
return (0, exports.buildExecutionArn)((0, exports.getMessageStateMachineArn)(message), (0, exports.getMessageExecutionName)(message));
|
|
104
109
|
}
|
|
105
110
|
catch (error) {
|
|
106
111
|
return null;
|
|
107
112
|
}
|
|
108
113
|
};
|
|
114
|
+
exports.getMessageExecutionArn = getMessageExecutionArn;
|
|
109
115
|
/**
|
|
110
116
|
* Get the parent execution ARN from a workflow message, if any.
|
|
111
117
|
*
|
|
@@ -114,7 +120,8 @@ exports.getMessageExecutionArn = (message) => {
|
|
|
114
120
|
*
|
|
115
121
|
* @alias module:Executions
|
|
116
122
|
*/
|
|
117
|
-
|
|
123
|
+
const getMessageExecutionParentArn = (message) => { var _a; return (_a = message.cumulus_meta) === null || _a === void 0 ? void 0 : _a.parentExecutionArn; };
|
|
124
|
+
exports.getMessageExecutionParentArn = getMessageExecutionParentArn;
|
|
118
125
|
/**
|
|
119
126
|
* Get the Cumulus version from a workflow message, if any.
|
|
120
127
|
*
|
|
@@ -123,7 +130,8 @@ exports.getMessageExecutionParentArn = (message) => { var _a; return (_a = messa
|
|
|
123
130
|
*
|
|
124
131
|
* @alias module:Executions
|
|
125
132
|
*/
|
|
126
|
-
|
|
133
|
+
const getMessageCumulusVersion = (message) => { var _a; return (_a = message.cumulus_meta) === null || _a === void 0 ? void 0 : _a.cumulus_version; };
|
|
134
|
+
exports.getMessageCumulusVersion = getMessageCumulusVersion;
|
|
127
135
|
/**
|
|
128
136
|
* Get the workflow original payload, if any.
|
|
129
137
|
*
|
|
@@ -132,10 +140,11 @@ exports.getMessageCumulusVersion = (message) => { var _a; return (_a = message.c
|
|
|
132
140
|
*
|
|
133
141
|
* @alias module:Executions
|
|
134
142
|
*/
|
|
135
|
-
|
|
136
|
-
const status = workflows_1.getMetaStatus(message);
|
|
143
|
+
const getMessageExecutionOriginalPayload = (message) => {
|
|
144
|
+
const status = (0, workflows_1.getMetaStatus)(message);
|
|
137
145
|
return status === 'running' ? message.payload : undefined;
|
|
138
146
|
};
|
|
147
|
+
exports.getMessageExecutionOriginalPayload = getMessageExecutionOriginalPayload;
|
|
139
148
|
/**
|
|
140
149
|
* Get the workflow final payload, if any.
|
|
141
150
|
*
|
|
@@ -144,8 +153,9 @@ exports.getMessageExecutionOriginalPayload = (message) => {
|
|
|
144
153
|
*
|
|
145
154
|
* @alias module:Executions
|
|
146
155
|
*/
|
|
147
|
-
|
|
148
|
-
const status = workflows_1.getMetaStatus(message);
|
|
156
|
+
const getMessageExecutionFinalPayload = (message) => {
|
|
157
|
+
const status = (0, workflows_1.getMetaStatus)(message);
|
|
149
158
|
return status === 'running' ? undefined : message.payload;
|
|
150
159
|
};
|
|
160
|
+
exports.getMessageExecutionFinalPayload = getMessageExecutionFinalPayload;
|
|
151
161
|
//# sourceMappingURL=Executions.js.map
|
package/Executions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Executions.js","sourceRoot":"","sources":["src/Executions.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AAEb;;;;;;;;GAQG;AAEH,+DAAuC;AAGvC,2CAA4C;AAE5C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,OAAO,CAAC,CAAC;IACtC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5D,CAAC,CAAC;AALW,QAAA,kCAAkC,sCAK7C;AAEF;;;;;;;GAOG;AACI,MAAM,+BAA+B,GAAG,CAC7C,OAA+B,EACV,EAAE;IACvB,MAAM,MAAM,GAAG,IAAA,yBAAa,EAAC,OAAO,CAAC,CAAC;IACtC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AAC5D,CAAC,CAAC;AALW,QAAA,+BAA+B,mCAK1C"}
|
package/Granules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Granules.d.ts","sourceRoot":"","sources":["src/Granules.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAExE,UAAU,0BAA2B,SAAQ,OAAO,CAAC,IAAI;IACvD,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,OAAO,CAAA;KACtB,CAAA;CACF;AAED,UAAU,mBAAoB,SAAQ,OAAO,CAAC,cAAc;IAC1D,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KACpB,CAAA;CACF;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,YACpB,mBAAmB,KAC3B,OAAO,EAAqC,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,YACpB,mBAAmB,KAC3B,OAAmD,CAAC;AAEvD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,mBACX,
|
|
1
|
+
{"version":3,"file":"Granules.d.ts","sourceRoot":"","sources":["src/Granules.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAExE,UAAU,0BAA2B,SAAQ,OAAO,CAAC,IAAI;IACvD,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,OAAO,CAAA;KACtB,CAAA;CACF;AAED,UAAU,mBAAoB,SAAQ,OAAO,CAAC,cAAc;IAC1D,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KACpB,CAAA;CACF;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,YACpB,mBAAmB,KAC3B,OAAO,EAAqC,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,YACpB,mBAAmB,KAC3B,OAAmD,CAAC;AAEvD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,mBACX,QAAQ,cAAc,WAC7B,UAAU,KAClB,QAAQ,cAAc,GAAG,aAAiD,CAAC;AAE9E;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,YACvB,mBAAmB,YACS,CAAC"}
|
package/Granules.js
CHANGED
|
@@ -10,7 +10,8 @@ exports.getGranuleQueryFields = exports.getGranuleStatus = exports.messageHasGra
|
|
|
10
10
|
*
|
|
11
11
|
* @alias module:Granules
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
const getMessageGranules = (message) => { var _a, _b; return (_b = (_a = message.payload) === null || _a === void 0 ? void 0 : _a.granules) !== null && _b !== void 0 ? _b : []; };
|
|
14
|
+
exports.getMessageGranules = getMessageGranules;
|
|
14
15
|
/**
|
|
15
16
|
* Determine if message has a granules object.
|
|
16
17
|
*
|
|
@@ -19,7 +20,8 @@ exports.getMessageGranules = (message) => { var _a, _b; return (_b = (_a = messa
|
|
|
19
20
|
*
|
|
20
21
|
* @alias module:Granules
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
+
const messageHasGranules = (message) => (0, exports.getMessageGranules)(message).length !== 0;
|
|
24
|
+
exports.messageHasGranules = messageHasGranules;
|
|
23
25
|
/**
|
|
24
26
|
* Determine the status of a granule.
|
|
25
27
|
*
|
|
@@ -29,7 +31,8 @@ exports.messageHasGranules = (message) => exports.getMessageGranules(message).le
|
|
|
29
31
|
*
|
|
30
32
|
* @alias module:Granules
|
|
31
33
|
*/
|
|
32
|
-
|
|
34
|
+
const getGranuleStatus = (workflowStatus, granule) => workflowStatus || granule.status;
|
|
35
|
+
exports.getGranuleStatus = getGranuleStatus;
|
|
33
36
|
/**
|
|
34
37
|
* Get the query fields of a granule, if any
|
|
35
38
|
*
|
|
@@ -38,5 +41,6 @@ exports.getGranuleStatus = (workflowStatus, granule) => workflowStatus || granul
|
|
|
38
41
|
*
|
|
39
42
|
* @alias module:Granules
|
|
40
43
|
*/
|
|
41
|
-
|
|
44
|
+
const getGranuleQueryFields = (message) => { var _a, _b; return (_b = (_a = message.meta) === null || _a === void 0 ? void 0 : _a.granule) === null || _b === void 0 ? void 0 : _b.queryFields; };
|
|
45
|
+
exports.getGranuleQueryFields = getGranuleQueryFields;
|
|
42
46
|
//# sourceMappingURL=Granules.js.map
|
package/Granules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Granules.js","sourceRoot":"","sources":["src/Granules.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AA0Bb;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"Granules.js","sourceRoot":"","sources":["src/Granules.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AA0Bb;;;;;;;;GAQG;AACI,MAAM,kBAAkB,GAAG,CAChC,OAA4B,EACjB,EAAE,eAAC,OAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,QAAQ,mCAAI,EAAE,CAAA,EAAA,CAAC;AAFnC,QAAA,kBAAkB,sBAEiB;AAEhD;;;;;;;GAOG;AACI,MAAM,kBAAkB,GAAG,CAChC,OAA4B,EACnB,EAAE,CAAC,IAAA,0BAAkB,EAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AAF1C,QAAA,kBAAkB,sBAEwB;AAEvD;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAG,CAC9B,cAAsC,EACtC,OAAmB,EACqB,EAAE,CAAC,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;AAHjE,QAAA,gBAAgB,oBAGiD;AAE9E;;;;;;;GAOG;AACI,MAAM,qBAAqB,GAAG,CACnC,OAA4B,EAC5B,EAAE,eAAC,OAAA,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,OAAO,0CAAE,WAAW,CAAA,EAAA,CAAC;AAF3B,QAAA,qBAAqB,yBAEM"}
|
package/PDRs.js
CHANGED
|
@@ -9,7 +9,8 @@ exports.getPdrPercentCompletion = exports.getMessagePdrStats = exports.getMessag
|
|
|
9
9
|
*
|
|
10
10
|
* @alias module:PDRs
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
const getMessagePdr = (message) => { var _a; return (_a = message.payload) === null || _a === void 0 ? void 0 : _a.pdr; };
|
|
13
|
+
exports.getMessagePdr = getMessagePdr;
|
|
13
14
|
/**
|
|
14
15
|
* Determine if message has a PDR.
|
|
15
16
|
*
|
|
@@ -18,7 +19,8 @@ exports.getMessagePdr = (message) => { var _a; return (_a = message.payload) ===
|
|
|
18
19
|
*
|
|
19
20
|
* @alias module:PDRs
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
const messageHasPdr = (message) => (0, exports.getMessagePdr)(message) !== undefined;
|
|
23
|
+
exports.messageHasPdr = messageHasPdr;
|
|
22
24
|
/**
|
|
23
25
|
* Get the PAN sent status from a workflow message, if any.
|
|
24
26
|
*
|
|
@@ -27,7 +29,8 @@ exports.messageHasPdr = (message) => exports.getMessagePdr(message) !== undefine
|
|
|
27
29
|
*
|
|
28
30
|
* @alias module:PDRs
|
|
29
31
|
*/
|
|
30
|
-
|
|
32
|
+
const getMessagePdrPANSent = (message) => { var _a, _b; return (_b = (_a = (0, exports.getMessagePdr)(message)) === null || _a === void 0 ? void 0 : _a.PANSent) !== null && _b !== void 0 ? _b : false; };
|
|
33
|
+
exports.getMessagePdrPANSent = getMessagePdrPANSent;
|
|
31
34
|
/**
|
|
32
35
|
* Get the PAN message status from a workflow message, if any.
|
|
33
36
|
*
|
|
@@ -36,7 +39,8 @@ exports.getMessagePdrPANSent = (message) => { var _a, _b; return (_b = (_a = exp
|
|
|
36
39
|
*
|
|
37
40
|
* @alias module:PDRs
|
|
38
41
|
*/
|
|
39
|
-
|
|
42
|
+
const getMessagePdrPANMessage = (message) => { var _a, _b; return (_b = (_a = (0, exports.getMessagePdr)(message)) === null || _a === void 0 ? void 0 : _a.PANmessage) !== null && _b !== void 0 ? _b : 'N/A'; };
|
|
43
|
+
exports.getMessagePdrPANMessage = getMessagePdrPANMessage;
|
|
40
44
|
/**
|
|
41
45
|
* Get the PDR name from a workflow message, if any.
|
|
42
46
|
*
|
|
@@ -45,7 +49,8 @@ exports.getMessagePdrPANMessage = (message) => { var _a, _b; return (_b = (_a =
|
|
|
45
49
|
*
|
|
46
50
|
* @alias module:PDRs
|
|
47
51
|
*/
|
|
48
|
-
|
|
52
|
+
const getMessagePdrName = (message) => { var _a; return (_a = (0, exports.getMessagePdr)(message)) === null || _a === void 0 ? void 0 : _a.name; };
|
|
53
|
+
exports.getMessagePdrName = getMessagePdrName;
|
|
49
54
|
/**
|
|
50
55
|
* Get the number of running executions for a PDR, if any.
|
|
51
56
|
*
|
|
@@ -54,7 +59,8 @@ exports.getMessagePdrName = (message) => { var _a; return (_a = exports.getMessa
|
|
|
54
59
|
*
|
|
55
60
|
* @alias module:PDRs
|
|
56
61
|
*/
|
|
57
|
-
|
|
62
|
+
const getMessagePdrRunningExecutions = (message) => { var _a; return ((_a = message.payload.running) !== null && _a !== void 0 ? _a : []).length; };
|
|
63
|
+
exports.getMessagePdrRunningExecutions = getMessagePdrRunningExecutions;
|
|
58
64
|
/**
|
|
59
65
|
* Get the number of completed executions for a PDR, if any.
|
|
60
66
|
*
|
|
@@ -63,7 +69,8 @@ exports.getMessagePdrRunningExecutions = (message) => { var _a; return ((_a = me
|
|
|
63
69
|
*
|
|
64
70
|
* @alias module:PDRs
|
|
65
71
|
*/
|
|
66
|
-
|
|
72
|
+
const getMessagePdrCompletedExecutions = (message) => { var _a; return ((_a = message.payload.completed) !== null && _a !== void 0 ? _a : []).length; };
|
|
73
|
+
exports.getMessagePdrCompletedExecutions = getMessagePdrCompletedExecutions;
|
|
67
74
|
/**
|
|
68
75
|
* Get the number of failed executions for a PDR, if any.
|
|
69
76
|
*
|
|
@@ -72,7 +79,8 @@ exports.getMessagePdrCompletedExecutions = (message) => { var _a; return ((_a =
|
|
|
72
79
|
*
|
|
73
80
|
* @alias module:PDRs
|
|
74
81
|
*/
|
|
75
|
-
|
|
82
|
+
const getMessagePdrFailedExecutions = (message) => { var _a; return ((_a = message.payload.failed) !== null && _a !== void 0 ? _a : []).length; };
|
|
83
|
+
exports.getMessagePdrFailedExecutions = getMessagePdrFailedExecutions;
|
|
76
84
|
/**
|
|
77
85
|
* Get the PDR stats from a workflow message, if any.
|
|
78
86
|
*
|
|
@@ -82,10 +90,10 @@ exports.getMessagePdrFailedExecutions = (message) => { var _a; return ((_a = mes
|
|
|
82
90
|
*
|
|
83
91
|
* @alias module:PDRs
|
|
84
92
|
*/
|
|
85
|
-
|
|
86
|
-
const processing = exports.getMessagePdrRunningExecutions(message);
|
|
87
|
-
const completed = exports.getMessagePdrCompletedExecutions(message);
|
|
88
|
-
const failed = exports.getMessagePdrFailedExecutions(message);
|
|
93
|
+
const getMessagePdrStats = (message) => {
|
|
94
|
+
const processing = (0, exports.getMessagePdrRunningExecutions)(message);
|
|
95
|
+
const completed = (0, exports.getMessagePdrCompletedExecutions)(message);
|
|
96
|
+
const failed = (0, exports.getMessagePdrFailedExecutions)(message);
|
|
89
97
|
const stats = {
|
|
90
98
|
processing,
|
|
91
99
|
completed,
|
|
@@ -94,6 +102,7 @@ exports.getMessagePdrStats = (message) => {
|
|
|
94
102
|
};
|
|
95
103
|
return stats;
|
|
96
104
|
};
|
|
105
|
+
exports.getMessagePdrStats = getMessagePdrStats;
|
|
97
106
|
/**
|
|
98
107
|
* Get the percent completion of PDR executions
|
|
99
108
|
*
|
|
@@ -102,7 +111,7 @@ exports.getMessagePdrStats = (message) => {
|
|
|
102
111
|
*
|
|
103
112
|
* @alias module:PDRs
|
|
104
113
|
*/
|
|
105
|
-
|
|
114
|
+
const getPdrPercentCompletion = (stats) => {
|
|
106
115
|
let progress = 0;
|
|
107
116
|
if (stats.processing > 0 && stats.total > 0) {
|
|
108
117
|
progress = ((stats.total - stats.processing) / stats.total) * 100;
|
|
@@ -112,4 +121,5 @@ exports.getPdrPercentCompletion = (stats) => {
|
|
|
112
121
|
}
|
|
113
122
|
return progress;
|
|
114
123
|
};
|
|
124
|
+
exports.getPdrPercentCompletion = getPdrPercentCompletion;
|
|
115
125
|
//# sourceMappingURL=PDRs.js.map
|
package/PDRs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PDRs.js","sourceRoot":"","sources":["src/PDRs.ts"],"names":[],"mappings":";;;AA8BA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"PDRs.js","sourceRoot":"","sources":["src/PDRs.ts"],"names":[],"mappings":";;;AA8BA;;;;;;;GAOG;AACI,MAAM,aAAa,GAAG,CAC3B,OAAsC,EACrB,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAA,EAAA,CAAC;AAF9B,QAAA,aAAa,iBAEiB;AAE3C;;;;;;;GAOG;AACI,MAAM,aAAa,GAAG,CAC3B,OAAsC,EAC7B,EAAE,CAAC,IAAA,qBAAa,EAAC,OAAO,CAAC,KAAK,SAAS,CAAC;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nD;;;;;;;;GAQG;AACI,MAAM,kBAAkB,GAAG,CAChC,OAAoC,EAC1B,EAAE;IACZ,MAAM,UAAU,GAAG,IAAA,sCAA8B,EAAC,OAAO,CAAC,CAAC;IAC3D,MAAM,SAAS,GAAG,IAAA,wCAAgC,EAAC,OAAO,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,IAAA,qCAA6B,EAAC,OAAO,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG;QACZ,UAAU;QACV,SAAS;QACT,MAAM;QACN,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM;KACvC,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAbW,QAAA,kBAAkB,sBAa7B;AAEF;;;;;;;GAOG;AACI,MAAM,uBAAuB,GAAG,CACrC,KAAe,EACP,EAAE;IACV,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,KAAK,CAAC,UAAU,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE;QAC3C,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;KACnE;SAAM,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE;QACpD,QAAQ,GAAG,GAAG,CAAC;KAChB;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAVW,QAAA,uBAAuB,2BAUlC"}
|
package/Providers.js
CHANGED
|
@@ -9,7 +9,8 @@ exports.getMessageProviderId = exports.getMessageProvider = void 0;
|
|
|
9
9
|
*
|
|
10
10
|
* @alias module:Providers
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
const getMessageProvider = (message) => { var _a; return (_a = message.meta) === null || _a === void 0 ? void 0 : _a.provider; };
|
|
13
|
+
exports.getMessageProvider = getMessageProvider;
|
|
13
14
|
/**
|
|
14
15
|
* Get the provider ID from a workflow message, if any.
|
|
15
16
|
*
|
|
@@ -18,5 +19,6 @@ exports.getMessageProvider = (message) => { var _a; return (_a = message.meta) =
|
|
|
18
19
|
*
|
|
19
20
|
* @alias module:Providers
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
const getMessageProviderId = (message) => { var _a; return (_a = (0, exports.getMessageProvider)(message)) === null || _a === void 0 ? void 0 : _a.id; };
|
|
23
|
+
exports.getMessageProviderId = getMessageProviderId;
|
|
22
24
|
//# sourceMappingURL=Providers.js.map
|
package/Providers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Providers.js","sourceRoot":"","sources":["src/Providers.ts"],"names":[],"mappings":";;;AAeA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"Providers.js","sourceRoot":"","sources":["src/Providers.ts"],"names":[],"mappings":";;;AAeA;;;;;;;GAOG;AACI,MAAM,kBAAkB,GAAG,CAChC,OAA4B,EACC,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,QAAQ,CAAA,EAAA,CAAC;AAF5C,QAAA,kBAAkB,sBAE0B;AAEzD;;;;;;;GAOG;AACI,MAAM,oBAAoB,GAAG,CAClC,OAA4B,EACR,EAAE,WAAC,OAAA,MAAA,IAAA,0BAAkB,EAAC,OAAO,CAAC,0CAAE,EAAE,CAAA,EAAA,CAAC;AAF5C,QAAA,oBAAoB,wBAEwB"}
|
package/Queue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Queue.d.ts","sourceRoot":"","sources":["src/Queue.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,aAAK,oBAAoB,GAAG,OAAO,CAAC,cAAc,GAAG;IACnD,YAAY,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,YAAa,oBAAoB,KAAG,MAM3D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,YACtB,
|
|
1
|
+
{"version":3,"file":"Queue.d.ts","sourceRoot":"","sources":["src/Queue.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,aAAK,oBAAoB,GAAG,OAAO,CAAC,cAAc,GAAG;IACnD,YAAY,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,YAAa,oBAAoB,KAAG,MAM3D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,YACtB,QAAQ,cAAc,YACrB,MAAM,KACf,MAMF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,YAC3B,oBAAoB,KAC5B,OAQF,CAAC"}
|
package/Queue.js
CHANGED
|
@@ -20,13 +20,14 @@ const isNil_1 = __importDefault(require("lodash/isNil"));
|
|
|
20
20
|
*
|
|
21
21
|
* @alias module:Queue
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
const getQueueUrl = (message) => {
|
|
24
24
|
const queueUrl = message.cumulus_meta.queueUrl;
|
|
25
|
-
if (isNil_1.default(queueUrl)) {
|
|
25
|
+
if ((0, isNil_1.default)(queueUrl)) {
|
|
26
26
|
throw new Error('Could not find queue URL at cumulus_meta.queueUrl in message');
|
|
27
27
|
}
|
|
28
28
|
return queueUrl;
|
|
29
29
|
};
|
|
30
|
+
exports.getQueueUrl = getQueueUrl;
|
|
30
31
|
/**
|
|
31
32
|
* Get the maximum executions for a queue.
|
|
32
33
|
*
|
|
@@ -37,14 +38,15 @@ exports.getQueueUrl = (message) => {
|
|
|
37
38
|
*
|
|
38
39
|
* @alias module:Queue
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
const getMaximumExecutions = (message, queueUrl) => {
|
|
41
42
|
var _a;
|
|
42
43
|
const maxExecutions = (_a = message.cumulus_meta.queueExecutionLimits) === null || _a === void 0 ? void 0 : _a[queueUrl];
|
|
43
|
-
if (isNil_1.default(maxExecutions)) {
|
|
44
|
+
if ((0, isNil_1.default)(maxExecutions)) {
|
|
44
45
|
throw new Error(`Could not determine maximum executions for queue ${queueUrl}`);
|
|
45
46
|
}
|
|
46
47
|
return maxExecutions;
|
|
47
48
|
};
|
|
49
|
+
exports.getMaximumExecutions = getMaximumExecutions;
|
|
48
50
|
/**
|
|
49
51
|
* Determine if there is a queue and queue execution limit in the message.
|
|
50
52
|
*
|
|
@@ -53,14 +55,15 @@ exports.getMaximumExecutions = (message, queueUrl) => {
|
|
|
53
55
|
*
|
|
54
56
|
* @alias module:Queue
|
|
55
57
|
*/
|
|
56
|
-
|
|
58
|
+
const hasQueueAndExecutionLimit = (message) => {
|
|
57
59
|
try {
|
|
58
|
-
const queueUrl = exports.getQueueUrl(message);
|
|
59
|
-
exports.getMaximumExecutions(message, queueUrl);
|
|
60
|
+
const queueUrl = (0, exports.getQueueUrl)(message);
|
|
61
|
+
(0, exports.getMaximumExecutions)(message, queueUrl);
|
|
60
62
|
}
|
|
61
63
|
catch (error) {
|
|
62
64
|
return false;
|
|
63
65
|
}
|
|
64
66
|
return true;
|
|
65
67
|
};
|
|
68
|
+
exports.hasQueueAndExecutionLimit = hasQueueAndExecutionLimit;
|
|
66
69
|
//# sourceMappingURL=Queue.js.map
|
package/Queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Queue.js","sourceRoot":"","sources":["src/Queue.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AAEb;;;;;;GAMG;AAEH,yDAAiC;AASjC;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"Queue.js","sourceRoot":"","sources":["src/Queue.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AAEb;;;;;;GAMG;AAEH,yDA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