@temporalio/common 0.18.0 → 0.19.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.
Files changed (97) hide show
  1. package/README.md +5 -11
  2. package/lib/converter/data-converter.d.ts +35 -62
  3. package/lib/converter/data-converter.js +6 -100
  4. package/lib/converter/data-converter.js.map +1 -1
  5. package/lib/{encoding.d.ts → converter/encoding.d.ts} +0 -0
  6. package/lib/{encoding.js → converter/encoding.js} +0 -0
  7. package/lib/converter/encoding.js.map +1 -0
  8. package/lib/converter/patch-protobuf-root.d.ts +8 -0
  9. package/lib/converter/patch-protobuf-root.js +43 -0
  10. package/lib/converter/patch-protobuf-root.js.map +1 -0
  11. package/lib/converter/payload-codec.d.ts +27 -0
  12. package/lib/converter/payload-codec.js +11 -0
  13. package/lib/converter/payload-codec.js.map +1 -0
  14. package/lib/converter/payload-converter.d.ts +63 -62
  15. package/lib/converter/payload-converter.js +113 -68
  16. package/lib/converter/payload-converter.js.map +1 -1
  17. package/lib/converter/payload-converters.d.ts +31 -0
  18. package/lib/converter/payload-converters.js +85 -0
  19. package/lib/converter/payload-converters.js.map +1 -0
  20. package/lib/converter/protobuf-payload-converters.d.ts +53 -0
  21. package/lib/converter/protobuf-payload-converters.js +159 -0
  22. package/lib/converter/protobuf-payload-converters.js.map +1 -0
  23. package/lib/converter/types.d.ts +4 -2
  24. package/lib/converter/types.js +3 -2
  25. package/lib/converter/types.js.map +1 -1
  26. package/lib/failure.d.ts +7 -7
  27. package/lib/failure.js +30 -32
  28. package/lib/failure.js.map +1 -1
  29. package/lib/index.d.ts +9 -11
  30. package/lib/index.js +12 -16
  31. package/lib/index.js.map +1 -1
  32. package/lib/protobufs.d.ts +13 -0
  33. package/lib/protobufs.js +31 -0
  34. package/lib/protobufs.js.map +1 -0
  35. package/package.json +11 -8
  36. package/src/converter/data-converter.ts +39 -175
  37. package/src/{encoding.ts → converter/encoding.ts} +0 -0
  38. package/src/converter/patch-protobuf-root.ts +49 -0
  39. package/src/converter/payload-codec.ts +30 -0
  40. package/src/converter/payload-converter.ts +122 -102
  41. package/src/converter/payload-converters.ts +89 -0
  42. package/src/converter/protobuf-payload-converters.ts +192 -0
  43. package/src/converter/types.ts +6 -3
  44. package/src/failure.ts +35 -39
  45. package/src/index.ts +9 -11
  46. package/src/protobufs.ts +15 -0
  47. package/tsconfig.json +2 -2
  48. package/tsconfig.tsbuildinfo +1 -1
  49. package/lib/activity-options.d.ts +0 -81
  50. package/lib/activity-options.js +0 -14
  51. package/lib/activity-options.js.map +0 -1
  52. package/lib/encoding.js.map +0 -1
  53. package/lib/errors.d.ts +0 -45
  54. package/lib/errors.js +0 -76
  55. package/lib/errors.js.map +0 -1
  56. package/lib/interceptors.d.ts +0 -18
  57. package/lib/interceptors.js +0 -24
  58. package/lib/interceptors.js.map +0 -1
  59. package/lib/interfaces.d.ts +0 -31
  60. package/lib/interfaces.js +0 -3
  61. package/lib/interfaces.js.map +0 -1
  62. package/lib/otel.d.ts +0 -26
  63. package/lib/otel.js +0 -82
  64. package/lib/otel.js.map +0 -1
  65. package/lib/retry-policy.d.ts +0 -43
  66. package/lib/retry-policy.js +0 -36
  67. package/lib/retry-policy.js.map +0 -1
  68. package/lib/time.d.ts +0 -17
  69. package/lib/time.js +0 -77
  70. package/lib/time.js.map +0 -1
  71. package/lib/tls-config.d.ts +0 -32
  72. package/lib/tls-config.js +0 -11
  73. package/lib/tls-config.js.map +0 -1
  74. package/lib/type-helpers.d.ts +0 -12
  75. package/lib/type-helpers.js +0 -17
  76. package/lib/type-helpers.js.map +0 -1
  77. package/lib/utils.d.ts +0 -4
  78. package/lib/utils.js +0 -11
  79. package/lib/utils.js.map +0 -1
  80. package/lib/workflow-handle.d.ts +0 -27
  81. package/lib/workflow-handle.js +0 -3
  82. package/lib/workflow-handle.js.map +0 -1
  83. package/lib/workflow-options.d.ts +0 -92
  84. package/lib/workflow-options.js +0 -26
  85. package/lib/workflow-options.js.map +0 -1
  86. package/src/activity-options.ts +0 -97
  87. package/src/errors.ts +0 -60
  88. package/src/interceptors.ts +0 -32
  89. package/src/interfaces.ts +0 -37
  90. package/src/otel.ts +0 -61
  91. package/src/retry-policy.ts +0 -73
  92. package/src/time.ts +0 -76
  93. package/src/tls-config.ts +0 -35
  94. package/src/type-helpers.ts +0 -26
  95. package/src/utils.ts +0 -6
  96. package/src/workflow-handle.ts +0 -30
  97. package/src/workflow-options.ts +0 -128
package/lib/otel.js DELETED
@@ -1,82 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.linkSpans = exports.headersWithContext = exports.extractSpanContextFromHeaders = exports.extractContextFromHeaders = exports.NUM_JOBS_ATTR_KEY = exports.TASK_TOKEN_ATTR_KEY = exports.RUN_ID_ATTR_KEY = exports.TRACE_HEADER = void 0;
23
- const otel = __importStar(require("@opentelemetry/api"));
24
- const data_converter_1 = require("./converter/data-converter");
25
- /** Default trace header for opentelemetry interceptors */
26
- exports.TRACE_HEADER = '_tracer-data';
27
- /** As in workflow run id */
28
- exports.RUN_ID_ATTR_KEY = 'run_id';
29
- /** For a workflow or activity task */
30
- exports.TASK_TOKEN_ATTR_KEY = 'task_token';
31
- /** Number of jobs in a workflow activation */
32
- exports.NUM_JOBS_ATTR_KEY = 'num_jobs';
33
- /**
34
- * If found, return an otel Context deserialized from the provided headers
35
- */
36
- async function extractContextFromHeaders(headers) {
37
- const encodedSpanContext = headers[exports.TRACE_HEADER];
38
- if (encodedSpanContext === undefined) {
39
- return undefined;
40
- }
41
- const textMap = await data_converter_1.defaultDataConverter.fromPayload(encodedSpanContext);
42
- return otel.propagation.extract(otel.context.active(), textMap, otel.defaultTextMapGetter);
43
- }
44
- exports.extractContextFromHeaders = extractContextFromHeaders;
45
- /**
46
- * If found, return an otel SpanContext deserialized from the provided headers
47
- */
48
- async function extractSpanContextFromHeaders(headers) {
49
- const context = await extractContextFromHeaders(headers);
50
- if (context === undefined) {
51
- return undefined;
52
- }
53
- return otel.trace.getSpanContext(context);
54
- }
55
- exports.extractSpanContextFromHeaders = extractSpanContextFromHeaders;
56
- /**
57
- * Given headers, return new headers with the current otel context inserted
58
- */
59
- async function headersWithContext(headers) {
60
- const carrier = {};
61
- otel.propagation.inject(otel.context.active(), carrier, otel.defaultTextMapSetter);
62
- return { ...headers, [exports.TRACE_HEADER]: await data_converter_1.defaultDataConverter.toPayload(carrier) };
63
- }
64
- exports.headersWithContext = headersWithContext;
65
- /**
66
- * Link a span to an maybe-existing span context
67
- */
68
- function linkSpans(fromSpan, toContext) {
69
- if (toContext !== undefined) {
70
- // TODO: I have to go around typescript because otel api 😢
71
- // See https://github.com/open-telemetry/opentelemetry-js-api/issues/124
72
- const links = fromSpan.links;
73
- if (links === undefined) {
74
- fromSpan.links = [{ context: toContext }];
75
- }
76
- else {
77
- links.push({ context: toContext });
78
- }
79
- }
80
- }
81
- exports.linkSpans = linkSpans;
82
- //# sourceMappingURL=otel.js.map
package/lib/otel.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"otel.js","sourceRoot":"","sources":["../src/otel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAC3C,+DAAkE;AAGlE,0DAA0D;AAC7C,QAAA,YAAY,GAAG,cAAc,CAAC;AAC3C,4BAA4B;AACf,QAAA,eAAe,GAAG,QAAQ,CAAC;AACxC,sCAAsC;AACzB,QAAA,mBAAmB,GAAG,YAAY,CAAC;AAChD,8CAA8C;AACjC,QAAA,iBAAiB,GAAG,UAAU,CAAC;AAE5C;;GAEG;AACI,KAAK,UAAU,yBAAyB,CAAC,OAAgB;IAC9D,MAAM,kBAAkB,GAAG,OAAO,CAAC,oBAAY,CAAC,CAAC;IACjD,IAAI,kBAAkB,KAAK,SAAS,EAAE;QACpC,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,OAAO,GAA2B,MAAM,qCAAoB,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACnG,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAC7F,CAAC;AAPD,8DAOC;AAED;;GAEG;AACI,KAAK,UAAU,6BAA6B,CAAC,OAAgB;IAClE,MAAM,OAAO,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACzD,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC;AAPD,sEAOC;AAED;;GAEG;AACI,KAAK,UAAU,kBAAkB,CAAC,OAAgB;IACvD,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACnF,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,oBAAY,CAAC,EAAE,MAAM,qCAAoB,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AACvF,CAAC;AAJD,gDAIC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,QAAmB,EAAE,SAA4B;IACzE,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,2DAA2D;QAC3D,yEAAyE;QACzE,MAAM,KAAK,GAAI,QAAgB,CAAC,KAAK,CAAC;QACtC,IAAI,KAAK,KAAK,SAAS,EAAE;YACtB,QAAgB,CAAC,KAAK,GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;SACpD;aAAM;YACL,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;SACpC;KACF;AACH,CAAC;AAXD,8BAWC"}
@@ -1,43 +0,0 @@
1
- import type { temporal } from '@temporalio/proto';
2
- /**
3
- * Options for retrying Workflows and Activities
4
- */
5
- export interface RetryPolicy {
6
- /**
7
- * Coefficient used to calculate the next retry interval.
8
- * The next retry interval is previous interval multiplied by this coefficient.
9
- * @minimum 1
10
- * @default 2
11
- */
12
- backoffCoefficient?: number;
13
- /**
14
- * Interval of the first retry.
15
- * If coefficient is 1 then it is used for all retries
16
- * @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
17
- * @default 1 second
18
- */
19
- initialInterval?: string | number;
20
- /**
21
- * Maximum number of attempts. When exceeded the retries stop even if not expired yet.
22
- * @minimum 1
23
- * @default Infinity
24
- */
25
- maximumAttempts?: number;
26
- /**
27
- * Maximum interval between retries.
28
- * Exponential backoff leads to interval increase.
29
- * This value is the cap of the increase.
30
- *
31
- * @default 100x of {@link initialInterval}
32
- * @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
33
- */
34
- maximumInterval?: string | number;
35
- /**
36
- * List of application failures types to not retry.
37
- */
38
- nonRetryableErrorTypes?: string[];
39
- }
40
- /**
41
- * Turns a TS RetryPolicy into a proto compatible RetryPolicy
42
- */
43
- export declare function compileRetryPolicy(retryPolicy: RetryPolicy): temporal.api.common.v1.IRetryPolicy;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compileRetryPolicy = void 0;
4
- const _1 = require(".");
5
- const time_1 = require("./time");
6
- /**
7
- * Turns a TS RetryPolicy into a proto compatible RetryPolicy
8
- */
9
- function compileRetryPolicy(retryPolicy) {
10
- if (retryPolicy.backoffCoefficient != null && retryPolicy.backoffCoefficient <= 0) {
11
- throw new _1.ValueError('RetryPolicy.backoffCoefficient must be greater than 0');
12
- }
13
- if (retryPolicy.maximumAttempts != null && retryPolicy.maximumAttempts <= 0) {
14
- throw new _1.ValueError('RetryPolicy.maximumAttempts must be greater than 0');
15
- }
16
- const maximumInterval = (0, time_1.msOptionalToNumber)(retryPolicy.maximumInterval);
17
- const initialInterval = (0, time_1.msToNumber)(retryPolicy.initialInterval ?? 1000);
18
- if (maximumInterval === 0) {
19
- throw new _1.ValueError('RetryPolicy.maximumInterval cannot be 0');
20
- }
21
- if (initialInterval === 0) {
22
- throw new _1.ValueError('RetryPolicy.initialInterval cannot be 0');
23
- }
24
- if (maximumInterval != null && maximumInterval < initialInterval) {
25
- throw new _1.ValueError('RetryPolicy.maximumInterval cannot be less than its initialInterval');
26
- }
27
- return {
28
- maximumAttempts: retryPolicy.maximumAttempts,
29
- initialInterval: (0, time_1.msToTs)(initialInterval),
30
- maximumInterval: (0, time_1.msOptionalToTs)(maximumInterval),
31
- backoffCoefficient: retryPolicy.backoffCoefficient,
32
- nonRetryableErrorTypes: retryPolicy.nonRetryableErrorTypes,
33
- };
34
- }
35
- exports.compileRetryPolicy = compileRetryPolicy;
36
- //# sourceMappingURL=retry-policy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retry-policy.js","sourceRoot":"","sources":["../src/retry-policy.ts"],"names":[],"mappings":";;;AACA,wBAA+B;AAC/B,iCAAgF;AA0ChF;;GAEG;AACH,SAAgB,kBAAkB,CAAC,WAAwB;IACzD,IAAI,WAAW,CAAC,kBAAkB,IAAI,IAAI,IAAI,WAAW,CAAC,kBAAkB,IAAI,CAAC,EAAE;QACjF,MAAM,IAAI,aAAU,CAAC,uDAAuD,CAAC,CAAC;KAC/E;IACD,IAAI,WAAW,CAAC,eAAe,IAAI,IAAI,IAAI,WAAW,CAAC,eAAe,IAAI,CAAC,EAAE;QAC3E,MAAM,IAAI,aAAU,CAAC,oDAAoD,CAAC,CAAC;KAC5E;IACD,MAAM,eAAe,GAAG,IAAA,yBAAkB,EAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACxE,MAAM,eAAe,GAAG,IAAA,iBAAU,EAAC,WAAW,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC;IACxE,IAAI,eAAe,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,aAAU,CAAC,yCAAyC,CAAC,CAAC;KACjE;IACD,IAAI,eAAe,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,aAAU,CAAC,yCAAyC,CAAC,CAAC;KACjE;IACD,IAAI,eAAe,IAAI,IAAI,IAAI,eAAe,GAAG,eAAe,EAAE;QAChE,MAAM,IAAI,aAAU,CAAC,qEAAqE,CAAC,CAAC;KAC7F;IACD,OAAO;QACL,eAAe,EAAE,WAAW,CAAC,eAAe;QAC5C,eAAe,EAAE,IAAA,aAAM,EAAC,eAAe,CAAC;QACxC,eAAe,EAAE,IAAA,qBAAc,EAAC,eAAe,CAAC;QAChD,kBAAkB,EAAE,WAAW,CAAC,kBAAkB;QAClD,sBAAsB,EAAE,WAAW,CAAC,sBAAsB;KAC3D,CAAC;AACJ,CAAC;AAzBD,gDAyBC"}
package/lib/time.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import type * as iface from '@temporalio/proto/lib/coresdk';
2
- export declare type Timestamp = iface.google.protobuf.ITimestamp;
3
- /**
4
- * Lossy conversion function from Timestamp to number due to possible overflow.
5
- * If ts is null or undefined returns undefined.
6
- */
7
- export declare function optionalTsToMs(ts: Timestamp | null | undefined): number | undefined;
8
- /**
9
- * Lossy conversion function from Timestamp to number due to possible overflow
10
- */
11
- export declare function tsToMs(ts: Timestamp | null | undefined): number;
12
- export declare function msNumberToTs(millis: number): Timestamp;
13
- export declare function falsyMsToTs(str: string | number | undefined): Timestamp | undefined;
14
- export declare function msToTs(str: string | number): Timestamp;
15
- export declare function msOptionalToTs(str: string | number | undefined): Timestamp | undefined;
16
- export declare function msOptionalToNumber(val: string | number | undefined): number | undefined;
17
- export declare function msToNumber(val: string | number): number;
package/lib/time.js DELETED
@@ -1,77 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.msToNumber = exports.msOptionalToNumber = exports.msOptionalToTs = exports.msToTs = exports.falsyMsToTs = exports.msNumberToTs = exports.tsToMs = exports.optionalTsToMs = void 0;
7
- const long_1 = __importDefault(require("long"));
8
- const ms_1 = __importDefault(require("ms"));
9
- const errors_1 = require("./errors");
10
- /**
11
- * Lossy conversion function from Timestamp to number due to possible overflow.
12
- * If ts is null or undefined returns undefined.
13
- */
14
- function optionalTsToMs(ts) {
15
- if (ts === undefined || ts === null) {
16
- return undefined;
17
- }
18
- return tsToMs(ts);
19
- }
20
- exports.optionalTsToMs = optionalTsToMs;
21
- /**
22
- * Lossy conversion function from Timestamp to number due to possible overflow
23
- */
24
- function tsToMs(ts) {
25
- if (ts === undefined || ts === null) {
26
- throw new Error(`Expected timestamp, got ${ts}`);
27
- }
28
- const { seconds, nanos } = ts;
29
- return (seconds || long_1.default.UZERO)
30
- .mul(1000)
31
- .add(Math.floor((nanos || 0) / 1000000))
32
- .toNumber();
33
- }
34
- exports.tsToMs = tsToMs;
35
- function msNumberToTs(millis) {
36
- const seconds = Math.floor(millis / 1000);
37
- const nanos = (millis % 1000) * 1000000;
38
- if (Number.isNaN(seconds) || Number.isNaN(nanos)) {
39
- throw new errors_1.ValueError(`Invalid millis ${millis}`);
40
- }
41
- return { seconds: long_1.default.fromNumber(seconds), nanos };
42
- }
43
- exports.msNumberToTs = msNumberToTs;
44
- function falsyMsToTs(str) {
45
- return str ? msToTs(str) : undefined;
46
- }
47
- exports.falsyMsToTs = falsyMsToTs;
48
- function msToTs(str) {
49
- if (typeof str === 'number') {
50
- return msNumberToTs(str);
51
- }
52
- return msNumberToTs((0, ms_1.default)(str));
53
- }
54
- exports.msToTs = msToTs;
55
- function msOptionalToTs(str) {
56
- if (str === undefined)
57
- return undefined;
58
- if (typeof str === 'number') {
59
- return msNumberToTs(str);
60
- }
61
- return msNumberToTs((0, ms_1.default)(str));
62
- }
63
- exports.msOptionalToTs = msOptionalToTs;
64
- function msOptionalToNumber(val) {
65
- if (val === undefined)
66
- return undefined;
67
- return msToNumber(val);
68
- }
69
- exports.msOptionalToNumber = msOptionalToNumber;
70
- function msToNumber(val) {
71
- if (typeof val === 'number') {
72
- return val;
73
- }
74
- return (0, ms_1.default)(val);
75
- }
76
- exports.msToNumber = msToNumber;
77
- //# sourceMappingURL=time.js.map
package/lib/time.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,4CAAoB;AAEpB,qCAAsC;AAStC;;;GAGG;AACH,SAAgB,cAAc,CAAC,EAAgC;IAC7D,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,IAAI,EAAE;QACnC,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC;AACpB,CAAC;AALD,wCAKC;AAED;;GAEG;AACH,SAAgB,MAAM,CAAC,EAAgC;IACrD,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,IAAI,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAC;KAClD;IACD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IAC9B,OAAO,CAAC,OAAO,IAAI,cAAI,CAAC,KAAK,CAAC;SAC3B,GAAG,CAAC,IAAI,CAAC;SACT,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;SACvC,QAAQ,EAAE,CAAC;AAChB,CAAC;AATD,wBASC;AAED,SAAgB,YAAY,CAAC,MAAc;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC;IACxC,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QAChD,MAAM,IAAI,mBAAU,CAAC,kBAAkB,MAAM,EAAE,CAAC,CAAC;KAClD;IACD,OAAO,EAAE,OAAO,EAAE,cAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC;AACtD,CAAC;AAPD,oCAOC;AAED,SAAgB,WAAW,CAAC,GAAgC;IAC1D,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvC,CAAC;AAFD,kCAEC;AAED,SAAgB,MAAM,CAAC,GAAoB;IACzC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;KAC1B;IACD,OAAO,YAAY,CAAC,IAAA,YAAE,EAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC;AALD,wBAKC;AAED,SAAgB,cAAc,CAAC,GAAgC;IAC7D,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;KAC1B;IACD,OAAO,YAAY,CAAC,IAAA,YAAE,EAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC;AAND,wCAMC;AAED,SAAgB,kBAAkB,CAAC,GAAgC;IACjE,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAHD,gDAGC;AAED,SAAgB,UAAU,CAAC,GAAoB;IAC7C,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,IAAA,YAAE,EAAC,GAAG,CAAC,CAAC;AACjB,CAAC;AALD,gCAKC"}
@@ -1,32 +0,0 @@
1
- /// <reference types="node" />
2
- /** TLS configuration options. */
3
- export interface TLSConfig {
4
- /**
5
- * Overrides the target name used for SSL host name checking.
6
- * If this attribute is not specified, the name used for SSL host name checking will be the host from {@link ServerOptions.url}.
7
- * This _should_ be used for testing only.
8
- */
9
- serverNameOverride?: string;
10
- /**
11
- * Root CA certificate used by the server. If not set, and the server's
12
- * cert is issued by someone the operating system trusts, verification will still work (ex: Cloud offering).
13
- */
14
- serverRootCACertificate?: Buffer;
15
- /** Sets the client certificate and key for connecting with mTLS */
16
- clientCertPair?: {
17
- /** The certificate for this client */
18
- crt: Buffer;
19
- /** The private key for this client */
20
- key: Buffer;
21
- };
22
- }
23
- /**
24
- * TLS configuration.
25
- * Pass a falsy value to use a non-encrypted connection or `true` or `{}` to
26
- * connect with TLS without any customization.
27
- */
28
- export declare type TLSConfigOption = TLSConfig | boolean | null;
29
- /**
30
- * Normalize {@link TLSConfigOption} by turning false and null to undefined and true to and empty object
31
- */
32
- export declare function normalizeTlsConfig(tls?: TLSConfigOption): TLSConfig | undefined;
package/lib/tls-config.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeTlsConfig = void 0;
4
- /**
5
- * Normalize {@link TLSConfigOption} by turning false and null to undefined and true to and empty object
6
- */
7
- function normalizeTlsConfig(tls) {
8
- return typeof tls === 'object' ? (tls === null ? undefined : tls) : tls ? {} : undefined;
9
- }
10
- exports.normalizeTlsConfig = normalizeTlsConfig;
11
- //# sourceMappingURL=tls-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tls-config.js","sourceRoot":"","sources":["../src/tls-config.ts"],"names":[],"mappings":";;;AA6BA;;GAEG;AACH,SAAgB,kBAAkB,CAAC,GAAqB;IACtD,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3F,CAAC;AAFD,gDAEC"}
@@ -1,12 +0,0 @@
1
- /** Shorthand alias */
2
- export declare type AnyFunc = (...args: any[]) => any;
3
- /** A tuple without its last element */
4
- export declare type OmitLast<T> = T extends [...infer REST, any] ? REST : never;
5
- /** F with all arguments but the last */
6
- export declare type OmitLastParam<F extends AnyFunc> = (...args: OmitLast<Parameters<F>>) => ReturnType<F>;
7
- /** Verify that an type _Copy extends _Orig */
8
- export declare function checkExtends<_Orig, _Copy extends _Orig>(): void;
9
- export declare type Replace<Base, New> = Omit<Base, keyof New> & New;
10
- export declare type MakeOptional<Base, Keys extends keyof Base> = Omit<Base, Keys> & Partial<Pick<Base, Keys>>;
11
- export declare function isRecord(value: unknown): value is Record<string, unknown>;
12
- export declare function hasOwnProperties<X extends Record<string, unknown>, Y extends PropertyKey>(record: X, props: Y[]): record is X & Record<Y, unknown>;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasOwnProperties = exports.isRecord = exports.checkExtends = void 0;
4
- /** Verify that an type _Copy extends _Orig */
5
- function checkExtends() {
6
- // noop, just type check
7
- }
8
- exports.checkExtends = checkExtends;
9
- function isRecord(value) {
10
- return typeof value === 'object' && value !== null;
11
- }
12
- exports.isRecord = isRecord;
13
- function hasOwnProperties(record, props) {
14
- return props.every((prop) => prop in record);
15
- }
16
- exports.hasOwnProperties = hasOwnProperties;
17
- //# sourceMappingURL=type-helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-helpers.js","sourceRoot":"","sources":["../src/type-helpers.ts"],"names":[],"mappings":";;;AAOA,8CAA8C;AAC9C,SAAgB,YAAY;IAC1B,wBAAwB;AAC1B,CAAC;AAFD,oCAEC;AAMD,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAFD,4BAEC;AAED,SAAgB,gBAAgB,CAC9B,MAAS,EACT,KAAU;IAEV,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC;AAC/C,CAAC;AALD,4CAKC"}
package/lib/utils.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /**
2
- * Helper to prevent undefined and null values overriding defaults when merging maps
3
- */
4
- export declare function filterNullAndUndefined<T extends Record<string, any>>(obj: T): T;
package/lib/utils.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterNullAndUndefined = void 0;
4
- /**
5
- * Helper to prevent undefined and null values overriding defaults when merging maps
6
- */
7
- function filterNullAndUndefined(obj) {
8
- return Object.fromEntries(Object.entries(obj).filter(([_k, v]) => v != null));
9
- }
10
- exports.filterNullAndUndefined = filterNullAndUndefined;
11
- //# sourceMappingURL=utils.js.map
package/lib/utils.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,sBAAsB,CAAgC,GAAM;IAC1E,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAQ,CAAC;AACvF,CAAC;AAFD,wDAEC"}
@@ -1,27 +0,0 @@
1
- import { Workflow, WorkflowResultType, SignalDefinition } from './interfaces';
2
- /**
3
- * Base WorkflowHandle interface, extended in workflow and client libs.
4
- *
5
- * Transforms a workflow interface `T` into a client interface.
6
- */
7
- export interface BaseWorkflowHandle<T extends Workflow> {
8
- /**
9
- * Promise that resolves when Workflow execution completes
10
- */
11
- result(): Promise<WorkflowResultType<T>>;
12
- /**
13
- * Signal a running Workflow.
14
- *
15
- * @param def a signal definition as returned from {@link defineSignal}
16
- *
17
- * @example
18
- * ```ts
19
- * await handle.signal(incrementSignal, 3);
20
- * ```
21
- */
22
- signal<Args extends any[] = []>(def: SignalDefinition<Args> | string, ...args: Args): Promise<void>;
23
- /**
24
- * The workflowId of the current Workflow
25
- */
26
- readonly workflowId: string;
27
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=workflow-handle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow-handle.js","sourceRoot":"","sources":["../src/workflow-handle.ts"],"names":[],"mappings":""}
@@ -1,92 +0,0 @@
1
- import type { google } from '@temporalio/proto/lib/coresdk';
2
- import { Workflow } from './interfaces';
3
- import { Replace } from './type-helpers';
4
- import { RetryPolicy } from './retry-policy';
5
- export declare enum WorkflowIdReusePolicy {
6
- WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED = 0,
7
- WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE = 1,
8
- WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY = 2,
9
- WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE = 3
10
- }
11
- export interface BaseWorkflowOptions {
12
- /**
13
- * Specifies server behavior if a completed workflow with the same id exists. Note that under no
14
- * conditions Temporal allows two workflows with the same namespace and workflow id run
15
- * simultaneously.
16
- * ALLOW_DUPLICATE_FAILED_ONLY is a default value. It means that workflow can start if
17
- * previous run failed or was canceled or terminated.
18
- * ALLOW_DUPLICATE allows new run independently of the previous run closure status.
19
- * REJECT_DUPLICATE doesn't allow new run independently of the previous run closure status.
20
- */
21
- workflowIdReusePolicy?: WorkflowIdReusePolicy;
22
- /**
23
- * Controls how a Workflow is retried.
24
- *
25
- * Workflows should typically use the system default, do not set this unless
26
- * you know what you're doing.
27
- */
28
- retry?: RetryPolicy;
29
- /**
30
- * Optional cron schedule for Workflow. If a cron schedule is specified, the Workflow will run
31
- * as a cron based on the schedule. The scheduling will be based on UTC time. The schedule for the next run only happens
32
- * after the current run is completed/failed/timeout. If a RetryPolicy is also supplied, and the Workflow failed
33
- * or timed out, the Workflow will be retried based on the retry policy. While the Workflow is retrying, it won't
34
- * schedule its next run. If the next schedule is due while the Workflow is running (or retrying), then it will skip that
35
- * schedule. Cron Workflow will not stop until it is terminated or cancelled (by returning temporal.CanceledError).
36
- * https://crontab.guru/ is useful for testing your cron expressions.
37
- */
38
- cronSchedule?: string;
39
- /**
40
- * Specifies additional non-indexed information in result of list workflow. The type of value
41
- * can be any object that are serializable by `DataConverter`.
42
- */
43
- memo?: Record<string, any>;
44
- /**
45
- * Specifies additional indexed information in result of list workflow. The type of value should
46
- * be a primitive (e.g. string, number, boolean), for dates use Date.toISOString();
47
- */
48
- searchAttributes?: Record<string, string | number | boolean>;
49
- }
50
- export declare type WithWorkflowArgs<W extends Workflow, T> = T & (Parameters<W> extends [any, ...any[]] ? {
51
- /**
52
- * Arguments to pass to the Workflow
53
- */
54
- args: Parameters<W>;
55
- } : {
56
- /**
57
- * Arguments to pass to the Workflow
58
- */
59
- args?: Parameters<W>;
60
- });
61
- export interface WorkflowDurationOptions {
62
- /**
63
- * The time after which workflow run is automatically terminated by Temporal service. Do not
64
- * rely on run timeout for business level timeouts. It is preferred to use in workflow timers
65
- * for this purpose.
66
- *
67
- * @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
68
- */
69
- workflowRunTimeout?: string | number;
70
- /**
71
- *
72
- * The time after which workflow execution (which includes run retries and continue as new) is
73
- * automatically terminated by Temporal service. Do not rely on execution timeout for business
74
- * level timeouts. It is preferred to use in workflow timers for this purpose.
75
- *
76
- * @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
77
- */
78
- workflowExecutionTimeout?: string | number;
79
- /**
80
- * Maximum execution time of a single workflow task. Default is 10 seconds.
81
- *
82
- * @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
83
- */
84
- workflowTaskTimeout?: string | number;
85
- }
86
- export declare type CommonWorkflowOptions = BaseWorkflowOptions & WorkflowDurationOptions;
87
- export declare type WithCompiledWorkflowDurationOptions<T extends WorkflowDurationOptions> = Replace<T, {
88
- workflowExecutionTimeout?: google.protobuf.IDuration;
89
- workflowRunTimeout?: google.protobuf.IDuration;
90
- workflowTaskTimeout?: google.protobuf.IDuration;
91
- }>;
92
- export declare function compileWorkflowOptions<T extends WorkflowDurationOptions>(options: T): WithCompiledWorkflowDurationOptions<T>;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compileWorkflowOptions = exports.WorkflowIdReusePolicy = void 0;
4
- const time_1 = require("./time");
5
- const type_helpers_1 = require("./type-helpers");
6
- // Avoid importing the proto implementation to reduce workflow bundle size
7
- // Copied from coresdk.common.WorkflowIdReusePolicy
8
- var WorkflowIdReusePolicy;
9
- (function (WorkflowIdReusePolicy) {
10
- WorkflowIdReusePolicy[WorkflowIdReusePolicy["WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED"] = 0] = "WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED";
11
- WorkflowIdReusePolicy[WorkflowIdReusePolicy["WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE"] = 1] = "WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE";
12
- WorkflowIdReusePolicy[WorkflowIdReusePolicy["WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY"] = 2] = "WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY";
13
- WorkflowIdReusePolicy[WorkflowIdReusePolicy["WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE"] = 3] = "WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE";
14
- })(WorkflowIdReusePolicy = exports.WorkflowIdReusePolicy || (exports.WorkflowIdReusePolicy = {}));
15
- (0, type_helpers_1.checkExtends)();
16
- function compileWorkflowOptions(options) {
17
- const { workflowExecutionTimeout, workflowRunTimeout, workflowTaskTimeout, ...rest } = options;
18
- return {
19
- ...rest,
20
- workflowExecutionTimeout: (0, time_1.falsyMsToTs)(workflowExecutionTimeout),
21
- workflowRunTimeout: (0, time_1.falsyMsToTs)(workflowRunTimeout),
22
- workflowTaskTimeout: (0, time_1.falsyMsToTs)(workflowTaskTimeout),
23
- };
24
- }
25
- exports.compileWorkflowOptions = compileWorkflowOptions;
26
- //# sourceMappingURL=workflow-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow-options.js","sourceRoot":"","sources":["../src/workflow-options.ts"],"names":[],"mappings":";;;AAEA,iCAAqC;AAGrC,iDAA8C;AAE9C,0EAA0E;AAC1E,mDAAmD;AACnD,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,iIAAwC,CAAA;IACxC,yIAA4C,CAAA;IAC5C,iKAAwD,CAAA;IACxD,2IAA6C,CAAA;AAC/C,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC;AAED,IAAA,2BAAY,GAA+D,CAAC;AAoG5E,SAAgB,sBAAsB,CACpC,OAAU;IAEV,MAAM,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAE/F,OAAO;QACL,GAAG,IAAI;QACP,wBAAwB,EAAE,IAAA,kBAAW,EAAC,wBAAwB,CAAC;QAC/D,kBAAkB,EAAE,IAAA,kBAAW,EAAC,kBAAkB,CAAC;QACnD,mBAAmB,EAAE,IAAA,kBAAW,EAAC,mBAAmB,CAAC;KACtD,CAAC;AACJ,CAAC;AAXD,wDAWC"}
@@ -1,97 +0,0 @@
1
- import type { coresdk } from '@temporalio/proto/lib/coresdk';
2
- import { RetryPolicy } from './retry-policy';
3
- import { checkExtends } from './type-helpers';
4
-
5
- // Avoid importing the proto implementation to reduce workflow bundle size
6
- // Copied from coresdk.workflow_commands.ActivityCancellationType
7
- export enum ActivityCancellationType {
8
- TRY_CANCEL = 0,
9
- WAIT_CANCELLATION_COMPLETED = 1,
10
- ABANDON = 2,
11
- }
12
-
13
- checkExtends<coresdk.workflow_commands.ActivityCancellationType, ActivityCancellationType>();
14
-
15
- /**
16
- * Options for remote activity invocation - will be processed from a task queue.
17
- * @see https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/activity/ActivityOptions.Builder.html
18
- */
19
- export interface ActivityOptions {
20
- /**
21
- * Identifier to use for tracking the activity in Workflow history.
22
- * The `activityId` can be accessed by the activity function.
23
- * Does not need to be unique.
24
- *
25
- * @default an incremental sequence number
26
- */
27
- activityId?: string;
28
-
29
- /**
30
- * Namespace to schedule this activity in.
31
- * @default current worker namespace
32
- */
33
- namespace?: string;
34
-
35
- /**
36
- * Task queue name.
37
- *
38
- * @default current worker task queue
39
- */
40
- taskQueue?: string;
41
-
42
- /**
43
- * Heartbeat interval. Activity must heartbeat before this interval passes after a last heartbeat or activity start.
44
- * @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
45
- */
46
- heartbeatTimeout?: string | number;
47
-
48
- /**
49
- * RetryPolicy that define how activity is retried in case of failure. If this is not set, then the server-defined default activity retry policy will be used. To ensure zero retries, set maximum attempts to 1.
50
- */
51
- retry?: RetryPolicy;
52
-
53
- /**
54
- * Maximum time of a single Activity execution attempt.
55
- Note that the Temporal Server doesn't detect Worker process failures directly. It relies on this timeout to detect that an Activity that didn't complete on time. So this timeout should be as short as the longest possible execution of the Activity body. Potentially long running Activities must specify {@link heartbeatTimeout} and call {@link activity.Context.heartbeat} periodically for timely failure detection.
56
-
57
- * Either this option or {@link scheduleToCloseTimeout} is required.
58
- * @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
59
- */
60
- startToCloseTimeout?: string | number;
61
- /**
62
- * Time that the Activity Task can stay in the Task Queue before it is picked up by a Worker. Do not specify this timeout unless using host specific Task Queues for Activity Tasks are being used for routing.
63
- * `scheduleToStartTimeout` is always non-retryable. Retrying after this timeout doesn't make sense as it would just put the Activity Task back into the same Task Queue.
64
- * @default unlimited
65
- * @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
66
- */
67
- scheduleToStartTimeout?: string | number;
68
-
69
- /**
70
- * Total time that a workflow is willing to wait for Activity to complete.
71
- * `scheduleToCloseTimeout` limits the total time of an Activity's execution including retries (use {@link startToCloseTimeout} to limit the time of a single attempt).
72
- *
73
- * Either this option or {@link startToCloseTimeout} is required
74
- * @default unlimited
75
- * @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
76
- */
77
- scheduleToCloseTimeout?: string | number;
78
-
79
- /**
80
- * Determines what the SDK does when the Activity is cancelled.
81
- * - `TRY_CANCEL` - Initiate a cancellation request and immediately report cancellation to the workflow.
82
- * - `WAIT_CANCELLATION_COMPLETED` - Wait for activity cancellation completion. Note that activity must heartbeat to receive a
83
- * cancellation notification. This can block the cancellation for a long time if activity doesn't
84
- * heartbeat or chooses to ignore the cancellation request.
85
- * - `ABANDON` - Do not request cancellation of the activity and immediately report cancellation to the workflow.
86
- */
87
- cancellationType?: coresdk.workflow_commands.ActivityCancellationType;
88
- }
89
-
90
- export interface ActivityFunction<P extends any[], R> {
91
- (...args: P): Promise<R>;
92
- }
93
-
94
- /**
95
- * Mapping of Activity name to function
96
- */
97
- export type ActivityInterface = Record<string, ActivityFunction<any[], any>>;