@zintrust/core 1.5.4 → 1.6.0
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/bin/launcher.d.ts +6 -0
- package/bin/launcher.d.ts.map +1 -0
- package/bin/launcher.js +167 -0
- package/bin/z.js +2 -35
- package/bin/zin.js +2 -35
- package/bin/zintrust.d.ts +1 -1
- package/bin/zintrust.d.ts.map +1 -1
- package/bin/zintrust.js +3 -36
- package/bin/zt.d.ts +1 -1
- package/bin/zt.js +3 -23
- package/package.json +1 -1
- package/src/boot/bootstrap.d.ts.map +1 -1
- package/src/boot/bootstrap.js +105 -40
- package/src/boot/registry/runtime.d.ts +4 -2
- package/src/boot/registry/runtime.d.ts.map +1 -1
- package/src/boot/registry/runtime.js +67 -26
- package/src/boot/registry/worker.d.ts.map +1 -1
- package/src/boot/registry/worker.js +3 -2
- package/src/cli/utils/spawn.d.ts.map +1 -1
- package/src/cli/utils/spawn.js +255 -46
- package/src/helper/ShutdownTrace.d.ts +9 -0
- package/src/helper/ShutdownTrace.d.ts.map +1 -0
- package/src/helper/ShutdownTrace.js +148 -0
- package/src/helper/index.d.ts +1 -0
- package/src/helper/index.d.ts.map +1 -1
- package/src/helper/index.js +1 -0
- package/src/index.js +3 -3
- package/src/tools/queue/QueueReliabilityOrchestrator.d.ts.map +1 -1
- package/src/tools/queue/QueueReliabilityOrchestrator.js +11 -0
- package/src/zintrust.plugins.d.ts +3 -6
- package/src/zintrust.plugins.d.ts.map +1 -1
- package/src/zintrust.plugins.js +3 -6
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
const TRACE_ENV_KEYS = ['SHUTDOWN_TRACE', 'DEBUG_SHUTDOWN_TRACE', 'WORKER_SHUTDOWN_TRACE'];
|
|
2
|
+
const MAX_HANDLE_DETAILS = 20;
|
|
3
|
+
const writeLine = (line) => {
|
|
4
|
+
const nodeProcess = getNodeProcess();
|
|
5
|
+
if (nodeProcess?.stderr && typeof nodeProcess.stderr.write === 'function') {
|
|
6
|
+
nodeProcess.stderr.write(`${line}\n`);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const getNodeProcess = () => {
|
|
10
|
+
if (typeof process === 'undefined')
|
|
11
|
+
return null;
|
|
12
|
+
return process; // NOSONAR
|
|
13
|
+
};
|
|
14
|
+
const isEnabled = () => {
|
|
15
|
+
const nodeProcess = getNodeProcess();
|
|
16
|
+
if (nodeProcess === null)
|
|
17
|
+
return false;
|
|
18
|
+
return TRACE_ENV_KEYS.some((key) => {
|
|
19
|
+
const raw = nodeProcess.env[key];
|
|
20
|
+
if (typeof raw !== 'string')
|
|
21
|
+
return false;
|
|
22
|
+
const normalized = raw.trim().toLowerCase();
|
|
23
|
+
return (normalized === '1' || normalized === 'true' || normalized === 'yes' || normalized === 'on');
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const getConstructorName = (value) => {
|
|
27
|
+
if (typeof value !== 'object' || value === null)
|
|
28
|
+
return typeof value;
|
|
29
|
+
const constructorValue = value.constructor;
|
|
30
|
+
return typeof constructorValue?.name === 'string' ? constructorValue.name : 'Unknown';
|
|
31
|
+
};
|
|
32
|
+
const hasFunction = (value, key) => {
|
|
33
|
+
return (typeof value === 'object' &&
|
|
34
|
+
value !== null &&
|
|
35
|
+
key in value &&
|
|
36
|
+
typeof value[key] === 'function');
|
|
37
|
+
};
|
|
38
|
+
const getOptionalValue = (value, key) => {
|
|
39
|
+
if (typeof value !== 'object' || value === null || !(key in value))
|
|
40
|
+
return undefined;
|
|
41
|
+
return value[key];
|
|
42
|
+
};
|
|
43
|
+
const summarizeHandle = (handle) => {
|
|
44
|
+
const constructorName = getConstructorName(handle);
|
|
45
|
+
const summary = {
|
|
46
|
+
type: constructorName,
|
|
47
|
+
};
|
|
48
|
+
const fd = getOptionalValue(handle, 'fd');
|
|
49
|
+
if (typeof fd === 'number') {
|
|
50
|
+
summary['fd'] = fd;
|
|
51
|
+
}
|
|
52
|
+
const localPort = getOptionalValue(handle, 'localPort');
|
|
53
|
+
if (typeof localPort === 'number') {
|
|
54
|
+
summary['localPort'] = localPort;
|
|
55
|
+
}
|
|
56
|
+
const remotePort = getOptionalValue(handle, 'remotePort');
|
|
57
|
+
if (typeof remotePort === 'number') {
|
|
58
|
+
summary['remotePort'] = remotePort;
|
|
59
|
+
}
|
|
60
|
+
const repeat = getOptionalValue(handle, '_repeat');
|
|
61
|
+
if (typeof repeat === 'number') {
|
|
62
|
+
summary['repeatMs'] = repeat;
|
|
63
|
+
}
|
|
64
|
+
const destroyed = getOptionalValue(handle, 'destroyed');
|
|
65
|
+
if (typeof destroyed === 'boolean') {
|
|
66
|
+
summary['destroyed'] = destroyed;
|
|
67
|
+
}
|
|
68
|
+
if (hasFunction(handle, 'hasRef')) {
|
|
69
|
+
try {
|
|
70
|
+
summary['hasRef'] = handle.hasRef();
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
summary['hasRef'] = 'error';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return summary;
|
|
77
|
+
};
|
|
78
|
+
const countTypes = (items) => {
|
|
79
|
+
return items.reduce((counts, item) => {
|
|
80
|
+
const type = getConstructorName(item);
|
|
81
|
+
counts[type] = (counts[type] ?? 0) + 1;
|
|
82
|
+
return counts;
|
|
83
|
+
}, {});
|
|
84
|
+
};
|
|
85
|
+
const log = (label, details = {}) => {
|
|
86
|
+
if (!isEnabled())
|
|
87
|
+
return;
|
|
88
|
+
writeLine(JSON.stringify({
|
|
89
|
+
level: 'info',
|
|
90
|
+
trace: 'shutdown',
|
|
91
|
+
label,
|
|
92
|
+
details,
|
|
93
|
+
}));
|
|
94
|
+
};
|
|
95
|
+
const logHandles = (label, details = {}) => {
|
|
96
|
+
if (!isEnabled())
|
|
97
|
+
return;
|
|
98
|
+
const nodeProcess = getNodeProcess(); //NOSONAR
|
|
99
|
+
const handles = typeof nodeProcess._getActiveHandles === 'function' ? nodeProcess._getActiveHandles() : [];
|
|
100
|
+
const requests = typeof nodeProcess._getActiveRequests === 'function' ? nodeProcess._getActiveRequests() : [];
|
|
101
|
+
writeLine(JSON.stringify({
|
|
102
|
+
level: 'info',
|
|
103
|
+
trace: 'shutdown',
|
|
104
|
+
label,
|
|
105
|
+
details: {
|
|
106
|
+
...details,
|
|
107
|
+
available: true,
|
|
108
|
+
handleCount: handles.length,
|
|
109
|
+
requestCount: requests.length,
|
|
110
|
+
handleTypes: countTypes(handles),
|
|
111
|
+
requestTypes: countTypes(requests),
|
|
112
|
+
handles: handles.slice(0, MAX_HANDLE_DETAILS).map((handle) => summarizeHandle(handle)),
|
|
113
|
+
requests: requests.slice(0, MAX_HANDLE_DETAILS).map((request) => summarizeHandle(request)),
|
|
114
|
+
},
|
|
115
|
+
}));
|
|
116
|
+
};
|
|
117
|
+
const logBullMQWorker = (label, worker, details = {}) => {
|
|
118
|
+
if (!isEnabled())
|
|
119
|
+
return;
|
|
120
|
+
const name = getOptionalValue(worker, 'name');
|
|
121
|
+
const opts = getOptionalValue(worker, 'opts');
|
|
122
|
+
const connection = getOptionalValue(opts, 'connection');
|
|
123
|
+
const prefix = getOptionalValue(opts, 'prefix');
|
|
124
|
+
const concurrency = getOptionalValue(opts, 'concurrency');
|
|
125
|
+
const autorun = getOptionalValue(opts, 'autorun');
|
|
126
|
+
const closing = getOptionalValue(worker, 'closing');
|
|
127
|
+
writeLine(JSON.stringify({
|
|
128
|
+
level: 'info',
|
|
129
|
+
trace: 'shutdown',
|
|
130
|
+
label,
|
|
131
|
+
details: {
|
|
132
|
+
...details,
|
|
133
|
+
workerType: getConstructorName(worker),
|
|
134
|
+
queueName: typeof name === 'string' ? name : undefined,
|
|
135
|
+
prefix: typeof prefix === 'string' ? prefix : undefined,
|
|
136
|
+
concurrency: typeof concurrency === 'number' ? concurrency : undefined,
|
|
137
|
+
autorun: typeof autorun === 'boolean' ? autorun : undefined,
|
|
138
|
+
connectionType: getConstructorName(connection),
|
|
139
|
+
closingState: closing === undefined ? 'idle' : getConstructorName(closing),
|
|
140
|
+
},
|
|
141
|
+
}));
|
|
142
|
+
};
|
|
143
|
+
export const ShutdownTrace = Object.freeze({
|
|
144
|
+
isEnabled,
|
|
145
|
+
log,
|
|
146
|
+
logHandles,
|
|
147
|
+
logBullMQWorker,
|
|
148
|
+
});
|
package/src/helper/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const isObject: (value: unknown) => value is Record<string, unkno
|
|
|
13
13
|
export declare const isFunction: (value: unknown) => value is (...args: unknown[]) => unknown;
|
|
14
14
|
/** Check whether value is a valid Date object */
|
|
15
15
|
export declare const isDate: (value: unknown) => value is Date;
|
|
16
|
+
export { ShutdownTrace } from './ShutdownTrace';
|
|
16
17
|
/**
|
|
17
18
|
* Check if value is "empty".
|
|
18
19
|
* Matches legacy behavior: null, undefined, false, 0, '', '0' are all considered empty.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helper/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,gDAAgD;AAChD,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAmC,CAAC;AAEvF,sCAAsC;AACtC,eAAO,MAAM,OAAO,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,OAAO,EAA0B,CAAC;AAEpF,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACH,CAAC;AAEvE,wCAAwC;AACxC,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAChD,CAAC;AAE9B,iDAAiD;AACjD,eAAO,MAAM,MAAM,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,IACQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helper/index.ts"],"names":[],"mappings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,OAAO,UAAU,MAAM,KAAG,OAAO;yBAM9B,OAAO,OAAO,MAAM,KAAG,OAAO;yBAM9B,OAAO,OAAO,MAAM,KAAG,OAAO;qBA7CxD,OAAO,SACP,MAAM,YACH;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAC/B,OAAO;qBArBqB,OAAO,KAAG,OAAO;4BAIV,OAAO,KAAG,OAAO;uBApItB,OAAO,KAAG,OAAO;;;yBAiGf,OAAO,eAAe;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO;2BAKxF,OAAO,eACD;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,KAC1C,OAAO;8BAiG8B,OAAO,KAAG,KAAK,IAAI,MAAM;6BAI1B,OAAO,KAAG,KAAK,IAAI,OAAO,EAAE;8BAI3B,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;8BAW1C,OAAO,KAAG,OAAO;oBAO3B,OAAO,KAAG,OAAO;oBASjB,OAAO,KAAG,OAAO;sBAaf,OAAO,KAAG,OAAO;wBAWf,OAAO,KAAG,OAAO;oBAUrB,OAAO,KAAG,OAAO;yBAQZ,OAAO,KAAG,OAAO;yBASjB,OAAO,KAAG,OAAO;wBAWlB,OAAO,KAAG,OAAO;wBAIjB,OAAO,KAAG,OAAO;oBAIrB,OAAO,KAAG,OAAO;oBAIjB,OAAO,KAAG,OAAO;mBAIlB,OAAO,KAAG,OAAO;uBAOb,OAAO,KAAG,OAAO;uBAMjB,OAAO,OAAO,MAAM,OAAO,MAAM,KAAG,OAAO;2BAMvC,OAAO,WAAW,MAAM,KAAG,OAAO;EAwDrE,CAAC"}
|
package/src/helper/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export const isObject = (value) => typeof value === 'object' && value !== null &
|
|
|
16
16
|
export const isFunction = (value) => typeof value === 'function';
|
|
17
17
|
/** Check whether value is a valid Date object */
|
|
18
18
|
export const isDate = (value) => value instanceof Date && !Number.isNaN(value.getTime());
|
|
19
|
+
export { ShutdownTrace } from './ShutdownTrace.js';
|
|
19
20
|
/* -------------------------------------------------------------------------- */
|
|
20
21
|
/* Empty / Null Checks */
|
|
21
22
|
/* -------------------------------------------------------------------------- */
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @zintrust/core v1.
|
|
2
|
+
* @zintrust/core v1.6.0
|
|
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-04-
|
|
8
|
+
* Built: 2026-04-29T16:55:46.596Z
|
|
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-04-
|
|
24
|
+
export const ZINTRUST_BUILD_DATE = '2026-04-29T16:55:46.563Z'; // 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":"QueueReliabilityOrchestrator.d.ts","sourceRoot":"","sources":["../../../../src/tools/queue/QueueReliabilityOrchestrator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QueueReliabilityOrchestrator.d.ts","sourceRoot":"","sources":["../../../../src/tools/queue/QueueReliabilityOrchestrator.ts"],"names":[],"mappings":"AAoDA,eAAO,MAAM,4BAA4B;iBAC1B,OAAO;aAIX,IAAI;YAiCL,IAAI;EAeZ,CAAC;AAEH,eAAe,4BAA4B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Env } from '../../config/env.js';
|
|
2
2
|
import { Logger } from '../../config/logger.js';
|
|
3
|
+
import { ShutdownTrace } from '../../helper/index.js';
|
|
3
4
|
import { JobReconciliationRunner } from './JobReconciliationRunner.js';
|
|
4
5
|
import { JobRecoveryDaemon } from './JobRecoveryDaemon.js';
|
|
5
6
|
import { StalledJobMonitor } from './StalledJobMonitor.js';
|
|
@@ -57,8 +58,16 @@ export const QueueReliabilityOrchestrator = Object.freeze({
|
|
|
57
58
|
recoveryMs,
|
|
58
59
|
stalledMs,
|
|
59
60
|
});
|
|
61
|
+
ShutdownTrace.logHandles('queue-reliability.start', {
|
|
62
|
+
reconciliationMs,
|
|
63
|
+
recoveryMs,
|
|
64
|
+
stalledMs,
|
|
65
|
+
});
|
|
60
66
|
},
|
|
61
67
|
stop() {
|
|
68
|
+
ShutdownTrace.log('queue-reliability.stop.start', {
|
|
69
|
+
started: state.started,
|
|
70
|
+
});
|
|
62
71
|
clearTimer(state.reconciliationTimer);
|
|
63
72
|
clearTimer(state.recoveryTimer);
|
|
64
73
|
clearTimer(state.stalledTimer);
|
|
@@ -66,6 +75,8 @@ export const QueueReliabilityOrchestrator = Object.freeze({
|
|
|
66
75
|
state.recoveryTimer = undefined;
|
|
67
76
|
state.stalledTimer = undefined;
|
|
68
77
|
state.started = false;
|
|
78
|
+
Logger.info('Queue reliability orchestrator stopped');
|
|
79
|
+
ShutdownTrace.logHandles('queue-reliability.stop.complete');
|
|
69
80
|
},
|
|
70
81
|
});
|
|
71
82
|
export default QueueReliabilityOrchestrator;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* side-effect imports (e.g. `@zintrust/db-sqlite/register`) that register
|
|
6
|
-
* optional adapters/drivers into core registries.
|
|
7
|
-
*
|
|
2
|
+
* Auto-generated fallback module.
|
|
3
|
+
* This file is created by scripts/ensure-worker-plugins.mjs when missing.
|
|
4
|
+
* It allows optional runtime plugin imports to resolve in CI/scaffolded setups.
|
|
8
5
|
*/
|
|
9
6
|
export type {};
|
|
10
7
|
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;;;;GAIG;AAIH,YAAY,EAAE,CAAC;AAgBf,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;;AACnE,wBAAkB"}
|
package/src/zintrust.plugins.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* side-effect imports (e.g. `@zintrust/db-sqlite/register`) that register
|
|
6
|
-
* optional adapters/drivers into core registries.
|
|
7
|
-
*
|
|
2
|
+
* Auto-generated fallback module.
|
|
3
|
+
* This file is created by scripts/ensure-worker-plugins.mjs when missing.
|
|
4
|
+
* It allows optional runtime plugin imports to resolve in CI/scaffolded setups.
|
|
8
5
|
*/
|
|
9
6
|
import * as TraceRuntime from './runtime/plugins/trace-runtime.js';
|
|
10
7
|
globalThis.__zintrust_system_trace_plugin_requested__ = true;
|