@sphereon/ssi-sdk.ebsi-support 0.34.1-fix.79 → 0.34.1-next.278

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/dist/index.cjs CHANGED
@@ -382,7 +382,7 @@ var require_plugin_schema = __commonJS({
382
382
  di_vp: {
383
383
  $ref: "#/components/schemas/DiObject"
384
384
  },
385
- "vc+sd-jwt": {
385
+ "dc+sd-jwt": {
386
386
  $ref: "#/components/schemas/SdJwtObject"
387
387
  }
388
388
  }
@@ -2070,19 +2070,42 @@ var require_plugin_schema = __commonJS({
2070
2070
  // src/index.ts
2071
2071
  var index_exports = {};
2072
2072
  __export(index_exports, {
2073
+ BASE_CONTEXT_DOC: () => BASE_CONTEXT_DOC,
2074
+ EBSI_DID_SPEC_INFOS: () => EBSI_DID_SPEC_INFOS,
2073
2075
  EbsiDidProvider: () => EbsiDidProvider,
2076
+ EbsiPublicKeyPurpose: () => EbsiPublicKeyPurpose,
2077
+ EbsiRpcMethod: () => EbsiRpcMethod,
2074
2078
  EbsiSupport: () => EbsiSupport,
2079
+ JSON_RPC_VERSION: () => JSON_RPC_VERSION,
2075
2080
  TokenType: () => TokenType,
2081
+ assertedPurposes: () => assertedPurposes,
2082
+ determineWellknownEndpoint: () => determineWellknownEndpoint,
2083
+ ebsiCreateDidOnLedger: () => ebsiCreateDidOnLedger,
2084
+ ebsiGenerateOrUseKeyPair: () => ebsiGenerateOrUseKeyPair,
2085
+ ebsiGetAuthorisationServer: () => ebsiGetAuthorisationServer,
2086
+ ebsiGetDidDocument: () => ebsiGetDidDocument,
2087
+ ebsiGetIssuerMock: () => ebsiGetIssuerMock,
2088
+ ebsiGetRegistryAPIUrls: () => ebsiGetRegistryAPIUrls,
2089
+ ebsiListDidDocuments: () => ebsiListDidDocuments,
2090
+ ebsiSignAndSendTransaction: () => ebsiSignAndSendTransaction,
2076
2091
  ebsiSupportMethods: () => ebsiSupportMethods,
2092
+ ebsiWaitTillDocumentAnchored: () => ebsiWaitTillDocumentAnchored,
2093
+ formatEbsiPublicKey: () => formatEbsiPublicKey,
2094
+ generateEbsiMethodSpecificId: () => generateEbsiMethodSpecificId,
2095
+ generateOrUseProvidedEbsiPrivateKeyHex: () => generateOrUseProvidedEbsiPrivateKeyHex,
2096
+ getDidEbsiResolver: () => getDidEbsiResolver,
2077
2097
  logger: () => logger,
2078
- schema: () => schema
2098
+ randomRpcId: () => randomRpcId,
2099
+ schema: () => schema,
2100
+ setPurposes: () => setPurposes,
2101
+ toMinimalImportableKey: () => toMinimalImportableKey
2079
2102
  });
2080
2103
  module.exports = __toCommonJS(index_exports);
2081
- var import_ssi_types2 = require("@sphereon/ssi-types");
2104
+ var import_ssi_types3 = require("@sphereon/ssi-types");
2082
2105
 
2083
2106
  // src/agent/EbsiSupport.ts
2084
2107
  var import_oid4vci_common4 = require("@sphereon/oid4vci-common");
2085
- var import_ssi_types = require("@sphereon/ssi-types");
2108
+ var import_ssi_types2 = require("@sphereon/ssi-types");
2086
2109
  var import_cross_fetch4 = __toESM(require("cross-fetch"), 1);
2087
2110
 
2088
2111
  // src/did/functions.ts
@@ -2102,13 +2125,14 @@ var import_ssi_sdk_ext = require("@sphereon/ssi-sdk-ext.did-utils");
2102
2125
  var import_ssi_sdk_ext2 = require("@sphereon/ssi-sdk-ext.key-utils");
2103
2126
  var import_ssi_sdk3 = require("@sphereon/ssi-sdk.oid4vci-holder");
2104
2127
  var import_ssi_sdk4 = require("@sphereon/ssi-sdk.siopv2-oid4vp-op-auth");
2105
- var import_waitFor = require("xstate/lib/waitFor");
2128
+ var import_waitFor = require("xstate/lib/waitFor.js");
2106
2129
 
2107
2130
  // src/functions/AttestationHeadlessCallbacks.ts
2108
2131
  var import_did_auth_siop = require("@sphereon/did-auth-siop");
2109
2132
  var import_oid4vci_common = require("@sphereon/oid4vci-common");
2110
- var import_ssi_sdk = require("@sphereon/ssi-sdk.data-store");
2133
+ var import_ssi_sdk = require("@sphereon/ssi-sdk.data-store-types");
2111
2134
  var import_ssi_sdk2 = require("@sphereon/ssi-sdk.oid4vci-holder");
2135
+ var import_ssi_types = require("@sphereon/ssi-types");
2112
2136
  var import_cross_fetch = __toESM(require("cross-fetch"), 1);
2113
2137
  var addContactCallback = /* @__PURE__ */ __name((context) => {
2114
2138
  return async (oid4vciMachine, state) => {
@@ -2139,7 +2163,7 @@ var addContactCallback = /* @__PURE__ */ __name((context) => {
2139
2163
  {
2140
2164
  alias: correlationId,
2141
2165
  roles: [
2142
- import_ssi_sdk.CredentialRole.ISSUER
2166
+ import_ssi_types.CredentialRole.ISSUER
2143
2167
  ],
2144
2168
  origin: import_ssi_sdk.IdentityOrigin.EXTERNAL,
2145
2169
  identifier: {
@@ -2572,6 +2596,24 @@ var ebsiWaitTillDocumentAnchored = /* @__PURE__ */ __name(async (args) => {
2572
2596
  count
2573
2597
  };
2574
2598
  }, "ebsiWaitTillDocumentAnchored");
2599
+ var ebsiListDidDocuments = /* @__PURE__ */ __name(async (args) => {
2600
+ const { params, apiOpts } = args;
2601
+ const { offset, size, controller } = params;
2602
+ const queryParams = [];
2603
+ if (offset) {
2604
+ queryParams.push(`page[after]=${offset}`);
2605
+ }
2606
+ if (size) {
2607
+ queryParams.push(`page[size]=${size}`);
2608
+ }
2609
+ if (controller) {
2610
+ queryParams.push(`controller=${controller}`);
2611
+ }
2612
+ const query = `?${queryParams.filter(Boolean).join("&")}`;
2613
+ return await (await (0, import_cross_fetch2.default)(`${ebsiGetRegistryAPIUrls({
2614
+ ...apiOpts
2615
+ }).query}/${query}`)).json();
2616
+ }, "ebsiListDidDocuments");
2575
2617
 
2576
2618
  // src/did/services/EbsiRPCService.ts
2577
2619
  var import_cross_fetch3 = __toESM(require("cross-fetch"), 1);
@@ -2590,12 +2632,12 @@ var EBSI_DID_SPEC_INFOS = {
2590
2632
  method: "did:key:"
2591
2633
  }
2592
2634
  };
2593
- var EbsiPublicKeyPurpose = /* @__PURE__ */ function(EbsiPublicKeyPurpose2) {
2635
+ var EbsiPublicKeyPurpose = /* @__PURE__ */ (function(EbsiPublicKeyPurpose2) {
2594
2636
  EbsiPublicKeyPurpose2["Authentication"] = "authentication";
2595
2637
  EbsiPublicKeyPurpose2["AssertionMethod"] = "assertionMethod";
2596
2638
  EbsiPublicKeyPurpose2["CapabilityInvocation"] = "capabilityInvocation";
2597
2639
  return EbsiPublicKeyPurpose2;
2598
- }({});
2640
+ })({});
2599
2641
  var JSON_RPC_VERSION = "2.0";
2600
2642
  var BASE_CONTEXT_DOC = JSON.stringify({
2601
2643
  "@context": [
@@ -2603,7 +2645,7 @@ var BASE_CONTEXT_DOC = JSON.stringify({
2603
2645
  "https://w3id.org/security/suites/jws-2020/v1"
2604
2646
  ]
2605
2647
  });
2606
- var EbsiRpcMethod = /* @__PURE__ */ function(EbsiRpcMethod2) {
2648
+ var EbsiRpcMethod = /* @__PURE__ */ (function(EbsiRpcMethod2) {
2607
2649
  EbsiRpcMethod2["INSERT_DID_DOCUMENT"] = "insertDidDocument";
2608
2650
  EbsiRpcMethod2["UPDATE_DID_DOCUMENT"] = "updateBaseDocument";
2609
2651
  EbsiRpcMethod2["ADD_VERIFICATION_METHOD"] = "addVerificationMethod";
@@ -2611,7 +2653,7 @@ var EbsiRpcMethod = /* @__PURE__ */ function(EbsiRpcMethod2) {
2611
2653
  EbsiRpcMethod2["ADD_SERVICE"] = "addService";
2612
2654
  EbsiRpcMethod2["SEND_SIGNED_TRANSACTION"] = "sendSignedTransaction";
2613
2655
  return EbsiRpcMethod2;
2614
- }({});
2656
+ })({});
2615
2657
 
2616
2658
  // src/did/services/EbsiRPCService.ts
2617
2659
  var callRpcMethod = /* @__PURE__ */ __name(async (args) => {
@@ -2729,6 +2771,14 @@ var ebsiGetIssuerMock = /* @__PURE__ */ __name((args) => {
2729
2771
  system: environment
2730
2772
  })}/issuer-mock`;
2731
2773
  }, "ebsiGetIssuerMock");
2774
+ var ebsiGetAuthorisationServer = /* @__PURE__ */ __name((args) => {
2775
+ const { environment = "pilot", version = "v4" } = args;
2776
+ return `${getEbsiApiBaseUrl({
2777
+ environment,
2778
+ version,
2779
+ system: "authorisation"
2780
+ })}`;
2781
+ }, "ebsiGetAuthorisationServer");
2732
2782
  var ebsiGetRegistryAPIUrls = /* @__PURE__ */ __name((args) => {
2733
2783
  const { environment = "pilot", version = "v5" } = args;
2734
2784
  const baseUrl = `${getEbsiApiBaseUrl({
@@ -2842,7 +2892,7 @@ var toMinimalImportableKey = /* @__PURE__ */ __name(async (args) => {
2842
2892
  minimalImportableKey.meta = {
2843
2893
  purposes: assertedPurposes({
2844
2894
  key
2845
- }) ?? setDefaultPurposes({
2895
+ }) ?? setPurposes({
2846
2896
  key,
2847
2897
  type
2848
2898
  }),
@@ -2878,7 +2928,7 @@ var assertedPurposes = /* @__PURE__ */ __name((args) => {
2878
2928
  }
2879
2929
  return key?.purposes;
2880
2930
  }, "assertedPurposes");
2881
- var setDefaultPurposes = /* @__PURE__ */ __name((args) => {
2931
+ var setPurposes = /* @__PURE__ */ __name((args) => {
2882
2932
  const { key, type } = args;
2883
2933
  if (!key?.purposes || key.purposes.length === 0) {
2884
2934
  switch (type) {
@@ -2896,7 +2946,7 @@ var setDefaultPurposes = /* @__PURE__ */ __name((args) => {
2896
2946
  }
2897
2947
  }
2898
2948
  return key.purposes;
2899
- }, "setDefaultPurposes");
2949
+ }, "setPurposes");
2900
2950
  var randomRpcId = /* @__PURE__ */ __name(() => {
2901
2951
  return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
2902
2952
  }, "randomRpcId");
@@ -3229,7 +3279,7 @@ var EbsiSupport = class {
3229
3279
  }
3230
3280
  });
3231
3281
  if (pexResult.filteredCredentials.length > 0) {
3232
- const filtered = pexResult.filteredCredentials.map((cred) => import_ssi_types.CredentialMapper.toUniformCredential(cred, {
3282
+ const filtered = pexResult.filteredCredentials.map((cred) => import_ssi_types2.CredentialMapper.toUniformCredential(cred, {
3233
3283
  hasher: import_ssi_sdk5.defaultHasher
3234
3284
  })).filter((cred) => {
3235
3285
  if (!cred.expirationDate) {
@@ -3332,10 +3382,10 @@ ${JSON.stringify(accessTokenResponse)}`);
3332
3382
  };
3333
3383
 
3334
3384
  // src/types/IEbsiSupport.ts
3335
- var TokenType = /* @__PURE__ */ function(TokenType2) {
3385
+ var TokenType = /* @__PURE__ */ (function(TokenType2) {
3336
3386
  TokenType2["BEARER"] = "Bearer";
3337
3387
  return TokenType2;
3338
- }({});
3388
+ })({});
3339
3389
 
3340
3390
  // src/did/EbsiDidProvider.ts
3341
3391
  var import_ssi_sdk_ext5 = require("@sphereon/ssi-sdk-ext.did-utils");
@@ -3546,13 +3596,25 @@ var EbsiDidProvider = class _EbsiDidProvider extends import_did_manager.Abstract
3546
3596
  // src/did/EbsiDidResolver.ts
3547
3597
  var import_did_resolver = require("did-resolver");
3548
3598
  var import_ssi_sdk_ext7 = require("@sphereon/ssi-sdk-ext.did-resolver-ebsi");
3599
+ var resolveDidEbsi = /* @__PURE__ */ __name(async (didUrl, _parsed, _resolver, options) => {
3600
+ const resolver = new import_did_resolver.Resolver({
3601
+ ...(0, import_ssi_sdk_ext7.getResolver)()
3602
+ });
3603
+ return resolver.resolve(didUrl, options);
3604
+ }, "resolveDidEbsi");
3605
+ function getDidEbsiResolver() {
3606
+ return {
3607
+ key: resolveDidEbsi
3608
+ };
3609
+ }
3610
+ __name(getDidEbsiResolver, "getDidEbsiResolver");
3549
3611
 
3550
3612
  // src/index.ts
3551
- var logger = import_ssi_types2.Loggers.DEFAULT.options("sphereon:ebsi-support", {
3552
- defaultLogLevel: import_ssi_types2.LogLevel.DEBUG,
3613
+ var logger = import_ssi_types3.Loggers.DEFAULT.options("sphereon:ebsi-support", {
3614
+ defaultLogLevel: import_ssi_types3.LogLevel.DEBUG,
3553
3615
  methods: [
3554
- import_ssi_types2.LogMethod.CONSOLE,
3555
- import_ssi_types2.LogMethod.DEBUG_PKG
3616
+ import_ssi_types3.LogMethod.CONSOLE,
3617
+ import_ssi_types3.LogMethod.DEBUG_PKG
3556
3618
  ]
3557
3619
  }).get("sphereon:ebsi-support");
3558
3620
  var schema = require_plugin_schema();