@interop/zcap 9.0.3 → 10.0.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # zcap _(@interop/zcap)_
2
2
 
3
- [![Node.js CI](https://github.com/interop-alliance/zcap/workflows/CI/badge.svg)](https://github.com/interop-alliance/zcap/actions?query=workflow%3A%22CI%22)
3
+ [![CI](https://github.com/interop-alliance/zcap/workflows/CI/badge.svg)](https://github.com/interop-alliance/zcap/actions?query=workflow%3ACI)
4
4
  [![NPM Version](https://img.shields.io/npm/v/@interop/zcap.svg)](https://npm.im/@interop/zcap)
5
5
 
6
6
  > JavaScript reference implementation for
@@ -6,14 +6,14 @@ import {CapabilityProofPurpose} from './CapabilityProofPurpose.js';
6
6
 
7
7
  /**
8
8
  * @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
9
- * @typedef {import('./utils.js').Zcap} Zcap
10
- * @typedef {import('./utils.js').DelegatedZcap} DelegatedZcap
9
+ * @typedef {import('./utils.js').IZcap} IZcap
10
+ * @typedef {import('./utils.js').IDelegatedZcap} IDelegatedZcap
11
11
  */
12
12
 
13
13
  export class CapabilityDelegation extends CapabilityProofPurpose {
14
14
  /**
15
15
  * @param {object} options - The options.
16
- * @param {string|Zcap} [options.parentCapability] - An alternative to
16
+ * @param {string|IZcap} [options.parentCapability] - An alternative to
17
17
  * passing `capabilityChain` when creating a proof; passing
18
18
  * `parentCapability` will enable the capability chain to be auto-computed.
19
19
  * Pass a root zcap ID string, or a full root or delegated zcap object.
@@ -43,8 +43,8 @@ export class CapabilityDelegation extends CapabilityProofPurpose {
43
43
  * @param {object|object[]} [options.suite] - The jsonld-signature suite(s) to
44
44
  * use to verify the capability chain. Required only in verify-proof mode;
45
45
  * unused (and omitted) when creating a delegation proof.
46
- * @param {Zcap} [options._verifiedParentCapability] - Private.
47
- * @param {Array<string|DelegatedZcap>} [options._capabilityChain] - Private.
46
+ * @param {IZcap} [options._verifiedParentCapability] - Private.
47
+ * @param {Array<string|IDelegatedZcap>} [options._capabilityChain] - Private.
48
48
  * @param {boolean} [options._skipLocalValidationForTesting] - Private.
49
49
  */
50
50
  constructor({
@@ -7,13 +7,13 @@ import {CapabilityProofPurpose} from './CapabilityProofPurpose.js';
7
7
 
8
8
  /**
9
9
  * @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
10
- * @typedef {import('./utils.js').DelegatedZcap} DelegatedZcap
10
+ * @typedef {import('./utils.js').IDelegatedZcap} IDelegatedZcap
11
11
  */
12
12
 
13
13
  export class CapabilityInvocation extends CapabilityProofPurpose {
14
14
  /**
15
15
  * @param {object} options - The options.
16
- * @param {string|DelegatedZcap} [options.capability] - The capability to
16
+ * @param {string|IDelegatedZcap} [options.capability] - The capability to
17
17
  * add/reference in a created proof. A root zcap MUST be passed as its ID
18
18
  * string; a delegated zcap must be passed as the full object.
19
19
  * @param {string} [options.capabilityAction] - The capability action that is
package/lib/index.js CHANGED
@@ -11,10 +11,6 @@ import * as constants from './constants.js';
11
11
  export {constants};
12
12
 
13
13
  /**
14
- * @typedef {import('./utils.js').RootZcap} RootZcap
15
- * @typedef {import('./utils.js').DelegatedZcap} DelegatedZcap
16
- * @typedef {import('./utils.js').Zcap} Zcap
17
- * @typedef {import('./utils.js').CapabilityDelegationProof} CapabilityDelegationProof
18
14
  * @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
19
15
  * @typedef {import('./utils.js').InspectResult} InspectResult
20
16
  * @typedef {import('./utils.js').CapabilityChainDetails} CapabilityChainDetails
@@ -56,5 +52,4 @@ export function extendDocumentLoader(documentLoader) {
56
52
  *
57
53
  * @type {Function}
58
54
  */
59
- export const documentLoader = extendDocumentLoader(
60
- jsigs.strictDocumentLoader);
55
+ export const documentLoader = extendDocumentLoader(jsigs.strictDocumentLoader);
package/lib/utils.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  * @param {string|string[]} options.controller - The root controller.
14
14
  * @param {string} options.invocationTarget - The root invocation target.
15
15
  *
16
- * @returns {RootZcap} The root capability.
16
+ * @returns {IRootZcap} The root capability.
17
17
  */
18
18
  export function createRootCapability({controller, invocationTarget}) {
19
19
  return {
@@ -28,7 +28,7 @@ export function createRootCapability({controller, invocationTarget}) {
28
28
  * Retrieves the controller(s) from a capability.
29
29
  *
30
30
  * @param {object} options - The options.
31
- * @param {Zcap} options.capability - The authorization capability (zcap).
31
+ * @param {IZcap} options.capability - The authorization capability (zcap).
32
32
  *
33
33
  * @returns {string[]} The controller(s) for the capability.
34
34
  */
@@ -45,7 +45,7 @@ export function getControllers({capability}) {
45
45
  * controlled by a controller) of the given capability.
46
46
  *
47
47
  * @param {object} options - The options.
48
- * @param {Zcap} options.capability - The authorization capability (zcap).
48
+ * @param {IZcap} options.capability - The authorization capability (zcap).
49
49
  * @param {object} options.verificationMethod - The verification method to
50
50
  * check.
51
51
  *
@@ -61,7 +61,7 @@ export function isController({capability, verificationMethod}) {
61
61
  * Retrieves the allowed actions from a capability.
62
62
  *
63
63
  * @param {object} options - The options.
64
- * @param {Zcap} options.capability - The authorization capability (zcap).
64
+ * @param {IZcap} options.capability - The authorization capability (zcap).
65
65
  *
66
66
  * @returns {string[]} Allowed actions.
67
67
  */
@@ -80,7 +80,7 @@ export function getAllowedActions({capability}) {
80
80
  * Retrieves the target from a capability.
81
81
  *
82
82
  * @param {object} options - The options.
83
- * @param {Zcap} options.capability - The authorization capability (zcap).
83
+ * @param {IZcap} options.capability - The authorization capability (zcap).
84
84
  *
85
85
  * @returns {string} - Capability target.
86
86
  */
@@ -95,9 +95,9 @@ export function getTarget({capability}) {
95
95
  * delegation proofs will cause this function to return an empty array.
96
96
  *
97
97
  * @param {object} options - The options.
98
- * @param {Zcap} options.capability - The authorization capability.
98
+ * @param {IZcap} options.capability - The authorization capability.
99
99
  *
100
- * @returns {CapabilityDelegationProof[]} Any `capabilityDelegation` proof
100
+ * @returns {ICapabilityDelegationProof[]} Any `capabilityDelegation` proof
101
101
  * objects attached to the given capability.
102
102
  */
103
103
  export function getDelegationProofs({capability}) {
@@ -117,9 +117,9 @@ export function getDelegationProofs({capability}) {
117
117
  * Gets the `capabilityChain` associated with the given capability.
118
118
  *
119
119
  * @param {object} options - The options.
120
- * @param {Zcap} options.capability - The authorization capability.
120
+ * @param {IZcap} options.capability - The authorization capability.
121
121
  *
122
- * @returns {Array<string|DelegatedZcap>} The capability chain entries
122
+ * @returns {Array<string|IDelegatedZcap>} The capability chain entries
123
123
  * (root to parent), as stored in the delegation proof.
124
124
  */
125
125
  export function getCapabilityChain({capability}) {
@@ -204,12 +204,12 @@ export function isValidTarget({
204
204
  * given `parentCapability`.
205
205
  *
206
206
  * @param {object} options - The options.
207
- * @param {string|Zcap} options.parentCapability - The parent capability from
207
+ * @param {string|IZcap} options.parentCapability - The parent capability from
208
208
  * which to compute the capability chain (a root zcap ID string, or a full
209
209
  * root or delegated zcap object).
210
210
  * @param {boolean} options._skipLocalValidationForTesting - Private.
211
211
  *
212
- * @returns {Array<string|DelegatedZcap>} The computed capability chain to be
212
+ * @returns {Array<string|IDelegatedZcap>} The computed capability chain to be
213
213
  * included in a capability delegation proof.
214
214
  */
215
215
  export function computeCapabilityChain({
@@ -309,7 +309,7 @@ export function computeCapabilityChain({
309
309
  * work with both root zcap `a` and `b`).
310
310
  *
311
311
  * @param {object} options - The options.
312
- * @param {string|DelegatedZcap} options.capability - The authorization
312
+ * @param {string|IDelegatedZcap} options.capability - The authorization
313
313
  * capability to dereference the chain for. Pass a string (the root zcap ID)
314
314
  * to dereference a root zcap directly, or a delegated zcap object.
315
315
  * @param {Function} options.getRootCapability - A function for dereferencing
@@ -318,7 +318,7 @@ export function computeCapabilityChain({
318
318
  * @param {number} [options.maxChainLength=10] - The maximum length of the
319
319
  * capability delegation chain (this is inclusive of `capability` itself).
320
320
  *
321
- * @returns {Promise<{dereferencedChain: Zcap[]}>} Resolves to an object
321
+ * @returns {Promise<{dereferencedChain: IZcap[]}>} Resolves to an object
322
322
  * containing the full dereferenced chain ordered root to tail.
323
323
  */
324
324
  export async function dereferenceCapabilityChain({
@@ -592,16 +592,14 @@ export function compareTime({t1, t2, maxClockSkew}) {
592
592
  }
593
593
 
594
594
  /**
595
- * The zcap object shapes (`RootZcap`, `DelegatedZcap`,
596
- * `CapabilityDelegationProof`, `Zcap`) are defined in `./zcap-types.d.ts` and
597
- * re-exported here as typedefs. They cannot be expressed as JSDoc `@typedef`s
598
- * because TypeScript's JSDoc parser mangles the `@context` property name (the
599
- * leading `@` becomes an empty-string key). See `./zcap-types.d.ts`.
600
- *
601
- * @typedef {import('./zcap-types.js').RootZcap} RootZcap
602
- * @typedef {import('./zcap-types.js').CapabilityDelegationProof} CapabilityDelegationProof
603
- * @typedef {import('./zcap-types.js').DelegatedZcap} DelegatedZcap
604
- * @typedef {import('./zcap-types.js').Zcap} Zcap
595
+ * The zcap object shapes (`IRootZcap`, `IDelegatedZcap`,
596
+ * `ICapabilityDelegationProof`, `IZcap`) live in `@digitalcredentials/ssi/zcap`
597
+ * (the canonical home) and are re-imported here as typedefs for JSDoc use.
598
+ *
599
+ * @typedef {import('@digitalcredentials/ssi/zcap').IRootZcap} IRootZcap
600
+ * @typedef {import('@digitalcredentials/ssi/zcap').ICapabilityDelegationProof} ICapabilityDelegationProof
601
+ * @typedef {import('@digitalcredentials/ssi/zcap').IDelegatedZcap} IDelegatedZcap
602
+ * @typedef {import('@digitalcredentials/ssi/zcap').IZcap} IZcap
605
603
  */
606
604
 
607
605
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interop/zcap",
3
- "version": "9.0.3",
3
+ "version": "10.0.2",
4
4
  "description": "Authorization Capabilities reference implementation.",
5
5
  "homepage": "https://github.com/interop-alliance/zcap",
6
6
  "author": {
@@ -32,6 +32,7 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@digitalbazaar/zcap-context": "^2.0.1",
35
+ "@digitalcredentials/ssi": "^5.5.0",
35
36
  "@interop/jsonld-signatures": "^11.6.1"
36
37
  },
37
38
  "devDependencies": {
@@ -64,6 +65,7 @@
64
65
  "engines": {
65
66
  "node": ">=18"
66
67
  },
68
+ "packageManager": "pnpm@11.3.0",
67
69
  "keywords": [
68
70
  "Authorization Capability",
69
71
  "Authorization Capabilities",
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
3
- * @typedef {import('./utils.js').Zcap} Zcap
4
- * @typedef {import('./utils.js').DelegatedZcap} DelegatedZcap
3
+ * @typedef {import('./utils.js').IZcap} IZcap
4
+ * @typedef {import('./utils.js').IDelegatedZcap} IDelegatedZcap
5
5
  */
6
6
  export class CapabilityDelegation extends CapabilityProofPurpose {
7
7
  /**
8
8
  * @param {object} options - The options.
9
- * @param {string|Zcap} [options.parentCapability] - An alternative to
9
+ * @param {string|IZcap} [options.parentCapability] - An alternative to
10
10
  * passing `capabilityChain` when creating a proof; passing
11
11
  * `parentCapability` will enable the capability chain to be auto-computed.
12
12
  * Pass a root zcap ID string, or a full root or delegated zcap object.
@@ -36,12 +36,12 @@ export class CapabilityDelegation extends CapabilityProofPurpose {
36
36
  * @param {object|object[]} [options.suite] - The jsonld-signature suite(s) to
37
37
  * use to verify the capability chain. Required only in verify-proof mode;
38
38
  * unused (and omitted) when creating a delegation proof.
39
- * @param {Zcap} [options._verifiedParentCapability] - Private.
40
- * @param {Array<string|DelegatedZcap>} [options._capabilityChain] - Private.
39
+ * @param {IZcap} [options._verifiedParentCapability] - Private.
40
+ * @param {Array<string|IDelegatedZcap>} [options._capabilityChain] - Private.
41
41
  * @param {boolean} [options._skipLocalValidationForTesting] - Private.
42
42
  */
43
43
  constructor({ parentCapability, allowTargetAttenuation, controller, date, expectedRootCapability, inspectCapabilityChain, maxChainLength, maxClockSkew, maxDelegationTtl, suite, _verifiedParentCapability, _capabilityChain, _skipLocalValidationForTesting }?: {
44
- parentCapability?: string | Zcap;
44
+ parentCapability?: string | IZcap;
45
45
  allowTargetAttenuation?: boolean;
46
46
  date?: string | Date | number;
47
47
  expectedRootCapability?: string | string[];
@@ -51,14 +51,14 @@ export class CapabilityDelegation extends CapabilityProofPurpose {
51
51
  maxClockSkew?: number;
52
52
  maxDelegationTtl?: number;
53
53
  suite?: object | object[];
54
- _verifiedParentCapability?: Zcap;
55
- _capabilityChain?: Array<string | DelegatedZcap>;
54
+ _verifiedParentCapability?: IZcap;
55
+ _capabilityChain?: Array<string | IDelegatedZcap>;
56
56
  _skipLocalValidationForTesting?: boolean;
57
57
  });
58
- parentCapability: string | import("./zcap-types.js").Zcap;
59
- _capabilityChain: (string | import("./zcap-types.js").DelegatedZcap)[];
58
+ parentCapability: string | import("@digitalcredentials/ssi/zcap").IZcap;
59
+ _capabilityChain: (string | import("@digitalcredentials/ssi/zcap").IDelegatedZcap)[];
60
60
  _skipLocalValidationForTesting: boolean;
61
- _verifiedParentCapability: import("./zcap-types.js").Zcap;
61
+ _verifiedParentCapability: import("@digitalcredentials/ssi/zcap").IZcap;
62
62
  update(proof: any, { document }: {
63
63
  document: any;
64
64
  }): Promise<any>;
@@ -95,7 +95,7 @@ export class CapabilityDelegation extends CapabilityProofPurpose {
95
95
  }): Promise<import("@interop/jsonld-signatures").ProofValidateResult>;
96
96
  }
97
97
  export type InspectCapabilityChain = import("./utils.js").InspectCapabilityChain;
98
- export type Zcap = import("./utils.js").Zcap;
99
- export type DelegatedZcap = import("./utils.js").DelegatedZcap;
98
+ export type IZcap = import("./utils.js").IZcap;
99
+ export type IDelegatedZcap = import("./utils.js").IDelegatedZcap;
100
100
  import { CapabilityProofPurpose } from './CapabilityProofPurpose.js';
101
101
  //# sourceMappingURL=CapabilityDelegation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CapabilityDelegation.d.ts","sourceRoot":"","sources":["../../lib/CapabilityDelegation.js"],"names":[],"mappings":"AAMA;;;;GAIG;AAEH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;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,YAAY,GAA7B,MAAM;QAGW,gBAAgB,GAAjC,MAAM;QAGoB,KAAK,GAA/B,MAAM,GAAC,MAAM,EAAE;QAGC,yBAAyB,GAAzC,KAAK;QACkC,gBAAgB,GAAvD,KAAK,CAAC,MAAM,GAAC,cAAc,CAAC;QACV,8BAA8B,GAAhD,OAAO;KACjB,EA0EA;IAbG,wEAAwC;IAKtC,qFAAwC;IAGxC,wCAAoE;IAGtE,wEAA0D;IAI9D;;qBAiFC;IAED;;;yBAUC;IAED,6DAEC;IAED;;;;;MAIC;IAED;;;;OAOC;IAED;;;;;0EAsBC;IAED;;;0EAgBC;IAED;;;;0EA8BC;CACF;qCAhTY,OAAO,YAAY,EAAE,sBAAsB;oBAC3C,OAAO,YAAY,EAAE,KAAK;6BAC1B,OAAO,YAAY,EAAE,cAAc;uCALX,6BAA6B"}
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
3
- * @typedef {import('./utils.js').DelegatedZcap} DelegatedZcap
3
+ * @typedef {import('./utils.js').IDelegatedZcap} IDelegatedZcap
4
4
  */
5
5
  export class CapabilityInvocation extends CapabilityProofPurpose {
6
6
  /**
7
7
  * @param {object} options - The options.
8
- * @param {string|DelegatedZcap} [options.capability] - The capability to
8
+ * @param {string|IDelegatedZcap} [options.capability] - The capability to
9
9
  * add/reference in a created proof. A root zcap MUST be passed as its ID
10
10
  * string; a delegated zcap must be passed as the full object.
11
11
  * @param {string} [options.capabilityAction] - The capability action that is
@@ -49,7 +49,7 @@ export class CapabilityInvocation extends CapabilityProofPurpose {
49
49
  * unused (and omitted) when creating an invocation proof.
50
50
  */
51
51
  constructor({ capability, capabilityAction, invocationTarget, allowTargetAttenuation, controller, date, expectedAction, expectedRootCapability, expectedTarget, inspectCapabilityChain, maxChainLength, maxClockSkew, maxDelegationTtl, maxTimestampDelta, suite }?: {
52
- capability?: string | DelegatedZcap;
52
+ capability?: string | IDelegatedZcap;
53
53
  capabilityAction?: string;
54
54
  invocationTarget?: string;
55
55
  allowTargetAttenuation?: boolean;
@@ -65,7 +65,7 @@ export class CapabilityInvocation extends CapabilityProofPurpose {
65
65
  maxTimestampDelta?: number;
66
66
  suite?: object | object[];
67
67
  });
68
- capability: string | import("./zcap-types.js").DelegatedZcap;
68
+ capability: string | import("@digitalcredentials/ssi/zcap").IDelegatedZcap;
69
69
  capabilityAction: string;
70
70
  invocationTarget: string;
71
71
  expectedTarget: string | string[];
@@ -94,7 +94,7 @@ export class CapabilityInvocation extends CapabilityProofPurpose {
94
94
  }): Promise<import("@interop/jsonld-signatures").ProofValidateResult>;
95
95
  }
96
96
  export type InspectCapabilityChain = import("./utils.js").InspectCapabilityChain;
97
- export type DelegatedZcap = import("./utils.js").DelegatedZcap;
97
+ export type IDelegatedZcap = import("./utils.js").IDelegatedZcap;
98
98
  import { CapabilityProofPurpose } from './CapabilityProofPurpose.js';
99
99
  import { CapabilityDelegation } from './CapabilityDelegation.js';
100
100
  //# sourceMappingURL=CapabilityInvocation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CapabilityInvocation.d.ts","sourceRoot":"","sources":["../../lib/CapabilityInvocation.js"],"names":[],"mappings":"AAOA;;;GAGG;AAEH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACH,qQA3CG;QAAuC,UAAU,GAAzC,MAAM,GAAC,aAAa;QAGH,gBAAgB,GAAjC,MAAM;QAEW,gBAAgB,GAAjC,MAAM;QAGY,sBAAsB,GAAxC,OAAO;QAGU,UAAU,GAA3B,MAAM;QAEuB,IAAI,GAAjC,MAAM,GAAC,IAAI,GAAC,MAAM;QAID,cAAc,GAA/B,MAAM;QAEoB,sBAAsB,GAAhD,MAAM,GAAC,MAAM,EAAE;QAGW,cAAc,GAAxC,MAAM,GAAC,MAAM,EAAE;QAEkB,sBAAsB,GAAvD,sBAAsB;QAGL,cAAc,GAA/B,MAAM;QAEW,YAAY,GAA7B,M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FC;IAED;;;;0EAgDC;CACF;qCA9UY,OAAO,YAAY,EAAE,sBAAsB;6BAC3C,OAAO,YAAY,EAAE,cAAc;uCAJX,6BAA6B;qCAD/B,2BAA2B"}
@@ -78,7 +78,7 @@ export class CapabilityProofPurpose extends jsigs.ControllerProofPurpose {
78
78
  documentLoader: any;
79
79
  proof: any;
80
80
  }): Promise<{
81
- dereferencedChain: import("./zcap-types.js").Zcap[];
81
+ dereferencedChain: import("@digitalcredentials/ssi/zcap").IZcap[];
82
82
  }>;
83
83
  _getCapabilityDelegationClass(): void;
84
84
  _getTailCapability(): Promise<void>;
@@ -1,8 +1,4 @@
1
1
  /**
2
- * @typedef {import('./utils.js').RootZcap} RootZcap
3
- * @typedef {import('./utils.js').DelegatedZcap} DelegatedZcap
4
- * @typedef {import('./utils.js').Zcap} Zcap
5
- * @typedef {import('./utils.js').CapabilityDelegationProof} CapabilityDelegationProof
6
2
  * @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
7
3
  * @typedef {import('./utils.js').InspectResult} InspectResult
8
4
  * @typedef {import('./utils.js').CapabilityChainDetails} CapabilityChainDetails
@@ -35,10 +31,6 @@ export { constants };
35
31
  * @type {Function}
36
32
  */
37
33
  export const documentLoader: Function;
38
- export type RootZcap = import("./utils.js").RootZcap;
39
- export type DelegatedZcap = import("./utils.js").DelegatedZcap;
40
- export type Zcap = import("./utils.js").Zcap;
41
- export type CapabilityDelegationProof = import("./utils.js").CapabilityDelegationProof;
42
34
  export type InspectCapabilityChain = import("./utils.js").InspectCapabilityChain;
43
35
  export type InspectResult = import("./utils.js").InspectResult;
44
36
  export type CapabilityChainDetails = import("./utils.js").CapabilityChainDetails;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;GASG;AACH,yEAYC;;;;;AAED;;;;;;;GAOG;AACH,sCAC8B;uBA9CjB,OAAO,YAAY,EAAE,QAAQ;4BAC7B,OAAO,YAAY,EAAE,aAAa;mBAClC,OAAO,YAAY,EAAE,IAAI;wCACzB,OAAO,YAAY,EAAE,yBAAyB;qCAC9C,OAAO,YAAY,EAAE,sBAAsB;4BAC3C,OAAO,YAAY,EAAE,aAAa;qCAClC,OAAO,YAAY,EAAE,sBAAsB;6BAC3C,OAAO,YAAY,EAAE,cAAc;2BACnC,OAAO,YAAY,EAAE,YAAY;gCACjC,OAAO,YAAY,EAAE,iBAAiB;uCACtC,OAAO,YAAY,EAAE,wBAAwB;2BAd/B,gBAAgB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AACH,yEAYC;;;;;AAED;;;;;;;GAOG;AACH,sCAA+E;qCAzClE,OAAO,YAAY,EAAE,sBAAsB;4BAC3C,OAAO,YAAY,EAAE,aAAa;qCAClC,OAAO,YAAY,EAAE,sBAAsB;6BAC3C,OAAO,YAAY,EAAE,cAAc;2BACnC,OAAO,YAAY,EAAE,YAAY;gCACjC,OAAO,YAAY,EAAE,iBAAiB;uCACtC,OAAO,YAAY,EAAE,wBAAwB;2BAV/B,gBAAgB"}
@@ -6,59 +6,59 @@
6
6
  * @param {string|string[]} options.controller - The root controller.
7
7
  * @param {string} options.invocationTarget - The root invocation target.
8
8
  *
9
- * @returns {RootZcap} The root capability.
9
+ * @returns {IRootZcap} The root capability.
10
10
  */
11
11
  export function createRootCapability({ controller, invocationTarget }: {
12
12
  controller: string | string[];
13
13
  invocationTarget: string;
14
- }): RootZcap;
14
+ }): IRootZcap;
15
15
  /**
16
16
  * Retrieves the controller(s) from a capability.
17
17
  *
18
18
  * @param {object} options - The options.
19
- * @param {Zcap} options.capability - The authorization capability (zcap).
19
+ * @param {IZcap} options.capability - The authorization capability (zcap).
20
20
  *
21
21
  * @returns {string[]} The controller(s) for the capability.
22
22
  */
23
23
  export function getControllers({ capability }: {
24
- capability: Zcap;
24
+ capability: IZcap;
25
25
  }): string[];
26
26
  /**
27
27
  * Returns true if the given verification method is a controller (or is
28
28
  * controlled by a controller) of the given capability.
29
29
  *
30
30
  * @param {object} options - The options.
31
- * @param {Zcap} options.capability - The authorization capability (zcap).
31
+ * @param {IZcap} options.capability - The authorization capability (zcap).
32
32
  * @param {object} options.verificationMethod - The verification method to
33
33
  * check.
34
34
  *
35
35
  * @returns {boolean} `true` if the controller matches, `false` if not.
36
36
  */
37
37
  export function isController({ capability, verificationMethod }: {
38
- capability: Zcap;
38
+ capability: IZcap;
39
39
  verificationMethod: object;
40
40
  }): boolean;
41
41
  /**
42
42
  * Retrieves the allowed actions from a capability.
43
43
  *
44
44
  * @param {object} options - The options.
45
- * @param {Zcap} options.capability - The authorization capability (zcap).
45
+ * @param {IZcap} options.capability - The authorization capability (zcap).
46
46
  *
47
47
  * @returns {string[]} Allowed actions.
48
48
  */
49
49
  export function getAllowedActions({ capability }: {
50
- capability: Zcap;
50
+ capability: IZcap;
51
51
  }): string[];
52
52
  /**
53
53
  * Retrieves the target from a capability.
54
54
  *
55
55
  * @param {object} options - The options.
56
- * @param {Zcap} options.capability - The authorization capability (zcap).
56
+ * @param {IZcap} options.capability - The authorization capability (zcap).
57
57
  *
58
58
  * @returns {string} - Capability target.
59
59
  */
60
60
  export function getTarget({ capability }: {
61
- capability: Zcap;
61
+ capability: IZcap;
62
62
  }): string;
63
63
  /**
64
64
  * Retrieves the delegation proof(s) for a capability that is associated with
@@ -66,26 +66,26 @@ export function getTarget({ capability }: {
66
66
  * delegation proofs will cause this function to return an empty array.
67
67
  *
68
68
  * @param {object} options - The options.
69
- * @param {Zcap} options.capability - The authorization capability.
69
+ * @param {IZcap} options.capability - The authorization capability.
70
70
  *
71
- * @returns {CapabilityDelegationProof[]} Any `capabilityDelegation` proof
71
+ * @returns {ICapabilityDelegationProof[]} Any `capabilityDelegation` proof
72
72
  * objects attached to the given capability.
73
73
  */
74
74
  export function getDelegationProofs({ capability }: {
75
- capability: Zcap;
76
- }): CapabilityDelegationProof[];
75
+ capability: IZcap;
76
+ }): ICapabilityDelegationProof[];
77
77
  /**
78
78
  * Gets the `capabilityChain` associated with the given capability.
79
79
  *
80
80
  * @param {object} options - The options.
81
- * @param {Zcap} options.capability - The authorization capability.
81
+ * @param {IZcap} options.capability - The authorization capability.
82
82
  *
83
- * @returns {Array<string|DelegatedZcap>} The capability chain entries
83
+ * @returns {Array<string|IDelegatedZcap>} The capability chain entries
84
84
  * (root to parent), as stored in the delegation proof.
85
85
  */
86
86
  export function getCapabilityChain({ capability }: {
87
- capability: Zcap;
88
- }): Array<string | DelegatedZcap>;
87
+ capability: IZcap;
88
+ }): Array<string | IDelegatedZcap>;
89
89
  /**
90
90
  * Determines if the given `invocationTarget` is valid given a
91
91
  * `baseInvocationTarget`.
@@ -116,18 +116,18 @@ export function isValidTarget({ invocationTarget, baseInvocationTarget, allowTar
116
116
  * given `parentCapability`.
117
117
  *
118
118
  * @param {object} options - The options.
119
- * @param {string|Zcap} options.parentCapability - The parent capability from
119
+ * @param {string|IZcap} options.parentCapability - The parent capability from
120
120
  * which to compute the capability chain (a root zcap ID string, or a full
121
121
  * root or delegated zcap object).
122
122
  * @param {boolean} options._skipLocalValidationForTesting - Private.
123
123
  *
124
- * @returns {Array<string|DelegatedZcap>} The computed capability chain to be
124
+ * @returns {Array<string|IDelegatedZcap>} The computed capability chain to be
125
125
  * included in a capability delegation proof.
126
126
  */
127
127
  export function computeCapabilityChain({ parentCapability, _skipLocalValidationForTesting }: {
128
- parentCapability: string | Zcap;
128
+ parentCapability: string | IZcap;
129
129
  _skipLocalValidationForTesting: boolean;
130
- }): Array<string | DelegatedZcap>;
130
+ }): Array<string | IDelegatedZcap>;
131
131
  /**
132
132
  * Dereferences the capability chain associated with the given capability,
133
133
  * ensuring it passes a number of validation checks.
@@ -152,7 +152,7 @@ export function computeCapabilityChain({ parentCapability, _skipLocalValidationF
152
152
  * work with both root zcap `a` and `b`).
153
153
  *
154
154
  * @param {object} options - The options.
155
- * @param {string|DelegatedZcap} options.capability - The authorization
155
+ * @param {string|IDelegatedZcap} options.capability - The authorization
156
156
  * capability to dereference the chain for. Pass a string (the root zcap ID)
157
157
  * to dereference a root zcap directly, or a delegated zcap object.
158
158
  * @param {Function} options.getRootCapability - A function for dereferencing
@@ -161,15 +161,15 @@ export function computeCapabilityChain({ parentCapability, _skipLocalValidationF
161
161
  * @param {number} [options.maxChainLength=10] - The maximum length of the
162
162
  * capability delegation chain (this is inclusive of `capability` itself).
163
163
  *
164
- * @returns {Promise<{dereferencedChain: Zcap[]}>} Resolves to an object
164
+ * @returns {Promise<{dereferencedChain: IZcap[]}>} Resolves to an object
165
165
  * containing the full dereferenced chain ordered root to tail.
166
166
  */
167
167
  export function dereferenceCapabilityChain({ capability, getRootCapability, maxChainLength }: {
168
- capability: string | DelegatedZcap;
168
+ capability: string | IDelegatedZcap;
169
169
  getRootCapability: Function;
170
170
  maxChainLength?: number;
171
171
  }): Promise<{
172
- dereferencedChain: Zcap[];
172
+ dereferencedChain: IZcap[];
173
173
  }>;
174
174
  export function checkProofContext({ proof }: {
175
175
  proof: any;
@@ -188,37 +188,29 @@ export function compareTime({ t1, t2, maxClockSkew }: {
188
188
  maxClockSkew: any;
189
189
  }): 0 | 1 | -1;
190
190
  /**
191
- * The zcap object shapes (`RootZcap`, `DelegatedZcap`,
192
- * `CapabilityDelegationProof`, `Zcap`) are defined in `./zcap-types.d.ts` and
193
- * re-exported here as typedefs. They cannot be expressed as JSDoc `@typedef`s
194
- * because TypeScript's JSDoc parser mangles the `@context` property name (the
195
- * leading `@` becomes an empty-string key). See `./zcap-types.d.ts`.
191
+ * The zcap object shapes (`IRootZcap`, `IDelegatedZcap`,
192
+ * `ICapabilityDelegationProof`, `IZcap`) live in `@digitalcredentials/ssi/zcap`
193
+ * (the canonical home) and are re-imported here as typedefs for JSDoc use.
196
194
  */
197
- export type RootZcap = import("./zcap-types.js").RootZcap;
195
+ export type IRootZcap = import("@digitalcredentials/ssi/zcap").IRootZcap;
198
196
  /**
199
- * The zcap object shapes (`RootZcap`, `DelegatedZcap`,
200
- * `CapabilityDelegationProof`, `Zcap`) are defined in `./zcap-types.d.ts` and
201
- * re-exported here as typedefs. They cannot be expressed as JSDoc `@typedef`s
202
- * because TypeScript's JSDoc parser mangles the `@context` property name (the
203
- * leading `@` becomes an empty-string key). See `./zcap-types.d.ts`.
197
+ * The zcap object shapes (`IRootZcap`, `IDelegatedZcap`,
198
+ * `ICapabilityDelegationProof`, `IZcap`) live in `@digitalcredentials/ssi/zcap`
199
+ * (the canonical home) and are re-imported here as typedefs for JSDoc use.
204
200
  */
205
- export type CapabilityDelegationProof = import("./zcap-types.js").CapabilityDelegationProof;
201
+ export type ICapabilityDelegationProof = import("@digitalcredentials/ssi/zcap").ICapabilityDelegationProof;
206
202
  /**
207
- * The zcap object shapes (`RootZcap`, `DelegatedZcap`,
208
- * `CapabilityDelegationProof`, `Zcap`) are defined in `./zcap-types.d.ts` and
209
- * re-exported here as typedefs. They cannot be expressed as JSDoc `@typedef`s
210
- * because TypeScript's JSDoc parser mangles the `@context` property name (the
211
- * leading `@` becomes an empty-string key). See `./zcap-types.d.ts`.
203
+ * The zcap object shapes (`IRootZcap`, `IDelegatedZcap`,
204
+ * `ICapabilityDelegationProof`, `IZcap`) live in `@digitalcredentials/ssi/zcap`
205
+ * (the canonical home) and are re-imported here as typedefs for JSDoc use.
212
206
  */
213
- export type DelegatedZcap = import("./zcap-types.js").DelegatedZcap;
207
+ export type IDelegatedZcap = import("@digitalcredentials/ssi/zcap").IDelegatedZcap;
214
208
  /**
215
- * The zcap object shapes (`RootZcap`, `DelegatedZcap`,
216
- * `CapabilityDelegationProof`, `Zcap`) are defined in `./zcap-types.d.ts` and
217
- * re-exported here as typedefs. They cannot be expressed as JSDoc `@typedef`s
218
- * because TypeScript's JSDoc parser mangles the `@context` property name (the
219
- * leading `@` becomes an empty-string key). See `./zcap-types.d.ts`.
209
+ * The zcap object shapes (`IRootZcap`, `IDelegatedZcap`,
210
+ * `ICapabilityDelegationProof`, `IZcap`) live in `@digitalcredentials/ssi/zcap`
211
+ * (the canonical home) and are re-imported here as typedefs for JSDoc use.
220
212
  */
221
- export type Zcap = import("./zcap-types.js").Zcap;
213
+ export type IZcap = import("@digitalcredentials/ssi/zcap").IZcap;
222
214
  /**
223
215
  * An inspection function result.
224
216
  */
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.js"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,uEALG;IAAiC,UAAU,EAAnC,MAAM,GAAC,MAAM,EAAE;IACC,gBAAgB,EAAhC,MAAM;CAEd,GAAU,QAAQ,CASpB;AAED;;;;;;;GAOG;AACH,+CAJG;IAAsB,UAAU,EAAxB,IAAI;CAEZ,GAAU,MAAM,EAAE,CAQpB;AAED;;;;;;;;;;GAUG;AACH,iEANG;IAAsB,UAAU,EAAxB,IAAI;IACY,kBAAkB,EAAlC,MAAM;CAGd,GAAU,OAAO,CAMnB;AAED;;;;;;;GAOG;AACH,kDAJG;IAAsB,UAAU,EAAxB,IAAI;CAEZ,GAAU,MAAM,EAAE,CAWpB;AAED;;;;;;;GAOG;AACH,0CAJG;IAAsB,UAAU,EAAxB,IAAI;CAEZ,GAAU,MAAM,CAKlB;AAED;;;;;;;;;;GAUG;AACH,oDALG;IAAsB,UAAU,EAAxB,IAAI;CAEZ,GAAU,yBAAyB,EAAE,CAcvC;AAED;;;;;;;;GAQG;AACH,mDALG;IAAsB,UAAU,EAAxB,IAAI;CAEZ,GAAU,KAAK,CAAC,MAAM,GAAC,aAAa,CAAC,CAwBvC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,kGAPG;IAAwB,gBAAgB,EAAhC,MAAM;IACU,oBAAoB,EAApC,MAAM;IACW,sBAAsB,EAAvC,OAAO;CAGf,GAAU,OAAO,CAkCnB;AAED;;;;;;;;;;;;GAYG;AACH,6FARG;IAA6B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E;;;;;;;yBACZ,cAAc,EAAE;;;;;;;;;;kBAUhB,YAAY;;;;;;;;;;cAQZ,OAAO;;;;;aAEP,iBAAiB,EAAE;;;;;;;;;;wBAQnB,wBAAwB;;;;;;;;;;eAQxB,MAAM"}
@@ -1,72 +0,0 @@
1
- /*!
2
- * Copyright (c) 2018-2026 Digital Bazaar, Inc. All rights reserved.
3
- */
4
-
5
- // Hand-authored object shapes for zcaps. These live in a `.d.ts` (rather than
6
- // as JSDoc `@typedef`s in `utils.js`) because TypeScript's JSDoc parser cannot
7
- // express a property named `@context` -- the leading `@` is mangled to an
8
- // empty-string key (`""`). `utils.js` re-exports these via `@typedef
9
- // {import('./zcap-types.js').X} X` so the public type names are unchanged.
10
-
11
- /**
12
- * A root authorization capability (zcap). Root zcaps are unsigned, have no
13
- * `expires` field and no delegation proof.
14
- */
15
- export interface RootZcap {
16
- /** The zcap JSON-LD context URL. */
17
- '@context': string;
18
- /** Capability ID (`urn:zcap:root:<encodedTarget>`). */
19
- id: string;
20
- /** The DID(s) authorized to invoke. */
21
- controller: string | string[];
22
- /** Resource URI this capability grants access to (absolute URI). */
23
- invocationTarget: string;
24
- }
25
-
26
- /** A proof attached to a delegated capability. */
27
- export interface CapabilityDelegationProof {
28
- /** The cryptographic suite type (e.g. `'Ed25519Signature2020'`). */
29
- type: string;
30
- /** ISO 8601 date-time the proof was created. */
31
- created: string;
32
- /** Verification method URI used to sign. */
33
- verificationMethod: string;
34
- /** Always `'capabilityDelegation'`. */
35
- proofPurpose: 'capabilityDelegation';
36
- /**
37
- * Ordered capability chain (root > parent). All entries are string IDs
38
- * except the last delegated zcap, which is embedded as an object.
39
- */
40
- capabilityChain: (string | DelegatedZcap)[];
41
- /** The encoded proof value. */
42
- proofValue: string;
43
- }
44
-
45
- /**
46
- * A delegated authorization capability (zcap). Delegated capabilities narrow
47
- * a parent capability and must carry exactly one `capabilityDelegation` proof.
48
- */
49
- export interface DelegatedZcap {
50
- /** JSON-LD context array; first entry MUST be the zcap context URL. */
51
- '@context': string[];
52
- /** Capability ID (absolute URI). */
53
- id: string;
54
- /** Parent capability ID (absolute URI). */
55
- parentCapability: string;
56
- /** The DID(s) authorized to invoke. */
57
- controller: string | string[];
58
- /** Resource URI this capability grants access to (absolute URI). */
59
- invocationTarget: string;
60
- /**
61
- * The action(s) the controller may perform; if absent, no actions are
62
- * allowed (except for the root zcap).
63
- */
64
- allowedAction?: string | string[];
65
- /** ISO 8601 date-time when this capability expires. */
66
- expires: string;
67
- /** The capability delegation proof(s). */
68
- proof: CapabilityDelegationProof | CapabilityDelegationProof[];
69
- }
70
-
71
- /** A zcap is either a root or a delegated capability. */
72
- export type Zcap = RootZcap | DelegatedZcap;