nestjs-temporal-core 2.0.6 → 2.0.8
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 +439 -325
- package/dist/client/temporal-client.module.js +1 -4
- 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/client/temporal-schedule.service.d.ts +1 -11
- package/dist/client/temporal-schedule.service.js +12 -108
- package/dist/client/temporal-schedule.service.js.map +1 -1
- 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 -5
- package/dist/index.js +8 -34
- 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
|
@@ -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,10 +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 './client/temporal-schedule.service';
|
|
7
8
|
export * from './decorators';
|
|
8
|
-
export
|
|
9
|
-
export {
|
|
10
|
-
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,47 +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("./client/temporal-schedule.service"), exports);
|
|
24
25
|
__exportStar(require("./decorators"), exports);
|
|
26
|
+
__exportStar(require("./interfaces"), exports);
|
|
25
27
|
var constants_1 = require("./constants");
|
|
26
|
-
Object.defineProperty(exports, "TEMPORAL_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_MODULE_OPTIONS; } });
|
|
27
|
-
Object.defineProperty(exports, "TEMPORAL_CLIENT_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_CLIENT_MODULE_OPTIONS; } });
|
|
28
|
-
Object.defineProperty(exports, "TEMPORAL_WORKER_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKER_MODULE_OPTIONS; } });
|
|
29
|
-
Object.defineProperty(exports, "TEMPORAL_SCHEDULE_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_SCHEDULE_MODULE_OPTIONS; } });
|
|
30
|
-
Object.defineProperty(exports, "TEMPORAL_CLIENT", { enumerable: true, get: function () { return constants_1.TEMPORAL_CLIENT; } });
|
|
31
|
-
Object.defineProperty(exports, "TEMPORAL_CONNECTION", { enumerable: true, get: function () { return constants_1.TEMPORAL_CONNECTION; } });
|
|
32
|
-
Object.defineProperty(exports, "TEMPORAL_SCHEDULE_CLIENT", { enumerable: true, get: function () { return constants_1.TEMPORAL_SCHEDULE_CLIENT; } });
|
|
33
|
-
Object.defineProperty(exports, "TEMPORAL_ACTIVITY", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY; } });
|
|
34
|
-
Object.defineProperty(exports, "TEMPORAL_ACTIVITY_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY_METHOD; } });
|
|
35
|
-
Object.defineProperty(exports, "TEMPORAL_ACTIVITY_METHOD_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY_METHOD_NAME; } });
|
|
36
|
-
Object.defineProperty(exports, "TEMPORAL_ACTIVITY_METHOD_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_ACTIVITY_METHOD_OPTIONS; } });
|
|
37
|
-
Object.defineProperty(exports, "TEMPORAL_WORKFLOW", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKFLOW; } });
|
|
38
|
-
Object.defineProperty(exports, "TEMPORAL_WORKFLOW_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKFLOW_METHOD; } });
|
|
39
|
-
Object.defineProperty(exports, "TEMPORAL_WORKFLOW_METHOD_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKFLOW_METHOD_NAME; } });
|
|
40
|
-
Object.defineProperty(exports, "TEMPORAL_WORKFLOW_OPTIONS", { enumerable: true, get: function () { return constants_1.TEMPORAL_WORKFLOW_OPTIONS; } });
|
|
41
|
-
Object.defineProperty(exports, "TEMPORAL_SIGNAL_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_SIGNAL_METHOD; } });
|
|
42
|
-
Object.defineProperty(exports, "TEMPORAL_SIGNAL_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_SIGNAL_NAME; } });
|
|
43
|
-
Object.defineProperty(exports, "TEMPORAL_QUERY_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_QUERY_METHOD; } });
|
|
44
|
-
Object.defineProperty(exports, "TEMPORAL_QUERY_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_QUERY_NAME; } });
|
|
45
|
-
Object.defineProperty(exports, "TEMPORAL_UPDATE_METHOD", { enumerable: true, get: function () { return constants_1.TEMPORAL_UPDATE_METHOD; } });
|
|
46
|
-
Object.defineProperty(exports, "TEMPORAL_UPDATE_NAME", { enumerable: true, get: function () { return constants_1.TEMPORAL_UPDATE_NAME; } });
|
|
47
|
-
Object.defineProperty(exports, "TEMPORAL_UPDATE_VALIDATOR", { enumerable: true, get: function () { return constants_1.TEMPORAL_UPDATE_VALIDATOR; } });
|
|
48
28
|
Object.defineProperty(exports, "DEFAULT_NAMESPACE", { enumerable: true, get: function () { return constants_1.DEFAULT_NAMESPACE; } });
|
|
49
29
|
Object.defineProperty(exports, "DEFAULT_TASK_QUEUE", { enumerable: true, get: function () { return constants_1.DEFAULT_TASK_QUEUE; } });
|
|
50
|
-
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; } });
|
|
51
33
|
Object.defineProperty(exports, "ERRORS", { enumerable: true, get: function () { return constants_1.ERRORS; } });
|
|
52
|
-
var constants_2 = require("./constants");
|
|
53
|
-
Object.defineProperty(exports, "ActivityCancellationType", { enumerable: true, get: function () { return constants_2.ActivityCancellationType; } });
|
|
54
|
-
Object.defineProperty(exports, "WorkflowIdReusePolicy", { enumerable: true, get: function () { return constants_2.WorkflowIdReusePolicy; } });
|
|
55
|
-
Object.defineProperty(exports, "WorkflowIdConflictPolicy", { enumerable: true, get: function () { return constants_2.WorkflowIdConflictPolicy; } });
|
|
56
|
-
Object.defineProperty(exports, "ChildWorkflowCancellationType", { enumerable: true, get: function () { return constants_2.ChildWorkflowCancellationType; } });
|
|
57
|
-
Object.defineProperty(exports, "ParentClosePolicy", { enumerable: true, get: function () { return constants_2.ParentClosePolicy; } });
|
|
58
|
-
Object.defineProperty(exports, "ScheduleOverlapPolicy", { enumerable: true, get: function () { return constants_2.ScheduleOverlapPolicy; } });
|
|
59
|
-
Object.defineProperty(exports, "VersioningIntent", { enumerable: true, get: function () { return constants_2.VersioningIntent; } });
|
|
60
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
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var TemporalModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TemporalModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const core_1 = require("@nestjs/core");
|
|
13
|
+
const temporal_client_module_1 = require("./client/temporal-client.module");
|
|
14
|
+
const temporal_worker_module_1 = require("./worker/temporal-worker.module");
|
|
15
|
+
const temporal_service_1 = require("./temporal.service");
|
|
16
|
+
let TemporalModule = TemporalModule_1 = class TemporalModule {
|
|
17
|
+
static register(options) {
|
|
18
|
+
const clientOptions = {
|
|
19
|
+
connection: options.connection,
|
|
20
|
+
namespace: options.connection.namespace,
|
|
21
|
+
allowConnectionFailure: true,
|
|
22
|
+
};
|
|
23
|
+
const imports = [temporal_client_module_1.TemporalClientModule.register(clientOptions)];
|
|
24
|
+
if (options.worker) {
|
|
25
|
+
const workerOptions = {
|
|
26
|
+
connection: options.connection,
|
|
27
|
+
namespace: options.connection.namespace,
|
|
28
|
+
taskQueue: options.taskQueue || 'default-task-queue',
|
|
29
|
+
workflowsPath: options.worker.workflowsPath,
|
|
30
|
+
activityClasses: options.worker.activityClasses,
|
|
31
|
+
autoStart: options.worker.autoStart !== false,
|
|
32
|
+
allowWorkerFailure: true,
|
|
33
|
+
};
|
|
34
|
+
imports.push(temporal_worker_module_1.TemporalWorkerModule.register(workerOptions));
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
module: TemporalModule_1,
|
|
38
|
+
imports,
|
|
39
|
+
providers: [temporal_service_1.TemporalService, core_1.DiscoveryService],
|
|
40
|
+
exports: [temporal_service_1.TemporalService],
|
|
41
|
+
global: options.isGlobal,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static registerAsync(options) {
|
|
45
|
+
return {
|
|
46
|
+
module: TemporalModule_1,
|
|
47
|
+
imports: [
|
|
48
|
+
...(options.imports || []),
|
|
49
|
+
temporal_client_module_1.TemporalClientModule.registerAsync({
|
|
50
|
+
imports: options.imports,
|
|
51
|
+
useFactory: async (...args) => {
|
|
52
|
+
if (!options.useFactory) {
|
|
53
|
+
throw new Error('useFactory is required');
|
|
54
|
+
}
|
|
55
|
+
const temporalOptions = await options.useFactory(...args);
|
|
56
|
+
return {
|
|
57
|
+
connection: temporalOptions.connection,
|
|
58
|
+
namespace: temporalOptions.connection.namespace,
|
|
59
|
+
allowConnectionFailure: true,
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
inject: options.inject,
|
|
63
|
+
}),
|
|
64
|
+
...(options.useFactory
|
|
65
|
+
? [
|
|
66
|
+
temporal_worker_module_1.TemporalWorkerModule.registerAsync({
|
|
67
|
+
imports: options.imports,
|
|
68
|
+
useFactory: async (...args) => {
|
|
69
|
+
if (!options.useFactory) {
|
|
70
|
+
throw new Error('useFactory is required');
|
|
71
|
+
}
|
|
72
|
+
const temporalOptions = await options.useFactory(...args);
|
|
73
|
+
if (!temporalOptions.worker) {
|
|
74
|
+
throw new Error('Worker configuration is required');
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
connection: temporalOptions.connection,
|
|
78
|
+
namespace: temporalOptions.connection.namespace,
|
|
79
|
+
taskQueue: temporalOptions.taskQueue || 'default-task-queue',
|
|
80
|
+
workflowsPath: temporalOptions.worker.workflowsPath,
|
|
81
|
+
activityClasses: temporalOptions.worker.activityClasses,
|
|
82
|
+
autoStart: temporalOptions.worker.autoStart !== false,
|
|
83
|
+
allowWorkerFailure: true,
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
inject: options.inject,
|
|
87
|
+
}),
|
|
88
|
+
]
|
|
89
|
+
: []),
|
|
90
|
+
],
|
|
91
|
+
providers: [temporal_service_1.TemporalService, core_1.DiscoveryService],
|
|
92
|
+
exports: [temporal_service_1.TemporalService],
|
|
93
|
+
global: options.isGlobal,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
exports.TemporalModule = TemporalModule;
|
|
98
|
+
exports.TemporalModule = TemporalModule = TemporalModule_1 = __decorate([
|
|
99
|
+
(0, common_1.Module)({})
|
|
100
|
+
], TemporalModule);
|
|
101
|
+
//# sourceMappingURL=temporal.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal.module.js","sourceRoot":"","sources":["../src/temporal.module.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { TemporalClientService } from './client/temporal-client.service';
|
|
3
|
+
import { TemporalScheduleService } from './client/temporal-schedule.service';
|
|
4
|
+
import { WorkerManager } from './worker/worker-manager.service';
|
|
5
|
+
export declare class TemporalService implements OnModuleInit {
|
|
6
|
+
private readonly clientService;
|
|
7
|
+
private readonly scheduleService;
|
|
8
|
+
private readonly workerManager?;
|
|
9
|
+
private readonly logger;
|
|
10
|
+
constructor(clientService: TemporalClientService, scheduleService: TemporalScheduleService, workerManager?: WorkerManager | undefined);
|
|
11
|
+
onModuleInit(): Promise<void>;
|
|
12
|
+
getClient(): TemporalClientService;
|
|
13
|
+
getScheduleService(): TemporalScheduleService;
|
|
14
|
+
getWorkerManager(): WorkerManager | undefined;
|
|
15
|
+
hasWorker(): boolean;
|
|
16
|
+
startWorkflow<T, A extends any[]>(workflowType: string, args: A, taskQueue: string, options?: {
|
|
17
|
+
workflowId?: string;
|
|
18
|
+
searchAttributes?: Record<string, unknown>;
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
result: Promise<T>;
|
|
22
|
+
workflowId: string;
|
|
23
|
+
firstExecutionRunId: string;
|
|
24
|
+
handle: import("@temporalio/client").WorkflowHandle;
|
|
25
|
+
}>;
|
|
26
|
+
}
|