@zintrust/core 0.1.25 → 0.1.26

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": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "Production-grade TypeScript backend framework for JavaScript",
5
5
  "homepage": "https://zintrust.com",
6
6
  "repository": {
@@ -1 +1 @@
1
- {"version":3,"file":"VersionChecker.d.ts","sourceRoot":"","sources":["../../../../src/cli/services/VersionChecker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,UAAU,kBAAkB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAUD,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc;IACzB;;OAEG;yBACkB,MAAM;IAY3B;;OAEG;iBACU,kBAAkB;IAQ/B;;OAEG;0BACmB,OAAO;IA+B7B;;OAEG;0BACyB,OAAO,CAAC,MAAM,CAAC;IAwB3C;;OAEG;6BACsB,MAAM,UAAU,MAAM,GAAG,MAAM;IAmBxD;;OAEG;oBACmB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IA8BxD;;OAEG;sCAC+B,kBAAkB,GAAG,IAAI;IA4B3D;;OAEG;uBACsB,OAAO,CAAC,IAAI,CAAC;EAWtC,CAAC"}
1
+ {"version":3,"file":"VersionChecker.d.ts","sourceRoot":"","sources":["../../../../src/cli/services/VersionChecker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,UAAU,kBAAkB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAUD,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc;IACzB;;OAEG;yBACkB,MAAM;IAY3B;;OAEG;iBACU,kBAAkB;IAQ/B;;OAEG;0BACmB,OAAO;IA+B7B;;OAEG;0BACyB,OAAO,CAAC,MAAM,CAAC;IAwB3C;;OAEG;6BACsB,MAAM,UAAU,MAAM,GAAG,MAAM;IAuBxD;;OAEG;oBACmB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IA8BxD;;OAEG;sCAC+B,kBAAkB,GAAG,IAAI;IA4B3D;;OAEG;uBACsB,OAAO,CAAC,IAAI,CAAC;EAWtC,CAAC"}
@@ -28,7 +28,7 @@ export const VersionChecker = Object.freeze({
28
28
  getConfig() {
29
29
  return {
30
30
  enabled: process.env['ZINTRUST_VERSION_CHECK'] !== 'false',
31
- checkInterval: parseInt(process.env['ZINTRUST_VERSION_CHECK_INTERVAL'] ?? '24', 10),
31
+ checkInterval: Number.parseInt(process.env['ZINTRUST_VERSION_CHECK_INTERVAL'] ?? '24', 10),
32
32
  skipVersionCheck: process.env['ZINTRUST_SKIP_VERSION_CHECK'] === 'true',
33
33
  };
34
34
  },
@@ -42,15 +42,15 @@ export const VersionChecker = Object.freeze({
42
42
  return false;
43
43
  }
44
44
  // Skip for version commands
45
- const args = process.argv.slice(2);
46
- if (args.includes('-v') || args.includes('--version') || args.includes('help')) {
45
+ const args = new Set(process.argv.slice(2));
46
+ if (args.has('-v') || args.has('--version') || args.has('help')) {
47
47
  return false;
48
48
  }
49
49
  // Check last check time
50
50
  const lastCheckKey = 'zintrust_last_version_check';
51
51
  const lastCheck = globalThis.localStorage?.getItem?.(lastCheckKey);
52
52
  if (lastCheck !== null && lastCheck !== undefined) {
53
- const lastCheckTime = parseInt(lastCheck, 10);
53
+ const lastCheckTime = Number.parseInt(lastCheck, 10);
54
54
  const now = Date.now();
55
55
  const hoursSinceLastCheck = (now - lastCheckTime) / (1000 * 60 * 60);
56
56
  if (hoursSinceLastCheck < config.checkInterval) {
@@ -88,7 +88,11 @@ export const VersionChecker = Object.freeze({
88
88
  * Compare versions using semver-like comparison
89
89
  */
90
90
  compareVersions(current, latest) {
91
- const cleanVersion = (version) => version.replace(/^v/, '').replace(/-.*$/, '');
91
+ const cleanVersion = (version) => {
92
+ // Remove leading 'v' and trailing pre-release identifiers safely
93
+ // Using specific patterns instead of greedy quantifiers to prevent ReDoS
94
+ return version.replace(/^v/, '').replace(/-[^-]*$/, '');
95
+ };
92
96
  const currentParts = cleanVersion(current).split('.').map(Number);
93
97
  const latestParts = cleanVersion(latest).split('.').map(Number);
94
98
  const maxLength = Math.max(currentParts.length, latestParts.length);
package/src/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @zintrust/core v0.1.25
2
+ * @zintrust/core v0.1.26
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-01-27T17:04:32.521Z
8
+ * Built: 2026-01-27T19:14:04.015Z
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.23';
24
- export const ZINTRUST_BUILD_DATE = '2026-01-27T17:04:32.494Z'; // Replaced during build
24
+ export const ZINTRUST_BUILD_DATE = '2026-01-27T19:14:03.983Z'; // Replaced during build
25
25
  import { Application } from './boot/Application.js';
26
26
  import { AwsSigV4 } from './common/index.js';
27
27
  import { SignedRequest } from './security/SignedRequest.js';
@@ -7,9 +7,6 @@ import type { LockProvider, LockProviderConfig } from '../../types/Queue';
7
7
  * Redis-based Lock Provider Implementation
8
8
  */
9
9
  export declare function createRedisLockProvider(config: LockProviderConfig): LockProvider;
10
- /**
11
- * Memory-based Lock Provider (for testing/sync driver)
12
- */
13
10
  export declare function createMemoryLockProvider(config: LockProviderConfig): LockProvider;
14
11
  export declare function registerLockProvider(name: string, provider: LockProvider): void;
15
12
  export declare function getLockProvider(name: string): LockProvider | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"LockProvider.d.ts","sourceRoot":"","sources":["../../../../src/tools/queue/LockProvider.ts"],"names":[],"mappings":"AACA;;;GAGG;AAGH,OAAO,KAAK,EAGV,YAAY,EACZ,kBAAkB,EAEnB,MAAM,eAAe,CAAC;AAwKvB;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAWhF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CA4FjF;AAOD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,CAG/E;AACD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEtE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAS3E"}
1
+ {"version":3,"file":"LockProvider.d.ts","sourceRoot":"","sources":["../../../../src/tools/queue/LockProvider.ts"],"names":[],"mappings":"AACA;;;GAGG;AAGH,OAAO,KAAK,EAGV,YAAY,EACZ,kBAAkB,EAEnB,MAAM,eAAe,CAAC;AAwKvB;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAWhF;AAYD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CA4FjF;AAOD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,CAG/E;AACD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEtE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAS3E"}
@@ -165,6 +165,12 @@ export function createRedisLockProvider(config) {
165
165
  /**
166
166
  * Memory-based Lock Provider (for testing/sync driver)
167
167
  */
168
+ function globToRegExp(pattern) {
169
+ // Escape all regex metacharacters, then turn '*' into '.*' as a wildcard
170
+ const escaped = pattern.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw `\$&`);
171
+ const regexSource = escaped.replaceAll(String.raw `\*`, '.*');
172
+ return new RegExp(`^${regexSource}$`);
173
+ }
168
174
  export function createMemoryLockProvider(config) {
169
175
  const locks = new Map();
170
176
  const prefix = config.prefix ?? ZintrustLang.MEMORY_LOCKS;
@@ -230,8 +236,8 @@ export function createMemoryLockProvider(config) {
230
236
  };
231
237
  },
232
238
  async list(pattern = '*') {
233
- // Simple regex match for memory provider
234
- const regex = new RegExp(pattern.replace('*', '.*'));
239
+ // Simple glob-style match for memory provider ('*' as wildcard)
240
+ const regex = globToRegExp(pattern);
235
241
  const keys = [];
236
242
  for (const key of locks.keys()) {
237
243
  const strippedKey = key.replace(prefix, '');