@relyio/sdk 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/dist/{chunk-3DRDHXLY.js → chunk-3NPPMGB6.js} +435 -23
  3. package/dist/{chunk-FRJEUAAF.js → chunk-6NGJXLOR.js} +22 -11
  4. package/dist/{chunk-DXCVO6M5.cjs → chunk-DEDIJKHY.cjs} +22 -11
  5. package/dist/{chunk-POEEDYFM.js → chunk-EW23SZPX.js} +7 -2
  6. package/dist/{chunk-3MSFWXQL.cjs → chunk-FOSM4LMM.cjs} +7 -2
  7. package/dist/{chunk-FI5VIF4M.cjs → chunk-Z6GLWSSD.cjs} +442 -22
  8. package/dist/client/index.cjs +3 -3
  9. package/dist/client/index.d.cts +4 -5
  10. package/dist/client/index.d.ts +4 -5
  11. package/dist/client/index.js +1 -1
  12. package/dist/{define-schema-mrEZbY1h.d.ts → define-schema-UHViXKiv.d.ts} +2 -219
  13. package/dist/{define-schema-DgctHlI2.d.cts → define-schema-sWJ8Zn7C.d.cts} +2 -219
  14. package/dist/{include-paths-CL4gHv6I.d.cts → include-paths-Bs5FhNw2.d.cts} +2191 -108
  15. package/dist/{include-paths-CrJNTsMl.d.ts → include-paths-Cb7iPCW2.d.ts} +2191 -108
  16. package/dist/index--_u1nPHv.d.cts +507 -0
  17. package/dist/index-8DozAWsA.d.ts +507 -0
  18. package/dist/{index-BrvEg6-A.d.cts → index-BT0L8xJj.d.cts} +41 -53
  19. package/dist/{index-Pw0onkJe.d.ts → index-CPjJ25R4.d.ts} +41 -53
  20. package/dist/index.cjs +119 -112
  21. package/dist/index.d.cts +39 -70
  22. package/dist/index.d.ts +39 -70
  23. package/dist/index.js +5 -29
  24. package/dist/markdown/index.cjs +13750 -0
  25. package/dist/markdown/index.d.cts +111 -0
  26. package/dist/markdown/index.d.ts +111 -0
  27. package/dist/markdown/index.js +13742 -0
  28. package/dist/rich-text/index.cjs +26 -6
  29. package/dist/rich-text/index.d.cts +3 -148
  30. package/dist/rich-text/index.d.ts +3 -148
  31. package/dist/rich-text/index.js +1 -1
  32. package/dist/rich-text.d-BWc-5gX1.d.cts +326 -0
  33. package/dist/rich-text.d-BWc-5gX1.d.ts +326 -0
  34. package/dist/schema/index.cjs +34 -34
  35. package/dist/schema/index.d.cts +9 -178
  36. package/dist/schema/index.d.ts +9 -178
  37. package/dist/schema/index.js +1 -1
  38. package/dist/types/index.d.cts +2 -3
  39. package/dist/types/index.d.ts +2 -3
  40. package/package.json +14 -3
  41. package/dist/index-B9RfZVF1.d.ts +0 -861
  42. package/dist/index-b-AkfTUv.d.cts +0 -861
  43. package/dist/rich-text.d-rKmpgdGd.d.cts +0 -200
  44. package/dist/rich-text.d-rKmpgdGd.d.ts +0 -200
@@ -1,6 +1,5 @@
1
- import { K as MergedRelyIOConfig, A as ApiPath, c as ApiMethod, N as PathParamsOf, w as ApiResponse, W as Wire, v as RequestConfig, B as BaseContent, h as WhereClause, Q as QueryOptions, j as SortOptions, k as ContentQueryResult, C as CreateInput, U as UpdateInput, S as SDKError, H as BaseValidationError, G as ValidationViolation, R as RelyIOConfig, a as RelyIOConfigUpdate } from './index-b-AkfTUv.cjs';
2
- import { W as Reading, _ as UntypedReading, M as CheckedIncludes, X as ReadWith, aX as components, aY as CheckedInclude, aW as paths, a6 as InferContentType, P as ContentReading, an as InferAssetType, J as AssetReading, ae as InferSingleton, Z as SingletonReading, aj as InferSettingsGroup, Y as SettingsReading } from './include-paths-CL4gHv6I.cjs';
3
- import { a as SchemaDefinition, b as SchemaContentTypeNames, j as SchemaEntryOf, al as FilterOperator, h as SchemaAssetTypeNames, c as SchemaSingletonNames, g as SchemaSettingsGroupNames, e as SchemaQueryNames, f as SchemaLocaleCodes } from './define-schema-DgctHlI2.cjs';
1
+ import { cj as MergedRelyIOConfig, bC as ApiPath, bD as ApiMethod, ck as PathParamsOf, ca as ApiResponse, bF as Wire, c9 as RequestConfig, bL as BaseContent, ae as Reading, ai as UntypedReading, cl as ReadWhere, bO as WhereClause, bS as QueryOptions, aa as CheckedIncludes, af as ReadWith, bR as SortOptions, bX as ContentQueryResult, bT as CreateInput, bW as UpdateInput, bU as RevisedContent, bV as RestoredContent, bx as SDKError, cg as BaseValidationError, cf as ValidationViolation, aJ as AssetServedBlocks, cm as CheckedInclude, cn as components, bJ as AssetFileBlock, co as paths, by as RelyIOConfig, aq as InferContentType, ac as ContentReading, aH as InferAssetType, a9 as AssetReading, ay as InferSingleton, ah as SingletonReading, aD as InferSettingsGroup, ag as SettingsReading, bz as RelyIOConfigUpdate } from './include-paths-Bs5FhNw2.cjs';
2
+ import { a as SchemaDefinition, b as SchemaContentTypeNames, j as SchemaEntryOf, a8 as FilterOperator, h as SchemaAssetTypeNames, c as SchemaSingletonNames, g as SchemaSettingsGroupNames, e as SchemaQueryNames, f as SchemaLocaleCodes } from './define-schema-sWJ8Zn7C.cjs';
4
3
  import { VisitorResyncReason } from './live-visitor.js';
5
4
  import { DevUnreadableReason } from './dev-handshake/index.cjs';
6
5
 
@@ -323,10 +322,14 @@ declare class ContentQueryBuilder<T extends BaseContent = BaseContent, F extends
323
322
  */
324
323
  headers(headers: Record<string, string>): this;
325
324
  /**
326
- * Add where conditions to the query: conditions on the fields the content type declares. A
327
- * condition on `_metadata` is refused here, before anything is sent (`refuseMetadataConditions`).
325
+ * Add where conditions to the query, each naming a value by its path: a field the content type
326
+ * declares, a field inside an object (`'pricing.basePrice'`), a reference inside its blocks —
327
+ * `{ 'sections.features': featureId }` keeps the entries some block of which holds that feature
328
+ * (REL-1810) — and rich text that can point at an entry, by the entries it points at. A typed read
329
+ * takes exactly the paths the API filters by (`FilterPaths`, REL-2136). A condition on `_metadata`
330
+ * is refused here, before anything is sent (`refuseMetadataConditions`).
328
331
  */
329
- where(conditions: WhereClause<F>): this;
332
+ where(conditions: ReadWhere<WhereClause<F>, R>): this;
330
333
  /**
331
334
  * Select specific fields to return
332
335
  */
@@ -657,9 +660,9 @@ declare function entityTagOf(response: {
657
660
  /**
658
661
  * Content fetch options
659
662
  */
660
- interface ContentFetchOptions<T extends BaseContent = BaseContent> {
661
- /** Filter conditions */
662
- where?: WhereClause<T>;
663
+ interface ContentFetchOptions<T extends BaseContent = BaseContent, R extends Reading = UntypedReading<T>> {
664
+ /** Filter conditions: what `query().where()` takes (REL-2136) */
665
+ where?: ReadWhere<WhereClause<T>, R>;
663
666
  /** Maximum entries to return */
664
667
  limit?: number;
665
668
  /** Entries to skip (offset pagination) */
@@ -724,10 +727,10 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
724
727
  /**
725
728
  * Fetch content with query options
726
729
  */
727
- fetch<const P extends readonly string[]>(options: Omit<ContentFetchOptions<T>, 'include'> & {
730
+ fetch<const P extends readonly string[]>(options: Omit<ContentFetchOptions<T, R>, 'include'> & {
728
731
  include: CheckedIncludes<R, P>;
729
732
  }): Promise<Array<ReadWith<R, P[number]>>>;
730
- fetch(options?: Omit<ContentFetchOptions<T>, 'include'>): Promise<T[]>;
733
+ fetch(options?: Omit<ContentFetchOptions<T, R>, 'include'>): Promise<T[]>;
731
734
  /**
732
735
  * Fetch a single content item by ID
733
736
  * @param id - Entry ID or slug
@@ -781,7 +784,7 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
781
784
  * @param where - Filter conditions
782
785
  * @param locale - Optional locale
783
786
  */
784
- fetchFirst(where?: WhereClause<T>, locale?: string): Promise<T | null>;
787
+ fetchFirst(where?: ReadWhere<WhereClause<T>, R>, locale?: string): Promise<T | null>;
785
788
  /**
786
789
  * Create a new content item
787
790
  * @param data - Content data
@@ -805,6 +808,8 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
805
808
  * request adds, as for {@link create}. `ifMatch` and `idempotencyKey` win over the same
806
809
  * header among them. `locale` defaults to the client's own, the locale whose entity tag
807
810
  * {@link fetchOneWithTag} reads, so the tag it hands back is checked against the same locale.
811
+ * @returns The entry, its `_metadata.brokenLinks` naming each entry link another entry publishes
812
+ * that this revision left pointing nowhere — empty when it took no heading away.
808
813
  */
809
814
  update(id: string, data: UpdateInput<T>, options?: {
810
815
  slug?: string;
@@ -812,7 +817,7 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
812
817
  parentId?: string;
813
818
  sortOrder?: number;
814
819
  headers?: Record<string, string>;
815
- } & ConditionalWriteOptions): Promise<T>;
820
+ } & ConditionalWriteOptions): Promise<RevisedContent<T>>;
816
821
  /**
817
822
  * Delete a content item by ID
818
823
  */
@@ -856,15 +861,19 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
856
861
  * The restore is validated as strictly as a publish, so it cannot publish invalid content, and it
857
862
  * records a new version of its own rather than rewinding the counter — so the revert is auditable
858
863
  * and itself reversible.
864
+ *
865
+ * @returns The entry, its `_metadata.leftOut` naming each value of the version the active schema
866
+ * no longer declares, and `_metadata.brokenLinks` the entry links it left pointing nowhere.
859
867
  */
860
- restore(id: string, versionNumber: number, locale: string, options?: ConditionalWriteOptions): Promise<T>;
868
+ restore(id: string, versionNumber: number, locale: string, options?: ConditionalWriteOptions): Promise<RestoredContent<T>>;
861
869
  /**
862
- * Get children of a hierarchical entry
870
+ * Get the direct children of a hierarchical entry. The route lists one level and takes no depth
871
+ * (REL-2195): `{ depth }` was sent as `?depth=`, which the API refused with `400`. A tree nested
872
+ * under each entry is a list or entry read's `query().children()`.
863
873
  * @param id - Parent entry ID
864
- * @param options - Fetch options
874
+ * @param options - Include paths to expand on each child, and the locale to read
865
875
  */
866
876
  children(id: string, options?: {
867
- depth?: number;
868
877
  include?: string[];
869
878
  locale?: string;
870
879
  }): Promise<T[]>;
@@ -964,12 +973,6 @@ type AssetVisibility = 'public' | 'protected' | 'private';
964
973
  type FileStatus = 'pending_upload' | 'uploading' | 'processing' | 'ready' | 'failed';
965
974
  /** Storage backend: `r2` = image + file kinds, `stream` = video kind. */
966
975
  type FileBackend = 'r2' | 'stream';
967
- /**
968
- * Customer-facing file binding block on an asset entry: the document's `AssetFile` — status,
969
- * backend, file name, MIME type, size, advisory hash, visibility, extracted metadata, focal point,
970
- * enrichment and scan status, processing stage/progress/error, and video playback readiness.
971
- */
972
- type AssetFileBlock = components['schemas']['AssetFile'];
973
976
  /** Extracted media metadata (Phase 1 basics + Phase 2 enrichment, plans 15–19); open-ended. */
974
977
  type AssetFileExtracted = NonNullable<AssetFileBlock['extracted']>;
975
978
  /**
@@ -978,33 +981,13 @@ type AssetFileExtracted = NonNullable<AssetFileBlock['extracted']>;
978
981
  * nothing of the entry's content. `processing.error` is present exactly while `status` is `failed`.
979
982
  */
980
983
  type FileStatusResult = components['schemas']['FileStatus'];
981
- /**
982
- * Computed gateway delivery URLs (the reserved `urls` key). Always served from
983
- * `cdn.relyio.net`. Image bindings expose `original` + `variants`; video bindings
984
- * expose `playback`/`poster`/`download`. Present only when `file.status` is
985
- * `ready` — otherwise the response omits `urls` and callers read `file.status`.
986
- */
987
- interface AssetUrls {
988
- /** Image: canonical original delivery URL. */
989
- original?: string;
990
- /** Image: variant id → delivery URL map. */
991
- variants?: Record<string, string>;
992
- /** Video: HLS/DASH manifest URL. */
993
- playback?: string;
994
- /** Video: poster image URL. */
995
- poster?: string;
996
- /** Video: downloadable MP4 URL (when enabled). */
997
- download?: string;
998
- [key: string]: unknown;
999
- }
984
+
1000
985
  /**
1001
986
  * An asset entry response: schema fields at the top level plus the reserved
1002
- * `file` + `urls` blocks and `_metadata`. `T` carries the inferred field shape.
987
+ * `file` + `urls` blocks and `_metadata`. `T` carries the inferred field shape — for a typed client
988
+ * `InferAssetType`, so this is `InferAssetEntry`, the shape an expanded asset reads as too.
1003
989
  */
1004
- type AssetEntryResponse<T extends BaseContent = BaseContent> = T & {
1005
- file?: AssetFileBlock;
1006
- urls?: AssetUrls;
1007
- };
990
+ type AssetEntryResponse<T extends BaseContent = BaseContent> = T & AssetServedBlocks;
1008
991
  /** Request a single upload target for the binding. */
1009
992
  interface PresignInput {
1010
993
  /** Original file name (required). */
@@ -1323,9 +1306,14 @@ declare class AssetUploadBuilder<T extends BaseContent = BaseContent> {
1323
1306
  * An asset read typed by the asset type's reading `R`: what the type's include paths make of its
1324
1307
  * fields, beside the `file` and `urls` blocks every asset read carries (REL-1801).
1325
1308
  */
1326
- interface AssetResponseReading<R extends Reading> extends Reading {
1309
+ interface AssetResponseReading<R extends Reading, T extends BaseContent = BaseContent> extends Reading {
1327
1310
  readonly read: AssetEntryResponse<Extract<ReadWith<R, this['include']>, BaseContent>>;
1328
1311
  readonly checked: CheckedInclude<R, this['path']>;
1312
+ /**
1313
+ * The asset type's own `where` — every path the API filters its fields by, never the `file` and
1314
+ * `urls` blocks — or, where no schema types it, the conditions `T`'s keys take (REL-2195).
1315
+ */
1316
+ readonly where: ReadWhere<WhereClause<T>, R>;
1329
1317
  }
1330
1318
  declare class AssetClient<T extends BaseContent = BaseContent, R extends Reading = UntypedReading<T>> {
1331
1319
  private readonly httpClient;
@@ -1341,19 +1329,19 @@ declare class AssetClient<T extends BaseContent = BaseContent, R extends Reading
1341
1329
  * Create a query builder for this asset type. It resolves asset reads; its conditions name the
1342
1330
  * asset type's fields, which the `file` and `urls` blocks are not.
1343
1331
  */
1344
- query(): ContentQueryBuilder<AssetEntryResponse<T>, T, AssetResponseReading<R>>;
1332
+ query(): ContentQueryBuilder<AssetEntryResponse<T>, T, AssetResponseReading<R, T>>;
1345
1333
  /** Find an asset entry by id (or slug) with fluent options. */
1346
- findById(id: string): ContentByIdBuilder<AssetEntryResponse<T>, AssetResponseReading<R>>;
1334
+ findById(id: string): ContentByIdBuilder<AssetEntryResponse<T>, AssetResponseReading<R, T>>;
1347
1335
  /** Fetch a single asset entry by id (or slug), or `null` if not found. */
1348
1336
  fetchOne<const P extends readonly string[]>(id: string, options: {
1349
1337
  include: CheckedIncludes<R, P>;
1350
1338
  locale?: string;
1351
- }): Promise<ReadWith<AssetResponseReading<R>, P[number]> | null>;
1339
+ }): Promise<ReadWith<AssetResponseReading<R, T>, P[number]> | null>;
1352
1340
  fetchOne(id: string, options?: {
1353
1341
  locale?: string;
1354
1342
  }): Promise<AssetEntryResponse<T> | null>;
1355
1343
  /** Fetch the first asset entry matching the conditions, or `null`. */
1356
- fetchFirst(where?: WhereClause<T>, locale?: string): Promise<AssetEntryResponse<T> | null>;
1344
+ fetchFirst(where?: ReadWhere<WhereClause<T>, R>, locale?: string): Promise<AssetEntryResponse<T> | null>;
1357
1345
  /**
1358
1346
  * Create a new asset entry as a draft. The binary is uploaded separately via
1359
1347
  * `file(uid)` (or use the high-level `upload()` helper), and the entry
@@ -3726,4 +3714,4 @@ declare function createClient<TSchema extends AnySchemaDefinition>(config: Typed
3726
3714
  */
3727
3715
  type ClientSchema<T extends TypedRelyIOClient<AnySchemaDefinition>> = T extends TypedRelyIOClient<infer TSchema> ? TSchema : never;
3728
3716
 
3729
- export { type BatchOptions as $, type ActiveSandbox as A, type SearchMode as B, type Change as C, type SearchResultItem as D, type ExtendedQueryResult as E, type FeedChange as F, type SearchHitMetadata as G, HttpClient as H, type SearchResponse as I, type AutocompleteSuggestion as J, type AutocompleteResponse as K, LIVE_KEEPALIVE_INTERVAL_MS as L, type SimilarResult as M, type SimilarResponse as N, type SearchFilter as O, type Project as P, type SearchFields as Q, type Register as R, type SandboxState as S, TypedRelyIOClient as T, type SearchSort as U, type SearchTypeName as V, type SearchEntry as W, BatchClient as X, BatchBuilder as Y, type BatchMethod as Z, type BatchOperation as _, ChangesExpiredError as a, type BatchOperationResult as a0, type BatchSummary as a1, type BatchResponse as a2, AdhocQueryClient as a3, AdhocQueryBuilder as a4, type FetchBlock as a5, type AggregateBlock as a6, type AggregateMetric as a7, type SearchBlock as a8, type FilterValue as a9, type MultipartCreateResult as aA, type MultipartPart as aB, type MultipartTarget as aC, type UploadProgress as aD, ResourceNotFoundError as aE, ResourceConflictError as aF, ResourceExpiredError as aG, isResourceNotFound as aH, type FileErrorCode as aI, type FileUploadErrorCode as aJ, FileUploadError as aK, FileValidationError as aL, type FileValidationConstraints as aM, validateFile as aN, type FullTextConfig as aa, type AdhocQueryDefinition as ab, type AdhocQueryOptions as ac, type QueryMetadata as ad, type AdhocQueryResult as ae, AssetClient as af, AssetFileBuilder as ag, AssetUploadBuilder as ah, isAssetEntry as ai, type AssetVisibility as aj, type FileStatus as ak, type FileBackend as al, type AssetFileBlock as am, type AssetFileExtracted as an, type FileStatusResult as ao, type AssetUrls as ap, type AssetEntryResponse as aq, type PopulatedAssetReference as ar, type PresignInput as as, type PresignResult as at, type ConfirmInput as au, type ConfirmResult as av, type ResolveUrlInput as aw, type ResolveUrlResult as ax, type CreateAssetOptions as ay, type WaitUntilReadyOptions as az, type ChangesExpiredReason as b, createClient as c, type TypedClientConfig as d, type ClientSchema as e, type RegisteredSchema as f, type SendOptions as g, entityTagOf as h, type ConditionalWriteOptions as i, type RetryableWriteOptions as j, type ChangesHeadOptions as k, type ChangesOptions as l, LIVE_SOCKET_OPEN_TIMEOUT_MS as m, type LiveChangesOptions as n, ContentClient as o, SingletonClient as p, SettingsClient as q, ContentQueryBuilder as r, ContentByIdBuilder as s, type ChildrenOptions as t, type SingletonFetchOptions as u, type SettingsFetchOptions as v, SearchClient as w, SearchBuilder as x, AutocompleteBuilder as y, SimilarBuilder as z };
3717
+ export { type BatchOptions as $, type ActiveSandbox as A, type SearchMode as B, type Change as C, type SearchResultItem as D, type ExtendedQueryResult as E, type FeedChange as F, type SearchHitMetadata as G, HttpClient as H, type SearchResponse as I, type AutocompleteSuggestion as J, type AutocompleteResponse as K, LIVE_KEEPALIVE_INTERVAL_MS as L, type SimilarResult as M, type SimilarResponse as N, type SearchFilter as O, type Project as P, type SearchFields as Q, type Register as R, type SandboxState as S, TypedRelyIOClient as T, type SearchSort as U, type SearchTypeName as V, type SearchEntry as W, BatchClient as X, BatchBuilder as Y, type BatchMethod as Z, type BatchOperation as _, ChangesExpiredError as a, type BatchOperationResult as a0, type BatchSummary as a1, type BatchResponse as a2, AdhocQueryClient as a3, AdhocQueryBuilder as a4, type FetchBlock as a5, type AggregateBlock as a6, type AggregateMetric as a7, type SearchBlock as a8, type FilterValue as a9, type MultipartTarget as aA, type UploadProgress as aB, ResourceNotFoundError as aC, ResourceConflictError as aD, ResourceExpiredError as aE, isResourceNotFound as aF, type FileErrorCode as aG, type FileUploadErrorCode as aH, FileUploadError as aI, FileValidationError as aJ, type FileValidationConstraints as aK, validateFile as aL, type FullTextConfig as aa, type AdhocQueryDefinition as ab, type AdhocQueryOptions as ac, type QueryMetadata as ad, type AdhocQueryResult as ae, AssetClient as af, AssetFileBuilder as ag, AssetUploadBuilder as ah, isAssetEntry as ai, type AssetVisibility as aj, type FileStatus as ak, type FileBackend as al, type AssetFileExtracted as am, type FileStatusResult as an, type AssetEntryResponse as ao, type PopulatedAssetReference as ap, type PresignInput as aq, type PresignResult as ar, type ConfirmInput as as, type ConfirmResult as at, type ResolveUrlInput as au, type ResolveUrlResult as av, type CreateAssetOptions as aw, type WaitUntilReadyOptions as ax, type MultipartCreateResult as ay, type MultipartPart as az, type ChangesExpiredReason as b, createClient as c, type TypedClientConfig as d, type ClientSchema as e, type RegisteredSchema as f, type SendOptions as g, entityTagOf as h, type ConditionalWriteOptions as i, type RetryableWriteOptions as j, type ChangesHeadOptions as k, type ChangesOptions as l, LIVE_SOCKET_OPEN_TIMEOUT_MS as m, type LiveChangesOptions as n, ContentClient as o, SingletonClient as p, SettingsClient as q, ContentQueryBuilder as r, ContentByIdBuilder as s, type ChildrenOptions as t, type SingletonFetchOptions as u, type SettingsFetchOptions as v, SearchClient as w, SearchBuilder as x, AutocompleteBuilder as y, SimilarBuilder as z };
@@ -1,6 +1,5 @@
1
- import { K as MergedRelyIOConfig, A as ApiPath, c as ApiMethod, N as PathParamsOf, w as ApiResponse, W as Wire, v as RequestConfig, B as BaseContent, h as WhereClause, Q as QueryOptions, j as SortOptions, k as ContentQueryResult, C as CreateInput, U as UpdateInput, S as SDKError, H as BaseValidationError, G as ValidationViolation, R as RelyIOConfig, a as RelyIOConfigUpdate } from './index-B9RfZVF1.js';
2
- import { W as Reading, _ as UntypedReading, M as CheckedIncludes, X as ReadWith, aX as components, aY as CheckedInclude, aW as paths, a6 as InferContentType, P as ContentReading, an as InferAssetType, J as AssetReading, ae as InferSingleton, Z as SingletonReading, aj as InferSettingsGroup, Y as SettingsReading } from './include-paths-CrJNTsMl.js';
3
- import { a as SchemaDefinition, b as SchemaContentTypeNames, j as SchemaEntryOf, al as FilterOperator, h as SchemaAssetTypeNames, c as SchemaSingletonNames, g as SchemaSettingsGroupNames, e as SchemaQueryNames, f as SchemaLocaleCodes } from './define-schema-mrEZbY1h.js';
1
+ import { cj as MergedRelyIOConfig, bC as ApiPath, bD as ApiMethod, ck as PathParamsOf, ca as ApiResponse, bF as Wire, c9 as RequestConfig, bL as BaseContent, ae as Reading, ai as UntypedReading, cl as ReadWhere, bO as WhereClause, bS as QueryOptions, aa as CheckedIncludes, af as ReadWith, bR as SortOptions, bX as ContentQueryResult, bT as CreateInput, bW as UpdateInput, bU as RevisedContent, bV as RestoredContent, bx as SDKError, cg as BaseValidationError, cf as ValidationViolation, aJ as AssetServedBlocks, cm as CheckedInclude, cn as components, bJ as AssetFileBlock, co as paths, by as RelyIOConfig, aq as InferContentType, ac as ContentReading, aH as InferAssetType, a9 as AssetReading, ay as InferSingleton, ah as SingletonReading, aD as InferSettingsGroup, ag as SettingsReading, bz as RelyIOConfigUpdate } from './include-paths-Cb7iPCW2.js';
2
+ import { a as SchemaDefinition, b as SchemaContentTypeNames, j as SchemaEntryOf, a8 as FilterOperator, h as SchemaAssetTypeNames, c as SchemaSingletonNames, g as SchemaSettingsGroupNames, e as SchemaQueryNames, f as SchemaLocaleCodes } from './define-schema-UHViXKiv.js';
4
3
  import { VisitorResyncReason } from './live-visitor.js';
5
4
  import { DevUnreadableReason } from './dev-handshake/index.js';
6
5
 
@@ -323,10 +322,14 @@ declare class ContentQueryBuilder<T extends BaseContent = BaseContent, F extends
323
322
  */
324
323
  headers(headers: Record<string, string>): this;
325
324
  /**
326
- * Add where conditions to the query: conditions on the fields the content type declares. A
327
- * condition on `_metadata` is refused here, before anything is sent (`refuseMetadataConditions`).
325
+ * Add where conditions to the query, each naming a value by its path: a field the content type
326
+ * declares, a field inside an object (`'pricing.basePrice'`), a reference inside its blocks —
327
+ * `{ 'sections.features': featureId }` keeps the entries some block of which holds that feature
328
+ * (REL-1810) — and rich text that can point at an entry, by the entries it points at. A typed read
329
+ * takes exactly the paths the API filters by (`FilterPaths`, REL-2136). A condition on `_metadata`
330
+ * is refused here, before anything is sent (`refuseMetadataConditions`).
328
331
  */
329
- where(conditions: WhereClause<F>): this;
332
+ where(conditions: ReadWhere<WhereClause<F>, R>): this;
330
333
  /**
331
334
  * Select specific fields to return
332
335
  */
@@ -657,9 +660,9 @@ declare function entityTagOf(response: {
657
660
  /**
658
661
  * Content fetch options
659
662
  */
660
- interface ContentFetchOptions<T extends BaseContent = BaseContent> {
661
- /** Filter conditions */
662
- where?: WhereClause<T>;
663
+ interface ContentFetchOptions<T extends BaseContent = BaseContent, R extends Reading = UntypedReading<T>> {
664
+ /** Filter conditions: what `query().where()` takes (REL-2136) */
665
+ where?: ReadWhere<WhereClause<T>, R>;
663
666
  /** Maximum entries to return */
664
667
  limit?: number;
665
668
  /** Entries to skip (offset pagination) */
@@ -724,10 +727,10 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
724
727
  /**
725
728
  * Fetch content with query options
726
729
  */
727
- fetch<const P extends readonly string[]>(options: Omit<ContentFetchOptions<T>, 'include'> & {
730
+ fetch<const P extends readonly string[]>(options: Omit<ContentFetchOptions<T, R>, 'include'> & {
728
731
  include: CheckedIncludes<R, P>;
729
732
  }): Promise<Array<ReadWith<R, P[number]>>>;
730
- fetch(options?: Omit<ContentFetchOptions<T>, 'include'>): Promise<T[]>;
733
+ fetch(options?: Omit<ContentFetchOptions<T, R>, 'include'>): Promise<T[]>;
731
734
  /**
732
735
  * Fetch a single content item by ID
733
736
  * @param id - Entry ID or slug
@@ -781,7 +784,7 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
781
784
  * @param where - Filter conditions
782
785
  * @param locale - Optional locale
783
786
  */
784
- fetchFirst(where?: WhereClause<T>, locale?: string): Promise<T | null>;
787
+ fetchFirst(where?: ReadWhere<WhereClause<T>, R>, locale?: string): Promise<T | null>;
785
788
  /**
786
789
  * Create a new content item
787
790
  * @param data - Content data
@@ -805,6 +808,8 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
805
808
  * request adds, as for {@link create}. `ifMatch` and `idempotencyKey` win over the same
806
809
  * header among them. `locale` defaults to the client's own, the locale whose entity tag
807
810
  * {@link fetchOneWithTag} reads, so the tag it hands back is checked against the same locale.
811
+ * @returns The entry, its `_metadata.brokenLinks` naming each entry link another entry publishes
812
+ * that this revision left pointing nowhere — empty when it took no heading away.
808
813
  */
809
814
  update(id: string, data: UpdateInput<T>, options?: {
810
815
  slug?: string;
@@ -812,7 +817,7 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
812
817
  parentId?: string;
813
818
  sortOrder?: number;
814
819
  headers?: Record<string, string>;
815
- } & ConditionalWriteOptions): Promise<T>;
820
+ } & ConditionalWriteOptions): Promise<RevisedContent<T>>;
816
821
  /**
817
822
  * Delete a content item by ID
818
823
  */
@@ -856,15 +861,19 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
856
861
  * The restore is validated as strictly as a publish, so it cannot publish invalid content, and it
857
862
  * records a new version of its own rather than rewinding the counter — so the revert is auditable
858
863
  * and itself reversible.
864
+ *
865
+ * @returns The entry, its `_metadata.leftOut` naming each value of the version the active schema
866
+ * no longer declares, and `_metadata.brokenLinks` the entry links it left pointing nowhere.
859
867
  */
860
- restore(id: string, versionNumber: number, locale: string, options?: ConditionalWriteOptions): Promise<T>;
868
+ restore(id: string, versionNumber: number, locale: string, options?: ConditionalWriteOptions): Promise<RestoredContent<T>>;
861
869
  /**
862
- * Get children of a hierarchical entry
870
+ * Get the direct children of a hierarchical entry. The route lists one level and takes no depth
871
+ * (REL-2195): `{ depth }` was sent as `?depth=`, which the API refused with `400`. A tree nested
872
+ * under each entry is a list or entry read's `query().children()`.
863
873
  * @param id - Parent entry ID
864
- * @param options - Fetch options
874
+ * @param options - Include paths to expand on each child, and the locale to read
865
875
  */
866
876
  children(id: string, options?: {
867
- depth?: number;
868
877
  include?: string[];
869
878
  locale?: string;
870
879
  }): Promise<T[]>;
@@ -964,12 +973,6 @@ type AssetVisibility = 'public' | 'protected' | 'private';
964
973
  type FileStatus = 'pending_upload' | 'uploading' | 'processing' | 'ready' | 'failed';
965
974
  /** Storage backend: `r2` = image + file kinds, `stream` = video kind. */
966
975
  type FileBackend = 'r2' | 'stream';
967
- /**
968
- * Customer-facing file binding block on an asset entry: the document's `AssetFile` — status,
969
- * backend, file name, MIME type, size, advisory hash, visibility, extracted metadata, focal point,
970
- * enrichment and scan status, processing stage/progress/error, and video playback readiness.
971
- */
972
- type AssetFileBlock = components['schemas']['AssetFile'];
973
976
  /** Extracted media metadata (Phase 1 basics + Phase 2 enrichment, plans 15–19); open-ended. */
974
977
  type AssetFileExtracted = NonNullable<AssetFileBlock['extracted']>;
975
978
  /**
@@ -978,33 +981,13 @@ type AssetFileExtracted = NonNullable<AssetFileBlock['extracted']>;
978
981
  * nothing of the entry's content. `processing.error` is present exactly while `status` is `failed`.
979
982
  */
980
983
  type FileStatusResult = components['schemas']['FileStatus'];
981
- /**
982
- * Computed gateway delivery URLs (the reserved `urls` key). Always served from
983
- * `cdn.relyio.net`. Image bindings expose `original` + `variants`; video bindings
984
- * expose `playback`/`poster`/`download`. Present only when `file.status` is
985
- * `ready` — otherwise the response omits `urls` and callers read `file.status`.
986
- */
987
- interface AssetUrls {
988
- /** Image: canonical original delivery URL. */
989
- original?: string;
990
- /** Image: variant id → delivery URL map. */
991
- variants?: Record<string, string>;
992
- /** Video: HLS/DASH manifest URL. */
993
- playback?: string;
994
- /** Video: poster image URL. */
995
- poster?: string;
996
- /** Video: downloadable MP4 URL (when enabled). */
997
- download?: string;
998
- [key: string]: unknown;
999
- }
984
+
1000
985
  /**
1001
986
  * An asset entry response: schema fields at the top level plus the reserved
1002
- * `file` + `urls` blocks and `_metadata`. `T` carries the inferred field shape.
987
+ * `file` + `urls` blocks and `_metadata`. `T` carries the inferred field shape — for a typed client
988
+ * `InferAssetType`, so this is `InferAssetEntry`, the shape an expanded asset reads as too.
1003
989
  */
1004
- type AssetEntryResponse<T extends BaseContent = BaseContent> = T & {
1005
- file?: AssetFileBlock;
1006
- urls?: AssetUrls;
1007
- };
990
+ type AssetEntryResponse<T extends BaseContent = BaseContent> = T & AssetServedBlocks;
1008
991
  /** Request a single upload target for the binding. */
1009
992
  interface PresignInput {
1010
993
  /** Original file name (required). */
@@ -1323,9 +1306,14 @@ declare class AssetUploadBuilder<T extends BaseContent = BaseContent> {
1323
1306
  * An asset read typed by the asset type's reading `R`: what the type's include paths make of its
1324
1307
  * fields, beside the `file` and `urls` blocks every asset read carries (REL-1801).
1325
1308
  */
1326
- interface AssetResponseReading<R extends Reading> extends Reading {
1309
+ interface AssetResponseReading<R extends Reading, T extends BaseContent = BaseContent> extends Reading {
1327
1310
  readonly read: AssetEntryResponse<Extract<ReadWith<R, this['include']>, BaseContent>>;
1328
1311
  readonly checked: CheckedInclude<R, this['path']>;
1312
+ /**
1313
+ * The asset type's own `where` — every path the API filters its fields by, never the `file` and
1314
+ * `urls` blocks — or, where no schema types it, the conditions `T`'s keys take (REL-2195).
1315
+ */
1316
+ readonly where: ReadWhere<WhereClause<T>, R>;
1329
1317
  }
1330
1318
  declare class AssetClient<T extends BaseContent = BaseContent, R extends Reading = UntypedReading<T>> {
1331
1319
  private readonly httpClient;
@@ -1341,19 +1329,19 @@ declare class AssetClient<T extends BaseContent = BaseContent, R extends Reading
1341
1329
  * Create a query builder for this asset type. It resolves asset reads; its conditions name the
1342
1330
  * asset type's fields, which the `file` and `urls` blocks are not.
1343
1331
  */
1344
- query(): ContentQueryBuilder<AssetEntryResponse<T>, T, AssetResponseReading<R>>;
1332
+ query(): ContentQueryBuilder<AssetEntryResponse<T>, T, AssetResponseReading<R, T>>;
1345
1333
  /** Find an asset entry by id (or slug) with fluent options. */
1346
- findById(id: string): ContentByIdBuilder<AssetEntryResponse<T>, AssetResponseReading<R>>;
1334
+ findById(id: string): ContentByIdBuilder<AssetEntryResponse<T>, AssetResponseReading<R, T>>;
1347
1335
  /** Fetch a single asset entry by id (or slug), or `null` if not found. */
1348
1336
  fetchOne<const P extends readonly string[]>(id: string, options: {
1349
1337
  include: CheckedIncludes<R, P>;
1350
1338
  locale?: string;
1351
- }): Promise<ReadWith<AssetResponseReading<R>, P[number]> | null>;
1339
+ }): Promise<ReadWith<AssetResponseReading<R, T>, P[number]> | null>;
1352
1340
  fetchOne(id: string, options?: {
1353
1341
  locale?: string;
1354
1342
  }): Promise<AssetEntryResponse<T> | null>;
1355
1343
  /** Fetch the first asset entry matching the conditions, or `null`. */
1356
- fetchFirst(where?: WhereClause<T>, locale?: string): Promise<AssetEntryResponse<T> | null>;
1344
+ fetchFirst(where?: ReadWhere<WhereClause<T>, R>, locale?: string): Promise<AssetEntryResponse<T> | null>;
1357
1345
  /**
1358
1346
  * Create a new asset entry as a draft. The binary is uploaded separately via
1359
1347
  * `file(uid)` (or use the high-level `upload()` helper), and the entry
@@ -3726,4 +3714,4 @@ declare function createClient<TSchema extends AnySchemaDefinition>(config: Typed
3726
3714
  */
3727
3715
  type ClientSchema<T extends TypedRelyIOClient<AnySchemaDefinition>> = T extends TypedRelyIOClient<infer TSchema> ? TSchema : never;
3728
3716
 
3729
- export { type BatchOptions as $, type ActiveSandbox as A, type SearchMode as B, type Change as C, type SearchResultItem as D, type ExtendedQueryResult as E, type FeedChange as F, type SearchHitMetadata as G, HttpClient as H, type SearchResponse as I, type AutocompleteSuggestion as J, type AutocompleteResponse as K, LIVE_KEEPALIVE_INTERVAL_MS as L, type SimilarResult as M, type SimilarResponse as N, type SearchFilter as O, type Project as P, type SearchFields as Q, type Register as R, type SandboxState as S, TypedRelyIOClient as T, type SearchSort as U, type SearchTypeName as V, type SearchEntry as W, BatchClient as X, BatchBuilder as Y, type BatchMethod as Z, type BatchOperation as _, ChangesExpiredError as a, type BatchOperationResult as a0, type BatchSummary as a1, type BatchResponse as a2, AdhocQueryClient as a3, AdhocQueryBuilder as a4, type FetchBlock as a5, type AggregateBlock as a6, type AggregateMetric as a7, type SearchBlock as a8, type FilterValue as a9, type MultipartCreateResult as aA, type MultipartPart as aB, type MultipartTarget as aC, type UploadProgress as aD, ResourceNotFoundError as aE, ResourceConflictError as aF, ResourceExpiredError as aG, isResourceNotFound as aH, type FileErrorCode as aI, type FileUploadErrorCode as aJ, FileUploadError as aK, FileValidationError as aL, type FileValidationConstraints as aM, validateFile as aN, type FullTextConfig as aa, type AdhocQueryDefinition as ab, type AdhocQueryOptions as ac, type QueryMetadata as ad, type AdhocQueryResult as ae, AssetClient as af, AssetFileBuilder as ag, AssetUploadBuilder as ah, isAssetEntry as ai, type AssetVisibility as aj, type FileStatus as ak, type FileBackend as al, type AssetFileBlock as am, type AssetFileExtracted as an, type FileStatusResult as ao, type AssetUrls as ap, type AssetEntryResponse as aq, type PopulatedAssetReference as ar, type PresignInput as as, type PresignResult as at, type ConfirmInput as au, type ConfirmResult as av, type ResolveUrlInput as aw, type ResolveUrlResult as ax, type CreateAssetOptions as ay, type WaitUntilReadyOptions as az, type ChangesExpiredReason as b, createClient as c, type TypedClientConfig as d, type ClientSchema as e, type RegisteredSchema as f, type SendOptions as g, entityTagOf as h, type ConditionalWriteOptions as i, type RetryableWriteOptions as j, type ChangesHeadOptions as k, type ChangesOptions as l, LIVE_SOCKET_OPEN_TIMEOUT_MS as m, type LiveChangesOptions as n, ContentClient as o, SingletonClient as p, SettingsClient as q, ContentQueryBuilder as r, ContentByIdBuilder as s, type ChildrenOptions as t, type SingletonFetchOptions as u, type SettingsFetchOptions as v, SearchClient as w, SearchBuilder as x, AutocompleteBuilder as y, SimilarBuilder as z };
3717
+ export { type BatchOptions as $, type ActiveSandbox as A, type SearchMode as B, type Change as C, type SearchResultItem as D, type ExtendedQueryResult as E, type FeedChange as F, type SearchHitMetadata as G, HttpClient as H, type SearchResponse as I, type AutocompleteSuggestion as J, type AutocompleteResponse as K, LIVE_KEEPALIVE_INTERVAL_MS as L, type SimilarResult as M, type SimilarResponse as N, type SearchFilter as O, type Project as P, type SearchFields as Q, type Register as R, type SandboxState as S, TypedRelyIOClient as T, type SearchSort as U, type SearchTypeName as V, type SearchEntry as W, BatchClient as X, BatchBuilder as Y, type BatchMethod as Z, type BatchOperation as _, ChangesExpiredError as a, type BatchOperationResult as a0, type BatchSummary as a1, type BatchResponse as a2, AdhocQueryClient as a3, AdhocQueryBuilder as a4, type FetchBlock as a5, type AggregateBlock as a6, type AggregateMetric as a7, type SearchBlock as a8, type FilterValue as a9, type MultipartTarget as aA, type UploadProgress as aB, ResourceNotFoundError as aC, ResourceConflictError as aD, ResourceExpiredError as aE, isResourceNotFound as aF, type FileErrorCode as aG, type FileUploadErrorCode as aH, FileUploadError as aI, FileValidationError as aJ, type FileValidationConstraints as aK, validateFile as aL, type FullTextConfig as aa, type AdhocQueryDefinition as ab, type AdhocQueryOptions as ac, type QueryMetadata as ad, type AdhocQueryResult as ae, AssetClient as af, AssetFileBuilder as ag, AssetUploadBuilder as ah, isAssetEntry as ai, type AssetVisibility as aj, type FileStatus as ak, type FileBackend as al, type AssetFileExtracted as am, type FileStatusResult as an, type AssetEntryResponse as ao, type PopulatedAssetReference as ap, type PresignInput as aq, type PresignResult as ar, type ConfirmInput as as, type ConfirmResult as at, type ResolveUrlInput as au, type ResolveUrlResult as av, type CreateAssetOptions as aw, type WaitUntilReadyOptions as ax, type MultipartCreateResult as ay, type MultipartPart as az, type ChangesExpiredReason as b, createClient as c, type TypedClientConfig as d, type ClientSchema as e, type RegisteredSchema as f, type SendOptions as g, entityTagOf as h, type ConditionalWriteOptions as i, type RetryableWriteOptions as j, type ChangesHeadOptions as k, type ChangesOptions as l, LIVE_SOCKET_OPEN_TIMEOUT_MS as m, type LiveChangesOptions as n, ContentClient as o, SingletonClient as p, SettingsClient as q, ContentQueryBuilder as r, ContentByIdBuilder as s, type ChildrenOptions as t, type SingletonFetchOptions as u, type SettingsFetchOptions as v, SearchClient as w, SearchBuilder as x, AutocompleteBuilder as y, SimilarBuilder as z };