@bedrock/vc-delivery 6.6.0 → 6.6.2

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/lib/exchanges.js CHANGED
@@ -48,7 +48,7 @@ bedrock.events.on('bedrock-mongodb.ready', async () => {
48
48
  partialFilterExpression: {
49
49
  localWorkflowId: {$exists: true}
50
50
  },
51
- unique: true, background: false
51
+ unique: true
52
52
  }
53
53
  }, {
54
54
  // backwards compatibility: cover exchange queries by
@@ -57,7 +57,7 @@ bedrock.events.on('bedrock-mongodb.ready', async () => {
57
57
  // deployments use `localExchangerId`
58
58
  collection: COLLECTION_NAME,
59
59
  fields: {localExchangerId: 1, 'exchange.id': 1},
60
- options: {unique: true, background: false}
60
+ options: {unique: true}
61
61
  }, {
62
62
  // expire exchanges based on `expires` field
63
63
  collection: COLLECTION_NAME,
@@ -67,7 +67,6 @@ bedrock.events.on('bedrock-mongodb.ready', async () => {
67
67
  'meta.expires': {$exists: true}
68
68
  },
69
69
  unique: false,
70
- background: false,
71
70
  expireAfterSeconds: 0
72
71
  }
73
72
  }]);
@@ -273,7 +272,7 @@ export async function update({workflowId, exchange, explain = false} = {}) {
273
272
 
274
273
  try {
275
274
  const result = await collection.updateOne(query, update);
276
- if(result.result.n > 0) {
275
+ if(result.modifiedCount > 0) {
277
276
  // document modified: success
278
277
  return true;
279
278
  }
@@ -356,7 +355,7 @@ export async function complete({workflowId, exchange, explain = false} = {}) {
356
355
 
357
356
  try {
358
357
  const result = await collection.updateOne(query, update);
359
- if(result.result.n > 0) {
358
+ if(result.modifiedCount > 0) {
360
359
  // document modified: success
361
360
  return true;
362
361
  }
@@ -477,7 +476,7 @@ export async function setLastError({
477
476
 
478
477
  try {
479
478
  const result = await collection.updateOne(query, update);
480
- if(result.result.n > 0) {
479
+ if(result.modifiedCount > 0) {
481
480
  // document modified: success
482
481
  return true;
483
482
  }
@@ -549,7 +548,7 @@ async function _markExchangeInvalid({record}) {
549
548
  };
550
549
  const collection = database.collections[COLLECTION_NAME];
551
550
  const result = await collection.updateOne(query, update);
552
- if(result.result.n > 0) {
551
+ if(result.modifiedCount > 0) {
553
552
  // document modified: success
554
553
  return true;
555
554
  }
package/lib/verify.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2022-2024 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2022-2025 Digital Bazaar, Inc. All rights reserved.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import * as EcdsaMultikey from '@digitalbazaar/ecdsa-multikey';
@@ -66,7 +66,7 @@ export async function verify({
66
66
  name: 'OperationError',
67
67
  cause,
68
68
  details: {
69
- httpStatusCode: cause.status,
69
+ httpStatusCode: cause.status ?? 500,
70
70
  public: true
71
71
  }
72
72
  });
@@ -81,7 +81,7 @@ export async function verify({
81
81
  }
82
82
  });
83
83
  }
84
- if(presentationResult.error) {
84
+ if(presentationResult?.error) {
85
85
  presentationResult.error = stripStacktrace(presentationResult.error);
86
86
  }
87
87
 
@@ -97,7 +97,7 @@ export async function verify({
97
97
  verified,
98
98
  credentialResults,
99
99
  presentationResult,
100
- httpStatusCode: cause.status,
100
+ httpStatusCode: cause.status ?? 500,
101
101
  public: true
102
102
  }
103
103
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/vc-delivery",
3
- "version": "6.6.0",
3
+ "version": "6.6.2",
4
4
  "type": "module",
5
5
  "description": "Bedrock Verifiable Credential Delivery",
6
6
  "main": "./lib/index.js",