@warp-drive-mirror/core 5.10.0-alpha.21 → 5.10.0-alpha.22

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 (133) hide show
  1. package/dist/{-private-CvZfrDZl.js → -private-DhEjiHue.js} +2 -2
  2. package/dist/{-private-CvZfrDZl.js.map → -private-DhEjiHue.js.map} +1 -1
  3. package/dist/build-config/babel-macros.d.ts +5 -0
  4. package/dist/build-config/canary-features.d.ts +5 -0
  5. package/dist/build-config/debugging.d.ts +59 -0
  6. package/dist/build-config/deprecations.d.ts +5 -0
  7. package/dist/build-config.d.ts +17 -0
  8. package/dist/{concepts-vh86nAcd.d.ts → concepts-Db9ssz1h.d.ts} +3 -3
  9. package/dist/{concepts-vh86nAcd.d.ts.map → concepts-Db9ssz1h.d.ts.map} +1 -1
  10. package/dist/configure.d.ts +8 -0
  11. package/dist/configure.js +1 -1
  12. package/dist/{document-B8Fup751.d.ts → document-BUmwSPVO.d.ts} +2 -2
  13. package/dist/{document-B8Fup751.d.ts.map → document-BUmwSPVO.d.ts.map} +1 -1
  14. package/dist/{fields-r1rZJB9d.d.ts → fields-B-jO-dzB.d.ts} +111 -47
  15. package/dist/fields-B-jO-dzB.d.ts.map +1 -0
  16. package/dist/graph/-private.d.ts +1 -1
  17. package/dist/graph/-private.js +33 -20
  18. package/dist/graph/-private.js.map +1 -1
  19. package/dist/{graph-BqxaFjEb.d.ts → graph-CoQhsOgT.d.ts} +3 -3
  20. package/dist/{graph-BqxaFjEb.d.ts.map → graph-CoQhsOgT.d.ts.map} +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/{internal-D_WIXC4r.d.ts → internal-BrC3kM86.d.ts} +20 -6
  24. package/dist/internal-BrC3kM86.d.ts.map +1 -0
  25. package/dist/reactive/-private.d.ts +1 -1
  26. package/dist/reactive.d.ts +276 -1
  27. package/dist/reactive.js +2 -2
  28. package/dist/{request-CxtnNIIp.js → request-qKqD2aCa.js} +2 -2
  29. package/dist/{request-CxtnNIIp.js.map → request-qKqD2aCa.js.map} +1 -1
  30. package/dist/request.d.ts +9 -1
  31. package/dist/request.js +1 -1
  32. package/dist/signals/-leaked.d.ts +15 -1
  33. package/dist/signals/-leaked.d.ts.map +1 -1
  34. package/dist/signals/-leaked.js +1 -1
  35. package/dist/{src-ccp1WKyt.js → src-spa19bCt.js} +30 -13
  36. package/dist/src-spa19bCt.js.map +1 -0
  37. package/dist/store/-private.d.ts +1 -1
  38. package/dist/store/-private.js +1 -1
  39. package/dist/store.d.ts +6 -1
  40. package/dist/types/-private.js +1 -1
  41. package/dist/types/cache/relationship.d.ts +5 -0
  42. package/dist/types/cache.d.ts +6 -1
  43. package/dist/types/graph.d.ts +6 -1
  44. package/dist/types/record.d.ts +5 -0
  45. package/dist/types/request.d.ts +1 -1
  46. package/dist/types/schema/concepts.d.ts +6 -1
  47. package/dist/types/schema/fields.d.ts +2 -2
  48. package/dist/types/schema/fields.js +82 -23
  49. package/dist/types/schema/fields.js.map +1 -1
  50. package/dist/types/schema/schema-service.d.ts +6 -1
  51. package/dist/types/spec/document.d.ts +1 -1
  52. package/dist/types/spec/error.d.ts +4 -0
  53. package/dist/types/spec/json-api-raw.d.ts +5 -0
  54. package/dist/types.d.ts +9 -1
  55. package/dist/unpkg/{dev-deprecated/-private-B4pCmkq-.js → dev/-private-BJ2WIhKs.js} +2 -2
  56. package/dist/unpkg/dev/{-private-B4pCmkq-.js.map → -private-BJ2WIhKs.js.map} +1 -1
  57. package/dist/unpkg/dev/configure.js +1 -1
  58. package/dist/unpkg/dev/graph/-private.js +34 -21
  59. package/dist/unpkg/dev/graph/-private.js.map +1 -1
  60. package/dist/unpkg/dev/index.js +1 -1
  61. package/dist/unpkg/dev/reactive.js +2 -2
  62. package/dist/unpkg/dev/{request-oWpijCPQ.js → request-6lzVjHLN.js} +2 -2
  63. package/dist/unpkg/{dev-deprecated/request-oWpijCPQ.js.map → dev/request-6lzVjHLN.js.map} +1 -1
  64. package/dist/unpkg/dev/request.js +1 -1
  65. package/dist/unpkg/dev/signals/-leaked.js +1 -1
  66. package/dist/unpkg/dev/{src-C4ET4R1n.js → src-D1dbEzXb.js} +31 -14
  67. package/dist/unpkg/dev/src-D1dbEzXb.js.map +1 -0
  68. package/dist/unpkg/dev/store/-private.js +1 -1
  69. package/dist/unpkg/dev/{store-dZViNfMK.js → store-DVS3G92Q.js} +2 -2
  70. package/dist/unpkg/dev/{store-dZViNfMK.js.map → store-DVS3G92Q.js.map} +1 -1
  71. package/dist/unpkg/dev/store.js +1 -1
  72. package/dist/unpkg/dev/types/-private.js +1 -1
  73. package/dist/unpkg/dev/types/schema/fields.js +82 -23
  74. package/dist/unpkg/dev/types/schema/fields.js.map +1 -1
  75. package/dist/unpkg/{dev/-private-B4pCmkq-.js → dev-deprecated/-private-BJ2WIhKs.js} +2 -2
  76. package/dist/unpkg/dev-deprecated/{-private-B4pCmkq-.js.map → -private-BJ2WIhKs.js.map} +1 -1
  77. package/dist/unpkg/dev-deprecated/configure.js +1 -1
  78. package/dist/unpkg/dev-deprecated/graph/-private.js +34 -21
  79. package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -1
  80. package/dist/unpkg/dev-deprecated/index.js +1 -1
  81. package/dist/unpkg/dev-deprecated/reactive.js +2 -2
  82. package/dist/unpkg/dev-deprecated/{request-oWpijCPQ.js → request-6lzVjHLN.js} +2 -2
  83. package/dist/unpkg/{dev/request-oWpijCPQ.js.map → dev-deprecated/request-6lzVjHLN.js.map} +1 -1
  84. package/dist/unpkg/dev-deprecated/request.js +1 -1
  85. package/dist/unpkg/dev-deprecated/signals/-leaked.js +1 -1
  86. package/dist/unpkg/dev-deprecated/{src-jHpowq3S.js → src-Tvv7X1KB.js} +30 -13
  87. package/dist/unpkg/dev-deprecated/src-Tvv7X1KB.js.map +1 -0
  88. package/dist/unpkg/dev-deprecated/store/-private.js +1 -1
  89. package/dist/unpkg/dev-deprecated/types/-private.js +1 -1
  90. package/dist/unpkg/dev-deprecated/types/schema/fields.js +82 -23
  91. package/dist/unpkg/dev-deprecated/types/schema/fields.js.map +1 -1
  92. package/dist/unpkg/{prod-deprecated/-private-CrUi_3E_.js → prod/-private-Dg07O05r.js} +2 -2
  93. package/dist/unpkg/{prod-deprecated/-private-CrUi_3E_.js.map → prod/-private-Dg07O05r.js.map} +1 -1
  94. package/dist/unpkg/prod/configure.js +1 -1
  95. package/dist/unpkg/prod/graph/-private.js +27 -12
  96. package/dist/unpkg/prod/graph/-private.js.map +1 -1
  97. package/dist/unpkg/prod/index.js +1 -1
  98. package/dist/unpkg/prod/reactive.js +2 -2
  99. package/dist/unpkg/{prod-deprecated/request-Cgw3j6Dx.js → prod/request-edWLn9JK.js} +2 -2
  100. package/dist/unpkg/prod/{request-Cgw3j6Dx.js.map → request-edWLn9JK.js.map} +1 -1
  101. package/dist/unpkg/prod/request.js +1 -1
  102. package/dist/unpkg/prod/signals/-leaked.js +1 -1
  103. package/dist/unpkg/prod/{src-DFmPDGQ6.js → src-BIRx6kC-.js} +33 -12
  104. package/dist/unpkg/prod/src-BIRx6kC-.js.map +1 -0
  105. package/dist/unpkg/prod/store/-private.js +1 -1
  106. package/dist/unpkg/prod/types/-private.js +1 -1
  107. package/dist/unpkg/prod/types/schema/fields.js +82 -23
  108. package/dist/unpkg/prod/types/schema/fields.js.map +1 -1
  109. package/dist/unpkg/{prod/-private-CrUi_3E_.js → prod-deprecated/-private-Dg07O05r.js} +2 -2
  110. package/dist/unpkg/{prod/-private-CrUi_3E_.js.map → prod-deprecated/-private-Dg07O05r.js.map} +1 -1
  111. package/dist/unpkg/prod-deprecated/configure.js +1 -1
  112. package/dist/unpkg/prod-deprecated/graph/-private.js +27 -12
  113. package/dist/unpkg/prod-deprecated/graph/-private.js.map +1 -1
  114. package/dist/unpkg/prod-deprecated/index.js +1 -1
  115. package/dist/unpkg/prod-deprecated/reactive.js +2 -2
  116. package/dist/unpkg/{prod/request-Cgw3j6Dx.js → prod-deprecated/request-edWLn9JK.js} +2 -2
  117. package/dist/unpkg/prod-deprecated/{request-Cgw3j6Dx.js.map → request-edWLn9JK.js.map} +1 -1
  118. package/dist/unpkg/prod-deprecated/request.js +1 -1
  119. package/dist/unpkg/prod-deprecated/signals/-leaked.js +1 -1
  120. package/dist/unpkg/prod-deprecated/{src-BgQLcshl.js → src-0f4an0QR.js} +33 -12
  121. package/dist/unpkg/prod-deprecated/src-0f4an0QR.js.map +1 -0
  122. package/dist/unpkg/prod-deprecated/store/-private.js +1 -1
  123. package/dist/unpkg/prod-deprecated/types/-private.js +1 -1
  124. package/dist/unpkg/prod-deprecated/types/schema/fields.js +82 -23
  125. package/dist/unpkg/prod-deprecated/types/schema/fields.js.map +1 -1
  126. package/package.json +4 -4
  127. package/dist/fields-r1rZJB9d.d.ts.map +0 -1
  128. package/dist/internal-D_WIXC4r.d.ts.map +0 -1
  129. package/dist/src-ccp1WKyt.js.map +0 -1
  130. package/dist/unpkg/dev/src-C4ET4R1n.js.map +0 -1
  131. package/dist/unpkg/dev-deprecated/src-jHpowq3S.js.map +0 -1
  132. package/dist/unpkg/prod/src-DFmPDGQ6.js.map +0 -1
  133. package/dist/unpkg/prod-deprecated/src-BgQLcshl.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import { $ as PrivateStore, At as CachePolicy, Ct as setRecordIdentifier, Et as assertPrivateCapabilities, G as logGroup, J as normalizeModelName, K as LegacyManyArray, Mt as StoreRequestContext, Nt as StoreRequestInput, Q as CreateRecordProperties, St as recordIdentifierFor, Tt as PrivateCacheCapabilitiesManager, W as log, X as ensureStringId, Y as coerceId, Z as constructResource, at as Request, bt as StoreMap, cn as isRequestKey, ct as SaveRecordMutation, dt as LegacyQueryArray, et as Store, ft as LegacyLiveArray, it as PrivateRequestStateService, jt as CacheHandler, ln as isResourceKey, lt as RecordArrayManager, mt as ReactiveResourceArray, nt as isPrivateStore, on as FieldValueIdentity, ot as RequestCacheRequestState, pt as PrivateReactiveResourceArray, q as createLegacyManyArray, rt as FindRecordQuery, sn as fieldValueIdentity, st as RequestStateService, tt as assertPrivateStore, ut as fastPush, vt as NativeProxy, wt as storeFor, xt as _clearCaches, yt as InstanceCache } from "../internal-D_WIXC4r.js";
1
+ import { $ as PrivateStore, At as CachePolicy, Ct as setRecordIdentifier, Et as assertPrivateCapabilities, G as logGroup, J as normalizeModelName, K as LegacyManyArray, Mt as StoreRequestContext, Nt as StoreRequestInput, Q as CreateRecordProperties, St as recordIdentifierFor, Tt as PrivateCacheCapabilitiesManager, W as log, X as ensureStringId, Y as coerceId, Z as constructResource, at as Request, bt as StoreMap, cn as isRequestKey, ct as SaveRecordMutation, dt as LegacyQueryArray, et as Store, ft as LegacyLiveArray, it as PrivateRequestStateService, jt as CacheHandler, ln as isResourceKey, lt as RecordArrayManager, mt as ReactiveResourceArray, nt as isPrivateStore, on as FieldValueIdentity, ot as RequestCacheRequestState, pt as PrivateReactiveResourceArray, q as createLegacyManyArray, rt as FindRecordQuery, sn as fieldValueIdentity, st as RequestStateService, tt as assertPrivateStore, ut as fastPush, vt as NativeProxy, wt as storeFor, xt as _clearCaches, yt as InstanceCache } from "../internal-BrC3kM86.js";
2
2
  export { CacheHandler, type CachePolicy, type LegacyQueryArray as CollectionRecordArray, type LegacyQueryArray, type CreateRecordProperties, type FieldValueIdentity, type FindRecordQuery, type InstanceCache, type LegacyLiveArray, type LegacyLiveArray as LiveArray, type LegacyManyArray, type LegacyManyArray as RelatedCollection, type NativeProxy, type PrivateCacheCapabilitiesManager, type PrivateReactiveResourceArray, type PrivateRequestStateService, type PrivateStore, type ReactiveResourceArray, RecordArrayManager, type Request, type RequestCacheRequestState, type RequestStateService, type SaveRecordMutation, Store, StoreMap, type StoreRequestContext, type StoreRequestInput, _clearCaches, normalizeModelName as _deprecatingNormalize, assertPrivateCapabilities, assertPrivateStore, coerceId, constructResource, createLegacyManyArray, ensureStringId, fastPush, fieldValueIdentity, isPrivateStore, isRequestKey, isResourceKey, log, logGroup, recordIdentifierFor, setRecordIdentifier, storeFor };
@@ -1,3 +1,3 @@
1
- import { C as setRecordIdentifier, D as isRequestKey, E as fieldValueIdentity, F as coerceId, I as ensureStringId, L as log, O as isResourceKey, P as normalizeModelName, R as logGroup, S as recordIdentifierFor, T as assertPrivateCapabilities, _ as isPrivateStore, b as StoreMap, f as createLegacyManyArray, g as assertPrivateStore, h as Store, m as CacheHandler, p as constructResource, v as RecordArrayManager, w as storeFor, x as _clearCaches, y as fastPush } from "../src-ccp1WKyt.js";
1
+ import { C as setRecordIdentifier, D as isRequestKey, E as fieldValueIdentity, F as coerceId, I as ensureStringId, L as log, O as isResourceKey, P as normalizeModelName, R as logGroup, S as recordIdentifierFor, T as assertPrivateCapabilities, _ as isPrivateStore, b as StoreMap, f as createLegacyManyArray, g as assertPrivateStore, h as Store, m as CacheHandler, p as constructResource, v as RecordArrayManager, w as storeFor, x as _clearCaches, y as fastPush } from "../src-spa19bCt.js";
2
2
 
3
3
  export { CacheHandler, RecordArrayManager, Store, StoreMap, _clearCaches, normalizeModelName as _deprecatingNormalize, assertPrivateCapabilities, assertPrivateStore, coerceId, constructResource, createLegacyManyArray, ensureStringId, fastPush, fieldValueIdentity, isPrivateStore, isRequestKey, isResourceKey, log, logGroup, recordIdentifierFor, setRecordIdentifier, storeFor };
package/dist/store.d.ts CHANGED
@@ -1,2 +1,7 @@
1
- import { F as PolicyConfig, I as parseCacheControl, N as CacheControlValue, P as DefaultCachePolicy, rn as NotificationManager } from "./internal-D_WIXC4r.js";
1
+ /**
2
+ * @module
3
+ * @summary The `DefaultCachePolicy` and `parseCacheControl` for expiring cached requests, plus the
4
+ * `NotificationManager` type for subscribing to cache change notifications.
5
+ */
6
+ import { F as PolicyConfig, I as parseCacheControl, N as CacheControlValue, P as DefaultCachePolicy, rn as NotificationManager } from "./internal-BrC3kM86.js";
2
7
  export { type CacheControlValue, DefaultCachePolicy, type NotificationManager, type PolicyConfig, parseCacheControl };
@@ -2,7 +2,7 @@ import { getGlobalConfig, macroCondition } from "@embroider/macros";
2
2
 
3
3
  // src/types/-private.ts
4
4
  const name = "@warp-drive-mirror/core";
5
- const version = "5.10.0-alpha.21";
5
+ const version = "5.10.0-alpha.22";
6
6
  const GlobalRef = globalThis;
7
7
  const UniversalCache = GlobalRef.__warpDrive_universalCache = GlobalRef.__warpDrive_universalCache ?? {};
8
8
  GlobalRef[name] = GlobalRef[name] ?? { __version: version };
@@ -1,2 +1,7 @@
1
+ /**
2
+ * @module
3
+ * @summary Types for the cache-side state of to-one and to-many relationships, with related resources referenced by
4
+ * `ResourceKey`.
5
+ */
1
6
  import { n as Relationship, r as ResourceRelationship, t as CollectionRelationship } from "../../relationship-99pc4CaS.js";
2
7
  export { CollectionRelationship, Relationship, ResourceRelationship };
@@ -1,2 +1,7 @@
1
- import { Qt as RelationshipDiff, Xt as Cache, Zt as ChangedAttributesHash } from "../internal-D_WIXC4r.js";
1
+ /**
2
+ * @module
3
+ * @summary The `Cache` interface a cache implementation fulfills to store, patch, mutate and read documents and
4
+ * resources, plus the `ChangedAttributesHash` and `RelationshipDiff` types.
5
+ */
6
+ import { Qt as RelationshipDiff, Xt as Cache, Zt as ChangedAttributesHash } from "../internal-BrC3kM86.js";
2
7
  export { Cache, ChangedAttributesHash, RelationshipDiff };
@@ -1,2 +1,7 @@
1
- import { a as ReplaceRelatedRecordOperation, c as UnknownOperation, i as RemoteRelationshipOperation, l as UpdateRelationshipOperation, n as LocalRelationshipOperation, o as ReplaceRelatedRecordsOperation, r as Operation, s as SortRelatedRecords, t as DeleteRecordOperation } from "../graph-BqxaFjEb.js";
1
+ /**
2
+ * @module
3
+ * @summary Types for the operations that update a relationship's remote (persisted) or local (uncommitted) state in the
4
+ * relationship Graph.
5
+ */
6
+ import { a as ReplaceRelatedRecordOperation, c as UnknownOperation, i as RemoteRelationshipOperation, l as UpdateRelationshipOperation, n as LocalRelationshipOperation, o as ReplaceRelatedRecordsOperation, r as Operation, s as SortRelatedRecords, t as DeleteRecordOperation } from "../graph-CoQhsOgT.js";
2
7
  export { DeleteRecordOperation, LocalRelationshipOperation, Operation, RemoteRelationshipOperation, ReplaceRelatedRecordOperation, ReplaceRelatedRecordsOperation, SortRelatedRecords, UnknownOperation, UpdateRelationshipOperation };
@@ -1,2 +1,7 @@
1
+ /**
2
+ * @module
3
+ * @summary Types for records that declare their resource type via the `[Type]` symbol, including `TypedRecordInstance`,
4
+ * `Includes`, `Mask` and the `createIncludeValidator` helper.
5
+ */
1
6
  import { a as StringSatisfiesIncludes, c as TypedRecordInstance, i as OpaqueRecordInstance, l as Validate, n as Includes, o as TypeFromInstance, r as Mask, s as TypeFromInstanceOrString, t as ExtractSuggestedCacheTypes, u as createIncludeValidator } from "../record-f5-uOgHt.js";
2
7
  export { ExtractSuggestedCacheTypes, Includes, Mask, OpaqueRecordInstance, StringSatisfiesIncludes, TypeFromInstance, TypeFromInstanceOrString, TypedRecordInstance, Validate, createIncludeValidator };
@@ -1,2 +1,2 @@
1
- import { $n as STRUCTURED, Bn as HTTPMethod, Fn as CreateRequestOptions, Gn as ImmutableRequestInfo, Hn as ImmutableCreateRequestOptions, In as DeleteRequestOptions, Jn as QueryRequestOptions, Kn as ImmutableUpdateRequestOptions, Ln as EnableHydration, Nn as CacheOptions, Pn as ConstrainedRequestOptions, Qn as ResponseInfo, Rn as FindRecordOptions, Un as ImmutableDeleteRequestOptions, Vn as IS_FUTURE, Wn as ImmutableHeaders, Xn as RequestContext, Yn as RemotelyAccessibleIdentifier, Zn as RequestInfo, ar as FetchError, er as SkipCache, ir as UpdateRequestOptions, nr as StructuredDocument, qn as PostQueryRequestOptions, rr as StructuredErrorDocument, tr as StructuredDataDocument, zn as FindRecordRequestOptions } from "../internal-D_WIXC4r.js";
1
+ import { $n as STRUCTURED, Bn as HTTPMethod, Fn as CreateRequestOptions, Gn as ImmutableRequestInfo, Hn as ImmutableCreateRequestOptions, In as DeleteRequestOptions, Jn as QueryRequestOptions, Kn as ImmutableUpdateRequestOptions, Ln as EnableHydration, Nn as CacheOptions, Pn as ConstrainedRequestOptions, Qn as ResponseInfo, Rn as FindRecordOptions, Un as ImmutableDeleteRequestOptions, Vn as IS_FUTURE, Wn as ImmutableHeaders, Xn as RequestContext, Yn as RemotelyAccessibleIdentifier, Zn as RequestInfo, ar as FetchError, er as SkipCache, ir as UpdateRequestOptions, nr as StructuredDocument, qn as PostQueryRequestOptions, rr as StructuredErrorDocument, tr as StructuredDataDocument, zn as FindRecordRequestOptions } from "../internal-BrC3kM86.js";
2
2
  export { CacheOptions, ConstrainedRequestOptions, CreateRequestOptions, DeleteRequestOptions, EnableHydration, type FetchError, FindRecordOptions, FindRecordRequestOptions, HTTPMethod, IS_FUTURE, ImmutableCreateRequestOptions, ImmutableDeleteRequestOptions, ImmutableHeaders, ImmutableRequestInfo, ImmutableUpdateRequestOptions, PostQueryRequestOptions, QueryRequestOptions, RemotelyAccessibleIdentifier, RequestContext, RequestInfo, ResponseInfo, STRUCTURED, SkipCache, StructuredDataDocument, StructuredDocument, StructuredErrorDocument, UpdateRequestOptions };
@@ -1,2 +1,7 @@
1
- import { n as HashFn, r as Transformation, t as Derivation } from "../../concepts-vh86nAcd.js";
1
+ /**
2
+ * @module
3
+ * @summary Types for the functions schemas reference by name: `Transformation` to convert field values, `Derivation`
4
+ * for computed fields and `HashFn` for object identity.
5
+ */
6
+ import { n as HashFn, r as Transformation, t as Derivation } from "../../concepts-Db9ssz1h.js";
2
7
  export { Derivation, HashFn, Transformation };
@@ -1,2 +1,2 @@
1
- import { A as ResourceField, C as ObjectField, D as PolarisModeFieldSchema, E as PolarisAliasField, F as Trait, I as isLegacyResourceSchema, L as isResourceSchema, M as Schema, N as SchemaArrayField, O as PolarisResourceSchema, P as SchemaObjectField, R as objectSchema, S as ObjectAliasField, T as ObjectSchema, _ as LegacyResourceSchema, a as DerivedField, b as LinksModeHasManyField, c as HashField, d as LegacyAttributeField, f as LegacyBelongsToField, g as LegacyRelationshipField, h as LegacyModeFieldSchema, i as CollectionField, j as ResourceSchema, k as PolarisTrait, l as IdentityField, m as LegacyHasManyField, n as AttrOptions, o as FieldSchema, p as LegacyField, r as CacheableFieldSchema, s as GenericField, t as ArrayField, u as LegacyAliasField, v as LegacyTrait, w as ObjectFieldSchema, x as LocalField, y as LinksModeBelongsToField, z as resourceSchema } from "../../fields-r1rZJB9d.js";
2
- export { ArrayField, AttrOptions, CacheableFieldSchema, CollectionField, DerivedField, FieldSchema, GenericField, HashField, IdentityField, LegacyAliasField, LegacyAttributeField, LegacyBelongsToField, LegacyField, LegacyHasManyField, LegacyModeFieldSchema, LegacyRelationshipField, LegacyResourceSchema, LegacyTrait, LinksModeBelongsToField, LinksModeHasManyField, LocalField, ObjectAliasField, ObjectField, ObjectFieldSchema, ObjectSchema, PolarisAliasField, PolarisModeFieldSchema, PolarisResourceSchema, PolarisTrait, ResourceField, ResourceSchema, Schema, SchemaArrayField, SchemaObjectField, Trait, isLegacyResourceSchema, isResourceSchema, objectSchema, resourceSchema };
1
+ import { A as ResourceField, B as isSingleKind, C as ObjectField, D as PolarisModeFieldSchema, E as PolarisAliasField, F as Trait, H as resourceSchema, I as isLegacyResourceSchema, L as isManyKind, M as Schema, N as SchemaArrayField, O as PolarisResourceSchema, P as SchemaObjectField, R as isRelationshipKind, S as ObjectAliasField, T as ObjectSchema, V as objectSchema, _ as LegacyResourceSchema, a as DerivedField, b as LinksModeHasManyField, c as HashField, d as LegacyAttributeField, f as LegacyBelongsToField, g as LegacyRelationshipField, h as LegacyModeFieldSchema, i as CollectionField, j as ResourceSchema, k as PolarisTrait, l as IdentityField, m as LegacyHasManyField, n as AttrOptions, o as FieldSchema, p as LegacyField, r as CacheableFieldSchema, s as GenericField, t as ArrayField, u as LegacyAliasField, v as LegacyTrait, w as ObjectFieldSchema, x as LocalField, y as LinksModeBelongsToField, z as isResourceSchema } from "../../fields-B-jO-dzB.js";
2
+ export { ArrayField, AttrOptions, CacheableFieldSchema, CollectionField, DerivedField, FieldSchema, GenericField, HashField, IdentityField, LegacyAliasField, LegacyAttributeField, LegacyBelongsToField, LegacyField, LegacyHasManyField, LegacyModeFieldSchema, LegacyRelationshipField, LegacyResourceSchema, LegacyTrait, LinksModeBelongsToField, LinksModeHasManyField, LocalField, ObjectAliasField, ObjectField, ObjectFieldSchema, ObjectSchema, PolarisAliasField, PolarisModeFieldSchema, PolarisResourceSchema, PolarisTrait, ResourceField, ResourceSchema, Schema, SchemaArrayField, SchemaObjectField, Trait, isLegacyResourceSchema, isManyKind, isRelationshipKind, isResourceSchema, isSingleKind, objectSchema, resourceSchema };
@@ -280,31 +280,64 @@
280
280
  * Represents a field that is a reference to
281
281
  * another resource.
282
282
  *
283
- * SUPPORT FOR THIS FEATURE IS NOT YET COMPLETE
284
- * IN ReactiveResource. It is not yet part of
285
- * {@link PolarisModeFieldSchema} or {@link LegacyModeFieldSchema}.
286
- * Reading the field returns an object with the related
287
- * record as `data`, plus `links`, `meta` and a `fetch()`
288
- * method, but it does not yet update when the
289
- * relationship changes, and setting it is not supported.
283
+ * The value of a `resource` field on a ReactiveResource is a
284
+ * `ReactiveRelationshipDocument` whose `data` is the related
285
+ * resource (or `null`), and whose `links` and `meta` mirror the
286
+ * relationship payload received from the API.
290
287
  *
291
- * @summary Field schema of kind `resource` for a reference to another resource; not yet implemented by
292
- * `ReactiveResource`.
288
+ * ```ts
289
+ * const user = store.peekRecord<User>('user', '1');
290
+ * user.bestFriend.data; // User | null | undefined
291
+ * user.bestFriend.links; // { related: '/users/1/best-friend' }
292
+ * ```
293
+ *
294
+ * The relationship payload for this field is expected to have the
295
+ * shape `{ data?: { type, id } | null, links?: Links, meta?: Meta }`.
296
+ * When `data` is omitted from the payload `doc.data` is `undefined`
297
+ * and `doc.fetch()` may be used to load the related resource via
298
+ * the `related` link.
299
+ *
300
+ * In LegacyMode the relationship is mutable via `doc.data = record`.
301
+ * In PolarisMode it is immutable unless the parent resource has been
302
+ * checked out for editing.
303
+ *
304
+ * @summary Field schema of kind `resource` for a reference to another resource, whose value is a
305
+ * `ReactiveRelationshipDocument`.
293
306
  * @public
294
307
  */
295
308
  /**
296
309
  * Represents a field that is a reference to
297
- * a collection of other resources, potentially
298
- * paginate.
310
+ * a collection of other resources.
311
+ *
312
+ * The value of a `collection` field on a ReactiveResource is a
313
+ * `ReactiveRelationshipDocument` whose `data` is a reactive array
314
+ * of the related resources, and whose `links` and `meta` mirror the
315
+ * relationship payload received from the API.
316
+ *
317
+ * ```ts
318
+ * const user = store.peekRecord<User>('user', '1');
319
+ * user.friends.data; // User[] | undefined
320
+ * user.friends.links; // { related: '/users/1/friends' }
321
+ * ```
299
322
  *
300
- * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED
301
- * BY ReactiveResource. It is not yet part of
302
- * {@link PolarisModeFieldSchema} or {@link LegacyModeFieldSchema},
303
- * and reading or setting the field fails an assertion
304
- * in development builds.
323
+ * The relationship payload for this field is expected to have the
324
+ * shape `{ data?: { type, id }[], links?: Links, meta?: Meta }`.
325
+ * When `data` is omitted from the payload `doc.data` is `undefined`
326
+ * and `doc.fetch()` may be used to load the related resources via
327
+ * the `related` link.
305
328
  *
306
- * @summary Field schema of kind `collection` for a possibly paginated reference to other resources; not yet implemented
307
- * by `ReactiveResource`.
329
+ * Collection relationships are not paginated: pagination links present
330
+ * on the relationship are surfaced on `doc.links` but are never merged
331
+ * into the relationship's membership. Large, sortable, filterable or
332
+ * paginated lists should be loaded with a top-level request instead.
333
+ *
334
+ * In LegacyMode the relationship is mutable via `doc.data.push(record)`
335
+ * (and the other array mutation methods) or `doc.data = [records]`.
336
+ * In PolarisMode it is immutable unless the parent resource has been
337
+ * checked out for editing.
338
+ *
339
+ * @summary Field schema of kind `collection` for a reference to other resources, whose value is a
340
+ * `ReactiveRelationshipDocument`.
308
341
  * @public
309
342
  */
310
343
  /**
@@ -400,8 +433,8 @@
400
433
  * - {@link ArrayField}
401
434
  * - {@link SchemaArrayField}
402
435
  * - {@link DerivedField}
403
- * - {@link ResourceField | ResourceField (not yet implemented)}
404
- * - {@link CollectionField | CollectionField (not yet implemented)}
436
+ * - {@link ResourceField}
437
+ * - {@link CollectionField}
405
438
  * - {@link LegacyAttributeField}
406
439
  * - {@link LegacyBelongsToField}
407
440
  * - {@link LegacyHasManyField}
@@ -423,8 +456,8 @@
423
456
  * - {@link ArrayField}
424
457
  * - {@link SchemaArrayField}
425
458
  * - {@link DerivedField}
426
- * - {@link ResourceField | ResourceField (not yet implemented)}
427
- * - {@link CollectionField | CollectionField (not yet implemented)}
459
+ * - {@link ResourceField}
460
+ * - {@link CollectionField}
428
461
  * - {@link LinksModeBelongsToField}
429
462
  * - {@link LinksModeHasManyField}
430
463
  *
@@ -591,6 +624,32 @@ function objectSchema(schema) {
591
624
  * `@id`.
592
625
  * @public
593
626
  */
627
+ /**
628
+ * Whether a field kind is a to-many relationship: the legacy `hasMany` or the
629
+ * `collection` kind.
630
+ *
631
+ * @public
632
+ */
633
+ function isManyKind(kind) {
634
+ return kind === "hasMany" || kind === "collection";
635
+ }
636
+ /**
637
+ * Whether a field kind is a to-one relationship: the legacy `belongsTo` or the
638
+ * `resource` kind.
639
+ *
640
+ * @public
641
+ */
642
+ function isSingleKind(kind) {
643
+ return kind === "belongsTo" || kind === "resource";
644
+ }
645
+ /**
646
+ * Whether a field kind is any relationship kind, legacy or not.
647
+ *
648
+ * @public
649
+ */
650
+ function isRelationshipKind(kind) {
651
+ return isManyKind(kind) || isSingleKind(kind);
652
+ }
594
653
  function isResourceSchema(schema) {
595
654
  return schema?.identity?.kind === "@id";
596
655
  }
@@ -635,5 +694,5 @@ function isLegacyResourceSchema(schema) {
635
694
  * @summary Union of the legacy belongsTo and hasMany field schemas, including their LinksMode variants.
636
695
  * @public
637
696
  */
638
- export { isLegacyResourceSchema, isResourceSchema, objectSchema, resourceSchema };
697
+ export { isLegacyResourceSchema, isManyKind, isRelationshipKind, isResourceSchema, isSingleKind, objectSchema, resourceSchema };
639
698
  //# sourceMappingURL=fields.js.map