@zintrust/core 2.2.6 → 2.2.8
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 +39 -3
- package/src/cli/cloudflare/CloudflareSecretSync.d.ts +3 -2
- package/src/cli/cloudflare/CloudflareSecretSync.d.ts.map +1 -1
- package/src/cli/cloudflare/CloudflareSecretSync.js +40 -12
- package/src/cli/commands/DeployCommand.d.ts.map +1 -1
- package/src/cli/commands/DeployCommand.js +2 -0
- package/src/cli/commands/DeployContainersProxyCommand.d.ts.map +1 -1
- package/src/cli/commands/DeployContainersProxyCommand.js +2 -0
- package/src/cli/commands/PutCommand.d.ts.map +1 -1
- package/src/cli/commands/PutCommand.js +2 -0
- package/src/config/FileLogWriter.d.ts +1 -1
- package/src/config/FileLogWriter.d.ts.map +1 -1
- package/src/config/FileLogWriter.js +5 -4
- package/src/config/logger.js +4 -4
- package/src/index.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zintrust/core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"description": "Production-grade TypeScript backend framework for JavaScript",
|
|
5
5
|
"homepage": "https://zintrust.com",
|
|
6
6
|
"repository": {
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
"bcryptjs": "^3.0.3",
|
|
210
210
|
"bullmq": "^5.77.6",
|
|
211
211
|
"chalk": "^5.6.2",
|
|
212
|
-
"commander": "^
|
|
212
|
+
"commander": "^15.0.0",
|
|
213
213
|
"inquirer": "^14.0.0",
|
|
214
214
|
"ioredis": "^5.11.0",
|
|
215
215
|
"jsonwebtoken": "^9.0.3",
|
|
@@ -219,8 +219,44 @@
|
|
|
219
219
|
"tsx": "^4.22.3"
|
|
220
220
|
},
|
|
221
221
|
"overrides": {
|
|
222
|
+
"ajv": "^8.18.0",
|
|
223
|
+
"@eslint/plugin-kit": "^0.7.1",
|
|
224
|
+
"follow-redirects": "^1.16.0",
|
|
225
|
+
"@tootallnate/once": "3.0.1",
|
|
226
|
+
"node-forge": "^1.4.0",
|
|
227
|
+
"fast-uri": "3.1.2",
|
|
228
|
+
"fast-xml-parser": "5.8.0",
|
|
229
|
+
"protobufjs": "7.5.9",
|
|
230
|
+
"brace-expansion": "^5.0.5",
|
|
231
|
+
"picomatch": "^4.0.4",
|
|
232
|
+
"cross-spawn": "^7.0.5",
|
|
233
|
+
"glob": "^11.1.0",
|
|
234
|
+
"minimatch": "^10.2.2",
|
|
235
|
+
"rollup": "^4.59.0",
|
|
236
|
+
"vite": "^8.0.5",
|
|
237
|
+
"flatted": "^3.4.2",
|
|
238
|
+
"uuid": "14.0.0",
|
|
222
239
|
"ioredis": "^5.11.0",
|
|
223
|
-
"axios": "^1.16.1"
|
|
240
|
+
"axios": "^1.16.1",
|
|
241
|
+
"@actions/github": {
|
|
242
|
+
"undici": "^6.24.0"
|
|
243
|
+
},
|
|
244
|
+
"@actions/http-client": {
|
|
245
|
+
"undici": "^6.24.0"
|
|
246
|
+
},
|
|
247
|
+
"miniflare": {
|
|
248
|
+
"undici": "^7.24.4"
|
|
249
|
+
},
|
|
250
|
+
"http-proxy-agent": "7.0.2",
|
|
251
|
+
"retry-request": "8.0.2",
|
|
252
|
+
"gaxios": "7.1.4",
|
|
253
|
+
"teeny-request": "10.1.2",
|
|
254
|
+
"braces": "^3.0.3",
|
|
255
|
+
"lodash": "^4.17.21",
|
|
256
|
+
"semver": "^7.6.3",
|
|
257
|
+
"tmp": "^0.2.4",
|
|
258
|
+
"ws": "^8.20.0",
|
|
259
|
+
"micromatch": "^4.0.8"
|
|
224
260
|
},
|
|
225
261
|
"bin": {
|
|
226
262
|
"zintrust": "bin/zintrust.js",
|
|
@@ -21,6 +21,7 @@ type CloudflareSecretSyncArgs = {
|
|
|
21
21
|
target?: string;
|
|
22
22
|
bulk?: boolean;
|
|
23
23
|
requireSelection?: boolean;
|
|
24
|
+
all?: boolean;
|
|
24
25
|
};
|
|
25
26
|
export type CloudflareSecretSyncResult = {
|
|
26
27
|
pushed: number;
|
|
@@ -31,9 +32,9 @@ export type CloudflareSecretSyncResult = {
|
|
|
31
32
|
};
|
|
32
33
|
export declare const uniq: (items: string[]) => string[];
|
|
33
34
|
export declare const reportCloudflareSecretSync: (log: CloudflareSecretLog, result: Pick<CloudflareSecretSyncResult, "pushed" | "skippedEmptyKeys" | "failures">) => void;
|
|
34
|
-
export declare const syncCloudflareSecrets: ({ log, cwd, wranglerEnvs, envPath, dryRun, configGroups, directKeys, inlineValues, configPath, target, bulk, requireSelection, }: CloudflareSecretSyncArgs) => Promise<CloudflareSecretSyncResult>;
|
|
35
|
+
export declare const syncCloudflareSecrets: ({ log, cwd, wranglerEnvs, envPath, dryRun, configGroups, directKeys, inlineValues, configPath, target, bulk, requireSelection, all, }: CloudflareSecretSyncArgs) => Promise<CloudflareSecretSyncResult>;
|
|
35
36
|
declare const _default: Readonly<{
|
|
36
|
-
syncCloudflareSecrets: ({ log, cwd, wranglerEnvs, envPath, dryRun, configGroups, directKeys, inlineValues, configPath, target, bulk, requireSelection, }: CloudflareSecretSyncArgs) => Promise<CloudflareSecretSyncResult>;
|
|
37
|
+
syncCloudflareSecrets: ({ log, cwd, wranglerEnvs, envPath, dryRun, configGroups, directKeys, inlineValues, configPath, target, bulk, requireSelection, all, }: CloudflareSecretSyncArgs) => Promise<CloudflareSecretSyncResult>;
|
|
37
38
|
reportCloudflareSecretSync: (log: CloudflareSecretLog, result: Pick<CloudflareSecretSyncResult, "pushed" | "skippedEmptyKeys" | "failures">) => void;
|
|
38
39
|
}>;
|
|
39
40
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudflareSecretSync.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloudflare/CloudflareSecretSync.ts"],"names":[],"mappings":"AAaA,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,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AAqFP,wBAGG"}
|
|
@@ -38,16 +38,22 @@ const getConfigArray = (config, key) => {
|
|
|
38
38
|
return [];
|
|
39
39
|
return uniq(raw.filter((item) => typeof item === 'string'));
|
|
40
40
|
};
|
|
41
|
-
const resolveValue = (key, envMap) => {
|
|
41
|
+
const resolveValue = (key, envMap, envPath, all = false) => {
|
|
42
42
|
const fromFile = envMap[key];
|
|
43
43
|
const fromProcess = process.env[key];
|
|
44
|
+
const isCustomEnvFile = envPath !== '.env' && envPath.trim() !== '';
|
|
45
|
+
// If custom env file is provided and all is false, only use values from the custom file
|
|
46
|
+
if (isCustomEnvFile && !all) {
|
|
47
|
+
return fromFile ?? '';
|
|
48
|
+
}
|
|
49
|
+
// Default behavior: fallback to process.env
|
|
44
50
|
return fromFile ?? fromProcess ?? '';
|
|
45
51
|
};
|
|
46
|
-
const resolveValueWithOverrides = (key, envMap, inlineValues) => {
|
|
52
|
+
const resolveValueWithOverrides = (key, envMap, inlineValues, envPath, all = false) => {
|
|
47
53
|
const inlineValue = inlineValues[key];
|
|
48
54
|
if (typeof inlineValue === 'string')
|
|
49
55
|
return inlineValue;
|
|
50
|
-
return resolveValue(key, envMap);
|
|
56
|
+
return resolveValue(key, envMap, envPath, all);
|
|
51
57
|
};
|
|
52
58
|
const getPutTimeoutMs = () => {
|
|
53
59
|
const raw = process.env['ZT_PUT_TIMEOUT_MS'];
|
|
@@ -131,13 +137,13 @@ const resolveSelectedKeys = ({ log, config, cwd, wranglerEnvs, configGroups = []
|
|
|
131
137
|
? 'No secret keys resolved from explicit keys or .zintrust.json cloudflare.shared_env/cloudflare.targets/cloudflare.wrangler_envs. Use --key/--keys, --var <group>, or add a Cloudflare env manifest.'
|
|
132
138
|
: 'No secret keys resolved from selected groups.');
|
|
133
139
|
};
|
|
134
|
-
const resolveBulkPayload = (log, wranglerEnv, selectedKeys, envMap, inlineValues) => {
|
|
140
|
+
const resolveBulkPayload = (log, wranglerEnv, selectedKeys, envMap, inlineValues, envPath, all = false) => {
|
|
135
141
|
const payload = {};
|
|
136
142
|
const includedKeys = [];
|
|
137
143
|
const skippedEmptyKeys = [];
|
|
138
144
|
const wranglerEnvLabel = describeWranglerEnv(wranglerEnv);
|
|
139
145
|
for (const key of selectedKeys) {
|
|
140
|
-
const value = resolveValueWithOverrides(key, envMap, inlineValues);
|
|
146
|
+
const value = resolveValueWithOverrides(key, envMap, inlineValues, envPath, all);
|
|
141
147
|
if (value.trim() === '') {
|
|
142
148
|
log.warn(`skip ${key} -> ${wranglerEnvLabel}: empty value`);
|
|
143
149
|
skippedEmptyKeys.push(key);
|
|
@@ -148,11 +154,12 @@ const resolveBulkPayload = (log, wranglerEnv, selectedKeys, envMap, inlineValues
|
|
|
148
154
|
}
|
|
149
155
|
return { payload, includedKeys, skippedEmptyKeys };
|
|
150
156
|
};
|
|
151
|
-
const processSecretSync = (
|
|
157
|
+
const processSecretSync = (args) => {
|
|
158
|
+
const { log, wranglerEnvs, selectedKeys, envMap, dryRun, configPath, inlineValues, envPath, all, } = args;
|
|
152
159
|
const progress = createSyncProgress();
|
|
153
160
|
forEachWranglerEnv(wranglerEnvs, (wranglerEnv, wranglerEnvLabel) => {
|
|
154
161
|
for (const key of selectedKeys) {
|
|
155
|
-
const value = resolveValueWithOverrides(key, envMap, inlineValues);
|
|
162
|
+
const value = resolveValueWithOverrides(key, envMap, inlineValues, envPath, all);
|
|
156
163
|
if (value.trim() === '') {
|
|
157
164
|
log.warn(`skip ${key} -> ${wranglerEnvLabel}: empty value`);
|
|
158
165
|
progress.skippedEmptyKeys.push(key);
|
|
@@ -174,10 +181,11 @@ const processSecretSync = (log, wranglerEnvs, selectedKeys, envMap, dryRun, conf
|
|
|
174
181
|
});
|
|
175
182
|
return progress;
|
|
176
183
|
};
|
|
177
|
-
const processSecretBulkSync = (
|
|
184
|
+
const processSecretBulkSync = (args) => {
|
|
185
|
+
const { log, wranglerEnvs, selectedKeys, envMap, dryRun, configPath, inlineValues, envPath, all, } = args;
|
|
178
186
|
const progress = createSyncProgress();
|
|
179
187
|
forEachWranglerEnv(wranglerEnvs, (wranglerEnv, wranglerEnvLabel) => {
|
|
180
|
-
const { payload, includedKeys, skippedEmptyKeys: skippedForEnv, } = resolveBulkPayload(log, wranglerEnv, selectedKeys, envMap, inlineValues);
|
|
188
|
+
const { payload, includedKeys, skippedEmptyKeys: skippedForEnv, } = resolveBulkPayload(log, wranglerEnv, selectedKeys, envMap, inlineValues, envPath, all);
|
|
181
189
|
progress.skippedEmptyKeys.push(...skippedForEnv);
|
|
182
190
|
if (includedKeys.length === 0) {
|
|
183
191
|
log.info(`skip bulk upload -> ${wranglerEnvLabel}: no non-empty keys`);
|
|
@@ -222,7 +230,7 @@ export const reportCloudflareSecretSync = (log, result) => {
|
|
|
222
230
|
log.warn(`${item.key} -> ${describeWranglerEnv(item.wranglerEnv)}: ${item.reason}`);
|
|
223
231
|
}
|
|
224
232
|
};
|
|
225
|
-
export const syncCloudflareSecrets = async ({ log, cwd, wranglerEnvs, envPath, dryRun = false, configGroups = [], directKeys = [], inlineValues = {}, configPath, target, bulk = false, requireSelection = true, }) => {
|
|
233
|
+
export const syncCloudflareSecrets = async ({ log, cwd, wranglerEnvs, envPath, dryRun = false, configGroups = [], directKeys = [], inlineValues = {}, configPath, target, bulk = false, requireSelection = true, all = false, }) => {
|
|
226
234
|
const normalizedConfigPath = typeof configPath === 'string' && configPath.trim() !== '' ? configPath.trim() : undefined;
|
|
227
235
|
if (normalizedConfigPath !== undefined && !existsSync(path.join(cwd, normalizedConfigPath))) {
|
|
228
236
|
throw ErrorFactory.createCliError(`Wrangler config not found: ${normalizedConfigPath}`);
|
|
@@ -244,8 +252,28 @@ export const syncCloudflareSecrets = async ({ log, cwd, wranglerEnvs, envPath, d
|
|
|
244
252
|
}
|
|
245
253
|
const envMap = await EnvFile.read({ cwd, path: envPath });
|
|
246
254
|
const syncResult = bulk
|
|
247
|
-
? processSecretBulkSync(
|
|
248
|
-
|
|
255
|
+
? processSecretBulkSync({
|
|
256
|
+
log,
|
|
257
|
+
wranglerEnvs,
|
|
258
|
+
selectedKeys,
|
|
259
|
+
envMap,
|
|
260
|
+
dryRun,
|
|
261
|
+
configPath: normalizedConfigPath,
|
|
262
|
+
inlineValues,
|
|
263
|
+
envPath,
|
|
264
|
+
all,
|
|
265
|
+
})
|
|
266
|
+
: processSecretSync({
|
|
267
|
+
log,
|
|
268
|
+
wranglerEnvs,
|
|
269
|
+
selectedKeys,
|
|
270
|
+
envMap,
|
|
271
|
+
dryRun,
|
|
272
|
+
configPath: normalizedConfigPath,
|
|
273
|
+
inlineValues,
|
|
274
|
+
envPath,
|
|
275
|
+
all,
|
|
276
|
+
});
|
|
249
277
|
return {
|
|
250
278
|
...syncResult,
|
|
251
279
|
selectedKeys,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeployCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/DeployCommand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"DeployCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/DeployCommand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgMrE;;;GAGG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;cACO,YAAY;EAGtB,CAAC"}
|
|
@@ -58,6 +58,7 @@ const syncWranglerSecrets = async (cmd, cwd, wranglerEnv, options) => {
|
|
|
58
58
|
configPath: typeof options.config === 'string' ? options.config.trim() : undefined,
|
|
59
59
|
target: typeof options.target === 'string' ? options.target : undefined,
|
|
60
60
|
requireSelection: false,
|
|
61
|
+
all: options.all === true,
|
|
61
62
|
});
|
|
62
63
|
if (result.selectedKeys.length === 0)
|
|
63
64
|
return;
|
|
@@ -109,6 +110,7 @@ const createDeployCommand = () => {
|
|
|
109
110
|
command.option('-c, --config <path>', 'Wrangler config file (e.g. wrangler.containers-proxy.jsonc)');
|
|
110
111
|
command.option('--env-path <path>', 'Path to env file used when syncing Cloudflare secrets', '.env');
|
|
111
112
|
command.option('--target <id>', 'Cloudflare worker target key from .zintrust.json cloudflare.targets');
|
|
113
|
+
command.option('--all', 'Sync both custom env file and process.env (only applies when custom env file is provided)');
|
|
112
114
|
command.option('--no-sync-secrets', 'Skip Cloudflare secret sync before wrangler deploy');
|
|
113
115
|
},
|
|
114
116
|
execute: async (options) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeployContainersProxyCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/DeployContainersProxyCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"DeployContainersProxyCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/DeployContainersProxyCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA+ErE,eAAO,MAAM,4BAA4B;cAC7B,YAAY;EA6BtB,CAAC"}
|
|
@@ -31,6 +31,7 @@ const syncDeploySecrets = async (cmd, cwd, config, env, options) => {
|
|
|
31
31
|
configPath: config,
|
|
32
32
|
target: typeof options.target === 'string' ? options.target : undefined,
|
|
33
33
|
requireSelection: false,
|
|
34
|
+
all: options.all === true,
|
|
34
35
|
});
|
|
35
36
|
if (result.selectedKeys.length === 0)
|
|
36
37
|
return;
|
|
@@ -60,6 +61,7 @@ export const DeployContainersProxyCommand = Object.freeze({
|
|
|
60
61
|
command.option('-c, --config <path>', 'Wrangler config file', DEFAULT_CONFIG);
|
|
61
62
|
command.option('--env-path <path>', 'Path to env file used when syncing Cloudflare secrets', '.env');
|
|
62
63
|
command.option('--target <id>', 'Cloudflare worker target key from .zintrust.json cloudflare.targets');
|
|
64
|
+
command.option('--all', 'Sync both custom env file and process.env (only applies when custom env file is provided)');
|
|
63
65
|
command.option('--no-sync-secrets', 'Skip Cloudflare secret sync before wrangler deploy');
|
|
64
66
|
},
|
|
65
67
|
execute: async (options) => execute(cmd, options),
|
|
@@ -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;
|
|
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;AAmHvF,eAAO,MAAM,UAAU;cACX,YAAY;EAWtB,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -50,6 +50,7 @@ const addOptions = (command) => {
|
|
|
50
50
|
.option('--env_path <path>', 'Path to env file used as source values', '.env')
|
|
51
51
|
.option('-c, --config <path>', 'Wrangler config file to target (optional)')
|
|
52
52
|
.option('--bulk', 'Upload the final key set with one wrangler secret bulk call per target')
|
|
53
|
+
.option('--all', 'Sync both custom env file and process.env (only applies when custom env file is provided)')
|
|
53
54
|
.option('--dry-run', 'Show what would be uploaded without calling wrangler');
|
|
54
55
|
};
|
|
55
56
|
const ensureCloudflareProvider = (providerRaw) => {
|
|
@@ -75,6 +76,7 @@ const execute = async (cmd, options) => {
|
|
|
75
76
|
target: typeof options.target === 'string' ? options.target : undefined,
|
|
76
77
|
bulk: options.bulk === true,
|
|
77
78
|
requireSelection: true,
|
|
79
|
+
all: options.all === true,
|
|
78
80
|
});
|
|
79
81
|
reportCloudflareSecretSync(cmd, result);
|
|
80
82
|
};
|
|
@@ -16,7 +16,7 @@ type CleanOnceOptions = {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const cleanOnce: (options?: CleanOnceOptions) => string[];
|
|
18
18
|
export declare const FileLogWriter: Readonly<{
|
|
19
|
-
write(line: string):
|
|
19
|
+
write(line: string): boolean;
|
|
20
20
|
flush(): void;
|
|
21
21
|
}>;
|
|
22
22
|
export default FileLogWriter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileLogWriter.d.ts","sourceRoot":"","sources":["../../../src/config/FileLogWriter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgIH,KAAK,gBAAgB,GAAG;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAiFF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,gBAAgB,KAAG,MAAM,EAsB5D,CAAC;AA2EF,eAAO,MAAM,aAAa;gBACZ,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"FileLogWriter.d.ts","sourceRoot":"","sources":["../../../src/config/FileLogWriter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgIH,KAAK,gBAAgB,GAAG;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAiFF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,gBAAgB,KAAG,MAAM,EAsB5D,CAAC;AA2EF,eAAO,MAAM,aAAa;gBACZ,MAAM,GAAG,OAAO;aAuCnB,IAAI;EAQb,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -263,10 +263,10 @@ const flushPendingWrites = (logFile) => {
|
|
|
263
263
|
export const FileLogWriter = Object.freeze({
|
|
264
264
|
write(line) {
|
|
265
265
|
if (isWorkersRuntime())
|
|
266
|
-
return;
|
|
266
|
+
return false;
|
|
267
267
|
const cwd = getCwdSafe();
|
|
268
268
|
if (cwd === '')
|
|
269
|
-
return;
|
|
269
|
+
return false;
|
|
270
270
|
const logsDir = path.join(cwd, 'logs');
|
|
271
271
|
ensureDirSafeBestEffort(logsDir);
|
|
272
272
|
const dateStr = getDateStr(new Date());
|
|
@@ -277,7 +277,7 @@ export const FileLogWriter = Object.freeze({
|
|
|
277
277
|
if (!canUseWriteStreams()) {
|
|
278
278
|
appendFileSafe(logFile, `${line}\n`);
|
|
279
279
|
cleanupOldLogs(logsDir, Env.LOG_ROTATION_DAYS);
|
|
280
|
-
return;
|
|
280
|
+
return true;
|
|
281
281
|
}
|
|
282
282
|
try {
|
|
283
283
|
// Buffer writes for async processing
|
|
@@ -289,9 +289,10 @@ export const FileLogWriter = Object.freeze({
|
|
|
289
289
|
}
|
|
290
290
|
catch {
|
|
291
291
|
// best-effort
|
|
292
|
-
return;
|
|
292
|
+
return false;
|
|
293
293
|
}
|
|
294
294
|
cleanupOldLogs(logsDir, Env.LOG_ROTATION_DAYS);
|
|
295
|
+
return true;
|
|
295
296
|
},
|
|
296
297
|
// Flush all streams (for graceful shutdown)
|
|
297
298
|
flush() {
|
package/src/config/logger.js
CHANGED
|
@@ -470,7 +470,7 @@ const getFileWriter = () => {
|
|
|
470
470
|
})
|
|
471
471
|
.catch(() => {
|
|
472
472
|
fileWriterPromise = undefined;
|
|
473
|
-
return { FileLogWriter: { write: (_line) =>
|
|
473
|
+
return { FileLogWriter: { write: (_line) => false } };
|
|
474
474
|
});
|
|
475
475
|
};
|
|
476
476
|
const shouldLogToFile = () => {
|
|
@@ -570,7 +570,7 @@ const emitCloudLogs = (event) => {
|
|
|
570
570
|
void (async () => {
|
|
571
571
|
try {
|
|
572
572
|
if (event.level === 'error' || event.level === 'fatal') {
|
|
573
|
-
const mod = await import('./logging/KvLogger');
|
|
573
|
+
const mod = await import('./logging/KvLogger.js');
|
|
574
574
|
void mod.KvLogger.enqueue(event);
|
|
575
575
|
}
|
|
576
576
|
}
|
|
@@ -579,7 +579,7 @@ const emitCloudLogs = (event) => {
|
|
|
579
579
|
}
|
|
580
580
|
try {
|
|
581
581
|
if (event.level === 'warn' || event.level === 'error' || event.level === 'fatal') {
|
|
582
|
-
const mod = await import('./logging/SlackLogger');
|
|
582
|
+
const mod = await import('./logging/SlackLogger.js');
|
|
583
583
|
void mod.SlackLogger.enqueue(event);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
@@ -587,7 +587,7 @@ const emitCloudLogs = (event) => {
|
|
|
587
587
|
// best-effort
|
|
588
588
|
}
|
|
589
589
|
try {
|
|
590
|
-
const mod = await import('./logging/HttpLogger');
|
|
590
|
+
const mod = await import('./logging/HttpLogger.js');
|
|
591
591
|
void mod.HttpLogger.enqueue(event);
|
|
592
592
|
}
|
|
593
593
|
catch {
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @zintrust/core v2.2.
|
|
2
|
+
* @zintrust/core v2.2.8
|
|
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-05-
|
|
8
|
+
* Built: 2026-05-29T12:22:04.247Z
|
|
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-05-
|
|
24
|
+
export const ZINTRUST_BUILD_DATE = '2026-05-29T12:22:04.212Z'; // 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';
|