@reyaxyz/athena-logger 0.2.8 → 0.3.0
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 +1 -1
- package/dist/modules/error/index.js.map +1 -1
- package/dist/modules/error/types.js +3 -0
- package/dist/modules/error/types.js.map +1 -0
- package/dist/modules/types.js +19 -0
- package/dist/modules/types.js.map +1 -0
- package/dist/modules/user-journey/index.js.map +1 -1
- package/dist/modules/user-journey/types.js +3 -0
- package/dist/modules/user-journey/types.js.map +1 -0
- package/dist/types/index.d.ts +4 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/error/index.d.ts +1 -8
- package/dist/types/modules/error/index.d.ts.map +1 -1
- package/dist/types/modules/error/types.d.ts +8 -0
- package/dist/types/modules/error/types.d.ts.map +1 -0
- package/dist/types/modules/types.d.ts +3 -0
- package/dist/types/modules/types.d.ts.map +1 -0
- package/dist/types/modules/user-journey/index.d.ts +1 -11
- package/dist/types/modules/user-journey/index.d.ts.map +1 -1
- package/dist/types/modules/user-journey/types.d.ts +12 -0
- package/dist/types/modules/user-journey/types.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +5 -0
- package/src/modules/error/index.ts +1 -9
- package/src/modules/error/types.ts +8 -0
- package/src/modules/types.ts +2 -0
- package/src/modules/user-journey/index.ts +1 -13
- package/src/modules/user-journey/types.ts +12 -0
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} from './modules/types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,uCAAmD;
|
|
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 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/user-journey/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,uCAAmD;AACnD,iCAMiB;AAGjB,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,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,KAAK,GAAG,UAAC,EAA2D;QAAzD,MAAM,YAAA,EAAE,KAAK,WAAA,EAAE,OAAO,aAAA,EAAE,OAAO,aAAA;IAC9C,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,KAAK,CACtB,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,KAEH,KAAc,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,KAAK,GAAG,UAAC,EAA0D;QAAxD,OAAO,aAAA,EAAE,OAAO,aAAA;IAC/B,IAAI,CAAC,IAAA,4BAAmB,GAAE,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 { UserJourneyActionParams, UserJourneyErrorParams } 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 }: { 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"]}
|
|
@@ -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"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export declare const Athena: {
|
|
|
6
6
|
version: string;
|
|
7
7
|
}) => void;
|
|
8
8
|
UserJourney: {
|
|
9
|
-
action: ({ action, message, payload }: import("./modules/
|
|
10
|
-
error: ({ action, error, message, payload }: import("./modules/
|
|
9
|
+
action: ({ action, message, payload }: import("./modules/types").UserJourneyActionParams) => void;
|
|
10
|
+
error: ({ action, error, message, payload }: import("./modules/types").UserJourneyErrorParams) => void;
|
|
11
11
|
start: ({ address, chainId }: {
|
|
12
12
|
address: string;
|
|
13
13
|
chainId: number;
|
|
@@ -16,13 +16,8 @@ export declare const Athena: {
|
|
|
16
16
|
stop: () => void;
|
|
17
17
|
};
|
|
18
18
|
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;
|
|
19
|
+
error: ({ context, message, metadata, walletAddress, error, }: import("./modules/types").LogErrorParams) => void;
|
|
26
20
|
};
|
|
27
21
|
};
|
|
22
|
+
export type { UserJourneyActionParams, UserJourneyErrorParams, } from './modules/types';
|
|
28
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM
|
|
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,GACvB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
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":"
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/types.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
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 } 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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/user-journey/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/user-journey/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAqG1E,eAAO,MAAM,WAAW;2CAnGsB,uBAAuB;iDA+BjB,sBAAsB;;iBAgC1B,MAAM;iBAAW,MAAM;;2BAYzC,MAAM;;CA8BnC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
//# 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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/athena-logger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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": "
|
|
46
|
+
"gitHead": "b75394b4b8d22b9bef0dc300259976d3aa10dcb0"
|
|
47
47
|
}
|
package/src/index.ts
CHANGED
|
@@ -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,
|
|
@@ -7,19 +7,7 @@ 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 { UserJourneyActionParams, UserJourneyErrorParams } from './types';
|
|
23
11
|
|
|
24
12
|
const action = ({ action, message, payload }: UserJourneyActionParams) => {
|
|
25
13
|
const walletAddress = getWalletAddress();
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|