@interop/was-client 0.69.0 → 0.71.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.
- package/README.md +35 -0
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +2 -2
- package/dist/Collection.js.map +1 -1
- package/dist/Space.d.ts +8 -2
- package/dist/Space.d.ts.map +1 -1
- package/dist/Space.js +19 -4
- package/dist/Space.js.map +1 -1
- package/dist/WasClient.d.ts +4 -0
- package/dist/WasClient.d.ts.map +1 -1
- package/dist/WasClient.js +18 -6
- package/dist/WasClient.js.map +1 -1
- package/dist/edv/EdvCodec.d.ts +56 -74
- package/dist/edv/EdvCodec.d.ts.map +1 -1
- package/dist/edv/EdvCodec.js +12 -118
- package/dist/edv/EdvCodec.js.map +1 -1
- package/dist/edv/WasTransport.d.ts +1 -1
- package/dist/edv/WasTransport.d.ts.map +1 -1
- package/dist/edv/WasTransport.js +1 -1
- package/dist/edv/WasTransport.js.map +1 -1
- package/dist/edv/cipher.d.ts +80 -0
- package/dist/edv/cipher.d.ts.map +1 -0
- package/dist/edv/cipher.js +74 -0
- package/dist/edv/cipher.js.map +1 -0
- package/dist/edv/core.d.ts +25 -0
- package/dist/edv/core.d.ts.map +1 -0
- package/dist/edv/core.js +23 -0
- package/dist/edv/core.js.map +1 -0
- package/dist/edv/docCipher.d.ts.map +1 -1
- package/dist/edv/docCipher.js +16 -8
- package/dist/edv/docCipher.js.map +1 -1
- package/dist/edv/encryption.d.ts +71 -0
- package/dist/edv/encryption.d.ts.map +1 -0
- package/dist/edv/encryption.js +92 -0
- package/dist/edv/encryption.js.map +1 -0
- package/dist/edv/index.d.ts +17 -58
- package/dist/edv/index.d.ts.map +1 -1
- package/dist/edv/index.js +20 -51
- package/dist/edv/index.js.map +1 -1
- package/dist/edv/transportFactory.d.ts +17 -0
- package/dist/edv/transportFactory.d.ts.map +1 -0
- package/dist/edv/transportFactory.js +32 -0
- package/dist/edv/transportFactory.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/codec.js +2 -1
- package/dist/internal/codec.js.map +1 -1
- package/dist/internal/describe.d.ts +1 -43
- package/dist/internal/describe.d.ts.map +1 -1
- package/dist/internal/describe.js +23 -28
- package/dist/internal/describe.js.map +1 -1
- package/dist/internal/grant.d.ts +2 -0
- package/dist/internal/grant.d.ts.map +1 -1
- package/dist/internal/grant.js +11 -0
- package/dist/internal/grant.js.map +1 -1
- package/dist/internal/meta.d.ts +22 -0
- package/dist/internal/meta.d.ts.map +1 -1
- package/dist/internal/meta.js +40 -4
- package/dist/internal/meta.js.map +1 -1
- package/dist/internal/paths.d.ts +9 -2
- package/dist/internal/paths.d.ts.map +1 -1
- package/dist/internal/paths.js +9 -2
- package/dist/internal/paths.js.map +1 -1
- package/dist/internal/request.d.ts +8 -1
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/package.json +15 -3
package/dist/edv/index.js
CHANGED
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
* do not pull the `@interop/edv-client` / `@interop/minimal-cipher` crypto graph
|
|
8
8
|
* unless they opt in by importing this subpath.
|
|
9
9
|
*
|
|
10
|
+
* This is the full encrypted surface, online and offline. It re-exports
|
|
11
|
+
* `@interop/was-client/edv/core` -- the codec, the doc ciphers, the key
|
|
12
|
+
* epochs, the recipient operations, `resourceDescriptorStore`, the log-governed
|
|
13
|
+
* descriptor stores and the blinding keys, none of which need a server -- and
|
|
14
|
+
* adds the modules that do talk to one, `collectionDescriptorStore` among
|
|
15
|
+
* them. A consumer working offline imports `./edv/core` instead and keeps every
|
|
16
|
+
* transport module out of its graph; everything this entry exported before
|
|
17
|
+
* that entry existed still resolves from here.
|
|
18
|
+
*
|
|
10
19
|
* Two integration levels:
|
|
11
20
|
*
|
|
12
21
|
* - `createEdvEncryption` -- the EDV keystore for the handle seam. Pass its
|
|
@@ -17,45 +26,9 @@
|
|
|
17
26
|
* - `WasTransport` -- the standalone `@interop/edv-client`
|
|
18
27
|
* transport, for driving an `EdvClient` directly against WAS.
|
|
19
28
|
*
|
|
20
|
-
*
|
|
21
|
-
* `
|
|
22
|
-
*
|
|
23
|
-
* `initRecipients` / `addRecipient` / `removeRecipient` manage the readers and
|
|
24
|
-
* rotate the epoch key, so the same `createEdvEncryption` provider
|
|
25
|
-
* transparently encrypts each write under the current epoch and decrypts any
|
|
26
|
-
* epoch a reader still holds.
|
|
27
|
-
* They mutate the descriptor through the descriptor-store seam: the Collection
|
|
28
|
-
* Description by default, or any `EncryptionDescriptorStore` -- e.g.
|
|
29
|
-
* `resourceDescriptorStore` for a descriptor hosted as a plain JSON Resource.
|
|
30
|
-
*
|
|
31
|
-
* A collection provisioned with `ensureFirstEpoch({ blindedIndex: true })` also
|
|
32
|
-
* carries a blinded-index HMAC key, distributed to recipients exactly like an
|
|
33
|
-
* epoch key (see `hmacKey.ts`). It is installed at provisioning or never, and
|
|
34
|
-
* never rotates.
|
|
35
|
-
*
|
|
36
|
-
* `hasKeyEpochs` and `epochRostersEqual` are the crypto-free predicates over a
|
|
37
|
-
* descriptor: whether it carries a usable roster, and whether two descriptors
|
|
38
|
-
* carry the same epoch configuration (`scheme`, `version`, `currentEpoch`, and
|
|
39
|
-
* the ordered epoch ids; recipients and the `hmac` member deliberately
|
|
40
|
-
* excluded).
|
|
41
|
-
*
|
|
42
|
-
* `x25519RecipientFromDidKey` is the one rule for turning a grantee named only
|
|
43
|
-
* by its Ed25519 `did:key` controller into a `RecipientPublicKey`, so a
|
|
44
|
-
* recipient key is always derived from an identifier both sides already hold
|
|
45
|
-
* rather than transmitted.
|
|
46
|
-
*
|
|
47
|
-
* A decrypt that finds no key raises one of two classes, and a caller scanning
|
|
48
|
-
* rows must tell them apart: `UnknownEpochError` when the envelope's epoch is
|
|
49
|
-
* not on the descriptor the reader holds (a re-read may fix it) and
|
|
50
|
-
* `KeyUnwrapError` when the epoch IS listed but this reader has no key for it
|
|
51
|
-
* (never a recipient, or removed and the epoch rotated since -- re-reading
|
|
52
|
-
* cannot help). Both ship from this subpath beside the cipher that raises
|
|
53
|
-
* them, so a consumer classifying what a cipher threw need not reach for the
|
|
54
|
-
* package root. Both assign their `name` explicitly, and a consumer whose
|
|
55
|
-
* cipher arrives through an injected seam matches on that name rather than
|
|
56
|
-
* `instanceof`, since the seam may resolve to a second copy of this package:
|
|
57
|
-
* `isKeyUnwrapError` here, and `isUnknownEpochError` on `./sync`, are those
|
|
58
|
-
* matchers.
|
|
29
|
+
* `collectionDescriptorStore` is the `EncryptionDescriptorStore` over a live
|
|
30
|
+
* `Collection` handle's Collection Description, the default the recipient
|
|
31
|
+
* operations use when a caller names a collection rather than a store.
|
|
59
32
|
*
|
|
60
33
|
* Which epoch a collection encrypts under, and when to ask again, is the
|
|
61
34
|
* descriptor acquisition and refresh policy every consumer running an
|
|
@@ -83,20 +56,16 @@
|
|
|
83
56
|
* re-reads the description, swaps itself, and retries exactly once per
|
|
84
57
|
* instance.
|
|
85
58
|
*/
|
|
86
|
-
|
|
59
|
+
// The offline half, named one export at a time rather than with `export *`.
|
|
60
|
+
// This entry is the one every online consumer imports, so its surface is
|
|
61
|
+
// stated here: an export added to `core.ts` widens `./edv/core` only, and
|
|
62
|
+
// widening `./edv` takes an edit to this list.
|
|
63
|
+
export { EdvCodec, EDV_SCHEME_VERSION, JOSE_CONTENT_TYPE, ensureFirstEpoch, initRecipients, addRecipient, removeRecipient, replaceRecipient, isEd25519DidKey, x25519RecipientFromDidKey, resourceDescriptorStore, EPOCH_CONFIGURATION_STATE_TYPE, logGovernedCollectionDescriptorStore, logGovernedDescriptorStore, readGovernedEpochConfiguration, toEpochConfigurationState, didKeyResolver, mintEpoch, epochKeyIdFor, unwrapEpochSecret, wrapEpochSecret, hasKeyEpochs, epochRostersEqual, resolveEpochKeys, HMAC_KEY_TYPE, mintHmacKey, hmacKeyFromSecret, resolveHmacKey, createEdvDocCipher, createEdvEncryptOnlyDocCipher, ownerRecipient, EncryptOnlyCipherError, KeyUnwrapError, UnknownEpochError, isEncryptedEnvelope, isKeyUnwrapError } from './core.js';
|
|
64
|
+
export { createEdvEncryption } from './encryption.js';
|
|
65
|
+
export { wasTransportFactory } from './transportFactory.js';
|
|
87
66
|
export { WasTransport } from './WasTransport.js';
|
|
88
|
-
export {
|
|
89
|
-
export { ensureFirstEpoch, initRecipients, addRecipient, removeRecipient, replaceRecipient } from './recipients.js';
|
|
90
|
-
export { isEd25519DidKey, x25519RecipientFromDidKey } from './didKeyRecipient.js';
|
|
91
|
-
export { collectionDescriptorStore, resourceDescriptorStore } from './descriptorStore.js';
|
|
92
|
-
export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedCollectionDescriptorStore, logGovernedDescriptorStore, readGovernedEpochConfiguration, toEpochConfigurationState } from './logGovernedDescriptorStore.js';
|
|
93
|
-
export { mintEpoch, epochKeyIdFor, unwrapEpochSecret, wrapEpochSecret } from './epochCrypto.js';
|
|
94
|
-
export { hasKeyEpochs, epochRostersEqual } from './epochRoster.js';
|
|
95
|
-
export { resolveEpochKeys } from './epochKeys.js';
|
|
96
|
-
export { HMAC_KEY_TYPE, mintHmacKey, hmacKeyFromSecret, resolveHmacKey } from './hmacKey.js';
|
|
97
|
-
export { createEdvDocCipher, createEdvEncryptOnlyDocCipher, ownerRecipient, EncryptOnlyCipherError, KeyUnwrapError, UnknownEpochError, isEncryptedEnvelope } from './docCipher.js';
|
|
67
|
+
export { collectionDescriptorStore } from './descriptorStore.js';
|
|
98
68
|
export { acquireDescriptor, acquireDescriptors, wasDescriptorSource } from './acquire.js';
|
|
99
69
|
export { DescriptorRefreshPolicy } from './refresh.js';
|
|
100
70
|
export { createRefreshingEdvDocCipher } from './refreshingDocCipher.js';
|
|
101
|
-
export { isKeyUnwrapError } from '../sync/predicates.js';
|
|
102
71
|
//# sourceMappingURL=index.js.map
|
package/dist/edv/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,4EAA4E;AAC5E,yEAAyE;AACzE,0EAA0E;AAC1E,+CAA+C;AAC/C,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,EAC9B,oCAAoC,EACpC,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,cAAc,EACd,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,WAAW,CAAA;AAYlB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAKrB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CodecTransportFactory } from './EdvCodec.js';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the transport factory for a Collection reachable over WAS: the
|
|
4
|
+
* codec's route to its own document and chunk resources on the server.
|
|
5
|
+
*
|
|
6
|
+
* @param options {object}
|
|
7
|
+
* @param options.spaceId {string} the Space holding the Collection
|
|
8
|
+
* @param options.collectionId {string} the Collection
|
|
9
|
+
* @param options.contentType {string} stored envelope content type
|
|
10
|
+
* @returns {CodecTransportFactory}
|
|
11
|
+
*/
|
|
12
|
+
export declare function wasTransportFactory({ spaceId, collectionId, contentType }: {
|
|
13
|
+
spaceId: string;
|
|
14
|
+
collectionId: string;
|
|
15
|
+
contentType: string;
|
|
16
|
+
}): CodecTransportFactory;
|
|
17
|
+
//# sourceMappingURL=transportFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transportFactory.d.ts","sourceRoot":"","sources":["../../src/edv/transportFactory.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAE1D;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,YAAY,EACZ,WAAW,EACZ,EAAE;IACD,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACpB,GAAG,qBAAqB,CASxB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* `wasTransportFactory`: the one function that constructs a {@link
|
|
6
|
+
* WasTransport} for an {@link EdvCodec}. It lives apart from the codec class
|
|
7
|
+
* because it is the codec's only reach to a server: the class itself takes its
|
|
8
|
+
* transport through the injected `CodecTransportFactory` seam, so a build with
|
|
9
|
+
* no server behind it (the local-replica doc cipher) never evaluates this
|
|
10
|
+
* module, nor the transport and request machinery behind it.
|
|
11
|
+
*/
|
|
12
|
+
import { WasTransport } from './WasTransport.js';
|
|
13
|
+
/**
|
|
14
|
+
* Builds the transport factory for a Collection reachable over WAS: the
|
|
15
|
+
* codec's route to its own document and chunk resources on the server.
|
|
16
|
+
*
|
|
17
|
+
* @param options {object}
|
|
18
|
+
* @param options.spaceId {string} the Space holding the Collection
|
|
19
|
+
* @param options.collectionId {string} the Collection
|
|
20
|
+
* @param options.contentType {string} stored envelope content type
|
|
21
|
+
* @returns {CodecTransportFactory}
|
|
22
|
+
*/
|
|
23
|
+
export function wasTransportFactory({ spaceId, collectionId, contentType }) {
|
|
24
|
+
return ({ context, documentHeaders }) => new WasTransport({
|
|
25
|
+
was: { request: input => context.request(input) },
|
|
26
|
+
spaceId,
|
|
27
|
+
collectionId,
|
|
28
|
+
contentType,
|
|
29
|
+
...(documentHeaders !== undefined && { documentHeaders })
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=transportFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transportFactory.js","sourceRoot":"","sources":["../../src/edv/transportFactory.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,OAAO,EACP,YAAY,EACZ,WAAW,EAKZ;IACC,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,CACtC,IAAI,YAAY,CAAC;QACf,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACjD,OAAO;QACP,YAAY;QACZ,WAAW;QACX,GAAG,CAAC,eAAe,KAAK,SAAS,IAAI,EAAE,eAAe,EAAE,CAAC;KAC1D,CAAC,CAAA;AACN,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,5 +18,11 @@ export type { WritePrecondition } from './internal/conditional.js';
|
|
|
18
18
|
export { WasError, NotFoundError, CapabilityRevokedError, CapabilityExpiredError, ValidationError, AlreadyRevokedError, AuthRequiredError, NotImplementedError, NotSupportedError, IncompatibleServerError, ConflictError, PreconditionFailedError, PayloadTooLargeError, QuotaExceededError, EncryptionError, EncryptOnlyCipherError, KeyUnwrapError, IntegrityError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError, WasServerError, httpStatus, mapError } from './errors.js';
|
|
19
19
|
export { isChunkedWrite } from './codec.js';
|
|
20
20
|
export type { ResourceCodec, EncryptionProvider, ChunkedWrite, CodecRequestContext, CodecWrite, MetaReadSlot, MetaWriteSlot, EncodedWrite, ResponseLike, BlindedQuery, CodecIndexing, IndexDeclaration, IndexSchema } from './codec.js';
|
|
21
|
-
export type { Json, JsonPrimitive, JsonObject, JsonArray, ResourceData, Action, ActionInput, ChangeDocument, ChangesCheckpoint, ChangesPage, SpaceMetadata, CollectionWritableFields, CollectionEncryption, CollectionEncryptionEpoch, CollectionEncryptionRecipient, CollectionEncryptionHmac, EncryptionWithHmac, CollectionSummary, CollectionsList, SpaceSummary, SpaceListing, ResourceSummary, CollectionResourcesList, ResourceMetadata, ResourceMetadataCustom, ResourceMetadataCustomInput, CollectionMetadata, AddResult, FindPage, ImportStats, PolicyDocument, LinkSet, LinkSetEntry, HandleOptions, EncryptionOverride, BackendReference, BackendDescriptor, BackendRegistration, BackendConnectionInput, BackendConnectionPublic, StorageLimit, CollectionUsage, BackendUsage, SpaceQuotaReport, ServiceDescription, ServiceDescriptionVersionEntry, PwsVersionEntry, ServiceInfo, GrantOptions, RequestInput, IZcap, IDelegatedZcap, ISigner } from './types.js';
|
|
21
|
+
export type { Json, JsonPrimitive, JsonObject, JsonArray, ResourceData, Action, ActionInput, ChangeDocument, ChangesCheckpoint, ChangesPage, SpaceMetadata, CollectionWritableFields, CollectionEncryption, CollectionEncryptionEpoch, CollectionEncryptionRecipient, CollectionEncryptionHmac, EncryptionWithHmac, CollectionSummary, CollectionsList, SpaceSummary, SpaceListing, ResourceSummary, CollectionResourcesList, ResourceMetadata, ResourceMetadataCustom, ResourceMetadataCustomInput, CollectionMetadata, AddResult, FindPage, ImportStats, PolicyDocument, LinkSet, LinkSetEntry, HandleOptions, EncryptionOverride, BackendReference, BackendDescriptor, BackendRegistration, BackendConnectionInput, BackendConnectionPublic, StorageLimit, CollectionUsage, BackendUsage, SpaceQuotaReport, ServiceDescription, ServiceDescriptionVersionEntry, PwsVersionEntry, ServiceInfo, GrantOptions, RequestInput, IZcap, IDelegatedZcap, IRootZcap, IDID, ISigner } from './types.js';
|
|
22
|
+
/**
|
|
23
|
+
* The Collection Metadata `custom` object as the blinded-index code sees it --
|
|
24
|
+
* the user's own properties plus the `indexSchema` `declareIndex` persists.
|
|
25
|
+
* The annotation for a caller reading the schema off a `describe()` result.
|
|
26
|
+
*/
|
|
27
|
+
export type { CustomWithIndexSchema } from './internal/indexSchema.js';
|
|
22
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,YAAY,EAAE,e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CAAA;AAC3C,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,WAAW,EACZ,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,IAAI,EACJ,aAAa,EACb,UAAU,EACV,SAAS,EACT,YAAY,EACZ,MAAM,EACN,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,cAAc,EACd,OAAO,EACP,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,8BAA8B,EAC9B,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,cAAc,EACd,SAAS,EACT,IAAI,EACJ,OAAO,EACR,MAAM,YAAY,CAAA;AAEnB;;;;GAIG;AACH,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA"}
|
package/dist/internal/codec.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { prepareBody, parseResource } from './content.js';
|
|
2
|
-
import { asCollectionMetadata,
|
|
2
|
+
import { asCollectionMetadata, storedEncryption, unreadableDescriptionError } from './describe.js';
|
|
3
|
+
import { readCollectionMetadata } from './meta.js';
|
|
3
4
|
import { readIndexSchema } from './indexSchema.js';
|
|
4
5
|
import { Memo } from './memo.js';
|
|
5
6
|
import { EncryptionError, NotImplementedError } from '../errors.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/internal/codec.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EACL,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/internal/codec.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAyBnE;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,WAAW;IACb,KAAK,CAAuB;IAErC;;;OAGG;IACH,YAAY,OAAuC;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG;QACP,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAA;QACzC,UAAU,CAAC,IAAI,GAAG,SAAS,CAAA;QAC3B,OAAO,UAAU,CAAC,KAAK,CAAA;IACzB,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,SAAS,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAA;QACrC,MAAM,UAAU,GAAG,MAAM,IAAI,CAA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AAQ,CAAC;QAC9C,OAAO;QACP,YAAY;QACZ,MAAM;QACN,UAAU;QACV,IAAI;KACL,CAAC,CAAA;IACF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,eAAe,CACvB,cAAc,KAAK,0BAA0B,MAAM,qBAAqB;YACtE,wEAAwE;YACxE,kEAAkE,CACrE,CAAA;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAA;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,KAAK,UAAU,eAAe,CAC5B,OAAsB,EACtB,EACE,OAAO,EACP,YAAY,EACZ,UAAU,EACV,KAAK,EAMN;IAED,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACpB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,IAAI,CAAA;IACR,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,sBAAsB,CAAC,OAAO,EAAE;YAC3C,OAAO;YACP,YAAY;YACZ,UAAU;SACX,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,mBAAmB,EAAE,CAAC;YACvC,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,MAAM,GAAG,CAAA;IACX,CAAC;IACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;AACtC,CAAC"}
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Reads a Collection Metadata object with a single GET of the Collection's
|
|
6
|
-
* `meta` sub-resource, in the wire form the server serves it: `custom` is
|
|
7
|
-
* whatever is stored there (an opaque envelope on an encrypted Collection),
|
|
8
|
-
* left undecoded, because the codec that would decode it is itself resolved
|
|
9
|
-
* from this object's `encryption` member. Shared by `Collection`'s read and
|
|
10
|
-
* write paths and by the codec resolver's descriptor discovery, so the request
|
|
11
|
-
* shape (path, capability, null-unwrap, validator) lives in one place.
|
|
12
|
-
*
|
|
13
|
-
* Also owns the masked-404 fail-closed policy: WAS returns 404 for both
|
|
14
|
-
* not-found and unauthorized, so a `null` read is ambiguous and an operation
|
|
15
|
-
* that must know the current state fails closed via
|
|
16
|
-
* `unreadableDescriptionError` rather than guessing. `collectionWritableFields`
|
|
17
|
-
* lives here too: it is the one inclusion rule for the writable configuration
|
|
18
|
-
* members a caller supplies, beside `carriedForward`, the rule for the stored
|
|
19
|
-
* members a full-replacement write re-sends unchanged.
|
|
20
|
-
*/
|
|
21
|
-
import type { ClientContext } from './request.js';
|
|
22
1
|
import type { WasError } from '../errors.js';
|
|
23
|
-
import type { CollectionEncryption, CollectionMetadata, CollectionWritableFields
|
|
2
|
+
import type { CollectionEncryption, CollectionMetadata, CollectionWritableFields } from '../types.js';
|
|
24
3
|
/**
|
|
25
4
|
* A Collection Metadata object exactly as the server served it. Typed as an
|
|
26
5
|
* open record rather than as `CollectionMetadata`, because `custom` here is the
|
|
@@ -123,27 +102,6 @@ export declare function storedEncryption(stored: StoredCollectionMetadata): Coll
|
|
|
123
102
|
export declare function carriedForward(stored: StoredCollectionMetadata, { replacing }: {
|
|
124
103
|
replacing: readonly string[];
|
|
125
104
|
}): StoredCollectionMetadata;
|
|
126
|
-
/**
|
|
127
|
-
* Reads the Collection Metadata object with its `metaVersion` validator, in the
|
|
128
|
-
* stored wire form. Returns `null` if the collection is missing or not visible
|
|
129
|
-
* to you (WAS returns 404 for both not-found and unauthorized); `etag` is
|
|
130
|
-
* absent against a backend that does not version the object.
|
|
131
|
-
*
|
|
132
|
-
* @param context {ClientContext}
|
|
133
|
-
* @param options {object}
|
|
134
|
-
* @param options.spaceId {string}
|
|
135
|
-
* @param options.collectionId {string}
|
|
136
|
-
* @param [options.capability] {IZcap} capability attached to the request
|
|
137
|
-
* @returns {Promise<{ metadata: StoredCollectionMetadata; etag?: string } | null>}
|
|
138
|
-
*/
|
|
139
|
-
export declare function readCollectionMetadata(context: ClientContext, options: {
|
|
140
|
-
spaceId: string;
|
|
141
|
-
collectionId: string;
|
|
142
|
-
capability?: IZcap;
|
|
143
|
-
}): Promise<{
|
|
144
|
-
metadata: StoredCollectionMetadata;
|
|
145
|
-
etag?: string;
|
|
146
|
-
} | null>;
|
|
147
105
|
/**
|
|
148
106
|
* Builds the fail-closed error for an operation that needs a Collection
|
|
149
107
|
* Metadata object it could not read. The one owner of the masked-404 policy
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,aAAa,CAAA;AAEpB;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,wBAAwB,GAC/B,kBAAkB,CAMpB;AAqBD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,oBAAoB,GAC/B,UAAU,IAAI,oBAAoB,GAAG;IACtC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C,CAEA;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,wBAAwB,GAC/B,wBAAwB,CAW1B;AAsBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAMlD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAAwB,CAAA;AAExE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,wBAAwB,GAC/B,oBAAoB,GAAG,SAAS,CAElC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,wBAAwB,EAChC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC9C,wBAAwB,CAgB1B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,SAAS,EACT,WAAW,EACX,MAAM,EACN,UAA4B,EAC7B,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAA;CAC/C,GAAG,QAAQ,CAQX"}
|
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The Collection Metadata object helpers: pure shape checks, projections, and
|
|
6
|
+
* the compose rules every write shares. Nothing here performs a request, so a
|
|
7
|
+
* reader that only parses a descriptor does not pull the transport layer in
|
|
8
|
+
* with it. The read itself lives beside the rest of the `meta` I/O, in
|
|
9
|
+
* `internal/meta.ts`.
|
|
10
|
+
*
|
|
11
|
+
* `asCollectionMetadata` and `storedEncryption` narrow the stored wire form --
|
|
12
|
+
* `custom` is whatever the server serves there, an opaque envelope on an
|
|
13
|
+
* encrypted Collection, because the codec that would decode it is itself
|
|
14
|
+
* resolved from this object's `encryption` member. `collectionWritableFields`
|
|
15
|
+
* is the one inclusion rule for the writable configuration members a caller
|
|
16
|
+
* supplies, beside `carriedForward`, the rule for the stored members a
|
|
17
|
+
* full-replacement write re-sends unchanged.
|
|
18
|
+
*
|
|
19
|
+
* This module also owns the masked-404 fail-closed policy: WAS returns 404 for
|
|
20
|
+
* both not-found and unauthorized, so a `null` read is ambiguous and an
|
|
21
|
+
* operation that must know the current state fails closed via
|
|
22
|
+
* `unreadableDescriptionError` rather than guessing.
|
|
23
|
+
*/
|
|
3
24
|
import { ValidationError } from '../errors.js';
|
|
4
25
|
/**
|
|
5
26
|
* Reads a stored Collection Metadata object as the `CollectionMetadata` wire
|
|
@@ -166,32 +187,6 @@ export function carriedForward(stored, { replacing }) {
|
|
|
166
187
|
}
|
|
167
188
|
return carried;
|
|
168
189
|
}
|
|
169
|
-
/**
|
|
170
|
-
* Reads the Collection Metadata object with its `metaVersion` validator, in the
|
|
171
|
-
* stored wire form. Returns `null` if the collection is missing or not visible
|
|
172
|
-
* to you (WAS returns 404 for both not-found and unauthorized); `etag` is
|
|
173
|
-
* absent against a backend that does not version the object.
|
|
174
|
-
*
|
|
175
|
-
* @param context {ClientContext}
|
|
176
|
-
* @param options {object}
|
|
177
|
-
* @param options.spaceId {string}
|
|
178
|
-
* @param options.collectionId {string}
|
|
179
|
-
* @param [options.capability] {IZcap} capability attached to the request
|
|
180
|
-
* @returns {Promise<{ metadata: StoredCollectionMetadata; etag?: string } | null>}
|
|
181
|
-
*/
|
|
182
|
-
export async function readCollectionMetadata(context, options) {
|
|
183
|
-
const read = await readDataWithEtag(context, {
|
|
184
|
-
path: collectionMeta(options.spaceId, options.collectionId),
|
|
185
|
-
capability: options.capability
|
|
186
|
-
});
|
|
187
|
-
if (read === null) {
|
|
188
|
-
return null;
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
metadata: read.data,
|
|
192
|
-
...(read.etag !== undefined && { etag: read.etag })
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
190
|
/**
|
|
196
191
|
* Builds the fail-closed error for an operation that needs a Collection
|
|
197
192
|
* Metadata object it could not read. The one owner of the masked-404 policy
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAiB9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAgC;IAEhC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,OAAO,MAAuC,CAAA;IAChD,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;IAC5C,OAAO,IAAqC,CAAA;AAC9C,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,eAAe,CAAC,MAAe;IACtC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACtB,MAAM,CAAC,IAAI,CAAC,MAAgB,CAAC,CAAC,MAAM,KAAK,CAAC,CAC3C,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,UAAgC;IAIhC,OAAO,UAAU,CAAC,OAAO,KAAK,SAAS,CAAA;AACzC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAgC;IAEhC,OAAO;QACL,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EA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AAC,MAAM,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACrD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAQ;QACV,CAAC;QACD,IAAI,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1E,SAAQ;QACV,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAA;IACzB,CAAC;IACD,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC3C,IAAI,UAAU,KAAK,SAAS,IAAI,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;QACjE,OAAO,OAAO,CAAC,UAAU,CAAA;IAC3B,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,0BAA0B,CAAC,EACzC,SAAS,EACT,WAAW,EACX,MAAM,EACN,UAAU,GAAG,eAAe,EAM7B;IACC,OAAO,IAAI,UAAU,CACnB,UAAU,SAAS,sDAAsD;QACvE,kEAAkE;QAClE,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,GAAG;QACH,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC7C,CAAA;AACH,CAAC"}
|
package/dist/internal/grant.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ import type { GrantOptions, IDelegatedZcap, IZcap } from '../types.js';
|
|
|
26
26
|
* @param context {ClientContext}
|
|
27
27
|
* @param options {GrantOptions}
|
|
28
28
|
* @returns {Promise<IDelegatedZcap>}
|
|
29
|
+
* @throws {ValidationError} when neither `target` nor `capability` is given,
|
|
30
|
+
* so the delegation names nothing to grant
|
|
29
31
|
*/
|
|
30
32
|
export declare function delegateGrant(context: ClientContext, { to, actions, expires, target, capability }: GrantOptions): Promise<IDelegatedZcap>;
|
|
31
33
|
/**
|
|
@@ -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;
|
|
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;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,EACtB,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,YAAY,GACzD,OAAO,CAAC,cAAc,CAAC,CAuBzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,aAAa,EACtB,EACE,IAAI,EACJ,OAAO,EACP,UAAU,EACX,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GAC7D,OAAO,CAAC,cAAc,CAAC,CAMzB"}
|
package/dist/internal/grant.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseSpaceTarget, spacePath, toUrl } from './paths.js';
|
|
2
2
|
import { rootCapabilityId } from './revoke.js';
|
|
3
|
+
import { ValidationError } from '../errors.js';
|
|
3
4
|
/**
|
|
4
5
|
* The root capability id (`urn:zcap:root:<encoded target>`) of the Space
|
|
5
6
|
* containing `target`, or `undefined` when `target` is not a URL beneath this
|
|
@@ -32,8 +33,18 @@ function spaceRootCapabilityId({ serverUrl, target }) {
|
|
|
32
33
|
* @param context {ClientContext}
|
|
33
34
|
* @param options {GrantOptions}
|
|
34
35
|
* @returns {Promise<IDelegatedZcap>}
|
|
36
|
+
* @throws {ValidationError} when neither `target` nor `capability` is given,
|
|
37
|
+
* so the delegation names nothing to grant
|
|
35
38
|
*/
|
|
36
39
|
export async function delegateGrant(context, { to, actions, expires, target, capability }) {
|
|
40
|
+
// The scoped sugar always prefills `target`, so this only catches a direct
|
|
41
|
+
// `was.grant()`. Without either member ezcap has no invocation target and no
|
|
42
|
+
// parent to take one from, and rejects the call with a bare `TypeError` a
|
|
43
|
+
// consumer catching `WasError` would miss.
|
|
44
|
+
if (target === undefined && capability === undefined) {
|
|
45
|
+
throw new ValidationError('A grant needs a `target` (the invocationTarget URL to grant) or a ' +
|
|
46
|
+
'`capability` (the parent capability to attenuate); neither was given.');
|
|
47
|
+
}
|
|
37
48
|
const parent = capability ??
|
|
38
49
|
(target === undefined
|
|
39
50
|
? undefined
|
|
@@ -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;AAG9C;;;;;;;;;;;;;;GAcG;AACH,SAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,MAAM,EAIP;IACC,MAAM,MAAM,GAAG,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAA;IACtD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EA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AC,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IACtE,OAAO,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;QACjC,UAAU,EAAE,EAAE;QACd,gBAAgB,EAAE,MAAM;QACxB,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAC3D,OAAO;QACP,UAAU,EAAE,MAAM;KACnB,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAAsB,EACtB,EACE,IAAI,EACJ,OAAO,EACP,UAAU,EACkD;IAE9D,OAAO,aAAa,CAAC,OAAO,EAAE;QAC5B,GAAG,OAAO;QACV,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;QACvE,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,UAAU;KAC7C,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/internal/meta.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StoredCollectionMetadata } from './describe.js';
|
|
1
2
|
import type { MetaReadSlot, MetaWriteSlot, ResourceCodec } from '../codec.js';
|
|
2
3
|
import type { ClientContext } from './request.js';
|
|
3
4
|
import type { IZcap, ResourceMetadataCustom, ResourceMetadataCustomInput } from '../types.js';
|
|
@@ -106,4 +107,25 @@ export declare function patchCustom(handle: {
|
|
|
106
107
|
etag?: string;
|
|
107
108
|
}>;
|
|
108
109
|
}, patch: ResourceMetadataCustom, operation?: string): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Reads the Collection Metadata object with its `metaVersion` validator, in the
|
|
112
|
+
* stored wire form. Returns `null` if the collection is missing or not visible
|
|
113
|
+
* to you (WAS returns 404 for both not-found and unauthorized); `etag` is
|
|
114
|
+
* absent against a backend that does not version the object.
|
|
115
|
+
*
|
|
116
|
+
* @param context {ClientContext}
|
|
117
|
+
* @param options {object}
|
|
118
|
+
* @param options.spaceId {string}
|
|
119
|
+
* @param options.collectionId {string}
|
|
120
|
+
* @param [options.capability] {IZcap} capability attached to the request
|
|
121
|
+
* @returns {Promise<{ metadata: StoredCollectionMetadata; etag?: string } | null>}
|
|
122
|
+
*/
|
|
123
|
+
export declare function readCollectionMetadata(context: ClientContext, options: {
|
|
124
|
+
spaceId: string;
|
|
125
|
+
collectionId: string;
|
|
126
|
+
capability?: IZcap;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
metadata: StoredCollectionMetadata;
|
|
129
|
+
etag?: string;
|
|
130
|
+
} | null>;
|
|
109
131
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"
|
|
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;;;;;;;;;;;;;;;;;;;;GAoBG;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;IAC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sBAAsB,CAAA;KAAE,EACzC,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5B,OAAO,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9B,EACD,KAAK,EAAE,sBAAsB,EAC7B,SAAS,SAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GACrE,OAAO,CAAC;IAAE,QAAQ,EAAE,wBAAwB,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAYvE"}
|
package/dist/internal/meta.js
CHANGED
|
@@ -8,13 +8,23 @@
|
|
|
8
8
|
*
|
|
9
9
|
* `writeMeta` is the Resource side alone. A Collection's `meta` write is a full
|
|
10
10
|
* replacement of the merged Collection Metadata object -- configuration
|
|
11
|
-
* members included -- so it is composed against a fresh read of that object
|
|
12
|
-
* `
|
|
13
|
-
* helpers through a bounded compare-and-swap.
|
|
11
|
+
* members included -- so it is composed against a fresh read of that object,
|
|
12
|
+
* `readCollectionMetadata`, and `patchCustom` below drives both handles'
|
|
13
|
+
* read-modify-write helpers through a bounded compare-and-swap.
|
|
14
|
+
*
|
|
15
|
+
* `readCollectionMetadata` is the undecoded Collection read: one GET of the
|
|
16
|
+
* `meta` sub-resource in the wire form the server serves it, with `custom`
|
|
17
|
+
* left as stored, because the codec that would decode it is itself resolved
|
|
18
|
+
* from the same object's `encryption` member. It lives here rather than beside
|
|
19
|
+
* the Collection Metadata helpers in `describe.ts` so those stay free of the
|
|
20
|
+
* transport layer; the request shape (path, capability, null-unwrap,
|
|
21
|
+
* validator) is still stated in one place, shared by `Collection`'s read and
|
|
22
|
+
* write paths and by the codec resolver's descriptor discovery.
|
|
14
23
|
*/
|
|
15
24
|
import { NotFoundError, WasServerError } from '../errors.js';
|
|
16
25
|
import { compareAndSwap } from './cas.js';
|
|
17
|
-
import {
|
|
26
|
+
import { collectionMeta } from './paths.js';
|
|
27
|
+
import { readDataWithEtag, send } from './request.js';
|
|
18
28
|
import { readEtag, writeHeaders } from './conditional.js';
|
|
19
29
|
import { withCodec } from './withCodec.js';
|
|
20
30
|
/**
|
|
@@ -158,4 +168,30 @@ export async function patchCustom(handle, patch, operation = 'Metadata update')
|
|
|
158
168
|
mutate: custom => ({ ...custom, ...patch })
|
|
159
169
|
});
|
|
160
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Reads the Collection Metadata object with its `metaVersion` validator, in the
|
|
173
|
+
* stored wire form. Returns `null` if the collection is missing or not visible
|
|
174
|
+
* to you (WAS returns 404 for both not-found and unauthorized); `etag` is
|
|
175
|
+
* absent against a backend that does not version the object.
|
|
176
|
+
*
|
|
177
|
+
* @param context {ClientContext}
|
|
178
|
+
* @param options {object}
|
|
179
|
+
* @param options.spaceId {string}
|
|
180
|
+
* @param options.collectionId {string}
|
|
181
|
+
* @param [options.capability] {IZcap} capability attached to the request
|
|
182
|
+
* @returns {Promise<{ metadata: StoredCollectionMetadata; etag?: string } | null>}
|
|
183
|
+
*/
|
|
184
|
+
export async function readCollectionMetadata(context, options) {
|
|
185
|
+
const read = await readDataWithEtag(context, {
|
|
186
|
+
path: collectionMeta(options.spaceId, options.collectionId),
|
|
187
|
+
capability: options.capability
|
|
188
|
+
});
|
|
189
|
+
if (read === null) {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
metadata: read.data,
|
|
194
|
+
...(read.etag !== undefined && { etag: read.etag })
|
|
195
|
+
};
|
|
196
|
+
}
|
|
161
197
|
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
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;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAG5B,OAAsB,EACtB,EACE,QAAQ,EACR,KAAK,EAAE,YAAY,EACnB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,QAAQ,EAWT;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;QAChC,yEAAyE;QACzE,uEAAuE;QACvE,yEAAyE;QACzE,+DAA+D;QAC/D,wEAAwE;QACxE,2EAA2E;QAC3E,6DAA6D;QAC7D,MAAM,IAAI,cAAc,CACtB,yBAAyB,OAAO,wBAAwB;YACtD,g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EACtB,OAAsE;IAEtE,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAA2B,OAAO,EAAE;QACrE,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC;QAC3D,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAA;IACF,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,IAAI;QACnB,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;KACpD,CAAA;AACH,CAAC"}
|
package/dist/internal/paths.d.ts
CHANGED
|
@@ -52,8 +52,15 @@ export declare function spaceLinkset(spaceId: string): string;
|
|
|
52
52
|
* Space-rooted capability. The capability's `id` (typically a `urn:uuid:`) is
|
|
53
53
|
* percent-encoded into the single final segment.
|
|
54
54
|
*
|
|
55
|
-
* `zcaps` is not
|
|
56
|
-
*
|
|
55
|
+
* `zcaps` is not in the Reserved Path Segment Registry, and does not need to
|
|
56
|
+
* be. Depth is not the reason: this route is exactly as deep as a
|
|
57
|
+
* Resource sub-resource route (`/space/:s/:c/:r/meta`), so a Collection named
|
|
58
|
+
* `zcaps` does reach the same depth. Two other properties make the shadowing
|
|
59
|
+
* unreachable. A zcap `id` is an absolute URI, so the final segment never
|
|
60
|
+
* matches one of the reserved sub-resource segments (`meta`, `policy`,
|
|
61
|
+
* `chunks/:n`, ...) a Resource route would read there. And the two routes are
|
|
62
|
+
* method-disjoint: a revocation is submitted with `POST`, while the Resource
|
|
63
|
+
* routes at that depth answer `GET` / `PUT` / `DELETE`.
|
|
57
64
|
*/
|
|
58
65
|
export declare function spaceRevocation(spaceId: string, capabilityId: string): string;
|
|
59
66
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/internal/paths.ts"],"names":[],"mappings":"AA8GA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/internal/paths.ts"],"names":[],"mappings":"AA8GA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;GA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,CAAA;AAEjE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,MAAM,EACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,eAAe,GAAG,IAAI,CAazB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CA0CvE"}
|
package/dist/internal/paths.js
CHANGED
|
@@ -168,8 +168,15 @@ export function spaceLinkset(spaceId) {
|
|
|
168
168
|
* Space-rooted capability. The capability's `id` (typically a `urn:uuid:`) is
|
|
169
169
|
* percent-encoded into the single final segment.
|
|
170
170
|
*
|
|
171
|
-
* `zcaps` is not
|
|
172
|
-
*
|
|
171
|
+
* `zcaps` is not in the Reserved Path Segment Registry, and does not need to
|
|
172
|
+
* be. Depth is not the reason: this route is exactly as deep as a
|
|
173
|
+
* Resource sub-resource route (`/space/:s/:c/:r/meta`), so a Collection named
|
|
174
|
+
* `zcaps` does reach the same depth. Two other properties make the shadowing
|
|
175
|
+
* unreachable. A zcap `id` is an absolute URI, so the final segment never
|
|
176
|
+
* matches one of the reserved sub-resource segments (`meta`, `policy`,
|
|
177
|
+
* `chunks/:n`, ...) a Resource route would read there. And the two routes are
|
|
178
|
+
* method-disjoint: a revocation is submitted with `POST`, while the Resource
|
|
179
|
+
* routes at that depth answer `GET` / `PUT` / `DELETE`.
|
|
173
180
|
*/
|
|
174
181
|
export function spaceRevocation(spaceId, capabilityId) {
|
|
175
182
|
return `${spacePrefix(spaceId)}/zcaps/revocations/${encode(capabilityId)}`;
|