Skip to content

Commit

Permalink
Update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Oct 15, 2024
1 parent 8a08a29 commit 9ae0379
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# bedrock-account ChangeLog

## 9.1.0 - 2024-10-dd

### Changed
- Update dependencies.

## 9.0.0 - 2023-01-24

### Changed
Expand Down
6 changes: 3 additions & 3 deletions lib/RecordTransaction.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
9 changes: 4 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
8 changes: 4 additions & 4 deletions test/mocha/helpers.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9ae0379

Please sign in to comment.