@zintrust/trace 0.7.2 → 0.7.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.
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@zintrust/trace",
3
- "version": "0.7.2",
4
- "buildDate": "2026-04-18T19:23:29.310Z",
3
+ "version": "0.7.7",
4
+ "buildDate": "2026-04-19T15:00:27.813Z",
5
5
  "buildEnvironment": {
6
6
  "node": "v22.22.1",
7
7
  "platform": "darwin",
8
8
  "arch": "arm64"
9
9
  },
10
10
  "git": {
11
- "commit": "126e1196",
11
+ "commit": "a24f7050",
12
12
  "branch": "release"
13
13
  },
14
14
  "package": {
@@ -23,7 +23,7 @@
23
23
  "files": {
24
24
  "build-manifest.json": {
25
25
  "size": 14744,
26
- "sha256": "6cd46c9c15b2d55e83b4563969b4180be3c278cda5438003d8ba98b543133a49"
26
+ "sha256": "92c908f5c5528304d6c843be5147edf082722c48b3d0c06a186207e6a0735461"
27
27
  },
28
28
  "cli-register.d.ts": {
29
29
  "size": 255,
@@ -79,7 +79,7 @@
79
79
  },
80
80
  "index.js": {
81
81
  "size": 3324,
82
- "sha256": "fea850dbd404cad2e9cf9e29c718dd0596216a4ec766bb8701b399a10c7adeb9"
82
+ "sha256": "231eccde4e494f5c48e17cd645e7518b7487fbb1fb82d8b961e60f988f776188"
83
83
  },
84
84
  "migrations/20260331000001_create_zin_trace_entries_table.d.ts": {
85
85
  "size": 304,
@@ -13,6 +13,10 @@ const resolveDashboardConnectionName = (connectionName) => {
13
13
  if (explicitConnection !== undefined && explicitConnection !== '') {
14
14
  return explicitConnection;
15
15
  }
16
+ const runtimeConnection = globalThis.__zintrust_system_trace_connection_name__?.trim();
17
+ if (runtimeConnection !== undefined && runtimeConnection !== '') {
18
+ return runtimeConnection;
19
+ }
16
20
  const configuredConnection = TraceConfig.merge().connection?.trim();
17
21
  return configuredConnection === undefined || configuredConnection === ''
18
22
  ? undefined
package/dist/register.js CHANGED
@@ -316,6 +316,9 @@ if (!traceAlreadyInitialized && Env) {
316
316
  });
317
317
  const resolvedConnectionName = resolveTraceConnectionName(Env, config.connection);
318
318
  const resolvedObservedConnectionName = resolveObservedConnectionName(Env, config.observeConnection, resolvedConnectionName);
319
+ globalTraceRegisterState.__zintrust_system_trace_connection_name__ = resolvedConnectionName;
320
+ globalTraceRegisterState.__zintrust_system_trace_observe_connection_name__ =
321
+ resolvedObservedConnectionName;
319
322
  const storageDb = core.useDatabase?.(undefined, resolvedConnectionName);
320
323
  const observedDb = core.useDatabase?.(undefined, resolvedObservedConnectionName);
321
324
  assertTraceConnectionResolved(core, storageDb, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zintrust/trace",
3
- "version": "0.7.2",
3
+ "version": "0.7.8",
4
4
  "description": "Trace assistant for ZinTrust: logs requests, queries, exceptions, jobs, and more.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -40,7 +40,7 @@
40
40
  "node": ">=20.0.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@zintrust/core": "^0.7.2"
43
+ "@zintrust/core": "*"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"
@@ -56,4 +56,4 @@
56
56
  "build": "tsc -p tsconfig.json && tsc -p tsconfig.migrations.json && node ../../scripts/fix-dist-esm-imports.mjs dist",
57
57
  "prepublishOnly": "npm run build"
58
58
  }
59
- }
59
+ }
@@ -36,12 +36,23 @@ export type TraceDashboardRegistrationOptions = TraceDashboardOptions & {
36
36
  connectionName?: string;
37
37
  };
38
38
 
39
+ type GlobalTraceDashboardState = {
40
+ __zintrust_system_trace_connection_name__?: string;
41
+ };
42
+
39
43
  const resolveDashboardConnectionName = (connectionName?: string): string | undefined => {
40
44
  const explicitConnection = connectionName?.trim();
41
45
  if (explicitConnection !== undefined && explicitConnection !== '') {
42
46
  return explicitConnection;
43
47
  }
44
48
 
49
+ const runtimeConnection = (
50
+ globalThis as GlobalTraceDashboardState
51
+ ).__zintrust_system_trace_connection_name__?.trim();
52
+ if (runtimeConnection !== undefined && runtimeConnection !== '') {
53
+ return runtimeConnection;
54
+ }
55
+
45
56
  const configuredConnection = TraceConfig.merge().connection?.trim();
46
57
  return configuredConnection === undefined || configuredConnection === ''
47
58
  ? undefined
package/src/register.ts CHANGED
@@ -33,6 +33,8 @@ export type {}; // side-effect ESM module
33
33
  type GlobalTraceRegisterState = {
34
34
  __zintrust_system_trace_register_initialized__?: boolean;
35
35
  __zintrust_system_trace_plugin_requested__?: boolean;
36
+ __zintrust_system_trace_connection_name__?: string;
37
+ __zintrust_system_trace_observe_connection_name__?: string;
36
38
  };
37
39
 
38
40
  const globalTraceRegisterState = globalThis as unknown as GlobalTraceRegisterState;
@@ -467,6 +469,9 @@ if (!traceAlreadyInitialized && Env) {
467
469
  config.observeConnection,
468
470
  resolvedConnectionName
469
471
  );
472
+ globalTraceRegisterState.__zintrust_system_trace_connection_name__ = resolvedConnectionName;
473
+ globalTraceRegisterState.__zintrust_system_trace_observe_connection_name__ =
474
+ resolvedObservedConnectionName;
470
475
  const storageDb = core.useDatabase?.(undefined, resolvedConnectionName);
471
476
  const observedDb = core.useDatabase?.(undefined, resolvedObservedConnectionName);
472
477