@sphereon/ssi-types 0.18.2-next.9 → 0.18.2-unstable.13

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.
@@ -1,2 +1,2 @@
1
- export * from './credential-mapper';
1
+ export * from './credential-mapper';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,18 +1,18 @@
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);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./credential-mapper"), exports);
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);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./credential-mapper"), exports);
18
18
  //# sourceMappingURL=index.js.map
@@ -1,36 +1,36 @@
1
- export declare enum IProofPurpose {
2
- verificationMethod = "verificationMethod",
3
- assertionMethod = "assertionMethod",
4
- authentication = "authentication",
5
- keyAgreement = "keyAgreement",
6
- contractAgreement = "contactAgreement",
7
- capabilityInvocation = "capabilityInvocation",
8
- capabilityDelegation = "capabilityDelegation"
9
- }
10
- export declare enum IProofType {
11
- Ed25519Signature2018 = "Ed25519Signature2018",
12
- Ed25519Signature2020 = "Ed25519Signature2020",
13
- EcdsaSecp256k1Signature2019 = "EcdsaSecp256k1Signature2019",
14
- EcdsaSecp256k1RecoverySignature2020 = "EcdsaSecp256k1RecoverySignature2020",
15
- JsonWebSignature2020 = "JsonWebSignature2020",
16
- RsaSignature2018 = "RsaSignature2018",
17
- GpgSignature2020 = "GpgSignature2020",
18
- JcsEd25519Signature2020 = "JcsEd25519Signature2020",
19
- BbsBlsSignatureProof2020 = "BbsBlsSignatureProof2020",
20
- BbsBlsBoundSignatureProof2020 = "BbsBlsBoundSignatureProof2020",
21
- JwtProof2020 = "JwtProof2020"
22
- }
23
- export interface IParsedDID {
24
- did: string;
25
- didUrl: string;
26
- method: string;
27
- id: string;
28
- path?: string;
29
- fragment?: string;
30
- query?: string;
31
- params?: {
32
- [index: string]: string;
33
- };
34
- }
35
- export declare const parseDid: (did: string) => IParsedDID;
1
+ export declare enum IProofPurpose {
2
+ verificationMethod = "verificationMethod",
3
+ assertionMethod = "assertionMethod",
4
+ authentication = "authentication",
5
+ keyAgreement = "keyAgreement",
6
+ contractAgreement = "contactAgreement",
7
+ capabilityInvocation = "capabilityInvocation",
8
+ capabilityDelegation = "capabilityDelegation"
9
+ }
10
+ export declare enum IProofType {
11
+ Ed25519Signature2018 = "Ed25519Signature2018",
12
+ Ed25519Signature2020 = "Ed25519Signature2020",
13
+ EcdsaSecp256k1Signature2019 = "EcdsaSecp256k1Signature2019",
14
+ EcdsaSecp256k1RecoverySignature2020 = "EcdsaSecp256k1RecoverySignature2020",
15
+ JsonWebSignature2020 = "JsonWebSignature2020",
16
+ RsaSignature2018 = "RsaSignature2018",
17
+ GpgSignature2020 = "GpgSignature2020",
18
+ JcsEd25519Signature2020 = "JcsEd25519Signature2020",
19
+ BbsBlsSignatureProof2020 = "BbsBlsSignatureProof2020",
20
+ BbsBlsBoundSignatureProof2020 = "BbsBlsBoundSignatureProof2020",
21
+ JwtProof2020 = "JwtProof2020"
22
+ }
23
+ export interface IParsedDID {
24
+ did: string;
25
+ didUrl: string;
26
+ method: string;
27
+ id: string;
28
+ path?: string;
29
+ fragment?: string;
30
+ query?: string;
31
+ params?: {
32
+ [index: string]: string;
33
+ };
34
+ }
35
+ export declare const parseDid: (did: string) => IParsedDID;
36
36
  //# sourceMappingURL=did.d.ts.map
package/dist/types/did.js CHANGED
@@ -1,76 +1,76 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseDid = exports.IProofType = exports.IProofPurpose = void 0;
4
- var IProofPurpose;
5
- (function (IProofPurpose) {
6
- IProofPurpose["verificationMethod"] = "verificationMethod";
7
- IProofPurpose["assertionMethod"] = "assertionMethod";
8
- IProofPurpose["authentication"] = "authentication";
9
- IProofPurpose["keyAgreement"] = "keyAgreement";
10
- IProofPurpose["contractAgreement"] = "contactAgreement";
11
- IProofPurpose["capabilityInvocation"] = "capabilityInvocation";
12
- IProofPurpose["capabilityDelegation"] = "capabilityDelegation";
13
- })(IProofPurpose = exports.IProofPurpose || (exports.IProofPurpose = {}));
14
- var IProofType;
15
- (function (IProofType) {
16
- IProofType["Ed25519Signature2018"] = "Ed25519Signature2018";
17
- IProofType["Ed25519Signature2020"] = "Ed25519Signature2020";
18
- IProofType["EcdsaSecp256k1Signature2019"] = "EcdsaSecp256k1Signature2019";
19
- IProofType["EcdsaSecp256k1RecoverySignature2020"] = "EcdsaSecp256k1RecoverySignature2020";
20
- IProofType["JsonWebSignature2020"] = "JsonWebSignature2020";
21
- IProofType["RsaSignature2018"] = "RsaSignature2018";
22
- IProofType["GpgSignature2020"] = "GpgSignature2020";
23
- IProofType["JcsEd25519Signature2020"] = "JcsEd25519Signature2020";
24
- IProofType["BbsBlsSignatureProof2020"] = "BbsBlsSignatureProof2020";
25
- IProofType["BbsBlsBoundSignatureProof2020"] = "BbsBlsBoundSignatureProof2020";
26
- IProofType["JwtProof2020"] = "JwtProof2020";
27
- })(IProofType = exports.IProofType || (exports.IProofType = {}));
28
- const parseDid = (did) => {
29
- const parsedDid = parse(did);
30
- if (parsedDid === null) {
31
- throw new Error('invalid did');
32
- }
33
- return parsedDid;
34
- };
35
- exports.parseDid = parseDid;
36
- const parse = (didUrl) => {
37
- const PCT_ENCODED = '(?:%[0-9a-fA-F]{2})';
38
- const ID_CHAR = `(?:[a-zA-Z0-9._-]|${PCT_ENCODED})`;
39
- const METHOD = '([a-z0-9]+)';
40
- const METHOD_ID = `((?:${ID_CHAR}*:)*(${ID_CHAR}+))`;
41
- const PARAM_CHAR = '[a-zA-Z0-9_.:%-]';
42
- const PARAM = `;${PARAM_CHAR}+=${PARAM_CHAR}*`;
43
- const PARAMS = `((${PARAM})*)`;
44
- const PATH = `(/[^#?]*)?`;
45
- const QUERY = `([?][^#]*)?`;
46
- const FRAGMENT = `(#.*)?`;
47
- const DID_MATCHER = new RegExp(`^did:${METHOD}:${METHOD_ID}${PARAMS}${PATH}${QUERY}${FRAGMENT}$`);
48
- if (didUrl === '' || !didUrl)
49
- return null;
50
- const sections = didUrl.match(DID_MATCHER);
51
- if (sections) {
52
- const parts = {
53
- did: `did:${sections[1]}:${sections[2]}`,
54
- method: sections[1],
55
- id: sections[2],
56
- didUrl,
57
- };
58
- if (sections[4]) {
59
- const params = sections[4].slice(1).split(';');
60
- parts.params = {};
61
- for (const p of params) {
62
- const kv = p.split('=');
63
- parts.params[kv[0]] = kv[1];
64
- }
65
- }
66
- if (sections[6])
67
- parts.path = sections[6];
68
- if (sections[7])
69
- parts.query = sections[7].slice(1);
70
- if (sections[8])
71
- parts.fragment = sections[8].slice(1);
72
- return parts;
73
- }
74
- return null;
75
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseDid = exports.IProofType = exports.IProofPurpose = void 0;
4
+ var IProofPurpose;
5
+ (function (IProofPurpose) {
6
+ IProofPurpose["verificationMethod"] = "verificationMethod";
7
+ IProofPurpose["assertionMethod"] = "assertionMethod";
8
+ IProofPurpose["authentication"] = "authentication";
9
+ IProofPurpose["keyAgreement"] = "keyAgreement";
10
+ IProofPurpose["contractAgreement"] = "contactAgreement";
11
+ IProofPurpose["capabilityInvocation"] = "capabilityInvocation";
12
+ IProofPurpose["capabilityDelegation"] = "capabilityDelegation";
13
+ })(IProofPurpose = exports.IProofPurpose || (exports.IProofPurpose = {}));
14
+ var IProofType;
15
+ (function (IProofType) {
16
+ IProofType["Ed25519Signature2018"] = "Ed25519Signature2018";
17
+ IProofType["Ed25519Signature2020"] = "Ed25519Signature2020";
18
+ IProofType["EcdsaSecp256k1Signature2019"] = "EcdsaSecp256k1Signature2019";
19
+ IProofType["EcdsaSecp256k1RecoverySignature2020"] = "EcdsaSecp256k1RecoverySignature2020";
20
+ IProofType["JsonWebSignature2020"] = "JsonWebSignature2020";
21
+ IProofType["RsaSignature2018"] = "RsaSignature2018";
22
+ IProofType["GpgSignature2020"] = "GpgSignature2020";
23
+ IProofType["JcsEd25519Signature2020"] = "JcsEd25519Signature2020";
24
+ IProofType["BbsBlsSignatureProof2020"] = "BbsBlsSignatureProof2020";
25
+ IProofType["BbsBlsBoundSignatureProof2020"] = "BbsBlsBoundSignatureProof2020";
26
+ IProofType["JwtProof2020"] = "JwtProof2020";
27
+ })(IProofType = exports.IProofType || (exports.IProofType = {}));
28
+ const parseDid = (did) => {
29
+ const parsedDid = parse(did);
30
+ if (parsedDid === null) {
31
+ throw new Error('invalid did');
32
+ }
33
+ return parsedDid;
34
+ };
35
+ exports.parseDid = parseDid;
36
+ const parse = (didUrl) => {
37
+ const PCT_ENCODED = '(?:%[0-9a-fA-F]{2})';
38
+ const ID_CHAR = `(?:[a-zA-Z0-9._-]|${PCT_ENCODED})`;
39
+ const METHOD = '([a-z0-9]+)';
40
+ const METHOD_ID = `((?:${ID_CHAR}*:)*(${ID_CHAR}+))`;
41
+ const PARAM_CHAR = '[a-zA-Z0-9_.:%-]';
42
+ const PARAM = `;${PARAM_CHAR}+=${PARAM_CHAR}*`;
43
+ const PARAMS = `((${PARAM})*)`;
44
+ const PATH = `(/[^#?]*)?`;
45
+ const QUERY = `([?][^#]*)?`;
46
+ const FRAGMENT = `(#.*)?`;
47
+ const DID_MATCHER = new RegExp(`^did:${METHOD}:${METHOD_ID}${PARAMS}${PATH}${QUERY}${FRAGMENT}$`);
48
+ if (didUrl === '' || !didUrl)
49
+ return null;
50
+ const sections = didUrl.match(DID_MATCHER);
51
+ if (sections) {
52
+ const parts = {
53
+ did: `did:${sections[1]}:${sections[2]}`,
54
+ method: sections[1],
55
+ id: sections[2],
56
+ didUrl,
57
+ };
58
+ if (sections[4]) {
59
+ const params = sections[4].slice(1).split(';');
60
+ parts.params = {};
61
+ for (const p of params) {
62
+ const kv = p.split('=');
63
+ parts.params[kv[0]] = kv[1];
64
+ }
65
+ }
66
+ if (sections[6])
67
+ parts.path = sections[6];
68
+ if (sections[7])
69
+ parts.query = sections[7].slice(1);
70
+ if (sections[8])
71
+ parts.fragment = sections[8].slice(1);
72
+ return parts;
73
+ }
74
+ return null;
75
+ };
76
76
  //# sourceMappingURL=did.js.map
@@ -1,8 +1,8 @@
1
- /**
2
- * Accept a Type or a Promise of that Type.
3
- *
4
- * @internal
5
- */
6
- export type OrPromise<T> = T | Promise<T>;
7
- export type BearerTokenArg = (() => Promise<string>) | string;
1
+ /**
2
+ * Accept a Type or a Promise of that Type.
3
+ *
4
+ * @internal
5
+ */
6
+ export type OrPromise<T> = T | Promise<T>;
7
+ export type BearerTokenArg = (() => Promise<string>) | string;
8
8
  //# sourceMappingURL=generic.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=generic.js.map
@@ -1,7 +1,7 @@
1
- export * from './did';
2
- export * from './pex';
3
- export * from './vc';
4
- export * from './generic';
5
- export * from './sd-jwt-vc';
6
- export * from './w3c-vc';
1
+ export * from './did';
2
+ export * from './pex';
3
+ export * from './vc';
4
+ export * from './generic';
5
+ export * from './sd-jwt-vc';
6
+ export * from './w3c-vc';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,23 +1,23 @@
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);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./did"), exports);
18
- __exportStar(require("./pex"), exports);
19
- __exportStar(require("./vc"), exports);
20
- __exportStar(require("./generic"), exports);
21
- __exportStar(require("./sd-jwt-vc"), exports);
22
- __exportStar(require("./w3c-vc"), exports);
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);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./did"), exports);
18
+ __exportStar(require("./pex"), exports);
19
+ __exportStar(require("./vc"), exports);
20
+ __exportStar(require("./generic"), exports);
21
+ __exportStar(require("./sd-jwt-vc"), exports);
22
+ __exportStar(require("./w3c-vc"), exports);
23
23
  //# sourceMappingURL=index.js.map
@@ -1,36 +1,36 @@
1
- /**
2
- * It expresses how the inputs are presented as proofs to a Verifier.
3
- */
4
- export interface PresentationSubmission {
5
- /**
6
- * A UUID or some other unique ID to identify this Presentation Submission
7
- */
8
- id: string;
9
- /**
10
- * A UUID or some other unique ID to identify this Presentation Definition
11
- */
12
- definition_id: string;
13
- /**
14
- * List of descriptors of how the claims are being mapped to presentation definition
15
- */
16
- descriptor_map: Array<Descriptor>;
17
- }
18
- /**
19
- * descriptor map laying out the structure of the presentation submission.
20
- */
21
- export interface Descriptor {
22
- /**
23
- * ID to identify the descriptor from Presentation Definition Input Descriptor it coresponds to.
24
- */
25
- id: string;
26
- /**
27
- * The path where the verifiable credential is located in the presentation submission json
28
- */
29
- path: string;
30
- path_nested?: Descriptor;
31
- /**
32
- * The Proof or JWT algorith that the proof is in
33
- */
34
- format: string;
35
- }
1
+ /**
2
+ * It expresses how the inputs are presented as proofs to a Verifier.
3
+ */
4
+ export interface PresentationSubmission {
5
+ /**
6
+ * A UUID or some other unique ID to identify this Presentation Submission
7
+ */
8
+ id: string;
9
+ /**
10
+ * A UUID or some other unique ID to identify this Presentation Definition
11
+ */
12
+ definition_id: string;
13
+ /**
14
+ * List of descriptors of how the claims are being mapped to presentation definition
15
+ */
16
+ descriptor_map: Array<Descriptor>;
17
+ }
18
+ /**
19
+ * descriptor map laying out the structure of the presentation submission.
20
+ */
21
+ export interface Descriptor {
22
+ /**
23
+ * ID to identify the descriptor from Presentation Definition Input Descriptor it coresponds to.
24
+ */
25
+ id: string;
26
+ /**
27
+ * The path where the verifiable credential is located in the presentation submission json
28
+ */
29
+ path: string;
30
+ path_nested?: Descriptor;
31
+ /**
32
+ * The Proof or JWT algorith that the proof is in
33
+ */
34
+ format: string;
35
+ }
36
36
  //# sourceMappingURL=pex.d.ts.map
package/dist/types/pex.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=pex.js.map