@sphereon/ssi-sdk.ebsi-support 0.34.1-feature.SSISDK.46.44 → 0.34.1-feature.SSISDK.47.154

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: {
@@ -2353,7 +2353,7 @@ var ebsiCreateAttestationAuthRequestURL = /* @__PURE__ */ __name(async ({ client
2353
2353
  createAuthorizationRequestURL: false,
2354
2354
  retrieveServerMetadata: true
2355
2355
  });
2356
- const allMatches = vciClient.getCredentialsSupported(false);
2356
+ const allMatches = {};
2357
2357
  let arrayMatches;
2358
2358
  if (Array.isArray(allMatches)) {
2359
2359
  arrayMatches = allMatches;
@@ -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: {
@@ -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();