@zintrust/queue-redis 0.4.64 → 0.4.70

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.
@@ -228,10 +228,16 @@ export const BullMQRedisQueue = (() => {
228
228
  const getQueueNames = () => {
229
229
  return Array.from(queues.keys());
230
230
  };
231
+ const resolveRequestedJobId = (payloadData) => {
232
+ if (typeof payloadData?.jobId === 'string' && payloadData.jobId.trim().length > 0) {
233
+ return payloadData.jobId.trim();
234
+ }
235
+ return generateUuid();
236
+ };
231
237
  const createJobOptions = (payloadData) => {
232
238
  return {
233
- // Use uniqueId if present, otherwise generated
234
- jobId: payloadData?.uniqueId ?? generateUuid(),
239
+ // Prefer the explicit BullMQ jobId and keep uniqueId as a legacy alias.
240
+ jobId: resolveRequestedJobId(payloadData),
235
241
  // CRITICAL: Delay scheduling
236
242
  delay: payloadData.delay,
237
243
  // IMPORTANT: Retry configuration
@@ -154,8 +154,8 @@ const callGateway = async (action, payload) => {
154
154
  }
155
155
  };
156
156
  const resolveFallbackJobId = (payload) => {
157
- if (typeof payload.uniqueId === 'string' && payload.uniqueId.trim().length > 0) {
158
- return payload.uniqueId.trim();
157
+ if (typeof payload.jobId === 'string' && payload.jobId.trim().length > 0) {
158
+ return payload.jobId.trim();
159
159
  }
160
160
  return generateUuid();
161
161
  };
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@zintrust/queue-redis",
3
- "version": "0.4.64",
4
- "buildDate": "2026-04-05T16:26:40.440Z",
3
+ "version": "0.4.70",
4
+ "buildDate": "2026-04-06T16:10:45.630Z",
5
5
  "buildEnvironment": {
6
6
  "node": "v20.20.2",
7
7
  "platform": "linux",
8
8
  "arch": "x64"
9
9
  },
10
10
  "git": {
11
- "commit": "018dcfe5",
11
+ "commit": "b92b2b05",
12
12
  "branch": "master"
13
13
  },
14
14
  "package": {
@@ -29,16 +29,16 @@
29
29
  "sha256": "52fb0f688cd17cc7d8e8128e60df6f5eea4c803282382ac75550e6aacee7cbb0"
30
30
  },
31
31
  "BullMQRedisQueue.js": {
32
- "size": 21068,
33
- "sha256": "56e7681b5a996189b2c8587729ed3caa544939368c04649046ed9c55a242f005"
32
+ "size": 21327,
33
+ "sha256": "a35f9d822a3166d57ca48ea1f4894e9fe7996fb842c2f8eeb5cd8be4de866a6a"
34
34
  },
35
35
  "HttpQueueDriver.d.ts": {
36
36
  "size": 835,
37
37
  "sha256": "31735e10a83cf905ca48f3bf1c79f40029b9ac7c0ce6c26751ad646fa77bc764"
38
38
  },
39
39
  "HttpQueueDriver.js": {
40
- "size": 8967,
41
- "sha256": "1ed2cbcee0df24c42760222eb2cab2fac21d4547c153453ce4a8623e5b83b5c3"
40
+ "size": 8958,
41
+ "sha256": "5e465fe42ff2cc4c5f0366f3a5588ce5870b63e558b09a320da5fa80878eeada"
42
42
  },
43
43
  "QueueHttpGateway.d.ts": {
44
44
  "size": 432,
@@ -62,15 +62,15 @@
62
62
  },
63
63
  "index.js": {
64
64
  "size": 677,
65
- "sha256": "b904593f6f18183af388b30e2214759599d6ab08ea9e31321888e77afd6ad275"
65
+ "sha256": "6579dfb73bfcc427e23eb91a8c1791b714216e695dec1fd87f654c1ff7033684"
66
66
  },
67
67
  "register.d.ts": {
68
- "size": 169,
69
- "sha256": "1ba6de37e0d3276ed9b9e6de02541aab03d3d1b7d3246013af27b66179c38948"
68
+ "size": 170,
69
+ "sha256": "e10ca97976730171bfaaaa25f484a30d06c6dca57c7cd85d700c202e0785a0b7"
70
70
  },
71
71
  "register.js": {
72
- "size": 513,
73
- "sha256": "3c5de15f10641521cac21e0a26112bb7bde615c60652327210e77b5c90307409"
72
+ "size": 593,
73
+ "sha256": "9a4ca56fc5d0ae9ca9c5d6c89731b3331749d3e254e583992f311e3ec7add80b"
74
74
  }
75
75
  }
76
76
  }
@@ -1,5 +1,5 @@
1
1
  type QueueApi = {
2
- register: (name: string, driver: unknown) => void;
2
+ register?: (name: string, driver: unknown) => void;
3
3
  };
4
4
  export declare function registerRedisQueueDriver(queue: QueueApi): Promise<void>;
5
5
  export {};
package/dist/register.js CHANGED
@@ -1,5 +1,7 @@
1
1
  export async function registerRedisQueueDriver(queue) {
2
2
  const mod = await import('./BullMQRedisQueue.js');
3
+ if (typeof queue.register !== 'function')
4
+ return;
3
5
  queue.register('redis', mod.default);
4
6
  }
5
7
  const importCore = async () => {
@@ -16,6 +18,6 @@ const importCore = async () => {
16
18
  }
17
19
  };
18
20
  const core = (await importCore());
19
- if (core.Queue !== undefined) {
21
+ if (typeof core.Queue?.register === 'function') {
20
22
  await registerRedisQueueDriver(core.Queue);
21
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zintrust/queue-redis",
3
- "version": "0.4.64",
3
+ "version": "0.4.70",
4
4
  "description": "Redis queue driver for ZinTrust.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "node": ">=20.0.0"
24
24
  },
25
25
  "peerDependencies": {
26
- "@zintrust/core": "^0.4.64"
26
+ "@zintrust/core": "^0.4.70"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"