unnbound-logger-sdk 3.0.25 → 3.0.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/dist/storage.d.ts CHANGED
@@ -1,7 +1,12 @@
1
1
  import { AsyncLocalStorage } from 'async_hooks';
2
- export interface Context {
2
+ export interface UnnboundContext {
3
3
  traceId?: string;
4
4
  spanId?: string;
5
5
  messageId?: string;
6
6
  }
7
- export declare const storage: AsyncLocalStorage<Context>;
7
+ interface UnnboundStorage extends AsyncLocalStorage<object> {
8
+ getStore<T>(): T | undefined;
9
+ }
10
+ export declare const storage: UnnboundStorage;
11
+ export declare const withStorage: <T>(data: object, callback: () => Promise<T>) => Promise<T>;
12
+ export {};
package/dist/storage.js CHANGED
@@ -1,5 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.storage = void 0;
3
+ exports.withStorage = exports.storage = void 0;
4
4
  const async_hooks_1 = require("async_hooks");
5
5
  exports.storage = new async_hooks_1.AsyncLocalStorage();
6
+ const withStorage = async (data, callback) => {
7
+ const previous = exports.storage.getStore();
8
+ return exports.storage.run({ ...previous, ...data }, callback);
9
+ };
10
+ exports.withStorage = withStorage;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unnbound-logger-sdk",
3
3
  "description": "A structured logging library with TypeScript support using Pino. Provides consistent, well-typed logging with automatic logId, workflowId, traceId, and deploymentId tracking across operational contexts.",
4
- "version": "3.0.25",
4
+ "version": "3.0.26",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "keywords": [
@@ -26,7 +26,7 @@
26
26
  "url": "https://github.com/unnbounddev/unnbound-sdks/issues"
27
27
  },
28
28
  "dependencies": {
29
- "axios": "^1.0.0",
29
+ "axios": "^1.12.2",
30
30
  "express": "^4.0.0 || ^5.0.0",
31
31
  "pino": "^8.17.2",
32
32
  "uuid": "^11.1.0"
@@ -38,7 +38,7 @@
38
38
  "@types/uuid": "^9.0.8"
39
39
  },
40
40
  "peerDependencies": {
41
- "axios": "^1.0.0",
41
+ "axios": "^1.12.2",
42
42
  "express": "^4.0.0 || ^5.0.0"
43
43
  },
44
44
  "peerDependenciesMeta": {