@ariestools/aries-datalake-client 0.1.19 → 0.1.21

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
@@ -5,7 +5,7 @@ REST clients for the Aries datalake control and data planes, with Node-only loca
5
5
  ## Entry points
6
6
 
7
7
  - `@ariestools/aries-datalake-client` is the Node entry point. It includes the REST clients plus local filesystem-backed clients, credentials, defaults, and `ARIES_HOME` helpers.
8
- - `@ariestools/aries-datalake-client/browser` is the browser entry point. It exports only REST clients, their interfaces, the asynchronous token-supplier contract, and browser-safe datalake wire contracts.
8
+ - `@ariestools/aries-datalake-client/browser` is the browser entry point. It exports REST clients, the composite client, their interfaces, the asynchronous token-supplier contract, and browser-safe datalake wire contracts.
9
9
 
10
10
  Use an asynchronous token supplier that is invoked for each request. The application adapter may return a still-valid short-lived token from page memory or request a fresh wallet JWT through the XL1 browser wallet gateway:
11
11
 
@@ -36,3 +36,128 @@ const payloads = new RestPayloadsClient({
36
36
  ```
37
37
 
38
38
  The supplier receives the exact control-plane audience or datalake id. Treat its return value as a sensitive, short-lived bearer token: cache it only in page memory when useful, and never persist it in browser storage or logs. The wallet gateway controls key access; the Aries HTTP services independently verify audience, signature, origin, scope, signer identity, and live ACL state.
39
+
40
+ ## Multiple required datalakes
41
+
42
+ `CompositePayloadsClient` writes each target's eligible subset and verifies it by
43
+ reading the content back. Configure a complete S3 collection alongside a selected
44
+ Auto Drive collection using already authenticated `RestPayloadsClient` instances:
45
+
46
+ ```ts
47
+ import { CompositePayloadsClient, type RestPayloadsClient } from '@ariestools/aries-datalake-client/browser'
48
+ import { asAnyPayload, PayloadBuilder } from '@xyo-network/sdk'
49
+
50
+ declare const autoDriveClient: RestPayloadsClient
51
+ declare const s3Client: RestPayloadsClient
52
+
53
+ const composite = new CompositePayloadsClient({
54
+ identify: async (payload) => {
55
+ const canonical = asAnyPayload(payload, true)
56
+ return {
57
+ hash: await PayloadBuilder.hash(canonical),
58
+ dataHash: await PayloadBuilder.dataHash(canonical),
59
+ }
60
+ },
61
+ targets: [
62
+ {
63
+ name: 'auto-drive',
64
+ client: autoDriveClient,
65
+ policy: {
66
+ mode: 'selected',
67
+ allowedSchemas: ['com.example.smallrecord'],
68
+ maxPayloadBytes: 4096, // Example deployment limit, not a provider default.
69
+ revision: 'v1',
70
+ },
71
+ },
72
+ { name: 's3', client: s3Client, policy: { mode: 'all' } },
73
+ ],
74
+ })
75
+
76
+ const result = await composite.insertWithReceipts([
77
+ { schema: 'com.example.smallrecord', value: 1 },
78
+ { schema: 'com.example.other', value: 2 },
79
+ ])
80
+ const read = await composite.getWithReceipts(result.acknowledged.map(payload => payload._hash))
81
+ ```
82
+
83
+ All targets are required for their eligible subset. A selected policy requires
84
+ an explicit allowlist and positive byte limit; an empty list selects nothing.
85
+ `disallowedSchemas` takes precedence. `schemaMaxPayloadBytes` may tighten the
86
+ global byte limit, and `isValid` may supply a trusted structural validator.
87
+ Sizes count UTF-8 JSON including client metadata and excluding storage metadata.
88
+ The receiving service must enforce its policy independently; this client does not
89
+ authorize permanent uploads or implement service quotas.
90
+
91
+ `insert(payloads)` returns the verified acknowledgment array, including duplicates;
92
+ `insertWithReceipts(payloads)` also returns per-target eligibility and outcomes.
93
+ A rejected expected-eligible item or failed required target throws
94
+ `CompositePayloadsWriteError`. Its `result` retains verified partial success and
95
+ sanitized receipts, not raw provider errors. A complete target's success does not
96
+ satisfy a different target's obligation. Callers own durable retry state and
97
+ policy-revision coordination; this client does not resume a failed operation.
98
+
99
+ `get(hashes)` and `getMany(hashes)` return verified payload arrays.
100
+ `getWithReceipts(hashes)` adds source attribution. Reads try targets in declared
101
+ order for unresolved hashes only. Provider errors or corrupt responses throw
102
+ `CompositePayloadsReadError`; they are not silently converted into misses.
103
+ Reads never copy content between targets. Supply canonical XYO `PayloadBuilder`
104
+ hashes through `identify`; the composite package itself adds no XYO runtime
105
+ dependency to browser consumers.
106
+
107
+ Only flat payload bodies are accepted. Validate and flatten known hydrated
108
+ protocol envelopes before insertion. There is no global sequence, clear, delete,
109
+ or usage API and no automatic registration into an XL1 connection. The
110
+ payload-array `insert`/`get` methods are intended for a protocol adapter; keep
111
+ the SDK's exact transaction-content acknowledgment check in that adapter.
112
+ Successful read-back is readable storage, not proof of provider network archival.
113
+
114
+ ## Explicit public payload reads
115
+
116
+ Use `RestPublicPayloadsReader` when the provider has granted public viewer access
117
+ to the datalake. This is separate from the authenticated clients above; an
118
+ authentication failure never triggers an anonymous retry.
119
+
120
+ ```ts
121
+ import { RestPublicPayloadsReader } from '@ariestools/aries-datalake-client/browser'
122
+
123
+ const reader = new RestPublicPayloadsReader({
124
+ baseUrl: 'https://data.example/plane/v1/datalakes/dl_public',
125
+ datalakeId: 'dl_public',
126
+ })
127
+ const controller = new AbortController()
128
+ const payload = await reader.get('configured-content-hash', {
129
+ maxResponseBytes: 65_536,
130
+ signal: controller.signal,
131
+ })
132
+ ```
133
+
134
+ The reader exposes only `get(hash, options?)` and `getMany(hashes, options?)`.
135
+ It has no token supplier, header hooks, listing or mutation methods. Requests
136
+ omit ambient credentials and reject redirects. Configuration accepts absolute
137
+ HTTP(S) URLs, including a shared-host path prefix, and rejects userinfo and
138
+ fragments. Local HTTP is permitted explicitly; address/DNS policy remains the
139
+ host's responsibility. An optional `fetchImpl` is a trusted transport override
140
+ that must retain those policies. Without it, fetch is resolved at request time.
141
+
142
+ `maxResponseBytes` is an optional positive safe integer. It counts decoded Fetch
143
+ response-stream bytes before JSON parsing, on success and error responses,
144
+ including the whole native object/array and its metadata. Omission means no size
145
+ limit. It does not bound raw compressed traffic, headers, decompression work or
146
+ connection buffers. The signal is forwarded to fetch and remains active during
147
+ body consumption; aborting does not wait indefinitely for stream cleanup.
148
+
149
+ Successful reads validate the stored-payload shape and preserve all fields.
150
+ Neither requested paths nor `_hash`/`_dataHash` metadata verify content identity;
151
+ callers that need content assurance must hash and validate the returned data.
152
+ Transport, size, cancellation, malformed-response and access failures remain
153
+ failed reads, not evidence that an advertised object never existed.
154
+
155
+ Public viewer access applies to the **whole datalake**, including provider-side
156
+ enumeration and usage APIs. Prefer a dedicated public viewer lake with
157
+ authenticated writers; public runner access also permits mutations. New lakes
158
+ are private until granted access, and browser access additionally requires the
159
+ provider's CORS configuration. This client does not change ACLs or retention.
160
+
161
+ The public reader requires the released `@ariestools/sdk` 8.2.0 or a compatible
162
+ 8.2 patch, plus its required `@opentelemetry/api` peer. It does not require zod
163
+ for these reads; other SDK features and datalake peers can have separate needs.
@@ -0,0 +1,91 @@
1
+ import type { Payload, WithStorageMeta } from '@ariestools/aries-datalake-core/browser';
2
+ import type { PayloadsClient } from './PayloadsClient.ts';
3
+ /** Supply the canonical XYO PayloadBuilder hashes, without adding its runtime to browser clients. */
4
+ export interface CompositePayloadIdentity {
5
+ dataHash: string;
6
+ hash: string;
7
+ }
8
+ export interface CompositePayloadsPolicy {
9
+ /** Required for selected mode; an empty array selects nothing. */
10
+ allowedSchemas?: readonly string[];
11
+ disallowedSchemas?: readonly string[];
12
+ /** Trusted local validator; receiving services must independently enforce their policy. */
13
+ isValid?: (payload: Payload) => boolean;
14
+ /** Required for selected mode. Measured as UTF-8 JSON, before compression. */
15
+ maxPayloadBytes?: number;
16
+ /** Explicitly choose a complete collection or an allowlisted collection. */
17
+ mode: 'all' | 'selected';
18
+ revision?: string;
19
+ /** Per-schema limits can only tighten the overall payload limit. */
20
+ schemaMaxPayloadBytes?: Readonly<Record<string, number>>;
21
+ }
22
+ export interface CompositePayloadsTarget {
23
+ client: Pick<PayloadsClient, 'getMany' | 'insert'>;
24
+ /** A non-secret identifier, not an endpoint or credential. Also determines receipt provenance. */
25
+ name: string;
26
+ policy: CompositePayloadsPolicy;
27
+ }
28
+ export interface CompositePayloadsClientOptions {
29
+ /** Trusted canonical XYO hash implementation. Storage metadata must not affect either hash. */
30
+ identify: (payload: Payload) => Promise<CompositePayloadIdentity>;
31
+ /** Every target is required for its eligible subset. Array order is read priority. */
32
+ targets: readonly CompositePayloadsTarget[];
33
+ }
34
+ export interface CompositePayloadExclusion {
35
+ hash: string;
36
+ reason: 'schema' | 'size' | 'validation';
37
+ }
38
+ export interface CompositeWriteReceipt {
39
+ acknowledged: string[];
40
+ eligible: string[];
41
+ error?: 'provider_error' | 'invalid_response' | 'policy_rejected' | 'incomplete_readback';
42
+ excluded: CompositePayloadExclusion[];
43
+ policyRevision?: string;
44
+ rejected: string[];
45
+ status: 'complete' | 'excluded' | 'failed';
46
+ target: string;
47
+ }
48
+ export interface CompositeWriteResult {
49
+ /** Verified union, including previously stored duplicates. Not an aggregate success on an error. */
50
+ acknowledged: WithStorageMeta<Payload>[];
51
+ receipts: CompositeWriteReceipt[];
52
+ }
53
+ export declare class CompositePayloadsWriteError extends Error {
54
+ readonly result: CompositeWriteResult;
55
+ constructor(result: CompositeWriteResult);
56
+ }
57
+ export interface CompositeReadReceipt {
58
+ error?: 'provider_error' | 'invalid_response';
59
+ found: string[];
60
+ requested: string[];
61
+ target: string;
62
+ }
63
+ export interface CompositeReadResult {
64
+ payloads: WithStorageMeta<Payload>[];
65
+ receipts: CompositeReadReceipt[];
66
+ sources: Record<string, string>;
67
+ }
68
+ export declare class CompositePayloadsReadError extends Error {
69
+ readonly result: CompositeReadResult;
70
+ constructor(result: CompositeReadResult);
71
+ }
72
+ /**
73
+ * Required-subset writes and verified hash reads across named datalakes.
74
+ * Accepts flat payload bodies only. Callers validate and flatten protocol envelopes first.
75
+ * Deliberately has no global next/clear/delete/usage: store-local sequences and lifecycles differ.
76
+ */
77
+ export declare class CompositePayloadsClient {
78
+ private readonly identify;
79
+ private readonly targets;
80
+ constructor(options: CompositePayloadsClientOptions);
81
+ /** Missing hashes fall through in target order. Provider errors and corruption fail explicitly. */
82
+ get(hashes: string[]): Promise<WithStorageMeta<Payload>[]>;
83
+ getMany(hashes: string[]): Promise<WithStorageMeta<Payload>[]>;
84
+ getWithReceipts(hashes: readonly string[]): Promise<CompositeReadResult>;
85
+ /** Payload-array acknowledgment suitable for consumers of insert/get method contracts. */
86
+ insert(payloads: Payload[]): Promise<WithStorageMeta<Payload>[]>;
87
+ insertWithReceipts(payloads: readonly Payload[]): Promise<CompositeWriteResult>;
88
+ private verify;
89
+ private writeTarget;
90
+ }
91
+ //# sourceMappingURL=CompositePayloadsClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompositePayloadsClient.d.ts","sourceRoot":"","sources":["../../src/CompositePayloadsClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAEvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,qGAAqG;AACrG,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,uBAAuB;IACtC,kEAAkE;IAClE,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,2FAA2F;IAC3F,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAA;IACvC,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,4EAA4E;IAC5E,IAAI,EAAE,KAAK,GAAG,UAAU,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oEAAoE;IACpE,qBAAqB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACzD;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAA;IAClD,kGAAkG;IAClG,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,uBAAuB,CAAA;CAChC;AAED,MAAM,WAAW,8BAA8B;IAC7C,+FAA+F;IAC/F,QAAQ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C;IAOnC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAIpD,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;IAQ9D,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAY1D,IAAI,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAepE,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC;YAI7B,OAAO;YAKP,kBAAkB;CAuBjC"}
@@ -0,0 +1,38 @@
1
+ import type { Payload, WithStorageMeta } from '@ariestools/aries-datalake-core/browser';
2
+ /** Policy for one public HTTP response, including its JSON envelope and metadata. */
3
+ export interface RestPublicPayloadsReadOptions {
4
+ /**
5
+ Positive safe-integer limit on decoded Fetch-body bytes before JSON parsing.
6
+ Omission leaves the body size unlimited; this is not a raw network-byte limit.
7
+ */
8
+ readonly maxResponseBytes?: number;
9
+ /** Caller cancellation remains active through response-body consumption. */
10
+ readonly signal?: AbortSignal;
11
+ }
12
+ export interface RestPublicPayloadsReaderOptions {
13
+ /** Absolute HTTP(S) data-plane URL, optionally including its API path prefix. */
14
+ readonly baseUrl: string;
15
+ /** Datalake id used to regenerate the canonical native data-plane paths. */
16
+ readonly datalakeId: string;
17
+ /**
18
+ Trusted transport override. It must preserve the public no-credentials and
19
+ no-redirect policy and honor cancellation. Defaults to request-time global fetch.
20
+ */
21
+ readonly fetchImpl?: typeof fetch;
22
+ }
23
+ /**
24
+ * Exact-hash reads using the native data-plane protocol without token handling.
25
+ * The server must grant public viewer access. Public access applies to the whole
26
+ * lake; this reader neither grants access nor falls back from authenticated I/O.
27
+ * Returned metadata is structural transport data, not verified content identity.
28
+ */
29
+ export declare class RestPublicPayloadsReader {
30
+ private readonly datalakeId;
31
+ private readonly fetchImpl?;
32
+ private readonly requestBase;
33
+ constructor(options: RestPublicPayloadsReaderOptions);
34
+ get(hash: string, options?: RestPublicPayloadsReadOptions): Promise<WithStorageMeta<Payload>>;
35
+ getMany(hashes: readonly string[], options?: RestPublicPayloadsReadOptions): Promise<WithStorageMeta<Payload>[]>;
36
+ private request;
37
+ }
38
+ //# sourceMappingURL=RestPublicPayloadsReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RestPublicPayloadsReader.d.ts","sourceRoot":"","sources":["../../src/RestPublicPayloadsReader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAMvF,qFAAqF;AACrF,MAAM,WAAW,6BAA6B;IAC5C;;;MAGE;IACF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAC9B;AAED,MAAM,WAAW,+BAA+B;IAC9C,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B;;;MAGE;IACF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CAClC;AAED;;;;;GAKG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAc;IACzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;gBAExB,OAAO,EAAE,+BAA+B;IAM9C,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,6BAAkC,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAMjG,OAAO,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,GAAE,6BAAkC,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;YAW5G,OAAO;CAoBtB"}
@@ -1,8 +1,12 @@
1
1
  export type { AuthTokenRequest, AuthTokenSource, AuthTokenSupplier, } from './AuthToken.ts';
2
+ export type { CompositePayloadExclusion, CompositePayloadIdentity, CompositePayloadsClientOptions, CompositePayloadsPolicy, CompositePayloadsTarget, CompositeReadReceipt, CompositeReadResult, CompositeWriteReceipt, CompositeWriteResult, } from './CompositePayloadsClient.ts';
3
+ export { CompositePayloadsClient, CompositePayloadsReadError, CompositePayloadsWriteError, } from './CompositePayloadsClient.ts';
2
4
  export type { CreateDatalakeRequest, DatalakeClient, GrantRequest, RevokeRequest, TokenRequest, } from './DatalakeClient.ts';
3
5
  export type { DatalakeUsageReport, PayloadsAuthTokenSource, PayloadsClient, RestPayloadsClientOptions, } from './PayloadsClient.ts';
4
6
  export { RestPayloadsClient } from './PayloadsClient.ts';
5
7
  export type { RestDatalakeClientOptions } from './RestDatalakeClient.ts';
6
8
  export { RestDatalakeClient } from './RestDatalakeClient.ts';
9
+ export type { RestPublicPayloadsReaderOptions, RestPublicPayloadsReadOptions } from './RestPublicPayloadsReader.ts';
10
+ export { RestPublicPayloadsReader } from './RestPublicPayloadsReader.ts';
7
11
  export * from '@ariestools/aries-datalake-core/browser';
8
12
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,GACrD,MAAM,gBAAgB,CAAA;AACvB,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,yBAAyB,GAC1B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,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