@bedrock/kms 16.1.0 → 16.2.0

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2019-2026 Digital Bazaar, Inc. All rights reserved.
3
3
  */
4
4
  import * as brPackageManager from '@bedrock/package-manager';
5
5
 
@@ -9,15 +9,16 @@ import './config.js';
9
9
  const importMap = new Map();
10
10
 
11
11
  export class BedrockKmsModuleManager {
12
- async get({id}) {
12
+ async get({id} = {}) {
13
13
  const {packageName} = brPackageManager.get(
14
14
  {alias: id, type: 'webkms-module'});
15
- let api = await importMap.get(packageName);
16
- if(!api) {
15
+ let mod = await importMap.get(packageName);
16
+ if(!mod) {
17
17
  const promise = import(packageName);
18
18
  importMap.set(packageName, promise);
19
- api = await promise;
19
+ mod = await promise;
20
20
  }
21
- return api.default || api;
21
+ const api = await mod.getKmsModuleApi?.() ?? mod.default ?? mod;
22
+ return api;
22
23
  }
23
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/kms",
3
- "version": "16.1.0",
3
+ "version": "16.2.0",
4
4
  "type": "module",
5
5
  "description": "Key management for Bedrock applications",
6
6
  "main": "./lib/index.js",