@zintrust/core 2.7.3 → 2.8.2
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 +3 -3
- package/src/boot/registry/runtime.d.ts.map +1 -1
- package/src/boot/registry/runtime.js +4 -2
- package/src/config/redis.d.ts.map +1 -1
- package/src/config/redis.js +3 -2
- package/src/health/RuntimeHealthProbes.js +1 -1
- package/src/index.js +3 -3
- package/src/observability/PrometheusMetrics.d.ts.map +1 -1
- package/src/observability/PrometheusMetrics.js +2 -3
- package/src/runtime/ProjectRuntime.d.ts.map +1 -1
- package/src/runtime/ProjectRuntime.js +17 -23
- package/src/tools/queue/QueueRuntimeRegistration.d.ts.map +1 -1
- package/src/tools/queue/QueueRuntimeRegistration.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zintrust/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.2",
|
|
4
4
|
"description": "Production-grade TypeScript backend framework for JavaScript",
|
|
5
5
|
"homepage": "https://zintrust.com",
|
|
6
6
|
"repository": {
|
|
@@ -253,10 +253,10 @@
|
|
|
253
253
|
"axios": "^1.16.1"
|
|
254
254
|
},
|
|
255
255
|
"@actions/github": {
|
|
256
|
-
"undici": "^6.
|
|
256
|
+
"undici": "^6.27.0"
|
|
257
257
|
},
|
|
258
258
|
"@actions/http-client": {
|
|
259
|
-
"undici": "^6.
|
|
259
|
+
"undici": "^6.27.0"
|
|
260
260
|
},
|
|
261
261
|
"miniflare": {
|
|
262
262
|
"undici": "^7.28.0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/boot/registry/runtime.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAQnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/boot/registry/runtime.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAQnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAiTvD,eAAO,MAAM,8BAA8B,GAAI,iBAAiB,gBAAgB,KAAG,IA6BlF,CAAC;AA8WF,KAAK,eAAe,GAAG;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,gBAAgB,CAAC;IAClC,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAqIF,eAAO,MAAM,eAAe,GAC1B,QAAQ,eAAe,KACtB;IAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAK5D,CAAC"}
|
|
@@ -19,7 +19,7 @@ import { registerDatabasesFromRuntimeConfig } from '../../orm/DatabaseRuntimeReg
|
|
|
19
19
|
import { registerMasterRoutes, tryImportOptional } from './registerRoute.js';
|
|
20
20
|
import { registerWorkerShutdownHook } from './worker.js';
|
|
21
21
|
import { StartupConfigFile, StartupConfigFileRegistry } from '../../runtime/StartupConfigFileRegistry.js';
|
|
22
|
-
import { SocketFeature } from '../../sockets/SocketRuntime.js';
|
|
22
|
+
import { SocketFeature, } from '../../sockets/SocketRuntime.js';
|
|
23
23
|
import { SocketRuntimeRegistry } from '../../sockets/SocketRuntimeRegistry.js';
|
|
24
24
|
import { registerBroadcastersFromRuntimeConfig } from '../../tools/broadcast/BroadcastRuntimeRegistration.js';
|
|
25
25
|
import { registerNotificationChannelsFromRuntimeConfig } from '../../tools/notification/NotificationRuntimeRegistration.js';
|
|
@@ -366,6 +366,7 @@ const initializeQueueMonitor = async (router) => {
|
|
|
366
366
|
Logger.info(`Queue Monitor enqueue endpoint at http://127.0.0.1:${appConfig.port}/test/enqueue`);
|
|
367
367
|
};
|
|
368
368
|
let runtimeQueueMonitor = null;
|
|
369
|
+
const QUEUE_REDIS_PACKAGE = '@zintrust/queue-redis';
|
|
369
370
|
const initializeWorkers = async (router) => {
|
|
370
371
|
const workers = await loadWorkersModule({ allowWhenDisabled: true });
|
|
371
372
|
if (workers?.WorkerInit !== undefined && typeof workers.registerWorkerRoutes === 'function') {
|
|
@@ -383,7 +384,8 @@ const resolveLocalQueueRedisEntry = () => {
|
|
|
383
384
|
};
|
|
384
385
|
const loadQueueHttpGatewayModule = async () => {
|
|
385
386
|
try {
|
|
386
|
-
return (await import(
|
|
387
|
+
return (await import(
|
|
388
|
+
/* @vite-ignore */ QUEUE_REDIS_PACKAGE));
|
|
387
389
|
}
|
|
388
390
|
catch {
|
|
389
391
|
const localEntry = resolveLocalQueueRedisEntry();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../../src/config/redis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAM/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1E,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA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EF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,0BAA0B,KAAG,MAYnE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,0BAA0B,KAAG,MAAM,GAAG,IAW1E,CAAC;AAuDF,eAAO,MAAM,YAAY,GAAU,CAAC,GAAG,WAAW,EAAE,OAAO,OAAO,GAAG,SAAS,KAAG,OAAO,CAAC,CAAC,CA0BzF,CAAC"}
|
package/src/config/redis.js
CHANGED
|
@@ -22,7 +22,7 @@ export const buildRedisUrl = (config) => {
|
|
|
22
22
|
export const getRedisUrl = (config) => {
|
|
23
23
|
const fromEnv = Env.get('REDIS_URL', '');
|
|
24
24
|
const hasProcess = typeof process === 'object' && process !== null;
|
|
25
|
-
const fallback = hasProcess ? process.env?.['REDIS_URL'] ?? '' : '';
|
|
25
|
+
const fallback = hasProcess ? (process.env?.['REDIS_URL'] ?? '') : '';
|
|
26
26
|
const trimmed = fromEnv.trim();
|
|
27
27
|
const url = (trimmed.length > 0 ? fromEnv : String(fallback)).trim();
|
|
28
28
|
// If REDIS_URL exists, use it
|
|
@@ -30,6 +30,7 @@ export const getRedisUrl = (config) => {
|
|
|
30
30
|
return url;
|
|
31
31
|
return buildRedisUrl(config);
|
|
32
32
|
};
|
|
33
|
+
const QUEUE_REDIS_PACKAGE = '@zintrust/queue-redis';
|
|
33
34
|
const resolveLocalQueueRedisEntry = () => {
|
|
34
35
|
const cwd = typeof process !== 'undefined' && typeof process.cwd === 'function' ? process.cwd() : '';
|
|
35
36
|
if (cwd.trim() === '')
|
|
@@ -39,7 +40,7 @@ const resolveLocalQueueRedisEntry = () => {
|
|
|
39
40
|
};
|
|
40
41
|
const importQueueRedisModule = async () => {
|
|
41
42
|
try {
|
|
42
|
-
return (await import(
|
|
43
|
+
return (await import(/* @vite-ignore */ QUEUE_REDIS_PACKAGE));
|
|
43
44
|
}
|
|
44
45
|
catch {
|
|
45
46
|
const localEntry = resolveLocalQueueRedisEntry();
|
|
@@ -42,7 +42,7 @@ const pingKvCache = async (timeoutMs = 2000) => {
|
|
|
42
42
|
const start = Date.now();
|
|
43
43
|
const kv = Cloudflare.getKVBinding();
|
|
44
44
|
if (kv === null) {
|
|
45
|
-
throw ErrorFactory.createConfigError('Configured KV binding not found');
|
|
45
|
+
throw ErrorFactory.createConfigError('Configured KV binding "CACHE" not found');
|
|
46
46
|
}
|
|
47
47
|
const key = `__runtime_health__:kv:${Date.now()}`;
|
|
48
48
|
await withTimeout('runtime.cache.kv.ping', timeoutMs, async () => {
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @zintrust/core v2.
|
|
2
|
+
* @zintrust/core v2.8.2
|
|
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-06-
|
|
8
|
+
* Built: 2026-06-26T07:11:29.618Z
|
|
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-06-
|
|
24
|
+
export const ZINTRUST_BUILD_DATE = '2026-06-26T07:11:29.573Z'; // 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":"PrometheusMetrics.d.ts","sourceRoot":"","sources":["../../../src/observability/PrometheusMetrics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"PrometheusMetrics.d.ts","sourceRoot":"","sources":["../../../src/observability/PrometheusMetrics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8GH,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,iBAAiB;sBACJ,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;8BAWtC,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;0BAY3C,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;EAS/D,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { Env } from '../config/env.js';
|
|
7
7
|
let statePromise = null;
|
|
8
8
|
const DEFAULT_CONTENT_TYPE = 'text/plain; version=0.0.4; charset=utf-8';
|
|
9
|
+
const PROM_CLIENT_PACKAGE = 'prom-client';
|
|
9
10
|
const createNoopState = () => {
|
|
10
11
|
const noopCounter = { inc: () => undefined };
|
|
11
12
|
const noopHistogram = { observe: () => undefined };
|
|
@@ -28,9 +29,7 @@ async function ensureState() {
|
|
|
28
29
|
statePromise = (async () => {
|
|
29
30
|
let client;
|
|
30
31
|
try {
|
|
31
|
-
|
|
32
|
-
const promClientPkg = 'prom-client';
|
|
33
|
-
client = (await import(promClientPkg));
|
|
32
|
+
client = (await import(/* @vite-ignore */ PROM_CLIENT_PACKAGE));
|
|
34
33
|
}
|
|
35
34
|
catch {
|
|
36
35
|
// prom-client is intentionally optional at runtime.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtime/ProjectRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"ProjectRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtime/ProjectRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AA6FxC,eAAO,MAAM,cAAc;aAChB,IAAI;iBAIA,oBAAoB,GAAG,SAAS;gBAIjC,OAAO,GAAG,oBAAoB;oCAIV,OAAO,GAAG,oBAAoB,GAAG,SAAS;0BAM9C,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;4BAgBvC,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;0BAOjD,aAAa,CAAC,oBAAoB,CAAC;wBAIrC,oBAAoB,GAAG,SAAS;EAGpD,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -16,6 +16,12 @@ const getNodeRuntimeCandidates = (projectRoot) => [
|
|
|
16
16
|
path.join(projectRoot, 'dist', 'src', 'zintrust.runtime.js'),
|
|
17
17
|
path.join(projectRoot, 'src', 'zintrust.runtime.js'),
|
|
18
18
|
];
|
|
19
|
+
const WORKER_RUNTIME_CANDIDATES = [
|
|
20
|
+
'@/zintrust.runtime.wg',
|
|
21
|
+
'@/zintrust.runtime',
|
|
22
|
+
'../zintrust.runtime.wg.js',
|
|
23
|
+
'../zintrust.runtime.js',
|
|
24
|
+
];
|
|
19
25
|
const mergeProjectRuntime = (current, next) => {
|
|
20
26
|
return Object.freeze({
|
|
21
27
|
...(current?.serviceManifest === undefined ? {} : { serviceManifest: current.serviceManifest }),
|
|
@@ -53,30 +59,18 @@ const tryImportNodeRuntimeCandidate = async (candidate) => {
|
|
|
53
59
|
}
|
|
54
60
|
};
|
|
55
61
|
const tryImportWorkerRuntimeLiteralCandidates = async () => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// continue
|
|
67
|
-
}
|
|
68
|
-
try {
|
|
69
|
-
return cacheProjectRuntime((await import('../index.js' + 'zintrust.runtime.wg.js')));
|
|
70
|
-
}
|
|
71
|
-
catch {
|
|
72
|
-
// continue
|
|
73
|
-
}
|
|
74
|
-
try {
|
|
75
|
-
return cacheProjectRuntime((await import('../index.js' + 'zintrust.runtime.js')));
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
return undefined;
|
|
62
|
+
for (const candidate of WORKER_RUNTIME_CANDIDATES) {
|
|
63
|
+
try {
|
|
64
|
+
return cacheProjectRuntime(
|
|
65
|
+
// These files are generated in consuming projects and are legitimately absent
|
|
66
|
+
// when a browser bundle only imports unrelated helpers such as Logger.
|
|
67
|
+
(await import(/* @vite-ignore */ candidate)));
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// continue
|
|
71
|
+
}
|
|
79
72
|
}
|
|
73
|
+
return undefined;
|
|
80
74
|
};
|
|
81
75
|
export const ProjectRuntime = Object.freeze({
|
|
82
76
|
clear() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueueRuntimeRegistration.d.ts","sourceRoot":"","sources":["../../../../src/tools/queue/QueueRuntimeRegistration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"QueueRuntimeRegistration.d.ts","sourceRoot":"","sources":["../../../../src/tools/queue/QueueRuntimeRegistration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAsFjD,wBAAsB,+BAA+B,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyCxF"}
|
|
@@ -11,6 +11,7 @@ import { autoRegisterJobStateTrackerPersistenceFromEnv } from '../queue/JobState
|
|
|
11
11
|
import { QueueReliabilityOrchestrator } from '../queue/QueueReliabilityOrchestrator.js';
|
|
12
12
|
import { InMemoryQueue } from '../queue/drivers/InMemory.js';
|
|
13
13
|
import { Queue } from '../queue/Queue.js';
|
|
14
|
+
const QUEUE_REDIS_PACKAGE = '@zintrust/queue-redis';
|
|
14
15
|
/**
|
|
15
16
|
* Register queue drivers from runtime config.
|
|
16
17
|
*
|
|
@@ -21,7 +22,7 @@ import { Queue } from '../queue/Queue.js';
|
|
|
21
22
|
*/
|
|
22
23
|
const registerRedisDriverIfAvailable = async () => {
|
|
23
24
|
try {
|
|
24
|
-
const mod = (await import(
|
|
25
|
+
const mod = (await import(/* @vite-ignore */ QUEUE_REDIS_PACKAGE));
|
|
25
26
|
if (mod.RedisQueue !== undefined) {
|
|
26
27
|
Queue.register('redis', mod.RedisQueue);
|
|
27
28
|
return true;
|