@interop/was-client 0.99.1 → 0.100.0

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.
Files changed (107) hide show
  1. package/README.md +90 -70
  2. package/dist/Collection.d.ts +20 -8
  3. package/dist/Collection.d.ts.map +1 -1
  4. package/dist/Collection.js +89 -69
  5. package/dist/Collection.js.map +1 -1
  6. package/dist/Resource.d.ts +14 -3
  7. package/dist/Resource.d.ts.map +1 -1
  8. package/dist/Resource.js +38 -27
  9. package/dist/Resource.js.map +1 -1
  10. package/dist/Space.d.ts +18 -4
  11. package/dist/Space.d.ts.map +1 -1
  12. package/dist/Space.js +64 -61
  13. package/dist/Space.js.map +1 -1
  14. package/dist/WasClient.d.ts +102 -54
  15. package/dist/WasClient.d.ts.map +1 -1
  16. package/dist/WasClient.js +212 -133
  17. package/dist/WasClient.js.map +1 -1
  18. package/dist/codec.d.ts +3 -2
  19. package/dist/codec.d.ts.map +1 -1
  20. package/dist/edv/EdvCodec.js +1 -1
  21. package/dist/edv/EdvCodec.js.map +1 -1
  22. package/dist/edv/WasTransport.d.ts +7 -4
  23. package/dist/edv/WasTransport.d.ts.map +1 -1
  24. package/dist/edv/WasTransport.js +39 -20
  25. package/dist/edv/WasTransport.js.map +1 -1
  26. package/dist/edv/acquire.d.ts +3 -3
  27. package/dist/edv/acquire.d.ts.map +1 -1
  28. package/dist/edv/acquire.js +3 -3
  29. package/dist/edv/acquire.js.map +1 -1
  30. package/dist/edv/cipher.d.ts +1 -1
  31. package/dist/edv/cipher.js +1 -1
  32. package/dist/edv/docCipher.d.ts +6 -5
  33. package/dist/edv/docCipher.d.ts.map +1 -1
  34. package/dist/edv/docCipher.js +6 -5
  35. package/dist/edv/docCipher.js.map +1 -1
  36. package/dist/edv/encryption.d.ts +2 -2
  37. package/dist/edv/encryption.d.ts.map +1 -1
  38. package/dist/edv/encryption.js +8 -6
  39. package/dist/edv/encryption.js.map +1 -1
  40. package/dist/edv/refreshingDocCipher.d.ts +3 -3
  41. package/dist/edv/refreshingDocCipher.d.ts.map +1 -1
  42. package/dist/edv/refreshingDocCipher.js +3 -3
  43. package/dist/edv/refreshingDocCipher.js.map +1 -1
  44. package/dist/edv/transportFactory.d.ts +3 -3
  45. package/dist/edv/transportFactory.d.ts.map +1 -1
  46. package/dist/edv/transportFactory.js +3 -3
  47. package/dist/edv/transportFactory.js.map +1 -1
  48. package/dist/index.d.ts +2 -1
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/index.js.map +1 -1
  52. package/dist/internal/codec.d.ts +7 -7
  53. package/dist/internal/codec.d.ts.map +1 -1
  54. package/dist/internal/codec.js +19 -18
  55. package/dist/internal/codec.js.map +1 -1
  56. package/dist/internal/conditional.d.ts +3 -3
  57. package/dist/internal/conditional.d.ts.map +1 -1
  58. package/dist/internal/conditional.js +5 -5
  59. package/dist/internal/conditional.js.map +1 -1
  60. package/dist/internal/grant.d.ts +15 -26
  61. package/dist/internal/grant.d.ts.map +1 -1
  62. package/dist/internal/grant.js +95 -29
  63. package/dist/internal/grant.js.map +1 -1
  64. package/dist/internal/meta.d.ts +8 -8
  65. package/dist/internal/meta.d.ts.map +1 -1
  66. package/dist/internal/meta.js +13 -10
  67. package/dist/internal/meta.js.map +1 -1
  68. package/dist/internal/paths.d.ts +332 -195
  69. package/dist/internal/paths.d.ts.map +1 -1
  70. package/dist/internal/paths.js +400 -367
  71. package/dist/internal/paths.js.map +1 -1
  72. package/dist/internal/policy.d.ts +23 -23
  73. package/dist/internal/policy.d.ts.map +1 -1
  74. package/dist/internal/policy.js +20 -20
  75. package/dist/internal/policy.js.map +1 -1
  76. package/dist/internal/request.d.ts +17 -21
  77. package/dist/internal/request.d.ts.map +1 -1
  78. package/dist/internal/request.js +10 -21
  79. package/dist/internal/request.js.map +1 -1
  80. package/dist/internal/revoke.d.ts +34 -13
  81. package/dist/internal/revoke.d.ts.map +1 -1
  82. package/dist/internal/revoke.js +97 -28
  83. package/dist/internal/revoke.js.map +1 -1
  84. package/dist/internal/service.d.ts +25 -7
  85. package/dist/internal/service.d.ts.map +1 -1
  86. package/dist/internal/service.js +49 -45
  87. package/dist/internal/service.js.map +1 -1
  88. package/dist/internal/write.d.ts +18 -18
  89. package/dist/internal/write.d.ts.map +1 -1
  90. package/dist/internal/write.js +27 -27
  91. package/dist/internal/write.js.map +1 -1
  92. package/dist/paths.d.ts +32 -25
  93. package/dist/paths.d.ts.map +1 -1
  94. package/dist/paths.js +32 -25
  95. package/dist/paths.js.map +1 -1
  96. package/dist/sync/port.d.ts +3 -3
  97. package/dist/sync/port.d.ts.map +1 -1
  98. package/dist/sync/port.js +12 -12
  99. package/dist/sync/port.js.map +1 -1
  100. package/dist/sync/provisioning.d.ts +10 -9
  101. package/dist/sync/provisioning.d.ts.map +1 -1
  102. package/dist/sync/provisioning.js +19 -18
  103. package/dist/sync/provisioning.js.map +1 -1
  104. package/dist/sync/types.d.ts +2 -2
  105. package/dist/types.d.ts +13 -5
  106. package/dist/types.d.ts.map +1 -1
  107. package/package.json +1 -1
@@ -173,17 +173,17 @@ export function readEtag(response) {
173
173
  * the server.
174
174
  *
175
175
  * @param options {object}
176
- * @param options.path {string} the resource path written
176
+ * @param options.url {string} the resource URL written
177
177
  * @param options.current {ResponseLike | null} the pre-read document
178
178
  * @param [options.precondition] {WritePrecondition} the caller's precondition
179
179
  * @returns {void}
180
180
  */
181
- export function assertPreconditionAgainstPreRead({ path, current, precondition }) {
181
+ export function assertPreconditionAgainstPreRead({ url, current, precondition }) {
182
182
  if (precondition === undefined) {
183
183
  return;
184
184
  }
185
185
  if (precondition.ifNoneMatch && current !== null) {
186
- throw new PreconditionFailedError(`Cannot create the document at "${path}": create-if-absent was ` +
186
+ throw new PreconditionFailedError(`Cannot create the document at "${url}": create-if-absent was ` +
187
187
  'requested (ifNoneMatch), but a document is already stored there. ' +
188
188
  'Re-read it and write an update instead.', { status: 412 });
189
189
  }
@@ -191,14 +191,14 @@ export function assertPreconditionAgainstPreRead({ path, current, precondition }
191
191
  return;
192
192
  }
193
193
  if (current === null) {
194
- throw new PreconditionFailedError(`Cannot update the document at "${path}": an ifMatch validator was ` +
194
+ throw new PreconditionFailedError(`Cannot update the document at "${url}": an ifMatch validator was ` +
195
195
  'supplied, but no current document is readable there -- it was ' +
196
196
  'deleted, or it is not readable with this capability (WAS masks ' +
197
197
  'unauthorized reads as 404). Re-read the resource before retrying.', { status: 412 });
198
198
  }
199
199
  const etag = readEtag(current);
200
200
  if (etag !== undefined && etag !== precondition.ifMatch) {
201
- throw new PreconditionFailedError(`Cannot update the document at "${path}": its current version ` +
201
+ throw new PreconditionFailedError(`Cannot update the document at "${url}": its current version ` +
202
202
  `(${etag}) is not the one the write was pinned to ` +
203
203
  `(${precondition.ifMatch}) -- another writer changed it. Re-read the ` +
204
204
  'resource, rebase the change, and retry.', { status: 412 });
@@ -1 +1 @@
1
- {"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../src/internal/conditional.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EAChB,MAAM,cAAc,CAAA;AAErB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAA;AAE3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAA;AAa3C;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAqB;IACvD,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAA;AACvE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,YAAgC;IAEhC,OAAO,YAAY,KAAK,SAAS;QAC/B,CAAC,YAAY,CAAC,OAAO,KAAK,SAAS,IAAI,YAAY,CAAC,WAAW,CAAC;QAChE,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,SAAS,CAAA;AACf,C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IAAI,IAAI,2CAA2C;YACnD,IAAI,YAAY,CAAC,OAAO,8CAA8C;YACtE,yCAAyC,EAC3C,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -1,35 +1,21 @@
1
- /*!
2
- * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
- */
4
- /**
5
- * The delegation primitive shared by `was.grant()` and the `space`/`collection`
6
- * grant sugar. Maps `GrantOptions` onto `zcapClient.delegate(...)`, normalizing
7
- * action verbs to uppercase so a lowercase grant (`'get'`) still validates on
8
- * the server (which matches actions case-sensitively against `'GET'`).
9
- *
10
- * An unparented grant whose target lies in the server's Space tree is delegated
11
- * from that **Space's** root capability, with the target carried as an
12
- * attenuated `invocationTarget`, rather than from the target's own root
13
- * capability. Both forms grant the same access (the server verifies WAS routes
14
- * with target attenuation allowed), but only a Space-rooted chain can be revoked
15
- * -- revocation is Space-scoped, and the endpoint requires the chain to root
16
- * exactly in the Space (see `revoke.ts`).
17
- */
18
1
  import type { ClientContext } from './request.js';
19
2
  import type { GrantOptions, IDelegatedZcap, IZcap } from '../types.js';
20
3
  /**
21
4
  * Delegates a capability per `GrantOptions`, returning the signed zcap to hand
22
5
  * off out-of-band. An explicit `capability` (re-delegation of a parent zcap)
23
- * always wins; otherwise a Space-tree target is rooted at its Space, so the
24
- * resulting capability is revocable via `space.revoke()` / `was.revoke()`.
6
+ * always wins; otherwise a grant naming its `spaceUrl` is rooted at that
7
+ * Space, so the resulting capability is revocable via `space.revoke()` /
8
+ * `was.revoke()`; otherwise ezcap roots it at the target's own root
9
+ * capability.
25
10
  *
26
11
  * @param context {ClientContext}
27
12
  * @param options {GrantOptions}
28
13
  * @returns {Promise<IDelegatedZcap>}
29
14
  * @throws {ValidationError} when neither `target` nor `capability` is given,
30
- * so the delegation names nothing to grant
15
+ * so the delegation names nothing to grant; or when `spaceUrl` is given
16
+ * and `target` does not lie at or beneath it
31
17
  */
32
- export declare function delegateGrant(context: ClientContext, { to, actions, expires, target, capability }: GrantOptions): Promise<IDelegatedZcap>;
18
+ export declare function delegateGrant(context: ClientContext, { to, actions, expires, target, capability, spaceUrl }: GrantOptions): Promise<IDelegatedZcap>;
33
19
  /**
34
20
  * Whether a capability permits `action`, matched case-insensitively against
35
21
  * its `allowedAction` (a single verb or a list). A capability that states no
@@ -49,18 +35,21 @@ export declare function allowsAction({ zcap, action }: {
49
35
  /**
50
36
  * The scoped-grant sugar shared by `Space.grant` and `Collection.grant`:
51
37
  * delegates per `GrantOptions` with the grant `target` prefilled from the
52
- * handle's `path` (and the handle's bound `capability`, if any, as the parent
53
- * for re-delegation). Explicit options win over both prefills.
38
+ * handle's `url`, the rooting `spaceUrl` from the handle's Space, and the
39
+ * handle's bound `capability`, if any, as the parent for re-delegation.
40
+ * Explicit options win over every prefill.
54
41
  *
55
42
  * @param context {ClientContext}
56
43
  * @param options {object}
57
- * @param options.path {string} the handle's path (target fallback)
44
+ * @param options.url {string} the handle's URL (target fallback)
45
+ * @param options.spaceUrl {string} the handle's Space (rooting fallback)
58
46
  * @param options.options {GrantOptions} the caller's grant options
59
47
  * @param [options.capability] {IZcap} the handle's bound capability
60
48
  * @returns {Promise<IDelegatedZcap>}
61
49
  */
62
- export declare function delegateGrantAt(context: ClientContext, { path, options, capability }: {
63
- path: string;
50
+ export declare function delegateGrantAt(context: ClientContext, { url, spaceUrl, options, capability }: {
51
+ url: string;
52
+ spaceUrl: string;
64
53
  options: GrantOptions;
65
54
  capability?: IZcap;
66
55
  }): Promise<IDelegatedZcap>;
@@ -1 +1 @@
1
- {"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/internal/grant.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAgCtE;;;;;;;;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AsB,eAAe,CACnC,OAAO,EAAE,aAAa,EACtB,EACE,GAAG,EACH,QAAQ,EACR,OAAO,EACP,UAAU,EACX,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB,GACA,OAAO,CAAC,cAAc,CAAC,CAOzB"}
@@ -1,42 +1,106 @@
1
- import { parseSpaceTarget, spacePath, toUrl } from './paths.js';
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The delegation primitive shared by `was.grant()` and the `space`/`collection`
6
+ * grant sugar. Maps `GrantOptions` onto `zcapClient.delegate(...)`, normalizing
7
+ * action verbs to uppercase so a lowercase grant (`'get'`) still validates on
8
+ * the server (which matches actions case-sensitively against `'GET'`).
9
+ *
10
+ * An unparented grant that names its Space (`spaceUrl`, which the scoped sugar
11
+ * fills from the handle) is delegated from that **Space's** root capability,
12
+ * with the target carried as an attenuated `invocationTarget`, rather than
13
+ * from the target's own root capability. Both forms grant the same access (the
14
+ * server verifies WAS routes with target attenuation allowed), but only a
15
+ * Space-rooted chain can be revoked -- revocation is Space-scoped, and the
16
+ * endpoint requires the chain to root exactly in the Space (see `revoke.ts`).
17
+ *
18
+ * A bare `was.grant({ target })` without `spaceUrl` is the other mode, kept
19
+ * on purpose: it delegates from the target's own root capability (ezcap's
20
+ * default). It is the shape for a server at the basic conformance level,
21
+ * which may serve fixed collections, or resources alone, with no Space
22
+ * container to root a chain in. Such a grant cannot be revoked through a
23
+ * Space's revocation endpoint; that is a limitation of that conformance
24
+ * level, not of the client.
25
+ */
26
+ import { isValidTarget } from '@interop/zcap';
27
+ import { canonicalSpaceUrl } from './paths.js';
2
28
  import { rootCapabilityId } from './revoke.js';
3
29
  import { ValidationError } from '../errors.js';
4
30
  /**
5
- * The root capability id (`urn:zcap:root:<encoded target>`) of the Space
6
- * containing `target`, or `undefined` when `target` is not a URL beneath this
7
- * server's `/space` tree (e.g. a `/kms` target, or another origin) -- in which
8
- * case the caller lets ezcap default to the target's own root capability.
31
+ * Roots a grant in its Space: the root capability id
32
+ * (`urn:zcap:root:<encoded Space URL>`) to parent it on, after checking that
33
+ * `target` lies at or beneath the Space, and the target to delegate. A chain
34
+ * rooted in one Space cannot delegate a target outside it, and the server
35
+ * would refuse the capability at invocation, so the mismatch is refused here
36
+ * by name.
37
+ *
38
+ * The Space itself may be named in either form. The bare (slash-less) form
39
+ * is accepted as the target, as `parseSpaceTarget` accepts it, and is
40
+ * delegated in canonical form: the server verifies a Space-rooted chain
41
+ * against the canonical Space URL, under which the bare form is not an
42
+ * attenuation of the Space but a sibling of it.
9
43
  *
10
44
  * The id is returned as a string, which `zcapClient.delegate(...)` accepts for a
11
45
  * root parent capability. (Its sibling `request(...)` does not, for a non-`https:`
12
46
  * target -- hence the object form in `revoke.ts`.)
13
47
  *
14
48
  * @param options {object}
15
- * @param options.baseUrl {string} the client's server base URL
16
- * @param options.target {string} the absolute grant target URL
17
- * @returns {string | undefined}
49
+ * @param options.spaceUrl {string} the Space to root the grant in
50
+ * @param options.target {string} the absolute grant target URL
51
+ * @returns {{ parent: string, target: string }}
52
+ * @throws {ValidationError} when `target` is not at or beneath `spaceUrl`,
53
+ * or its path is rewritten by URL normalization (a dot segment)
18
54
  */
19
- function spaceRootCapabilityId({ baseUrl, target }) {
20
- const parsed = parseSpaceTarget({ baseUrl, target });
21
- if (parsed === null) {
22
- return undefined;
55
+ function spaceRooted({ spaceUrl, target }) {
56
+ const canonical = canonicalSpaceUrl(spaceUrl);
57
+ // The check runs against the canonical Space URL, the base the server
58
+ // verifies the chain against, so what passes here is what the server
59
+ // accepts. The bare form is the one exception, matched exactly: as a base
60
+ // it would also admit `{space}?x`, which the server refuses.
61
+ const bare = canonical.slice(0, -1);
62
+ if (target !== bare &&
63
+ !isValidTarget({
64
+ invocationTarget: target,
65
+ baseInvocationTarget: canonical,
66
+ allowTargetAttenuation: true
67
+ })) {
68
+ throw new ValidationError(`Grant target "${target}" is not at or beneath the Space ` +
69
+ `"${canonical}" the grant would be rooted in.`);
70
+ }
71
+ // The prefix check reads the raw string, so a dot segment (`{space}../x`)
72
+ // passes it while naming a path outside the Space once a URL parser
73
+ // normalizes it. The server resolves the request URL that way, so such a
74
+ // target can never be invoked. Refuse a target whose path does not survive
75
+ // normalization unchanged. The query, if any, is left as given.
76
+ const origin = new URL(canonical).origin;
77
+ const rawPath = target.slice(origin.length).replace(/[?#].*$/, '');
78
+ if (target !== bare && new URL(target).pathname !== rawPath) {
79
+ throw new ValidationError(`Grant target "${target}" has a path that URL normalization rewrites ` +
80
+ '(a dot segment or an unencoded character); give the target in its ' +
81
+ 'normalized form.');
23
82
  }
24
- const spaceUrl = toUrl({ baseUrl, path: spacePath(parsed.spaceId) });
25
- return rootCapabilityId(spaceUrl);
83
+ return {
84
+ parent: rootCapabilityId(canonical),
85
+ target: target === bare ? canonical : target
86
+ };
26
87
  }
27
88
  /**
28
89
  * Delegates a capability per `GrantOptions`, returning the signed zcap to hand
29
90
  * off out-of-band. An explicit `capability` (re-delegation of a parent zcap)
30
- * always wins; otherwise a Space-tree target is rooted at its Space, so the
31
- * resulting capability is revocable via `space.revoke()` / `was.revoke()`.
91
+ * always wins; otherwise a grant naming its `spaceUrl` is rooted at that
92
+ * Space, so the resulting capability is revocable via `space.revoke()` /
93
+ * `was.revoke()`; otherwise ezcap roots it at the target's own root
94
+ * capability.
32
95
  *
33
96
  * @param context {ClientContext}
34
97
  * @param options {GrantOptions}
35
98
  * @returns {Promise<IDelegatedZcap>}
36
99
  * @throws {ValidationError} when neither `target` nor `capability` is given,
37
- * so the delegation names nothing to grant
100
+ * so the delegation names nothing to grant; or when `spaceUrl` is given
101
+ * and `target` does not lie at or beneath it
38
102
  */
39
- export async function delegateGrant(context, { to, actions, expires, target, capability }) {
103
+ export async function delegateGrant(context, { to, actions, expires, target, capability, spaceUrl }) {
40
104
  // The scoped sugar always prefills `target`, so this only catches a direct
41
105
  // `was.grant()`. Without either member ezcap has no invocation target and no
42
106
  // parent to take one from, and rejects the call with a bare `TypeError` a
@@ -45,16 +109,15 @@ export async function delegateGrant(context, { to, actions, expires, target, cap
45
109
  throw new ValidationError('A grant needs a `target` (the invocationTarget URL to grant) or a ' +
46
110
  '`capability` (the parent capability to attenuate); neither was given.');
47
111
  }
48
- const parent = capability ??
49
- (target === undefined
50
- ? undefined
51
- : spaceRootCapabilityId({ baseUrl: context.baseUrl, target }));
112
+ const rooted = capability === undefined && target !== undefined && spaceUrl !== undefined
113
+ ? spaceRooted({ spaceUrl, target })
114
+ : { parent: capability, target };
52
115
  return context.zcapClient.delegate({
53
116
  controller: to,
54
- invocationTarget: target,
117
+ invocationTarget: rooted.target,
55
118
  allowedActions: actions.map(action => action.toUpperCase()),
56
119
  expires,
57
- capability: parent
120
+ capability: rooted.parent
58
121
  });
59
122
  }
60
123
  /**
@@ -84,20 +147,23 @@ export function allowsAction({ zcap, action }) {
84
147
  /**
85
148
  * The scoped-grant sugar shared by `Space.grant` and `Collection.grant`:
86
149
  * delegates per `GrantOptions` with the grant `target` prefilled from the
87
- * handle's `path` (and the handle's bound `capability`, if any, as the parent
88
- * for re-delegation). Explicit options win over both prefills.
150
+ * handle's `url`, the rooting `spaceUrl` from the handle's Space, and the
151
+ * handle's bound `capability`, if any, as the parent for re-delegation.
152
+ * Explicit options win over every prefill.
89
153
  *
90
154
  * @param context {ClientContext}
91
155
  * @param options {object}
92
- * @param options.path {string} the handle's path (target fallback)
156
+ * @param options.url {string} the handle's URL (target fallback)
157
+ * @param options.spaceUrl {string} the handle's Space (rooting fallback)
93
158
  * @param options.options {GrantOptions} the caller's grant options
94
159
  * @param [options.capability] {IZcap} the handle's bound capability
95
160
  * @returns {Promise<IDelegatedZcap>}
96
161
  */
97
- export async function delegateGrantAt(context, { path, options, capability }) {
162
+ export async function delegateGrantAt(context, { url, spaceUrl, options, capability }) {
98
163
  return delegateGrant(context, {
99
164
  ...options,
100
- target: options.target ?? toUrl({ baseUrl: context.baseUrl, path }),
165
+ target: options.target ?? url,
166
+ spaceUrl: options.spaceUrl ?? spaceUrl,
101
167
  capability: options.capability ?? capability
102
168
  });
103
169
  }
@@ -1 +1 @@
1
- {"version":3,"file":"grant.js","sourceRoot":"","sources":["../../src/internal/grant.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAG9C;;;;;;;;;;;;;;GAcG;AACH,SAAS,qBAAqB,CAAC,EAC7B,OAAO,EACP,MAAM,EAIP;IACC,MAAM,MAAM,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAA;IACpD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACpE,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAA;AACnC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAsB,EACtB,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAgB;IAE1D,2EAA2E;IAC3E,6EAA6E;IAC7E,0EAA0E;IAC1E,2CAA2C;IAC3C,IAAI,MAAM,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QACrD,MAAM,IAAI,eAAe,CACvB,oEAAoE;YAClE,uEAAuE,CAC1E,CAAA;IACH,CAAC;IACD,MAAM,MAAM,GACV,UAAU;QACV,CAAC,MAAM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AAU,EAAE,MAAM,CAAC,MAAM;KAC1B,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,IAAI,EACJ,MAAM,EAIP;IACC,MAAM,OAAO,GAAG,IAAI,EAAE,aAAa,CAAA;IACnC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IAC5D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAA;IACnC,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAA;AAC9D,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAAsB,EACtB,EACE,GAAG,EACH,QAAQ,EACR,OAAO,EACP,UAAU,EAMX;IAED,OAAO,aAAa,CAAC,OAAO,EAAE;QAC5B,GAAG,OAAO;QACV,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,GAAG;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,QAAQ;QACtC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,UAAU;KAC7C,CAAC,CAAA;AACJ,CAAC"}
@@ -9,7 +9,7 @@ import type { IZcap, ResourceMetadataCustom, ResourceMetadataCustomInput } from
9
9
  *
10
10
  * @param context {ClientContext}
11
11
  * @param options {object}
12
- * @param options.metaPath {string} the `/meta` sub-resource path
12
+ * @param options.metaUrl {string} the `/meta` sub-resource URL
13
13
  * @param options.codec {Promise<ResourceCodec>} the resolving codec, awaited
14
14
  * concurrently with the read
15
15
  * @param options.subject {string} the metadata's owner as it reads in the
@@ -27,8 +27,8 @@ import type { IZcap, ResourceMetadataCustom, ResourceMetadataCustomInput } from
27
27
  */
28
28
  export declare function readMeta<Metadata extends {
29
29
  custom?: ResourceMetadataCustom;
30
- }>(context: ClientContext, { metaPath, codec: codecPromise, subject, slot, capability, onStored }: {
31
- metaPath: string;
30
+ }>(context: ClientContext, { metaUrl, codec: codecPromise, subject, slot, capability, onStored }: {
31
+ metaUrl: string;
32
32
  codec: Promise<ResourceCodec>;
33
33
  subject: string;
34
34
  slot: MetaReadSlot;
@@ -50,7 +50,7 @@ export declare function readMeta<Metadata extends {
50
50
  *
51
51
  * @param context {ClientContext}
52
52
  * @param options {object}
53
- * @param options.metaPath {string} the `meta` sub-resource path
53
+ * @param options.metaUrl {string} the `meta` sub-resource URL
54
54
  * @param options.codec {Promise<ResourceCodec>} the resolving codec
55
55
  * @param options.custom {ResourceMetadataCustomInput} the user-writable
56
56
  * properties, as a full replacement
@@ -61,8 +61,8 @@ export declare function readMeta<Metadata extends {
61
61
  * @param [options.capability] {IZcap}
62
62
  * @returns {Promise<{ etag?: string }>} the metadata's new ETag
63
63
  */
64
- export declare function writeMeta(context: ClientContext, { metaPath, codec: codecPromise, custom, slot, ifMatch, ifNoneMatch, capability }: {
65
- metaPath: string;
64
+ export declare function writeMeta(context: ClientContext, { metaUrl, codec: codecPromise, custom, slot, ifMatch, ifNoneMatch, capability }: {
65
+ metaUrl: string;
66
66
  codec: Promise<ResourceCodec>;
67
67
  custom: ResourceMetadataCustomInput;
68
68
  slot: MetaWriteSlot;
@@ -136,13 +136,13 @@ export declare function patchCustom(handle: {
136
136
  *
137
137
  * @param context {ClientContext}
138
138
  * @param options {object}
139
- * @param options.spaceId {string}
139
+ * @param options.spaceUrl {string}
140
140
  * @param options.collectionId {string}
141
141
  * @param [options.capability] {IZcap} capability attached to the request
142
142
  * @returns {Promise<{ metadata: StoredCollectionMetadata; etag?: string } | null>}
143
143
  */
144
144
  export declare function readCollectionMetadata(context: ClientContext, options: {
145
- spaceId: string;
145
+ spaceUrl: string;
146
146
  collectionId: string;
147
147
  capability?: IZcap;
148
148
  }): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjD,OAAO,KAAK,EACV,KAAK,EACL,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,aAAa,CAAA;AAEpB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,QAAQ,CAC5B,QAAQ,SAAS;IAAE,MAAM,CAAC,EAAE,sBAAsB,CAAA;CAAE,EAEpD,OAAO,EAAE,aAAa,EACtB,EACE,QAAQ,EACR,KAAK,EAAE,YAAY,EACnB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,YAAY,CAAA;IAClB,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACjC,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,sBAAsB,CAAA;KAC/B,KAAK,IAAI,CAAA;CACX,GACA,OAAO,CAAC,CAAC,QAAQ,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,IAAI,CAAC,C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AAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/C,OAAO,CAAC,IAAI,CAAC,CAuCf;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GACtE,OAAO,CAAC;IAAE,QAAQ,EAAE,wBAAwB,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAevE"}
@@ -17,13 +17,13 @@
17
17
  * left as stored, because the codec that would decode it is itself resolved
18
18
  * from the same object's `encryption` member. It lives here rather than beside
19
19
  * the Collection Metadata helpers in `describe.ts` so those stay free of the
20
- * transport layer; the request shape (path, capability, null-unwrap,
20
+ * transport layer; the request shape (URL, capability, null-unwrap,
21
21
  * validator) is still stated in one place, shared by `Collection`'s read and
22
22
  * write paths and by the codec resolver's descriptor discovery.
23
23
  */
24
24
  import { NotFoundError, WasServerError } from '../errors.js';
25
25
  import { compareAndSwap } from './cas.js';
26
- import { collectionMeta } from './paths.js';
26
+ import { collectionMetaUrl } from './paths.js';
27
27
  import { readDataWithEtag, send } from './request.js';
28
28
  import { readEtag, writeHeaders } from './conditional.js';
29
29
  import { withCodec } from './withCodec.js';
@@ -34,7 +34,7 @@ import { withCodec } from './withCodec.js';
34
34
  *
35
35
  * @param context {ClientContext}
36
36
  * @param options {object}
37
- * @param options.metaPath {string} the `/meta` sub-resource path
37
+ * @param options.metaUrl {string} the `/meta` sub-resource URL
38
38
  * @param options.codec {Promise<ResourceCodec>} the resolving codec, awaited
39
39
  * concurrently with the read
40
40
  * @param options.subject {string} the metadata's owner as it reads in the
@@ -50,11 +50,11 @@ import { withCodec } from './withCodec.js';
50
50
  * decode fails: a read that throws is no baseline
51
51
  * @returns {Promise<(Metadata & { etag?: string }) | null>}
52
52
  */
53
- export async function readMeta(context, { metaPath, codec: codecPromise, subject, slot, capability, onStored }) {
53
+ export async function readMeta(context, { metaUrl, codec: codecPromise, subject, slot, capability, onStored }) {
54
54
  // The metadata GET does not depend on the codec (only its `custom` decode
55
55
  // below does), so the two overlap.
56
56
  const [codec, response] = await withCodec(codecPromise, send(context, {
57
- path: metaPath,
57
+ url: metaUrl,
58
58
  method: 'GET',
59
59
  capability,
60
60
  read: true
@@ -100,7 +100,7 @@ export async function readMeta(context, { metaPath, codec: codecPromise, subject
100
100
  *
101
101
  * @param context {ClientContext}
102
102
  * @param options {object}
103
- * @param options.metaPath {string} the `meta` sub-resource path
103
+ * @param options.metaUrl {string} the `meta` sub-resource URL
104
104
  * @param options.codec {Promise<ResourceCodec>} the resolving codec
105
105
  * @param options.custom {ResourceMetadataCustomInput} the user-writable
106
106
  * properties, as a full replacement
@@ -111,11 +111,11 @@ export async function readMeta(context, { metaPath, codec: codecPromise, subject
111
111
  * @param [options.capability] {IZcap}
112
112
  * @returns {Promise<{ etag?: string }>} the metadata's new ETag
113
113
  */
114
- export async function writeMeta(context, { metaPath, codec: codecPromise, custom, slot, ifMatch, ifNoneMatch, capability }) {
114
+ export async function writeMeta(context, { metaUrl, codec: codecPromise, custom, slot, ifMatch, ifNoneMatch, capability }) {
115
115
  const codec = await codecPromise;
116
116
  const { custom: encoded } = await codec.encodeMeta({ custom, slot });
117
117
  const response = await send(context, {
118
- path: metaPath,
118
+ url: metaUrl,
119
119
  method: 'PUT',
120
120
  capability,
121
121
  json: { custom: encoded },
@@ -205,14 +205,17 @@ export async function patchCustom(handle, patch, { operation = 'Metadata update'
205
205
  *
206
206
  * @param context {ClientContext}
207
207
  * @param options {object}
208
- * @param options.spaceId {string}
208
+ * @param options.spaceUrl {string}
209
209
  * @param options.collectionId {string}
210
210
  * @param [options.capability] {IZcap} capability attached to the request
211
211
  * @returns {Promise<{ metadata: StoredCollectionMetadata; etag?: string } | null>}
212
212
  */
213
213
  export async function readCollectionMetadata(context, options) {
214
214
  const read = await readDataWithEtag(context, {
215
- path: collectionMeta(options.spaceId, options.collectionId),
215
+ url: collectionMetaUrl({
216
+ spaceUrl: options.spaceUrl,
217
+ collectionId: options.collectionId
218
+ }),
216
219
  capability: options.capability
217
220
  });
218
221
  if (read === null) {
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAG3C,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAO1C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAG5B,OAAsB,EACtB,EACE,QAAQ,EACR,KAAK,EAAE,YAAY,EACnB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,QAAQ,EAYT;IAED,0EAA0E;IAC1E,mCAAmC;IACnC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,MAAM,SAAS,CACvC,YAAY,EACZ,IAAI,CAAC,OAAO,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;QACb,UAAU;QACV,IAAI,EAAE,IAAI;KACX,CAAC,CACH,CAAA;IACD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC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