@reyaxyz/athena-logger 0.2.8 → 0.3.1

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uDAAqD;AACrD,yCAAwC;AACxC,mCAAsC;AAEzB,QAAA,MAAM,GAAG;IACpB,UAAU,qBAAA;IACV,WAAW,eACN,0BAAW,CACf;IACD,KAAK,EAAE;QACL,KAAK,eAAA;KACN;CACF,CAAC","sourcesContent":["import { userJourney } from './modules/user-journey';\nimport { error } from './modules/error';\nimport { initialize } from './logger';\n\nexport const Athena = {\n initialize,\n UserJourney: {\n ...userJourney,\n },\n Error: {\n error,\n },\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uDAAqD;AACrD,yCAAwC;AACxC,mCAAsC;AAEzB,QAAA,MAAM,GAAG;IACpB,UAAU,qBAAA;IACV,WAAW,eACN,0BAAW,CACf;IACD,KAAK,EAAE;QACL,KAAK,eAAA;KACN;CACF,CAAC","sourcesContent":["import { userJourney } from './modules/user-journey';\nimport { error } from './modules/error';\nimport { initialize } from './logger';\n\nexport const Athena = {\n initialize,\n UserJourney: {\n ...userJourney,\n },\n Error: {\n error,\n },\n};\n\nexport type {\n UserJourneyActionParams,\n UserJourneyErrorParams,\n UserJourneyStartParams,\n LogErrorParams,\n} from './modules/types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,uCAAmD;AAW5C,IAAM,KAAK,GAAG,UAAC,EAML;QALf,OAAO,aAAA,EACP,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,aAAa,mBAAA,EACb,KAAK,WAAA;IAEL,IAAI,CAAC,IAAA,4BAAmB,GAAE,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,0BAAW,CAAC,MAAM,CAAC,KAAK,CACtB,uBAAgB,OAAO,SAAG,OAAO,CAAC,CAAC,CAAC,YAAK,OAAO,CAAE,CAAC,CAAC,CAAC,EAAE,CAAE,wBACpD,QAAQ,GAAK,CAAC,aAAa,IAAI,EAAE,IAAI,EAAE,EAAE,aAAa,eAAA,EAAE,EAAE,CAAC,GAChE,KAAc,CACf,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,KAAK,SAiBhB","sourcesContent":["import { datadogLogs } from '@datadog/browser-logs';\nimport { isLoggerInitialized } from '../../shared';\n\ntype LogErrorParams = {\n context: string;\n error: unknown;\n walletAddress?: string;\n // Optional! If not provided, will try to extract message from Error\n message?: string;\n metadata?: Record<string, unknown>;\n};\n\nexport const error = ({\n context,\n message,\n metadata,\n walletAddress,\n error,\n}: LogErrorParams) => {\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n datadogLogs.logger.error(\n `athena.error/${context}${message ? `: ${message}` : ''}`,\n { ...metadata, ...(walletAddress && { user: { walletAddress } }) },\n error as Error,\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,uCAAmD;AAG5C,IAAM,KAAK,GAAG,UAAC,EAML;QALf,OAAO,aAAA,EACP,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,aAAa,mBAAA,EACb,KAAK,WAAA;IAEL,IAAI,CAAC,IAAA,4BAAmB,GAAE,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,0BAAW,CAAC,MAAM,CAAC,KAAK,CACtB,uBAAgB,OAAO,SAAG,OAAO,CAAC,CAAC,CAAC,YAAK,OAAO,CAAE,CAAC,CAAC,CAAC,EAAE,CAAE,wBACpD,QAAQ,GAAK,CAAC,aAAa,IAAI,EAAE,IAAI,EAAE,EAAE,aAAa,eAAA,EAAE,EAAE,CAAC,GAChE,KAAc,CACf,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,KAAK,SAiBhB","sourcesContent":["import { datadogLogs } from '@datadog/browser-logs';\nimport { isLoggerInitialized } from '../../shared';\nimport { LogErrorParams } from './types';\n\nexport const error = ({\n context,\n message,\n metadata,\n walletAddress,\n error,\n}: LogErrorParams) => {\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n datadogLogs.logger.error(\n `athena.error/${context}${message ? `: ${message}` : ''}`,\n { ...metadata, ...(walletAddress && { user: { walletAddress } }) },\n error as Error,\n );\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/error/types.ts"],"names":[],"mappings":"","sourcesContent":["export type LogErrorParams = {\n context: string;\n error: unknown;\n walletAddress?: string;\n // Optional! If not provided, will try to extract message from Error\n message?: string;\n metadata?: Record<string, unknown>;\n};\n"]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./error/types"), exports);
18
+ __exportStar(require("./user-journey/types"), exports);
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,uDAAqC","sourcesContent":["export * from './error/types';\nexport * from './user-journey/types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/user-journey/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,uCAAmD;AACnD,iCAMiB;AAejB,IAAM,MAAM,GAAG,UAAC,EAAqD;QAAnD,MAAM,YAAA,EAAE,OAAO,aAAA,EAAE,OAAO,aAAA;IACxC,IAAM,aAAa,GAAG,IAAA,wBAAgB,GAAE,CAAC;IACzC,IAAM,OAAO,GAAG,IAAA,kBAAU,GAAE,CAAC;IAE7B,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,IAAI,CAAC,IAAA,4BAAmB,GAAE,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,0BAAW,CAAC,MAAM,CAAC,IAAI,CACrB,8BAAuB,MAAM,SAAG,OAAO,CAAC,CAAC,CAAC,YAAK,OAAO,CAAE,CAAC,CAAC,CAAC,EAAE,CAAE,wBAE1D,OAAO,KACV,IAAI,EAAE;YACJ,aAAa,eAAA;YACb,OAAO,SAAA;SACR,IAEJ,CAA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EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;IACpB,MAAM,CAAC;QACL,MAAM,EAAE,eAAe;KACxB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,IAAM,IAAI,GAAG;IACX,IAAI,CAAC,IAAA,4BAAmB,GAAE,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,MAAM,CAAC;QACL,MAAM,EAAE,qBAAqB;KAC9B,CAAC,CAAC;IACH,IAAA,aAAK,GAAE,CAAC;AACV,CAAC,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,MAAM,QAAA;IACN,KAAK,OAAA;IACL,KAAK,OAAA;IACL,WAAW,aAAA;IACX,IAAI,MAAA;CACL,CAAC","sourcesContent":["import { datadogLogs } from '@datadog/browser-logs';\nimport { isLoggerInitialized } from '../../shared';\nimport {\n clear,\n getChainId,\n getWalletAddress,\n initialize,\n setChainId,\n} from './state';\n\nexport type UserJourneyActionParams = {\n action: string;\n message?: string;\n payload?: Record<string, unknown>;\n};\n\nexport type UserJourneyErrorParams = {\n action: string;\n error: Error | unknown;\n message?: string;\n payload?: Record<string, unknown>;\n};\n\nconst action = ({ action, message, payload }: UserJourneyActionParams) => {\n const walletAddress = getWalletAddress();\n const chainId = getChainId();\n\n if (!walletAddress) {\n console.warn('Logger missing wallet address');\n return;\n }\n\n if (!chainId) {\n console.warn('Logger missing chainId');\n return;\n }\n\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n datadogLogs.logger.info(\n `athena.user_journey/${action}${message ? `: ${message}` : ''}`,\n {\n ...payload,\n user: {\n walletAddress,\n chainId,\n },\n },\n );\n};\n\nconst error = ({ action, error, message, payload }: UserJourneyErrorParams) => {\n const walletAddress = getWalletAddress();\n const chainId = getChainId();\n\n if (!walletAddress) {\n console.warn('Logger missing wallet address');\n return;\n }\n\n if (!chainId) {\n console.warn('Logger missing chainId');\n return;\n }\n\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n datadogLogs.logger.error(\n `athena.user_journey/${action}${message ? `: ${message}` : ''}`,\n {\n ...payload,\n user: {\n walletAddress,\n chainId,\n },\n },\n error as Error,\n );\n};\n\nconst start = ({ address, chainId }: { address: string; chainId: number }) => {\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n initialize(address, chainId);\n action({\n action: 'wallet_connected',\n });\n};\n\nconst switchChain = (chainId: number) => {\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n setChainId(chainId);\n action({\n action: `chain_changed`,\n });\n};\n\nconst stop = () => {\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n action({\n action: 'wallet_disconnected',\n });\n clear();\n};\n\nexport const userJourney = {\n action,\n error,\n start,\n switchChain,\n stop,\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/user-journey/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,uCAAmD;AACnD,iCAMiB;AAOjB,IAAM,MAAM,GAAG,UAAC,EAAqD;QAAnD,MAAM,YAAA,EAAE,OAAO,aAAA,EAAE,OAAO,aAAA;IACxC,IAAM,aAAa,GAAG,IAAA,wBAAgB,GAAE,CAAC;IACzC,IAAM,OAAO,GAAG,IAAA,kBAAU,GAAE,CAAC;IAE7B,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,IAAI,CAAC,IAAA,4BAAmB,GAAE,EAAE,C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EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,IAAA,kBAAU,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7B,MAAM,CAAC;QACL,MAAM,EAAE,kBAAkB;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,IAAM,WAAW,GAAG,UAAC,OAAe;IAClC,IAAI,CAAC,IAAA,4BAAmB,GAAE,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;IACpB,MAAM,CAAC;QACL,MAAM,EAAE,eAAe;KACxB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,IAAM,IAAI,GAAG;IACX,IAAI,CAAC,IAAA,4BAAmB,GAAE,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,MAAM,CAAC;QACL,MAAM,EAAE,qBAAqB;KAC9B,CAAC,CAAC;IACH,IAAA,aAAK,GAAE,CAAC;AACV,CAAC,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,MAAM,QAAA;IACN,KAAK,OAAA;IACL,KAAK,OAAA;IACL,WAAW,aAAA;IACX,IAAI,MAAA;CACL,CAAC","sourcesContent":["import { datadogLogs } from '@datadog/browser-logs';\nimport { isLoggerInitialized } from '../../shared';\nimport {\n clear,\n getChainId,\n getWalletAddress,\n initialize,\n setChainId,\n} from './state';\nimport {\n UserJourneyActionParams,\n UserJourneyErrorParams,\n UserJourneyStartParams,\n} from './types';\n\nconst action = ({ action, message, payload }: UserJourneyActionParams) => {\n const walletAddress = getWalletAddress();\n const chainId = getChainId();\n\n if (!walletAddress) {\n console.warn('Logger missing wallet address');\n return;\n }\n\n if (!chainId) {\n console.warn('Logger missing chainId');\n return;\n }\n\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n datadogLogs.logger.info(\n `athena.user_journey/${action}${message ? `: ${message}` : ''}`,\n {\n ...payload,\n user: {\n walletAddress,\n chainId,\n },\n },\n );\n};\n\nconst error = ({ action, error, message, payload }: UserJourneyErrorParams) => {\n const walletAddress = getWalletAddress();\n const chainId = getChainId();\n\n if (!walletAddress) {\n console.warn('Logger missing wallet address');\n return;\n }\n\n if (!chainId) {\n console.warn('Logger missing chainId');\n return;\n }\n\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n datadogLogs.logger.error(\n `athena.user_journey/${action}${message ? `: ${message}` : ''}`,\n {\n ...payload,\n user: {\n walletAddress,\n chainId,\n },\n },\n error as Error,\n );\n};\n\nconst start = ({ address, chainId }: UserJourneyStartParams) => {\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n initialize(address, chainId);\n action({\n action: 'wallet_connected',\n });\n};\n\nconst switchChain = (chainId: number) => {\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n setChainId(chainId);\n action({\n action: `chain_changed`,\n });\n};\n\nconst stop = () => {\n if (!isLoggerInitialized()) {\n console.warn('Logger not initialized');\n return;\n }\n\n action({\n action: 'wallet_disconnected',\n });\n clear();\n};\n\nexport const userJourney = {\n action,\n error,\n start,\n switchChain,\n stop,\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/user-journey/types.ts"],"names":[],"mappings":"","sourcesContent":["export type UserJourneyActionParams = {\n action: string;\n message?: string;\n payload?: Record<string, unknown>;\n};\n\nexport type UserJourneyErrorParams = {\n action: string;\n error: Error | unknown;\n message?: string;\n payload?: Record<string, unknown>;\n};\n\nexport type UserJourneyStartParams = {\n address: string;\n chainId: number;\n};\n"]}
@@ -6,23 +6,15 @@ export declare const Athena: {
6
6
  version: string;
7
7
  }) => void;
8
8
  UserJourney: {
9
- action: ({ action, message, payload }: import("./modules/user-journey").UserJourneyActionParams) => void;
10
- error: ({ action, error, message, payload }: import("./modules/user-journey").UserJourneyErrorParams) => void;
11
- start: ({ address, chainId }: {
12
- address: string;
13
- chainId: number;
14
- }) => void;
9
+ action: ({ action, message, payload }: import("./modules/types").UserJourneyActionParams) => void;
10
+ error: ({ action, error, message, payload }: import("./modules/types").UserJourneyErrorParams) => void;
11
+ start: ({ address, chainId }: import("./modules/types").UserJourneyStartParams) => void;
15
12
  switchChain: (chainId: number) => void;
16
13
  stop: () => void;
17
14
  };
18
15
  Error: {
19
- error: ({ context, message, metadata, walletAddress, error, }: {
20
- context: string;
21
- error: unknown;
22
- walletAddress?: string | undefined;
23
- message?: string | undefined;
24
- metadata?: Record<string, unknown> | undefined;
25
- }) => void;
16
+ error: ({ context, message, metadata, walletAddress, error, }: import("./modules/types").LogErrorParams) => void;
26
17
  };
27
18
  };
19
+ export type { UserJourneyActionParams, UserJourneyErrorParams, UserJourneyStartParams, LogErrorParams, } from './modules/types';
28
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;CAQlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;CAQlB,CAAC;AAEF,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,GACf,MAAM,iBAAiB,CAAC"}
@@ -1,10 +1,3 @@
1
- type LogErrorParams = {
2
- context: string;
3
- error: unknown;
4
- walletAddress?: string;
5
- message?: string;
6
- metadata?: Record<string, unknown>;
7
- };
1
+ import { LogErrorParams } from './types';
8
2
  export declare const error: ({ context, message, metadata, walletAddress, error, }: LogErrorParams) => void;
9
- export {};
10
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/error/index.ts"],"names":[],"mappings":"AAGA,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,KAAK,0DAMf,cAAc,SAWhB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/error/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,KAAK,0DAMf,cAAc,SAWhB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type LogErrorParams = {
2
+ context: string;
3
+ error: unknown;
4
+ walletAddress?: string;
5
+ message?: string;
6
+ metadata?: Record<string, unknown>;
7
+ };
8
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/error/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './error/types';
2
+ export * from './user-journey/types';
3
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/types.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
@@ -1,21 +1,8 @@
1
- export type UserJourneyActionParams = {
2
- action: string;
3
- message?: string;
4
- payload?: Record<string, unknown>;
5
- };
6
- export type UserJourneyErrorParams = {
7
- action: string;
8
- error: Error | unknown;
9
- message?: string;
10
- payload?: Record<string, unknown>;
11
- };
1
+ import { UserJourneyActionParams, UserJourneyErrorParams, UserJourneyStartParams } from './types';
12
2
  export declare const userJourney: {
13
3
  action: ({ action, message, payload }: UserJourneyActionParams) => void;
14
4
  error: ({ action, error, message, payload }: UserJourneyErrorParams) => void;
15
- start: ({ address, chainId }: {
16
- address: string;
17
- chainId: number;
18
- }) => void;
5
+ start: ({ address, chainId }: UserJourneyStartParams) => void;
19
6
  switchChain: (chainId: number) => void;
20
7
  stop: () => void;
21
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/user-journey/index.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAqGF,eAAO,MAAM,WAAW;2CAnGsB,uBAAuB;iDA+BjB,sBAAsB;;iBAgC1B,MAAM;iBAAW,MAAM;;2BAYzC,MAAM;;CA8BnC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/user-journey/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAqGjB,eAAO,MAAM,WAAW;2CAnGsB,uBAAuB;iDA+BjB,sBAAsB;kCAgCrC,sBAAsB;2BAY7B,MAAM;;CA8BnC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export type UserJourneyActionParams = {
2
+ action: string;
3
+ message?: string;
4
+ payload?: Record<string, unknown>;
5
+ };
6
+ export type UserJourneyErrorParams = {
7
+ action: string;
8
+ error: Error | unknown;
9
+ message?: string;
10
+ payload?: Record<string, unknown>;
11
+ };
12
+ export type UserJourneyStartParams = {
13
+ address: string;
14
+ chainId: number;
15
+ };
16
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/user-journey/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/athena-logger",
3
- "version": "0.2.8",
3
+ "version": "0.3.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -43,5 +43,5 @@
43
43
  "@datadog/browser-logs": "5.17.1"
44
44
  },
45
45
  "packageManager": "pnpm@8.3.1",
46
- "gitHead": "451f5ad174f0ba7adb3404c5e5660e6c1bdbf6cd"
46
+ "gitHead": "d9f43bfb9fdf587ff020b2aab6915231bdcd0f86"
47
47
  }
package/src/index.ts CHANGED
@@ -11,3 +11,10 @@ export const Athena = {
11
11
  error,
12
12
  },
13
13
  };
14
+
15
+ export type {
16
+ UserJourneyActionParams,
17
+ UserJourneyErrorParams,
18
+ UserJourneyStartParams,
19
+ LogErrorParams,
20
+ } from './modules/types';
@@ -1,14 +1,6 @@
1
1
  import { datadogLogs } from '@datadog/browser-logs';
2
2
  import { isLoggerInitialized } from '../../shared';
3
-
4
- type LogErrorParams = {
5
- context: string;
6
- error: unknown;
7
- walletAddress?: string;
8
- // Optional! If not provided, will try to extract message from Error
9
- message?: string;
10
- metadata?: Record<string, unknown>;
11
- };
3
+ import { LogErrorParams } from './types';
12
4
 
13
5
  export const error = ({
14
6
  context,
@@ -0,0 +1,8 @@
1
+ export type LogErrorParams = {
2
+ context: string;
3
+ error: unknown;
4
+ walletAddress?: string;
5
+ // Optional! If not provided, will try to extract message from Error
6
+ message?: string;
7
+ metadata?: Record<string, unknown>;
8
+ };
@@ -0,0 +1,2 @@
1
+ export * from './error/types';
2
+ export * from './user-journey/types';
@@ -7,19 +7,11 @@ import {
7
7
  initialize,
8
8
  setChainId,
9
9
  } from './state';
10
-
11
- export type UserJourneyActionParams = {
12
- action: string;
13
- message?: string;
14
- payload?: Record<string, unknown>;
15
- };
16
-
17
- export type UserJourneyErrorParams = {
18
- action: string;
19
- error: Error | unknown;
20
- message?: string;
21
- payload?: Record<string, unknown>;
22
- };
10
+ import {
11
+ UserJourneyActionParams,
12
+ UserJourneyErrorParams,
13
+ UserJourneyStartParams,
14
+ } from './types';
23
15
 
24
16
  const action = ({ action, message, payload }: UserJourneyActionParams) => {
25
17
  const walletAddress = getWalletAddress();
@@ -84,7 +76,7 @@ const error = ({ action, error, message, payload }: UserJourneyErrorParams) => {
84
76
  );
85
77
  };
86
78
 
87
- const start = ({ address, chainId }: { address: string; chainId: number }) => {
79
+ const start = ({ address, chainId }: UserJourneyStartParams) => {
88
80
  if (!isLoggerInitialized()) {
89
81
  console.warn('Logger not initialized');
90
82
  return;
@@ -0,0 +1,17 @@
1
+ export type UserJourneyActionParams = {
2
+ action: string;
3
+ message?: string;
4
+ payload?: Record<string, unknown>;
5
+ };
6
+
7
+ export type UserJourneyErrorParams = {
8
+ action: string;
9
+ error: Error | unknown;
10
+ message?: string;
11
+ payload?: Record<string, unknown>;
12
+ };
13
+
14
+ export type UserJourneyStartParams = {
15
+ address: string;
16
+ chainId: number;
17
+ };