@sphereon/oid4vci-common 0.19.1-fix.168 → 0.19.1-fix.197

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
@@ -34,9 +34,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  ));
35
35
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
36
 
37
- // ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.11.29_postcss@8.5.3_tsx@4.19.4_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/cjs_shims.js
37
+ // ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.19_postcss@8.5.6_tsx@4.20.6_typescript@5.8.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
38
38
  var init_cjs_shims = __esm({
39
- "../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.11.29_postcss@8.5.3_tsx@4.19.4_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/cjs_shims.js"() {
39
+ "../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.19_postcss@8.5.6_tsx@4.20.6_typescript@5.8.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js"() {
40
40
  "use strict";
41
41
  }
42
42
  });
@@ -219,7 +219,7 @@ init_cjs_shims();
219
219
  // lib/functions/HttpUtils.ts
220
220
  init_cjs_shims();
221
221
  var import_ssi_types = require("@sphereon/ssi-types");
222
- var import_cross_fetch = require("cross-fetch");
222
+ var import_cross_fetch = __toESM(require("cross-fetch"), 1);
223
223
 
224
224
  // lib/types/index.ts
225
225
  init_cjs_shims();
@@ -244,7 +244,7 @@ var PRE_AUTH_CODE_LITERAL = "pre-authorized_code";
244
244
  var PRE_AUTH_GRANT_LITERAL = "urn:ietf:params:oauth:grant-type:pre-authorized_code";
245
245
 
246
246
  // lib/types/Authorization.types.ts
247
- var AuthorizationChallengeError = /* @__PURE__ */ function(AuthorizationChallengeError2) {
247
+ var AuthorizationChallengeError = /* @__PURE__ */ (function(AuthorizationChallengeError2) {
248
248
  AuthorizationChallengeError2["invalid_request"] = "invalid_request";
249
249
  AuthorizationChallengeError2["invalid_client"] = "invalid_client";
250
250
  AuthorizationChallengeError2["unauthorized_client"] = "unauthorized_client";
@@ -253,44 +253,44 @@ var AuthorizationChallengeError = /* @__PURE__ */ function(AuthorizationChalleng
253
253
  AuthorizationChallengeError2["insufficient_authorization"] = "insufficient_authorization";
254
254
  AuthorizationChallengeError2["redirect_to_web"] = "redirect_to_web";
255
255
  return AuthorizationChallengeError2;
256
- }({});
257
- var GrantTypes = /* @__PURE__ */ function(GrantTypes2) {
256
+ })({});
257
+ var GrantTypes = /* @__PURE__ */ (function(GrantTypes2) {
258
258
  GrantTypes2["AUTHORIZATION_CODE"] = "authorization_code";
259
259
  GrantTypes2["PRE_AUTHORIZED_CODE"] = "urn:ietf:params:oauth:grant-type:pre-authorized_code";
260
260
  GrantTypes2["PASSWORD"] = "password";
261
261
  return GrantTypes2;
262
- }({});
263
- var Encoding = /* @__PURE__ */ function(Encoding2) {
262
+ })({});
263
+ var Encoding = /* @__PURE__ */ (function(Encoding2) {
264
264
  Encoding2["FORM_URL_ENCODED"] = "application/x-www-form-urlencoded";
265
265
  Encoding2["UTF_8"] = "UTF-8";
266
266
  return Encoding2;
267
- }({});
268
- var ResponseType = /* @__PURE__ */ function(ResponseType2) {
267
+ })({});
268
+ var ResponseType = /* @__PURE__ */ (function(ResponseType2) {
269
269
  ResponseType2["AUTH_CODE"] = "code";
270
270
  return ResponseType2;
271
- }({});
272
- var CodeChallengeMethod = /* @__PURE__ */ function(CodeChallengeMethod2) {
271
+ })({});
272
+ var CodeChallengeMethod = /* @__PURE__ */ (function(CodeChallengeMethod2) {
273
273
  CodeChallengeMethod2["plain"] = "plain";
274
274
  CodeChallengeMethod2["S256"] = "S256";
275
275
  return CodeChallengeMethod2;
276
- }({});
277
- var PARMode = /* @__PURE__ */ function(PARMode2) {
276
+ })({});
277
+ var PARMode = /* @__PURE__ */ (function(PARMode2) {
278
278
  PARMode2[PARMode2["REQUIRE"] = 0] = "REQUIRE";
279
279
  PARMode2[PARMode2["AUTO"] = 1] = "AUTO";
280
280
  PARMode2[PARMode2["NEVER"] = 2] = "NEVER";
281
281
  return PARMode2;
282
- }({});
283
- var CreateRequestObjectMode = /* @__PURE__ */ function(CreateRequestObjectMode2) {
282
+ })({});
283
+ var CreateRequestObjectMode = /* @__PURE__ */ (function(CreateRequestObjectMode2) {
284
284
  CreateRequestObjectMode2[CreateRequestObjectMode2["NONE"] = 0] = "NONE";
285
285
  CreateRequestObjectMode2[CreateRequestObjectMode2["REQUEST_OBJECT"] = 1] = "REQUEST_OBJECT";
286
286
  CreateRequestObjectMode2[CreateRequestObjectMode2["REQUEST_URI"] = 2] = "REQUEST_URI";
287
287
  return CreateRequestObjectMode2;
288
- }({});
289
- var AuthzFlowType = /* @__PURE__ */ function(AuthzFlowType2) {
288
+ })({});
289
+ var AuthzFlowType = /* @__PURE__ */ (function(AuthzFlowType2) {
290
290
  AuthzFlowType2["AUTHORIZATION_CODE_FLOW"] = "Authorization Code Flow";
291
291
  AuthzFlowType2["PRE_AUTHORIZED_CODE_FLOW"] = "Pre-Authorized Code Flow";
292
292
  return AuthzFlowType2;
293
- }({});
293
+ })({});
294
294
  (function(AuthzFlowType2) {
295
295
  function valueOf(request) {
296
296
  if (PRE_AUTH_CODE_LITERAL in request) {
@@ -304,12 +304,12 @@ var AuthzFlowType = /* @__PURE__ */ function(AuthzFlowType2) {
304
304
 
305
305
  // lib/types/CredentialIssuance.types.ts
306
306
  init_cjs_shims();
307
- var JsonURIMode = /* @__PURE__ */ function(JsonURIMode2) {
307
+ var JsonURIMode = /* @__PURE__ */ (function(JsonURIMode2) {
308
308
  JsonURIMode2[JsonURIMode2["JSON_STRINGIFY"] = 0] = "JSON_STRINGIFY";
309
309
  JsonURIMode2[JsonURIMode2["X_FORM_WWW_URLENCODED"] = 1] = "X_FORM_WWW_URLENCODED";
310
310
  return JsonURIMode2;
311
- }({});
312
- var Alg = /* @__PURE__ */ function(Alg2) {
311
+ })({});
312
+ var Alg = /* @__PURE__ */ (function(Alg2) {
313
313
  Alg2["EdDSA"] = "EdDSA";
314
314
  Alg2["ES256"] = "ES256";
315
315
  Alg2["ES256K"] = "ES256K";
@@ -320,7 +320,7 @@ var Alg = /* @__PURE__ */ function(Alg2) {
320
320
  Alg2["RS384"] = "RS384";
321
321
  Alg2["RS512"] = "RS512";
322
322
  return Alg2;
323
- }({});
323
+ })({});
324
324
 
325
325
  // lib/types/v1_0_15.types.ts
326
326
  init_cjs_shims();
@@ -370,12 +370,12 @@ var authorizationServerMetadataFieldNames = [
370
370
  "code_challenge_methods_supported",
371
371
  "signed_metadata"
372
372
  ];
373
- var WellKnownEndpoints = /* @__PURE__ */ function(WellKnownEndpoints2) {
373
+ var WellKnownEndpoints = /* @__PURE__ */ (function(WellKnownEndpoints2) {
374
374
  WellKnownEndpoints2["OPENID_CONFIGURATION"] = "/.well-known/openid-configuration";
375
375
  WellKnownEndpoints2["OAUTH_AS"] = "/.well-known/oauth-authorization-server";
376
376
  WellKnownEndpoints2["OPENID4VCI_ISSUER"] = "/.well-known/openid-credential-issuer";
377
377
  return WellKnownEndpoints2;
378
- }({});
378
+ })({});
379
379
 
380
380
  // lib/types/OpenID4VCIErrors.ts
381
381
  init_cjs_shims();
@@ -418,20 +418,20 @@ var WRONG_METADATA_FORMAT = "Wrong metadata format";
418
418
 
419
419
  // lib/types/OpenID4VCIVersions.types.ts
420
420
  init_cjs_shims();
421
- var OpenId4VCIVersion = /* @__PURE__ */ function(OpenId4VCIVersion2) {
421
+ var OpenId4VCIVersion = /* @__PURE__ */ (function(OpenId4VCIVersion2) {
422
422
  OpenId4VCIVersion2[OpenId4VCIVersion2["VER_1_0_15"] = 1015] = "VER_1_0_15";
423
423
  OpenId4VCIVersion2[OpenId4VCIVersion2["VER_UNKNOWN"] = Number.MAX_VALUE] = "VER_UNKNOWN";
424
424
  return OpenId4VCIVersion2;
425
- }({});
426
- var DefaultURISchemes = /* @__PURE__ */ function(DefaultURISchemes2) {
425
+ })({});
426
+ var DefaultURISchemes = /* @__PURE__ */ (function(DefaultURISchemes2) {
427
427
  DefaultURISchemes2["INITIATE_ISSUANCE"] = "openid-initiate-issuance";
428
428
  DefaultURISchemes2["CREDENTIAL_OFFER"] = "openid-credential-offer";
429
429
  return DefaultURISchemes2;
430
- }({});
430
+ })({});
431
431
 
432
432
  // lib/types/StateManager.types.ts
433
433
  init_cjs_shims();
434
- var IssueStatus = /* @__PURE__ */ function(IssueStatus2) {
434
+ var IssueStatus = /* @__PURE__ */ (function(IssueStatus2) {
435
435
  IssueStatus2["OFFER_CREATED"] = "OFFER_CREATED";
436
436
  IssueStatus2["ACCESS_TOKEN_REQUESTED"] = "ACCESS_TOKEN_REQUESTED";
437
437
  IssueStatus2["ACCESS_TOKEN_CREATED"] = "ACCESS_TOKEN_CREATED";
@@ -442,18 +442,18 @@ var IssueStatus = /* @__PURE__ */ function(IssueStatus2) {
442
442
  IssueStatus2["NOTIFICATION_CREDENTIAL_FAILURE"] = "NOTIFICATION_CREDENTIAL_FAILURE";
443
443
  IssueStatus2["ERROR"] = "ERROR";
444
444
  return IssueStatus2;
445
- }({});
445
+ })({});
446
446
 
447
447
  // lib/types/Token.types.ts
448
448
  init_cjs_shims();
449
- var TokenErrorResponse = /* @__PURE__ */ function(TokenErrorResponse2) {
449
+ var TokenErrorResponse = /* @__PURE__ */ (function(TokenErrorResponse2) {
450
450
  TokenErrorResponse2["invalid_request"] = "invalid_request";
451
451
  TokenErrorResponse2["invalid_grant"] = "invalid_grant";
452
452
  TokenErrorResponse2["invalid_client"] = "invalid_client";
453
453
  TokenErrorResponse2["invalid_scope"] = "invalid_scope";
454
454
  TokenErrorResponse2["invalid_dpop_proof"] = "invalid_dpop_proof";
455
455
  return TokenErrorResponse2;
456
- }({});
456
+ })({});
457
457
  var TokenError = class _TokenError extends Error {
458
458
  static {
459
459
  __name(this, "TokenError");
@@ -533,7 +533,7 @@ ${typeof body == "string" ? body : JSON.stringify(body)}`);
533
533
  }
534
534
  logger.debug(`Headers:\r
535
535
  ${JSON.stringify(payload.headers)}`);
536
- const origResponse = await (0, import_cross_fetch.fetch)(url, payload);
536
+ const origResponse = await (0, import_cross_fetch.default)(url, payload);
537
537
  const isJSONResponse = accept === "application/json" || origResponse.headers.get("Content-Type") === "application/json";
538
538
  const success = origResponse && origResponse.status >= 200 && origResponse.status < 400;
539
539
  const responseText = await origResponse.text();
@@ -1199,7 +1199,7 @@ function getTypesFromCredentialSupported(credentialSupported, opts) {
1199
1199
  let types = [];
1200
1200
  if (credentialSupported.format === "jwt_vc_json" || credentialSupported.format === "jwt_vc" || credentialSupported.format === "jwt_vc_json-ld" || credentialSupported.format === "ldp_vc") {
1201
1201
  types = getTypesFromObject(credentialSupported) ?? [];
1202
- } else if (credentialSupported.format === "dc+sd-jwt") {
1202
+ } else if (credentialSupported.format === "dc+sd-jwt" || credentialSupported.format === "vc+sd-jwt") {
1203
1203
  types = [
1204
1204
  credentialSupported.vct
1205
1205
  ];
@@ -1577,22 +1577,22 @@ var EXPERIMENTAL_SUBJECT_PROOF_MODE_ENABLED = process.env.EXPERIMENTAL_SUBJECT_P
1577
1577
  // lib/events/index.ts
1578
1578
  init_cjs_shims();
1579
1579
  var import_ssi_types4 = require("@sphereon/ssi-types");
1580
- var CredentialOfferEventNames = /* @__PURE__ */ function(CredentialOfferEventNames2) {
1580
+ var CredentialOfferEventNames = /* @__PURE__ */ (function(CredentialOfferEventNames2) {
1581
1581
  CredentialOfferEventNames2["OID4VCI_OFFER_CREATED"] = "OID4VCI_OFFER_CREATED";
1582
1582
  CredentialOfferEventNames2["OID4VCI_OFFER_EXPIRED"] = "OID4VCI_OFFER_EXPIRED";
1583
1583
  CredentialOfferEventNames2["OID4VCI_OFFER_DELETED"] = "OID4VCI_OFFER_DELETED";
1584
1584
  return CredentialOfferEventNames2;
1585
- }({});
1586
- var CredentialEventNames = /* @__PURE__ */ function(CredentialEventNames2) {
1585
+ })({});
1586
+ var CredentialEventNames = /* @__PURE__ */ (function(CredentialEventNames2) {
1587
1587
  CredentialEventNames2["OID4VCI_CREDENTIAL_ISSUED"] = "OID4VCI_CREDENTIAL_ISSUED";
1588
1588
  return CredentialEventNames2;
1589
- }({});
1590
- var NotificationStatusEventNames = /* @__PURE__ */ function(NotificationStatusEventNames2) {
1589
+ })({});
1590
+ var NotificationStatusEventNames = /* @__PURE__ */ (function(NotificationStatusEventNames2) {
1591
1591
  NotificationStatusEventNames2["OID4VCI_NOTIFICATION_RECEIVED"] = "OID4VCI_NOTIFICATION_RECEIVED";
1592
1592
  NotificationStatusEventNames2["OID4VCI_NOTIFICATION_PROCESSED"] = "OID4VCI_NOTIFICATION_PROCESSED";
1593
1593
  NotificationStatusEventNames2["OID4VCI_NOTIFICATION_ERROR"] = "OID4VCI_NOTIFICATION_ERROR";
1594
1594
  return NotificationStatusEventNames2;
1595
- }({});
1595
+ })({});
1596
1596
  var EVENTS = import_ssi_types4.EventManager.instance();
1597
1597
 
1598
1598
  // lib/index.ts