@dynamic-labs/logger 3.0.0-alpha.17 → 3.0.0-alpha.19

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/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
1
 
2
+ ## [3.0.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.18...v3.0.0-alpha.19) (2024-07-13)
3
+
4
+ ## [3.0.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.17...v3.0.0-alpha.18) (2024-07-12)
5
+
6
+
7
+ ### Bug Fixes
8
+
9
+ * hide confirmation ui triggers passkey creation ([#6322](https://github.com/dynamic-labs/DynamicAuth/issues/6322)) ([c66f282](https://github.com/dynamic-labs/DynamicAuth/commit/c66f282cf8d64f19d7f5a7355aaaec980afbe245))
10
+
2
11
  ## [3.0.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.16...v3.0.0-alpha.17) (2024-07-11)
3
12
 
4
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/logger",
3
- "version": "3.0.0-alpha.17",
3
+ "version": "3.0.0-alpha.19",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
package/src/index.cjs CHANGED
@@ -159,11 +159,11 @@ class Logger {
159
159
  /**
160
160
  * Emits an INFO type message to the backend for analysis and debugging
161
161
  */
162
- instrument(message, ...args) {
162
+ instrument(message, options) {
163
163
  return this.emitHttpLogs(types.LogLevel.INFO, message, {
164
- args,
165
- // Don't send entire user to avoid storing PII
166
- transformMeta: (meta) => { var _a; return meta && { userId: (_a = meta['user']) === null || _a === void 0 ? void 0 : _a.userId }; },
164
+ args: [options],
165
+ // Don't send any meta to avoid storing PII
166
+ transformMeta: () => undefined,
167
167
  });
168
168
  }
169
169
  log(level, message, ...args) {
package/src/index.d.ts CHANGED
@@ -5,6 +5,18 @@ type EmitHttpOptions = {
5
5
  args?: any[];
6
6
  transformMeta?: (meta: Record<string, any> | undefined) => Record<string, any> | undefined;
7
7
  };
8
+ export type InstrumentOptions = {
9
+ extraArgs?: NonNullable<EmitHttpOptions['args']>;
10
+ /** Identifies which resource is being instrumented */
11
+ key: string;
12
+ /** Instrumentation does not use meta so this needs to be explicit */
13
+ environmentId: string;
14
+ /** Measurement in MS the operation took to complete */
15
+ time: number;
16
+ appName?: string;
17
+ userId?: string;
18
+ primaryWalletId?: string;
19
+ };
8
20
  export declare class Logger {
9
21
  private name;
10
22
  private level;
@@ -27,7 +39,7 @@ export declare class Logger {
27
39
  /**
28
40
  * Emits an INFO type message to the backend for analysis and debugging
29
41
  */
30
- instrument(message: Message, ...args: NonNullable<EmitHttpOptions['args']>): void;
42
+ instrument(message: Message, options: InstrumentOptions & Record<string, unknown>): void;
31
43
  log(level: LogLevel, message: Message, ...args: any[]): void;
32
44
  debug(message: Message, ...args: any[]): void;
33
45
  info(message: Message, ...args: any[]): void;
package/src/index.js CHANGED
@@ -152,11 +152,11 @@ class Logger {
152
152
  /**
153
153
  * Emits an INFO type message to the backend for analysis and debugging
154
154
  */
155
- instrument(message, ...args) {
155
+ instrument(message, options) {
156
156
  return this.emitHttpLogs(LogLevel.INFO, message, {
157
- args,
158
- // Don't send entire user to avoid storing PII
159
- transformMeta: (meta) => { var _a; return meta && { userId: (_a = meta['user']) === null || _a === void 0 ? void 0 : _a.userId }; },
157
+ args: [options],
158
+ // Don't send any meta to avoid storing PII
159
+ transformMeta: () => undefined,
160
160
  });
161
161
  }
162
162
  log(level, message, ...args) {