@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.
- package/dist/AccessTokenClient.d.ts +5 -5
- package/dist/AccessTokenClient.d.ts.map +1 -1
- package/dist/AccessTokenClient.js +45 -25
- package/dist/AccessTokenClient.js.map +1 -1
- package/dist/AccessTokenClientV1_0_11.d.ts +29 -0
- package/dist/AccessTokenClientV1_0_11.d.ts.map +1 -0
- package/dist/AccessTokenClientV1_0_11.js +212 -0
- package/dist/AccessTokenClientV1_0_11.js.map +1 -0
- package/dist/AuthorizationCodeClient.d.ts +5 -5
- package/dist/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/AuthorizationCodeClient.js +19 -8
- package/dist/AuthorizationCodeClient.js.map +1 -1
- package/dist/AuthorizationCodeClientV1_0_11.d.ts +9 -0
- package/dist/AuthorizationCodeClientV1_0_11.d.ts.map +1 -0
- package/dist/AuthorizationCodeClientV1_0_11.js +132 -0
- package/dist/AuthorizationCodeClientV1_0_11.js.map +1 -0
- package/dist/CredentialOfferClient.d.ts.map +1 -1
- package/dist/CredentialOfferClient.js +14 -25
- package/dist/CredentialOfferClient.js.map +1 -1
- package/dist/CredentialOfferClientV1_0_11.d.ts +10 -0
- package/dist/CredentialOfferClientV1_0_11.d.ts.map +1 -0
- package/dist/CredentialOfferClientV1_0_11.js +103 -0
- package/dist/CredentialOfferClientV1_0_11.js.map +1 -0
- package/dist/CredentialRequestClient.d.ts +1 -1
- package/dist/CredentialRequestClient.d.ts.map +1 -1
- package/dist/CredentialRequestClient.js +11 -8
- package/dist/CredentialRequestClient.js.map +1 -1
- package/dist/CredentialRequestClientBuilder.d.ts +3 -3
- package/dist/CredentialRequestClientBuilder.d.ts.map +1 -1
- package/dist/CredentialRequestClientBuilder.js +4 -4
- package/dist/CredentialRequestClientBuilder.js.map +1 -1
- package/dist/CredentialRequestClientBuilderV1_0_11.d.ts +46 -0
- package/dist/CredentialRequestClientBuilderV1_0_11.d.ts.map +1 -0
- package/dist/CredentialRequestClientBuilderV1_0_11.js +117 -0
- package/dist/CredentialRequestClientBuilderV1_0_11.js.map +1 -0
- package/dist/CredentialRequestClientV1_0_11.d.ts +44 -0
- package/dist/CredentialRequestClientV1_0_11.d.ts.map +1 -0
- package/dist/CredentialRequestClientV1_0_11.js +151 -0
- package/dist/CredentialRequestClientV1_0_11.js.map +1 -0
- package/dist/MetadataClient.d.ts +5 -15
- package/dist/MetadataClient.d.ts.map +1 -1
- package/dist/MetadataClient.js +13 -33
- package/dist/MetadataClient.js.map +1 -1
- package/dist/MetadataClientV1_0_11.d.ts +31 -0
- package/dist/MetadataClientV1_0_11.d.ts.map +1 -0
- package/dist/MetadataClientV1_0_11.js +182 -0
- package/dist/MetadataClientV1_0_11.js.map +1 -0
- package/dist/OpenID4VCIClient.d.ts +5 -17
- package/dist/OpenID4VCIClient.d.ts.map +1 -1
- package/dist/OpenID4VCIClient.js +19 -90
- package/dist/OpenID4VCIClient.js.map +1 -1
- package/dist/OpenID4VCIClientV1_0_11.d.ts +107 -0
- package/dist/OpenID4VCIClientV1_0_11.d.ts.map +1 -0
- package/dist/OpenID4VCIClientV1_0_11.js +462 -0
- package/dist/OpenID4VCIClientV1_0_11.js.map +1 -0
- package/dist/ProofOfPossessionBuilder.js +1 -1
- package/dist/ProofOfPossessionBuilder.js.map +1 -1
- package/dist/functions/OpenIDUtils.d.ts +12 -0
- package/dist/functions/OpenIDUtils.d.ts.map +1 -0
- package/dist/functions/OpenIDUtils.js +37 -0
- package/dist/functions/OpenIDUtils.js.map +1 -0
- package/dist/functions/ProofUtil.d.ts.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/lib/AccessTokenClient.ts +277 -245
- package/lib/AccessTokenClientV1_0_11.ts +255 -0
- package/lib/AuthorizationCodeClient.ts +183 -163
- package/lib/AuthorizationCodeClientV1_0_11.ts +167 -0
- package/lib/CredentialOfferClient.ts +99 -111
- package/lib/CredentialOfferClientV1_0_11.ts +112 -0
- package/lib/CredentialRequestClient.ts +212 -208
- package/lib/CredentialRequestClientBuilder.ts +156 -155
- package/lib/CredentialRequestClientBuilderV1_0_11.ts +156 -0
- package/lib/CredentialRequestClientV1_0_11.ts +190 -0
- package/lib/MetadataClient.ts +186 -208
- package/lib/MetadataClientV1_0_11.ts +186 -0
- package/lib/OpenID4VCIClient.ts +547 -629
- package/lib/OpenID4VCIClientV1_0_11.ts +644 -0
- package/lib/ProofOfPossessionBuilder.ts +204 -204
- package/lib/__tests__/AccessTokenClient.spec.ts +239 -211
- package/lib/__tests__/CredentialRequestClient.spec.ts +328 -311
- package/lib/__tests__/CredentialRequestClientBuilder.spec.ts +131 -131
- package/lib/__tests__/CredentialRequestClientV1_0_11.spec.ts +316 -0
- package/lib/__tests__/EBSIE2E.spec.test.ts +145 -145
- package/lib/__tests__/IT.spec.ts +382 -171
- package/lib/__tests__/IssuanceInitiation.spec.ts +64 -61
- package/lib/__tests__/IssuanceInitiationV1_0_11.spec.ts +62 -0
- package/lib/__tests__/JsonURIConversions.spec.ts +146 -146
- package/lib/__tests__/MattrE2E.spec.test.ts +104 -104
- package/lib/__tests__/MetadataClient.spec.ts +324 -260
- package/lib/__tests__/MetadataMocks.ts +483 -444
- package/lib/__tests__/OpenID4VCIClient.spec.ts +202 -202
- package/lib/__tests__/{OpenID4VCIClientPAR.spec.ts → OpenID4VCIClientPARV1_0_11.spec.ts} +122 -122
- package/lib/__tests__/OpenID4VCIClientV1_0_11.spec.ts +202 -0
- package/lib/__tests__/ProofOfPossessionBuilder.spec.ts +110 -110
- package/lib/__tests__/SdJwt.spec.ts +170 -163
- package/lib/__tests__/SphereonE2E.spec.test.ts +169 -169
- package/lib/__tests__/data/VciDataFixtures.ts +1382 -745
- package/lib/functions/AuthorizationUtil.ts +18 -18
- package/lib/functions/OpenIDUtils.ts +25 -0
- package/lib/functions/ProofUtil.ts +128 -128
- package/lib/index.ts +16 -9
- 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;AACI,MAAM,iBAAiB,GAAG,CAC/B,IAAY,EACZ,YAAgC,EAChC,IAAoC,EACR,EAAE;IAC9B,MAAM,MAAM,GAAsB,MAAM,IAAA,wBAAO,EAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,YAAY,EAAE,EAAE;QACnH,0BAA0B,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,eAAe;KAClD,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;QACtC,oDAAoD;QACpD,KAAK,CAAC,QAAQ,IAAI,uBAAuB,YAAY,YAAY,MAAM,CAAC,YAAY,CAAC,MAAM,KAAK,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC,CAAC;IACpI,CAAC;IACD,OAAO,MAAM,CAAC;AACd,CAAC,CAAA,CAAA;AAbY,QAAA,iBAAiB,qBAa7B"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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 './
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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("./
|
|
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,
|
|
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"}
|