@zintrust/core 0.1.43 → 0.1.46

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 (43) hide show
  1. package/README.md +1 -0
  2. package/package.json +3 -1
  3. package/packages/workers/src/http/middleware/FeaturesValidator.d.ts.map +1 -1
  4. package/packages/workers/src/http/middleware/FeaturesValidator.js +5 -4
  5. package/src/cli/CLI.d.ts.map +1 -1
  6. package/src/cli/CLI.js +8 -0
  7. package/src/cli/commands/ContainerComposeLifecycle.d.ts +20 -0
  8. package/src/cli/commands/ContainerComposeLifecycle.d.ts.map +1 -0
  9. package/src/cli/commands/ContainerComposeLifecycle.js +46 -0
  10. package/src/cli/commands/ContainerProxiesCommand.d.ts.map +1 -1
  11. package/src/cli/commands/ContainerProxiesCommand.js +7 -44
  12. package/src/cli/commands/ContainerWorkersCommand.d.ts.map +1 -1
  13. package/src/cli/commands/ContainerWorkersCommand.js +7 -30
  14. package/src/cli/commands/DeployCommand.d.ts.map +1 -1
  15. package/src/cli/commands/DeployCommand.js +12 -1
  16. package/src/cli/commands/DeployContainersProxyCommand.d.ts +5 -0
  17. package/src/cli/commands/DeployContainersProxyCommand.d.ts.map +1 -0
  18. package/src/cli/commands/DeployContainersProxyCommand.js +45 -0
  19. package/src/cli/commands/DockerCommand.d.ts +5 -0
  20. package/src/cli/commands/DockerCommand.d.ts.map +1 -0
  21. package/src/cli/commands/DockerCommand.js +156 -0
  22. package/src/cli/commands/DockerPushCommand.d.ts +5 -0
  23. package/src/cli/commands/DockerPushCommand.d.ts.map +1 -0
  24. package/src/cli/commands/DockerPushCommand.js +92 -0
  25. package/src/cli/commands/InitContainerCommand.d.ts.map +1 -1
  26. package/src/cli/commands/InitContainerCommand.js +1 -0
  27. package/src/cli/commands/InitContainersProxyCommand.d.ts +5 -0
  28. package/src/cli/commands/InitContainersProxyCommand.d.ts.map +1 -0
  29. package/src/cli/commands/InitContainersProxyCommand.js +159 -0
  30. package/src/cli/commands/PutCommand.d.ts.map +1 -1
  31. package/src/cli/commands/PutCommand.js +15 -5
  32. package/src/cli/commands/StartCommand.d.ts.map +1 -1
  33. package/src/cli/commands/StartCommand.js +20 -3
  34. package/src/config/queue.d.ts.map +1 -1
  35. package/src/config/queue.js +27 -8
  36. package/src/index.js +3 -3
  37. package/src/orm/Database.d.ts.map +1 -1
  38. package/src/orm/Database.js +36 -2
  39. package/src/performance/Optimizer.js +1 -1
  40. package/src/proxy/ProxyServer.d.ts.map +1 -1
  41. package/src/proxy/ProxyServer.js +9 -0
  42. package/src/session/SessionManager.js +1 -1
  43. package/src/templates/docker/docker-compose.schedules.yml.tpl +78 -7
@@ -0,0 +1,92 @@
1
+ import { BaseCommand } from '../BaseCommand.js';
2
+ import { VersionChecker } from '../services/VersionChecker.js';
3
+ import { SpawnUtil } from '../utils/spawn.js';
4
+ import { Logger } from '../../config/logger.js';
5
+ import { ErrorFactory } from '../../exceptions/ZintrustError.js';
6
+ const parsePlatforms = (value) => {
7
+ const raw = (value ?? '').trim();
8
+ if (raw !== '')
9
+ return raw;
10
+ return 'linux/amd64,linux/arm64';
11
+ };
12
+ const parseTag = (value) => {
13
+ const raw = (value ?? '').trim();
14
+ if (raw === '') {
15
+ const currentVersion = VersionChecker.getCurrentVersion();
16
+ return currentVersion === '0.0.0' ? 'latest' : currentVersion;
17
+ }
18
+ return raw;
19
+ };
20
+ const resolvePublishTags = (tag, alsoLatest) => {
21
+ if (tag === 'latest')
22
+ return ['latest'];
23
+ if (alsoLatest === false)
24
+ return [tag];
25
+ return [tag, 'latest'];
26
+ };
27
+ const parseOnly = (value) => {
28
+ const raw = (value ?? '').trim().toLowerCase();
29
+ if (raw === 'runtime' || raw === 'gateway')
30
+ return raw;
31
+ return 'both';
32
+ };
33
+ const runPublishImages = async (options) => {
34
+ const tag = parseTag(options.tag);
35
+ const platforms = parsePlatforms(options.platforms);
36
+ const tags = resolvePublishTags(tag, options.alsoLatest);
37
+ const only = parseOnly(options.only);
38
+ const runtimeRepo = 'zintrust/zintrust';
39
+ const gatewayRepo = 'zintrust/zintrust-proxy-gateway';
40
+ const buildArgsFor = (repo, context) => {
41
+ const args = ['buildx', 'build', '--platform', platforms];
42
+ for (const t of tags)
43
+ args.push('-t', `${repo}:${t}`);
44
+ args.push('--push', context);
45
+ return args;
46
+ };
47
+ Logger.info('Publishing images to Docker Hub via buildx...', {
48
+ runtime: runtimeRepo,
49
+ gateway: gatewayRepo,
50
+ platforms,
51
+ tags,
52
+ only,
53
+ });
54
+ if (only === 'runtime' || only === 'both') {
55
+ const runtimeExit = await SpawnUtil.spawnAndWait({
56
+ command: 'docker',
57
+ args: buildArgsFor(runtimeRepo, '.'),
58
+ env: process.env,
59
+ });
60
+ if (runtimeExit !== 0) {
61
+ throw ErrorFactory.createCliError(`Failed to publish ${runtimeRepo} (exit code ${runtimeExit})`);
62
+ }
63
+ }
64
+ if (only === 'gateway' || only === 'both') {
65
+ const gatewayExit = await SpawnUtil.spawnAndWait({
66
+ command: 'docker',
67
+ args: buildArgsFor(gatewayRepo, './docker/proxy-gateway'),
68
+ env: process.env,
69
+ });
70
+ if (gatewayExit !== 0) {
71
+ throw ErrorFactory.createCliError(`Failed to publish ${gatewayRepo} (exit code ${gatewayExit})`);
72
+ }
73
+ }
74
+ };
75
+ export const DockerPushCommand = Object.freeze({
76
+ create() {
77
+ return BaseCommand.create({
78
+ name: 'docker:push',
79
+ aliases: ['docker-push'],
80
+ description: 'Build and push ZinTrust Docker images to Docker Hub',
81
+ addOptions: (command) => {
82
+ command.option('--tag <tag>', 'Docker image tag to publish. Defaults to current version and also tags :latest');
83
+ command.option('--platforms <list>', 'Comma-separated platforms for buildx', 'linux/amd64,linux/arm64');
84
+ command.option('--no-also-latest', 'When publishing a non-latest --tag, do not also push :latest');
85
+ command.option('--only <target>', 'Publish only one image: runtime|gateway|both', 'both');
86
+ },
87
+ execute: async (options) => {
88
+ await runPublishImages(options);
89
+ },
90
+ });
91
+ },
92
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"InitContainerCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/InitContainerCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAmOlE,eAAO,MAAM,oBAAoB;cACrB,YAAY;EAkBtB,CAAC"}
1
+ {"version":3,"file":"InitContainerCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/InitContainerCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAoOlE,eAAO,MAAM,oBAAoB;cACrB,YAAY;EAkBtB,CAAC"}
@@ -9,6 +9,7 @@ services:
9
9
  # Workers/Jobs API Service (Port 7772)
10
10
  # Exposes the Workers API to create/manage jobs
11
11
  workers-api:
12
+ image: \${WORKERS_IMAGE:-zintrust/zintrust-workers:latest}
12
13
  build:
13
14
  context: .
14
15
  dockerfile: Dockerfile
@@ -0,0 +1,5 @@
1
+ import { type IBaseCommand } from '../BaseCommand';
2
+ export declare const InitContainersProxyCommand: Readonly<{
3
+ create(): IBaseCommand;
4
+ }>;
5
+ //# sourceMappingURL=InitContainersProxyCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitContainersProxyCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/InitContainersProxyCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA6JlE,eAAO,MAAM,0BAA0B;cAC3B,YAAY;EAuBtB,CAAC"}
@@ -0,0 +1,159 @@
1
+ import { BaseCommand } from '../BaseCommand.js';
2
+ import { PromptHelper } from '../PromptHelper.js';
3
+ import { Logger } from '../../config/logger.js';
4
+ import { copyFileSync, existsSync, mkdirSync, writeFileSync } from '../../node-singletons/fs.js';
5
+ import { join } from '../../node-singletons/path.js';
6
+ const WRANGLER_CONTAINERS_PROXY_TEMPLATE = `/**
7
+ * ============================================================================
8
+ * ZinTrust Cloudflare Containers Proxy
9
+ * ============================================================================
10
+ * This Worker acts as the "gateway" for the DB/KV/SMTP proxy stack.
11
+ *
12
+ * Requests are routed by path prefix:
13
+ * /mysql/* -> ZintrustMySqlProxyContainer (port 8789)
14
+ * /postgres/* -> ZintrustPostgresProxyContainer (port 8790)
15
+ * /redis/* -> ZintrustRedisProxyContainer (port 8791)
16
+ * /mongodb/* -> ZintrustMongoDbProxyContainer (port 8792)
17
+ * /sqlserver/* -> ZintrustSqlServerProxyContainer (port 8793)
18
+ * /smtp/* -> ZintrustSmtpProxyContainer (port 8794)
19
+ *
20
+ * Notes:
21
+ * - You must install the runtime package: "@zintrust/cloudflare-containers-proxy".
22
+ * - Secrets should be uploaded with the same config file.
23
+ * ============================================================================
24
+ */
25
+
26
+ {
27
+ "name": "zintrust-containers-proxy",
28
+ "main": "./src/containers-proxy.ts",
29
+
30
+ "compatibility_date": "2025-04-21",
31
+ "compatibility_flags": ["nodejs_compat"],
32
+
33
+ "workers_dev": true,
34
+ "minify": false,
35
+
36
+ "containers": [
37
+ { "class_name": "ZintrustMySqlProxyContainer", "image": "./Dockerfile", "max_instances": 10 },
38
+ { "class_name": "ZintrustPostgresProxyContainer", "image": "./Dockerfile", "max_instances": 10 },
39
+ { "class_name": "ZintrustRedisProxyContainer", "image": "./Dockerfile", "max_instances": 10 },
40
+ { "class_name": "ZintrustMongoDbProxyContainer", "image": "./Dockerfile", "max_instances": 10 },
41
+ { "class_name": "ZintrustSqlServerProxyContainer", "image": "./Dockerfile", "max_instances": 10 },
42
+ { "class_name": "ZintrustSmtpProxyContainer", "image": "./Dockerfile", "max_instances": 10 }
43
+ ],
44
+
45
+ "durable_objects": {
46
+ "bindings": [
47
+ { "name": "ZT_PROXY_MYSQL", "class_name": "ZintrustMySqlProxyContainer" },
48
+ { "name": "ZT_PROXY_POSTGRES", "class_name": "ZintrustPostgresProxyContainer" },
49
+ { "name": "ZT_PROXY_REDIS", "class_name": "ZintrustRedisProxyContainer" },
50
+ { "name": "ZT_PROXY_MONGODB", "class_name": "ZintrustMongoDbProxyContainer" },
51
+ { "name": "ZT_PROXY_SQLSERVER", "class_name": "ZintrustSqlServerProxyContainer" },
52
+ { "name": "ZT_PROXY_SMTP", "class_name": "ZintrustSmtpProxyContainer" }
53
+ ]
54
+ },
55
+
56
+ "migrations": [
57
+ {
58
+ "tag": "containers-proxy-v1",
59
+ "new_sqlite_classes": [
60
+ "ZintrustMySqlProxyContainer",
61
+ "ZintrustPostgresProxyContainer",
62
+ "ZintrustRedisProxyContainer",
63
+ "ZintrustMongoDbProxyContainer",
64
+ "ZintrustSqlServerProxyContainer",
65
+ "ZintrustSmtpProxyContainer"
66
+ ]
67
+ }
68
+ ],
69
+
70
+ "env": {
71
+ "staging": {
72
+ "name": "zintrust-containers-proxy-staging",
73
+ "minify": false,
74
+ "vars": {
75
+ "ENVIRONMENT": "staging",
76
+ "APP_NAME": "ZinTrust",
77
+ "CSRF_SKIP_PATHS": "/api/*,/queue-monitor/*"
78
+ },
79
+ // Add routes here when ready:
80
+ // "routes": [{ "pattern": "proxy-staging.example.com", "custom_domain": true }]
81
+ },
82
+ "production": {
83
+ "name": "zintrust-containers-proxy-production",
84
+ "minify": true,
85
+ "vars": {
86
+ "ENVIRONMENT": "production",
87
+ "APP_NAME": "ZinTrust",
88
+ "CSRF_SKIP_PATHS": "/api/*,/queue-monitor/*"
89
+ },
90
+ // Add routes here when ready:
91
+ // "routes": [{ "pattern": "proxy.example.com", "custom_domain": true }]
92
+ }
93
+ }
94
+ }
95
+ `;
96
+ const WORKER_ENTRY_TEMPLATE = `export { default } from '@zintrust/cloudflare-containers-proxy';
97
+ export * from '@zintrust/cloudflare-containers-proxy';
98
+ `;
99
+ const backupSuffix = () => new Date().toISOString().replaceAll(/[:.]/g, '-');
100
+ const backupFileIfExists = (filePath) => {
101
+ if (!existsSync(filePath))
102
+ return;
103
+ const backupPath = `${filePath}.bak.${backupSuffix()}`;
104
+ copyFileSync(filePath, backupPath);
105
+ Logger.info(`🗂️ Backup created: ${backupPath}`);
106
+ };
107
+ async function writeWranglerConfig(cwd) {
108
+ const configPath = join(cwd, 'wrangler.containers-proxy.jsonc');
109
+ let shouldWrite = true;
110
+ if (existsSync(configPath)) {
111
+ shouldWrite = await PromptHelper.confirm('wrangler.containers-proxy.jsonc already exists. Overwrite?', false);
112
+ }
113
+ if (!shouldWrite) {
114
+ Logger.info('Skipped wrangler.containers-proxy.jsonc');
115
+ return;
116
+ }
117
+ backupFileIfExists(configPath);
118
+ writeFileSync(configPath, WRANGLER_CONTAINERS_PROXY_TEMPLATE);
119
+ Logger.info('✅ Created wrangler.containers-proxy.jsonc');
120
+ }
121
+ async function writeWorkerEntry(cwd) {
122
+ const srcDir = join(cwd, 'src');
123
+ const entryPath = join(srcDir, 'containers-proxy.ts');
124
+ if (!existsSync(srcDir)) {
125
+ mkdirSync(srcDir, { recursive: true });
126
+ }
127
+ let shouldWrite = true;
128
+ if (existsSync(entryPath)) {
129
+ shouldWrite = await PromptHelper.confirm('src/containers-proxy.ts already exists. Overwrite?', false);
130
+ }
131
+ if (!shouldWrite) {
132
+ Logger.info('Skipped src/containers-proxy.ts');
133
+ return;
134
+ }
135
+ backupFileIfExists(entryPath);
136
+ writeFileSync(entryPath, WORKER_ENTRY_TEMPLATE);
137
+ Logger.info('✅ Created src/containers-proxy.ts');
138
+ }
139
+ export const InitContainersProxyCommand = Object.freeze({
140
+ create() {
141
+ return BaseCommand.create({
142
+ name: 'init:containers-proxy',
143
+ aliases: ['init:ccp', 'init:cf-containers-proxy'],
144
+ description: 'Scaffold Cloudflare Containers proxy Worker (wrangler.containers-proxy.jsonc)',
145
+ async execute() {
146
+ Logger.info('Initializing Cloudflare Containers proxy scaffolding...');
147
+ const cwd = process.cwd();
148
+ await writeWranglerConfig(cwd);
149
+ await writeWorkerEntry(cwd);
150
+ Logger.info('✅ Containers proxy scaffolding complete.');
151
+ Logger.info('Install runtime: npm i @zintrust/cloudflare-containers-proxy');
152
+ Logger.info('Dev (Wrangler + Docker): zin docker --wrangler-config wrangler.containers-proxy.jsonc --env staging');
153
+ Logger.info('Dev (short): zin dk -e staging');
154
+ Logger.info('Deploy (short): zin d:ccp');
155
+ await Promise.resolve();
156
+ },
157
+ });
158
+ },
159
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"PutCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/PutCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAmNvF,eAAO,MAAM,UAAU;cACX,YAAY;EAWtB,CAAC;AAEH,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"PutCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/PutCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA0OvF,eAAO,MAAM,UAAU;cACX,YAAY;EAWtB,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -74,9 +74,14 @@ const getPutTimeoutMs = () => {
74
74
  return 120000;
75
75
  return parsed;
76
76
  };
77
- const putSecret = (wranglerEnv, key, value) => {
77
+ const putSecret = (wranglerEnv, key, value, configPath) => {
78
78
  const npmPath = resolveNpmPath();
79
- execFileSync(npmPath, ['exec', '--yes', '--', 'wrangler', 'secret', 'put', key, '--env', wranglerEnv], {
79
+ const args = ['exec', '--yes', '--', 'wrangler'];
80
+ if (typeof configPath === 'string' && configPath.trim().length > 0) {
81
+ args.push('--config', configPath.trim());
82
+ }
83
+ args.push('secret', 'put', key, '--env', wranglerEnv);
84
+ execFileSync(npmPath, args, {
80
85
  stdio: ['pipe', 'inherit', 'inherit'],
81
86
  input: value,
82
87
  encoding: 'utf8',
@@ -91,6 +96,7 @@ const addOptions = (command) => {
91
96
  .option('--wg <env...>', 'Wrangler environment target(s), e.g. d1-proxy kv-proxy')
92
97
  .option('--var <configKey...>', 'Config array key(s) from .zintrust.json (e.g. d1_env kv_env)')
93
98
  .option('--env_path <path>', 'Path to env file used as source values', '.env')
99
+ .option('-c, --config <path>', 'Wrangler config file to target (optional)')
94
100
  .option('--dry-run', 'Show what would be uploaded without calling wrangler');
95
101
  };
96
102
  const ensureCloudflareProvider = (providerRaw) => {
@@ -122,7 +128,7 @@ const reportResult = (cmd, pushed, failures) => {
122
128
  cmd.warn(`${item.key} -> ${item.wranglerEnv}: ${item.reason}`);
123
129
  }
124
130
  };
125
- const processPut = (cmd, wranglerEnvs, selectedKeys, envMap, dryRun) => {
131
+ const processPut = (cmd, wranglerEnvs, selectedKeys, envMap, dryRun, configPath) => {
126
132
  let pushed = 0;
127
133
  const failures = [];
128
134
  for (const wranglerEnv of wranglerEnvs) {
@@ -135,7 +141,7 @@ const processPut = (cmd, wranglerEnvs, selectedKeys, envMap, dryRun) => {
135
141
  try {
136
142
  if (!dryRun) {
137
143
  cmd.info(`putting ${key} -> ${wranglerEnv}...`);
138
- putSecret(wranglerEnv, key, value);
144
+ putSecret(wranglerEnv, key, value, configPath);
139
145
  }
140
146
  pushed += 1;
141
147
  cmd.info(`${dryRun ? '[dry-run] ' : ''}put ${key} -> ${wranglerEnv}`);
@@ -156,7 +162,11 @@ const execute = async (cmd, options) => {
156
162
  const envMap = await EnvFile.read({ cwd, path: envFilePath });
157
163
  const wranglerEnvs = resolveWranglerEnvs(options);
158
164
  const dryRun = options.dryRun === true;
159
- const result = processPut(cmd, wranglerEnvs, selectedKeys, envMap, dryRun);
165
+ const configPath = typeof options.config === 'string' ? options.config.trim() : '';
166
+ if (configPath !== '' && !existsSync(path.join(cwd, configPath))) {
167
+ throw ErrorFactory.createCliError(`Wrangler config not found: ${configPath}`);
168
+ }
169
+ const result = processPut(cmd, wranglerEnvs, selectedKeys, envMap, dryRun, configPath === '' ? undefined : configPath);
160
170
  reportResult(cmd, result.pushed, result.failures);
161
171
  };
162
172
  export const PutCommand = Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"StartCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/StartCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA2lBvF,eAAO,MAAM,YAAY;cACb,YAAY;EA4BtB,CAAC"}
1
+ {"version":3,"file":"StartCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/StartCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAwnBvF,eAAO,MAAM,YAAY;cACb,YAAY;EA6BtB,CAAC"}
@@ -241,16 +241,29 @@ const resolveNodeProdCommand = (cwd) => {
241
241
  }
242
242
  return { command: 'node', args: [compiled] };
243
243
  };
244
- const executeWranglerStart = async (cmd, cwd, port, runtime, envName) => {
244
+ const executeWranglerStart = async (cmd, cwd, port, runtime, envName, wranglerConfig) => {
245
245
  if (runtime !== undefined) {
246
246
  throw ErrorFactory.createCliError('Error: --runtime is not supported with --wrangler (Wrangler controls Workers runtime).');
247
247
  }
248
- const configPath = findWranglerConfig(cwd);
248
+ const normalizedConfig = typeof wranglerConfig === 'string' ? wranglerConfig.trim() : '';
249
+ const explicitConfigFullPath = normalizedConfig.length > 0 ? path.join(cwd, normalizedConfig) : undefined;
250
+ const configPath = explicitConfigFullPath ?? findWranglerConfig(cwd);
249
251
  const entry = resolveWranglerEntry(cwd);
252
+ if (explicitConfigFullPath !== undefined) {
253
+ if (existsSync(explicitConfigFullPath)) {
254
+ // ok
255
+ }
256
+ else {
257
+ throw ErrorFactory.createCliError(`Error: Wrangler config not found: ${normalizedConfig}`);
258
+ }
259
+ }
250
260
  if (configPath === undefined && entry === undefined) {
251
261
  throw ErrorFactory.createCliError("Error: wrangler config not found (wrangler.toml/json). Run 'wrangler init' first.");
252
262
  }
253
263
  const wranglerArgs = ['dev'];
264
+ if (normalizedConfig !== '') {
265
+ wranglerArgs.push('--config', normalizedConfig);
266
+ }
254
267
  if (configPath === undefined && entry !== undefined) {
255
268
  wranglerArgs.push(entry);
256
269
  }
@@ -429,7 +442,10 @@ const executeStart = async (options, cmd) => {
429
442
  ...(typeof cacheEnabled === 'boolean' ? { cacheEnabled } : {}),
430
443
  });
431
444
  if (variant === 'wrangler') {
432
- await executeWranglerStart(cmd, cwd, port, runtime, envName === '' ? undefined : envName);
445
+ const wranglerConfig = typeof options.wranglerConfig === 'string' && options.wranglerConfig.trim() !== ''
446
+ ? options.wranglerConfig.trim()
447
+ : undefined;
448
+ await executeWranglerStart(cmd, cwd, port, runtime, envName === '' ? undefined : envName, wranglerConfig);
433
449
  return;
434
450
  }
435
451
  if (envName !== '') {
@@ -461,6 +477,7 @@ export const StartCommand = Object.freeze({
461
477
  .option('--no-watch', 'Disable watch mode (Node only)')
462
478
  .option('--mode <development|production|testing>', 'Override app mode')
463
479
  .option('--env <name>', 'Wrangler environment name (Wrangler mode only)')
480
+ .option('--wrangler-config <path>', 'Wrangler config path (Wrangler mode only)')
464
481
  .option('--runtime <nodejs|cloudflare|lambda|deno|auto>', 'Set RUNTIME for spawned Node')
465
482
  .option('-p, --port <number>', 'Override server port');
466
483
  };
@@ -1 +1 @@
1
- {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/config/queue.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGhG,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC;IACzC,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,UAAU,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE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ACrB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CAuEH,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAqB/D,eAAO,MAAM,WAAW,EAAE,WAYxB,CAAC"}
@@ -5,6 +5,9 @@
5
5
  */
6
6
  import { Cloudflare } from './cloudflare.js';
7
7
  import { Env } from './env.js';
8
+ import { Logger } from './logger.js';
9
+ import { middlewareConfig } from './middleware.js';
10
+ import { ErrorFactory } from '../exceptions/ZintrustError.js';
8
11
  import { ZintrustLang } from '../lang/lang.js';
9
12
  import { StartupConfigFile, StartupConfigFileRegistry } from '../runtime/StartupConfigFileRegistry.js';
10
13
  const getQueueDriver = (driverConfig) => {
@@ -113,16 +116,32 @@ export const createBaseDrivers = () => ({
113
116
  /**
114
117
  * Helper: Create monitor configuration from environment
115
118
  */
116
- const createBaseMonitor = () => ({
117
- enabled: Env.getBool('QUEUE_MONITOR_ENABLED', false),
118
- basePath: Env.get('QUEUE_MONITOR_BASE_PATH', '/queue-monitor'),
119
- middleware: Env.get('QUEUE_MONITOR_MIDDLEWARE', '')
119
+ const createBaseMonitor = () => {
120
+ const enabled = Env.getBool('QUEUE_MONITOR_ENABLED', false);
121
+ const basePath = Env.get('QUEUE_MONITOR_BASE_PATH', '/queue-monitor');
122
+ const middleware = Env.get('QUEUE_MONITOR_MIDDLEWARE', '')
120
123
  .split(',')
121
124
  .map((m) => m.trim())
122
- .filter((m) => m.length > 0),
123
- autoRefresh: Env.getBool('QUEUE_MONITOR_AUTO_REFRESH', true),
124
- refreshIntervalMs: Env.getInt('QUEUE_MONITOR_REFRESH_MS', 5000),
125
- });
125
+ .filter((m) => m.length > 0);
126
+ if (enabled && middleware.length > 0) {
127
+ const knownKeys = new Set(Object.keys(middlewareConfig.route ?? {}));
128
+ const unknownKeys = middleware.filter((name) => !knownKeys.has(name));
129
+ if (unknownKeys.length > 0) {
130
+ Logger.error('Unknown QUEUE_MONITOR_MIDDLEWARE keys configured', {
131
+ unknownKeys,
132
+ basePath,
133
+ });
134
+ throw ErrorFactory.createConfigError(`Unknown QUEUE_MONITOR_MIDDLEWARE key(s): ${unknownKeys.join(', ')}. These must match registered route middleware keys in your app.`);
135
+ }
136
+ }
137
+ return {
138
+ enabled,
139
+ basePath,
140
+ middleware,
141
+ autoRefresh: Env.getBool('QUEUE_MONITOR_AUTO_REFRESH', true),
142
+ refreshIntervalMs: Env.getInt('QUEUE_MONITOR_REFRESH_MS', 5000),
143
+ };
144
+ };
126
145
  const createQueueConfig = () => {
127
146
  const overrides = StartupConfigFileRegistry.get(StartupConfigFile.Queue) ?? {};
128
147
  const baseDefault = Env.get('QUEUE_DRIVER', 'sync');
package/src/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @zintrust/core v0.1.43
2
+ * @zintrust/core v0.1.46
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-02-18T18:05:00.416Z
8
+ * Built: 2026-02-22T15:47:02.870Z
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-02-18T18:05:00.386Z'; // Replaced during build
24
+ export const ZINTRUST_BUILD_DATE = '2026-02-22T15:47:02.841Z'; // 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":"Database.d.ts","sourceRoot":"","sources":["../../../src/orm/Database.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAUxD,OAAO,KAAK,EAAE,cAAc,EAAE,g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AAK,IAAI,GAAG,IAAI,CAAC;IAC3F,kBAAkB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IACvD,OAAO,IAAI,eAAe,CAAC;IAC3B,SAAS,IAAI,cAAc,CAAC;IAC5B,OAAO,IAAI,IAAI,CAAC;CACjB;AA4gBD,eAAO,MAAM,QAAQ;IACnB;;OAEG;oBACa,cAAc,GAAG,SAAS;EAI1C,CAAC;AAIH,eAAO,MAAM,oBAAoB,GAC/B,SAAQ,cAAc,GAAG,SAAqB,EAC9C,uBAA0B,KACzB,OAAO,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,CAMxC,CAAC;AAEF,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,UAAU,SAAY,GAAG,SAAS,CAoBtF;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAWnD"}
@@ -16,6 +16,7 @@ import { PostgreSQLAdapter } from './adapters/PostgreSQLAdapter.js';
16
16
  import { PostgreSQLProxyAdapter } from './adapters/PostgreSQLProxyAdapter.js';
17
17
  import { SQLiteAdapter } from './adapters/SQLiteAdapter.js';
18
18
  import { SQLServerAdapter } from './adapters/SQLServerAdapter.js';
19
+ import { createSqlServerProxyAdapter } from './adapters/SqlServerProxyAdapter.js';
19
20
  import { DatabaseAdapterRegistry } from './DatabaseAdapterRegistry.js';
20
21
  import { QueryBuilder } from './QueryBuilder.js';
21
22
  /**
@@ -31,7 +32,7 @@ const resolveMySqlProxyAdapter = (cfg) => {
31
32
  const proxyUrl = Env.get('MYSQL_PROXY_URL', '').trim();
32
33
  const useProxy = Env.getBool('USE_MYSQL_PROXY', false);
33
34
  if (useProxy || proxyUrl.length > 0) {
34
- Logger.info('[Database] Selecting MySQL proxy adapter for Workers runtime', {
35
+ Logger.info('[Database] Selecting MySQL proxy adapter', {
35
36
  driver: cfg.driver,
36
37
  useMySqlProxy: useProxy,
37
38
  mysqlProxyUrlConfigured: proxyUrl.length > 0,
@@ -47,7 +48,7 @@ const resolvePostgresProxyAdapter = (cfg) => {
47
48
  const proxyUrl = Env.get('POSTGRES_PROXY_URL', '').trim();
48
49
  const useProxy = Env.getBool('USE_POSTGRES_PROXY', false);
49
50
  if (useProxy || proxyUrl.length > 0) {
50
- Logger.info('[Database] Selecting PostgreSQL proxy adapter for Workers runtime', {
51
+ Logger.info('[Database] Selecting PostgreSQL proxy adapter', {
51
52
  driver: cfg.driver,
52
53
  usePostgresProxy: useProxy,
53
54
  postgresProxyUrlConfigured: proxyUrl.length > 0,
@@ -57,6 +58,36 @@ const resolvePostgresProxyAdapter = (cfg) => {
57
58
  }
58
59
  return null;
59
60
  };
61
+ const resolveSqlServerProxyAdapter = (cfg) => {
62
+ if (cfg.driver !== 'sqlserver')
63
+ return null;
64
+ const proxyUrl = Env.get('SQLSERVER_PROXY_URL', '').trim();
65
+ const useProxy = Env.getBool('USE_SQLSERVER_PROXY', false);
66
+ if (useProxy || proxyUrl.length > 0) {
67
+ Logger.info('[Database] Selecting SQL Server proxy adapter', {
68
+ driver: cfg.driver,
69
+ useSqlServerProxy: useProxy,
70
+ sqlServerProxyUrlConfigured: proxyUrl.length > 0,
71
+ sqlServerProxyUrl: proxyUrl,
72
+ });
73
+ return createSqlServerProxyAdapter();
74
+ }
75
+ return null;
76
+ };
77
+ const resolveExplicitProxyAdapter = (cfg) => {
78
+ // Allow proxy adapters to be forced in any runtime (Node or Workers) when
79
+ // the feature flags or proxy URLs are configured.
80
+ const mysqlProxy = resolveMySqlProxyAdapter(cfg);
81
+ if (mysqlProxy)
82
+ return mysqlProxy;
83
+ const postgresProxy = resolvePostgresProxyAdapter(cfg);
84
+ if (postgresProxy)
85
+ return postgresProxy;
86
+ const sqlServerProxy = resolveSqlServerProxyAdapter(cfg);
87
+ if (sqlServerProxy)
88
+ return sqlServerProxy;
89
+ return null;
90
+ };
60
91
  const ensureCloudflareSocketSupport = (cfg) => {
61
92
  const isSocketDriver = cfg.driver === 'postgresql' || cfg.driver === 'mysql';
62
93
  if (!isSocketDriver)
@@ -92,6 +123,9 @@ const resolveWorkersAdapter = (cfg) => {
92
123
  return null;
93
124
  };
94
125
  const createAdapter = (cfg) => {
126
+ const explicitProxy = resolveExplicitProxyAdapter(cfg);
127
+ if (explicitProxy)
128
+ return explicitProxy;
95
129
  const workersAdapter = resolveWorkersAdapter(cfg);
96
130
  if (workersAdapter)
97
131
  return workersAdapter;
@@ -469,7 +469,7 @@ export function createMemoized(fn, options = {}) {
469
469
  typeof a === 'string' ||
470
470
  typeof a === 'number' ||
471
471
  typeof a === 'boolean' ||
472
- a === 'undefined');
472
+ a === undefined);
473
473
  key = arePrimitives ? args.join('|') : JSON.stringify(args);
474
474
  }
475
475
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"ProxyServer.d.ts","sourceRoot":"","sources":["../../../src/proxy/ProxyServer.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,MAAM,EAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,CACP,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7E,CAAC,CAAC;AA0CH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,kBAAkB,KAC1B,QAAQ,CAAC;IACV,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB,CAsDA,CAAC"}
1
+ {"version":3,"file":"ProxyServer.d.ts","sourceRoot":"","sources":["../../../src/proxy/ProxyServer.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,MAAM,EAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,CACP,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7E,CAAC,CAAC;AA0CH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,kBAAkB,KAC1B,QAAQ,CAAC;IACV,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB,CAkEA,CAAC"}
@@ -38,6 +38,15 @@ export const createProxyServer = (options) => {
38
38
  const server = createServer(async (req, res) => {
39
39
  try {
40
40
  const body = await readBody(req, options.maxBodyBytes);
41
+ const rawUrl = req.url ?? '';
42
+ if (rawUrl.startsWith('/containerstarthealthcheck') ||
43
+ rawUrl.startsWith('containerstarthealthcheck')) {
44
+ respond(res, {
45
+ status: 200,
46
+ body: { status: 'ok' },
47
+ });
48
+ return;
49
+ }
41
50
  if ((req.url ?? '').startsWith('/health')) {
42
51
  const response = await options.backend.health();
43
52
  respond(res, response);
@@ -8,7 +8,7 @@ const DEFAULT_OPTIONS = {
8
8
  };
9
9
  function isUnrefableTimer(value) {
10
10
  return (typeof value === 'object' &&
11
- value !== null &&
11
+ value instanceof Object &&
12
12
  'unref' in value &&
13
13
  typeof value.unref === 'function');
14
14
  }