@sphereon/oid4vci-client 0.10.3 → 0.10.4-unstable.15

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.
Files changed (105) hide show
  1. package/dist/AccessTokenClient.d.ts +5 -5
  2. package/dist/AccessTokenClient.d.ts.map +1 -1
  3. package/dist/AccessTokenClient.js +45 -25
  4. package/dist/AccessTokenClient.js.map +1 -1
  5. package/dist/AccessTokenClientV1_0_11.d.ts +29 -0
  6. package/dist/AccessTokenClientV1_0_11.d.ts.map +1 -0
  7. package/dist/AccessTokenClientV1_0_11.js +212 -0
  8. package/dist/AccessTokenClientV1_0_11.js.map +1 -0
  9. package/dist/AuthorizationCodeClient.d.ts +5 -5
  10. package/dist/AuthorizationCodeClient.d.ts.map +1 -1
  11. package/dist/AuthorizationCodeClient.js +19 -8
  12. package/dist/AuthorizationCodeClient.js.map +1 -1
  13. package/dist/AuthorizationCodeClientV1_0_11.d.ts +9 -0
  14. package/dist/AuthorizationCodeClientV1_0_11.d.ts.map +1 -0
  15. package/dist/AuthorizationCodeClientV1_0_11.js +132 -0
  16. package/dist/AuthorizationCodeClientV1_0_11.js.map +1 -0
  17. package/dist/CredentialOfferClient.d.ts.map +1 -1
  18. package/dist/CredentialOfferClient.js +14 -25
  19. package/dist/CredentialOfferClient.js.map +1 -1
  20. package/dist/CredentialOfferClientV1_0_11.d.ts +10 -0
  21. package/dist/CredentialOfferClientV1_0_11.d.ts.map +1 -0
  22. package/dist/CredentialOfferClientV1_0_11.js +103 -0
  23. package/dist/CredentialOfferClientV1_0_11.js.map +1 -0
  24. package/dist/CredentialRequestClient.d.ts +1 -1
  25. package/dist/CredentialRequestClient.d.ts.map +1 -1
  26. package/dist/CredentialRequestClient.js +11 -8
  27. package/dist/CredentialRequestClient.js.map +1 -1
  28. package/dist/CredentialRequestClientBuilder.d.ts +3 -3
  29. package/dist/CredentialRequestClientBuilder.d.ts.map +1 -1
  30. package/dist/CredentialRequestClientBuilder.js +4 -4
  31. package/dist/CredentialRequestClientBuilder.js.map +1 -1
  32. package/dist/CredentialRequestClientBuilderV1_0_11.d.ts +46 -0
  33. package/dist/CredentialRequestClientBuilderV1_0_11.d.ts.map +1 -0
  34. package/dist/CredentialRequestClientBuilderV1_0_11.js +117 -0
  35. package/dist/CredentialRequestClientBuilderV1_0_11.js.map +1 -0
  36. package/dist/CredentialRequestClientV1_0_11.d.ts +44 -0
  37. package/dist/CredentialRequestClientV1_0_11.d.ts.map +1 -0
  38. package/dist/CredentialRequestClientV1_0_11.js +151 -0
  39. package/dist/CredentialRequestClientV1_0_11.js.map +1 -0
  40. package/dist/MetadataClient.d.ts +5 -15
  41. package/dist/MetadataClient.d.ts.map +1 -1
  42. package/dist/MetadataClient.js +13 -33
  43. package/dist/MetadataClient.js.map +1 -1
  44. package/dist/MetadataClientV1_0_11.d.ts +31 -0
  45. package/dist/MetadataClientV1_0_11.d.ts.map +1 -0
  46. package/dist/MetadataClientV1_0_11.js +182 -0
  47. package/dist/MetadataClientV1_0_11.js.map +1 -0
  48. package/dist/OpenID4VCIClient.d.ts +5 -17
  49. package/dist/OpenID4VCIClient.d.ts.map +1 -1
  50. package/dist/OpenID4VCIClient.js +19 -90
  51. package/dist/OpenID4VCIClient.js.map +1 -1
  52. package/dist/OpenID4VCIClientV1_0_11.d.ts +107 -0
  53. package/dist/OpenID4VCIClientV1_0_11.d.ts.map +1 -0
  54. package/dist/OpenID4VCIClientV1_0_11.js +462 -0
  55. package/dist/OpenID4VCIClientV1_0_11.js.map +1 -0
  56. package/dist/ProofOfPossessionBuilder.js +1 -1
  57. package/dist/ProofOfPossessionBuilder.js.map +1 -1
  58. package/dist/functions/OpenIDUtils.d.ts +12 -0
  59. package/dist/functions/OpenIDUtils.d.ts.map +1 -0
  60. package/dist/functions/OpenIDUtils.js +37 -0
  61. package/dist/functions/OpenIDUtils.js.map +1 -0
  62. package/dist/functions/ProofUtil.d.ts.map +1 -1
  63. package/dist/index.d.ts +8 -1
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +8 -1
  66. package/dist/index.js.map +1 -1
  67. package/lib/AccessTokenClient.ts +277 -245
  68. package/lib/AccessTokenClientV1_0_11.ts +255 -0
  69. package/lib/AuthorizationCodeClient.ts +183 -163
  70. package/lib/AuthorizationCodeClientV1_0_11.ts +167 -0
  71. package/lib/CredentialOfferClient.ts +99 -111
  72. package/lib/CredentialOfferClientV1_0_11.ts +112 -0
  73. package/lib/CredentialRequestClient.ts +212 -208
  74. package/lib/CredentialRequestClientBuilder.ts +156 -155
  75. package/lib/CredentialRequestClientBuilderV1_0_11.ts +156 -0
  76. package/lib/CredentialRequestClientV1_0_11.ts +190 -0
  77. package/lib/MetadataClient.ts +186 -208
  78. package/lib/MetadataClientV1_0_11.ts +186 -0
  79. package/lib/OpenID4VCIClient.ts +547 -629
  80. package/lib/OpenID4VCIClientV1_0_11.ts +644 -0
  81. package/lib/ProofOfPossessionBuilder.ts +204 -204
  82. package/lib/__tests__/AccessTokenClient.spec.ts +239 -211
  83. package/lib/__tests__/CredentialRequestClient.spec.ts +328 -311
  84. package/lib/__tests__/CredentialRequestClientBuilder.spec.ts +131 -131
  85. package/lib/__tests__/CredentialRequestClientV1_0_11.spec.ts +316 -0
  86. package/lib/__tests__/EBSIE2E.spec.test.ts +145 -145
  87. package/lib/__tests__/IT.spec.ts +382 -171
  88. package/lib/__tests__/IssuanceInitiation.spec.ts +64 -61
  89. package/lib/__tests__/IssuanceInitiationV1_0_11.spec.ts +62 -0
  90. package/lib/__tests__/JsonURIConversions.spec.ts +146 -146
  91. package/lib/__tests__/MattrE2E.spec.test.ts +104 -104
  92. package/lib/__tests__/MetadataClient.spec.ts +324 -260
  93. package/lib/__tests__/MetadataMocks.ts +483 -444
  94. package/lib/__tests__/OpenID4VCIClient.spec.ts +202 -202
  95. package/lib/__tests__/{OpenID4VCIClientPAR.spec.ts → OpenID4VCIClientPARV1_0_11.spec.ts} +122 -122
  96. package/lib/__tests__/OpenID4VCIClientV1_0_11.spec.ts +202 -0
  97. package/lib/__tests__/ProofOfPossessionBuilder.spec.ts +110 -110
  98. package/lib/__tests__/SdJwt.spec.ts +170 -163
  99. package/lib/__tests__/SphereonE2E.spec.test.ts +169 -169
  100. package/lib/__tests__/data/VciDataFixtures.ts +1382 -745
  101. package/lib/functions/AuthorizationUtil.ts +18 -18
  102. package/lib/functions/OpenIDUtils.ts +25 -0
  103. package/lib/functions/ProofUtil.ts +128 -128
  104. package/lib/index.ts +16 -9
  105. package/package.json +3 -3
@@ -0,0 +1,12 @@
1
+ import { OpenIDResponse, WellKnownEndpoints } from '@sphereon/oid4vci-common';
2
+ /**
3
+ * Allows to retrieve information from a well-known location
4
+ *
5
+ * @param host The host
6
+ * @param endpointType The endpoint type, currently supports OID4VCI, OIDC and OAuth2 endpoint types
7
+ * @param opts Options, like for instance whether an error should be thrown in case the endpoint doesn't exist
8
+ */
9
+ export declare const retrieveWellknown: <T>(host: string, endpointType: WellKnownEndpoints, opts?: {
10
+ errorOnNotFound?: boolean;
11
+ }) => Promise<OpenIDResponse<T>>;
12
+ //# sourceMappingURL=OpenIDUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenIDUtils.d.ts","sourceRoot":"","sources":["../../lib/functions/OpenIDUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAItF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,YACtB,MAAM,gBACE,kBAAkB,SACzB;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,KACnC,QAAQ,eAAe,CAAC,CAAC,CAS3B,CAAA"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.retrieveWellknown = void 0;
16
+ const oid4vci_common_1 = require("@sphereon/oid4vci-common");
17
+ const debug_1 = __importDefault(require("debug"));
18
+ const debug = (0, debug_1.default)('sphereon:openid4vci:openid-utils');
19
+ /**
20
+ * Allows to retrieve information from a well-known location
21
+ *
22
+ * @param host The host
23
+ * @param endpointType The endpoint type, currently supports OID4VCI, OIDC and OAuth2 endpoint types
24
+ * @param opts Options, like for instance whether an error should be thrown in case the endpoint doesn't exist
25
+ */
26
+ const retrieveWellknown = (host, endpointType, opts) => __awaiter(void 0, void 0, void 0, function* () {
27
+ const result = yield (0, oid4vci_common_1.getJson)(`${host.endsWith('/') ? host.slice(0, -1) : host}${endpointType}`, {
28
+ exceptionOnHttpErrorStatus: opts === null || opts === void 0 ? void 0 : opts.errorOnNotFound,
29
+ });
30
+ if (result.origResponse.status >= 400) {
31
+ // We only get here when error on not found is false
32
+ debug(`host ${host} with endpoint type ${endpointType} status: ${result.origResponse.status}, ${result.origResponse.statusText}`);
33
+ }
34
+ return result;
35
+ });
36
+ exports.retrieveWellknown = retrieveWellknown;
37
+ //# sourceMappingURL=OpenIDUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenIDUtils.js","sourceRoot":"","sources":["../../lib/functions/OpenIDUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAsF;AACtF,kDAA0B;AAE1B,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,kCAAkC,CAAC,CAAC;AACxD;;;;;;GAMG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AAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"ProofUtil.d.ts","sourceRoot":"","sources":["../../lib/functions/ProofUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,GAAG,EAEH,GAAG,EAGH,iBAAiB,EACjB,0BAA0B,EAC1B,GAAG,EACJ,MAAM,0BAA0B,CAAC;AAKlC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,sBACvB,2BAA2B,MAAM,CAAC,aAClC,QAAQ,gBACL,GAAG,KAChB,QAAQ,iBAAiB,CA0B3B,CAAC;AAQF,MAAM,WAAW,QAAQ;IACvB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,17 @@
1
1
  export * from './AccessTokenClient';
2
+ export * from './AccessTokenClientV1_0_11';
3
+ export * from './AuthorizationCodeClient';
4
+ export * from './AuthorizationCodeClientV1_0_11';
2
5
  export * from './CredentialRequestClient';
3
6
  export * from './CredentialOfferClient';
4
- export * from './CredentialRequestClient';
7
+ export * from './CredentialOfferClientV1_0_11';
8
+ export * from './CredentialRequestClientV1_0_11';
5
9
  export * from './CredentialRequestClientBuilder';
10
+ export * from './CredentialRequestClientBuilderV1_0_11';
6
11
  export * from './functions';
7
12
  export * from './MetadataClient';
13
+ export * from './MetadataClientV1_0_11';
8
14
  export * from './OpenID4VCIClient';
15
+ export * from './OpenID4VCIClientV1_0_11';
9
16
  export * from './ProofOfPossessionBuilder';
10
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC"}
package/dist/index.js CHANGED
@@ -15,12 +15,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./AccessTokenClient"), exports);
18
+ __exportStar(require("./AccessTokenClientV1_0_11"), exports);
19
+ __exportStar(require("./AuthorizationCodeClient"), exports);
20
+ __exportStar(require("./AuthorizationCodeClientV1_0_11"), exports);
18
21
  __exportStar(require("./CredentialRequestClient"), exports);
19
22
  __exportStar(require("./CredentialOfferClient"), exports);
20
- __exportStar(require("./CredentialRequestClient"), exports);
23
+ __exportStar(require("./CredentialOfferClientV1_0_11"), exports);
24
+ __exportStar(require("./CredentialRequestClientV1_0_11"), exports);
21
25
  __exportStar(require("./CredentialRequestClientBuilder"), exports);
26
+ __exportStar(require("./CredentialRequestClientBuilderV1_0_11"), exports);
22
27
  __exportStar(require("./functions"), exports);
23
28
  __exportStar(require("./MetadataClient"), exports);
29
+ __exportStar(require("./MetadataClientV1_0_11"), exports);
24
30
  __exportStar(require("./OpenID4VCIClient"), exports);
31
+ __exportStar(require("./OpenID4VCIClientV1_0_11"), exports);
25
32
  __exportStar(require("./ProofOfPossessionBuilder"), exports);
26
33
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,4DAA0C;AAC1C,0DAAwC;AACxC,4DAA0C;AAC1C,mEAAiD;AACjD,8CAA4B;AAC5B,mDAAiC;AACjC,qDAAmC;AACnC,6DAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,6DAA2C;AAC3C,4DAA0C;AAC1C,mEAAiD;AACjD,4DAA0C;AAC1C,0DAAwC;AACxC,iEAA+C;AAC/C,mEAAiD;AACjD,mEAAiD;AACjD,0EAAwD;AACxD,8CAA4B;AAC5B,mDAAiC;AACjC,0DAAwC;AACxC,qDAAmC;AACnC,4DAA0C;AAC1C,6DAA2C"}