@relyio/sdk 0.18.0 → 0.20.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 (58) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/automations/index.cjs +18 -17
  3. package/dist/automations/index.d.cts +2 -1307
  4. package/dist/automations/index.d.ts +2 -1307
  5. package/dist/automations/index.js +3 -2
  6. package/dist/{chunk-ZAMAR3X2.cjs → chunk-5F3YYPLZ.cjs} +11249 -10771
  7. package/dist/{chunk-ZO6QDYJG.cjs → chunk-5WGMIQBH.cjs} +2 -2
  8. package/dist/{chunk-LSI26ZN2.cjs → chunk-DBYMG6MQ.cjs} +5 -5
  9. package/dist/{chunk-W2A4OTCI.js → chunk-EQUZNVAR.js} +2 -2
  10. package/dist/{chunk-IFKF72VJ.cjs → chunk-K66MBRI4.cjs} +147 -71
  11. package/dist/{chunk-ZHTJ7GXH.js → chunk-L42C4G2S.js} +106 -31
  12. package/dist/{chunk-EDE2H37D.js → chunk-OUR7OUUZ.js} +174 -12
  13. package/dist/{chunk-W7JFHSFM.js → chunk-PZCDJFMA.js} +11249 -10772
  14. package/dist/{chunk-SHSK7UUY.cjs → chunk-UO2QRYKV.cjs} +177 -11
  15. package/dist/{chunk-R6E4HE7R.js → chunk-W2GRVXDG.js} +3 -3
  16. package/dist/client/index.cjs +5 -5
  17. package/dist/client/index.d.cts +4 -4
  18. package/dist/client/index.d.ts +4 -4
  19. package/dist/client/index.js +3 -3
  20. package/dist/{define-content-type-NEQDrvdq.d.cts → define-content-type-C2HnCYYX.d.cts} +1324 -156
  21. package/dist/{define-content-type-fb-WCD5e.d.ts → define-content-type-CVLUusfx.d.ts} +1324 -156
  22. package/dist/dev-handshake/index.cjs +8 -8
  23. package/dist/dev-handshake/index.d.cts +1 -1
  24. package/dist/dev-handshake/index.d.ts +1 -1
  25. package/dist/dev-handshake/index.js +1 -1
  26. package/dist/extensions/index.cjs +26 -6
  27. package/dist/extensions/index.d.cts +3 -791
  28. package/dist/extensions/index.d.ts +3 -791
  29. package/dist/extensions/index.js +24 -4
  30. package/dist/functions/index.cjs +7 -4
  31. package/dist/functions/index.d.cts +2 -4
  32. package/dist/functions/index.d.ts +2 -4
  33. package/dist/functions/index.js +5 -2
  34. package/dist/{index-DwHcL6x5.d.cts → index-BLVNMYUU.d.cts} +142 -79
  35. package/dist/{index-C4LqrNd1.d.ts → index-BY1xU93u.d.ts} +1 -1
  36. package/dist/{index-Dnmt_UOo.d.cts → index-Cmup6HJY.d.cts} +1 -1
  37. package/dist/index-D1fiaQlK.d.ts +2284 -0
  38. package/dist/index-DImzg3ew.d.cts +2284 -0
  39. package/dist/{index-M3luH06A.d.ts → index-IjSyBr8f.d.ts} +142 -79
  40. package/dist/index.cjs +89 -85
  41. package/dist/index.d.cts +64 -15
  42. package/dist/index.d.ts +64 -15
  43. package/dist/index.js +5 -5
  44. package/dist/preview/index.cjs +3 -3
  45. package/dist/preview/index.js +1 -1
  46. package/dist/rich-text/index.d.cts +2 -2
  47. package/dist/rich-text/index.d.ts +2 -2
  48. package/dist/schema/index.cjs +41 -40
  49. package/dist/schema/index.d.cts +948 -118
  50. package/dist/schema/index.d.ts +948 -118
  51. package/dist/schema/index.js +2 -1
  52. package/dist/types/index.d.cts +1 -1
  53. package/dist/types/index.d.ts +1 -1
  54. package/package.json +5 -5
  55. package/dist/define-schema-DZhtvLiK.d.cts +0 -846
  56. package/dist/define-schema-Dlwh6l_J.d.ts +0 -846
  57. package/dist/register-B53i97A9.d.ts +0 -677
  58. package/dist/register-BYCs0FpF.d.cts +0 -677
@@ -1,6 +1,6 @@
1
- import { e as ApiPath, f as ApiMethod, Q as QueryOf, W as Wire, H as HttpClient, A as AnySchemaDefinition, l as RecordsClient, B as BaseRecord, y as RecordBatchOperation, C as RecordBatchOptions, b as RecordBatchResult, R as RegisteredSchema } from './register-B53i97A9.js';
2
- import { aU as EntryMetadata, ax as Reading, cQ as BaseContent, at as CheckedIncludes, dp as ReadWhere, cV as WhereClause, cw as components, ay as ReadWith, d4 as UpdateInput, aB as UntypedReading, c_ as RevisedContent, cY as CreateInput, cZ as CreatedContent, d3 as ContentVersionRow, d2 as ContentVersion, d1 as RestoredContent, cJ as SDKError, dl as BaseValidationError, dk as ValidationViolation, ba as AssetServedBlocks, dq as CheckedInclude, cU as WhereFieldCondition, cO as AssetFileBlock, cR as BaseSingleton, c$ as WrittenSingleton, cS as BaseSettingsGroup, d0 as WrittenSettingsGroup, aV as InferContentType, av as ContentReading, a$ as InferSingleton, cF as paths, cK as RelyIOConfig, b8 as InferAssetType, as as AssetReading, aA as SingletonReading, b4 as InferSettingsGroup, az as SettingsReading, cL as RelyIOConfigUpdate, cH as MergedRelyIOConfig } from './define-content-type-fb-WCD5e.js';
3
- import { a as SchemaContentTypeNames, l as SchemaEntryOf, c as SchemaLocaleCodes, h as SchemaSingletonNames, v as AggregateBlock, _ as QueryParameterValue, F as FullTextSearch, i as SchemaQueryNames, Z as InferQueryParams, $ as AnyQueryParameters, S as SchemaRecordTypeNames, I as InferRecordType, R as RecordWriteFieldsOf, d as RecordUpdateFieldsOf, k as SchemaAssetTypeNames, j as SchemaSettingsGroupNames } from './define-schema-Dlwh6l_J.js';
1
+ import { b as ApiPath, c as ApiMethod, Q as QueryOf, W as Wire, H as HttpClient, F as FunctionFieldValues, R as Register, A as AnySchemaDefinition, h as RecordsClient, B as BaseRecord, v as RecordBatchOperation, x as RecordBatchOptions, y as RecordBatchResult, a as RegisteredSchema } from './index-D1fiaQlK.js';
2
+ import { bi as EntryMetadata, aZ as Reading, da as BaseContent, aV as CheckedIncludes, dL as ReadWhere, df as WhereClause, ap as components, a_ as ReadWith, dr as UpdateInput, b1 as UntypedReading, dk as RevisedContent, di as CreateInput, dj as CreatedContent, dq as ContentVersionRow, dp as ContentVersion, dn as RestoredContent, d3 as SDKError, dI as BaseValidationError, dH as ValidationViolation, bw as AssetServedBlocks, dM as CheckedInclude, de as WhereFieldCondition, d8 as AssetFileBlock, db as BaseSingleton, dl as WrittenSingleton, dc as BaseSettingsGroup, dm as WrittenSettingsGroup, s as KeyedMembers, aB as InferContentType, aX as ContentReading, bn as InferSingleton, cW as paths, d4 as RelyIOConfig, bu as InferAssetType, aU as AssetReading, b0 as SingletonReading, br as InferSettingsGroup, a$ as SettingsReading, d5 as RelyIOConfigUpdate, cY as MergedRelyIOConfig } from './define-content-type-CVLUusfx.js';
3
+ import { SchemaContentTypeNames, SchemaEntryOf, SchemaLocaleCodes, SchemaSingletonNames, AggregateBlock, QueryParameterValue, FullTextSearch, SchemaQueryNames, InferQueryParams, AnyQueryParameters, SchemaRecordTypeNames, InferRecordType, RecordWriteFieldsOf, RecordUpdateFieldsOf, SchemaAssetTypeNames, SchemaSettingsGroupNames } from './schema/index.js';
4
4
  import { DevUnreadableReason } from './dev-handshake/index.js';
5
5
 
6
6
  /**
@@ -65,70 +65,6 @@ type ActiveSandbox = Extract<SandboxState, {
65
65
  state: 'active';
66
66
  }>;
67
67
 
68
- /**
69
- * API4's two request headers, as the SDK's writes send them.
70
- *
71
- * `Idempotency-Key` is an option on every write whose route declares it (`idempotencyKey`), and the
72
- * SDK mints one when none is given. `If-Match` is never an option: a checked write builds it from
73
- * the entry it was read as (`versionCheckOf`), from the `_metadata` every read carries in its body
74
- * whether or not the edge cache served it (REL-2418). The SDK does not read the separate
75
- * `X-Entity-Tag` header, which the edge removes from what it stores; the API keeps sending it for
76
- * callers using plain HTTP (REL-2427). A batch operation carries its check in its own body, as
77
- * `ifMatch` (`batch/batch-operations.ts`, REL-2421).
78
- */
79
- interface RetryableWriteOptions {
80
- /**
81
- * A key that makes a retry of **this** write safe.
82
- *
83
- * A replay inside the service's window returns the original outcome rather
84
- * than applying twice. The service derives that response from committed state
85
- * pinned to the recorded version — it does not store bytes — so a replay after
86
- * the version has been pruned is refused `RESOURCE_EXPIRED` rather than
87
- * answered from a stale copy.
88
- *
89
- * **The SDK mints one when you do not.** It used to be caller-supplied and
90
- * nothing else, which meant the default write carried no key while the retry
91
- * loop replayed it anyway — the one mechanism that makes a replay safe was
92
- * optional on the one path that needed it. Supply your own to make a key
93
- * outlive the process: a job that may be restarted wants a key derived from
94
- * the work, not one minted per call.
95
- */
96
- idempotencyKey?: string;
97
- }
98
- /**
99
- * An entry a read handed back, as much of it as a version check needs: its `_metadata`'s id, the
100
- * locale it was read in and the two counters it was read at (REL-2418).
101
- *
102
- * Every read carries these in its body, whether origin or the edge cache served it — the edge
103
- * removes only the separate `X-Entity-Tag` header from what it stores, so a check taken from that
104
- * header vanished after a cached read. A `Pick` of the document's `EntryMetadata`, so a counter the
105
- * API stops reporting stops compiling here.
106
- */
107
- interface ReadEntry {
108
- readonly _metadata: Pick<EntryMetadata, 'id' | 'locale' | 'version' | 'sharedVersion'>;
109
- }
110
- /**
111
- * The version check a write takes from the entry it was read as: the entry's id, the locale it was
112
- * read in — which the write addresses, so a read negotiated from `Accept-Language` is written back
113
- * to that locale — and the `If-Match` tag over its two counters, spelled as the API mints it.
114
- */
115
- declare function versionCheckOf(entry: ReadEntry): {
116
- id: string;
117
- locale: string;
118
- ifMatch: string;
119
- };
120
-
121
- /**
122
- * The client's locale as a sub-client holds it: a function it asks on every call, or a locale fixed
123
- * when it was built.
124
- *
125
- * `TypedRelyIOClient` hands every sub-client and builder a function over the configuration it holds,
126
- * so one taken before `updateConfig({ locale })` sends the locale the client holds when the call is
127
- * made, and none once `updateConfig({ locale: null })` has cleared it (REL-1453). A string is a locale
128
- * fixed at construction — a handle built directly, as the tests build one — and stays what it was.
129
- */
130
- type ClientLocale = string | (() => string | undefined);
131
-
132
68
  /**
133
69
  * Site-visitor live, declared once for everyone who speaks it (`live-layer-spec.md` decisions 15, 19
134
70
  * and 20; phase LV5): the wire a visitor's browser meets at `live.relyio.com`, and the two internal
@@ -229,6 +165,70 @@ type VisitorResyncReason = VisitorLedgerResyncReason | 'too-far-behind';
229
165
  */
230
166
  type VisitorRetry = 'stop' | 'retry' | 'back-off';
231
167
 
168
+ /**
169
+ * API4's two request headers, as the SDK's writes send them.
170
+ *
171
+ * `Idempotency-Key` is an option on every write whose route declares it (`idempotencyKey`), and the
172
+ * SDK mints one when none is given. `If-Match` is never an option: a checked write builds it from
173
+ * the entry it was read as (`versionCheckOf`), from the `_metadata` every read carries in its body
174
+ * whether or not the edge cache served it (REL-2418). The SDK does not read the separate
175
+ * `X-Entity-Tag` header, which the edge removes from what it stores; the API keeps sending it for
176
+ * callers using plain HTTP (REL-2427). A batch operation carries its check in its own body, as
177
+ * `ifMatch` (`batch/batch-operations.ts`, REL-2421).
178
+ */
179
+ interface RetryableWriteOptions {
180
+ /**
181
+ * A key that makes a retry of **this** write safe.
182
+ *
183
+ * A replay inside the service's window returns the original outcome rather
184
+ * than applying twice. The service derives that response from committed state
185
+ * pinned to the recorded version — it does not store bytes — so a replay after
186
+ * the version has been pruned is refused `RESOURCE_EXPIRED` rather than
187
+ * answered from a stale copy.
188
+ *
189
+ * **The SDK mints one when you do not.** It used to be caller-supplied and
190
+ * nothing else, which meant the default write carried no key while the retry
191
+ * loop replayed it anyway — the one mechanism that makes a replay safe was
192
+ * optional on the one path that needed it. Supply your own to make a key
193
+ * outlive the process: a job that may be restarted wants a key derived from
194
+ * the work, not one minted per call.
195
+ */
196
+ idempotencyKey?: string;
197
+ }
198
+ /**
199
+ * An entry a read handed back, as much of it as a version check needs: its `_metadata`'s id, the
200
+ * locale it was read in and the two counters it was read at (REL-2418).
201
+ *
202
+ * Every read carries these in its body, whether origin or the edge cache served it — the edge
203
+ * removes only the separate `X-Entity-Tag` header from what it stores, so a check taken from that
204
+ * header vanished after a cached read. A `Pick` of the document's `EntryMetadata`, so a counter the
205
+ * API stops reporting stops compiling here.
206
+ */
207
+ interface ReadEntry {
208
+ readonly _metadata: Pick<EntryMetadata, 'id' | 'locale' | 'version' | 'sharedVersion'>;
209
+ }
210
+ /**
211
+ * The version check a write takes from the entry it was read as: the entry's id, the locale it was
212
+ * read in — which the write addresses, so a read negotiated from `Accept-Language` is written back
213
+ * to that locale — and the `If-Match` tag over its two counters, spelled as the API mints it.
214
+ */
215
+ declare function versionCheckOf(entry: ReadEntry): {
216
+ id: string;
217
+ locale: string;
218
+ ifMatch: string;
219
+ };
220
+
221
+ /**
222
+ * The client's locale as a sub-client holds it: a function it asks on every call, or a locale fixed
223
+ * when it was built.
224
+ *
225
+ * `TypedRelyIOClient` hands every sub-client and builder a function over the configuration it holds,
226
+ * so one taken before `updateConfig({ locale })` sends the locale the client holds when the call is
227
+ * made, and none once `updateConfig({ locale: null })` has cleared it (REL-1453). A string is a locale
228
+ * fixed at construction — a handle built directly, as the tests build one — and stays what it was.
229
+ */
230
+ type ClientLocale = string | (() => string | undefined);
231
+
232
232
  /**
233
233
  * Two read terms every read that takes them writes the same way: the children an entry embeds,
234
234
  * and the refusal of a condition on `_metadata`. Here once, for the list and entry reads
@@ -803,7 +803,7 @@ declare class FileValidationError extends BaseValidationError {
803
803
  }
804
804
  /** Constraints `validateFile` checks a file against (subset of the schema upload gate). */
805
805
  interface FileValidationConstraints {
806
- /** Allowed MIME types (exact match). */
806
+ /** Allowed MIME types: exact (`image/png`) or a wildcard pattern (`image/*`), as a schema declares them. */
807
807
  allowedMimeTypes?: string[];
808
808
  /** Max size in bytes. */
809
809
  maxSizeBytes?: number;
@@ -1479,9 +1479,11 @@ declare class SettingsClient<T = BaseSettingsGroup, R extends Reading = UntypedR
1479
1479
  * runs the Function `checkout` that the key's Branch runs, on the key's Dataset, and answers its
1480
1480
  * output.
1481
1481
  *
1482
- * Call it from your server with a secret key: a publishable key is refused
1483
- * (`PublishableKeyRefusedError`), and a read-only key runs only a Function whose reach writes
1484
- * nothing (`ReadOnlyKeyError`). A run whose code threw or was ended at a limit throws
1482
+ * Call it from your server with a secret key. A publishable key calls only a Function declaring
1483
+ * `endUsers` (spec 4, REL-3892) — with a signed-in End user's token (`getToken`) when it says
1484
+ * `'required'` — and is refused any other (`PublishableKeyRefusedError`); a read-only secret key
1485
+ * runs only a Function whose reach writes nothing (`ReadOnlyKeyError`). A call carrying an End
1486
+ * user's token hands the run `run.endUser`, whatever the key. A run whose code threw or was ended at a limit throws
1485
1487
  * `FunctionRunFailedError`, and one that outlived the service's five-minute wait
1486
1488
  * `FunctionRunTimedOutError` — each naming the run (`runId`), whose record and console output Manage
1487
1489
  * serves. A call is never retried: a Function may write, and a second call would be a second run.
@@ -1502,15 +1504,56 @@ interface FunctionCallOptions {
1502
1504
  */
1503
1505
  idempotencyKey?: string;
1504
1506
  }
1505
- /** One Function, called: its input, as its input Fields declare it, and its output. */
1507
+ /** One Function, called, before `Register` names the project's Functions: any input, any answer. */
1506
1508
  type FunctionCall = (input?: Record<string, unknown>, options?: FunctionCallOptions) => Promise<unknown>;
1507
1509
  /**
1508
- * `relyio.functions`: every Function the key's Branch runs, by name. A name the Branch does not run
1509
- * is refused by the service (`ResourceNotFoundError`), not here.
1510
+ * One Function's input and output Fields, as the generated `schema.ts` registers them (REL-4059): the
1511
+ * keyed record its file declares under `input`, and under `output` when it declares one.
1510
1512
  */
1511
- type FunctionsAccessor = {
1513
+ interface RegisteredFunctionFields {
1514
+ readonly input: KeyedMembers;
1515
+ readonly output?: KeyedMembers;
1516
+ }
1517
+ /** What a registered Function's call answers: its output's values, or what its run returned when it declares none. */
1518
+ type OutputOf<F extends RegisteredFunctionFields> = F extends {
1519
+ readonly output: infer O extends KeyedMembers;
1520
+ } ? FunctionFieldValues<O> : unknown;
1521
+ /**
1522
+ * What a registered Function's call takes: its input Fields' values. A Function declaring no input
1523
+ * field takes none — `{}` would take any key, since an empty object type has no excess-property check.
1524
+ */
1525
+ type InputOf<F extends RegisteredFunctionFields> = [keyof FunctionFieldValues<F['input']>] extends [
1526
+ never
1527
+ ] ? {
1528
+ readonly [field: string]: never;
1529
+ } : FunctionFieldValues<F['input']>;
1530
+ /**
1531
+ * One registered Function, called: its input as its input Fields declare them — required when a
1532
+ * field of it is, so a missing, misnamed or mistyped field is a type error — and its output.
1533
+ */
1534
+ type TypedFunctionCall<F extends RegisteredFunctionFields> = {} extends InputOf<F> ? (input?: InputOf<F>, options?: FunctionCallOptions) => Promise<OutputOf<F>> : (input: InputOf<F>, options?: FunctionCallOptions) => Promise<OutputOf<F>>;
1535
+ /**
1536
+ * `relyio.functions` over a project's Functions: exactly those registered, each typed by its Fields,
1537
+ * or any name before `relyio generate-types` registered any. Generic on purpose, as
1538
+ * `FunctionRecordTypeName` is: written over `Register` directly, the conditional can be resolved
1539
+ * before the program's augmentation is in view.
1540
+ */
1541
+ type FunctionsAccessorOf<R> = R extends {
1542
+ readonly functions: infer F extends {
1543
+ readonly [name: string]: RegisteredFunctionFields;
1544
+ };
1545
+ } ? {
1546
+ readonly [N in keyof F]: TypedFunctionCall<F[N]>;
1547
+ } : {
1512
1548
  readonly [name: string]: FunctionCall;
1513
1549
  };
1550
+ /**
1551
+ * `relyio.functions`: every Function the key's Branch runs, by name. Once `relyio generate-types`
1552
+ * has registered the project's Functions (`Register`'s `functions`), only those names are on it and
1553
+ * each call is typed by its input and output Fields; before, any name, untyped. A name the Branch
1554
+ * does not run is refused by the service (`ResourceNotFoundError`), not here.
1555
+ */
1556
+ type FunctionsAccessor = FunctionsAccessorOf<Register>;
1514
1557
 
1515
1558
  /**
1516
1559
  * What the search family's routes answer, read from the committed document, and what a search over
@@ -2430,11 +2473,19 @@ interface DeployedContentType {
2430
2473
  }
2431
2474
  /**
2432
2475
  * The defaults `client.with()` gives the client it makes (REL-2417, Q9): the locale and the dataset
2433
- * its reads and writes are in unless a call names its own. A locale is one the schema declares.
2476
+ * its reads and writes are in unless a call names its own, and the End user's token function its
2477
+ * requests ask in place of the parent's (REL-3882). A locale is one the schema declares.
2434
2478
  */
2435
2479
  interface ClientDefaults<TSchema extends AnySchemaDefinition | undefined = undefined> {
2436
2480
  readonly locale?: LocaleCodeOf<TSchema>;
2437
2481
  readonly dataset?: string;
2482
+ /**
2483
+ * The signed-in End user's token, asked for on every request this client sends — and every
2484
+ * request of a client `with()` makes from it that names none — in place of the parent's
2485
+ * `getToken`. `@relyio/react`'s provider hands it Clerk's `useAuth().getToken`. See
2486
+ * `RelyIOConfig.getToken`.
2487
+ */
2488
+ readonly getToken?: () => Promise<string | null>;
2438
2489
  }
2439
2490
  /** The locale codes a client's reads may name: the schema's, or any where no schema types it. */
2440
2491
  type LocaleCodeOf<TSchema extends AnySchemaDefinition | undefined> = TSchema extends AnySchemaDefinition ? SchemaLocaleCodes<TSchema> : string;
@@ -2509,7 +2560,10 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
2509
2560
  * `createClient()` made, which reads its own.
2510
2561
  */
2511
2562
  private parent;
2512
- /** What `with()` gave this client over its parent's: the locale and dataset it names, and no other. */
2563
+ /**
2564
+ * What `with()` gave this client over its parent's: the locale, dataset and End user's token
2565
+ * function it names, and no other.
2566
+ */
2513
2567
  private defaults;
2514
2568
  /** The live edge's poll client id: chosen once, when first needed, and kept for this client's life. */
2515
2569
  private _liveClientId;
@@ -2565,7 +2619,9 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
2565
2619
  * all or none (REL-3774).
2566
2620
  *
2567
2621
  * A Record is an app's data, written by your server with a secret key and live the moment it
2568
- * lands; a publishable key is refused on every Record route (`PUBLISHABLE_KEY_REFUSED`).
2622
+ * lands. A publishable key reads the Records a Record type's read Policy grants it (spec 4,
2623
+ * REL-3883), and writes them only for the End user whose token it carries, as the type's write
2624
+ * Policy allows (REL-3884); with no token it writes nothing (`PUBLISHABLE_KEY_REFUSED`).
2569
2625
  *
2570
2626
  * @example
2571
2627
  * ```typescript
@@ -2585,9 +2641,13 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
2585
2641
  * `FunctionRunFailedError` and one past five minutes `FunctionRunTimedOutError`, each naming the
2586
2642
  * run. Never retried: a Function may write.
2587
2643
  *
2644
+ * Once `relyio generate-types` has run, its `schema.ts` registers each Function's input and output
2645
+ * Fields (REL-4059): only the project's Functions are named here, and each call takes and answers
2646
+ * what its Fields declare, so a misnamed or mistyped input field is a type error.
2647
+ *
2588
2648
  * @example
2589
2649
  * ```typescript
2590
- * const { orderId } = (await relyio.functions.checkout({ cartId })) as { orderId: string }
2650
+ * const { orderId } = await relyio.functions.checkout({ cartId })
2591
2651
  * ```
2592
2652
  */
2593
2653
  readonly functions: FunctionsAccessor;
@@ -2935,6 +2995,9 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
2935
2995
  * const { data } = await staging.content('post').list({ limit: 10 })
2936
2996
  *
2937
2997
  * const french = relyio.with({ locale: 'fr-FR' }) // ← autocompletes the schema's locales
2998
+ *
2999
+ * // Every request this one sends carries the signed-in End user's token (REL-3882)
3000
+ * const visitor = relyio.with({ getToken: () => session.getToken() })
2938
3001
  * ```
2939
3002
  */
2940
3003
  with(defaults: ClientDefaults<TSchema>): TypedRelyIOClient<TSchema>;