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,64 @@
|
|
|
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 __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var TemporalService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.TemporalService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const temporal_client_service_1 = require("./client/temporal-client.service");
|
|
19
|
+
const temporal_schedule_service_1 = require("./client/temporal-schedule.service");
|
|
20
|
+
const worker_manager_service_1 = require("./worker/worker-manager.service");
|
|
21
|
+
let TemporalService = TemporalService_1 = class TemporalService {
|
|
22
|
+
constructor(clientService, scheduleService, workerManager) {
|
|
23
|
+
this.clientService = clientService;
|
|
24
|
+
this.scheduleService = scheduleService;
|
|
25
|
+
this.workerManager = workerManager;
|
|
26
|
+
this.logger = new common_1.Logger(TemporalService_1.name);
|
|
27
|
+
}
|
|
28
|
+
async onModuleInit() {
|
|
29
|
+
this.logger.log('Temporal service initialized');
|
|
30
|
+
if (this.workerManager) {
|
|
31
|
+
this.logger.log('Worker manager is available');
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.logger.log('Worker manager is not available - running in client-only mode');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
getClient() {
|
|
38
|
+
return this.clientService;
|
|
39
|
+
}
|
|
40
|
+
getScheduleService() {
|
|
41
|
+
return this.scheduleService;
|
|
42
|
+
}
|
|
43
|
+
getWorkerManager() {
|
|
44
|
+
return this.workerManager;
|
|
45
|
+
}
|
|
46
|
+
hasWorker() {
|
|
47
|
+
return !!this.workerManager;
|
|
48
|
+
}
|
|
49
|
+
async startWorkflow(workflowType, args, taskQueue, options = {}) {
|
|
50
|
+
return this.clientService.startWorkflow(workflowType, args, {
|
|
51
|
+
taskQueue,
|
|
52
|
+
...options,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.TemporalService = TemporalService;
|
|
57
|
+
exports.TemporalService = TemporalService = TemporalService_1 = __decorate([
|
|
58
|
+
(0, common_1.Injectable)(),
|
|
59
|
+
__param(2, (0, common_1.Optional)()),
|
|
60
|
+
__metadata("design:paramtypes", [temporal_client_service_1.TemporalClientService,
|
|
61
|
+
temporal_schedule_service_1.TemporalScheduleService,
|
|
62
|
+
worker_manager_service_1.WorkerManager])
|
|
63
|
+
], TemporalService);
|
|
64
|
+
//# sourceMappingURL=temporal.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal.service.js","sourceRoot":"","sources":["../src/temporal.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4E;AAC5E,8EAAyE;AACzE,kFAA6E;AAC7E,4EAAgE;AAOzD,IAAM,eAAe,uBAArB,MAAM,eAAe;IAGxB,YACqB,aAAoC,EACpC,eAAwC,EAC7C,aAA8C;QAFzC,kBAAa,GAAb,aAAa,CAAuB;QACpC,oBAAe,GAAf,eAAe,CAAyB;QAC5B,kBAAa,GAAb,aAAa,CAAgB;QAL7C,WAAM,GAAG,IAAI,eAAM,CAAC,iBAAe,CAAC,IAAI,CAAC,CAAC;IAMxD,CAAC;IAEJ,KAAK,CAAC,YAAY;QACd,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAEhD,IAAI,IAAI,CAAC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