nestjs-temporal-core 2.0.5 → 2.0.7
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/README.md +434 -325
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/temporal-client.module.js +6 -6
- package/dist/client/temporal-client.module.js.map +1 -1
- package/dist/client/temporal-client.service.d.ts +0 -2
- package/dist/client/temporal-client.service.js +1 -35
- package/dist/client/temporal-client.service.js.map +1 -1
- package/dist/{schedule → client}/temporal-schedule.service.d.ts +4 -13
- package/dist/{schedule → client}/temporal-schedule.service.js +23 -85
- package/dist/client/temporal-schedule.service.js.map +1 -0
- package/dist/constants.d.ts +0 -39
- package/dist/constants.js +1 -36
- package/dist/constants.js.map +1 -1
- package/dist/decorators/activity-method.decorator.js.map +1 -1
- package/dist/decorators/index.d.ts +2 -4
- package/dist/decorators/index.js +2 -4
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/query-method.decorator.d.ts +1 -0
- package/dist/decorators/{query.decorator.js → query-method.decorator.js} +5 -14
- package/dist/decorators/query-method.decorator.js.map +1 -0
- package/dist/decorators/signal-method.decorator.d.ts +1 -0
- package/dist/decorators/{signal.decorator.js → signal-method.decorator.js} +5 -14
- package/dist/decorators/signal-method.decorator.js.map +1 -0
- package/dist/decorators/workflow-method.decorator.d.ts +1 -1
- package/dist/decorators/workflow-method.decorator.js +2 -5
- package/dist/decorators/workflow-method.decorator.js.map +1 -1
- package/dist/decorators/workflow.decorator.d.ts +2 -2
- package/dist/decorators/workflow.decorator.js +8 -13
- package/dist/decorators/workflow.decorator.js.map +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.js +8 -35
- package/dist/index.js.map +1 -1
- package/dist/interfaces/activity.interface.d.ts +2 -15
- package/dist/interfaces/base.interface.d.ts +8 -19
- package/dist/interfaces/client.interface.d.ts +6 -33
- package/dist/interfaces/client.interface.js +0 -11
- package/dist/interfaces/client.interface.js.map +1 -1
- package/dist/interfaces/index.d.ts +4 -6
- package/dist/interfaces/index.js +2 -10
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/temporal.interface.d.ts +33 -0
- package/dist/interfaces/{schedule.interface.js → temporal.interface.js} +1 -1
- package/dist/interfaces/temporal.interface.js.map +1 -0
- package/dist/interfaces/worker.interface.d.ts +2 -33
- package/dist/interfaces/workflow.interface.d.ts +9 -20
- package/dist/temporal.module.d.ts +6 -0
- package/dist/temporal.module.js +101 -0
- package/dist/temporal.module.js.map +1 -0
- package/dist/temporal.service.d.ts +26 -0
- package/dist/temporal.service.js +64 -0
- package/dist/temporal.service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/worker/index.js.map +1 -1
- package/dist/worker/temporal-metadata.accessor.d.ts +0 -10
- package/dist/worker/temporal-metadata.accessor.js +0 -60
- package/dist/worker/temporal-metadata.accessor.js.map +1 -1
- package/dist/worker/temporal-worker.module.js +2 -4
- package/dist/worker/temporal-worker.module.js.map +1 -1
- package/dist/worker/worker-manager.service.d.ts +1 -1
- package/dist/worker/worker-manager.service.js +25 -58
- package/dist/worker/worker-manager.service.js.map +1 -1
- package/package.json +1 -1
- package/dist/decorators/query.decorator.d.ts +0 -2
- package/dist/decorators/query.decorator.js.map +0 -1
- package/dist/decorators/scheduled-workflow.decorator.d.ts +0 -13
- package/dist/decorators/scheduled-workflow.decorator.js +0 -31
- package/dist/decorators/scheduled-workflow.decorator.js.map +0 -1
- package/dist/decorators/signal.decorator.d.ts +0 -2
- package/dist/decorators/signal.decorator.js.map +0 -1
- package/dist/decorators/update.decorator.d.ts +0 -2
- package/dist/decorators/update.decorator.js +0 -34
- package/dist/decorators/update.decorator.js.map +0 -1
- package/dist/interfaces/schedule.interface.d.ts +0 -40
- package/dist/interfaces/schedule.interface.js.map +0 -1
- package/dist/schedule/index.d.ts +0 -2
- package/dist/schedule/index.js +0 -19
- package/dist/schedule/index.js.map +0 -1
- package/dist/schedule/temporal-schedule.module.d.ts +0 -7
- package/dist/schedule/temporal-schedule.module.js +0 -94
- package/dist/schedule/temporal-schedule.module.js.map +0 -1
- package/dist/schedule/temporal-schedule.service.js.map +0 -1
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.QueryMethod = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
const
|
|
6
|
+
const QueryMethod = (name) => {
|
|
7
7
|
return (_target, propertyKey, descriptor) => {
|
|
8
|
-
|
|
9
|
-
if (typeof options === 'string') {
|
|
10
|
-
queryName = options;
|
|
11
|
-
}
|
|
12
|
-
else if (options && typeof options === 'object') {
|
|
13
|
-
queryName = options.name || propertyKey.toString();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
queryName = propertyKey.toString();
|
|
17
|
-
}
|
|
8
|
+
const queryName = name || propertyKey.toString();
|
|
18
9
|
Reflect.defineMetadata(constants_1.TEMPORAL_QUERY_METHOD, true, descriptor.value);
|
|
19
10
|
Reflect.defineMetadata(constants_1.TEMPORAL_QUERY_NAME, queryName, descriptor.value);
|
|
20
11
|
(0, common_1.SetMetadata)(constants_1.TEMPORAL_QUERY_METHOD, true)(descriptor.value);
|
|
@@ -22,5 +13,5 @@ const Query = (options) => {
|
|
|
22
13
|
return descriptor;
|
|
23
14
|
};
|
|
24
15
|
};
|
|
25
|
-
exports.
|
|
26
|
-
//# sourceMappingURL=query.decorator.js.map
|
|
16
|
+
exports.QueryMethod = QueryMethod;
|
|
17
|
+
//# sourceMappingURL=query-method.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-method.decorator.js","sourceRoot":"","sources":["../../src/decorators/query-method.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAA0E;AAiCnE,MAAM,WAAW,GAAG,CAAC,IAAa,EAAmB,EAAE;IAC1D,OAAO,CAAC,OAAgB,EAAE,WAA4B,EAAE,UAA8B,EAAE,EAAE;QACtF,MAAM,SAAS,GAAG,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAGjD,OAAO,CAAC,cAAc,CAAC,iCAAqB,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QACtE,OAAO,CAAC,cAAc,CAAC,+BAAmB,EAAE,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAGzE,IAAA,oBAAW,EAAC,iCAAqB,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAA,oBAAW,EAAC,+BAAmB,EAAE,SAAS,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAE9D,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC,CAAC;AAdW,QAAA,WAAW,eActB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SignalMethod: (name?: string) => MethodDecorator;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SignalMethod = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
const
|
|
6
|
+
const SignalMethod = (name) => {
|
|
7
7
|
return (_target, propertyKey, descriptor) => {
|
|
8
|
-
|
|
9
|
-
if (typeof options === 'string') {
|
|
10
|
-
signalName = options;
|
|
11
|
-
}
|
|
12
|
-
else if (options && typeof options === 'object') {
|
|
13
|
-
signalName = options.name || propertyKey.toString();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
signalName = propertyKey.toString();
|
|
17
|
-
}
|
|
8
|
+
const signalName = name || propertyKey.toString();
|
|
18
9
|
Reflect.defineMetadata(constants_1.TEMPORAL_SIGNAL_METHOD, true, descriptor.value);
|
|
19
10
|
Reflect.defineMetadata(constants_1.TEMPORAL_SIGNAL_NAME, signalName, descriptor.value);
|
|
20
11
|
(0, common_1.SetMetadata)(constants_1.TEMPORAL_SIGNAL_METHOD, true)(descriptor.value);
|
|
@@ -22,5 +13,5 @@ const Signal = (options) => {
|
|
|
22
13
|
return descriptor;
|
|
23
14
|
};
|
|
24
15
|
};
|
|
25
|
-
exports.
|
|
26
|
-
//# sourceMappingURL=signal.decorator.js.map
|
|
16
|
+
exports.SignalMethod = SignalMethod;
|
|
17
|
+
//# sourceMappingURL=signal-method.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal-method.decorator.js","sourceRoot":"","sources":["../../src/decorators/signal-method.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAA4E;AAkCrE,MAAM,YAAY,GAAG,CAAC,IAAa,EAAmB,EAAE;IAC3D,OAAO,CAAC,OAAgB,EAAE,WAA4B,EAAE,UAA8B,EAAE,EAAE;QACtF,MAAM,UAAU,GAAG,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAGlD,OAAO,CAAC,cAAc,CAAC,kCAAsB,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,cAAc,CAAC,gCAAoB,EAAE,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAG3E,IAAA,oBAAW,EAAC,kCAAsB,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC5D,IAAA,oBAAW,EAAC,gCAAoB,EAAE,UAAU,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAEhE,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC,CAAC;AAdW,QAAA,YAAY,gBAcvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { WorkflowMethodOptions } from '
|
|
1
|
+
import { WorkflowMethodOptions } from 'src/interfaces';
|
|
2
2
|
export declare const WorkflowMethod: (options?: string | WorkflowMethodOptions) => MethodDecorator;
|
|
@@ -6,14 +6,11 @@ const constants_1 = require("../constants");
|
|
|
6
6
|
const WorkflowMethod = (options) => {
|
|
7
7
|
return (_target, propertyKey, descriptor) => {
|
|
8
8
|
let methodName;
|
|
9
|
-
let methodOptions = {};
|
|
10
9
|
if (typeof options === 'string') {
|
|
11
10
|
methodName = options;
|
|
12
|
-
methodOptions = { name: options };
|
|
13
11
|
}
|
|
14
|
-
else if (options && typeof options === 'object') {
|
|
15
|
-
methodName = options.name
|
|
16
|
-
methodOptions = options;
|
|
12
|
+
else if (options && typeof options === 'object' && options.name) {
|
|
13
|
+
methodName = options.name;
|
|
17
14
|
}
|
|
18
15
|
else {
|
|
19
16
|
methodName = propertyKey.toString();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-method.decorator.js","sourceRoot":"","sources":["../../src/decorators/workflow-method.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAAuF;
|
|
1
|
+
{"version":3,"file":"workflow-method.decorator.js","sourceRoot":"","sources":["../../src/decorators/workflow-method.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAAuF;AA+BhF,MAAM,cAAc,GAAG,CAAC,OAAwC,EAAmB,EAAE;IACxF,OAAO,CAAC,OAAgB,EAAE,WAA4B,EAAE,UAA8B,EAAE,EAAE;QAEtF,IAAI,UAAkB,CAAC;QAEvB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC9B,UAAU,GAAG,OAAO,CAAC;QACzB,CAAC;aAAM,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YAChE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;QAC9B,CAAC;aAAM,CAAC;YACJ,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;QACxC,CAAC;QAGD,OAAO,CAAC,cAAc,CAAC,oCAAwB,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QACzE,OAAO,CAAC,cAAc,CAAC,yCAA6B,EAAE,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAGpF,IAAA,oBAAW,EAAC,oCAAwB,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC9D,IAAA,oBAAW,EAAC,yCAA6B,EAAE,UAAU,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAEzE,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC,CAAC;AAvBW,QAAA,cAAc,kBAuBzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { WorkflowOptions } from '
|
|
2
|
-
export declare
|
|
1
|
+
import { WorkflowOptions } from 'src/interfaces';
|
|
2
|
+
export declare const Workflow: (options: WorkflowOptions) => ClassDecorator;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Workflow =
|
|
3
|
+
exports.Workflow = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
|
|
7
|
-
if (!options.taskQueue) {
|
|
8
|
-
throw new Error('taskQueue is required in Workflow decorator options');
|
|
9
|
-
}
|
|
6
|
+
const Workflow = (options) => {
|
|
10
7
|
return (target) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Reflect.defineMetadata(constants_1.TEMPORAL_WORKFLOW, workflowOptions, target);
|
|
16
|
-
(0, common_1.SetMetadata)(constants_1.TEMPORAL_WORKFLOW, workflowOptions)(target);
|
|
17
|
-
(0, common_1.SetMetadata)(constants_1.TEMPORAL_WORKFLOW_OPTIONS, workflowOptions)(target);
|
|
8
|
+
Reflect.defineMetadata(constants_1.TEMPORAL_WORKFLOW, true, target);
|
|
9
|
+
Reflect.defineMetadata(constants_1.TEMPORAL_WORKFLOW_OPTIONS, options, target);
|
|
10
|
+
(0, common_1.SetMetadata)(constants_1.TEMPORAL_WORKFLOW, true)(target);
|
|
11
|
+
(0, common_1.SetMetadata)(constants_1.TEMPORAL_WORKFLOW_OPTIONS, options)(target);
|
|
18
12
|
return target;
|
|
19
13
|
};
|
|
20
|
-
}
|
|
14
|
+
};
|
|
15
|
+
exports.Workflow = Workflow;
|
|
21
16
|
//# sourceMappingURL=workflow.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.decorator.js","sourceRoot":"","sources":["../../src/decorators/workflow.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow.decorator.js","sourceRoot":"","sources":["../../src/decorators/workflow.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,4CAA4E;AAyBrE,MAAM,QAAQ,GAAG,CAAC,OAAwB,EAAkB,EAAE;IACjE,OAAO,CAAC,MAAW,EAAE,EAAE;QACnB,OAAO,CAAC,cAAc,CAAC,6BAAiB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACxD,OAAO,CAAC,cAAc,CAAC,qCAAyB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACnE,IAAA,oBAAW,EAAC,6BAAiB,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAA,oBAAW,EAAC,qCAAyB,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC,CAAC;AARW,QAAA,QAAQ,YAQnB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
export * from './temporal.module';
|
|
2
|
+
export * from './temporal.service';
|
|
1
3
|
export * from './client/temporal-client.module';
|
|
2
4
|
export * from './client/temporal-client.service';
|
|
5
|
+
export * from './client/temporal-schedule.service';
|
|
3
6
|
export * from './worker/temporal-worker.module';
|
|
4
7
|
export * from './worker/worker-manager.service';
|
|
5
|
-
export * from './worker/temporal-metadata.accessor';
|
|
6
|
-
export * from './schedule/temporal-schedule.module';
|
|
7
|
-
export * from './schedule/temporal-schedule.service';
|
|
8
8
|
export * from './decorators';
|
|
9
|
-
export
|
|
10
|
-
export {
|
|
11
|
-
export { ActivityCancellationType, WorkflowIdReusePolicy, WorkflowIdConflictPolicy, ChildWorkflowCancellationType, ParentClosePolicy, ScheduleOverlapPolicy, VersioningIntent, } from './constants';
|
|
9
|
+
export * from './interfaces';
|
|
10
|
+
export { DEFAULT_NAMESPACE, DEFAULT_TASK_QUEUE, WorkflowIdReusePolicy, WorkflowIdConflictPolicy, ScheduleOverlapPolicy, ERRORS, } from './constants';
|
package/dist/index.js
CHANGED
|
@@ -14,48 +14,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.ERRORS = exports.ScheduleOverlapPolicy = exports.WorkflowIdConflictPolicy = exports.WorkflowIdReusePolicy = exports.DEFAULT_TASK_QUEUE = exports.DEFAULT_NAMESPACE = void 0;
|
|
18
|
+
__exportStar(require("./temporal.module"), exports);
|
|
19
|
+
__exportStar(require("./temporal.service"), exports);
|
|
18
20
|
__exportStar(require("./client/temporal-client.module"), exports);
|
|
19
21
|
__exportStar(require("./client/temporal-client.service"), exports);
|
|
22
|
+
__exportStar(require("./client/temporal-schedule.service"), exports);
|
|
20
23
|
__exportStar(require("./worker/temporal-worker.module"), exports);
|
|
21
24
|
__exportStar(require("./worker/worker-manager.service"), exports);
|
|
22
|
-
__exportStar(require("./worker/temporal-metadata.accessor"), exports);
|
|
23
|
-
__exportStar(require("./schedule/temporal-schedule.module"), exports);
|
|
24
|
-
__exportStar(require("./schedule/temporal-schedule.service"), exports);
|
|
25
25
|
__exportStar(require("./decorators"), exports);
|
|
26
|
+
__exportStar(require("./interfaces"), exports);
|
|
26
27
|
var constants_1 = require("./constants");
|
|
27
|
-
Object.defineProperty(exports, "TEMPORAL_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_MODULE_OPTIONS; } });
|
|
28
|
-
Object.defineProperty(exports, "TEMPORAL_CLIENT_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_CLIENT_MODULE_OPTIONS; } });
|
|
29
|
-
Object.defineProperty(exports, "TEMPORAL_WORKER_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKER_MODULE_OPTIONS; } });
|
|
30
|
-
Object.defineProperty(exports, "TEMPORAL_SCHEDULE_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_SCHEDULE_MODULE_OPTIONS; } });
|
|
31
|
-
Object.defineProperty(exports, "TEMPORAL_CLIENT", { enumerable: true, get: function () { return constants_1.TEMPORAL_CLIENT; } });
|
|
32
|
-
Object.defineProperty(exports, "TEMPORAL_CONNECTION", { enumerable: true, get: function () { return constants_1.TEMPORAL_CONNECTION; } });
|
|
33
|
-
Object.defineProperty(exports, "TEMPORAL_SCHEDULE_CLIENT", { enumerable: true, get: function () { return constants_1.TEMPORAL_SCHEDULE_CLIENT; } });
|
|
34
|
-
Object.defineProperty(exports, "TEMPORAL_ACTIVITY", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY; } });
|
|
35
|
-
Object.defineProperty(exports, "TEMPORAL_ACTIVITY_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY_METHOD; } });
|
|
36
|
-
Object.defineProperty(exports, "TEMPORAL_ACTIVITY_METHOD_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY_METHOD_NAME; } });
|
|
37
|
-
Object.defineProperty(exports, "TEMPORAL_ACTIVITY_METHOD_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY_METHOD_OPTIONS; } });
|
|
38
|
-
Object.defineProperty(exports, "TEMPORAL_WORKFLOW", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKFLOW; } });
|
|
39
|
-
Object.defineProperty(exports, "TEMPORAL_WORKFLOW_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKFLOW_METHOD; } });
|
|
40
|
-
Object.defineProperty(exports, "TEMPORAL_WORKFLOW_METHOD_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKFLOW_METHOD_NAME; } });
|
|
41
|
-
Object.defineProperty(exports, "TEMPORAL_WORKFLOW_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKFLOW_OPTIONS; } });
|
|
42
|
-
Object.defineProperty(exports, "TEMPORAL_SIGNAL_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_SIGNAL_METHOD; } });
|
|
43
|
-
Object.defineProperty(exports, "TEMPORAL_SIGNAL_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_SIGNAL_NAME; } });
|
|
44
|
-
Object.defineProperty(exports, "TEMPORAL_QUERY_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_QUERY_METHOD; } });
|
|
45
|
-
Object.defineProperty(exports, "TEMPORAL_QUERY_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_QUERY_NAME; } });
|
|
46
|
-
Object.defineProperty(exports, "TEMPORAL_UPDATE_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_UPDATE_METHOD; } });
|
|
47
|
-
Object.defineProperty(exports, "TEMPORAL_UPDATE_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_UPDATE_NAME; } });
|
|
48
|
-
Object.defineProperty(exports, "TEMPORAL_UPDATE_VALIDATOR", { enumerable: true, get: function () { return constants_1.TEMPORAL_UPDATE_VALIDATOR; } });
|
|
49
28
|
Object.defineProperty(exports, "DEFAULT_NAMESPACE", { enumerable: true, get: function () { return constants_1.DEFAULT_NAMESPACE; } });
|
|
50
29
|
Object.defineProperty(exports, "DEFAULT_TASK_QUEUE", { enumerable: true, get: function () { return constants_1.DEFAULT_TASK_QUEUE; } });
|
|
51
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "WorkflowIdReusePolicy", { enumerable: true, get: function () { return constants_1.WorkflowIdReusePolicy; } });
|
|
31
|
+
Object.defineProperty(exports, "WorkflowIdConflictPolicy", { enumerable: true, get: function () { return constants_1.WorkflowIdConflictPolicy; } });
|
|
32
|
+
Object.defineProperty(exports, "ScheduleOverlapPolicy", { enumerable: true, get: function () { return constants_1.ScheduleOverlapPolicy; } });
|
|
52
33
|
Object.defineProperty(exports, "ERRORS", { enumerable: true, get: function () { return constants_1.ERRORS; } });
|
|
53
|
-
var constants_2 = require("./constants");
|
|
54
|
-
Object.defineProperty(exports, "ActivityCancellationType", { enumerable: true, get: function () { return constants_2.ActivityCancellationType; } });
|
|
55
|
-
Object.defineProperty(exports, "WorkflowIdReusePolicy", { enumerable: true, get: function () { return constants_2.WorkflowIdReusePolicy; } });
|
|
56
|
-
Object.defineProperty(exports, "WorkflowIdConflictPolicy", { enumerable: true, get: function () { return constants_2.WorkflowIdConflictPolicy; } });
|
|
57
|
-
Object.defineProperty(exports, "ChildWorkflowCancellationType", { enumerable: true, get: function () { return constants_2.ChildWorkflowCancellationType; } });
|
|
58
|
-
Object.defineProperty(exports, "ParentClosePolicy", { enumerable: true, get: function () { return constants_2.ParentClosePolicy; } });
|
|
59
|
-
Object.defineProperty(exports, "ScheduleOverlapPolicy", { enumerable: true, get: function () { return constants_2.ScheduleOverlapPolicy; } });
|
|
60
|
-
Object.defineProperty(exports, "VersioningIntent", { enumerable: true, get: function () { return constants_2.VersioningIntent; } });
|
|
61
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMA,kEAAgD;AAChD,mEAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMA,oDAAkC;AAClC,qDAAmC;AAGnC,kEAAgD;AAChD,mEAAiD;AACjD,qEAAmD;AAGnD,kEAAgD;AAChD,kEAAgD;AAGhD,+CAA6B;AAG7B,+CAA6B;AAG7B,yCAYqB;AAVjB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAGlB,kHAAA,qBAAqB,OAAA;AACrB,qHAAA,wBAAwB,OAAA;AACxB,kHAAA,qBAAqB,OAAA;AAGrB,mGAAA,MAAM,OAAA"}
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
export interface ActivityOptions {
|
|
2
2
|
name?: string;
|
|
3
|
-
description?: string;
|
|
4
3
|
}
|
|
5
4
|
export interface ActivityMethodOptions {
|
|
6
5
|
name?: string;
|
|
7
|
-
timeout?:
|
|
8
|
-
|
|
9
|
-
scheduleToStart?: string | number;
|
|
10
|
-
scheduleToClose?: string | number;
|
|
11
|
-
heartbeat?: string | number;
|
|
12
|
-
};
|
|
13
|
-
retry?: {
|
|
14
|
-
maximumAttempts?: number;
|
|
15
|
-
initialInterval?: string | number;
|
|
16
|
-
maximumInterval?: string | number;
|
|
17
|
-
backoffCoefficient?: number;
|
|
18
|
-
nonRetryableErrorTypes?: string[];
|
|
19
|
-
};
|
|
20
|
-
cancellationType?: 'TRY_CANCEL' | 'WAIT_CANCELLATION_COMPLETED' | 'ABANDON';
|
|
6
|
+
timeout?: string | number;
|
|
7
|
+
maxRetries?: number;
|
|
21
8
|
}
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
export interface ClientCertPair {
|
|
2
|
-
crt: Buffer;
|
|
3
|
-
key: Buffer;
|
|
4
|
-
ca?: Buffer;
|
|
5
|
-
}
|
|
6
|
-
export interface TlsOptions {
|
|
7
|
-
clientCertPair: ClientCertPair;
|
|
8
|
-
serverName?: string;
|
|
9
|
-
verifyServer?: boolean;
|
|
10
|
-
}
|
|
11
1
|
export interface ConnectionOptions {
|
|
12
2
|
address: string;
|
|
13
|
-
tls?:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
basicAuth?: {
|
|
20
|
-
username: string;
|
|
21
|
-
password: string;
|
|
3
|
+
tls?: boolean | {
|
|
4
|
+
serverName?: string;
|
|
5
|
+
clientCertPair?: {
|
|
6
|
+
crt: Buffer;
|
|
7
|
+
key: Buffer;
|
|
8
|
+
ca?: Buffer;
|
|
22
9
|
};
|
|
23
10
|
};
|
|
11
|
+
apiKey?: string;
|
|
12
|
+
metadata?: Record<string, string>;
|
|
24
13
|
}
|
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
-
import { RetryPolicy, SearchAttributes } from '@temporalio/common';
|
|
3
|
-
import { Duration } from '@temporalio/common';
|
|
4
2
|
import { ConnectionOptions } from './base.interface';
|
|
5
|
-
export declare const WorkflowIdConflictPolicy: {
|
|
6
|
-
FAIL: string;
|
|
7
|
-
USE_EXISTING: string;
|
|
8
|
-
TERMINATE_EXISTING: string;
|
|
9
|
-
};
|
|
10
|
-
export type WorkflowIdConflictPolicy = (typeof WorkflowIdConflictPolicy)[keyof typeof WorkflowIdConflictPolicy];
|
|
11
|
-
export declare const WorkflowIdReusePolicy: {
|
|
12
|
-
ALLOW_DUPLICATE: string;
|
|
13
|
-
ALLOW_DUPLICATE_FAILED_ONLY: string;
|
|
14
|
-
REJECT_DUPLICATE: string;
|
|
15
|
-
};
|
|
16
|
-
export type WorkflowIdReusePolicy = (typeof WorkflowIdReusePolicy)[keyof typeof WorkflowIdReusePolicy];
|
|
17
3
|
export interface TemporalClientOptions {
|
|
18
4
|
connection: ConnectionOptions;
|
|
19
5
|
namespace?: string;
|
|
20
6
|
allowConnectionFailure?: boolean;
|
|
21
|
-
reconnect?: {
|
|
22
|
-
enabled?: boolean;
|
|
23
|
-
maxAttempts?: number;
|
|
24
|
-
initialDelayMs?: number;
|
|
25
|
-
maxDelayMs?: number;
|
|
26
|
-
backoffCoefficient?: number;
|
|
27
|
-
};
|
|
28
7
|
}
|
|
29
8
|
export interface TemporalClientOptionsFactory {
|
|
30
9
|
createClientOptions(): Promise<TemporalClientOptions> | TemporalClientOptions;
|
|
@@ -42,16 +21,10 @@ export interface StartWorkflowOptions {
|
|
|
42
21
|
name: string;
|
|
43
22
|
args?: any[];
|
|
44
23
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
workflowIdReusePolicy?: WorkflowIdReusePolicy;
|
|
52
|
-
workflowIdConflictPolicy?: WorkflowIdConflictPolicy;
|
|
53
|
-
searchAttributes?: SearchAttributes;
|
|
54
|
-
typedSearchAttributes?: Record<string, unknown>;
|
|
55
|
-
followRuns?: boolean;
|
|
56
|
-
memo?: Record<string, unknown>;
|
|
24
|
+
retry?: {
|
|
25
|
+
maximumAttempts?: number;
|
|
26
|
+
initialInterval?: string | number;
|
|
27
|
+
};
|
|
28
|
+
searchAttributes?: Record<string, unknown>;
|
|
29
|
+
[key: string]: any;
|
|
57
30
|
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WorkflowIdReusePolicy = exports.WorkflowIdConflictPolicy = void 0;
|
|
4
|
-
exports.WorkflowIdConflictPolicy = {
|
|
5
|
-
FAIL: 'FAIL',
|
|
6
|
-
USE_EXISTING: 'USE_EXISTING',
|
|
7
|
-
TERMINATE_EXISTING: 'TERMINATE_EXISTING',
|
|
8
|
-
};
|
|
9
|
-
exports.WorkflowIdReusePolicy = {
|
|
10
|
-
ALLOW_DUPLICATE: 'ALLOW_DUPLICATE',
|
|
11
|
-
ALLOW_DUPLICATE_FAILED_ONLY: 'ALLOW_DUPLICATE_FAILED_ONLY',
|
|
12
|
-
REJECT_DUPLICATE: 'REJECT_DUPLICATE',
|
|
13
|
-
};
|
|
14
3
|
//# sourceMappingURL=client.interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.interface.js","sourceRoot":"","sources":["../../src/interfaces/client.interface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.interface.js","sourceRoot":"","sources":["../../src/interfaces/client.interface.ts"],"names":[],"mappings":""}
|
|
@@ -3,9 +3,7 @@ export * from './client.interface';
|
|
|
3
3
|
export * from './worker.interface';
|
|
4
4
|
export * from './workflow.interface';
|
|
5
5
|
export * from './activity.interface';
|
|
6
|
-
export * from './
|
|
7
|
-
export { RetryPolicy, Duration, SearchAttributes
|
|
8
|
-
export { ScheduleOverlapPolicy,
|
|
9
|
-
export { Worker
|
|
10
|
-
export { Workflow, WorkflowInfo, ContinueAsNewOptions, ParentClosePolicy, ChildWorkflowOptions, } from '@temporalio/workflow';
|
|
11
|
-
export { ActivityInterface, Context as ActivityContext, Info as ActivityInfo, } from '@temporalio/activity';
|
|
6
|
+
export * from './temporal.interface';
|
|
7
|
+
export { RetryPolicy, Duration, SearchAttributes } from '@temporalio/common';
|
|
8
|
+
export { ScheduleOverlapPolicy, WorkflowHandle, Client } from '@temporalio/client';
|
|
9
|
+
export { Worker } from '@temporalio/worker';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -14,24 +14,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.Worker = exports.Client = exports.ScheduleOverlapPolicy = void 0;
|
|
18
18
|
__exportStar(require("./base.interface"), exports);
|
|
19
19
|
__exportStar(require("./client.interface"), exports);
|
|
20
20
|
__exportStar(require("./worker.interface"), exports);
|
|
21
21
|
__exportStar(require("./workflow.interface"), exports);
|
|
22
22
|
__exportStar(require("./activity.interface"), exports);
|
|
23
|
-
__exportStar(require("./
|
|
23
|
+
__exportStar(require("./temporal.interface"), exports);
|
|
24
24
|
var client_1 = require("@temporalio/client");
|
|
25
25
|
Object.defineProperty(exports, "ScheduleOverlapPolicy", { enumerable: true, get: function () { return client_1.ScheduleOverlapPolicy; } });
|
|
26
26
|
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_1.Client; } });
|
|
27
|
-
Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return client_1.Connection; } });
|
|
28
|
-
Object.defineProperty(exports, "WorkflowClient", { enumerable: true, get: function () { return client_1.WorkflowClient; } });
|
|
29
27
|
var worker_1 = require("@temporalio/worker");
|
|
30
28
|
Object.defineProperty(exports, "Worker", { enumerable: true, get: function () { return worker_1.Worker; } });
|
|
31
|
-
Object.defineProperty(exports, "NativeConnection", { enumerable: true, get: function () { return worker_1.NativeConnection; } });
|
|
32
|
-
Object.defineProperty(exports, "Runtime", { enumerable: true, get: function () { return worker_1.Runtime; } });
|
|
33
|
-
var workflow_1 = require("@temporalio/workflow");
|
|
34
|
-
Object.defineProperty(exports, "ParentClosePolicy", { enumerable: true, get: function () { return workflow_1.ParentClosePolicy; } });
|
|
35
|
-
var activity_1 = require("@temporalio/activity");
|
|
36
|
-
Object.defineProperty(exports, "ActivityContext", { enumerable: true, get: function () { return activity_1.Context; } });
|
|
37
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAKA,mDAAiC;AAGjC,qDAAmC;AAGnC,qDAAmC;AAGnC,uDAAqC;AAGrC,uDAAqC;AAGrC,uDAAqC;AAKrC,6CAAmF;AAA1E,+GAAA,qBAAqB,OAAA;AAAkB,gGAAA,MAAM,OAAA;AAEtD,6CAA4C;AAAnC,gGAAA,MAAM,OAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
+
export interface TemporalOptions {
|
|
3
|
+
connection: {
|
|
4
|
+
address: string;
|
|
5
|
+
namespace?: string;
|
|
6
|
+
tls?: boolean | {
|
|
7
|
+
serverName?: string;
|
|
8
|
+
clientCertPair?: {
|
|
9
|
+
crt: Buffer;
|
|
10
|
+
key: Buffer;
|
|
11
|
+
ca?: Buffer;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
};
|
|
16
|
+
taskQueue?: string;
|
|
17
|
+
worker?: {
|
|
18
|
+
workflowsPath: string;
|
|
19
|
+
activityClasses?: Array<Type<any>>;
|
|
20
|
+
autoStart?: boolean;
|
|
21
|
+
};
|
|
22
|
+
isGlobal?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface TemporalOptionsFactory {
|
|
25
|
+
createTemporalOptions(): Promise<TemporalOptions> | TemporalOptions;
|
|
26
|
+
}
|
|
27
|
+
export interface TemporalAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
28
|
+
useExisting?: Type<TemporalOptionsFactory>;
|
|
29
|
+
useClass?: Type<TemporalOptionsFactory>;
|
|
30
|
+
useFactory?: (...args: any[]) => Promise<TemporalOptions> | TemporalOptions;
|
|
31
|
+
inject?: any[];
|
|
32
|
+
isGlobal?: boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal.interface.js","sourceRoot":"","sources":["../../src/interfaces/temporal.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,44 +1,13 @@
|
|
|
1
1
|
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
-
import { RuntimeOptions, DataConverter } from '@temporalio/worker';
|
|
3
2
|
import { ConnectionOptions } from './base.interface';
|
|
4
3
|
export interface TemporalWorkerOptions {
|
|
5
|
-
connection
|
|
4
|
+
connection?: ConnectionOptions;
|
|
6
5
|
namespace?: string;
|
|
7
6
|
taskQueue: string;
|
|
8
7
|
workflowsPath: string;
|
|
9
8
|
activityClasses?: Array<Type<any>>;
|
|
10
|
-
|
|
11
|
-
reuseV8Context?: boolean;
|
|
12
|
-
maxConcurrentWorkflowTaskExecutions?: number;
|
|
13
|
-
maxConcurrentActivityTaskExecutions?: number;
|
|
14
|
-
maxConcurrentLocalActivityExecutions?: number;
|
|
15
|
-
maxConcurrentWorkflowTaskPolls?: number;
|
|
16
|
-
maxConcurrentActivityTaskPolls?: number;
|
|
17
|
-
maxCachedWorkflows?: number;
|
|
18
|
-
workflowThreadPoolSize?: number;
|
|
19
|
-
debugMode?: boolean;
|
|
20
|
-
showStackTraceSources?: boolean;
|
|
21
|
-
useVersioning?: boolean;
|
|
22
|
-
buildId?: string;
|
|
23
|
-
autoStart?: {
|
|
24
|
-
enabled?: boolean;
|
|
25
|
-
delayMs?: number;
|
|
26
|
-
};
|
|
9
|
+
autoStart?: boolean;
|
|
27
10
|
allowWorkerFailure?: boolean;
|
|
28
|
-
maxActivitiesPerSecond?: number;
|
|
29
|
-
maxTaskQueueActivitiesPerSecond?: number;
|
|
30
|
-
dataConverter?: DataConverter;
|
|
31
|
-
workflowTaskTimeout?: string | number;
|
|
32
|
-
monitoring?: {
|
|
33
|
-
statsIntervalMs?: number;
|
|
34
|
-
metrics?: {
|
|
35
|
-
enabled?: boolean;
|
|
36
|
-
prometheus?: {
|
|
37
|
-
enabled?: boolean;
|
|
38
|
-
port?: number;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
11
|
}
|
|
43
12
|
export interface TemporalWorkerOptionsFactory {
|
|
44
13
|
createWorkerOptions(): Promise<TemporalWorkerOptions> | TemporalWorkerOptions;
|
|
@@ -1,26 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WorkflowIdReusePolicy, WorkflowIdConflictPolicy } from '../constants';
|
|
2
2
|
export interface WorkflowOptions {
|
|
3
3
|
name?: string;
|
|
4
|
-
description?: string;
|
|
5
4
|
taskQueue: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
workflowIdReusePolicy?:
|
|
12
|
-
workflowIdConflictPolicy?:
|
|
5
|
+
timeout?: string | number;
|
|
6
|
+
retry?: {
|
|
7
|
+
maximumAttempts?: number;
|
|
8
|
+
initialInterval?: string | number;
|
|
9
|
+
};
|
|
10
|
+
workflowIdReusePolicy?: WorkflowIdReusePolicy;
|
|
11
|
+
workflowIdConflictPolicy?: WorkflowIdConflictPolicy;
|
|
13
12
|
}
|
|
14
13
|
export interface WorkflowMethodOptions {
|
|
15
|
-
name
|
|
16
|
-
}
|
|
17
|
-
export interface QueryMethodOptions {
|
|
18
|
-
name?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface SignalMethodOptions {
|
|
21
|
-
name?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface UpdateMethodOptions {
|
|
24
|
-
name?: string;
|
|
25
|
-
validator?: (...args: any[]) => void;
|
|
14
|
+
name: string;
|
|
26
15
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { TemporalOptions, TemporalAsyncOptions } from './interfaces/temporal.interface';
|
|
3
|
+
export declare class TemporalModule {
|
|
4
|
+
static register(options: TemporalOptions): DynamicModule;
|
|
5
|
+
static registerAsync(options: TemporalAsyncOptions): DynamicModule;
|
|
6
|
+
}
|