@temporalio/activity 1.9.3 → 1.10.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 +3 -4
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +3 -5
package/lib/index.d.ts
CHANGED
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
*/
|
|
71
71
|
/// <reference types="node" />
|
|
72
72
|
/// <reference types="node" />
|
|
73
|
-
import 'abort-controller/polyfill';
|
|
74
73
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
75
74
|
import { Logger, Duration } from '@temporalio/common';
|
|
76
75
|
export { ActivityFunction, ActivityInterface, // eslint-disable-line deprecation/deprecation
|
|
@@ -185,7 +184,7 @@ export declare class Context {
|
|
|
185
184
|
/**
|
|
186
185
|
* Gets the context of the current Activity.
|
|
187
186
|
*
|
|
188
|
-
* Uses {@link https://nodejs.org/docs/latest-
|
|
187
|
+
* Uses {@link https://nodejs.org/docs/latest-v16.x/api/async_context.html#class-asynclocalstorage | AsyncLocalStorage} under the hood to make it accessible in nested callbacks and promises.
|
|
189
188
|
*/
|
|
190
189
|
static current(): Context;
|
|
191
190
|
/**
|
|
@@ -224,8 +223,8 @@ export declare class Context {
|
|
|
224
223
|
* The logger for this Activity.
|
|
225
224
|
*
|
|
226
225
|
* This defaults to the `Runtime`'s Logger (see {@link Runtime.logger}). Attributes from the current Activity context
|
|
227
|
-
*
|
|
228
|
-
*
|
|
226
|
+
* are automatically included as metadata on every log entries. An extra `sdkComponent` metadata attribute is also
|
|
227
|
+
* added, with value `activity`; this can be used for fine-grained filtering of log entries further downstream.
|
|
229
228
|
*
|
|
230
229
|
* To customize log attributes, register a {@link ActivityOutboundCallsInterceptor} that intercepts the
|
|
231
230
|
* `getLogAttributes()` method.
|
package/lib/index.js
CHANGED
|
@@ -77,8 +77,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
77
77
|
};
|
|
78
78
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
79
79
|
exports.cancellationSignal = exports.cancelled = exports.heartbeat = exports.sleep = exports.log = exports.activityInfo = exports.Context = exports.asyncLocalStorage = exports.CompleteAsyncError = exports.CancelledFailure = exports.ApplicationFailure = void 0;
|
|
80
|
-
// Keep this around until we drop support for Node 14.
|
|
81
|
-
require("abort-controller/polyfill"); // eslint-disable-line import/no-unassigned-import
|
|
82
80
|
const node_async_hooks_1 = require("node:async_hooks");
|
|
83
81
|
const time_1 = require("@temporalio/common/lib/time");
|
|
84
82
|
const type_helpers_1 = require("@temporalio/common/lib/type-helpers");
|
|
@@ -128,7 +126,7 @@ class Context {
|
|
|
128
126
|
/**
|
|
129
127
|
* Gets the context of the current Activity.
|
|
130
128
|
*
|
|
131
|
-
* Uses {@link https://nodejs.org/docs/latest-
|
|
129
|
+
* Uses {@link https://nodejs.org/docs/latest-v16.x/api/async_context.html#class-asynclocalstorage | AsyncLocalStorage} under the hood to make it accessible in nested callbacks and promises.
|
|
132
130
|
*/
|
|
133
131
|
static current() {
|
|
134
132
|
const store = exports.asyncLocalStorage.getStore();
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;;;;;;;;;AAEH,uDAAqD;AAErD,sDAAyD;AACzD,sEAAiF;AAEjF,6CAM4B;AAH1B,4GAAA,kBAAkB,OAAA;AAClB,0GAAA,gBAAgB,OAAA;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nD,CAAC;IACD,IAAI,CAAC,OAAe,EAAE,IAAkB;QACtC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IACD,KAAK,CAAC,OAAe,EAAE,IAAkB;QACvC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,EAAY;IAChC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACrC,CAAC;AAFD,sBAEC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,SAAS,CAAC,OAAiB;IACzC,OAAO,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAFD,8BAEC;AAED;;;;;;;;GAQG;AACH,SAAgB,SAAS;IACvB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC;AACrC,CAAC;AAFD,8BAEC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,kBAAkB;IAChC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,kBAAkB,CAAC;AAC9C,CAAC;AAFD,gDAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporalio/activity",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Temporal.io SDK Activity sub-package",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@temporalio/common": "1.
|
|
16
|
+
"@temporalio/common": "1.10.1",
|
|
17
17
|
"abort-controller": "^3.0.0"
|
|
18
18
|
},
|
|
19
19
|
"bugs": {
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"src",
|
|
33
33
|
"lib"
|
|
34
34
|
],
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "a39419f4f9398bd69cc313700af75aea268f80b1"
|
|
36
36
|
}
|
package/src/index.ts
CHANGED
|
@@ -69,8 +69,6 @@
|
|
|
69
69
|
* @module
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
|
-
// Keep this around until we drop support for Node 14.
|
|
73
|
-
import 'abort-controller/polyfill'; // eslint-disable-line import/no-unassigned-import
|
|
74
72
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
75
73
|
import { Logger, Duration, LogLevel, LogMetadata } from '@temporalio/common';
|
|
76
74
|
import { msToNumber } from '@temporalio/common/lib/time';
|
|
@@ -204,7 +202,7 @@ export class Context {
|
|
|
204
202
|
/**
|
|
205
203
|
* Gets the context of the current Activity.
|
|
206
204
|
*
|
|
207
|
-
* Uses {@link https://nodejs.org/docs/latest-
|
|
205
|
+
* Uses {@link https://nodejs.org/docs/latest-v16.x/api/async_context.html#class-asynclocalstorage | AsyncLocalStorage} under the hood to make it accessible in nested callbacks and promises.
|
|
208
206
|
*/
|
|
209
207
|
public static current(): Context {
|
|
210
208
|
const store = asyncLocalStorage.getStore();
|
|
@@ -254,8 +252,8 @@ export class Context {
|
|
|
254
252
|
* The logger for this Activity.
|
|
255
253
|
*
|
|
256
254
|
* This defaults to the `Runtime`'s Logger (see {@link Runtime.logger}). Attributes from the current Activity context
|
|
257
|
-
*
|
|
258
|
-
*
|
|
255
|
+
* are automatically included as metadata on every log entries. An extra `sdkComponent` metadata attribute is also
|
|
256
|
+
* added, with value `activity`; this can be used for fine-grained filtering of log entries further downstream.
|
|
259
257
|
*
|
|
260
258
|
* To customize log attributes, register a {@link ActivityOutboundCallsInterceptor} that intercepts the
|
|
261
259
|
* `getLogAttributes()` method.
|