@sphereon/ssi-sdk.siopv2-oid4vp-common 0.33.1-feature.vcdm2.4 → 0.33.1-feature.vcdm2.tsup.18

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 ADDED
@@ -0,0 +1,81 @@
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
+ // Annotate the CommonJS export names for ESM import in node:
61
+ 0 && (module.exports = {
62
+ AuthorizationRequest,
63
+ AuthorizationRequestPayload,
64
+ AuthorizationRequestState,
65
+ AuthorizationResponse,
66
+ AuthorizationResponsePayload,
67
+ OP,
68
+ OPBuilder,
69
+ PresentationDefinitionWithLocation,
70
+ PresentationVerificationCallback,
71
+ PresentationVerificationResult,
72
+ RP,
73
+ RequestObjectPayload,
74
+ SupportedVersion,
75
+ URI,
76
+ VPTokenLocation,
77
+ decodeUriAsJson,
78
+ encodeJsonAsURI,
79
+ uriWithBase
80
+ });
81
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,35 @@
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/dist/index.d.ts CHANGED
@@ -1,7 +1,35 @@
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
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/dist/index.js CHANGED
@@ -1,8 +1,39 @@
1
- export * from './auth-model';
2
- export * from './utils';
3
- // We are exporting some common class from SIOP
4
- /**
5
- * @private
6
- */
7
- export { decodeUriAsJson, encodeJsonAsURI, URI, AuthorizationRequest, AuthorizationResponse, RP, OP, OPBuilder, SupportedVersion, VPTokenLocation, } from '@sphereon/did-auth-siop';
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
38
+ };
8
39
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AAEvB,+CAA+C;AAC/C;;GAEG;AACH,OAAO,EACL,eAAe,EACf,eAAe,EAGf,GAAG,EAGH,oBAAoB,EACpB,qBAAqB,EACrB,EAAE,EACF,EAAE,EACF,SAAS,EACT,gBAAgB,EAIhB,eAAe,GAChB,MAAM,yBAAyB,CAAA"}
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"]}
package/package.json CHANGED
@@ -1,10 +1,22 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.siopv2-oid4vp-common",
3
- "version": "0.33.1-feature.vcdm2.4+9f634bdb",
3
+ "version": "0.33.1-feature.vcdm2.tsup.18+1fbb8be0",
4
4
  "description": "Common SIOPv2 and OID4VP types between modules",
5
5
  "source": "src/index.ts",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
6
+ "type": "module",
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "require": "./dist/index.cjs"
18
+ }
19
+ },
8
20
  "author": "Sphereon <dev@sphereon.com>",
9
21
  "license": "Apache-2.0",
10
22
  "private": false,
@@ -12,21 +24,23 @@
12
24
  "access": "public"
13
25
  },
14
26
  "dependencies": {
15
- "@sphereon/did-auth-siop": "0.17.0",
16
- "@sphereon/ssi-sdk.core": "0.33.1-feature.vcdm2.4+9f634bdb",
17
- "@sphereon/ssi-types": "0.33.1-feature.vcdm2.4+9f634bdb",
18
- "uint8arrays": "3.1.1"
27
+ "@sphereon/did-auth-siop": "0.17.1-feature.esm.cjs.37",
28
+ "@sphereon/ssi-sdk.core": "^0.33.1-feature.vcdm2.tsup.18+1fbb8be0",
29
+ "@sphereon/ssi-types": "^0.33.1-feature.vcdm2.tsup.18+1fbb8be0",
30
+ "uint8arrays": "^3.1.1"
19
31
  },
20
32
  "scripts": {
21
- "build": "tsc"
33
+ "build": "tsup --config ../../tsup.config.ts --tsconfig ../../tsconfig.tsup.json"
22
34
  },
23
35
  "devDependencies": {
24
36
  "@types/node": "^20.17.1",
25
- "typeorm": "^0.3.21"
37
+ "typeorm": "^0.3.22"
26
38
  },
27
39
  "files": [
28
- "dist/**/*"
40
+ "src",
41
+ "dist",
42
+ "README.md",
43
+ "LICENSE"
29
44
  ],
30
- "nx": {},
31
- "gitHead": "9f634bdb714061141e277508c124b08d626f6036"
45
+ "gitHead": "1fbb8be0256ec8dbc1b52d860b7bfd09d12f0d00"
32
46
  }
@@ -0,0 +1,33 @@
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 ADDED
@@ -0,0 +1,26 @@
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 ADDED
@@ -0,0 +1,10 @@
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
+ }
@@ -1,27 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=auth-model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-model.js","sourceRoot":"","sources":["../src/auth-model.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
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/utils.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare function uriWithBase(path: string, opts?: {
2
- baseURI?: string;
3
- envVarName?: string;
4
- }): string;
5
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
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 DELETED
@@ -1,12 +0,0 @@
1
- export function uriWithBase(path, opts) {
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
- }
6
- else if (!baseUri.startsWith('http')) {
7
- throw Error(`Base URI needs to start with http(s). Received: ${baseUri}`);
8
- }
9
- baseUri = baseUri.endsWith('/') ? baseUri.substring(0, baseUri.length - 1) : baseUri;
10
- return `${baseUri}${path.startsWith('/') ? path : '/' + path}`;
11
- }
12
- //# sourceMappingURL=utils.js.map
package/dist/utils.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,IAAgD;IACxF,IAAI,OAAO,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,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"}