@sphereon/ssi-sdk.siopv2-oid4vp-common 0.33.1-feature.vcdm2.tsup.32 → 0.33.1-next.2

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.
@@ -0,0 +1,27 @@
1
+ import { AuthorizationResponsePayload } from '@sphereon/did-auth-siop';
2
+ import { AdditionalClaims } from '@sphereon/ssi-types';
3
+ export interface ClaimPayloadCommonOpts {
4
+ [x: string]: any;
5
+ }
6
+ export interface AuthorizationChallengeValidationResponse {
7
+ presentation_during_issuance_session: string;
8
+ }
9
+ export type AuthorizationRequestStateStatus = 'created' | 'sent' | 'received' | 'verified' | 'error';
10
+ export type AuthorizationResponseStateStatus = 'created' | 'sent' | 'received' | 'verified' | 'error';
11
+ export interface GenerateAuthRequestURIResponse {
12
+ correlationId: string;
13
+ state: string;
14
+ definitionId: string;
15
+ authRequestURI: string;
16
+ authStatusURI: string;
17
+ }
18
+ export interface AuthStatusResponse {
19
+ status: AuthorizationRequestStateStatus | AuthorizationResponseStateStatus;
20
+ correlationId: string;
21
+ error?: string;
22
+ definitionId: string;
23
+ lastUpdated: number;
24
+ payload?: AuthorizationResponsePayload;
25
+ verifiedData?: AdditionalClaims;
26
+ }
27
+ //# sourceMappingURL=auth-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-model.d.ts","sourceRoot":"","sources":["../src/auth-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,WAAW,sBAAsB;IACrC,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CACjB;AAED,MAAM,WAAW,wCAAwC;IACvD,oCAAoC,EAAE,MAAM,CAAA;CAC7C;AAED,MAAM,MAAM,+BAA+B,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAA;AAEpG,MAAM,MAAM,gCAAgC,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAA;AAErG,MAAM,WAAW,8BAA8B;IAC7C,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,+BAA+B,GAAG,gCAAgC,CAAA;IAC1E,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,4BAA4B,CAAA;IACtC,YAAY,CAAC,EAAE,gBAAgB,CAAA;CAChC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=auth-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-model.js","sourceRoot":"","sources":["../src/auth-model.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -1,35 +1,7 @@
1
- import { AuthorizationResponsePayload } from '@sphereon/did-auth-siop';
2
- export { AuthorizationRequest, AuthorizationRequestPayload, AuthorizationRequestState, AuthorizationResponse, AuthorizationResponsePayload, OP, OPBuilder, PresentationDefinitionWithLocation, PresentationVerificationCallback, PresentationVerificationResult, RP, RequestObjectPayload, SupportedVersion, URI, VPTokenLocation, decodeUriAsJson, encodeJsonAsURI } from '@sphereon/did-auth-siop';
3
- import { AdditionalClaims } from '@sphereon/ssi-types';
4
-
5
- interface ClaimPayloadCommonOpts {
6
- [x: string]: any;
7
- }
8
- interface AuthorizationChallengeValidationResponse {
9
- presentation_during_issuance_session: string;
10
- }
11
- type AuthorizationRequestStateStatus = 'created' | 'sent' | 'received' | 'verified' | 'error';
12
- type AuthorizationResponseStateStatus = 'created' | 'sent' | 'received' | 'verified' | 'error';
13
- interface GenerateAuthRequestURIResponse {
14
- correlationId: string;
15
- state: string;
16
- definitionId: string;
17
- authRequestURI: string;
18
- authStatusURI: string;
19
- }
20
- interface AuthStatusResponse {
21
- status: AuthorizationRequestStateStatus | AuthorizationResponseStateStatus;
22
- correlationId: string;
23
- error?: string;
24
- definitionId: string;
25
- lastUpdated: number;
26
- payload?: AuthorizationResponsePayload;
27
- verifiedData?: AdditionalClaims;
28
- }
29
-
30
- declare function uriWithBase(path: string, opts?: {
31
- baseURI?: string;
32
- envVarName?: string;
33
- }): string;
34
-
35
- export { type AuthStatusResponse, type AuthorizationChallengeValidationResponse, type AuthorizationRequestStateStatus, type AuthorizationResponseStateStatus, type ClaimPayloadCommonOpts, type GenerateAuthRequestURIResponse, uriWithBase };
1
+ export * from './auth-model';
2
+ export * from './utils';
3
+ /**
4
+ * @private
5
+ */
6
+ export { decodeUriAsJson, encodeJsonAsURI, AuthorizationResponsePayload, AuthorizationRequestPayload, URI, AuthorizationRequestState, RequestObjectPayload, AuthorizationRequest, AuthorizationResponse, RP, OP, OPBuilder, SupportedVersion, PresentationDefinitionWithLocation, PresentationVerificationResult, PresentationVerificationCallback, VPTokenLocation, } from '@sphereon/did-auth-siop';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AAGvB;;GAEG;AACH,OAAO,EACL,eAAe,EACf,eAAe,EACf,4BAA4B,EAC5B,2BAA2B,EAC3B,GAAG,EACH,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,EAAE,EACF,EAAE,EACF,SAAS,EACT,gBAAgB,EAChB,kCAAkC,EAClC,8BAA8B,EAC9B,gCAAgC,EAChC,eAAe,GAChB,MAAM,yBAAyB,CAAA"}
package/dist/index.js CHANGED
@@ -1,39 +1,35 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/utils.ts
5
- function uriWithBase(path, opts) {
6
- let baseUri = `${!!opts?.baseURI ? opts.baseURI : opts?.envVarName && process ? process.env[opts.envVarName] : process?.env?.BACKEND_BASE_URI}`;
7
- if (!baseUri || baseUri === "undefined") {
8
- throw Error("No base URI provided as param or environment variable");
9
- } else if (!baseUri.startsWith("http")) {
10
- throw Error(`Base URI needs to start with http(s). Received: ${baseUri}`);
11
- }
12
- baseUri = baseUri.endsWith("/") ? baseUri.substring(0, baseUri.length - 1) : baseUri;
13
- return `${baseUri}${path.startsWith("/") ? path : "/" + path}`;
14
- }
15
- __name(uriWithBase, "uriWithBase");
16
-
17
- // src/index.ts
18
- import { decodeUriAsJson, encodeJsonAsURI, AuthorizationResponsePayload, AuthorizationRequestPayload, URI, AuthorizationRequestState, RequestObjectPayload, AuthorizationRequest, AuthorizationResponse, RP, OP, OPBuilder, SupportedVersion, PresentationDefinitionWithLocation, PresentationVerificationResult, PresentationVerificationCallback, VPTokenLocation } from "@sphereon/did-auth-siop";
19
- export {
20
- AuthorizationRequest,
21
- AuthorizationRequestPayload,
22
- AuthorizationRequestState,
23
- AuthorizationResponse,
24
- AuthorizationResponsePayload,
25
- OP,
26
- OPBuilder,
27
- PresentationDefinitionWithLocation,
28
- PresentationVerificationCallback,
29
- PresentationVerificationResult,
30
- RP,
31
- RequestObjectPayload,
32
- SupportedVersion,
33
- URI,
34
- VPTokenLocation,
35
- decodeUriAsJson,
36
- encodeJsonAsURI,
37
- uriWithBase
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
38
15
  };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.VPTokenLocation = exports.SupportedVersion = exports.OPBuilder = exports.OP = exports.RP = exports.AuthorizationResponse = exports.AuthorizationRequest = exports.URI = exports.encodeJsonAsURI = exports.decodeUriAsJson = void 0;
18
+ __exportStar(require("./auth-model"), exports);
19
+ __exportStar(require("./utils"), exports);
20
+ // We are exporting some common class from SIOP
21
+ /**
22
+ * @private
23
+ */
24
+ var did_auth_siop_1 = require("@sphereon/did-auth-siop");
25
+ Object.defineProperty(exports, "decodeUriAsJson", { enumerable: true, get: function () { return did_auth_siop_1.decodeUriAsJson; } });
26
+ Object.defineProperty(exports, "encodeJsonAsURI", { enumerable: true, get: function () { return did_auth_siop_1.encodeJsonAsURI; } });
27
+ Object.defineProperty(exports, "URI", { enumerable: true, get: function () { return did_auth_siop_1.URI; } });
28
+ Object.defineProperty(exports, "AuthorizationRequest", { enumerable: true, get: function () { return did_auth_siop_1.AuthorizationRequest; } });
29
+ Object.defineProperty(exports, "AuthorizationResponse", { enumerable: true, get: function () { return did_auth_siop_1.AuthorizationResponse; } });
30
+ Object.defineProperty(exports, "RP", { enumerable: true, get: function () { return did_auth_siop_1.RP; } });
31
+ Object.defineProperty(exports, "OP", { enumerable: true, get: function () { return did_auth_siop_1.OP; } });
32
+ Object.defineProperty(exports, "OPBuilder", { enumerable: true, get: function () { return did_auth_siop_1.OPBuilder; } });
33
+ Object.defineProperty(exports, "SupportedVersion", { enumerable: true, get: function () { return did_auth_siop_1.SupportedVersion; } });
34
+ Object.defineProperty(exports, "VPTokenLocation", { enumerable: true, get: function () { return did_auth_siop_1.VPTokenLocation; } });
39
35
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils.ts","../src/index.ts"],"sourcesContent":["export function uriWithBase(path: string, opts?: { baseURI?: string; envVarName?: string }) {\n let baseUri = `${!!opts?.baseURI ? opts.baseURI : opts?.envVarName && process ? process.env[opts.envVarName!] : process?.env?.BACKEND_BASE_URI}`\n if (!baseUri || baseUri === 'undefined') {\n throw Error('No base URI provided as param or environment variable')\n } else if (!baseUri.startsWith('http')) {\n throw Error(`Base URI needs to start with http(s). Received: ${baseUri}`)\n }\n baseUri = baseUri.endsWith('/') ? baseUri.substring(0, baseUri.length - 1) : baseUri\n return `${baseUri}${path.startsWith('/') ? path : '/' + path}`\n}\n","export * from './auth-model'\nexport * from './utils'\n\n// We are exporting some common class from SIOP\n/**\n * @private\n */\nexport {\n decodeUriAsJson,\n encodeJsonAsURI,\n AuthorizationResponsePayload,\n AuthorizationRequestPayload,\n URI,\n AuthorizationRequestState,\n RequestObjectPayload,\n AuthorizationRequest,\n AuthorizationResponse,\n RP,\n OP,\n OPBuilder,\n SupportedVersion,\n PresentationDefinitionWithLocation,\n PresentationVerificationResult,\n PresentationVerificationCallback,\n VPTokenLocation,\n} from '@sphereon/did-auth-siop'\n"],"mappings":";;;;AAAO,SAASA,YAAYC,MAAcC,MAAgD;AACxF,MAAIC,UAAU,GAAG,CAAC,CAACD,MAAME,UAAUF,KAAKE,UAAUF,MAAMG,cAAcC,UAAUA,QAAQC,IAAIL,KAAKG,UAAU,IAAKC,SAASC,KAAKC,gBAAAA;AAC9H,MAAI,CAACL,WAAWA,YAAY,aAAa;AACvC,UAAMM,MAAM,uDAAA;EACd,WAAW,CAACN,QAAQO,WAAW,MAAA,GAAS;AACtC,UAAMD,MAAM,mDAAmDN,OAAAA,EAAS;EAC1E;AACAA,YAAUA,QAAQQ,SAAS,GAAA,IAAOR,QAAQS,UAAU,GAAGT,QAAQU,SAAS,CAAA,IAAKV;AAC7E,SAAO,GAAGA,OAAAA,GAAUF,KAAKS,WAAW,GAAA,IAAOT,OAAO,MAAMA,IAAAA;AAC1D;AATgBD;;;ACOhB,SACEc,iBACAC,iBACAC,8BACAC,6BACAC,KACAC,2BACAC,sBACAC,sBACAC,uBACAC,IACAC,IACAC,WACAC,kBACAC,oCACAC,gCACAC,kCACAC,uBACK;","names":["uriWithBase","path","opts","baseUri","baseURI","envVarName","process","env","BACKEND_BASE_URI","Error","startsWith","endsWith","substring","length","decodeUriAsJson","encodeJsonAsURI","AuthorizationResponsePayload","AuthorizationRequestPayload","URI","AuthorizationRequestState","RequestObjectPayload","AuthorizationRequest","AuthorizationResponse","RP","OP","OPBuilder","SupportedVersion","PresentationDefinitionWithLocation","PresentationVerificationResult","PresentationVerificationCallback","VPTokenLocation"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,0CAAuB;AAEvB,+CAA+C;AAC/C;;GAEG;AACH,yDAkBgC;AAjB9B,gHAAA,eAAe,OAAA;AACf,gHAAA,eAAe,OAAA;AAGf,oGAAA,GAAG,OAAA;AAGH,qHAAA,oBAAoB,OAAA;AACpB,sHAAA,qBAAqB,OAAA;AACrB,mGAAA,EAAE,OAAA;AACF,mGAAA,EAAE,OAAA;AACF,0GAAA,SAAS,OAAA;AACT,iHAAA,gBAAgB,OAAA;AAIhB,gHAAA,eAAe,OAAA"}
@@ -0,0 +1,5 @@
1
+ export declare function uriWithBase(path: string, opts?: {
2
+ baseURI?: string;
3
+ envVarName?: string;
4
+ }): string;
5
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,UASzF"}
package/dist/utils.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uriWithBase = uriWithBase;
4
+ function uriWithBase(path, opts) {
5
+ var _a;
6
+ let baseUri = `${!!(opts === null || opts === void 0 ? void 0 : opts.baseURI) ? opts.baseURI : (opts === null || opts === void 0 ? void 0 : opts.envVarName) && process ? process.env[opts.envVarName] : (_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.BACKEND_BASE_URI}`;
7
+ if (!baseUri || baseUri === 'undefined') {
8
+ throw Error('No base URI provided as param or environment variable');
9
+ }
10
+ else if (!baseUri.startsWith('http')) {
11
+ throw Error(`Base URI needs to start with http(s). Received: ${baseUri}`);
12
+ }
13
+ baseUri = baseUri.endsWith('/') ? baseUri.substring(0, baseUri.length - 1) : baseUri;
14
+ return `${baseUri}${path.startsWith('/') ? path : '/' + path}`;
15
+ }
16
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAAA,kCASC;AATD,SAAgB,WAAW,CAAC,IAAY,EAAE,IAAgD;;IACxF,IAAI,OAAO,GAAG,GAAG,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAA,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,KAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,0CAAE,gBAAgB,EAAE,CAAA;IAChJ,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QACxC,MAAM,KAAK,CAAC,uDAAuD,CAAC,CAAA;IACtE,CAAC;SAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,MAAM,KAAK,CAAC,mDAAmD,OAAO,EAAE,CAAC,CAAA;IAC3E,CAAC;IACD,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IACpF,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,CAAA;AAChE,CAAC"}
package/package.json CHANGED
@@ -1,23 +1,10 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.siopv2-oid4vp-common",
3
- "version": "0.33.1-feature.vcdm2.tsup.32+203a9d60",
3
+ "version": "0.33.1-next.2+6f7f40b9",
4
4
  "description": "Common SIOPv2 and OID4VP types between modules",
5
5
  "source": "src/index.ts",
6
- "type": "module",
7
- "main": "./dist/index.cjs",
8
- "module": "./dist/index.js",
9
- "types": "./dist/index.d.ts",
10
- "exports": {
11
- "react-native": "./dist/index.js",
12
- "import": {
13
- "types": "./dist/index.d.ts",
14
- "import": "./dist/index.js"
15
- },
16
- "require": {
17
- "types": "./dist/index.d.cts",
18
- "require": "./dist/index.cjs"
19
- }
20
- },
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
21
8
  "author": "Sphereon <dev@sphereon.com>",
22
9
  "license": "Apache-2.0",
23
10
  "private": false,
@@ -25,23 +12,21 @@
25
12
  "access": "public"
26
13
  },
27
14
  "dependencies": {
28
- "@sphereon/did-auth-siop": "0.17.1-feature.esm.cjs.39",
29
- "@sphereon/ssi-sdk.core": "^0.33.1-feature.vcdm2.tsup.32+203a9d60",
30
- "@sphereon/ssi-types": "^0.33.1-feature.vcdm2.tsup.32+203a9d60",
31
- "uint8arrays": "^3.1.1"
15
+ "@sphereon/did-auth-siop": "0.17.0",
16
+ "@sphereon/ssi-sdk.core": "0.33.1-next.2+6f7f40b9",
17
+ "@sphereon/ssi-types": "0.33.1-next.2+6f7f40b9",
18
+ "uint8arrays": "3.1.1"
32
19
  },
33
20
  "scripts": {
34
- "build": "tsup --config ../../tsup.config.ts --tsconfig ../../tsconfig.tsup.json"
21
+ "build": "tsc"
35
22
  },
36
23
  "devDependencies": {
37
24
  "@types/node": "^20.17.1",
38
- "typeorm": "0.3.20"
25
+ "typeorm": "^0.3.21"
39
26
  },
40
27
  "files": [
41
- "src",
42
- "dist",
43
- "README.md",
44
- "LICENSE"
28
+ "dist/**/*"
45
29
  ],
46
- "gitHead": "203a9d6076275e58d7959b7d212b8b938ad6a49e"
30
+ "nx": {},
31
+ "gitHead": "6f7f40b94beb385369fede046c3912bd0c053408"
47
32
  }
package/dist/index.cjs DELETED
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- AuthorizationRequest: () => import_did_auth_siop.AuthorizationRequest,
25
- AuthorizationRequestPayload: () => import_did_auth_siop.AuthorizationRequestPayload,
26
- AuthorizationRequestState: () => import_did_auth_siop.AuthorizationRequestState,
27
- AuthorizationResponse: () => import_did_auth_siop.AuthorizationResponse,
28
- AuthorizationResponsePayload: () => import_did_auth_siop.AuthorizationResponsePayload,
29
- OP: () => import_did_auth_siop.OP,
30
- OPBuilder: () => import_did_auth_siop.OPBuilder,
31
- PresentationDefinitionWithLocation: () => import_did_auth_siop.PresentationDefinitionWithLocation,
32
- PresentationVerificationCallback: () => import_did_auth_siop.PresentationVerificationCallback,
33
- PresentationVerificationResult: () => import_did_auth_siop.PresentationVerificationResult,
34
- RP: () => import_did_auth_siop.RP,
35
- RequestObjectPayload: () => import_did_auth_siop.RequestObjectPayload,
36
- SupportedVersion: () => import_did_auth_siop.SupportedVersion,
37
- URI: () => import_did_auth_siop.URI,
38
- VPTokenLocation: () => import_did_auth_siop.VPTokenLocation,
39
- decodeUriAsJson: () => import_did_auth_siop.decodeUriAsJson,
40
- encodeJsonAsURI: () => import_did_auth_siop.encodeJsonAsURI,
41
- uriWithBase: () => uriWithBase
42
- });
43
- module.exports = __toCommonJS(index_exports);
44
-
45
- // src/utils.ts
46
- function uriWithBase(path, opts) {
47
- let baseUri = `${!!opts?.baseURI ? opts.baseURI : opts?.envVarName && process ? process.env[opts.envVarName] : process?.env?.BACKEND_BASE_URI}`;
48
- if (!baseUri || baseUri === "undefined") {
49
- throw Error("No base URI provided as param or environment variable");
50
- } else if (!baseUri.startsWith("http")) {
51
- throw Error(`Base URI needs to start with http(s). Received: ${baseUri}`);
52
- }
53
- baseUri = baseUri.endsWith("/") ? baseUri.substring(0, baseUri.length - 1) : baseUri;
54
- return `${baseUri}${path.startsWith("/") ? path : "/" + path}`;
55
- }
56
- __name(uriWithBase, "uriWithBase");
57
-
58
- // src/index.ts
59
- var import_did_auth_siop = require("@sphereon/did-auth-siop");
60
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../src/utils.ts"],"sourcesContent":["export * from './auth-model'\nexport * from './utils'\n\n// We are exporting some common class from SIOP\n/**\n * @private\n */\nexport {\n decodeUriAsJson,\n encodeJsonAsURI,\n AuthorizationResponsePayload,\n AuthorizationRequestPayload,\n URI,\n AuthorizationRequestState,\n RequestObjectPayload,\n AuthorizationRequest,\n AuthorizationResponse,\n RP,\n OP,\n OPBuilder,\n SupportedVersion,\n PresentationDefinitionWithLocation,\n PresentationVerificationResult,\n PresentationVerificationCallback,\n VPTokenLocation,\n} from '@sphereon/did-auth-siop'\n","export function uriWithBase(path: string, opts?: { baseURI?: string; envVarName?: string }) {\n let baseUri = `${!!opts?.baseURI ? opts.baseURI : opts?.envVarName && process ? process.env[opts.envVarName!] : process?.env?.BACKEND_BASE_URI}`\n if (!baseUri || baseUri === 'undefined') {\n throw Error('No base URI provided as param or environment variable')\n } else if (!baseUri.startsWith('http')) {\n throw Error(`Base URI needs to start with http(s). Received: ${baseUri}`)\n }\n baseUri = baseUri.endsWith('/') ? baseUri.substring(0, baseUri.length - 1) : baseUri\n return `${baseUri}${path.startsWith('/') ? path : '/' + path}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;ACAO,SAASA,YAAYC,MAAcC,MAAgD;AACxF,MAAIC,UAAU,GAAG,CAAC,CAACD,MAAME,UAAUF,KAAKE,UAAUF,MAAMG,cAAcC,UAAUA,QAAQC,IAAIL,KAAKG,UAAU,IAAKC,SAASC,KAAKC,gBAAAA;AAC9H,MAAI,CAACL,WAAWA,YAAY,aAAa;AACvC,UAAMM,MAAM,uDAAA;EACd,WAAW,CAACN,QAAQO,WAAW,MAAA,GAAS;AACtC,UAAMD,MAAM,mDAAmDN,OAAAA,EAAS;EAC1E;AACAA,YAAUA,QAAQQ,SAAS,GAAA,IAAOR,QAAQS,UAAU,GAAGT,QAAQU,SAAS,CAAA,IAAKV;AAC7E,SAAO,GAAGA,OAAAA,GAAUF,KAAKS,WAAW,GAAA,IAAOT,OAAO,MAAMA,IAAAA;AAC1D;AATgBD;;;ADOhB,2BAkBO;","names":["uriWithBase","path","opts","baseUri","baseURI","envVarName","process","env","BACKEND_BASE_URI","Error","startsWith","endsWith","substring","length"]}
package/dist/index.d.cts DELETED
@@ -1,35 +0,0 @@
1
- import { AuthorizationResponsePayload } from '@sphereon/did-auth-siop';
2
- export { AuthorizationRequest, AuthorizationRequestPayload, AuthorizationRequestState, AuthorizationResponse, AuthorizationResponsePayload, OP, OPBuilder, PresentationDefinitionWithLocation, PresentationVerificationCallback, PresentationVerificationResult, RP, RequestObjectPayload, SupportedVersion, URI, VPTokenLocation, decodeUriAsJson, encodeJsonAsURI } from '@sphereon/did-auth-siop';
3
- import { AdditionalClaims } from '@sphereon/ssi-types';
4
-
5
- interface ClaimPayloadCommonOpts {
6
- [x: string]: any;
7
- }
8
- interface AuthorizationChallengeValidationResponse {
9
- presentation_during_issuance_session: string;
10
- }
11
- type AuthorizationRequestStateStatus = 'created' | 'sent' | 'received' | 'verified' | 'error';
12
- type AuthorizationResponseStateStatus = 'created' | 'sent' | 'received' | 'verified' | 'error';
13
- interface GenerateAuthRequestURIResponse {
14
- correlationId: string;
15
- state: string;
16
- definitionId: string;
17
- authRequestURI: string;
18
- authStatusURI: string;
19
- }
20
- interface AuthStatusResponse {
21
- status: AuthorizationRequestStateStatus | AuthorizationResponseStateStatus;
22
- correlationId: string;
23
- error?: string;
24
- definitionId: string;
25
- lastUpdated: number;
26
- payload?: AuthorizationResponsePayload;
27
- verifiedData?: AdditionalClaims;
28
- }
29
-
30
- declare function uriWithBase(path: string, opts?: {
31
- baseURI?: string;
32
- envVarName?: string;
33
- }): string;
34
-
35
- export { type AuthStatusResponse, type AuthorizationChallengeValidationResponse, type AuthorizationRequestStateStatus, type AuthorizationResponseStateStatus, type ClaimPayloadCommonOpts, type GenerateAuthRequestURIResponse, uriWithBase };
package/src/auth-model.ts DELETED
@@ -1,33 +0,0 @@
1
- // noinspection JSUnusedGlobalSymbols
2
- import { AuthorizationResponsePayload } from '@sphereon/did-auth-siop'
3
- import { AdditionalClaims } from '@sphereon/ssi-types'
4
-
5
- export interface ClaimPayloadCommonOpts {
6
- [x: string]: any
7
- }
8
-
9
- export interface AuthorizationChallengeValidationResponse {
10
- presentation_during_issuance_session: string
11
- }
12
-
13
- export type AuthorizationRequestStateStatus = 'created' | 'sent' | 'received' | 'verified' | 'error'
14
-
15
- export type AuthorizationResponseStateStatus = 'created' | 'sent' | 'received' | 'verified' | 'error'
16
-
17
- export interface GenerateAuthRequestURIResponse {
18
- correlationId: string
19
- state: string
20
- definitionId: string
21
- authRequestURI: string
22
- authStatusURI: string
23
- }
24
-
25
- export interface AuthStatusResponse {
26
- status: AuthorizationRequestStateStatus | AuthorizationResponseStateStatus
27
- correlationId: string
28
- error?: string
29
- definitionId: string
30
- lastUpdated: number
31
- payload?: AuthorizationResponsePayload // Only put in here once the status reaches Verified on the RP side
32
- verifiedData?: AdditionalClaims
33
- }
package/src/index.ts DELETED
@@ -1,26 +0,0 @@
1
- export * from './auth-model'
2
- export * from './utils'
3
-
4
- // We are exporting some common class from SIOP
5
- /**
6
- * @private
7
- */
8
- export {
9
- decodeUriAsJson,
10
- encodeJsonAsURI,
11
- AuthorizationResponsePayload,
12
- AuthorizationRequestPayload,
13
- URI,
14
- AuthorizationRequestState,
15
- RequestObjectPayload,
16
- AuthorizationRequest,
17
- AuthorizationResponse,
18
- RP,
19
- OP,
20
- OPBuilder,
21
- SupportedVersion,
22
- PresentationDefinitionWithLocation,
23
- PresentationVerificationResult,
24
- PresentationVerificationCallback,
25
- VPTokenLocation,
26
- } from '@sphereon/did-auth-siop'
package/src/utils.ts DELETED
@@ -1,10 +0,0 @@
1
- export function uriWithBase(path: string, opts?: { baseURI?: string; envVarName?: string }) {
2
- let baseUri = `${!!opts?.baseURI ? opts.baseURI : opts?.envVarName && process ? process.env[opts.envVarName!] : process?.env?.BACKEND_BASE_URI}`
3
- if (!baseUri || baseUri === 'undefined') {
4
- throw Error('No base URI provided as param or environment variable')
5
- } else if (!baseUri.startsWith('http')) {
6
- throw Error(`Base URI needs to start with http(s). Received: ${baseUri}`)
7
- }
8
- baseUri = baseUri.endsWith('/') ? baseUri.substring(0, baseUri.length - 1) : baseUri
9
- return `${baseUri}${path.startsWith('/') ? path : '/' + path}`
10
- }