@bedrock/vc-delivery 6.4.0 → 6.4.1

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.
Files changed (2) hide show
  1. package/lib/vcapi.js +13 -1
  2. package/package.json +1 -1
package/lib/vcapi.js CHANGED
@@ -223,9 +223,20 @@ export async function processExchange({req, res, workflow, exchangeRecord}) {
223
223
  break;
224
224
  }
225
225
 
226
+ // FIXME: remove this once the other FIXME below is implemented
227
+ // and provides support for issuance in non-last step
228
+ if(step.issueRequests?.length > 0) {
229
+ throw new BedrockError(
230
+ 'Invalid step detected; continuing exchanges currently must ' +
231
+ 'only issue in the final step.', {
232
+ name: 'DataError',
233
+ details: {httpStatusCode: 500, public: true}
234
+ });
235
+ }
236
+
226
237
  // update the exchange to go to the next step, then loop to send
227
238
  // next VPR
228
- currentStep = exchange.step = step.nextStep;
239
+ exchange.step = step.nextStep;
229
240
  // ensure exchange state is active
230
241
  if(exchange.state === 'pending') {
231
242
  exchange.state = 'active';
@@ -249,6 +260,7 @@ export async function processExchange({req, res, workflow, exchangeRecord}) {
249
260
  details: {httpStatusCode: 500, public: true}
250
261
  });
251
262
  }
263
+ currentStep = step.nextStep;
252
264
  }
253
265
 
254
266
  // mark exchange complete
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/vc-delivery",
3
- "version": "6.4.0",
3
+ "version": "6.4.1",
4
4
  "type": "module",
5
5
  "description": "Bedrock Verifiable Credential Delivery",
6
6
  "main": "./lib/index.js",