@metamask/logging-controller
Advanced tools
Comparing version 2.0.3 to 3.0.0
@@ -10,2 +10,15 @@ # Changelog | ||
## [3.0.0] | ||
### Added | ||
- **BREAKING**: Add ESM build ([#3998](https://github.com/MetaMask/core/pull/3998)) | ||
- It's no longer possible to import files from `./dist` directly. | ||
### Changed | ||
- **BREAKING:** Bump `@metamask/base-controller` to `^5.0.0` ([#4039](https://github.com/MetaMask/core/pull/4039)) | ||
- This version has a number of breaking changes. See the changelog for more. | ||
- Bump `@metamask/controller-utils` to `^9.0.0` ([#4039](https://github.com/MetaMask/core/pull/4039)) | ||
## [2.0.3] | ||
@@ -72,3 +85,4 @@ | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@2.0.3...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@3.0.0...HEAD | ||
[3.0.0]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@2.0.3...@metamask/logging-controller@3.0.0 | ||
[2.0.3]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@2.0.2...@metamask/logging-controller@2.0.3 | ||
@@ -75,0 +89,0 @@ [2.0.2]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@2.0.1...@metamask/logging-controller@2.0.2 |
@@ -1,19 +0,20 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./LoggingController"), exports); | ||
__exportStar(require("./logTypes"), exports); | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkLZJQW27Yjs = require('./chunk-LZJQW27Y.js'); | ||
require('./chunk-PMCRFQY3.js'); | ||
var _chunkPUIX5TCGjs = require('./chunk-PUIX5TCG.js'); | ||
require('./chunk-JUURNM6C.js'); | ||
var _chunkB6ES7RHKjs = require('./chunk-B6ES7RHK.js'); | ||
require('./chunk-UJIPPGP6.js'); | ||
exports.LogType = _chunkB6ES7RHKjs.LogType; exports.LoggingController = _chunkLZJQW27Yjs.LoggingController; exports.SigningMethod = _chunkPUIX5TCGjs.SigningMethod; exports.SigningStage = _chunkPUIX5TCGjs.SigningStage; | ||
//# sourceMappingURL=index.js.map |
@@ -1,72 +0,8 @@ | ||
"use strict"; | ||
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { | ||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); | ||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); | ||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); | ||
}; | ||
var _LoggingController_instances, _LoggingController_generateId; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LoggingController = void 0; | ||
const base_controller_1 = require("@metamask/base-controller"); | ||
const uuid_1 = require("uuid"); | ||
const name = 'LoggingController'; | ||
const metadata = { | ||
logs: { persist: true, anonymous: false }, | ||
}; | ||
const defaultState = { | ||
logs: {}, | ||
}; | ||
/** | ||
* Controller that manages a list of logs for signature requests. | ||
*/ | ||
class LoggingController extends base_controller_1.BaseController { | ||
/** | ||
* Creates a LoggingController instance. | ||
* | ||
* @param options - Constructor options | ||
* @param options.messenger - An instance of the ControllerMessenger | ||
* @param options.state - Initial state to set on this controller. | ||
*/ | ||
constructor({ messenger, state, }) { | ||
super({ | ||
name, | ||
metadata, | ||
messenger, | ||
state: Object.assign(Object.assign({}, defaultState), state), | ||
}); | ||
_LoggingController_instances.add(this); | ||
this.messagingSystem.registerActionHandler(`${name}:add`, (log) => this.add(log)); | ||
} | ||
/** | ||
* Add log to the state. | ||
* | ||
* @param log - Log to add to the controller | ||
*/ | ||
add(log) { | ||
const newLog = { | ||
id: __classPrivateFieldGet(this, _LoggingController_instances, "m", _LoggingController_generateId).call(this), | ||
timestamp: Date.now(), | ||
log, | ||
}; | ||
this.update((state) => { | ||
state.logs[newLog.id] = newLog; | ||
}); | ||
} | ||
/** | ||
* Removes all log entries. | ||
*/ | ||
clear() { | ||
this.update((state) => { | ||
state.logs = {}; | ||
}); | ||
} | ||
} | ||
exports.LoggingController = LoggingController; | ||
_LoggingController_instances = new WeakSet(), _LoggingController_generateId = function _LoggingController_generateId() { | ||
let id = (0, uuid_1.v1)(); | ||
while (id in this.state.logs) { | ||
id = (0, uuid_1.v1)(); | ||
} | ||
return id; | ||
}; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkLZJQW27Yjs = require('./chunk-LZJQW27Y.js'); | ||
require('./chunk-UJIPPGP6.js'); | ||
exports.LoggingController = _chunkLZJQW27Yjs.LoggingController; | ||
//# sourceMappingURL=LoggingController.js.map |
@@ -1,24 +0,10 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SigningStage = exports.SigningMethod = void 0; | ||
/** | ||
* An enum of the signing method types that we are interested in logging. | ||
*/ | ||
var SigningMethod; | ||
(function (SigningMethod) { | ||
SigningMethod["EthSign"] = "eth_sign"; | ||
SigningMethod["PersonalSign"] = "personal_sign"; | ||
SigningMethod["EthSignTypedData"] = "eth_signTypedData"; | ||
SigningMethod["EthSignTypedDataV3"] = "eth_signTypedData_v3"; | ||
SigningMethod["EthSignTypedDataV4"] = "eth_signTypedData_v4"; | ||
})(SigningMethod = exports.SigningMethod || (exports.SigningMethod = {})); | ||
/** | ||
* An enum of the various stages of the signing request | ||
*/ | ||
var SigningStage; | ||
(function (SigningStage) { | ||
SigningStage["Proposed"] = "proposed"; | ||
SigningStage["Rejected"] = "rejected"; | ||
SigningStage["Signed"] = "signed"; | ||
})(SigningStage = exports.SigningStage || (exports.SigningStage = {})); | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkPUIX5TCGjs = require('../chunk-PUIX5TCG.js'); | ||
require('../chunk-UJIPPGP6.js'); | ||
exports.SigningMethod = _chunkPUIX5TCGjs.SigningMethod; exports.SigningStage = _chunkPUIX5TCGjs.SigningStage; | ||
//# sourceMappingURL=EthSignLog.js.map |
@@ -1,3 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
"use strict";require('../chunk-JUURNM6C.js'); | ||
//# sourceMappingURL=GenericLog.js.map |
@@ -1,23 +0,16 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Export all other types from these files for usage by clients | ||
*/ | ||
__exportStar(require("./EthSignLog"), exports); | ||
__exportStar(require("./GenericLog"), exports); | ||
__exportStar(require("./LogType"), exports); | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-PMCRFQY3.js'); | ||
var _chunkPUIX5TCGjs = require('../chunk-PUIX5TCG.js'); | ||
require('../chunk-JUURNM6C.js'); | ||
var _chunkB6ES7RHKjs = require('../chunk-B6ES7RHK.js'); | ||
require('../chunk-UJIPPGP6.js'); | ||
exports.LogType = _chunkB6ES7RHKjs.LogType; exports.SigningMethod = _chunkPUIX5TCGjs.SigningMethod; exports.SigningStage = _chunkPUIX5TCGjs.SigningStage; | ||
//# sourceMappingURL=index.js.map |
@@ -1,14 +0,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LogType = void 0; | ||
/** | ||
* An enum representing the allowed types of log messages supported by this | ||
* controller. When adding new types of special cased log types, make sure to | ||
* extend this enum with the new type name. | ||
*/ | ||
var LogType; | ||
(function (LogType) { | ||
LogType["GenericLog"] = "GenericLog"; | ||
LogType["EthSignLog"] = "EthSignLog"; | ||
})(LogType = exports.LogType || (exports.LogType = {})); | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkB6ES7RHKjs = require('../chunk-B6ES7RHK.js'); | ||
require('../chunk-UJIPPGP6.js'); | ||
exports.LogType = _chunkB6ES7RHKjs.LogType; | ||
//# sourceMappingURL=LogType.js.map |
{ | ||
"name": "@metamask/logging-controller", | ||
"version": "2.0.3", | ||
"version": "3.0.0", | ||
"description": "Manages logging data to assist users and support staff", | ||
@@ -18,2 +18,11 @@ "keywords": [ | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js", | ||
"types": "./dist/types/index.d.ts" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"main": "./dist/index.js", | ||
@@ -25,2 +34,3 @@ "types": "./dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsup --config ../../tsup.config.ts --tsconfig ./tsconfig.build.json --clean", | ||
"build:docs": "typedoc", | ||
@@ -36,4 +46,4 @@ "changelog:update": "../../scripts/update-changelog.sh @metamask/logging-controller", | ||
"dependencies": { | ||
"@metamask/base-controller": "^4.1.1", | ||
"@metamask/controller-utils": "^8.0.4", | ||
"@metamask/base-controller": "^5.0.0", | ||
"@metamask/controller-utils": "^9.0.0", | ||
"uuid": "^8.3.2" | ||
@@ -40,0 +50,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
85669
65
461
1
+ Added@metamask/base-controller@5.0.2(transitive)
+ Added@metamask/controller-utils@9.1.0(transitive)
+ Added@spruceid/siwe-parser@2.1.0(transitive)
+ Added@types/bn.js@5.1.5(transitive)
+ Added@types/node@20.14.2(transitive)
+ Addedundici-types@5.26.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedvalid-url@1.0.9(transitive)
- Removed@metamask/base-controller@4.1.1(transitive)
- Removed@metamask/controller-utils@8.0.4(transitive)
- Removed@spruceid/siwe-parser@1.1.3(transitive)