@metamask-previews/logging-controller 8.0.2-preview-7aad920a3 → 8.0.2-preview-0dfe3b334
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/LoggingController-method-action-types.cjs.map +1 -1
- package/dist/LoggingController-method-action-types.d.cts.map +1 -1
- package/dist/LoggingController-method-action-types.d.mts.map +1 -1
- package/dist/LoggingController-method-action-types.mjs.map +1 -1
- package/dist/LoggingController.cjs.map +1 -1
- package/dist/LoggingController.d.cts.map +1 -1
- package/dist/LoggingController.d.mts.map +1 -1
- package/dist/LoggingController.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/logTypes/EthSignLog.cjs.map +1 -1
- package/dist/logTypes/EthSignLog.d.cts.map +1 -1
- package/dist/logTypes/EthSignLog.d.mts.map +1 -1
- package/dist/logTypes/EthSignLog.mjs.map +1 -1
- package/dist/logTypes/GenericLog.cjs.map +1 -1
- package/dist/logTypes/GenericLog.d.cts.map +1 -1
- package/dist/logTypes/GenericLog.d.mts.map +1 -1
- package/dist/logTypes/GenericLog.mjs.map +1 -1
- package/dist/logTypes/index.cjs.map +1 -1
- package/dist/logTypes/index.d.cts.map +1 -1
- package/dist/logTypes/index.d.mts.map +1 -1
- package/dist/logTypes/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingController-method-action-types.cjs","sourceRoot":"","sources":["../src/LoggingController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { LoggingController } from './LoggingController';\n\n/**\n * Add log to the state.\n *\n * @param log - Log to add to the controller\n */\nexport type LoggingControllerAddAction = {\n type: `LoggingController:add`;\n handler: LoggingController['add'];\n};\n\n/**\n * Removes all log entries.\n */\nexport type LoggingControllerClearAction = {\n type: `LoggingController:clear`;\n handler: LoggingController['clear'];\n};\n\n/**\n * Union of all LoggingController action types.\n */\nexport type LoggingControllerMethodActions =\n | LoggingControllerAddAction\n | LoggingControllerClearAction;\n"]}
|
|
1
|
+
{"version":3,"file":"LoggingController-method-action-types.cjs","sourceRoot":"","sources":["../src/LoggingController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { LoggingController } from './LoggingController.js';\n\n/**\n * Add log to the state.\n *\n * @param log - Log to add to the controller\n */\nexport type LoggingControllerAddAction = {\n type: `LoggingController:add`;\n handler: LoggingController['add'];\n};\n\n/**\n * Removes all log entries.\n */\nexport type LoggingControllerClearAction = {\n type: `LoggingController:clear`;\n handler: LoggingController['clear'];\n};\n\n/**\n * Union of all LoggingController action types.\n */\nexport type LoggingControllerMethodActions =\n | LoggingControllerAddAction\n | LoggingControllerClearAction;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingController-method-action-types.d.cts","sourceRoot":"","sources":["../src/LoggingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"LoggingController-method-action-types.d.cts","sourceRoot":"","sources":["../src/LoggingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gCAA+B;AAEhE;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,8BAA8B,GACtC,0BAA0B,GAC1B,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingController-method-action-types.d.mts","sourceRoot":"","sources":["../src/LoggingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"LoggingController-method-action-types.d.mts","sourceRoot":"","sources":["../src/LoggingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gCAA+B;AAEhE;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,8BAA8B,GACtC,0BAA0B,GAC1B,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingController-method-action-types.mjs","sourceRoot":"","sources":["../src/LoggingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { LoggingController } from './LoggingController';\n\n/**\n * Add log to the state.\n *\n * @param log - Log to add to the controller\n */\nexport type LoggingControllerAddAction = {\n type: `LoggingController:add`;\n handler: LoggingController['add'];\n};\n\n/**\n * Removes all log entries.\n */\nexport type LoggingControllerClearAction = {\n type: `LoggingController:clear`;\n handler: LoggingController['clear'];\n};\n\n/**\n * Union of all LoggingController action types.\n */\nexport type LoggingControllerMethodActions =\n | LoggingControllerAddAction\n | LoggingControllerClearAction;\n"]}
|
|
1
|
+
{"version":3,"file":"LoggingController-method-action-types.mjs","sourceRoot":"","sources":["../src/LoggingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { LoggingController } from './LoggingController.js';\n\n/**\n * Add log to the state.\n *\n * @param log - Log to add to the controller\n */\nexport type LoggingControllerAddAction = {\n type: `LoggingController:add`;\n handler: LoggingController['add'];\n};\n\n/**\n * Removes all log entries.\n */\nexport type LoggingControllerClearAction = {\n type: `LoggingController:clear`;\n handler: LoggingController['clear'];\n};\n\n/**\n * Union of all LoggingController action types.\n */\nexport type LoggingControllerMethodActions =\n | LoggingControllerAddAction\n | LoggingControllerClearAction;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingController.cjs","sourceRoot":"","sources":["../src/LoggingController.ts"],"names":[],"mappings":";;;;;;;;;AAKA,+DAA2D;AAE3D,+BAAoC;AA2BpC,MAAM,IAAI,GAAG,mBAAmB,CAAC;AAEjC,MAAM,yBAAyB,GAAG,CAAC,KAAK,EAAE,OAAO,CAAU,CAAC;AAwB5D,MAAM,QAAQ,GAA0C;IACtD,IAAI,EAAE;QACJ,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,KAAK;QAC7B,QAAQ,EAAE,KAAK;KAChB;CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,IAAI,EAAE,EAAE;CACT,CAAC;AAEF;;GAEG;AACH,MAAa,iBAAkB,SAAQ,gCAItC;IACC;;;;;;OAMG;IACH,YAAY,EACV,SAAS,EACT,KAAK,GAIN;QACC,KAAK,CAAC;YACJ,IAAI;YACJ,QAAQ;YACR,SAAS;YACT,KAAK,EAAE;gBACL,GAAG,YAAY;gBACf,GAAG,KAAK;aACT;SACF,CAAC,CAAC;;QAEH,IAAI,CAAC,SAAS,CAAC,4BAA4B,CACzC,IAAI,EACJ,yBAAyB,CAC1B,CAAC;IACJ,CAAC;IAmBD;;;;OAIG;IACH,GAAG,CAAC,GAAQ;QACV,MAAM,MAAM,GAAa;YACvB,EAAE,EAAE,uBAAA,IAAI,mEAAY,MAAhB,IAAI,CAAc;YACtB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,GAAG;SACJ,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7ED,8CA6EC;;IAhCG,IAAI,EAAE,GAAG,IAAA,SAAM,GAAE,CAAC;IAClB,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,EAAE,GAAG,IAAA,SAAM,GAAE,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport { v1 as random } from 'uuid';\n\nimport type { LoggingControllerMethodActions } from './LoggingController-method-action-types';\nimport type { Log } from './logTypes';\n\n/**\n * LogEntry is the entry that will be added to the logging controller state.\n * It consists of a entry key that must be on of the Log union types, and an\n * additional id and timestamp.\n */\nexport type LogEntry = {\n id: string;\n timestamp: number;\n log: Log;\n};\n\n/**\n * Logging controller state\n *\n * @property logs - An object of logs indexed by their ids\n */\nexport type LoggingControllerState = {\n logs: {\n [id: string]: LogEntry;\n };\n};\n\nconst name = 'LoggingController';\n\nconst MESSENGER_EXPOSED_METHODS = ['add', 'clear'] as const;\n\nexport type LoggingControllerGetStateAction = ControllerGetStateAction<\n typeof name,\n LoggingControllerState\n>;\n\nexport type LoggingControllerActions =\n | LoggingControllerGetStateAction\n | LoggingControllerMethodActions;\n\nexport type LoggingControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof name,\n LoggingControllerState\n>;\n\nexport type LoggingControllerEvents = LoggingControllerStateChangeEvent;\n\nexport type LoggingControllerMessenger = Messenger<\n typeof name,\n LoggingControllerActions,\n LoggingControllerEvents\n>;\n\nconst metadata: StateMetadata<LoggingControllerState> = {\n logs: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: false,\n },\n};\n\nconst defaultState = {\n logs: {},\n};\n\n/**\n * Controller that manages a list of logs for signature requests.\n */\nexport class LoggingController extends BaseController<\n typeof name,\n LoggingControllerState,\n LoggingControllerMessenger\n> {\n /**\n * Creates a LoggingController instance.\n *\n * @param options - Constructor options\n * @param options.messenger - An instance of the Messenger\n * @param options.state - Initial state to set on this controller.\n */\n constructor({\n messenger,\n state,\n }: {\n messenger: LoggingControllerMessenger;\n state?: Partial<LoggingControllerState>;\n }) {\n super({\n name,\n metadata,\n messenger,\n state: {\n ...defaultState,\n ...state,\n },\n });\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Method to generate a randomId and ensures no collision with existing ids.\n *\n * We may want to end up using a hashing mechanism to make ids deterministic\n * by the *data* passed in, and then make each key an array of logs that\n * match that id.\n *\n * @returns unique id\n */\n #generateId(): string {\n let id = random();\n while (id in this.state.logs) {\n id = random();\n }\n return id;\n }\n\n /**\n * Add log to the state.\n *\n * @param log - Log to add to the controller\n */\n add(log: Log) {\n const newLog: LogEntry = {\n id: this.#generateId(),\n timestamp: Date.now(),\n log,\n };\n\n this.update((state) => {\n state.logs[newLog.id] = newLog;\n });\n }\n\n /**\n * Removes all log entries.\n */\n clear() {\n this.update((state) => {\n state.logs = {};\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LoggingController.cjs","sourceRoot":"","sources":["../src/LoggingController.ts"],"names":[],"mappings":";;;;;;;;;AAKA,+DAA2D;AAE3D,+BAAoC;AA2BpC,MAAM,IAAI,GAAG,mBAAmB,CAAC;AAEjC,MAAM,yBAAyB,GAAG,CAAC,KAAK,EAAE,OAAO,CAAU,CAAC;AAwB5D,MAAM,QAAQ,GAA0C;IACtD,IAAI,EAAE;QACJ,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,KAAK;QAC7B,QAAQ,EAAE,KAAK;KAChB;CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,IAAI,EAAE,EAAE;CACT,CAAC;AAEF;;GAEG;AACH,MAAa,iBAAkB,SAAQ,gCAItC;IACC;;;;;;OAMG;IACH,YAAY,EACV,SAAS,EACT,KAAK,GAIN;QACC,KAAK,CAAC;YACJ,IAAI;YACJ,QAAQ;YACR,SAAS;YACT,KAAK,EAAE;gBACL,GAAG,YAAY;gBACf,GAAG,KAAK;aACT;SACF,CAAC,CAAC;;QAEH,IAAI,CAAC,SAAS,CAAC,4BAA4B,CACzC,IAAI,EACJ,yBAAyB,CAC1B,CAAC;IACJ,CAAC;IAmBD;;;;OAIG;IACH,GAAG,CAAC,GAAQ;QACV,MAAM,MAAM,GAAa;YACvB,EAAE,EAAE,uBAAA,IAAI,mEAAY,MAAhB,IAAI,CAAc;YACtB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,GAAG;SACJ,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7ED,8CA6EC;;IAhCG,IAAI,EAAE,GAAG,IAAA,SAAM,GAAE,CAAC;IAClB,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,EAAE,GAAG,IAAA,SAAM,GAAE,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport { v1 as random } from 'uuid';\n\nimport type { LoggingControllerMethodActions } from './LoggingController-method-action-types.js';\nimport type { Log } from './logTypes/index.js';\n\n/**\n * LogEntry is the entry that will be added to the logging controller state.\n * It consists of a entry key that must be on of the Log union types, and an\n * additional id and timestamp.\n */\nexport type LogEntry = {\n id: string;\n timestamp: number;\n log: Log;\n};\n\n/**\n * Logging controller state\n *\n * @property logs - An object of logs indexed by their ids\n */\nexport type LoggingControllerState = {\n logs: {\n [id: string]: LogEntry;\n };\n};\n\nconst name = 'LoggingController';\n\nconst MESSENGER_EXPOSED_METHODS = ['add', 'clear'] as const;\n\nexport type LoggingControllerGetStateAction = ControllerGetStateAction<\n typeof name,\n LoggingControllerState\n>;\n\nexport type LoggingControllerActions =\n | LoggingControllerGetStateAction\n | LoggingControllerMethodActions;\n\nexport type LoggingControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof name,\n LoggingControllerState\n>;\n\nexport type LoggingControllerEvents = LoggingControllerStateChangeEvent;\n\nexport type LoggingControllerMessenger = Messenger<\n typeof name,\n LoggingControllerActions,\n LoggingControllerEvents\n>;\n\nconst metadata: StateMetadata<LoggingControllerState> = {\n logs: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: false,\n },\n};\n\nconst defaultState = {\n logs: {},\n};\n\n/**\n * Controller that manages a list of logs for signature requests.\n */\nexport class LoggingController extends BaseController<\n typeof name,\n LoggingControllerState,\n LoggingControllerMessenger\n> {\n /**\n * Creates a LoggingController instance.\n *\n * @param options - Constructor options\n * @param options.messenger - An instance of the Messenger\n * @param options.state - Initial state to set on this controller.\n */\n constructor({\n messenger,\n state,\n }: {\n messenger: LoggingControllerMessenger;\n state?: Partial<LoggingControllerState>;\n }) {\n super({\n name,\n metadata,\n messenger,\n state: {\n ...defaultState,\n ...state,\n },\n });\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Method to generate a randomId and ensures no collision with existing ids.\n *\n * We may want to end up using a hashing mechanism to make ids deterministic\n * by the *data* passed in, and then make each key an array of logs that\n * match that id.\n *\n * @returns unique id\n */\n #generateId(): string {\n let id = random();\n while (id in this.state.logs) {\n id = random();\n }\n return id;\n }\n\n /**\n * Add log to the state.\n *\n * @param log - Log to add to the controller\n */\n add(log: Log) {\n const newLog: LogEntry = {\n id: this.#generateId(),\n timestamp: Date.now(),\n log,\n };\n\n this.update((state) => {\n state.logs[newLog.id] = newLog;\n });\n }\n\n /**\n * Removes all log entries.\n */\n clear() {\n this.update((state) => {\n state.logs = {};\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingController.d.cts","sourceRoot":"","sources":["../src/LoggingController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAGrD,OAAO,KAAK,EAAE,8BAA8B,EAAE,
|
|
1
|
+
{"version":3,"file":"LoggingController.d.cts","sourceRoot":"","sources":["../src/LoggingController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,k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1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingController.d.mts","sourceRoot":"","sources":["../src/LoggingController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAGrD,OAAO,KAAK,EAAE,8BAA8B,EAAE,
|
|
1
|
+
{"version":3,"file":"LoggingController.d.mts","sourceRoot":"","sources":["../src/LoggingController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAGrD,OAAO,KAAK,EAAE,8BAA8B,EAAE,oDAAmD;AACjG,OAAO,KAAK,EAAE,GAAG,EAAE,6BAA4B;AAE/C;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,GAAG,CAAC;CACV,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE;QACJ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC;KACxB,CAAC;CACH,CAAC;AAEF,QAAA,MAAM,IAAI,sBAAsB,CAAC;AAIjC,MAAM,MAAM,+BAA+B,GAAG,wBAAwB,CACpE,OAAO,IAAI,EACX,sBAAsB,CACvB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC,+BAA+B,GAC/B,8BAA8B,CAAC;AAEnC,MAAM,MAAM,iCAAiC,GAAG,0BAA0B,CACxE,OAAO,IAAI,EACX,sBAAsB,CACvB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,iCAAiC,CAAC;AAExE,MAAM,MAAM,0BAA0B,GAAG,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,CAAC;IACJ,CAAC;IAmBD;;;;OAIG;IACH,GAAG,CAAC,GAAQ;QACV,MAAM,MAAM,GAAa;YACvB,EAAE,EAAE,uBAAA,IAAI,mEAAY,MAAhB,IAAI,CAAc;YACtB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,GAAG;SACJ,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;;IAhCG,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,EAAE,GAAG,MAAM,EAAE,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport { v1 as random } from 'uuid';\n\nimport type { LoggingControllerMethodActions } from './LoggingController-method-action-types';\nimport type { Log } from './logTypes';\n\n/**\n * LogEntry is the entry that will be added to the logging controller state.\n * It consists of a entry key that must be on of the Log union types, and an\n * additional id and timestamp.\n */\nexport type LogEntry = {\n id: string;\n timestamp: number;\n log: Log;\n};\n\n/**\n * Logging controller state\n *\n * @property logs - An object of logs indexed by their ids\n */\nexport type LoggingControllerState = {\n logs: {\n [id: string]: LogEntry;\n };\n};\n\nconst name = 'LoggingController';\n\nconst MESSENGER_EXPOSED_METHODS = ['add', 'clear'] as const;\n\nexport type LoggingControllerGetStateAction = ControllerGetStateAction<\n typeof name,\n LoggingControllerState\n>;\n\nexport type LoggingControllerActions =\n | LoggingControllerGetStateAction\n | LoggingControllerMethodActions;\n\nexport type LoggingControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof name,\n LoggingControllerState\n>;\n\nexport type LoggingControllerEvents = LoggingControllerStateChangeEvent;\n\nexport type LoggingControllerMessenger = Messenger<\n typeof name,\n LoggingControllerActions,\n LoggingControllerEvents\n>;\n\nconst metadata: StateMetadata<LoggingControllerState> = {\n logs: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: false,\n },\n};\n\nconst defaultState = {\n logs: {},\n};\n\n/**\n * Controller that manages a list of logs for signature requests.\n */\nexport class LoggingController extends BaseController<\n typeof name,\n LoggingControllerState,\n LoggingControllerMessenger\n> {\n /**\n * Creates a LoggingController instance.\n *\n * @param options - Constructor options\n * @param options.messenger - An instance of the Messenger\n * @param options.state - Initial state to set on this controller.\n */\n constructor({\n messenger,\n state,\n }: {\n messenger: LoggingControllerMessenger;\n state?: Partial<LoggingControllerState>;\n }) {\n super({\n name,\n metadata,\n messenger,\n state: {\n ...defaultState,\n ...state,\n },\n });\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Method to generate a randomId and ensures no collision with existing ids.\n *\n * We may want to end up using a hashing mechanism to make ids deterministic\n * by the *data* passed in, and then make each key an array of logs that\n * match that id.\n *\n * @returns unique id\n */\n #generateId(): string {\n let id = random();\n while (id in this.state.logs) {\n id = random();\n }\n return id;\n }\n\n /**\n * Add log to the state.\n *\n * @param log - Log to add to the controller\n */\n add(log: Log) {\n const newLog: LogEntry = {\n id: this.#generateId(),\n timestamp: Date.now(),\n log,\n };\n\n this.update((state) => {\n state.logs[newLog.id] = newLog;\n });\n }\n\n /**\n * Removes all log entries.\n */\n clear() {\n this.update((state) => {\n state.logs = {};\n });\n }\n}\n"]}
|
|
1
|
+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EAAE,EAAE;YACpB,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;;IAhCG,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,EAAE,GAAG,MAAM,EAAE,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport { v1 as random } from 'uuid';\n\nimport type { LoggingControllerMethodActions } from './LoggingController-method-action-types.js';\nimport type { Log } from './logTypes/index.js';\n\n/**\n * LogEntry is the entry that will be added to the logging controller state.\n * It consists of a entry key that must be on of the Log union types, and an\n * additional id and timestamp.\n */\nexport type LogEntry = {\n id: string;\n timestamp: number;\n log: Log;\n};\n\n/**\n * Logging controller state\n *\n * @property logs - An object of logs indexed by their ids\n */\nexport type LoggingControllerState = {\n logs: {\n [id: string]: LogEntry;\n };\n};\n\nconst name = 'LoggingController';\n\nconst MESSENGER_EXPOSED_METHODS = ['add', 'clear'] as const;\n\nexport type LoggingControllerGetStateAction = ControllerGetStateAction<\n typeof name,\n LoggingControllerState\n>;\n\nexport type LoggingControllerActions =\n | LoggingControllerGetStateAction\n | LoggingControllerMethodActions;\n\nexport type LoggingControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof name,\n LoggingControllerState\n>;\n\nexport type LoggingControllerEvents = LoggingControllerStateChangeEvent;\n\nexport type LoggingControllerMessenger = Messenger<\n typeof name,\n LoggingControllerActions,\n LoggingControllerEvents\n>;\n\nconst metadata: StateMetadata<LoggingControllerState> = {\n logs: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: false,\n },\n};\n\nconst defaultState = {\n logs: {},\n};\n\n/**\n * Controller that manages a list of logs for signature requests.\n */\nexport class LoggingController extends BaseController<\n typeof name,\n LoggingControllerState,\n LoggingControllerMessenger\n> {\n /**\n * Creates a LoggingController instance.\n *\n * @param options - Constructor options\n * @param options.messenger - An instance of the Messenger\n * @param options.state - Initial state to set on this controller.\n */\n constructor({\n messenger,\n state,\n }: {\n messenger: LoggingControllerMessenger;\n state?: Partial<LoggingControllerState>;\n }) {\n super({\n name,\n metadata,\n messenger,\n state: {\n ...defaultState,\n ...state,\n },\n });\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Method to generate a randomId and ensures no collision with existing ids.\n *\n * We may want to end up using a hashing mechanism to make ids deterministic\n * by the *data* passed in, and then make each key an array of logs that\n * match that id.\n *\n * @returns unique id\n */\n #generateId(): string {\n let id = random();\n while (id in this.state.logs) {\n id = random();\n }\n return id;\n }\n\n /**\n * Add log to the state.\n *\n * @param log - Log to add to the controller\n */\n add(log: Log) {\n const newLog: LogEntry = {\n id: this.#generateId(),\n timestamp: Date.now(),\n log,\n };\n\n this.update((state) => {\n state.logs[newLog.id] = newLog;\n });\n }\n\n /**\n * Removes all log entries.\n */\n clear() {\n this.update((state) => {\n state.logs = {};\n });\n }\n}\n"]}
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AAKvC,uDAAoC","sourcesContent":["export * from './LoggingController.js';\nexport type {\n LoggingControllerAddAction,\n LoggingControllerClearAction,\n} from './LoggingController-method-action-types.js';\nexport * from './logTypes/index.js';\n"]}
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wCAAuC;AACvC,YAAY,EACV,0BAA0B,EAC1B,4BAA4B,GAC7B,oDAAmD;AACpD,qCAAoC"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wCAAuC;AACvC,YAAY,EACV,0BAA0B,EAC1B,4BAA4B,GAC7B,oDAAmD;AACpD,qCAAoC"}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wCAAuC;AAKvC,qCAAoC","sourcesContent":["export * from './LoggingController.js';\nexport type {\n LoggingControllerAddAction,\n LoggingControllerClearAction,\n} from './LoggingController-method-action-types.js';\nexport * from './logTypes/index.js';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthSignLog.cjs","sourceRoot":"","sources":["../../src/logTypes/EthSignLog.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,+CAA8B,CAAA;IAC9B,uDAAsC,CAAA;IACtC,4DAA2C,CAAA;IAC3C,4DAA2C,CAAA;AAC7C,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB;AAED;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;AACnB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB","sourcesContent":["import type { LogType } from './LogType';\n\n/**\n * An enum of the signing method types that we are interested in logging.\n */\nexport enum SigningMethod {\n PersonalSign = 'personal_sign',\n EthSignTypedData = 'eth_signTypedData',\n EthSignTypedDataV3 = 'eth_signTypedData_v3',\n EthSignTypedDataV4 = 'eth_signTypedData_v4',\n}\n\n/**\n * An enum of the various stages of the signing request\n */\nexport enum SigningStage {\n Proposed = 'proposed',\n Rejected = 'rejected',\n Signed = 'signed',\n}\n\n/**\n * First special case of logging scenarios involves signing requests. In this\n * case the data provided must include the method for the signature request as\n * well as the signingData. This is intended to be used to troubleshoot and\n * investigate FLI at the user's request.\n */\nexport type EthSignLog = {\n type: LogType.EthSignLog;\n data: {\n signingMethod: SigningMethod;\n stage: SigningStage;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n signingData?: any;\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"EthSignLog.cjs","sourceRoot":"","sources":["../../src/logTypes/EthSignLog.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,+CAA8B,CAAA;IAC9B,uDAAsC,CAAA;IACtC,4DAA2C,CAAA;IAC3C,4DAA2C,CAAA;AAC7C,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB;AAED;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;AACnB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB","sourcesContent":["import type { LogType } from './LogType.js';\n\n/**\n * An enum of the signing method types that we are interested in logging.\n */\nexport enum SigningMethod {\n PersonalSign = 'personal_sign',\n EthSignTypedData = 'eth_signTypedData',\n EthSignTypedDataV3 = 'eth_signTypedData_v3',\n EthSignTypedDataV4 = 'eth_signTypedData_v4',\n}\n\n/**\n * An enum of the various stages of the signing request\n */\nexport enum SigningStage {\n Proposed = 'proposed',\n Rejected = 'rejected',\n Signed = 'signed',\n}\n\n/**\n * First special case of logging scenarios involves signing requests. In this\n * case the data provided must include the method for the signature request as\n * well as the signingData. This is intended to be used to troubleshoot and\n * investigate FLI at the user's request.\n */\nexport type EthSignLog = {\n type: LogType.EthSignLog;\n data: {\n signingMethod: SigningMethod;\n stage: SigningStage;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n signingData?: any;\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthSignLog.d.cts","sourceRoot":"","sources":["../../src/logTypes/EthSignLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"EthSignLog.d.cts","sourceRoot":"","sources":["../../src/logTypes/EthSignLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAqB;AAE5C;;GAEG;AACH,oBAAY,aAAa;IACvB,YAAY,kBAAkB;IAC9B,gBAAgB,sBAAsB;IACtC,kBAAkB,yBAAyB;IAC3C,kBAAkB,yBAAyB;CAC5C;AAED;;GAEG;AACH,oBAAY,YAAY;IACtB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;IACzB,IAAI,EAAE;QACJ,aAAa,EAAE,aAAa,CAAC;QAC7B,KAAK,EAAE,YAAY,CAAC;QAGpB,WAAW,CAAC,EAAE,GAAG,CAAC;KACnB,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthSignLog.d.mts","sourceRoot":"","sources":["../../src/logTypes/EthSignLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"EthSignLog.d.mts","sourceRoot":"","sources":["../../src/logTypes/EthSignLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAqB;AAE5C;;GAEG;AACH,oBAAY,aAAa;IACvB,YAAY,kBAAkB;IAC9B,gBAAgB,sBAAsB;IACtC,kBAAkB,yBAAyB;IAC3C,kBAAkB,yBAAyB;CAC5C;AAED;;GAEG;AACH,oBAAY,YAAY;IACtB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;IACzB,IAAI,EAAE;QACJ,aAAa,EAAE,aAAa,CAAC;QAC7B,KAAK,EAAE,YAAY,CAAC;QAGpB,WAAW,CAAC,EAAE,GAAG,CAAC;KACnB,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthSignLog.mjs","sourceRoot":"","sources":["../../src/logTypes/EthSignLog.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,+CAA8B,CAAA;IAC9B,uDAAsC,CAAA;IACtC,4DAA2C,CAAA;IAC3C,4DAA2C,CAAA;AAC7C,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;AACnB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB","sourcesContent":["import type { LogType } from './LogType';\n\n/**\n * An enum of the signing method types that we are interested in logging.\n */\nexport enum SigningMethod {\n PersonalSign = 'personal_sign',\n EthSignTypedData = 'eth_signTypedData',\n EthSignTypedDataV3 = 'eth_signTypedData_v3',\n EthSignTypedDataV4 = 'eth_signTypedData_v4',\n}\n\n/**\n * An enum of the various stages of the signing request\n */\nexport enum SigningStage {\n Proposed = 'proposed',\n Rejected = 'rejected',\n Signed = 'signed',\n}\n\n/**\n * First special case of logging scenarios involves signing requests. In this\n * case the data provided must include the method for the signature request as\n * well as the signingData. This is intended to be used to troubleshoot and\n * investigate FLI at the user's request.\n */\nexport type EthSignLog = {\n type: LogType.EthSignLog;\n data: {\n signingMethod: SigningMethod;\n stage: SigningStage;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n signingData?: any;\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"EthSignLog.mjs","sourceRoot":"","sources":["../../src/logTypes/EthSignLog.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,+CAA8B,CAAA;IAC9B,uDAAsC,CAAA;IACtC,4DAA2C,CAAA;IAC3C,4DAA2C,CAAA;AAC7C,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;AACnB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB","sourcesContent":["import type { LogType } from './LogType.js';\n\n/**\n * An enum of the signing method types that we are interested in logging.\n */\nexport enum SigningMethod {\n PersonalSign = 'personal_sign',\n EthSignTypedData = 'eth_signTypedData',\n EthSignTypedDataV3 = 'eth_signTypedData_v3',\n EthSignTypedDataV4 = 'eth_signTypedData_v4',\n}\n\n/**\n * An enum of the various stages of the signing request\n */\nexport enum SigningStage {\n Proposed = 'proposed',\n Rejected = 'rejected',\n Signed = 'signed',\n}\n\n/**\n * First special case of logging scenarios involves signing requests. In this\n * case the data provided must include the method for the signature request as\n * well as the signingData. This is intended to be used to troubleshoot and\n * investigate FLI at the user's request.\n */\nexport type EthSignLog = {\n type: LogType.EthSignLog;\n data: {\n signingMethod: SigningMethod;\n stage: SigningStage;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n signingData?: any;\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericLog.cjs","sourceRoot":"","sources":["../../src/logTypes/GenericLog.ts"],"names":[],"mappings":"","sourcesContent":["import type { LogType } from './LogType';\n\n/*\n * The logging controller can handle any kind of log statement that may benefit\n * users and MetaMask support agents helping those users. These logs are typed\n * as generic.\n */\nexport type GenericLog = {\n type: LogType.GenericLog;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GenericLog.cjs","sourceRoot":"","sources":["../../src/logTypes/GenericLog.ts"],"names":[],"mappings":"","sourcesContent":["import type { LogType } from './LogType.js';\n\n/*\n * The logging controller can handle any kind of log statement that may benefit\n * users and MetaMask support agents helping those users. These logs are typed\n * as generic.\n */\nexport type GenericLog = {\n type: LogType.GenericLog;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericLog.d.cts","sourceRoot":"","sources":["../../src/logTypes/GenericLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GenericLog.d.cts","sourceRoot":"","sources":["../../src/logTypes/GenericLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAqB;AAO5C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;IAGzB,IAAI,EAAE,GAAG,CAAC;CACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericLog.d.mts","sourceRoot":"","sources":["../../src/logTypes/GenericLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GenericLog.d.mts","sourceRoot":"","sources":["../../src/logTypes/GenericLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAqB;AAO5C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;IAGzB,IAAI,EAAE,GAAG,CAAC;CACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericLog.mjs","sourceRoot":"","sources":["../../src/logTypes/GenericLog.ts"],"names":[],"mappings":"","sourcesContent":["import type { LogType } from './LogType';\n\n/*\n * The logging controller can handle any kind of log statement that may benefit\n * users and MetaMask support agents helping those users. These logs are typed\n * as generic.\n */\nexport type GenericLog = {\n type: LogType.GenericLog;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GenericLog.mjs","sourceRoot":"","sources":["../../src/logTypes/GenericLog.ts"],"names":[],"mappings":"","sourcesContent":["import type { LogType } from './LogType.js';\n\n/*\n * The logging controller can handle any kind of log statement that may benefit\n * users and MetaMask support agents helping those users. These logs are typed\n * as generic.\n */\nexport type GenericLog = {\n type: LogType.GenericLog;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/logTypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAQA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/logTypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAQA;;GAEG;AACH,mDAAgC;AAEhC,gDAA6B","sourcesContent":["import type { EthSignLog } from './EthSignLog.js';\nimport type { GenericLog } from './GenericLog.js';\n\n/**\n * Union of all possible log data structures.\n */\nexport type Log = EthSignLog | GenericLog;\n\n/**\n * Export all other types from these files for usage by clients\n */\nexport * from './EthSignLog.js';\nexport type * from './GenericLog.js';\nexport * from './LogType.js';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/logTypes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/logTypes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAwB;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAwB;AAElD;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG,UAAU,CAAC;AAE1C;;GAEG;AACH,iCAAgC;AAChC,sCAAqC;AACrC,8BAA6B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/logTypes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/logTypes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAwB;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAwB;AAElD;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG,UAAU,CAAC;AAE1C;;GAEG;AACH,iCAAgC;AAChC,sCAAqC;AACrC,8BAA6B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/logTypes/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/logTypes/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,iCAAgC;AAEhC,8BAA6B","sourcesContent":["import type { EthSignLog } from './EthSignLog.js';\nimport type { GenericLog } from './GenericLog.js';\n\n/**\n * Union of all possible log data structures.\n */\nexport type Log = EthSignLog | GenericLog;\n\n/**\n * Export all other types from these files for usage by clients\n */\nexport * from './EthSignLog.js';\nexport type * from './GenericLog.js';\nexport * from './LogType.js';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/logging-controller",
|
|
3
|
-
"version": "8.0.2-preview-
|
|
3
|
+
"version": "8.0.2-preview-0dfe3b334",
|
|
4
4
|
"description": "Manages logging data to assist users and support staff",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/logging-controller",
|
|
47
47
|
"lint:tsconfigs": "tsx ../../scripts/lint-tsconfigs/lint-tsconfigs.mts",
|
|
48
48
|
"lint:tsconfigs:fix": "tsx ../../scripts/lint-tsconfigs/lint-tsconfigs.mts --fix",
|
|
49
|
-
"messenger-action-types:check": "tsx ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --check",
|
|
50
|
-
"messenger-action-types:generate": "tsx ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --generate",
|
|
49
|
+
"messenger-action-types:check": "tsx ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --esm --check",
|
|
50
|
+
"messenger-action-types:generate": "tsx ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --esm --generate",
|
|
51
51
|
"since-latest-release": "../../scripts/since-latest-release.sh",
|
|
52
52
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
|
|
53
53
|
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
|