@temporalio/activity 1.3.0 → 1.4.1
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/lib/index.d.ts +1 -2
- package/lib/index.js +4 -7
- package/lib/index.js.map +1 -1
- package/package.json +3 -4
- package/src/index.ts +5 -5
package/lib/index.d.ts
CHANGED
|
@@ -71,9 +71,8 @@
|
|
|
71
71
|
/// <reference types="node" />
|
|
72
72
|
import { AbortSignal } from 'abort-controller';
|
|
73
73
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
74
|
-
export { CancelledFailure, ApplicationFailure } from '@temporalio/common';
|
|
75
74
|
export { ActivityFunction, ActivityInterface, // eslint-disable-line deprecation/deprecation
|
|
76
|
-
|
|
75
|
+
ApplicationFailure, CancelledFailure, UntypedActivities, } from '@temporalio/common';
|
|
77
76
|
/**
|
|
78
77
|
* Throw this error from an Activity in order to make the Worker forget about this Activity.
|
|
79
78
|
*
|
package/lib/index.js
CHANGED
|
@@ -70,15 +70,12 @@
|
|
|
70
70
|
* @module
|
|
71
71
|
*/
|
|
72
72
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
73
|
-
exports.Context = exports.asyncLocalStorage = exports.CompleteAsyncError = exports.
|
|
74
|
-
const internal_workflow_common_1 = require("@temporalio/internal-workflow-common");
|
|
73
|
+
exports.Context = exports.asyncLocalStorage = exports.CompleteAsyncError = exports.CancelledFailure = exports.ApplicationFailure = void 0;
|
|
75
74
|
const async_hooks_1 = require("async_hooks");
|
|
75
|
+
const time_1 = require("@temporalio/common/lib/time");
|
|
76
76
|
var common_1 = require("@temporalio/common");
|
|
77
|
-
Object.defineProperty(exports, "CancelledFailure", { enumerable: true, get: function () { return common_1.CancelledFailure; } });
|
|
78
77
|
Object.defineProperty(exports, "ApplicationFailure", { enumerable: true, get: function () { return common_1.ApplicationFailure; } });
|
|
79
|
-
|
|
80
|
-
Object.defineProperty(exports, "errorMessage", { enumerable: true, get: function () { return internal_workflow_common_2.errorMessage; } });
|
|
81
|
-
Object.defineProperty(exports, "errorCode", { enumerable: true, get: function () { return internal_workflow_common_2.errorCode; } });
|
|
78
|
+
Object.defineProperty(exports, "CancelledFailure", { enumerable: true, get: function () { return common_1.CancelledFailure; } });
|
|
82
79
|
/**
|
|
83
80
|
* Throw this error from an Activity in order to make the Worker forget about this Activity.
|
|
84
81
|
*
|
|
@@ -165,7 +162,7 @@ class Context {
|
|
|
165
162
|
sleep(ms) {
|
|
166
163
|
let handle;
|
|
167
164
|
const timer = new Promise((resolve) => {
|
|
168
|
-
handle = setTimeout(resolve, (0,
|
|
165
|
+
handle = setTimeout(resolve, (0, time_1.msToNumber)(ms));
|
|
169
166
|
});
|
|
170
167
|
return Promise.race([this.cancelled.finally(() => clearTimeout(handle)), timer]);
|
|
171
168
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;;;AAGH,6CAAgD;AAChD,sDAAyD;AAEzD,6CAM4B;AAH1B,4GAAA,kBAAkB,OAAA;AAClB,0GAAA,gBAAgB,OAAA;AAIlB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,kBAAmB,SAAQ,KAAK;IAG3C;QACE,KAAK,EAAE,CAAC;QAHM,SAAI,GAAW,oBAAoB,CAAC;IAIpD,CAAC;CACF;AAND,gDAMC;AAED,cAAc;AACD,QAAA,iBAAiB,GAAG,IAAI,+BAAiB,EAAW,CAAC;AA8ElE;;;;;;;;;GASG;AACH,MAAa,OAAO;IA8BlB;;;;OAIG;IACH,YACE,IAAU,EACV,SAAyB,EACzB,kBAA+B,EAC/B,SAAkC;QAElC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACI,SAAS,CAAC,OAAiB;QAChC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAO;QACnB,MAAM,KAAK,GAAG,yBAAiB,CAAC,QAAQ,EAAE,CAAC;QAC3C,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACrD;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,EAAmB;QAC9B,IAAI,MAAsB,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAC1C,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,IAAA,iBAAU,EAAC,EAAE,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IACnF,CAAC;CACF;AA3FD,0BA2FC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporalio/activity",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Temporal.io SDK Activity sub-package",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@temporalio/common": "^1.
|
|
17
|
-
"@temporalio/internal-workflow-common": "^1.3.0",
|
|
16
|
+
"@temporalio/common": "^1.4.1",
|
|
18
17
|
"abort-controller": "^3.0.0"
|
|
19
18
|
},
|
|
20
19
|
"bugs": {
|
|
@@ -28,5 +27,5 @@
|
|
|
28
27
|
"src",
|
|
29
28
|
"lib"
|
|
30
29
|
],
|
|
31
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "f745212e0dcb23896e37d5026978bc96008b1fdd"
|
|
32
31
|
}
|
package/src/index.ts
CHANGED
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
* @module
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
|
-
import { msToNumber } from '@temporalio/internal-workflow-common';
|
|
73
72
|
import { AbortSignal } from 'abort-controller';
|
|
74
73
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
75
|
-
|
|
74
|
+
import { msToNumber } from '@temporalio/common/lib/time';
|
|
75
|
+
|
|
76
76
|
export {
|
|
77
77
|
ActivityFunction,
|
|
78
78
|
ActivityInterface, // eslint-disable-line deprecation/deprecation
|
|
79
|
+
ApplicationFailure,
|
|
80
|
+
CancelledFailure,
|
|
79
81
|
UntypedActivities,
|
|
80
|
-
|
|
81
|
-
errorCode,
|
|
82
|
-
} from '@temporalio/internal-workflow-common';
|
|
82
|
+
} from '@temporalio/common';
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Throw this error from an Activity in order to make the Worker forget about this Activity.
|