diff --git a/CHANGELOG.md b/CHANGELOG.md index 987237b..5d729a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # bedrock-account ChangeLog +## 9.1.0 - 2024-10-dd + +### Changed +- Update dependencies. + ## 9.0.0 - 2023-01-24 ### Changed diff --git a/lib/RecordTransaction.js b/lib/RecordTransaction.js index ec3f8f7..87743a9 100644 --- a/lib/RecordTransaction.js +++ b/lib/RecordTransaction.js @@ -1,13 +1,13 @@ /*! - * Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. All rights reserved. */ -import {v4 as uuid} from 'uuid'; +import {randomUUID} from 'node:crypto'; export class RecordTransaction { constructor({ type, id, record, data, meta, expectedSequence, recordCollection } = {}) { - this.txn = {id: uuid(), type, recordId: id}; + this.txn = {id: randomUUID(), type, recordId: id}; this.id = id; this.record = record; this.data = data; diff --git a/lib/index.js b/lib/index.js index 7319160..0a6c27c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,10 +1,9 @@ /*! - * Copyright (c) 2018-2023 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2018-2024 Digital Bazaar, Inc. All rights reserved. */ import * as bedrock from '@bedrock/core'; import * as database from '@bedrock/mongodb'; import assert from 'assert-plus'; -import {klona} from 'klona'; import {logger} from './logger.js'; import {RecordCollection} from './RecordCollection.js'; @@ -45,7 +44,7 @@ export async function insert({account, meta} = {}) { meta = {...meta, status: 'active'}; // emit `insertEvent` with clone of `account` - account = klona(account); + account = structuredClone(account); const eventData = { account, meta, @@ -74,8 +73,8 @@ export async function insert({account, meta} = {}) { record = await ACCOUNT_STORAGE.insert({record}); // emit `postInsert` event with updated record data - eventData.account = klona(record.account); - eventData.meta = klona(record.meta); + eventData.account = structuredClone(record.account); + eventData.meta = structuredClone(record.meta); await bedrock.events.emit('bedrock-account.postInsert', eventData); return record; diff --git a/package.json b/package.json index e839084..f1cf944 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,7 @@ }, "homepage": "https://github.com/digitalbazaar/bedrock-account", "dependencies": { - "assert-plus": "^1.0.0", - "klona": "^2.0.5", - "uuid": "^9.0.0" + "assert-plus": "^1.0.0" }, "peerDependencies": { "@bedrock/core": "^6.0.0", @@ -40,8 +38,8 @@ }, "devDependencies": { "eslint": "^8.30.0", - "eslint-config-digitalbazaar": "^4.2.0", - "eslint-plugin-jsdoc": "^39.6.4", - "jsdoc-to-markdown": "^8.0.0" + "eslint-config-digitalbazaar": "^5.2.0", + "eslint-plugin-jsdoc": "^50.4.1", + "jsdoc-to-markdown": "^9.0.2" } } diff --git a/test/mocha/helpers.js b/test/mocha/helpers.js index 63245ce..1839bba 100644 --- a/test/mocha/helpers.js +++ b/test/mocha/helpers.js @@ -1,13 +1,13 @@ /*! - * Copyright (c) 2018-2023 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2018-2024 Digital Bazaar, Inc. All rights reserved. */ import * as brAccount from '@bedrock/account'; import * as database from '@bedrock/mongodb'; -import {v4 as uuid} from 'uuid'; +import {randomUUID} from 'node:crypto'; export function createAccount(email) { const newAccount = { - id: `urn:uuid:${uuid()}`, + id: `urn:uuid:${randomUUID()}`, email }; return newAccount; @@ -16,7 +16,7 @@ export function createAccount(email) { export async function createFakeTransaction({ accountId, type, committed, _pending, ops = [], skipAccountRecord = false } = {}) { - const txn = {id: uuid(), type, recordId: accountId}; + const txn = {id: randomUUID(), type, recordId: accountId}; if(committed) { txn.committed = true; } diff --git a/test/package.json b/test/package.json index b2fe534..134444f 100644 --- a/test/package.json +++ b/test/package.json @@ -17,8 +17,7 @@ "@bedrock/test": "^8.0.0", "@bedrock/validation": "^7.0.0", "c8": "^7.11.0", - "cross-env": "^7.0.2", - "uuid": "^8.3.2" + "cross-env": "^7.0.2" }, "c8": { "excludeNodeModules": false,