@zintrust/core 2.9.0 → 2.9.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zintrust/core",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "Production-grade TypeScript backend framework for JavaScript",
|
|
5
5
|
"homepage": "https://zintrust.com",
|
|
6
6
|
"repository": {
|
|
@@ -224,8 +224,8 @@
|
|
|
224
224
|
"jsonwebtoken": "^9.0.3",
|
|
225
225
|
"mysql2": "^3.22.5",
|
|
226
226
|
"pg": "^8.22.0",
|
|
227
|
-
"redis": "^6.1
|
|
228
|
-
"tsx": "^4.22.
|
|
227
|
+
"redis": "^6.0.1",
|
|
228
|
+
"tsx": "^4.22.4"
|
|
229
229
|
},
|
|
230
230
|
"overrides": {
|
|
231
231
|
"ajv": "^8.18.0",
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @zintrust/core v2.9.
|
|
2
|
+
* @zintrust/core v2.9.1
|
|
3
3
|
*
|
|
4
4
|
* ZinTrust Framework - Production-Grade TypeScript Backend
|
|
5
5
|
* Built for performance, type safety, and exceptional developer experience
|
|
6
6
|
*
|
|
7
7
|
* Build Information:
|
|
8
|
-
* Built: 2026-07-
|
|
8
|
+
* Built: 2026-07-08T17:47:02.976Z
|
|
9
9
|
* Node: >=20.0.0
|
|
10
10
|
* License: MIT
|
|
11
11
|
*
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Available at runtime for debugging and health checks
|
|
22
22
|
*/
|
|
23
23
|
export const ZINTRUST_VERSION = '0.1.41';
|
|
24
|
-
export const ZINTRUST_BUILD_DATE = '2026-07-
|
|
24
|
+
export const ZINTRUST_BUILD_DATE = '2026-07-08T17:47:02.938Z'; // Replaced during build
|
|
25
25
|
export { Application } from './boot/Application.js';
|
|
26
26
|
export { AwsSigV4 } from './common/index.js';
|
|
27
27
|
export { SignedRequest } from './security/SignedRequest.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-client.d.ts","sourceRoot":"","sources":["../../../src/worker-runtime/rpc-client.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAOF,eAAO,MAAM,oBAAoB,QAAO,OAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc-client.d.ts","sourceRoot":"","sources":["../../../src/worker-runtime/rpc-client.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAOF,eAAO,MAAM,oBAAoB,QAAO,OAAkC,CAAC;AAiD3E,wFAAwF;AACxF,eAAO,MAAM,OAAO,GAClB,WAAW,MAAM,EACjB,qBAAqB,MAAM,KAC1B,OAAO,CAAC,SAAS,GAAG,SAAS,CAU/B,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,MAAM,GACjB,WAAW,MAAM,EACjB,OAAO,MAAM,EACb,cAAc,OAAO,KACpB,OAAO,CAAC,IAAI,CAEd,CAAC;AAEF,gCAAgC;AAChC,eAAO,MAAM,OAAO,GAAU,WAAW,MAAM,EAAE,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,IAAI,CAM5F,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,WAAW,QAAa,OAAO,CAAC,gBAAgB,EAAE,CAG9D,CAAC"}
|
|
@@ -11,6 +11,26 @@ import { ErrorFactory } from '../exceptions/ZintrustError.js';
|
|
|
11
11
|
const getBaseUrl = () => Env.get('REDIS_RPC_URL', '').trim();
|
|
12
12
|
const getSecret = () => Env.get('REDIS_RPC_SECRET', Env.get('REDIS_PROXY_SECRET', Env.get('APP_KEY', ''))).trim();
|
|
13
13
|
export const isRedisRpcConfigured = () => getBaseUrl().length > 0;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the target Redis database index from env
|
|
16
|
+
* (REDIS_QUEUE_DB → REDIS_DB → undefined).
|
|
17
|
+
* Returns undefined when no explicit DB is configured,
|
|
18
|
+
* which means the RPC backend uses its own server default.
|
|
19
|
+
*/
|
|
20
|
+
const getQueueDb = () => {
|
|
21
|
+
const queueDb = Env.getInt('REDIS_QUEUE_DB', -1);
|
|
22
|
+
if (queueDb >= 0)
|
|
23
|
+
return queueDb;
|
|
24
|
+
const redisDb = Env.getInt('REDIS_DB', -1);
|
|
25
|
+
if (redisDb >= 0)
|
|
26
|
+
return redisDb;
|
|
27
|
+
return undefined;
|
|
28
|
+
};
|
|
29
|
+
/** Merge target DB into any queue RPC payload when configured. */
|
|
30
|
+
const queuePayload = (extra) => {
|
|
31
|
+
const db = getQueueDb();
|
|
32
|
+
return db === undefined ? extra : { db, ...extra };
|
|
33
|
+
};
|
|
14
34
|
const call = async (service, method, payload = {}) => {
|
|
15
35
|
const baseUrl = getBaseUrl();
|
|
16
36
|
if (baseUrl.length === 0) {
|
|
@@ -33,20 +53,20 @@ const call = async (service, method, payload = {}) => {
|
|
|
33
53
|
};
|
|
34
54
|
/** Atomically claim and pull the next waiting job for a queue, or undefined if none. */
|
|
35
55
|
export const pullJob = async (queueName, visibilityTimeoutMs) => {
|
|
36
|
-
const result = await call('queue', 'dequeue', {
|
|
56
|
+
const result = await call('queue', 'dequeue', queuePayload({
|
|
37
57
|
queueName,
|
|
38
58
|
visibilityTimeoutMs,
|
|
39
|
-
});
|
|
59
|
+
}));
|
|
40
60
|
return result ?? undefined;
|
|
41
61
|
};
|
|
42
62
|
/** Mark a pulled job completed. */
|
|
43
63
|
export const ackJob = async (queueName, jobId, returnValue) => {
|
|
44
|
-
await call('queue', 'ack', { queueName, jobId, returnValue });
|
|
64
|
+
await call('queue', 'ack', queuePayload({ queueName, jobId, returnValue }));
|
|
45
65
|
};
|
|
46
66
|
/** Mark a pulled job failed. */
|
|
47
67
|
export const failJob = async (queueName, jobId, reason) => {
|
|
48
68
|
try {
|
|
49
|
-
await call('queue', 'fail', { queueName, jobId, reason });
|
|
69
|
+
await call('queue', 'fail', queuePayload({ queueName, jobId, reason }));
|
|
50
70
|
}
|
|
51
71
|
catch (error) {
|
|
52
72
|
Logger.warn('[worker-runtime] failJob RPC failed', { queueName, jobId, error });
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* ZinTrust plugin auto-imports
|
|
3
|
+
*
|
|
4
|
+
* In real projects, this file is managed by `zin plugin install` and contains
|
|
5
|
+
* side-effect imports (e.g. `@zintrust/db-sqlite/register`) that register
|
|
6
|
+
* optional adapters/drivers into core registries.
|
|
7
|
+
*
|
|
5
8
|
*/
|
|
6
9
|
export type {};
|
|
7
10
|
export declare const __zintrustGeneratedPluginStub = "zintrust.plugins.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zintrust.plugins.d.ts","sourceRoot":"","sources":["../../src/zintrust.plugins.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"zintrust.plugins.d.ts","sourceRoot":"","sources":["../../src/zintrust.plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,YAAY,EAAE,CAAC;AAgBf,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;;AACnE,wBAAkB"}
|
package/src/zintrust.plugins.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* ZinTrust plugin auto-imports
|
|
3
|
+
*
|
|
4
|
+
* In real projects, this file is managed by `zin plugin install` and contains
|
|
5
|
+
* side-effect imports (e.g. `@zintrust/db-sqlite/register`) that register
|
|
6
|
+
* optional adapters/drivers into core registries.
|
|
7
|
+
*
|
|
5
8
|
*/
|
|
6
9
|
import * as TraceRuntime from './runtime/plugins/trace-runtime.js';
|
|
7
10
|
globalThis.__zintrust_system_trace_plugin_requested__ = true;
|