@sphereon/ssi-sdk.ebsi-support 0.34.1-next.6 → 0.34.1-next.85

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.js CHANGED
@@ -356,7 +356,7 @@ var require_plugin_schema = __commonJS({
356
356
  di_vp: {
357
357
  $ref: "#/components/schemas/DiObject"
358
358
  },
359
- "vc+sd-jwt": {
359
+ "dc+sd-jwt": {
360
360
  $ref: "#/components/schemas/SdJwtObject"
361
361
  }
362
362
  }
@@ -2045,7 +2045,6 @@ var require_plugin_schema = __commonJS({
2045
2045
  import { Loggers, LogLevel, LogMethod } from "@sphereon/ssi-types";
2046
2046
 
2047
2047
  // src/agent/EbsiSupport.ts
2048
- import { PresentationDefinitionLocation, SupportedVersion } from "@sphereon/did-auth-siop";
2049
2048
  import { CreateRequestObjectMode as CreateRequestObjectMode2 } from "@sphereon/oid4vci-common";
2050
2049
  import { CredentialMapper } from "@sphereon/ssi-types";
2051
2050
  import fetch4 from "cross-fetch";
@@ -2555,12 +2554,12 @@ var EBSI_DID_SPEC_INFOS = {
2555
2554
  method: "did:key:"
2556
2555
  }
2557
2556
  };
2558
- var EbsiPublicKeyPurpose = /* @__PURE__ */ function(EbsiPublicKeyPurpose2) {
2557
+ var EbsiPublicKeyPurpose = /* @__PURE__ */ (function(EbsiPublicKeyPurpose2) {
2559
2558
  EbsiPublicKeyPurpose2["Authentication"] = "authentication";
2560
2559
  EbsiPublicKeyPurpose2["AssertionMethod"] = "assertionMethod";
2561
2560
  EbsiPublicKeyPurpose2["CapabilityInvocation"] = "capabilityInvocation";
2562
2561
  return EbsiPublicKeyPurpose2;
2563
- }({});
2562
+ })({});
2564
2563
  var JSON_RPC_VERSION = "2.0";
2565
2564
  var BASE_CONTEXT_DOC = JSON.stringify({
2566
2565
  "@context": [
@@ -2568,7 +2567,7 @@ var BASE_CONTEXT_DOC = JSON.stringify({
2568
2567
  "https://w3id.org/security/suites/jws-2020/v1"
2569
2568
  ]
2570
2569
  });
2571
- var EbsiRpcMethod = /* @__PURE__ */ function(EbsiRpcMethod2) {
2570
+ var EbsiRpcMethod = /* @__PURE__ */ (function(EbsiRpcMethod2) {
2572
2571
  EbsiRpcMethod2["INSERT_DID_DOCUMENT"] = "insertDidDocument";
2573
2572
  EbsiRpcMethod2["UPDATE_DID_DOCUMENT"] = "updateBaseDocument";
2574
2573
  EbsiRpcMethod2["ADD_VERIFICATION_METHOD"] = "addVerificationMethod";
@@ -2576,7 +2575,7 @@ var EbsiRpcMethod = /* @__PURE__ */ function(EbsiRpcMethod2) {
2576
2575
  EbsiRpcMethod2["ADD_SERVICE"] = "addService";
2577
2576
  EbsiRpcMethod2["SEND_SIGNED_TRANSACTION"] = "sendSignedTransaction";
2578
2577
  return EbsiRpcMethod2;
2579
- }({});
2578
+ })({});
2580
2579
 
2581
2580
  // src/did/services/EbsiRPCService.ts
2582
2581
  var callRpcMethod = /* @__PURE__ */ __name(async (args) => {
@@ -3095,7 +3094,6 @@ var ebsiCreateDidOnLedger = /* @__PURE__ */ __name(async (args, context) => {
3095
3094
 
3096
3095
  // src/agent/EbsiSupport.ts
3097
3096
  import { v4 } from "uuid";
3098
- import { CheckLinkedDomain } from "@sphereon/did-auth-siop-adapter";
3099
3097
  import { defaultHasher } from "@sphereon/ssi-sdk.core";
3100
3098
  var ebsiSupportMethods = [
3101
3099
  "ebsiCreateDidOnLedger",
@@ -3187,15 +3185,15 @@ var EbsiSupport = class {
3187
3185
  let attestationCredential = args.attestationCredential;
3188
3186
  if (hasInputDescriptors && !attestationCredential) {
3189
3187
  if (allVerifiableCredentials && allVerifiableCredentials.length > 0) {
3190
- const pexResult2 = await context.agent.pexDefinitionFilterCredentials({
3188
+ const pexResult = await context.agent.pexDefinitionFilterCredentials({
3191
3189
  presentationDefinition: definitionResponse,
3192
3190
  credentialFilterOpts: {
3193
3191
  credentialRole: args.credentialRole,
3194
3192
  verifiableCredentials: allVerifiableCredentials
3195
3193
  }
3196
3194
  });
3197
- if (pexResult2.filteredCredentials.length > 0) {
3198
- const filtered = pexResult2.filteredCredentials.map((cred) => CredentialMapper.toUniformCredential(cred, {
3195
+ if (pexResult.filteredCredentials.length > 0) {
3196
+ const filtered = pexResult.filteredCredentials.map((cred) => CredentialMapper.toUniformCredential(cred, {
3199
3197
  hasher: defaultHasher
3200
3198
  })).filter((cred) => {
3201
3199
  if (!cred.expirationDate) {
@@ -3240,57 +3238,7 @@ var EbsiSupport = class {
3240
3238
  attestationCredential = attestationResult.credentials[0].rawVerifiableCredential;
3241
3239
  }
3242
3240
  }
3243
- const definition = {
3244
- definition: definitionResponse,
3245
- location: PresentationDefinitionLocation.TOPLEVEL_PRESENTATION_DEF,
3246
- version: SupportedVersion.SIOPv2_D11
3247
- };
3248
- const pexResult = hasInputDescriptors ? await context.agent.pexDefinitionFilterCredentials({
3249
- presentationDefinition: definitionResponse,
3250
- credentialFilterOpts: {
3251
- credentialRole: args.credentialRole,
3252
- verifiableCredentials: [
3253
- attestationCredential
3254
- ]
3255
- }
3256
- }) : {
3257
- // LOL, let's see whether we can trick PEX to create a VP without VCs
3258
- filteredCredentials: [],
3259
- id: definitionResponse.id,
3260
- selectResults: {
3261
- verifiableCredential: [],
3262
- areRequiredCredentialsPresent: "info"
3263
- }
3264
- };
3265
- const opSession = await context.agent.siopRegisterOPSession({
3266
- requestJwtOrUri: "",
3267
- op: {
3268
- checkLinkedDomains: CheckLinkedDomain.NEVER
3269
- },
3270
- providedPresentationDefinitions: [
3271
- definition
3272
- ]
3273
- });
3274
- const oid4vp = await opSession.getOID4VP({
3275
- allIdentifiers: [
3276
- identifier.did
3277
- ]
3278
- });
3279
- const vp = await oid4vp.createVerifiablePresentation(args.credentialRole, {
3280
- definition,
3281
- credentials: pexResult.filteredCredentials
3282
- }, {
3283
- proofOpts: {
3284
- domain: openIDMetadata.issuer,
3285
- nonce: v4(),
3286
- created: new Date(Date.now() - 12e4).toString()
3287
- },
3288
- holder: identifier.did,
3289
- idOpts,
3290
- skipDidResolution,
3291
- forceNoCredentialsInVP: !hasInputDescriptors
3292
- });
3293
- const presentationSubmission = hasInputDescriptors ? vp.presentationSubmission : {
3241
+ const presentationSubmission = {
3294
3242
  id: v4(),
3295
3243
  definition_id: definitionResponse.id,
3296
3244
  descriptor_map: []
@@ -3298,7 +3246,8 @@ var EbsiSupport = class {
3298
3246
  console.log(`Presentation submission`, presentationSubmission);
3299
3247
  const tokenRequestArgs = {
3300
3248
  grant_type: "vp_token",
3301
- vp_token: CredentialMapper.toCompactJWT(vp.verifiablePresentations[0]),
3249
+ // FIXME SSISDK-40
3250
+ vp_token: "",
3302
3251
  scope,
3303
3252
  presentation_submission: presentationSubmission,
3304
3253
  apiOpts: {
@@ -3347,10 +3296,10 @@ ${JSON.stringify(accessTokenResponse)}`);
3347
3296
  };
3348
3297
 
3349
3298
  // src/types/IEbsiSupport.ts
3350
- var TokenType = /* @__PURE__ */ function(TokenType2) {
3299
+ var TokenType = /* @__PURE__ */ (function(TokenType2) {
3351
3300
  TokenType2["BEARER"] = "Bearer";
3352
3301
  return TokenType2;
3353
- }({});
3302
+ })({});
3354
3303
 
3355
3304
  // src/did/EbsiDidProvider.ts
3356
3305
  import { getControllerKey as getControllerKey2, getEthereumAddressFromKey as getEthereumAddressFromKey2 } from "@sphereon/ssi-sdk-ext.did-utils";