@sphereon/ssi-sdk.ebsi-support 0.34.1-feature.SSISDK.47.43 → 0.34.1-feature.SSISDK.50.100

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
  }
@@ -2078,12 +2078,11 @@ __export(index_exports, {
2078
2078
  schema: () => schema
2079
2079
  });
2080
2080
  module.exports = __toCommonJS(index_exports);
2081
- var import_ssi_types2 = require("@sphereon/ssi-types");
2081
+ var import_ssi_types3 = require("@sphereon/ssi-types");
2082
2082
 
2083
2083
  // src/agent/EbsiSupport.ts
2084
- var import_did_auth_siop2 = require("@sphereon/did-auth-siop");
2085
2084
  var import_oid4vci_common4 = require("@sphereon/oid4vci-common");
2086
- var import_ssi_types = require("@sphereon/ssi-types");
2085
+ var import_ssi_types2 = require("@sphereon/ssi-types");
2087
2086
  var import_cross_fetch4 = __toESM(require("cross-fetch"), 1);
2088
2087
 
2089
2088
  // src/did/functions.ts
@@ -2110,6 +2109,7 @@ var import_did_auth_siop = require("@sphereon/did-auth-siop");
2110
2109
  var import_oid4vci_common = require("@sphereon/oid4vci-common");
2111
2110
  var import_ssi_sdk = require("@sphereon/ssi-sdk.data-store");
2112
2111
  var import_ssi_sdk2 = require("@sphereon/ssi-sdk.oid4vci-holder");
2112
+ var import_ssi_types = require("@sphereon/ssi-types");
2113
2113
  var import_cross_fetch = __toESM(require("cross-fetch"), 1);
2114
2114
  var addContactCallback = /* @__PURE__ */ __name((context) => {
2115
2115
  return async (oid4vciMachine, state) => {
@@ -2140,7 +2140,7 @@ var addContactCallback = /* @__PURE__ */ __name((context) => {
2140
2140
  {
2141
2141
  alias: correlationId,
2142
2142
  roles: [
2143
- import_ssi_sdk.CredentialRole.ISSUER
2143
+ import_ssi_types.CredentialRole.ISSUER
2144
2144
  ],
2145
2145
  origin: import_ssi_sdk.IdentityOrigin.EXTERNAL,
2146
2146
  identifier: {
@@ -2591,12 +2591,12 @@ var EBSI_DID_SPEC_INFOS = {
2591
2591
  method: "did:key:"
2592
2592
  }
2593
2593
  };
2594
- var EbsiPublicKeyPurpose = /* @__PURE__ */ (function(EbsiPublicKeyPurpose2) {
2594
+ var EbsiPublicKeyPurpose = /* @__PURE__ */ function(EbsiPublicKeyPurpose2) {
2595
2595
  EbsiPublicKeyPurpose2["Authentication"] = "authentication";
2596
2596
  EbsiPublicKeyPurpose2["AssertionMethod"] = "assertionMethod";
2597
2597
  EbsiPublicKeyPurpose2["CapabilityInvocation"] = "capabilityInvocation";
2598
2598
  return EbsiPublicKeyPurpose2;
2599
- })({});
2599
+ }({});
2600
2600
  var JSON_RPC_VERSION = "2.0";
2601
2601
  var BASE_CONTEXT_DOC = JSON.stringify({
2602
2602
  "@context": [
@@ -2604,7 +2604,7 @@ var BASE_CONTEXT_DOC = JSON.stringify({
2604
2604
  "https://w3id.org/security/suites/jws-2020/v1"
2605
2605
  ]
2606
2606
  });
2607
- var EbsiRpcMethod = /* @__PURE__ */ (function(EbsiRpcMethod2) {
2607
+ var EbsiRpcMethod = /* @__PURE__ */ function(EbsiRpcMethod2) {
2608
2608
  EbsiRpcMethod2["INSERT_DID_DOCUMENT"] = "insertDidDocument";
2609
2609
  EbsiRpcMethod2["UPDATE_DID_DOCUMENT"] = "updateBaseDocument";
2610
2610
  EbsiRpcMethod2["ADD_VERIFICATION_METHOD"] = "addVerificationMethod";
@@ -2612,7 +2612,7 @@ var EbsiRpcMethod = /* @__PURE__ */ (function(EbsiRpcMethod2) {
2612
2612
  EbsiRpcMethod2["ADD_SERVICE"] = "addService";
2613
2613
  EbsiRpcMethod2["SEND_SIGNED_TRANSACTION"] = "sendSignedTransaction";
2614
2614
  return EbsiRpcMethod2;
2615
- })({});
2615
+ }({});
2616
2616
 
2617
2617
  // src/did/services/EbsiRPCService.ts
2618
2618
  var callRpcMethod = /* @__PURE__ */ __name(async (args) => {
@@ -3131,7 +3131,6 @@ var ebsiCreateDidOnLedger = /* @__PURE__ */ __name(async (args, context) => {
3131
3131
 
3132
3132
  // src/agent/EbsiSupport.ts
3133
3133
  var import_uuid = require("uuid");
3134
- var import_did_auth_siop_adapter = require("@sphereon/did-auth-siop-adapter");
3135
3134
  var import_ssi_sdk5 = require("@sphereon/ssi-sdk.core");
3136
3135
  var ebsiSupportMethods = [
3137
3136
  "ebsiCreateDidOnLedger",
@@ -3223,15 +3222,15 @@ var EbsiSupport = class {
3223
3222
  let attestationCredential = args.attestationCredential;
3224
3223
  if (hasInputDescriptors && !attestationCredential) {
3225
3224
  if (allVerifiableCredentials && allVerifiableCredentials.length > 0) {
3226
- const pexResult2 = await context.agent.pexDefinitionFilterCredentials({
3225
+ const pexResult = await context.agent.pexDefinitionFilterCredentials({
3227
3226
  presentationDefinition: definitionResponse,
3228
3227
  credentialFilterOpts: {
3229
3228
  credentialRole: args.credentialRole,
3230
3229
  verifiableCredentials: allVerifiableCredentials
3231
3230
  }
3232
3231
  });
3233
- if (pexResult2.filteredCredentials.length > 0) {
3234
- const filtered = pexResult2.filteredCredentials.map((cred) => import_ssi_types.CredentialMapper.toUniformCredential(cred, {
3232
+ if (pexResult.filteredCredentials.length > 0) {
3233
+ const filtered = pexResult.filteredCredentials.map((cred) => import_ssi_types2.CredentialMapper.toUniformCredential(cred, {
3235
3234
  hasher: import_ssi_sdk5.defaultHasher
3236
3235
  })).filter((cred) => {
3237
3236
  if (!cred.expirationDate) {
@@ -3276,57 +3275,7 @@ var EbsiSupport = class {
3276
3275
  attestationCredential = attestationResult.credentials[0].rawVerifiableCredential;
3277
3276
  }
3278
3277
  }
3279
- const definition = {
3280
- definition: definitionResponse,
3281
- location: import_did_auth_siop2.PresentationDefinitionLocation.TOPLEVEL_PRESENTATION_DEF,
3282
- version: import_did_auth_siop2.SupportedVersion.SIOPv2_D11
3283
- };
3284
- const pexResult = hasInputDescriptors ? await context.agent.pexDefinitionFilterCredentials({
3285
- presentationDefinition: definitionResponse,
3286
- credentialFilterOpts: {
3287
- credentialRole: args.credentialRole,
3288
- verifiableCredentials: [
3289
- attestationCredential
3290
- ]
3291
- }
3292
- }) : {
3293
- // LOL, let's see whether we can trick PEX to create a VP without VCs
3294
- filteredCredentials: [],
3295
- id: definitionResponse.id,
3296
- selectResults: {
3297
- verifiableCredential: [],
3298
- areRequiredCredentialsPresent: "info"
3299
- }
3300
- };
3301
- const opSession = await context.agent.siopRegisterOPSession({
3302
- requestJwtOrUri: "",
3303
- op: {
3304
- checkLinkedDomains: import_did_auth_siop_adapter.CheckLinkedDomain.NEVER
3305
- },
3306
- providedPresentationDefinitions: [
3307
- definition
3308
- ]
3309
- });
3310
- const oid4vp = await opSession.getOID4VP({
3311
- allIdentifiers: [
3312
- identifier.did
3313
- ]
3314
- });
3315
- const vp = await oid4vp.createVerifiablePresentation(args.credentialRole, {
3316
- definition,
3317
- credentials: pexResult.filteredCredentials
3318
- }, {
3319
- proofOpts: {
3320
- domain: openIDMetadata.issuer,
3321
- nonce: (0, import_uuid.v4)(),
3322
- created: new Date(Date.now() - 12e4).toString()
3323
- },
3324
- holder: identifier.did,
3325
- idOpts,
3326
- skipDidResolution,
3327
- forceNoCredentialsInVP: !hasInputDescriptors
3328
- });
3329
- const presentationSubmission = hasInputDescriptors ? vp.presentationSubmission : {
3278
+ const presentationSubmission = {
3330
3279
  id: (0, import_uuid.v4)(),
3331
3280
  definition_id: definitionResponse.id,
3332
3281
  descriptor_map: []
@@ -3334,7 +3283,8 @@ var EbsiSupport = class {
3334
3283
  console.log(`Presentation submission`, presentationSubmission);
3335
3284
  const tokenRequestArgs = {
3336
3285
  grant_type: "vp_token",
3337
- vp_token: import_ssi_types.CredentialMapper.toCompactJWT(vp.verifiablePresentations[0]),
3286
+ // FIXME SSISDK-40
3287
+ vp_token: "",
3338
3288
  scope,
3339
3289
  presentation_submission: presentationSubmission,
3340
3290
  apiOpts: {
@@ -3383,10 +3333,10 @@ ${JSON.stringify(accessTokenResponse)}`);
3383
3333
  };
3384
3334
 
3385
3335
  // src/types/IEbsiSupport.ts
3386
- var TokenType = /* @__PURE__ */ (function(TokenType2) {
3336
+ var TokenType = /* @__PURE__ */ function(TokenType2) {
3387
3337
  TokenType2["BEARER"] = "Bearer";
3388
3338
  return TokenType2;
3389
- })({});
3339
+ }({});
3390
3340
 
3391
3341
  // src/did/EbsiDidProvider.ts
3392
3342
  var import_ssi_sdk_ext5 = require("@sphereon/ssi-sdk-ext.did-utils");
@@ -3599,11 +3549,11 @@ var import_did_resolver = require("did-resolver");
3599
3549
  var import_ssi_sdk_ext7 = require("@sphereon/ssi-sdk-ext.did-resolver-ebsi");
3600
3550
 
3601
3551
  // src/index.ts
3602
- var logger = import_ssi_types2.Loggers.DEFAULT.options("sphereon:ebsi-support", {
3603
- defaultLogLevel: import_ssi_types2.LogLevel.DEBUG,
3552
+ var logger = import_ssi_types3.Loggers.DEFAULT.options("sphereon:ebsi-support", {
3553
+ defaultLogLevel: import_ssi_types3.LogLevel.DEBUG,
3604
3554
  methods: [
3605
- import_ssi_types2.LogMethod.CONSOLE,
3606
- import_ssi_types2.LogMethod.DEBUG_PKG
3555
+ import_ssi_types3.LogMethod.CONSOLE,
3556
+ import_ssi_types3.LogMethod.DEBUG_PKG
3607
3557
  ]
3608
3558
  }).get("sphereon:ebsi-support");
3609
3559
  var schema = require_plugin_schema();