@relyio/sdk 0.7.0 → 0.8.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/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { C as ChangesExpiredError, a as Change, b as ChangesExpiredReason } from './index-1G97sNA8.js';
2
- export { A as ActiveSandbox, a2 as AdhocAggregateBlock, a1 as AdhocFetchBlock, a0 as AdhocQueryBuilder, $ as AdhocQueryClient, a7 as AdhocQueryDefinition, a8 as AdhocQueryOptions, aa as AdhocQueryResult, a4 as AdhocSearchBlock, a3 as AggregateMetric, ab as AssetClient, am as AssetEntryResponse, ai as AssetFileBlock, ac as AssetFileBuilder, aj as AssetFileExtracted, ad as AssetUploadBuilder, al as AssetUrls, af as AssetVisibility, w as AutocompleteBuilder, G as AutocompleteResponse, F as AutocompleteSuggestion, U as BatchBuilder, Q as BatchClient, V as BatchMethod, W as BatchOperation, Y as BatchOperationResult, X as BatchOptions, _ as BatchResponse, Z as BatchSummary, k as ChangesHeadOptions, l as ChangesOptions, r as ChildrenOptions, e as ClientSchema, i as ConditionalWriteOptions, aq as ConfirmInput, ar as ConfirmResult, q as ContentByIdBuilder, m as ContentClient, p as ContentQueryBuilder, au as CreateAssetOptions, E as ExtendedQueryResult, ah as FileBackend, aE as FileErrorCode, ag as FileStatus, ak as FileStatusResult, aG as FileUploadError, aF as FileUploadErrorCode, aI as FileValidationConstraints, aH as FileValidationError, a5 as FilterValue, a6 as FullTextConfig, H as HttpClient, aw as MultipartCreateResult, ax as MultipartPart, ay as MultipartTarget, an as PopulatedAssetReference, ao as PresignInput, ap as PresignResult, P as Project, a9 as QueryMetadata, R as Register, f as RegisteredSchema, as as ResolveUrlInput, at as ResolveUrlResult, aB as ResourceConflictError, aC as ResourceExpiredError, aA as ResourceNotFoundError, j as RetryableWriteOptions, S as SandboxState, v as SearchBuilder, u as SearchClient, O as SearchEntry, L as SearchFields, K as SearchFilter, B as SearchHitMetadata, y as SearchMode, D as SearchResponse, z as SearchResultItem, M as SearchSort, N as SearchTypeName, g as SendOptions, o as SettingsClient, t as SettingsFetchOptions, x as SimilarBuilder, J as SimilarResponse, I as SimilarResult, n as SingletonClient, s as SingletonFetchOptions, d as TypedClientConfig, T as TypedRelyIOClient, az as UploadProgress, av as WaitUntilReadyOptions, c as createClient, c as default, h as entityTagOf, ae as isAssetEntry, aD as isResourceNotFound, aJ as validateFile } from './index-1G97sNA8.js';
1
+ import { C as Change, a as ChangesExpiredError, b as ChangesExpiredReason } from './index-yRJ2IqM_.js';
2
+ export { A as ActiveSandbox, a5 as AdhocAggregateBlock, a4 as AdhocFetchBlock, a3 as AdhocQueryBuilder, a2 as AdhocQueryClient, aa as AdhocQueryDefinition, ab as AdhocQueryOptions, ad as AdhocQueryResult, a7 as AdhocSearchBlock, a6 as AggregateMetric, ae as AssetClient, ap as AssetEntryResponse, al as AssetFileBlock, af as AssetFileBuilder, am as AssetFileExtracted, ag as AssetUploadBuilder, ao as AssetUrls, ai as AssetVisibility, x as AutocompleteBuilder, J as AutocompleteResponse, I as AutocompleteSuggestion, X as BatchBuilder, W as BatchClient, Y as BatchMethod, Z as BatchOperation, $ as BatchOperationResult, _ as BatchOptions, a1 as BatchResponse, a0 as BatchSummary, k as ChangesHeadOptions, l as ChangesOptions, s as ChildrenOptions, e as ClientSchema, i as ConditionalWriteOptions, at as ConfirmInput, au as ConfirmResult, r as ContentByIdBuilder, n as ContentClient, q as ContentQueryBuilder, ax as CreateAssetOptions, E as ExtendedQueryResult, F as FeedChange, ak as FileBackend, aH as FileErrorCode, aj as FileStatus, an as FileStatusResult, aJ as FileUploadError, aI as FileUploadErrorCode, aL as FileValidationConstraints, aK as FileValidationError, a8 as FilterValue, a9 as FullTextConfig, H as HttpClient, L as LIVE_KEEPALIVE_INTERVAL_MS, m as LiveChangesOptions, az as MultipartCreateResult, aA as MultipartPart, aB as MultipartTarget, aq as PopulatedAssetReference, ar as PresignInput, as as PresignResult, P as Project, ac as QueryMetadata, R as Register, f as RegisteredSchema, av as ResolveUrlInput, aw as ResolveUrlResult, aE as ResourceConflictError, aF as ResourceExpiredError, aD as ResourceNotFoundError, j as RetryableWriteOptions, S as SandboxState, w as SearchBuilder, v as SearchClient, V as SearchEntry, O as SearchFields, N as SearchFilter, D as SearchHitMetadata, z as SearchMode, G as SearchResponse, B as SearchResultItem, Q as SearchSort, U as SearchTypeName, g as SendOptions, p as SettingsClient, u as SettingsFetchOptions, y as SimilarBuilder, M as SimilarResponse, K as SimilarResult, o as SingletonClient, t as SingletonFetchOptions, d as TypedClientConfig, T as TypedRelyIOClient, aC as UploadProgress, ay as WaitUntilReadyOptions, c as createClient, c as default, h as entityTagOf, ah as isAssetEntry, aG as isResourceNotFound, aM as validateFile } from './index-yRJ2IqM_.js';
3
3
  export { fields } from './schema/index.js';
4
- import { S as SDKError, B as BaseContent } from './index-BOQIHnsh.js';
5
- export { b as ApiMethod, A as ApiPath, v as ApiResponse, c as ApiSuccessBody, z as BaseValidationError, s as CacheConfig, x as CacheStrategy, j as ContentQueryResult, n as ContentTypeSchema, C as CreateInput, l as CustomQuery, D as DebugConfig, E as Environment, o as FieldOptions, F as FieldTypeName, I as InvalidPayloadError, L as LogLevel, M as MatchRouteOptions, P as PerformanceMetrics, Q as QueryOptions, t as RealtimeConfig, q as RealtimeEvent, p as RealtimeEventType, R as RelyIOConfig, a as RelyIOConfigUpdate, u as RequestConfig, w as RetryConfig, d as RouteMatch, k as SingletonContent, i as SortOptions, r as SubscriptionOptions, U as UpdateInput, G as ValidationError, V as ValidationRule, y as ValidationViolation, g as WhereClause, f as WhereFieldCondition, h as WhereOperator, e as WhereScalar, W as Wire, m as matchRoute } from './index-BOQIHnsh.js';
4
+ import { S as SDKError, B as BaseContent } from './index-Cv4tmcrw.js';
5
+ export { c as ApiMethod, A as ApiPath, w as ApiResponse, d as ApiSuccessBody, H as BaseValidationError, t as CacheConfig, y as CacheStrategy, k as ContentQueryResult, o as ContentTypeSchema, C as CreateInput, n as CustomQuery, D as DebugConfig, E as Environment, p as FieldOptions, F as FieldTypeName, J as InvalidPayloadError, L as LiveWebSocket, b as LiveWebSocketConstructor, z as LogLevel, M as MatchRouteOptions, P as PerformanceMetrics, Q as QueryOptions, u as RealtimeConfig, r as RealtimeEvent, q as RealtimeEventType, R as RelyIOConfig, a as RelyIOConfigUpdate, v as RequestConfig, x as RetryConfig, e as RouteMatch, l as SingletonContent, j as SortOptions, s as SubscriptionOptions, U as UpdateInput, I as ValidationError, V as ValidationRule, G as ValidationViolation, h as WhereClause, g as WhereFieldCondition, i as WhereOperator, f as WhereScalar, W as Wire, m as matchRoute } from './index-Cv4tmcrw.js';
6
+ import { VisitorRetry } from './live-visitor.js';
6
7
  export { camelToSnake, createDeferred, debounce, deepClone, generateId, isBrowser, isNode, isPlainObject, isValidEmail, isValidUrl, mergeDeep, omit, pick, retry, sleep, snakeToCamel, throttle, toSafeString } from './utils/index.js';
7
- import { Q as EntryMetadata } from './define-content-type-DiVpbwNs.js';
8
- export { a5 as AssetTypeConfig, a9 as AssetTypeDefinition, n as BaseFieldConfig, M as ContentTypeConfig, N as ContentTypeConfigWithFields, O as ContentTypeConfigWithFieldsets, P as ContentTypeDefinition, c as FieldDefinition, b as FieldRule, v as FieldSchemaContext, p as FieldType, F as FieldUIConfig, w as FieldValue, x as FieldValues, K as Fieldset, ad as FileKindConfig, ar as FileScanConfig, aq as FileUploadConfig, aj as ImageExifConfig, ab as ImageKindConfig, ai as ImageSourceConfig, ah as ImageUploadConfig, aa as InferAssetType, W as InferContentType, a3 as InferSingleton, a2 as InferSingletonContentType, X as LocalePublicationFields, L as LocalizationConfig, a0 as SingletonContentTypeDefinition, a1 as SingletonMetadata, G as UnresolvedComponent, z as UnresolvedEntry, ak as VariantDefinition, an as VideoCaptionsConfig, ao as VideoDownloadConfig, ac as VideoKindConfig, am as VideoPosterConfig, al as VideoUploadConfig, ap as VideoWatermarkConfig, a4 as defineAssetType, H as defineContentType, Z as defineSingleton, Y as defineSingletonContentType, J as fieldset } from './define-content-type-DiVpbwNs.js';
9
- export { aa as AggregateBlock, C as ComponentConfig, s as ComponentDefinition, t as ComponentMetadata, a9 as FetchBlock, an as FilterDefinition, aj as IncludeDefinition, ax as InferQueryParams, aw as InferQueryResponse, a5 as QueryConfig, a6 as QueryDefinition, h as SchemaAssetTypeNames, S as SchemaConfig, b as SchemaContentTypeNames, a as SchemaDefinition, i as SchemaEntry, j as SchemaEntryOf, f as SchemaLocaleCodes, e as SchemaQueryNames, g as SchemaSettingsGroupNames, c as SchemaSingletonNames, ab as SearchBlock, am as SelectMapping, x as SettingsGroupConfig, y as SettingsGroupDefinition, ah as SortCondition, ac as WhereCondition, r as defineComponent, a4 as defineQuery, d as defineSchema, w as defineSettingsGroup } from './define-schema-C-5an28C.js';
8
+ import { Q as EntryMetadata } from './define-content-type-cEGjIwT5.js';
9
+ export { a5 as AssetTypeConfig, a9 as AssetTypeDefinition, n as BaseFieldConfig, M as ContentTypeConfig, N as ContentTypeConfigWithFields, O as ContentTypeConfigWithFieldsets, P as ContentTypeDefinition, c as FieldDefinition, b as FieldRule, v as FieldSchemaContext, p as FieldType, F as FieldUIConfig, w as FieldValue, x as FieldValues, K as Fieldset, ad as FileKindConfig, ar as FileScanConfig, aq as FileUploadConfig, aj as ImageExifConfig, ab as ImageKindConfig, ai as ImageSourceConfig, ah as ImageUploadConfig, aa as InferAssetType, W as InferContentType, a3 as InferSingleton, a2 as InferSingletonContentType, X as LocalePublicationFields, L as LocalizationConfig, a0 as SingletonContentTypeDefinition, a1 as SingletonMetadata, G as UnresolvedComponent, z as UnresolvedEntry, ak as VariantDefinition, an as VideoCaptionsConfig, ao as VideoDownloadConfig, ac as VideoKindConfig, am as VideoPosterConfig, al as VideoUploadConfig, ap as VideoWatermarkConfig, a4 as defineAssetType, H as defineContentType, Z as defineSingleton, Y as defineSingletonContentType, J as fieldset } from './define-content-type-cEGjIwT5.js';
10
+ export { aa as AggregateBlock, C as ComponentConfig, s as ComponentDefinition, t as ComponentMetadata, a9 as FetchBlock, an as FilterDefinition, aj as IncludeDefinition, ax as InferQueryParams, aw as InferQueryResponse, a5 as QueryConfig, a6 as QueryDefinition, h as SchemaAssetTypeNames, S as SchemaConfig, b as SchemaContentTypeNames, a as SchemaDefinition, i as SchemaEntry, j as SchemaEntryOf, f as SchemaLocaleCodes, e as SchemaQueryNames, g as SchemaSettingsGroupNames, c as SchemaSingletonNames, ab as SearchBlock, am as SelectMapping, x as SettingsGroupConfig, y as SettingsGroupDefinition, ah as SortCondition, ac as WhereCondition, r as defineComponent, a4 as defineQuery, d as defineSchema, w as defineSettingsGroup } from './define-schema-BPj2srgh.js';
10
11
  import './dev-handshake/index.js';
11
12
 
12
13
  /**
@@ -44,25 +45,35 @@ declare const isPublishableKey: (apiKey: string | undefined) => boolean;
44
45
  * state mean to it.
45
46
  *
46
47
  * **The transport is a parameter.** A source opens from a cursor and yields
47
- * changes. Today that is `relyio.changes()`, the long-poll, with whatever filter
48
- * the caller binds in. LV5.2 (REL-1158, `live-layer-spec.md` LV5) adds a
49
- * second — a WebSocket to the live edge, falling back to polling the edge when a
50
- * socket cannot open — and hands it to this loop, with a classifier for its
51
- * refusal close codes. That source calls `opened()` on the socket's `open`: a
52
- * Worker deploy drops every socket, and a quiet dataset delivers no change, so
53
- * without it each deploy would double the next reconnect's wait up to thirty
54
- * seconds. With it, every drop after a healthy connection waits the base
55
- * ceiling. The loop, and every handler a surface passes it, stay as they are.
56
- *
57
- * The long-poll does not call `opened()`: `relyio.changes()` takes the public
58
- * `ChangesOptions`, which does not carry it, so its back-off resets only on a
59
- * delivered change — as it did before this loop existed.
48
+ * changes. There are two: `relyio.changes()`, the long-poll over `/v1/changes`,
49
+ * and `relyio.liveChanges()` (LV5.2, REL-1158), a WebSocket to the live edge that
50
+ * polls the edge when a socket cannot open — each with whatever filter the caller
51
+ * binds in. The edge's refusals are `LiveEdgeError`s, which the default
52
+ * classifier reads, so neither needs a classifier of its own.
53
+ *
54
+ * The edge source calls `opened()` on the feed's `feed.opened` frame — not the
55
+ * socket's `open` event, which a refusal fires too, because the edge accepts a
56
+ * socket to close it with a code — and on each answered poll. A Worker deploy
57
+ * drops every socket, and a quiet dataset delivers no change, so without it each
58
+ * deploy would double the next reconnect's wait up to thirty seconds. It calls
59
+ * `reached()` with the cursor `feed.opened` names, so a socket dropped before its
60
+ * first change reconnects from that cursor instead of re-reading everything.
61
+ *
62
+ * The long-poll calls neither: `relyio.changes()` takes the public
63
+ * `ChangesOptions`, which carries neither, so its back-off resets only on a
64
+ * delivered change and a failure before its first change resyncs — as before
65
+ * this loop existed.
60
66
  */
61
67
 
62
68
  /** The ceiling of the first wait after a failure worth retrying; doubled per consecutive failure. */
63
69
  declare const FOLLOW_RETRY_BASE_MS = 1000;
64
70
  /** The ceiling never doubles past this. A server's hint is not capped by it. */
65
71
  declare const FOLLOW_RETRY_MAX_MS = 30000;
72
+ /**
73
+ * A failure that backs off (a verdict's `backOffMs`) never waits longer than this, however often it
74
+ * repeats. A server's hint is not capped by it.
75
+ */
76
+ declare const FOLLOW_BACK_OFF_MAX_MS: number;
66
77
  /** What the loop hands a source each time it opens one. */
67
78
  interface ChangeSourceOptions {
68
79
  /**
@@ -91,11 +102,29 @@ interface ChangeSourceOptions {
91
102
  * already failed changes nothing.
92
103
  */
93
104
  readonly opened: () => void;
105
+ /**
106
+ * Call with a position the transport has reached without a change to carry
107
+ * it — the cursor a socket's `feed.opened` names, or a poll's answer with no
108
+ * changes. The loop reopens from it after a failure, as it would from a
109
+ * delivered change's cursor, so a connection dropped before its first change
110
+ * replays from there rather than re-reading everything.
111
+ *
112
+ * Call it only between changes, once every change before that position has
113
+ * been yielded and the loop has asked for the next — a position ahead of a
114
+ * change still being applied would skip that change on the next open. A call
115
+ * from an open that has already failed changes nothing.
116
+ */
117
+ readonly reached: (cursor: string) => void;
94
118
  }
95
119
  /**
96
120
  * A transport for the changes feed: open from a position and yield each change,
97
121
  * in feed order, as ids (`INV-SS-CHANGE-IS-IDS`).
98
122
  *
123
+ * `C` is what it yields. `relyio.changes()` and `relyio.liveChanges()` yield a
124
+ * `FeedChange` — a `Change` with the position a refetch for it names
125
+ * (`fresh`) — and the loop hands `onChange` exactly that. A source of plain
126
+ * `Change`s is followed alike and hands plain `Change`s on.
127
+ *
99
128
  * A source ends **only** when its signal aborts. Every other end — a dropped
100
129
  * connection, a refusal, a socket closed by a deploy — is thrown, so the loop's
101
130
  * classifier can decide between reconnecting and stopping. `relyio.changes()` is
@@ -105,7 +134,7 @@ interface ChangeSourceOptions {
105
134
  * const source: ChangeSource = from => relyio.changes({ ...from, types: ['post'] })
106
135
  * ```
107
136
  */
108
- type ChangeSource = (options: ChangeSourceOptions) => AsyncIterable<Change>;
137
+ type ChangeSource<C extends Change = Change> = (options: ChangeSourceOptions) => AsyncIterable<C>;
109
138
  /**
110
139
  * Why everything derived from the feed may be stale, so the consumer re-reads
111
140
  * what it holds:
@@ -113,9 +142,10 @@ type ChangeSource = (options: ChangeSourceOptions) => AsyncIterable<Change>;
113
142
  * - `expired` — the cursor could no longer be replayed. The source has resynced
114
143
  * to the current position and yields nothing after it until the handler
115
144
  * settles.
116
- * - `no-cursor` — the source failed before any change arrived, so there is no
117
- * cursor to reopen from and whatever happened meanwhile cannot be replayed. The
118
- * loop reopens from the current position once the handler settles.
145
+ * - `no-cursor` — the source failed before any change arrived or any position
146
+ * was `reached()`, so there is no cursor to reopen from and whatever happened
147
+ * meanwhile cannot be replayed. The loop reopens from the current position once
148
+ * the handler settles.
119
149
  */
120
150
  type FollowResync = {
121
151
  readonly cause: 'expired';
@@ -148,19 +178,14 @@ type FollowState = {
148
178
  readonly kind: 'stopped';
149
179
  readonly error: unknown;
150
180
  };
151
- /**
152
- * A classifier's answer for one failure. `afterMs` is the server's hint — HTTP's
153
- * `Retry-After`, a socket's close code — and a floor under the loop's own
154
- * back-off: the wait is never shorter than it, and a hint longer than
155
- * {@link FOLLOW_RETRY_MAX_MS} is waited out in full.
156
- */
157
181
  type FollowVerdict = {
158
182
  readonly retry: false;
159
183
  } | {
160
184
  readonly retry: true;
161
185
  readonly afterMs?: number;
186
+ readonly backOffMs?: number;
162
187
  };
163
- interface FollowOptions {
188
+ interface FollowOptions<C extends Change = Change> {
164
189
  /** Where to start: a change's cursor from an earlier follow. Omitted, the current position. */
165
190
  readonly since?: string;
166
191
  /** Ends the loop, which then resolves; a wait in progress ends at once. */
@@ -170,9 +195,16 @@ interface FollowOptions {
170
195
  * cursor counts as reached — a change whose handler has not settled is
171
196
  * replayed by the next open, never skipped. A throw is a failure like the
172
197
  * source's own, and the classifier sees it.
198
+ *
199
+ * It is handed what the source yields: from `relyio.changes()` or
200
+ * `relyio.liveChanges()`, a `FeedChange`, whose `fresh` a refetch names.
201
+ */
202
+ readonly onChange: (change: C) => void | Promise<void>;
203
+ /**
204
+ * Re-read everything derived from the feed. Awaited; see {@link FollowResync}.
205
+ * An `expired` resync's error carries the position it resynced to as `fresh`,
206
+ * which the re-reads name as a change's refetch does.
173
207
  */
174
- readonly onChange: (change: Change) => void | Promise<void>;
175
- /** Re-read everything derived from the feed. Awaited; see {@link FollowResync}. */
176
208
  readonly onResync: (resync: FollowResync) => void | Promise<void>;
177
209
  /** Observes each transition; see {@link FollowState}. It must not throw. */
178
210
  readonly onState?: (state: FollowState) => void;
@@ -210,6 +242,11 @@ type FollowEnd = {
210
242
  * service asked for: `Retry-After`, or a rate limit's `resetAt`. Anything else —
211
243
  * a refused key, a malformed request, a defect — stops the loop, because
212
244
  * retrying would meet the same refusal forever.
245
+ *
246
+ * A `LiveEdgeError` says what to do itself, from the edge's own tables: `stop`,
247
+ * `retry` (carrying a refused poll's `Retry-After`), or `back-off` — at least
248
+ * `VISITOR_ADMISSION_RETRY_AFTER_SECONDS` on the doubling schedule `backOffMs`
249
+ * describes.
213
250
  */
214
251
  declare function classifyFollowFailure(error: unknown): FollowVerdict;
215
252
  /**
@@ -221,12 +258,13 @@ declare function classifyFollowFailure(error: unknown): FollowVerdict;
221
258
  * - **A failure worth retrying** (`classify`) reopens the source after a
222
259
  * jittered, doubling wait — a ceiling of {@link FOLLOW_RETRY_BASE_MS} doubled
223
260
  * per consecutive failure up to {@link FOLLOW_RETRY_MAX_MS}, shortened by the
224
- * jitter to no less than half of it, and never below the server's hint. A
261
+ * jitter to no less than half of it, and never below the server's hint; a
262
+ * verdict's `backOffMs` puts it on the longer schedule that field describes. A
225
263
  * delivered change resets the doubling, and so does the source calling
226
264
  * `opened()` once its transport is up. The source reopens from the last
227
- * change's cursor so nothing is skipped; with no change seen yet there is none,
228
- * so `onResync({ cause: 'no-cursor' })` runs first and the source reopens from
229
- * the current position.
265
+ * change's cursor — or the last position it `reached()` — so nothing is
266
+ * skipped; with neither there is none, so `onResync({ cause: 'no-cursor' })`
267
+ * runs first and the source reopens from the current position.
230
268
  * - **Anything else** stops the loop: reported once as `stopped`, and returned.
231
269
  *
232
270
  * It never rejects. An abort — in the source, in a handler, or during a wait —
@@ -237,13 +275,14 @@ declare function classifyFollowFailure(error: unknown): FollowVerdict;
237
275
  * const controller = new AbortController()
238
276
  * const end = await followChanges(from => relyio.changes({ ...from, types: ['post'] }), {
239
277
  * signal: controller.signal,
240
- * onChange: change => refetch(change.contentType, change.entryId),
241
- * onResync: () => refetchEverything(),
278
+ * onChange: change => refetch(change.contentType, change.entryId, change.fresh),
279
+ * onResync: resync =>
280
+ * refetchEverything(resync.cause === 'expired' ? resync.expired.fresh : undefined),
242
281
  * })
243
282
  * if (end.kind === 'stopped') console.error(end.error)
244
283
  * ```
245
284
  */
246
- declare function followChanges(source: ChangeSource, options: FollowOptions): Promise<FollowEnd>;
285
+ declare function followChanges<C extends Change>(source: ChangeSource<C>, options: FollowOptions<C>): Promise<FollowEnd>;
247
286
 
248
287
  /**
249
288
  * Network-related errors
@@ -447,6 +486,77 @@ declare class UnknownContractError extends SDKError {
447
486
  getUserMessage(): string;
448
487
  }
449
488
 
489
+ /**
490
+ * What ended a subscription at RelyIO's live edge (`relyio.liveChanges()`):
491
+ *
492
+ * - `closed` — the edge closed the socket, or it dropped. `code` and `reason` are the close's. A
493
+ * refusal is a socket accepted and closed at once, because a browser cannot read a refused
494
+ * handshake's status (`@relyio/api-contract`'s `VISITOR_CLOSE_CODES`); a Worker deploy drops every
495
+ * socket with a code of its own.
496
+ * - `refused` — a poll was refused with this contract code (`VISITOR_POLL_ROUTE`). The mapped error
497
+ * is the `cause`.
498
+ * - `lost` — the socket stopped answering its keepalive, so the connection is presumed dead.
499
+ * - `unreadable` — the edge sent a frame or a poll answer the wire does not declare.
500
+ * - `needs-publishable-key` — the client holds no publishable key (`rly_pub_…`), so nothing was
501
+ * sent: a secret or preview key never travels to the edge in a URL.
502
+ * - `needs-live-url` — the client cannot name the edge: `liveUrl` is not set and cannot be derived
503
+ * from `baseUrl`, or it is not a URL. Nothing was sent.
504
+ */
505
+ type LiveEdgeEnd = {
506
+ readonly kind: 'closed';
507
+ readonly code: number;
508
+ readonly reason: string;
509
+ } | {
510
+ readonly kind: 'refused';
511
+ readonly code: string;
512
+ } | {
513
+ readonly kind: 'lost';
514
+ } | {
515
+ readonly kind: 'unreadable';
516
+ readonly what: string;
517
+ } | {
518
+ readonly kind: 'needs-publishable-key';
519
+ } | {
520
+ readonly kind: 'needs-live-url';
521
+ };
522
+ /**
523
+ * Every end of a live-edge subscription other than its signal aborting, and what to do about it.
524
+ *
525
+ * `retry` is the wire's own answer, read from `@relyio/api-contract`'s tables rather than restated
526
+ * here — `VISITOR_CLOSE_RETRY` for a close, `VISITOR_POLL_RETRY` for a refused poll:
527
+ *
528
+ * - `stop` — the same request meets the same answer (a refused key, origin or dataset, a malformed
529
+ * query, a configuration the client lacks). `retryable` is `false`.
530
+ * - `retry` — a dropped connection, or the edge could not decide just now: reconnect with back-off
531
+ * and jitter, from the last cursor.
532
+ * - `back-off` — the project, or this address, holds as many connections as it may (REL-1159). Wait
533
+ * at least `VISITOR_ADMISSION_RETRY_AFTER_SECONDS`, with jitter, doubling while it repeats — and do
534
+ * not fall back to polling, which the same admission refuses.
535
+ *
536
+ * `followChanges()`'s default classifier reads it, so a loop over `liveChanges()` needs no
537
+ * classifier of its own.
538
+ */
539
+ declare class LiveEdgeError extends SDKError {
540
+ readonly code = "LIVE_EDGE_ENDED";
541
+ readonly retryable: boolean;
542
+ readonly end: LiveEdgeEnd;
543
+ readonly retry: VisitorRetry;
544
+ /** A refused poll's `Retry-After`, in milliseconds, where it carried a readable one. */
545
+ readonly retryAfterMs: number | undefined;
546
+ constructor(message: string, end: LiveEdgeEnd, retry: VisitorRetry, options?: {
547
+ readonly statusCode?: number;
548
+ readonly cause?: Error;
549
+ readonly retryAfterMs?: number;
550
+ readonly context?: Record<string, unknown>;
551
+ });
552
+ /**
553
+ * The base class rebuilds an error through its own four-argument constructor, which this class
554
+ * does not have; rebuilt that way, `end` would be a string and `retry` a number.
555
+ */
556
+ withContext(context: Record<string, unknown>): this;
557
+ getUserMessage(): string;
558
+ }
559
+
450
560
  /**
451
561
  * Map a RelyIO refusal onto an SDK error class.
452
562
  *
@@ -895,4 +1005,4 @@ declare function snapToLadder(value: number): number;
895
1005
 
896
1006
  declare const VERSION = "__VERSION__";
897
1007
 
898
- export { AuthorizationError, BaseContent, Change, type ChangeSource, type ChangeSourceOptions, ChangesExpiredError, ChangesExpiredReason, ConnectionError, EntryMetadata, ErrorMapper, FOLLOW_RETRY_BASE_MS, FOLLOW_RETRY_MAX_MS, type FollowEnd, type FollowOptions, type FollowResync, type FollowState, type FollowVerdict, IMAGE_LADDER, InvalidApiKeyError, type LanguageSwitcherOption, type LanguageSwitcherOptions, type LocaleMetadata, type LocaleStatus, type LocalizedEntry, MethodNotAllowedError, MissingApiKeyError, NetworkError, PUBLISHABLE_KEY_PREFIX, PayloadTooLargeError, PlanFeatureUnavailableError, RELYIO_CHANGE_EVENT, RELYIO_RESYNC_EVENT, RateLimitError, ReadOnlyKeyError, type RelyIOChangeDetail, type RelyIOFieldAttributes, type RelyIOFieldName, type RelyIOResyncDetail, SDKError, ServerError, ServiceIndeterminateError, TimeoutError, TransactionRolledBackError, type TranslationCompleteness, UnknownContractError, UsageQuotaExceededError, VERSION, buildLanguageSwitcher, classifyFollowFailure, estimateTranslationCompleteness, followChanges, getAllLocalizedValues, getAvailableLocaleCodes, getDefaultLocale, getFallbackFields, getFieldFallbackLocale, getLocalizedField, getPublishedLocaleCodes, getRequestedLocale, hasLocale, isFieldFallback, isPublishableKey, isPublishedInLocale, localeHelpers, needsTranslation, relyioField, snapToLadder };
1008
+ export { AuthorizationError, BaseContent, Change, type ChangeSource, type ChangeSourceOptions, ChangesExpiredError, ChangesExpiredReason, ConnectionError, EntryMetadata, ErrorMapper, FOLLOW_BACK_OFF_MAX_MS, FOLLOW_RETRY_BASE_MS, FOLLOW_RETRY_MAX_MS, type FollowEnd, type FollowOptions, type FollowResync, type FollowState, type FollowVerdict, IMAGE_LADDER, InvalidApiKeyError, type LanguageSwitcherOption, type LanguageSwitcherOptions, type LiveEdgeEnd, LiveEdgeError, type LocaleMetadata, type LocaleStatus, type LocalizedEntry, MethodNotAllowedError, MissingApiKeyError, NetworkError, PUBLISHABLE_KEY_PREFIX, PayloadTooLargeError, PlanFeatureUnavailableError, RELYIO_CHANGE_EVENT, RELYIO_RESYNC_EVENT, RateLimitError, ReadOnlyKeyError, type RelyIOChangeDetail, type RelyIOFieldAttributes, type RelyIOFieldName, type RelyIOResyncDetail, SDKError, ServerError, ServiceIndeterminateError, TimeoutError, TransactionRolledBackError, type TranslationCompleteness, UnknownContractError, UsageQuotaExceededError, VERSION, buildLanguageSwitcher, classifyFollowFailure, estimateTranslationCompleteness, followChanges, getAllLocalizedValues, getAvailableLocaleCodes, getDefaultLocale, getFallbackFields, getFieldFallbackLocale, getLocalizedField, getPublishedLocaleCodes, getRequestedLocale, hasLocale, isFieldFallback, isPublishableKey, isPublishedInLocale, localeHelpers, needsTranslation, relyioField, snapToLadder };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { defineAssetType, defineComponent, defineContentType, defineQuery, defineSchema, defineSettingsGroup, defineSingleton, defineSingletonContentType, fields, fieldset } from './chunk-YEJUMW4X.js';
2
- import { SDKError, serviceInstructedDelayMs, isAborted, sleep } from './chunk-GYHAVYND.js';
3
- export { AdhocQueryBuilder, AdhocQueryClient, AssetClient, AssetFileBuilder, AssetUploadBuilder, AuthorizationError, AutocompleteBuilder, BaseValidationError, BatchBuilder, BatchClient, ChangesExpiredError, ConnectionError, ContentByIdBuilder, ContentClient, ContentQueryBuilder, ErrorMapper, FileUploadError, FileValidationError, HttpClient, InvalidApiKeyError, InvalidPayloadError, MethodNotAllowedError, MissingApiKeyError, NetworkError, PayloadTooLargeError, PlanFeatureUnavailableError, RateLimitError, ReadOnlyKeyError, ResourceConflictError, ResourceExpiredError, ResourceNotFoundError, SDKError, SearchBuilder, SearchClient, ServerError, ServiceIndeterminateError, SettingsClient, SimilarBuilder, SingletonClient, TimeoutError, TransactionRolledBackError, TypedRelyIOClient, UnknownContractError, UsageQuotaExceededError, ValidationError, createClient, createClient as default, entityTagOf, isAssetEntry, isResourceNotFound, matchRoute, validateFile } from './chunk-GYHAVYND.js';
2
+ import { LiveEdgeError, SDKError, serviceInstructedDelayMs, VISITOR_ADMISSION_RETRY_AFTER_SECONDS, isAborted, sleep } from './chunk-QFHVF3YF.js';
3
+ export { AdhocQueryBuilder, AdhocQueryClient, AssetClient, AssetFileBuilder, AssetUploadBuilder, AuthorizationError, AutocompleteBuilder, BaseValidationError, BatchBuilder, BatchClient, ChangesExpiredError, ConnectionError, ContentByIdBuilder, ContentClient, ContentQueryBuilder, ErrorMapper, FileUploadError, FileValidationError, HttpClient, InvalidApiKeyError, InvalidPayloadError, LIVE_KEEPALIVE_INTERVAL_MS, LiveEdgeError, MethodNotAllowedError, MissingApiKeyError, NetworkError, PUBLISHABLE_KEY_PREFIX, PayloadTooLargeError, PlanFeatureUnavailableError, RateLimitError, ReadOnlyKeyError, ResourceConflictError, ResourceExpiredError, ResourceNotFoundError, SDKError, SearchBuilder, SearchClient, ServerError, ServiceIndeterminateError, SettingsClient, SimilarBuilder, SingletonClient, TimeoutError, TransactionRolledBackError, TypedRelyIOClient, UnknownContractError, UsageQuotaExceededError, ValidationError, createClient, createClient as default, entityTagOf, isAssetEntry, isPublishableKey, isResourceNotFound, matchRoute, validateFile } from './chunk-QFHVF3YF.js';
4
4
  import './chunk-BBUB7C2Z.js';
5
5
  import './chunk-IY5LSKXU.js';
6
6
  export { camelToSnake, createDeferred, debounce, deepClone, generateId, isBrowser, isNode, isPlainObject, isValidEmail, isValidUrl, mergeDeep, omit, pick, retry, sleep, snakeToCamel, throttle, toSafeString } from './chunk-H6IBQSMM.js';
@@ -8,19 +8,39 @@ import { __name } from './chunk-XQ4QHWZE.js';
8
8
 
9
9
  /* RelyIO SDK - Built with ❤️ by the RelyIO Team */
10
10
 
11
- // src/config/key-kind.ts
12
- var PUBLISHABLE_KEY_PREFIX = "rly_pub_";
13
- var isPublishableKey = /* @__PURE__ */ __name((apiKey) => apiKey?.startsWith(PUBLISHABLE_KEY_PREFIX) === true, "isPublishableKey");
14
-
15
11
  // src/changes/follow.ts
16
12
  var FOLLOW_RETRY_BASE_MS = 1e3;
17
13
  var FOLLOW_RETRY_MAX_MS = 3e4;
14
+ var FOLLOW_BACK_OFF_MAX_MS = 15 * 6e4;
15
+ function stopOnUnknownAnswer(_answer) {
16
+ return { retry: false };
17
+ }
18
+ __name(stopOnUnknownAnswer, "stopOnUnknownAnswer");
18
19
  function classifyFollowFailure(error) {
20
+ if (error instanceof LiveEdgeError) return liveEdgeVerdict(error);
19
21
  if (!(error instanceof SDKError) || !error.retryable) return { retry: false };
20
22
  const afterMs = serviceInstructedDelayMs(error, Date.now());
21
23
  return afterMs === void 0 ? { retry: true } : { retry: true, afterMs };
22
24
  }
23
25
  __name(classifyFollowFailure, "classifyFollowFailure");
26
+ function liveEdgeVerdict(error) {
27
+ const hint = error.retryAfterMs === void 0 ? {} : { afterMs: error.retryAfterMs };
28
+ switch (error.retry) {
29
+ case "stop": {
30
+ return { retry: false };
31
+ }
32
+ case "retry": {
33
+ return { retry: true, ...hint };
34
+ }
35
+ case "back-off": {
36
+ return { retry: true, ...hint, backOffMs: VISITOR_ADMISSION_RETRY_AFTER_SECONDS * 1e3 };
37
+ }
38
+ default: {
39
+ return stopOnUnknownAnswer(error.retry);
40
+ }
41
+ }
42
+ }
43
+ __name(liveEdgeVerdict, "liveEdgeVerdict");
24
44
  async function followChanges(source, options) {
25
45
  const { signal, onChange, onResync } = options;
26
46
  const classify = options.classify ?? classifyFollowFailure;
@@ -54,7 +74,10 @@ async function followChanges(source, options) {
54
74
  onExpired: /* @__PURE__ */ __name((expired) => resync({ cause: "expired", expired }), "onExpired"),
55
75
  opened: /* @__PURE__ */ __name(() => {
56
76
  if (current === open) failures = 0;
57
- }, "opened")
77
+ }, "opened"),
78
+ reached: /* @__PURE__ */ __name((cursor) => {
79
+ if (current === open) since = cursor;
80
+ }, "reached")
58
81
  });
59
82
  for await (const change of changes) {
60
83
  if (isAborted(signal)) return { kind: "aborted", since };
@@ -78,7 +101,7 @@ async function followChanges(source, options) {
78
101
  return { kind: "stopped", since, error };
79
102
  }
80
103
  failures += 1;
81
- const retryInMs = retryDelayMs(failures, verdict.afterMs, random);
104
+ const retryInMs = retryDelayMs(failures, verdict, random);
82
105
  report({ kind: "reconnecting", error, retryInMs });
83
106
  await sleep(retryInMs, signal);
84
107
  if (since === void 0) unanchored = true;
@@ -86,10 +109,12 @@ async function followChanges(source, options) {
86
109
  }
87
110
  }
88
111
  __name(followChanges, "followChanges");
89
- function retryDelayMs(failures, hintMs, random) {
90
- const ceiling = Math.min(FOLLOW_RETRY_BASE_MS * 2 ** (failures - 1), FOLLOW_RETRY_MAX_MS);
112
+ function retryDelayMs(failures, verdict, random) {
113
+ const { afterMs, backOffMs } = verdict;
114
+ const [base, max] = backOffMs === void 0 ? [FOLLOW_RETRY_BASE_MS, FOLLOW_RETRY_MAX_MS] : [2 * backOffMs, Math.max(FOLLOW_BACK_OFF_MAX_MS, 2 * backOffMs)];
115
+ const ceiling = Math.min(base * 2 ** (failures - 1), max);
91
116
  const jittered = ceiling - Math.floor(ceiling / 2 * random());
92
- return hintMs === void 0 ? jittered : Math.max(hintMs, jittered);
117
+ return afterMs === void 0 ? jittered : Math.max(afterMs, jittered);
93
118
  }
94
119
  __name(retryDelayMs, "retryDelayMs");
95
120
 
@@ -272,6 +297,6 @@ __name(snapToLadder, "snapToLadder");
272
297
  // src/index.ts
273
298
  var VERSION = "__VERSION__";
274
299
 
275
- export { FOLLOW_RETRY_BASE_MS, FOLLOW_RETRY_MAX_MS, IMAGE_LADDER, PUBLISHABLE_KEY_PREFIX, RELYIO_CHANGE_EVENT, RELYIO_RESYNC_EVENT, VERSION, buildLanguageSwitcher, classifyFollowFailure, estimateTranslationCompleteness, followChanges, getAllLocalizedValues, getAvailableLocaleCodes, getDefaultLocale, getFallbackFields, getFieldFallbackLocale, getLocalizedField, getPublishedLocaleCodes, getRequestedLocale, hasLocale, isFieldFallback, isPublishableKey, isPublishedInLocale, localeHelpers, needsTranslation, relyioField, snapToLadder };
300
+ export { FOLLOW_BACK_OFF_MAX_MS, FOLLOW_RETRY_BASE_MS, FOLLOW_RETRY_MAX_MS, IMAGE_LADDER, RELYIO_CHANGE_EVENT, RELYIO_RESYNC_EVENT, VERSION, buildLanguageSwitcher, classifyFollowFailure, estimateTranslationCompleteness, followChanges, getAllLocalizedValues, getAvailableLocaleCodes, getDefaultLocale, getFallbackFields, getFieldFallbackLocale, getLocalizedField, getPublishedLocaleCodes, getRequestedLocale, hasLocale, isFieldFallback, isPublishedInLocale, localeHelpers, needsTranslation, relyioField, snapToLadder };
276
301
  //# sourceMappingURL=index.js.map
277
302
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- export { aa as AggregateBlock, X as AllScopeConfig, F as BUILT_IN_ROLES, G as BUILT_IN_ROLE_ACTIONS, H as BuiltInRole, ao as CachePolicy, ap as CachePolicyObject, C as ComponentConfig, s as ComponentDefinition, t as ComponentMetadata, u as ComponentReusabilityMetadata, v as ComponentValidationMetadata, Q as ContentTypeScopeConfig, U as ContentTypesScopeConfig, W as EntryTypeScopeConfig, a9 as FetchBlock, M as FieldVisibility, an as FilterDefinition, a8 as FullTextSearch, af as HavingOperator, aj as IncludeDefinition, ak as IncludeRelationship, al as IncludeSelection, ar as IncludeSubQueries, aq as IncludeSubQuery, ax as InferQueryParams, aw as InferQueryResponse, I as InferSettingsGroup, q as LocaleDefinition, L as LocaleOptions, as as Parameterizable, av as QueryCardinality, a5 as QueryConfig, a6 as QueryDefinition, at as QueryParameter, au as QueryParameterType, ag as QueryScalar, a7 as QueryType, R as ROLE_ACTIONS, K as ResourcePermission, J as RoleAction, N as RoleConfig, O as RoleDefinition, h as SchemaAssetTypeNames, S as SchemaConfig, b as SchemaContentTypeNames, a as SchemaDefinition, i as SchemaEntry, j as SchemaEntryOf, f as SchemaLocaleCodes, e as SchemaQueryNames, g as SchemaSettingsGroupNames, c as SchemaSingletonNames, ab as SearchBlock, am as SelectMapping, x as SettingsGroupConfig, y as SettingsGroupDefinition, z as SettingsGroupMetadata, ah as SortCondition, ai as SortDirection, T as TextDirection, a2 as ViewConfig, a3 as ViewDefinition, a1 as ViewFilter, $ as ViewFilterCondition, a0 as ViewFilterGroup, Y as ViewFilterOperator, _ as ViewFilterRelativeDate, Z as ViewFilterValue, V as ViewScopeConfig, ac as WhereCondition, ae as WhereOperator, ad as WhereValue, p as buildFallbackChain, r as defineComponent, k as defineLocale, a4 as defineQuery, A as defineRole, d as defineSchema, w as defineSettingsGroup, P as defineView, n as findDefaultLocale, o as getActiveLocales, E as getBuiltInRoleActions, m as getLocaleCodes, D as isBuiltInRole, l as isLocaleDefinition, B as isRoleDefinition } from '../define-schema-D7MButVt.cjs';
2
- import { F as FieldUIConfig, a as FieldAIConfig, b as FieldRule, L as LocalizationConfig, S as ShortTextConfig, c as FieldDefinition, d as LongTextConfig, R as RichTextConfig, e as SlugConfig, U as UrlConfig, E as EmailConfig, I as IntegerConfig, D as DecimalConfig, B as BooleanConfig, f as EnumConfig, g as DateConfig, h as DateTimeConfig, i as ReferenceConfig, T as TagsConfig, A as AnyFieldDefinition, j as ListConfig, C as ComponentFieldConfig, k as AIConfig, l as AllFieldTypes, m as AssetAIConfig, n as BaseFieldConfig, o as ComponentFieldType, p as FieldType, q as ReadOnlyRule, r as RequirementRule, s as RuleCondition, t as RuleConditions, V as ValidationRule, u as VisibilityRule } from '../define-content-type-DiVpbwNs.cjs';
3
- export { a5 as AssetTypeConfig, a6 as AssetTypeConfigWithFields, a7 as AssetTypeConfigWithFieldsets, a8 as AssetTypeConfigWithoutFields, a9 as AssetTypeDefinition, M as ContentTypeConfig, N as ContentTypeConfigWithFields, O as ContentTypeConfigWithFieldsets, P as ContentTypeDefinition, aI as ContentTypeWorkflowConfig, y as DeclaredFields, Q as EntryMetadata, v as FieldSchemaContext, w as FieldValue, x as FieldValues, K as Fieldset, ad as FileKindConfig, ar as FileScanConfig, aq as FileUploadConfig, aj as ImageExifConfig, af as ImageFitMode, ab as ImageKindConfig, ag as ImageOutputFormat, ai as ImageSourceConfig, ae as ImageTransform, ah as ImageUploadConfig, aa as InferAssetType, W as InferContentType, a3 as InferSingleton, a2 as InferSingletonContentType, X as LocalePublicationFields, _ as SingletonConfigWithFields, $ as SingletonConfigWithFieldsets, a0 as SingletonContentTypeDefinition, a1 as SingletonMetadata, G as UnresolvedComponent, z as UnresolvedEntry, ak as VariantDefinition, an as VideoCaptionsConfig, ao as VideoDownloadConfig, ac as VideoKindConfig, am as VideoPosterConfig, al as VideoUploadConfig, ap as VideoWatermarkConfig, aD as WorkflowAutoAssign, aG as WorkflowConfig, aH as WorkflowDefinition, aC as WorkflowEscalation, aE as WorkflowStageConfig, aF as WorkflowStageDefinition, a4 as defineAssetType, H as defineContentType, au as defineContentTypeWorkflow, Z as defineSingleton, Y as defineSingletonContentType, as as defineWorkflow, at as defineWorkflowStage, J as fieldset, ay as findWorkflowStage, aA as getFirstWorkflowStage, az as getNextWorkflowStage, ax as getWorkflowStageIds, aB as isFinalWorkflowStage, av as isWorkflowDefinition, aw as isWorkflowStageDefinition } from '../define-content-type-DiVpbwNs.cjs';
1
+ export { aa as AggregateBlock, X as AllScopeConfig, F as BUILT_IN_ROLES, G as BUILT_IN_ROLE_ACTIONS, H as BuiltInRole, ao as CachePolicy, ap as CachePolicyObject, C as ComponentConfig, s as ComponentDefinition, t as ComponentMetadata, u as ComponentReusabilityMetadata, v as ComponentValidationMetadata, Q as ContentTypeScopeConfig, U as ContentTypesScopeConfig, W as EntryTypeScopeConfig, a9 as FetchBlock, M as FieldVisibility, an as FilterDefinition, a8 as FullTextSearch, af as HavingOperator, aj as IncludeDefinition, ak as IncludeRelationship, al as IncludeSelection, ar as IncludeSubQueries, aq as IncludeSubQuery, ax as InferQueryParams, aw as InferQueryResponse, I as InferSettingsGroup, q as LocaleDefinition, L as LocaleOptions, as as Parameterizable, av as QueryCardinality, a5 as QueryConfig, a6 as QueryDefinition, at as QueryParameter, au as QueryParameterType, ag as QueryScalar, a7 as QueryType, R as ROLE_ACTIONS, K as ResourcePermission, J as RoleAction, N as RoleConfig, O as RoleDefinition, h as SchemaAssetTypeNames, S as SchemaConfig, b as SchemaContentTypeNames, a as SchemaDefinition, i as SchemaEntry, j as SchemaEntryOf, f as SchemaLocaleCodes, e as SchemaQueryNames, g as SchemaSettingsGroupNames, c as SchemaSingletonNames, ab as SearchBlock, am as SelectMapping, x as SettingsGroupConfig, y as SettingsGroupDefinition, z as SettingsGroupMetadata, ah as SortCondition, ai as SortDirection, T as TextDirection, a2 as ViewConfig, a3 as ViewDefinition, a1 as ViewFilter, $ as ViewFilterCondition, a0 as ViewFilterGroup, Y as ViewFilterOperator, _ as ViewFilterRelativeDate, Z as ViewFilterValue, V as ViewScopeConfig, ac as WhereCondition, ae as WhereOperator, ad as WhereValue, p as buildFallbackChain, r as defineComponent, k as defineLocale, a4 as defineQuery, A as defineRole, d as defineSchema, w as defineSettingsGroup, P as defineView, n as findDefaultLocale, o as getActiveLocales, E as getBuiltInRoleActions, m as getLocaleCodes, D as isBuiltInRole, l as isLocaleDefinition, B as isRoleDefinition } from '../define-schema-DgbJ5Kwn.cjs';
2
+ import { F as FieldUIConfig, a as FieldAIConfig, b as FieldRule, L as LocalizationConfig, S as ShortTextConfig, c as FieldDefinition, d as LongTextConfig, R as RichTextConfig, e as SlugConfig, U as UrlConfig, E as EmailConfig, I as IntegerConfig, D as DecimalConfig, B as BooleanConfig, f as EnumConfig, g as DateConfig, h as DateTimeConfig, i as ReferenceConfig, T as TagsConfig, A as AnyFieldDefinition, j as ListConfig, C as ComponentFieldConfig, k as AIConfig, l as AllFieldTypes, m as AssetAIConfig, n as BaseFieldConfig, o as ComponentFieldType, p as FieldType, q as ReadOnlyRule, r as RequirementRule, s as RuleCondition, t as RuleConditions, V as ValidationRule, u as VisibilityRule } from '../define-content-type-cEGjIwT5.cjs';
3
+ export { a5 as AssetTypeConfig, a6 as AssetTypeConfigWithFields, a7 as AssetTypeConfigWithFieldsets, a8 as AssetTypeConfigWithoutFields, a9 as AssetTypeDefinition, M as ContentTypeConfig, N as ContentTypeConfigWithFields, O as ContentTypeConfigWithFieldsets, P as ContentTypeDefinition, aI as ContentTypeWorkflowConfig, y as DeclaredFields, Q as EntryMetadata, v as FieldSchemaContext, w as FieldValue, x as FieldValues, K as Fieldset, ad as FileKindConfig, ar as FileScanConfig, aq as FileUploadConfig, aj as ImageExifConfig, af as ImageFitMode, ab as ImageKindConfig, ag as ImageOutputFormat, ai as ImageSourceConfig, ae as ImageTransform, ah as ImageUploadConfig, aa as InferAssetType, W as InferContentType, a3 as InferSingleton, a2 as InferSingletonContentType, X as LocalePublicationFields, _ as SingletonConfigWithFields, $ as SingletonConfigWithFieldsets, a0 as SingletonContentTypeDefinition, a1 as SingletonMetadata, G as UnresolvedComponent, z as UnresolvedEntry, ak as VariantDefinition, an as VideoCaptionsConfig, ao as VideoDownloadConfig, ac as VideoKindConfig, am as VideoPosterConfig, al as VideoUploadConfig, ap as VideoWatermarkConfig, aD as WorkflowAutoAssign, aG as WorkflowConfig, aH as WorkflowDefinition, aC as WorkflowEscalation, aE as WorkflowStageConfig, aF as WorkflowStageDefinition, a4 as defineAssetType, H as defineContentType, au as defineContentTypeWorkflow, Z as defineSingleton, Y as defineSingletonContentType, as as defineWorkflow, at as defineWorkflowStage, J as fieldset, ay as findWorkflowStage, aA as getFirstWorkflowStage, az as getNextWorkflowStage, ax as getWorkflowStageIds, aB as isFinalWorkflowStage, av as isWorkflowDefinition, aw as isWorkflowStageDefinition } from '../define-content-type-cEGjIwT5.cjs';
4
4
 
5
5
  /**
6
6
  * Field builders for defining schema fields
@@ -1,6 +1,6 @@
1
- export { aa as AggregateBlock, X as AllScopeConfig, F as BUILT_IN_ROLES, G as BUILT_IN_ROLE_ACTIONS, H as BuiltInRole, ao as CachePolicy, ap as CachePolicyObject, C as ComponentConfig, s as ComponentDefinition, t as ComponentMetadata, u as ComponentReusabilityMetadata, v as ComponentValidationMetadata, Q as ContentTypeScopeConfig, U as ContentTypesScopeConfig, W as EntryTypeScopeConfig, a9 as FetchBlock, M as FieldVisibility, an as FilterDefinition, a8 as FullTextSearch, af as HavingOperator, aj as IncludeDefinition, ak as IncludeRelationship, al as IncludeSelection, ar as IncludeSubQueries, aq as IncludeSubQuery, ax as InferQueryParams, aw as InferQueryResponse, I as InferSettingsGroup, q as LocaleDefinition, L as LocaleOptions, as as Parameterizable, av as QueryCardinality, a5 as QueryConfig, a6 as QueryDefinition, at as QueryParameter, au as QueryParameterType, ag as QueryScalar, a7 as QueryType, R as ROLE_ACTIONS, K as ResourcePermission, J as RoleAction, N as RoleConfig, O as RoleDefinition, h as SchemaAssetTypeNames, S as SchemaConfig, b as SchemaContentTypeNames, a as SchemaDefinition, i as SchemaEntry, j as SchemaEntryOf, f as SchemaLocaleCodes, e as SchemaQueryNames, g as SchemaSettingsGroupNames, c as SchemaSingletonNames, ab as SearchBlock, am as SelectMapping, x as SettingsGroupConfig, y as SettingsGroupDefinition, z as SettingsGroupMetadata, ah as SortCondition, ai as SortDirection, T as TextDirection, a2 as ViewConfig, a3 as ViewDefinition, a1 as ViewFilter, $ as ViewFilterCondition, a0 as ViewFilterGroup, Y as ViewFilterOperator, _ as ViewFilterRelativeDate, Z as ViewFilterValue, V as ViewScopeConfig, ac as WhereCondition, ae as WhereOperator, ad as WhereValue, p as buildFallbackChain, r as defineComponent, k as defineLocale, a4 as defineQuery, A as defineRole, d as defineSchema, w as defineSettingsGroup, P as defineView, n as findDefaultLocale, o as getActiveLocales, E as getBuiltInRoleActions, m as getLocaleCodes, D as isBuiltInRole, l as isLocaleDefinition, B as isRoleDefinition } from '../define-schema-C-5an28C.js';
2
- import { F as FieldUIConfig, a as FieldAIConfig, b as FieldRule, L as LocalizationConfig, S as ShortTextConfig, c as FieldDefinition, d as LongTextConfig, R as RichTextConfig, e as SlugConfig, U as UrlConfig, E as EmailConfig, I as IntegerConfig, D as DecimalConfig, B as BooleanConfig, f as EnumConfig, g as DateConfig, h as DateTimeConfig, i as ReferenceConfig, T as TagsConfig, A as AnyFieldDefinition, j as ListConfig, C as ComponentFieldConfig, k as AIConfig, l as AllFieldTypes, m as AssetAIConfig, n as BaseFieldConfig, o as ComponentFieldType, p as FieldType, q as ReadOnlyRule, r as RequirementRule, s as RuleCondition, t as RuleConditions, V as ValidationRule, u as VisibilityRule } from '../define-content-type-DiVpbwNs.js';
3
- export { a5 as AssetTypeConfig, a6 as AssetTypeConfigWithFields, a7 as AssetTypeConfigWithFieldsets, a8 as AssetTypeConfigWithoutFields, a9 as AssetTypeDefinition, M as ContentTypeConfig, N as ContentTypeConfigWithFields, O as ContentTypeConfigWithFieldsets, P as ContentTypeDefinition, aI as ContentTypeWorkflowConfig, y as DeclaredFields, Q as EntryMetadata, v as FieldSchemaContext, w as FieldValue, x as FieldValues, K as Fieldset, ad as FileKindConfig, ar as FileScanConfig, aq as FileUploadConfig, aj as ImageExifConfig, af as ImageFitMode, ab as ImageKindConfig, ag as ImageOutputFormat, ai as ImageSourceConfig, ae as ImageTransform, ah as ImageUploadConfig, aa as InferAssetType, W as InferContentType, a3 as InferSingleton, a2 as InferSingletonContentType, X as LocalePublicationFields, _ as SingletonConfigWithFields, $ as SingletonConfigWithFieldsets, a0 as SingletonContentTypeDefinition, a1 as SingletonMetadata, G as UnresolvedComponent, z as UnresolvedEntry, ak as VariantDefinition, an as VideoCaptionsConfig, ao as VideoDownloadConfig, ac as VideoKindConfig, am as VideoPosterConfig, al as VideoUploadConfig, ap as VideoWatermarkConfig, aD as WorkflowAutoAssign, aG as WorkflowConfig, aH as WorkflowDefinition, aC as WorkflowEscalation, aE as WorkflowStageConfig, aF as WorkflowStageDefinition, a4 as defineAssetType, H as defineContentType, au as defineContentTypeWorkflow, Z as defineSingleton, Y as defineSingletonContentType, as as defineWorkflow, at as defineWorkflowStage, J as fieldset, ay as findWorkflowStage, aA as getFirstWorkflowStage, az as getNextWorkflowStage, ax as getWorkflowStageIds, aB as isFinalWorkflowStage, av as isWorkflowDefinition, aw as isWorkflowStageDefinition } from '../define-content-type-DiVpbwNs.js';
1
+ export { aa as AggregateBlock, X as AllScopeConfig, F as BUILT_IN_ROLES, G as BUILT_IN_ROLE_ACTIONS, H as BuiltInRole, ao as CachePolicy, ap as CachePolicyObject, C as ComponentConfig, s as ComponentDefinition, t as ComponentMetadata, u as ComponentReusabilityMetadata, v as ComponentValidationMetadata, Q as ContentTypeScopeConfig, U as ContentTypesScopeConfig, W as EntryTypeScopeConfig, a9 as FetchBlock, M as FieldVisibility, an as FilterDefinition, a8 as FullTextSearch, af as HavingOperator, aj as IncludeDefinition, ak as IncludeRelationship, al as IncludeSelection, ar as IncludeSubQueries, aq as IncludeSubQuery, ax as InferQueryParams, aw as InferQueryResponse, I as InferSettingsGroup, q as LocaleDefinition, L as LocaleOptions, as as Parameterizable, av as QueryCardinality, a5 as QueryConfig, a6 as QueryDefinition, at as QueryParameter, au as QueryParameterType, ag as QueryScalar, a7 as QueryType, R as ROLE_ACTIONS, K as ResourcePermission, J as RoleAction, N as RoleConfig, O as RoleDefinition, h as SchemaAssetTypeNames, S as SchemaConfig, b as SchemaContentTypeNames, a as SchemaDefinition, i as SchemaEntry, j as SchemaEntryOf, f as SchemaLocaleCodes, e as SchemaQueryNames, g as SchemaSettingsGroupNames, c as SchemaSingletonNames, ab as SearchBlock, am as SelectMapping, x as SettingsGroupConfig, y as SettingsGroupDefinition, z as SettingsGroupMetadata, ah as SortCondition, ai as SortDirection, T as TextDirection, a2 as ViewConfig, a3 as ViewDefinition, a1 as ViewFilter, $ as ViewFilterCondition, a0 as ViewFilterGroup, Y as ViewFilterOperator, _ as ViewFilterRelativeDate, Z as ViewFilterValue, V as ViewScopeConfig, ac as WhereCondition, ae as WhereOperator, ad as WhereValue, p as buildFallbackChain, r as defineComponent, k as defineLocale, a4 as defineQuery, A as defineRole, d as defineSchema, w as defineSettingsGroup, P as defineView, n as findDefaultLocale, o as getActiveLocales, E as getBuiltInRoleActions, m as getLocaleCodes, D as isBuiltInRole, l as isLocaleDefinition, B as isRoleDefinition } from '../define-schema-BPj2srgh.js';
2
+ import { F as FieldUIConfig, a as FieldAIConfig, b as FieldRule, L as LocalizationConfig, S as ShortTextConfig, c as FieldDefinition, d as LongTextConfig, R as RichTextConfig, e as SlugConfig, U as UrlConfig, E as EmailConfig, I as IntegerConfig, D as DecimalConfig, B as BooleanConfig, f as EnumConfig, g as DateConfig, h as DateTimeConfig, i as ReferenceConfig, T as TagsConfig, A as AnyFieldDefinition, j as ListConfig, C as ComponentFieldConfig, k as AIConfig, l as AllFieldTypes, m as AssetAIConfig, n as BaseFieldConfig, o as ComponentFieldType, p as FieldType, q as ReadOnlyRule, r as RequirementRule, s as RuleCondition, t as RuleConditions, V as ValidationRule, u as VisibilityRule } from '../define-content-type-cEGjIwT5.js';
3
+ export { a5 as AssetTypeConfig, a6 as AssetTypeConfigWithFields, a7 as AssetTypeConfigWithFieldsets, a8 as AssetTypeConfigWithoutFields, a9 as AssetTypeDefinition, M as ContentTypeConfig, N as ContentTypeConfigWithFields, O as ContentTypeConfigWithFieldsets, P as ContentTypeDefinition, aI as ContentTypeWorkflowConfig, y as DeclaredFields, Q as EntryMetadata, v as FieldSchemaContext, w as FieldValue, x as FieldValues, K as Fieldset, ad as FileKindConfig, ar as FileScanConfig, aq as FileUploadConfig, aj as ImageExifConfig, af as ImageFitMode, ab as ImageKindConfig, ag as ImageOutputFormat, ai as ImageSourceConfig, ae as ImageTransform, ah as ImageUploadConfig, aa as InferAssetType, W as InferContentType, a3 as InferSingleton, a2 as InferSingletonContentType, X as LocalePublicationFields, _ as SingletonConfigWithFields, $ as SingletonConfigWithFieldsets, a0 as SingletonContentTypeDefinition, a1 as SingletonMetadata, G as UnresolvedComponent, z as UnresolvedEntry, ak as VariantDefinition, an as VideoCaptionsConfig, ao as VideoDownloadConfig, ac as VideoKindConfig, am as VideoPosterConfig, al as VideoUploadConfig, ap as VideoWatermarkConfig, aD as WorkflowAutoAssign, aG as WorkflowConfig, aH as WorkflowDefinition, aC as WorkflowEscalation, aE as WorkflowStageConfig, aF as WorkflowStageDefinition, a4 as defineAssetType, H as defineContentType, au as defineContentTypeWorkflow, Z as defineSingleton, Y as defineSingletonContentType, as as defineWorkflow, at as defineWorkflowStage, J as fieldset, ay as findWorkflowStage, aA as getFirstWorkflowStage, az as getNextWorkflowStage, ax as getWorkflowStageIds, aB as isFinalWorkflowStage, av as isWorkflowDefinition, aw as isWorkflowStageDefinition } from '../define-content-type-cEGjIwT5.js';
4
4
 
5
5
  /**
6
6
  * Field builders for defining schema fields
@@ -1,2 +1,2 @@
1
- export { v as ApiResponse, B as BaseContent, s as CacheConfig, x as CacheStrategy, j as ContentQueryResult, n as ContentTypeSchema, C as CreateInput, l as CustomQuery, D as DebugConfig, E as Environment, K as FieldDefinition, o as FieldOptions, F as FieldTypeName, L as LogLevel, P as PerformanceMetrics, Q as QueryOptions, t as RealtimeConfig, q as RealtimeEvent, p as RealtimeEventType, R as RelyIOConfig, u as RequestConfig, w as RetryConfig, k as SingletonContent, i as SortOptions, r as SubscriptionOptions, U as UpdateInput, V as ValidationRule, y as ValidationViolation, g as WhereClause, f as WhereFieldCondition, h as WhereOperator, e as WhereScalar } from '../index-DbsTUw3Q.cjs';
2
- import '../define-content-type-DiVpbwNs.cjs';
1
+ export { w as ApiResponse, B as BaseContent, t as CacheConfig, y as CacheStrategy, k as ContentQueryResult, o as ContentTypeSchema, C as CreateInput, n as CustomQuery, D as DebugConfig, E as Environment, O as FieldDefinition, p as FieldOptions, F as FieldTypeName, z as LogLevel, P as PerformanceMetrics, Q as QueryOptions, u as RealtimeConfig, r as RealtimeEvent, q as RealtimeEventType, R as RelyIOConfig, v as RequestConfig, x as RetryConfig, l as SingletonContent, j as SortOptions, s as SubscriptionOptions, U as UpdateInput, V as ValidationRule, G as ValidationViolation, h as WhereClause, g as WhereFieldCondition, i as WhereOperator, f as WhereScalar } from '../index-B_rIWO_l.cjs';
2
+ import '../define-content-type-cEGjIwT5.cjs';
@@ -1,2 +1,2 @@
1
- export { v as ApiResponse, B as BaseContent, s as CacheConfig, x as CacheStrategy, j as ContentQueryResult, n as ContentTypeSchema, C as CreateInput, l as CustomQuery, D as DebugConfig, E as Environment, K as FieldDefinition, o as FieldOptions, F as FieldTypeName, L as LogLevel, P as PerformanceMetrics, Q as QueryOptions, t as RealtimeConfig, q as RealtimeEvent, p as RealtimeEventType, R as RelyIOConfig, u as RequestConfig, w as RetryConfig, k as SingletonContent, i as SortOptions, r as SubscriptionOptions, U as UpdateInput, V as ValidationRule, y as ValidationViolation, g as WhereClause, f as WhereFieldCondition, h as WhereOperator, e as WhereScalar } from '../index-BOQIHnsh.js';
2
- import '../define-content-type-DiVpbwNs.js';
1
+ export { w as ApiResponse, B as BaseContent, t as CacheConfig, y as CacheStrategy, k as ContentQueryResult, o as ContentTypeSchema, C as CreateInput, n as CustomQuery, D as DebugConfig, E as Environment, O as FieldDefinition, p as FieldOptions, F as FieldTypeName, z as LogLevel, P as PerformanceMetrics, Q as QueryOptions, u as RealtimeConfig, r as RealtimeEvent, q as RealtimeEventType, R as RelyIOConfig, v as RequestConfig, x as RetryConfig, l as SingletonContent, j as SortOptions, s as SubscriptionOptions, U as UpdateInput, V as ValidationRule, G as ValidationViolation, h as WhereClause, g as WhereFieldCondition, i as WhereOperator, f as WhereScalar } from '../index-Cv4tmcrw.js';
2
+ import '../define-content-type-cEGjIwT5.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relyio/sdk",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "RelyIO is coming soon — this package is not ready for general use yet.",
5
5
  "keywords": [
6
6
  "relyio"
@@ -85,8 +85,8 @@
85
85
  "typedoc": "^0.28.20",
86
86
  "typescript": "npm:@typescript/typescript6@6.0.2",
87
87
  "vitest": "4.1.11",
88
- "@relyio/eslint-config": "0.0.0",
89
- "@relyio/api-contract": "0.1.0"
88
+ "@relyio/api-contract": "0.1.0",
89
+ "@relyio/eslint-config": "0.0.0"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "typescript": ">=4.9.0"