@relyio/sdk 0.18.0 → 0.19.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/CHANGELOG.md +20 -0
- package/dist/automations/index.cjs +18 -17
- package/dist/automations/index.d.cts +289 -8
- package/dist/automations/index.d.ts +289 -8
- package/dist/automations/index.js +3 -2
- package/dist/{chunk-ZHTJ7GXH.js → chunk-356SF5Y2.js} +84 -26
- package/dist/{chunk-ZAMAR3X2.cjs → chunk-5F3YYPLZ.cjs} +11249 -10771
- package/dist/{chunk-LSI26ZN2.cjs → chunk-DBYMG6MQ.cjs} +5 -5
- package/dist/{chunk-SHSK7UUY.cjs → chunk-NN45CSPZ.cjs} +177 -11
- package/dist/{chunk-IFKF72VJ.cjs → chunk-P23G5NXD.cjs} +122 -63
- package/dist/{chunk-W7JFHSFM.js → chunk-PZCDJFMA.js} +11249 -10772
- package/dist/{chunk-EDE2H37D.js → chunk-T7LGREB3.js} +174 -12
- package/dist/{chunk-R6E4HE7R.js → chunk-W2GRVXDG.js} +3 -3
- package/dist/client/index.cjs +4 -4
- package/dist/client/index.d.cts +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.js +2 -2
- package/dist/{define-content-type-NEQDrvdq.d.cts → define-content-type-BZ6X8GvL.d.cts} +1324 -156
- package/dist/{define-content-type-fb-WCD5e.d.ts → define-content-type-C12jh8cY.d.ts} +1324 -156
- package/dist/{define-schema-Dlwh6l_J.d.ts → define-schema-BPlZl4a2.d.cts} +104 -3
- package/dist/{define-schema-DZhtvLiK.d.cts → define-schema-CK7TtYot.d.ts} +104 -3
- package/dist/extensions/index.cjs +26 -6
- package/dist/extensions/index.d.cts +5 -791
- package/dist/extensions/index.d.ts +5 -791
- package/dist/extensions/index.js +24 -4
- package/dist/functions/index.cjs +7 -4
- package/dist/functions/index.d.cts +4 -4
- package/dist/functions/index.d.ts +4 -4
- package/dist/functions/index.js +5 -2
- package/dist/{index-M3luH06A.d.ts → index-BxNnlc5D.d.ts} +91 -73
- package/dist/{index-C4LqrNd1.d.ts → index-C-MymZTe.d.ts} +1 -1
- package/dist/{index-DwHcL6x5.d.cts → index-D5jyIeQ5.d.cts} +91 -73
- package/dist/{index-Dnmt_UOo.d.cts → index-DN0l8RHw.d.cts} +1 -1
- package/dist/index.cjs +88 -84
- package/dist/index.d.cts +64 -14
- package/dist/index.d.ts +64 -14
- package/dist/index.js +4 -4
- package/dist/preview/index.cjs +3 -3
- package/dist/preview/index.js +1 -1
- package/dist/{register-B53i97A9.d.ts → register-BiMQKVp-.d.ts} +24 -8
- package/dist/{register-BYCs0FpF.d.cts → register-DeMsaurp.d.cts} +24 -8
- package/dist/rich-text/index.d.cts +2 -2
- package/dist/rich-text/index.d.ts +2 -2
- package/dist/schema/index.cjs +41 -40
- package/dist/schema/index.d.cts +7 -120
- package/dist/schema/index.d.ts +7 -120
- package/dist/schema/index.js +2 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/extensions/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { extensionTrigger } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import { EXTENSION_SURFACES } from '../chunk-
|
|
1
|
+
import { extensionTrigger } from '../chunk-W2GRVXDG.js';
|
|
2
|
+
import { keyedField } from '../chunk-PZCDJFMA.js';
|
|
3
|
+
import { contributedFieldKindName, CONTRIBUTED_FIELD_KIND_OPTION, EXTENSION_SURFACES } from '../chunk-T7LGREB3.js';
|
|
4
4
|
import { __name } from '../chunk-DI6KFDBO.js';
|
|
5
5
|
|
|
6
6
|
/* RelyIO SDK - Built with ❤️ by the RelyIO Team */
|
|
@@ -8,6 +8,18 @@ import { __name } from '../chunk-DI6KFDBO.js';
|
|
|
8
8
|
// src/extensions/index.ts
|
|
9
9
|
var DECLARED = "declared";
|
|
10
10
|
var SURFACES = EXTENSION_SURFACES;
|
|
11
|
+
function fieldKindBuilder(slug, name, kind) {
|
|
12
|
+
return (options = {}) => {
|
|
13
|
+
const ui = options.ui;
|
|
14
|
+
const widget = typeof ui === "object" && ui !== null ? ui : {};
|
|
15
|
+
return keyedField("reference", {
|
|
16
|
+
...options,
|
|
17
|
+
to: kind.base.to,
|
|
18
|
+
ui: { ...widget, [CONTRIBUTED_FIELD_KIND_OPTION]: contributedFieldKindName(slug, name) }
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
__name(fieldKindBuilder, "fieldKindBuilder");
|
|
11
23
|
function handleOf(slug) {
|
|
12
24
|
const surface = SURFACES[slug];
|
|
13
25
|
if (surface === void 0) {
|
|
@@ -27,7 +39,15 @@ function handleOf(slug) {
|
|
|
27
39
|
name,
|
|
28
40
|
(options) => extensionTrigger(slug, trigger, options)
|
|
29
41
|
])
|
|
30
|
-
)
|
|
42
|
+
),
|
|
43
|
+
...Object.fromEntries(
|
|
44
|
+
Object.entries(surface.fieldKinds).map(([name, kind]) => [
|
|
45
|
+
name,
|
|
46
|
+
fieldKindBuilder(slug, name, kind)
|
|
47
|
+
])
|
|
48
|
+
),
|
|
49
|
+
// Its Managed Record types, by name: `clerk.user` is `'clerkUser'` (REL-3863)
|
|
50
|
+
...surface.recordTypes
|
|
31
51
|
};
|
|
32
52
|
}
|
|
33
53
|
__name(handleOf, "handleOf");
|
package/dist/functions/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5F3YYPLZ_cjs = require('../chunk-5F3YYPLZ.cjs');
|
|
4
|
+
require('../chunk-NN45CSPZ.cjs');
|
|
4
5
|
var chunkL6DXCKVQ_cjs = require('../chunk-L6DXCKVQ.cjs');
|
|
5
6
|
|
|
6
7
|
/* RelyIO SDK - Built with ❤️ by the RelyIO Team */
|
|
@@ -30,8 +31,8 @@ function defineFunction(config) {
|
|
|
30
31
|
runtime: config.runtime ?? "isolate",
|
|
31
32
|
...config.container === void 0 ? {} : { container: { size: config.container.size } },
|
|
32
33
|
...config.limits === void 0 ? {} : { limits: { ...config.limits } },
|
|
33
|
-
input:
|
|
34
|
-
...config.output === void 0 ? {} : { output:
|
|
34
|
+
input: chunk5F3YYPLZ_cjs.compileKeyedMembers(config.input ?? {}),
|
|
35
|
+
...config.output === void 0 ? {} : { output: chunk5F3YYPLZ_cjs.compileKeyedMembers(config.output) },
|
|
35
36
|
records: { read: [...config.records?.read ?? []], write: [...config.records?.write ?? []] },
|
|
36
37
|
content: config.content ?? "none",
|
|
37
38
|
network: (config.network ?? []).map((host) => ({ ...host })),
|
|
@@ -43,6 +44,8 @@ function defineFunction(config) {
|
|
|
43
44
|
),
|
|
44
45
|
// Absent when it declares none, so a Function declaring none hashes as it did before
|
|
45
46
|
...actions.length === 0 ? {} : { actions },
|
|
47
|
+
// Absent when undeclared, so a Function declaring none hashes as it did before
|
|
48
|
+
...config.endUsers === void 0 ? {} : { endUsers: config.endUsers },
|
|
46
49
|
...config.route === void 0 ? {} : { route: config.route },
|
|
47
50
|
...config.tool === void 0 ? {} : { tool: { description: config.tool.description } },
|
|
48
51
|
...config.schedule === void 0 ? {} : { schedule: { ...config.schedule } }
|
|
@@ -57,7 +60,7 @@ chunkL6DXCKVQ_cjs.__name(isFunctionDefinition, "isFunctionDefinition");
|
|
|
57
60
|
|
|
58
61
|
Object.defineProperty(exports, "fields", {
|
|
59
62
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunk5F3YYPLZ_cjs.fields; }
|
|
61
64
|
});
|
|
62
65
|
exports.defineFunction = defineFunction;
|
|
63
66
|
exports.isActionRefused = isActionRefused;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../register-
|
|
3
|
-
import '../define-schema-
|
|
4
|
-
import '../define-content-type-
|
|
1
|
+
export { r as FunctionActionHandle, q as FunctionActionReach, T as FunctionActionRefused, S as FunctionActions, J as FunctionBatchRefused, I as FunctionBatchResult, V as FunctionCapabilities, Y as FunctionConfig, m as FunctionContainerSize, R as FunctionContent, A as FunctionCounterMove, x as FunctionDeclaration, Z as FunctionDefinition, n as FunctionDuration, P as FunctionEndUser, O as FunctionEndUserClaims, N as FunctionEndUsers, w as FunctionFieldDeclaration, z as FunctionFile, _ as FunctionInputOf, p as FunctionNetworkHost, $ as FunctionOutputOf, G as FunctionRecordBatch, B as FunctionRecordReader, y as FunctionRecordTypeName, D as FunctionRecordWriter, L as FunctionRecords, W as FunctionResponse, t as FunctionRoute, o as FunctionRouteMethod, Q as FunctionRunInfo, F as FunctionRuntime, v as FunctionSchedule, s as FunctionSecretDeclaration, u as FunctionTool, M as FunctionWayIn, a0 as defineFunction, U as isActionRefused, K as isBatchRefused, a1 as isFunctionDefinition, X as respond } from '../automations/index.cjs';
|
|
2
|
+
import '../register-DeMsaurp.cjs';
|
|
3
|
+
import '../define-schema-BPlZl4a2.cjs';
|
|
4
|
+
import '../define-content-type-BZ6X8GvL.cjs';
|
|
5
5
|
export { fields } from '../schema/index.cjs';
|
|
6
6
|
import '../rich-text.d-BWc-5gX1.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../register-
|
|
3
|
-
import '../define-schema-
|
|
4
|
-
import '../define-content-type-
|
|
1
|
+
export { r as FunctionActionHandle, q as FunctionActionReach, T as FunctionActionRefused, S as FunctionActions, J as FunctionBatchRefused, I as FunctionBatchResult, V as FunctionCapabilities, Y as FunctionConfig, m as FunctionContainerSize, R as FunctionContent, A as FunctionCounterMove, x as FunctionDeclaration, Z as FunctionDefinition, n as FunctionDuration, P as FunctionEndUser, O as FunctionEndUserClaims, N as FunctionEndUsers, w as FunctionFieldDeclaration, z as FunctionFile, _ as FunctionInputOf, p as FunctionNetworkHost, $ as FunctionOutputOf, G as FunctionRecordBatch, B as FunctionRecordReader, y as FunctionRecordTypeName, D as FunctionRecordWriter, L as FunctionRecords, W as FunctionResponse, t as FunctionRoute, o as FunctionRouteMethod, Q as FunctionRunInfo, F as FunctionRuntime, v as FunctionSchedule, s as FunctionSecretDeclaration, u as FunctionTool, M as FunctionWayIn, a0 as defineFunction, U as isActionRefused, K as isBatchRefused, a1 as isFunctionDefinition, X as respond } from '../automations/index.js';
|
|
2
|
+
import '../register-BiMQKVp-.js';
|
|
3
|
+
import '../define-schema-CK7TtYot.js';
|
|
4
|
+
import '../define-content-type-C12jh8cY.js';
|
|
5
5
|
export { fields } from '../schema/index.js';
|
|
6
6
|
import '../rich-text.d-BWc-5gX1.js';
|
package/dist/functions/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { compileKeyedMembers } from '../chunk-
|
|
2
|
-
export { fields } from '../chunk-
|
|
1
|
+
import { compileKeyedMembers } from '../chunk-PZCDJFMA.js';
|
|
2
|
+
export { fields } from '../chunk-PZCDJFMA.js';
|
|
3
|
+
import '../chunk-T7LGREB3.js';
|
|
3
4
|
import { __name } from '../chunk-DI6KFDBO.js';
|
|
4
5
|
|
|
5
6
|
/* RelyIO SDK - Built with ❤️ by the RelyIO Team */
|
|
@@ -42,6 +43,8 @@ function defineFunction(config) {
|
|
|
42
43
|
),
|
|
43
44
|
// Absent when it declares none, so a Function declaring none hashes as it did before
|
|
44
45
|
...actions.length === 0 ? {} : { actions },
|
|
46
|
+
// Absent when undeclared, so a Function declaring none hashes as it did before
|
|
47
|
+
...config.endUsers === void 0 ? {} : { endUsers: config.endUsers },
|
|
45
48
|
...config.route === void 0 ? {} : { route: config.route },
|
|
46
49
|
...config.tool === void 0 ? {} : { tool: { description: config.tool.description } },
|
|
47
50
|
...config.schedule === void 0 ? {} : { schedule: { ...config.schedule } }
|
|
@@ -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-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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-BiMQKVp-.js';
|
|
2
|
+
import { aW as EntryMetadata, ay as Reading, da as BaseContent, au as CheckedIncludes, dL as ReadWhere, df as WhereClause, cR as components, az as ReadWith, dr as UpdateInput, aC 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, bc as AssetServedBlocks, dM as CheckedInclude, de as WhereFieldCondition, d8 as AssetFileBlock, db as BaseSingleton, dl as WrittenSingleton, dc as BaseSettingsGroup, dm as WrittenSettingsGroup, aX as InferContentType, aw as ContentReading, b1 as InferSingleton, c$ as paths, d4 as RelyIOConfig, ba as InferAssetType, at as AssetReading, aB as SingletonReading, b6 as InferSettingsGroup, aA as SettingsReading, d5 as RelyIOConfigUpdate, d1 as MergedRelyIOConfig } from './define-content-type-C12jh8cY.js';
|
|
3
|
+
import { b as SchemaContentTypeNames, k as SchemaEntryOf, f as SchemaLocaleCodes, c as SchemaSingletonNames, y as AggregateBlock, a5 as QueryParameterValue, w as FullTextSearch, e as SchemaQueryNames, a4 as InferQueryParams, a6 as AnyQueryParameters, i as SchemaRecordTypeNames, I as InferRecordType, r as RecordWriteFieldsOf, q as RecordUpdateFieldsOf, h as SchemaAssetTypeNames, g as SchemaSettingsGroupNames } from './define-schema-CK7TtYot.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
|
|
@@ -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
|
|
1483
|
-
*
|
|
1484
|
-
*
|
|
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.
|
|
@@ -2430,11 +2432,19 @@ interface DeployedContentType {
|
|
|
2430
2432
|
}
|
|
2431
2433
|
/**
|
|
2432
2434
|
* 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
|
|
2435
|
+
* its reads and writes are in unless a call names its own, and the End user's token function its
|
|
2436
|
+
* requests ask in place of the parent's (REL-3882). A locale is one the schema declares.
|
|
2434
2437
|
*/
|
|
2435
2438
|
interface ClientDefaults<TSchema extends AnySchemaDefinition | undefined = undefined> {
|
|
2436
2439
|
readonly locale?: LocaleCodeOf<TSchema>;
|
|
2437
2440
|
readonly dataset?: string;
|
|
2441
|
+
/**
|
|
2442
|
+
* The signed-in End user's token, asked for on every request this client sends — and every
|
|
2443
|
+
* request of a client `with()` makes from it that names none — in place of the parent's
|
|
2444
|
+
* `getToken`. `@relyio/react`'s provider hands it Clerk's `useAuth().getToken`. See
|
|
2445
|
+
* `RelyIOConfig.getToken`.
|
|
2446
|
+
*/
|
|
2447
|
+
readonly getToken?: () => Promise<string | null>;
|
|
2438
2448
|
}
|
|
2439
2449
|
/** The locale codes a client's reads may name: the schema's, or any where no schema types it. */
|
|
2440
2450
|
type LocaleCodeOf<TSchema extends AnySchemaDefinition | undefined> = TSchema extends AnySchemaDefinition ? SchemaLocaleCodes<TSchema> : string;
|
|
@@ -2509,7 +2519,10 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
|
|
|
2509
2519
|
* `createClient()` made, which reads its own.
|
|
2510
2520
|
*/
|
|
2511
2521
|
private parent;
|
|
2512
|
-
/**
|
|
2522
|
+
/**
|
|
2523
|
+
* What `with()` gave this client over its parent's: the locale, dataset and End user's token
|
|
2524
|
+
* function it names, and no other.
|
|
2525
|
+
*/
|
|
2513
2526
|
private defaults;
|
|
2514
2527
|
/** The live edge's poll client id: chosen once, when first needed, and kept for this client's life. */
|
|
2515
2528
|
private _liveClientId;
|
|
@@ -2565,7 +2578,9 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
|
|
|
2565
2578
|
* all or none (REL-3774).
|
|
2566
2579
|
*
|
|
2567
2580
|
* A Record is an app's data, written by your server with a secret key and live the moment it
|
|
2568
|
-
* lands
|
|
2581
|
+
* lands. A publishable key reads the Records a Record type's read Policy grants it (spec 4,
|
|
2582
|
+
* REL-3883), and writes them only for the End user whose token it carries, as the type's write
|
|
2583
|
+
* Policy allows (REL-3884); with no token it writes nothing (`PUBLISHABLE_KEY_REFUSED`).
|
|
2569
2584
|
*
|
|
2570
2585
|
* @example
|
|
2571
2586
|
* ```typescript
|
|
@@ -2935,6 +2950,9 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
|
|
|
2935
2950
|
* const { data } = await staging.content('post').list({ limit: 10 })
|
|
2936
2951
|
*
|
|
2937
2952
|
* const french = relyio.with({ locale: 'fr-FR' }) // ← autocompletes the schema's locales
|
|
2953
|
+
*
|
|
2954
|
+
* // Every request this one sends carries the signed-in End user's token (REL-3882)
|
|
2955
|
+
* const visitor = relyio.with({ getToken: () => session.getToken() })
|
|
2938
2956
|
* ```
|
|
2939
2957
|
*/
|
|
2940
2958
|
with(defaults: ClientDefaults<TSchema>): TypedRelyIOClient<TSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as RichTextHeading, b as RichTextValue, y as RichTextTable, h as RichTextCodeGroup, e as RichTextBlock, l as RichTextInline, t as RichTextNode, w as RichTextSpan, r as RichTextMark, A as AnyRichTextEntryLink, c as RichTextShapeValue } from './rich-text.d-BWc-5gX1.js';
|
|
2
|
-
import {
|
|
2
|
+
import { da as BaseContent } from './define-content-type-C12jh8cY.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The DOM↔field binding contract, as the one pure helper that emits it.
|
|
@@ -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-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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-DeMsaurp.cjs';
|
|
2
|
+
import { aW as EntryMetadata, ay as Reading, da as BaseContent, au as CheckedIncludes, dL as ReadWhere, df as WhereClause, cR as components, az as ReadWith, dr as UpdateInput, aC 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, bc as AssetServedBlocks, dM as CheckedInclude, de as WhereFieldCondition, d8 as AssetFileBlock, db as BaseSingleton, dl as WrittenSingleton, dc as BaseSettingsGroup, dm as WrittenSettingsGroup, aX as InferContentType, aw as ContentReading, b1 as InferSingleton, c$ as paths, d4 as RelyIOConfig, ba as InferAssetType, at as AssetReading, aB as SingletonReading, b6 as InferSettingsGroup, aA as SettingsReading, d5 as RelyIOConfigUpdate, d1 as MergedRelyIOConfig } from './define-content-type-BZ6X8GvL.cjs';
|
|
3
|
+
import { b as SchemaContentTypeNames, k as SchemaEntryOf, f as SchemaLocaleCodes, c as SchemaSingletonNames, y as AggregateBlock, a5 as QueryParameterValue, w as FullTextSearch, e as SchemaQueryNames, a4 as InferQueryParams, a6 as AnyQueryParameters, i as SchemaRecordTypeNames, I as InferRecordType, r as RecordWriteFieldsOf, q as RecordUpdateFieldsOf, h as SchemaAssetTypeNames, g as SchemaSettingsGroupNames } from './define-schema-BPlZl4a2.cjs';
|
|
4
4
|
import { DevUnreadableReason } from './dev-handshake/index.cjs';
|
|
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
|
|
@@ -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
|
|
1483
|
-
*
|
|
1484
|
-
*
|
|
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.
|
|
@@ -2430,11 +2432,19 @@ interface DeployedContentType {
|
|
|
2430
2432
|
}
|
|
2431
2433
|
/**
|
|
2432
2434
|
* 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
|
|
2435
|
+
* its reads and writes are in unless a call names its own, and the End user's token function its
|
|
2436
|
+
* requests ask in place of the parent's (REL-3882). A locale is one the schema declares.
|
|
2434
2437
|
*/
|
|
2435
2438
|
interface ClientDefaults<TSchema extends AnySchemaDefinition | undefined = undefined> {
|
|
2436
2439
|
readonly locale?: LocaleCodeOf<TSchema>;
|
|
2437
2440
|
readonly dataset?: string;
|
|
2441
|
+
/**
|
|
2442
|
+
* The signed-in End user's token, asked for on every request this client sends — and every
|
|
2443
|
+
* request of a client `with()` makes from it that names none — in place of the parent's
|
|
2444
|
+
* `getToken`. `@relyio/react`'s provider hands it Clerk's `useAuth().getToken`. See
|
|
2445
|
+
* `RelyIOConfig.getToken`.
|
|
2446
|
+
*/
|
|
2447
|
+
readonly getToken?: () => Promise<string | null>;
|
|
2438
2448
|
}
|
|
2439
2449
|
/** The locale codes a client's reads may name: the schema's, or any where no schema types it. */
|
|
2440
2450
|
type LocaleCodeOf<TSchema extends AnySchemaDefinition | undefined> = TSchema extends AnySchemaDefinition ? SchemaLocaleCodes<TSchema> : string;
|
|
@@ -2509,7 +2519,10 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
|
|
|
2509
2519
|
* `createClient()` made, which reads its own.
|
|
2510
2520
|
*/
|
|
2511
2521
|
private parent;
|
|
2512
|
-
/**
|
|
2522
|
+
/**
|
|
2523
|
+
* What `with()` gave this client over its parent's: the locale, dataset and End user's token
|
|
2524
|
+
* function it names, and no other.
|
|
2525
|
+
*/
|
|
2513
2526
|
private defaults;
|
|
2514
2527
|
/** The live edge's poll client id: chosen once, when first needed, and kept for this client's life. */
|
|
2515
2528
|
private _liveClientId;
|
|
@@ -2565,7 +2578,9 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
|
|
|
2565
2578
|
* all or none (REL-3774).
|
|
2566
2579
|
*
|
|
2567
2580
|
* A Record is an app's data, written by your server with a secret key and live the moment it
|
|
2568
|
-
* lands
|
|
2581
|
+
* lands. A publishable key reads the Records a Record type's read Policy grants it (spec 4,
|
|
2582
|
+
* REL-3883), and writes them only for the End user whose token it carries, as the type's write
|
|
2583
|
+
* Policy allows (REL-3884); with no token it writes nothing (`PUBLISHABLE_KEY_REFUSED`).
|
|
2569
2584
|
*
|
|
2570
2585
|
* @example
|
|
2571
2586
|
* ```typescript
|
|
@@ -2935,6 +2950,9 @@ declare class TypedRelyIOClient<TSchema extends AnySchemaDefinition | undefined
|
|
|
2935
2950
|
* const { data } = await staging.content('post').list({ limit: 10 })
|
|
2936
2951
|
*
|
|
2937
2952
|
* const french = relyio.with({ locale: 'fr-FR' }) // ← autocompletes the schema's locales
|
|
2953
|
+
*
|
|
2954
|
+
* // Every request this one sends carries the signed-in End user's token (REL-3882)
|
|
2955
|
+
* const visitor = relyio.with({ getToken: () => session.getToken() })
|
|
2938
2956
|
* ```
|
|
2939
2957
|
*/
|
|
2940
2958
|
with(defaults: ClientDefaults<TSchema>): TypedRelyIOClient<TSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as RichTextHeading, b as RichTextValue, y as RichTextTable, h as RichTextCodeGroup, e as RichTextBlock, l as RichTextInline, t as RichTextNode, w as RichTextSpan, r as RichTextMark, A as AnyRichTextEntryLink, c as RichTextShapeValue } from './rich-text.d-BWc-5gX1.cjs';
|
|
2
|
-
import {
|
|
2
|
+
import { da as BaseContent } from './define-content-type-BZ6X8GvL.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The DOM↔field binding contract, as the one pure helper that emits it.
|