@reyaxyz/athena-logger 0.3.0 → 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 +1 -1
- package/dist/modules/user-journey/index.js.map +1 -1
- package/dist/modules/user-journey/types.js.map +1 -1
- package/dist/types/index.d.ts +2 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/user-journey/index.d.ts +2 -5
- package/dist/types/modules/user-journey/index.d.ts.map +1 -1
- package/dist/types/modules/user-journey/types.d.ts +4 -0
- package/dist/types/modules/user-journey/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -0
- package/src/modules/user-journey/index.ts +6 -2
- package/src/modules/user-journey/types.ts +5 -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\nexport type {\n UserJourneyActionParams,\n UserJourneyErrorParams,\n} from './modules/types';\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/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;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,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';\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"]}
|
|
@@ -1 +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"]}
|
|
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"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,10 +8,7 @@ export declare const Athena: {
|
|
|
8
8
|
UserJourney: {
|
|
9
9
|
action: ({ action, message, payload }: import("./modules/types").UserJourneyActionParams) => void;
|
|
10
10
|
error: ({ action, error, message, payload }: import("./modules/types").UserJourneyErrorParams) => void;
|
|
11
|
-
start: ({ address, chainId }:
|
|
12
|
-
address: string;
|
|
13
|
-
chainId: number;
|
|
14
|
-
}) => void;
|
|
11
|
+
start: ({ address, chainId }: import("./modules/types").UserJourneyStartParams) => void;
|
|
15
12
|
switchChain: (chainId: number) => void;
|
|
16
13
|
stop: () => void;
|
|
17
14
|
};
|
|
@@ -19,5 +16,5 @@ export declare const Athena: {
|
|
|
19
16
|
error: ({ context, message, metadata, walletAddress, error, }: import("./modules/types").LogErrorParams) => void;
|
|
20
17
|
};
|
|
21
18
|
};
|
|
22
|
-
export type { UserJourneyActionParams, UserJourneyErrorParams, } from './modules/types';
|
|
19
|
+
export type { UserJourneyActionParams, UserJourneyErrorParams, UserJourneyStartParams, LogErrorParams, } from './modules/types';
|
|
23
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
|
|
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,11 +1,8 @@
|
|
|
1
|
-
import { UserJourneyActionParams, UserJourneyErrorParams } from './types';
|
|
1
|
+
import { UserJourneyActionParams, UserJourneyErrorParams, UserJourneyStartParams } from './types';
|
|
2
2
|
export declare const userJourney: {
|
|
3
3
|
action: ({ action, message, payload }: UserJourneyActionParams) => void;
|
|
4
4
|
error: ({ action, error, message, payload }: UserJourneyErrorParams) => void;
|
|
5
|
-
start: ({ address, chainId }:
|
|
6
|
-
address: string;
|
|
7
|
-
chainId: number;
|
|
8
|
-
}) => void;
|
|
5
|
+
start: ({ address, chainId }: UserJourneyStartParams) => void;
|
|
9
6
|
switchChain: (chainId: number) => void;
|
|
10
7
|
stop: () => void;
|
|
11
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/user-journey/index.ts"],"names":[],"mappings":"AASA,OAAO,
|
|
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"}
|
|
@@ -1 +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"}
|
|
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.3.
|
|
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": "
|
|
46
|
+
"gitHead": "d9f43bfb9fdf587ff020b2aab6915231bdcd0f86"
|
|
47
47
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,11 @@ import {
|
|
|
7
7
|
initialize,
|
|
8
8
|
setChainId,
|
|
9
9
|
} from './state';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
UserJourneyActionParams,
|
|
12
|
+
UserJourneyErrorParams,
|
|
13
|
+
UserJourneyStartParams,
|
|
14
|
+
} from './types';
|
|
11
15
|
|
|
12
16
|
const action = ({ action, message, payload }: UserJourneyActionParams) => {
|
|
13
17
|
const walletAddress = getWalletAddress();
|
|
@@ -72,7 +76,7 @@ const error = ({ action, error, message, payload }: UserJourneyErrorParams) => {
|
|
|
72
76
|
);
|
|
73
77
|
};
|
|
74
78
|
|
|
75
|
-
const start = ({ address, chainId }:
|
|
79
|
+
const start = ({ address, chainId }: UserJourneyStartParams) => {
|
|
76
80
|
if (!isLoggerInitialized()) {
|
|
77
81
|
console.warn('Logger not initialized');
|
|
78
82
|
return;
|