@spinajs/queue 2.0.179 → 2.0.181

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 (41) hide show
  1. package/lib/cjs/BlackHoleQueueClient.d.ts +11 -11
  2. package/lib/cjs/BlackHoleQueueClient.js +29 -29
  3. package/lib/cjs/BlackHoleQueueClient.js.map +1 -1
  4. package/lib/cjs/config/queue.d.ts +10 -10
  5. package/lib/cjs/config/queue.js +17 -17
  6. package/lib/cjs/decorators.d.ts +19 -19
  7. package/lib/cjs/decorators.js +35 -35
  8. package/lib/cjs/index.d.ts +38 -38
  9. package/lib/cjs/index.js +167 -167
  10. package/lib/cjs/index.js.map +1 -1
  11. package/lib/cjs/interfaces.d.ts +213 -213
  12. package/lib/cjs/interfaces.js +168 -168
  13. package/lib/cjs/interfaces.js.map +1 -1
  14. package/lib/cjs/migrations/Queue_2022_10_18_01_13_00.d.ts +5 -5
  15. package/lib/cjs/migrations/Queue_2022_10_18_01_13_00.js +35 -35
  16. package/lib/cjs/migrations/Queue_2022_10_18_01_13_00.js.map +1 -1
  17. package/lib/cjs/models/JobModel.d.ts +19 -19
  18. package/lib/cjs/models/JobModel.js +46 -46
  19. package/lib/cjs/models/JobModel.js.map +1 -1
  20. package/lib/mjs/BlackHoleQueueClient.d.ts +11 -11
  21. package/lib/mjs/BlackHoleQueueClient.js +26 -26
  22. package/lib/mjs/BlackHoleQueueClient.js.map +1 -1
  23. package/lib/mjs/config/queue.d.ts +10 -10
  24. package/lib/mjs/config/queue.js +15 -15
  25. package/lib/mjs/decorators.d.ts +19 -19
  26. package/lib/mjs/decorators.js +30 -30
  27. package/lib/mjs/index.d.ts +38 -38
  28. package/lib/mjs/index.js +150 -150
  29. package/lib/mjs/index.js.map +1 -1
  30. package/lib/mjs/interfaces.d.ts +213 -213
  31. package/lib/mjs/interfaces.js +156 -156
  32. package/lib/mjs/interfaces.js.map +1 -1
  33. package/lib/mjs/migrations/Queue_2022_10_18_01_13_00.d.ts +5 -5
  34. package/lib/mjs/migrations/Queue_2022_10_18_01_13_00.js +32 -32
  35. package/lib/mjs/migrations/Queue_2022_10_18_01_13_00.js.map +1 -1
  36. package/lib/mjs/models/JobModel.d.ts +19 -19
  37. package/lib/mjs/models/JobModel.js +43 -43
  38. package/lib/mjs/models/JobModel.js.map +1 -1
  39. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  40. package/lib/tsconfig.mjs.tsbuildinfo +1 -1
  41. package/package.json +6 -6
package/lib/cjs/index.js CHANGED
@@ -1,168 +1,168 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
14
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16
- 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;
17
- return c > 3 && r && Object.defineProperty(target, key, r), r;
18
- };
19
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
- };
22
- var __metadata = (this && this.__metadata) || function (k, v) {
23
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.DefaultQueueService = void 0;
27
- const exceptions_1 = require("@spinajs/exceptions");
28
- const di_1 = require("@spinajs/di");
29
- const log_1 = require("@spinajs/log");
30
- const interfaces_js_1 = require("./interfaces.js");
31
- const JobModel_js_1 = require("./models/JobModel.js");
32
- const uuid_1 = require("uuid");
33
- const configuration_1 = require("@spinajs/configuration");
34
- const luxon_1 = require("luxon");
35
- __exportStar(require("./BlackHoleQueueClient.js"), exports);
36
- __exportStar(require("./interfaces.js"), exports);
37
- __exportStar(require("./decorators.js"), exports);
38
- __exportStar(require("./models/JobModel.js"), exports);
39
- __exportStar(require("./migrations/Queue_2022_10_18_01_13_00.js"), exports);
40
- let DefaultQueueService = class DefaultQueueService extends interfaces_js_1.QueueService {
41
- async dispose() {
42
- this.Connections.forEach(async (val) => {
43
- await val.dispose();
44
- });
45
- this.Connections.clear();
46
- }
47
- async emit(event) {
48
- const connections = this.getConnectionsForMessage(event);
49
- for (let c of connections) {
50
- if ((0, interfaces_js_1.isJob)(event)) {
51
- const jModel = new JobModel_js_1.JobModel();
52
- jModel.JobId = (0, uuid_1.v4)();
53
- jModel.Name = event.Name;
54
- jModel.Status = 'created';
55
- jModel.Progress = 0;
56
- jModel.Connection = c;
57
- await jModel.insert();
58
- event.JobId = jModel.JobId;
59
- }
60
- this.Connections.get(c).emit(event);
61
- this.Log.trace(`Emitted message ${event.Name}, type: ${event.Type} to connection ${c}`);
62
- }
63
- }
64
- async stopConsuming(event) {
65
- this.getConnectionsForMessage(event).forEach((c) => this.Connections.get(c).unsubscribe(event));
66
- }
67
- /**
68
- *
69
- * Starts to consume events/jobs from connection
70
- *
71
- * NOTE: When consuming events, we can have multiple event types on same channel, couse
72
- * subscribe function filters it out, and event can be handled in another subscription
73
- *
74
- * When consuming jobs, multiple jobs on same channel can have unpredictible behavior becouse
75
- * job can be executed once even with multiple subscribers, so filtering it out
76
- * prevents from executing it on other subscriptions
77
- *
78
- * @param event - event type to consume
79
- * @param callback - optional callback when job is consumet, mandatory for events
80
- * @param subscriptionId - optional subscription id if consuming durable events
81
- * @param durable - is durable event, if not set, this value default to event decorator options
82
- */
83
- async consume(event, callback, subscriptionId, durable) {
84
- const options = Reflect.getMetadata('queue:options', event);
85
- const self = this;
86
- if (!options) {
87
- throw new exceptions_1.InvalidArgument(`Type ${event.name} is not defined as Job or Event type. Use proper decorator to configure queue events`);
88
- }
89
- const { durable: eDurable } = options;
90
- const connections = this.getConnectionsForMessage(event);
91
- if ((eDurable || durable) && !subscriptionId) {
92
- throw new exceptions_1.InvalidArgument('subscriptionId should be set when using durable events');
93
- }
94
- for (let c of connections) {
95
- const conn = this.Connections.get(c);
96
- if (!conn) {
97
- throw new di_1.ServiceNotFound(`Queue connection ${c} not found. Please check your configuration before consuming events from this connection.`);
98
- }
99
- await conn.subscribe(event, async (e) => {
100
- if (e.Name === event.name) {
101
- const ev = di_1.DI.resolve(event);
102
- ev.hydrate(e);
103
- /**
104
- * Handle job type of message
105
- * To preserve result & handle delay, errors etc..
106
- */
107
- if (ev instanceof interfaces_js_1.QueueJob) {
108
- let jobResult = null;
109
- const jModel = await JobModel_js_1.JobModel.where({ JobId: ev.JobId }).firstOrThrow(new exceptions_1.UnexpectedServerError(`No model found for jobId ${ev.JobId}`));
110
- jModel.Status = 'executing';
111
- jModel.ExecutedAt = luxon_1.DateTime.now();
112
- try {
113
- // update executing state
114
- await jModel.update();
115
- jobResult = await ev.execute(onProgress);
116
- jModel.Result = jobResult;
117
- jModel.Status = 'success';
118
- jModel.FinishedAt = luxon_1.DateTime.now();
119
- jModel.Progress = 100;
120
- this.Log.trace(`Job ${event.name} processed with result ${JSON.stringify(jModel.Result)}`);
121
- }
122
- catch (err) {
123
- this.Log.error(err, `Cannot execute job ${event.name}`);
124
- jModel.Result = {
125
- message: err.message,
126
- };
127
- jModel.Status = 'error';
128
- }
129
- await jModel.update();
130
- async function onProgress(p) {
131
- jModel.Progress = p;
132
- await jModel.update();
133
- self.Log.trace(`Job ${event.name}:${jModel.JobId} progress: ${p}%`);
134
- }
135
- }
136
- if (!callback && ev instanceof interfaces_js_1.QueueEvent) {
137
- throw new exceptions_1.InvalidArgument('when subscribing to events, callback cannot be null. Subscriber should handle event in callback function !');
138
- }
139
- this.Log.trace(`Queue message ${event.name} processed`);
140
- if (callback) {
141
- return callback(ev);
142
- }
143
- }
144
- }, subscriptionId, durable ?? eDurable ?? false);
145
- }
146
- }
147
- /**
148
- * Get specific queue client connection. If no connection param is provided, default is returned.
149
- * @param connection - connection name to obtain
150
- * @returns
151
- */
152
- get(connection) {
153
- return this.Connections.get(`${connection ?? this.Configuration.default}`);
154
- }
155
- };
156
- __decorate([
157
- (0, log_1.Logger)('queue'),
158
- __metadata("design:type", log_1.Log)
159
- ], DefaultQueueService.prototype, "Log", void 0);
160
- __decorate([
161
- (0, configuration_1.AutoinjectService)('queue.connections', interfaces_js_1.QueueClient),
162
- __metadata("design:type", Map)
163
- ], DefaultQueueService.prototype, "Connections", void 0);
164
- DefaultQueueService = __decorate([
165
- (0, di_1.Injectable)(interfaces_js_1.QueueService)
166
- ], DefaultQueueService);
167
- exports.DefaultQueueService = DefaultQueueService;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
14
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16
+ 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;
17
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18
+ };
19
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
+ };
22
+ var __metadata = (this && this.__metadata) || function (k, v) {
23
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.DefaultQueueService = void 0;
27
+ const exceptions_1 = require("@spinajs/exceptions");
28
+ const di_1 = require("@spinajs/di");
29
+ const log_1 = require("@spinajs/log");
30
+ const interfaces_js_1 = require("./interfaces.js");
31
+ const JobModel_js_1 = require("./models/JobModel.js");
32
+ const uuid_1 = require("uuid");
33
+ const configuration_1 = require("@spinajs/configuration");
34
+ const luxon_1 = require("luxon");
35
+ __exportStar(require("./BlackHoleQueueClient.js"), exports);
36
+ __exportStar(require("./interfaces.js"), exports);
37
+ __exportStar(require("./decorators.js"), exports);
38
+ __exportStar(require("./models/JobModel.js"), exports);
39
+ __exportStar(require("./migrations/Queue_2022_10_18_01_13_00.js"), exports);
40
+ let DefaultQueueService = class DefaultQueueService extends interfaces_js_1.QueueService {
41
+ async dispose() {
42
+ this.Connections.forEach(async (val) => {
43
+ await val.dispose();
44
+ });
45
+ this.Connections.clear();
46
+ }
47
+ async emit(event) {
48
+ const connections = this.getConnectionsForMessage(event);
49
+ for (let c of connections) {
50
+ if ((0, interfaces_js_1.isJob)(event)) {
51
+ const jModel = new JobModel_js_1.JobModel();
52
+ jModel.JobId = (0, uuid_1.v4)();
53
+ jModel.Name = event.Name;
54
+ jModel.Status = 'created';
55
+ jModel.Progress = 0;
56
+ jModel.Connection = c;
57
+ await jModel.insert();
58
+ event.JobId = jModel.JobId;
59
+ }
60
+ this.Connections.get(c).emit(event);
61
+ this.Log.trace(`Emitted message ${event.Name}, type: ${event.Type} to connection ${c}`);
62
+ }
63
+ }
64
+ async stopConsuming(event) {
65
+ this.getConnectionsForMessage(event).forEach((c) => this.Connections.get(c).unsubscribe(event));
66
+ }
67
+ /**
68
+ *
69
+ * Starts to consume events/jobs from connection
70
+ *
71
+ * NOTE: When consuming events, we can have multiple event types on same channel, couse
72
+ * subscribe function filters it out, and event can be handled in another subscription
73
+ *
74
+ * When consuming jobs, multiple jobs on same channel can have unpredictible behavior becouse
75
+ * job can be executed once even with multiple subscribers, so filtering it out
76
+ * prevents from executing it on other subscriptions
77
+ *
78
+ * @param event - event type to consume
79
+ * @param callback - optional callback when job is consumet, mandatory for events
80
+ * @param subscriptionId - optional subscription id if consuming durable events
81
+ * @param durable - is durable event, if not set, this value default to event decorator options
82
+ */
83
+ async consume(event, callback, subscriptionId, durable) {
84
+ const options = Reflect.getMetadata('queue:options', event);
85
+ const self = this;
86
+ if (!options) {
87
+ throw new exceptions_1.InvalidArgument(`Type ${event.name} is not defined as Job or Event type. Use proper decorator to configure queue events`);
88
+ }
89
+ const { durable: eDurable } = options;
90
+ const connections = this.getConnectionsForMessage(event);
91
+ if ((eDurable || durable) && !subscriptionId) {
92
+ throw new exceptions_1.InvalidArgument('subscriptionId should be set when using durable events');
93
+ }
94
+ for (let c of connections) {
95
+ const conn = this.Connections.get(c);
96
+ if (!conn) {
97
+ throw new di_1.ServiceNotFound(`Queue connection ${c} not found. Please check your configuration before consuming events from this connection.`);
98
+ }
99
+ await conn.subscribe(event, async (e) => {
100
+ if (e.Name === event.name) {
101
+ const ev = di_1.DI.resolve(event);
102
+ ev.hydrate(e);
103
+ /**
104
+ * Handle job type of message
105
+ * To preserve result & handle delay, errors etc..
106
+ */
107
+ if (ev instanceof interfaces_js_1.QueueJob) {
108
+ let jobResult = null;
109
+ const jModel = await JobModel_js_1.JobModel.where({ JobId: ev.JobId }).firstOrThrow(new exceptions_1.UnexpectedServerError(`No model found for jobId ${ev.JobId}`));
110
+ jModel.Status = 'executing';
111
+ jModel.ExecutedAt = luxon_1.DateTime.now();
112
+ try {
113
+ // update executing state
114
+ await jModel.update();
115
+ jobResult = await ev.execute(onProgress);
116
+ jModel.Result = jobResult;
117
+ jModel.Status = 'success';
118
+ jModel.FinishedAt = luxon_1.DateTime.now();
119
+ jModel.Progress = 100;
120
+ this.Log.trace(`Job ${event.name} processed with result ${JSON.stringify(jModel.Result)}`);
121
+ }
122
+ catch (err) {
123
+ this.Log.error(err, `Cannot execute job ${event.name}`);
124
+ jModel.Result = {
125
+ message: err.message,
126
+ };
127
+ jModel.Status = 'error';
128
+ }
129
+ await jModel.update();
130
+ async function onProgress(p) {
131
+ jModel.Progress = p;
132
+ await jModel.update();
133
+ self.Log.trace(`Job ${event.name}:${jModel.JobId} progress: ${p}%`);
134
+ }
135
+ }
136
+ if (!callback && ev instanceof interfaces_js_1.QueueEvent) {
137
+ throw new exceptions_1.InvalidArgument('when subscribing to events, callback cannot be null. Subscriber should handle event in callback function !');
138
+ }
139
+ this.Log.trace(`Queue message ${event.name} processed`);
140
+ if (callback) {
141
+ return callback(ev);
142
+ }
143
+ }
144
+ }, subscriptionId, durable ?? eDurable ?? false);
145
+ }
146
+ }
147
+ /**
148
+ * Get specific queue client connection. If no connection param is provided, default is returned.
149
+ * @param connection - connection name to obtain
150
+ * @returns
151
+ */
152
+ get(connection) {
153
+ return this.Connections.get(`${connection ?? this.Configuration.default}`);
154
+ }
155
+ };
156
+ exports.DefaultQueueService = DefaultQueueService;
157
+ __decorate([
158
+ (0, log_1.Logger)('queue'),
159
+ __metadata("design:type", log_1.Log)
160
+ ], DefaultQueueService.prototype, "Log", void 0);
161
+ __decorate([
162
+ (0, configuration_1.AutoinjectService)('queue.connections', interfaces_js_1.QueueClient),
163
+ __metadata("design:type", Map)
164
+ ], DefaultQueueService.prototype, "Connections", void 0);
165
+ exports.DefaultQueueService = DefaultQueueService = __decorate([
166
+ (0, di_1.Injectable)(interfaces_js_1.QueueService)
167
+ ], Def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