@warp-drive/core 5.8.0-alpha.4 → 5.8.0-alpha.40

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 (248) hide show
  1. package/README.md +22 -38
  2. package/declarations/build-config.d.ts +18 -1
  3. package/declarations/graph/-private/-edge-definition.d.ts +12 -2
  4. package/declarations/index.d.ts +90 -8
  5. package/declarations/reactive/-private/document.d.ts +58 -46
  6. package/declarations/reactive/-private/record.d.ts +10 -1
  7. package/declarations/reactive/-private/schema.d.ts +77 -4
  8. package/declarations/reactive/-private.d.ts +1 -0
  9. package/declarations/reactive.d.ts +13 -7
  10. package/declarations/request/-private/types.d.ts +1 -1
  11. package/declarations/request.d.ts +47 -0
  12. package/declarations/store/-private/caches/instance-cache.d.ts +5 -6
  13. package/declarations/store/-private/default-cache-policy.d.ts +147 -129
  14. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +1 -1
  15. package/declarations/store/-private/managers/cache-key-manager.d.ts +26 -8
  16. package/declarations/store/-private/managers/cache-manager.d.ts +6 -4
  17. package/declarations/store/-private/managers/notification-manager.d.ts +1 -1
  18. package/declarations/store/-private/new-core-tmp/promise-state.d.ts +1 -0
  19. package/declarations/store/-private/new-core-tmp/request-state.d.ts +1 -1
  20. package/declarations/store/-private/store-service.d.ts +43 -64
  21. package/declarations/store/-private.d.ts +0 -1
  22. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +1 -1
  23. package/declarations/store/deprecated/-private.d.ts +1 -1
  24. package/declarations/store/deprecated/store.d.ts +33 -32
  25. package/declarations/store.d.ts +1 -0
  26. package/declarations/types/cache.d.ts +8 -6
  27. package/declarations/types/record.d.ts +132 -0
  28. package/declarations/types/request.d.ts +26 -14
  29. package/declarations/types/schema/fields.d.ts +33 -9
  30. package/declarations/{store/-types/q → types/schema}/schema-service.d.ts +15 -13
  31. package/declarations/types/spec/document.d.ts +34 -0
  32. package/declarations/types/symbols.d.ts +2 -2
  33. package/declarations/types.d.ts +1 -1
  34. package/dist/build-config.js +1 -1
  35. package/dist/default-cache-policy-D7_u4YRH.js +572 -0
  36. package/dist/graph/-private.js +13 -4
  37. package/dist/{request-state-CUuZzgvE.js → index-BKcD4JZK.js} +10018 -8847
  38. package/dist/index.js +6 -382
  39. package/dist/reactive.js +4 -778
  40. package/dist/{context-C_7OLieY.js → request-oqoLC9rz.js} +219 -172
  41. package/dist/request.js +1 -1
  42. package/dist/store/-private.js +1 -1
  43. package/dist/store.js +1 -533
  44. package/dist/types/-private.js +1 -1
  45. package/dist/types/record.js +127 -0
  46. package/dist/types/request.js +14 -12
  47. package/dist/types/schema/fields.js +14 -0
  48. package/dist/types/schema/schema-service.js +0 -0
  49. package/dist/types/symbols.js +2 -2
  50. package/dist/unpkg/dev/-private-3C1OkYtZ.js +39 -0
  51. package/dist/unpkg/dev/build-config/babel-macros.js +1 -0
  52. package/dist/unpkg/dev/build-config/canary-features.js +1 -0
  53. package/dist/unpkg/dev/build-config/debugging.js +1 -0
  54. package/dist/unpkg/dev/build-config/deprecations.js +1 -0
  55. package/dist/unpkg/dev/build-config/env.js +1 -0
  56. package/dist/unpkg/dev/build-config/macros.js +1 -0
  57. package/dist/unpkg/dev/build-config.js +1 -0
  58. package/dist/unpkg/dev/configure-BC66sfNO.js +183 -0
  59. package/dist/unpkg/dev/configure.js +1 -0
  60. package/dist/unpkg/dev/graph/-private.js +3131 -0
  61. package/dist/unpkg/dev/index-DqhXrNZ_.js +11160 -0
  62. package/dist/unpkg/dev/index.js +6 -0
  63. package/dist/unpkg/dev/reactive/-private.js +1 -0
  64. package/dist/unpkg/dev/reactive.js +127 -0
  65. package/dist/unpkg/dev/request-CA9K0gXq.js +719 -0
  66. package/dist/unpkg/dev/request.js +1 -0
  67. package/dist/unpkg/dev/runtime-DGG4CvlW.js +135 -0
  68. package/dist/unpkg/dev/store/-private.js +56 -0
  69. package/dist/unpkg/dev/store.js +558 -0
  70. package/dist/unpkg/dev/types/-private.js +69 -0
  71. package/dist/unpkg/dev/types/cache/aliases.js +0 -0
  72. package/dist/unpkg/dev/types/cache/change.js +0 -0
  73. package/dist/unpkg/dev/types/cache/mutations.js +0 -0
  74. package/dist/unpkg/dev/types/cache/operations.js +0 -0
  75. package/dist/unpkg/dev/types/cache/relationship.js +0 -0
  76. package/dist/unpkg/dev/types/cache.js +0 -0
  77. package/dist/unpkg/dev/types/graph.js +0 -0
  78. package/dist/unpkg/dev/types/identifier.js +61 -0
  79. package/dist/unpkg/dev/types/json/raw.js +0 -0
  80. package/dist/unpkg/dev/types/params.js +0 -0
  81. package/dist/unpkg/dev/types/record.js +191 -0
  82. package/dist/unpkg/dev/types/request.js +77 -0
  83. package/dist/unpkg/dev/types/runtime.js +34 -0
  84. package/dist/unpkg/dev/types/schema/concepts.js +0 -0
  85. package/dist/unpkg/dev/types/schema/fields.js +505 -0
  86. package/dist/unpkg/dev/types/schema/fields.type-test.js +0 -0
  87. package/dist/unpkg/dev/types/schema/schema-service.js +0 -0
  88. package/dist/unpkg/dev/types/spec/document.js +0 -0
  89. package/dist/unpkg/dev/types/spec/error.js +0 -0
  90. package/dist/unpkg/dev/types/spec/json-api-raw.js +0 -0
  91. package/dist/unpkg/dev/types/symbols.js +84 -0
  92. package/dist/unpkg/dev/types/utils.js +0 -0
  93. package/dist/unpkg/dev/types.js +0 -0
  94. package/dist/unpkg/dev/utils/string.js +91 -0
  95. package/dist/unpkg/dev-deprecated/-private-3C1OkYtZ.js +39 -0
  96. package/dist/unpkg/dev-deprecated/build-config/babel-macros.js +1 -0
  97. package/dist/unpkg/dev-deprecated/build-config/canary-features.js +1 -0
  98. package/dist/unpkg/dev-deprecated/build-config/debugging.js +1 -0
  99. package/dist/unpkg/dev-deprecated/build-config/deprecations.js +1 -0
  100. package/dist/unpkg/dev-deprecated/build-config/env.js +1 -0
  101. package/dist/unpkg/dev-deprecated/build-config/macros.js +1 -0
  102. package/dist/unpkg/dev-deprecated/build-config.js +1 -0
  103. package/dist/unpkg/dev-deprecated/configure-BC66sfNO.js +183 -0
  104. package/dist/unpkg/dev-deprecated/configure.js +1 -0
  105. package/dist/unpkg/dev-deprecated/graph/-private.js +3326 -0
  106. package/dist/unpkg/dev-deprecated/index-BBlq5is_.js +11775 -0
  107. package/dist/unpkg/dev-deprecated/index.js +5 -0
  108. package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -0
  109. package/dist/unpkg/dev-deprecated/reactive.js +127 -0
  110. package/dist/unpkg/dev-deprecated/request-CA9K0gXq.js +719 -0
  111. package/dist/unpkg/dev-deprecated/request.js +1 -0
  112. package/dist/unpkg/dev-deprecated/runtime-DfhJzpZH.js +135 -0
  113. package/dist/unpkg/dev-deprecated/store/-private.js +2 -0
  114. package/dist/unpkg/dev-deprecated/store.js +558 -0
  115. package/dist/unpkg/dev-deprecated/types/-private.js +69 -0
  116. package/dist/unpkg/dev-deprecated/types/cache/aliases.js +0 -0
  117. package/dist/unpkg/dev-deprecated/types/cache/change.js +0 -0
  118. package/dist/unpkg/dev-deprecated/types/cache/mutations.js +0 -0
  119. package/dist/unpkg/dev-deprecated/types/cache/operations.js +0 -0
  120. package/dist/unpkg/dev-deprecated/types/cache/relationship.js +0 -0
  121. package/dist/unpkg/dev-deprecated/types/cache.js +0 -0
  122. package/dist/unpkg/dev-deprecated/types/graph.js +0 -0
  123. package/dist/unpkg/dev-deprecated/types/identifier.js +61 -0
  124. package/dist/unpkg/dev-deprecated/types/json/raw.js +0 -0
  125. package/dist/unpkg/dev-deprecated/types/params.js +0 -0
  126. package/dist/unpkg/dev-deprecated/types/record.js +191 -0
  127. package/dist/unpkg/dev-deprecated/types/request.js +77 -0
  128. package/dist/unpkg/dev-deprecated/types/runtime.js +34 -0
  129. package/dist/unpkg/dev-deprecated/types/schema/concepts.js +0 -0
  130. package/dist/unpkg/dev-deprecated/types/schema/fields.js +505 -0
  131. package/dist/unpkg/dev-deprecated/types/schema/fields.type-test.js +0 -0
  132. package/dist/unpkg/dev-deprecated/types/schema/schema-service.js +0 -0
  133. package/dist/unpkg/dev-deprecated/types/spec/document.js +0 -0
  134. package/dist/unpkg/dev-deprecated/types/spec/error.js +0 -0
  135. package/dist/unpkg/dev-deprecated/types/spec/json-api-raw.js +0 -0
  136. package/dist/unpkg/dev-deprecated/types/symbols.js +84 -0
  137. package/dist/unpkg/dev-deprecated/types/utils.js +0 -0
  138. package/dist/unpkg/dev-deprecated/types.js +0 -0
  139. package/dist/unpkg/dev-deprecated/utils/string.js +91 -0
  140. package/dist/unpkg/prod/-private-3C1OkYtZ.js +39 -0
  141. package/dist/unpkg/prod/build-config/babel-macros.js +1 -0
  142. package/dist/unpkg/prod/build-config/canary-features.js +1 -0
  143. package/dist/unpkg/prod/build-config/debugging.js +1 -0
  144. package/dist/unpkg/prod/build-config/deprecations.js +1 -0
  145. package/dist/unpkg/prod/build-config/env.js +1 -0
  146. package/dist/unpkg/prod/build-config/macros.js +1 -0
  147. package/dist/unpkg/prod/build-config.js +1 -0
  148. package/dist/unpkg/prod/configure-C0C1LpG6.js +158 -0
  149. package/dist/unpkg/prod/configure.js +1 -0
  150. package/dist/unpkg/prod/graph/-private.js +2234 -0
  151. package/dist/unpkg/prod/handler-LAyD1Y5l.js +1619 -0
  152. package/dist/unpkg/prod/hooks-BfiqDg3O.js +26 -0
  153. package/dist/unpkg/prod/index.js +481 -0
  154. package/dist/unpkg/prod/promise-state-ipG60SdD.js +6738 -0
  155. package/dist/unpkg/prod/reactive/-private.js +1 -0
  156. package/dist/unpkg/prod/reactive.js +127 -0
  157. package/dist/unpkg/prod/request-CN2LxbYX.js +437 -0
  158. package/dist/unpkg/prod/request.js +1 -0
  159. package/dist/unpkg/prod/store/-private.js +127 -0
  160. package/dist/unpkg/prod/store.js +437 -0
  161. package/dist/unpkg/prod/types/-private.js +49 -0
  162. package/dist/unpkg/prod/types/cache/aliases.js +0 -0
  163. package/dist/unpkg/prod/types/cache/change.js +0 -0
  164. package/dist/unpkg/prod/types/cache/mutations.js +0 -0
  165. package/dist/unpkg/prod/types/cache/operations.js +0 -0
  166. package/dist/unpkg/prod/types/cache/relationship.js +0 -0
  167. package/dist/unpkg/prod/types/cache.js +0 -0
  168. package/dist/unpkg/prod/types/graph.js +0 -0
  169. package/dist/unpkg/prod/types/identifier.js +61 -0
  170. package/dist/unpkg/prod/types/json/raw.js +0 -0
  171. package/dist/unpkg/prod/types/params.js +0 -0
  172. package/dist/unpkg/prod/types/record.js +191 -0
  173. package/dist/unpkg/prod/types/request.js +77 -0
  174. package/dist/unpkg/prod/types/runtime.js +34 -0
  175. package/dist/unpkg/prod/types/schema/concepts.js +0 -0
  176. package/dist/unpkg/prod/types/schema/fields.js +505 -0
  177. package/dist/unpkg/prod/types/schema/fields.type-test.js +0 -0
  178. package/dist/unpkg/prod/types/schema/schema-service.js +0 -0
  179. package/dist/unpkg/prod/types/spec/document.js +0 -0
  180. package/dist/unpkg/prod/types/spec/error.js +0 -0
  181. package/dist/unpkg/prod/types/spec/json-api-raw.js +0 -0
  182. package/dist/unpkg/prod/types/symbols.js +84 -0
  183. package/dist/unpkg/prod/types/utils.js +0 -0
  184. package/dist/unpkg/prod/types.js +0 -0
  185. package/dist/unpkg/prod/utils/string.js +72 -0
  186. package/dist/unpkg/prod-deprecated/-private-3C1OkYtZ.js +39 -0
  187. package/dist/unpkg/prod-deprecated/build-config/babel-macros.js +1 -0
  188. package/dist/unpkg/prod-deprecated/build-config/canary-features.js +1 -0
  189. package/dist/unpkg/prod-deprecated/build-config/debugging.js +1 -0
  190. package/dist/unpkg/prod-deprecated/build-config/deprecations.js +1 -0
  191. package/dist/unpkg/prod-deprecated/build-config/env.js +1 -0
  192. package/dist/unpkg/prod-deprecated/build-config/macros.js +1 -0
  193. package/dist/unpkg/prod-deprecated/build-config.js +1 -0
  194. package/dist/unpkg/prod-deprecated/configure-BQ8CpIcW.js +158 -0
  195. package/dist/unpkg/prod-deprecated/configure.js +1 -0
  196. package/dist/unpkg/prod-deprecated/graph/-private.js +2407 -0
  197. package/dist/unpkg/prod-deprecated/handler-D639oFvl.js +334 -0
  198. package/dist/unpkg/prod-deprecated/hooks-DGvi9teJ.js +26 -0
  199. package/dist/unpkg/prod-deprecated/index.js +481 -0
  200. package/dist/unpkg/prod-deprecated/promise-state-CYvoIPna.js +8458 -0
  201. package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -0
  202. package/dist/unpkg/prod-deprecated/reactive.js +126 -0
  203. package/dist/unpkg/prod-deprecated/request-CN2LxbYX.js +437 -0
  204. package/dist/unpkg/prod-deprecated/request.js +1 -0
  205. package/dist/unpkg/prod-deprecated/store/-private.js +89 -0
  206. package/dist/unpkg/prod-deprecated/store.js +437 -0
  207. package/dist/unpkg/prod-deprecated/types/-private.js +49 -0
  208. package/dist/unpkg/prod-deprecated/types/cache/aliases.js +0 -0
  209. package/dist/unpkg/prod-deprecated/types/cache/change.js +0 -0
  210. package/dist/unpkg/prod-deprecated/types/cache/mutations.js +0 -0
  211. package/dist/unpkg/prod-deprecated/types/cache/operations.js +0 -0
  212. package/dist/unpkg/prod-deprecated/types/cache/relationship.js +0 -0
  213. package/dist/unpkg/prod-deprecated/types/cache.js +0 -0
  214. package/dist/unpkg/prod-deprecated/types/graph.js +0 -0
  215. package/dist/unpkg/prod-deprecated/types/identifier.js +61 -0
  216. package/dist/unpkg/prod-deprecated/types/json/raw.js +0 -0
  217. package/dist/unpkg/prod-deprecated/types/params.js +0 -0
  218. package/dist/unpkg/prod-deprecated/types/record.js +191 -0
  219. package/dist/unpkg/prod-deprecated/types/request.js +77 -0
  220. package/dist/unpkg/prod-deprecated/types/runtime.js +34 -0
  221. package/dist/unpkg/prod-deprecated/types/schema/concepts.js +0 -0
  222. package/dist/unpkg/prod-deprecated/types/schema/fields.js +505 -0
  223. package/dist/unpkg/prod-deprecated/types/schema/fields.type-test.js +0 -0
  224. package/dist/unpkg/prod-deprecated/types/schema/schema-service.js +0 -0
  225. package/dist/unpkg/prod-deprecated/types/spec/document.js +0 -0
  226. package/dist/unpkg/prod-deprecated/types/spec/error.js +0 -0
  227. package/dist/unpkg/prod-deprecated/types/spec/json-api-raw.js +0 -0
  228. package/dist/unpkg/prod-deprecated/types/symbols.js +84 -0
  229. package/dist/unpkg/prod-deprecated/types/utils.js +0 -0
  230. package/dist/unpkg/prod-deprecated/types.js +0 -0
  231. package/dist/unpkg/prod-deprecated/utils/string.js +72 -0
  232. package/logos/README.md +2 -2
  233. package/logos/logo-yellow-slab.svg +1 -0
  234. package/logos/word-mark-black.svg +1 -0
  235. package/logos/word-mark-white.svg +1 -0
  236. package/package.json +11 -3
  237. package/logos/NCC-1701-a-blue.svg +0 -4
  238. package/logos/NCC-1701-a-gold.svg +0 -4
  239. package/logos/NCC-1701-a-gold_100.svg +0 -1
  240. package/logos/NCC-1701-a-gold_base-64.txt +0 -1
  241. package/logos/NCC-1701-a.svg +0 -4
  242. package/logos/docs-badge.svg +0 -2
  243. package/logos/ember-data-logo-dark.svg +0 -12
  244. package/logos/ember-data-logo-light.svg +0 -12
  245. package/logos/social1.png +0 -0
  246. package/logos/social2.png +0 -0
  247. package/logos/warp-drive-logo-dark.svg +0 -4
  248. package/logos/warp-drive-logo-gold.svg +0 -4
@@ -1,3 +1,4 @@
1
+ import type { FetchError } from "../request/-private/utils.js";
1
2
  import type { Store } from "../store/-private.js";
2
3
  import type { ResourceKey } from "./identifier.js";
3
4
  import type { QueryParamsSerializationOptions } from "./params.js";
@@ -8,12 +9,14 @@ export declare const SkipCache: "___(unique) Symbol(SkipCache)";
8
9
  export declare const EnableHydration: "___(unique) Symbol(EnableHydration)";
9
10
  export declare const IS_FUTURE: "___(unique) Symbol(IS_FUTURE)";
10
11
  export declare const STRUCTURED: "___(unique) Symbol(DOC)";
12
+ export type { FetchError };
11
13
  export type HTTPMethod = "QUERY" | "GET" | "OPTIONS" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "CONNECT" | "TRACE";
12
14
  /**
13
- * Use these options to adjust CacheHandler behavior for a request.
15
+ * Use these options to adjust {@link CacheHandler} behavior for a request
16
+ * via {@link RequestInfo.cacheOptions}.
14
17
  *
15
18
  */
16
- export type CacheOptions = {
19
+ export interface CacheOptions {
17
20
  /**
18
21
  * A key that uniquely identifies this request. If not present, the url wil be used
19
22
  * as the key for any GET request, while all other requests will not be cached.
@@ -57,7 +60,7 @@ export type CacheOptions = {
57
60
  *
58
61
  */
59
62
  [SkipCache]?: boolean;
60
- };
63
+ }
61
64
  export type FindRecordRequestOptions<
62
65
  RT = unknown,
63
66
  T = unknown
@@ -158,11 +161,15 @@ export interface FindRecordOptions extends ConstrainedRequestOptions {
158
161
  include?: string | string[];
159
162
  }
160
163
  /**
161
- * When a handler chain resolves, it returns an object
162
- * containing the original request, the response set by the handler
163
- * chain (if any), and the processed content.
164
+ * When a {@link Future} resolves, it returns an object
165
+ * containing the original {@link RequestInfo | request},
166
+ * the {@link Response | response} set by the handler chain (if any), and
167
+ * the processed content.
164
168
  */
165
169
  export interface StructuredDataDocument<T> {
170
+ /**
171
+ * @private
172
+ */
166
173
  [STRUCTURED]?: true;
167
174
  /**
168
175
  * @see {@link ImmutableRequestInfo}
@@ -172,25 +179,34 @@ export interface StructuredDataDocument<T> {
172
179
  content: T;
173
180
  }
174
181
  /**
175
- * When a handler chain rejects, it throws an Error that maintains the
176
- * `{ request, response, content }` shape but is also an Error instance
182
+ * When a {@link Future} rejects, it throws either an {@link Error}
183
+ * an {@link AggregateError} or a {@link DOMException} that maintains
184
+ * the `{ request, response, content }` shape but is also an Error instance
177
185
  * itself.
178
186
  *
179
187
  * If using the error originates from the {@link Fetch | Fetch Handler}
180
188
  * the error will be a {@link FetchError}
181
189
  */
182
190
  export interface StructuredErrorDocument<T = unknown> extends Error {
191
+ /**
192
+ * @private
193
+ */
183
194
  [STRUCTURED]?: true;
195
+ /**
196
+ * @see {@link ImmutableRequestInfo}
197
+ */
184
198
  request: ImmutableRequestInfo;
185
199
  response: Response | ResponseInfo | null;
186
200
  error: string | object;
187
201
  content?: T;
188
202
  }
189
203
  /**
190
- * A union of the resolve/reject data types for a request.
204
+ * A union of the resolve/reject data types for the {@link Future}
205
+ * returned by {@link Store.request | request}
191
206
  *
192
- * See the docs for:
207
+ * See also the docs for:
193
208
  *
209
+ * - {@link Future}
194
210
  * - {@link StructuredDataDocument} (resolved/successful requests)
195
211
  * - {@link StructuredErrorDocument} (rejected/failed requests)
196
212
  */
@@ -349,7 +365,3 @@ export interface RequestContext {
349
365
  setStream(stream: ReadableStream | Promise<ReadableStream | null>): void;
350
366
  setResponse(response: Response | ResponseInfo | null): void;
351
367
  }
352
- export declare function withBrand<T>(obj: RequestInfo): RequestInfo<T> & {
353
- [RequestSignature]: T;
354
- };
355
- export {};
@@ -673,7 +673,7 @@ export interface ArrayField {
673
673
  *
674
674
  * Configures which extensions this array is allowed to use.
675
675
  * Extensions are registered with the store's schema service
676
- * via {@link SchemaService.registerDangerousArrayExtension}
676
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
677
677
  *
678
678
  * Extensions should only be used for temporary enhancements
679
679
  * to arrays to support migrating away from deprecated behaviors
@@ -786,7 +786,7 @@ export interface SchemaArrayField {
786
786
  *
787
787
  * Configures which extensions this array is allowed to use.
788
788
  * Extensions are registered with the store's schema service
789
- * via {@link SchemaService.registerDangerousArrayExtension}
789
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
790
790
  *
791
791
  * Extensions should only be used for temporary enhancements
792
792
  * to arrays to support migrating away from deprecated behaviors
@@ -1285,6 +1285,9 @@ export interface LegacyBelongsToField {
1285
1285
  *
1286
1286
  * If null, the relationship is unidirectional.
1287
1287
  *
1288
+ * If the inverse field definition uses a sourceKey,
1289
+ * this should still be the name of the field, not the sourceKey.
1290
+ *
1288
1291
  * @public
1289
1292
  */
1290
1293
  inverse: string | null;
@@ -1307,8 +1310,9 @@ export interface LegacyBelongsToField {
1307
1310
  */
1308
1311
  polymorphic?: boolean;
1309
1312
  /**
1310
- * Whether this field should ever make use of the legacy support infra
1311
- * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.
1313
+ * Whether this field should ever make use of the legacy request infra
1314
+ * from @warp-drive/legacy/compat and the LegacyNetworkMiddleware for
1315
+ * adapters and serializers.
1312
1316
  *
1313
1317
  * When true, none of the legacy support will be utilized. Sync relationships
1314
1318
  * will be expected to already have all their data. When reloading a sync relationship
@@ -1433,6 +1437,9 @@ export interface LinksModeBelongsToField {
1433
1437
  *
1434
1438
  * If null, the relationship is unidirectional.
1435
1439
  *
1440
+ * If the inverse field definition uses a sourceKey,
1441
+ * this should still be the name of the field, not the sourceKey.
1442
+ *
1436
1443
  * @public
1437
1444
  */
1438
1445
  inverse: string | null;
@@ -1456,7 +1463,7 @@ export interface LinksModeBelongsToField {
1456
1463
  polymorphic?: boolean;
1457
1464
  /**
1458
1465
  * Whether this field should ever make use of the legacy support infra
1459
- * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.
1466
+ * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.
1460
1467
  *
1461
1468
  * MUST be true for PolarisMode + LinksMode
1462
1469
  *
@@ -1571,7 +1578,7 @@ export interface LegacyHasManyField {
1571
1578
  *
1572
1579
  * Configures which extensions this array is allowed to use.
1573
1580
  * Extensions are registered with the store's schema service
1574
- * via {@link SchemaService.registerDangerousArrayExtension}
1581
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
1575
1582
  *
1576
1583
  * Extensions should only be used for temporary enhancements
1577
1584
  * to arrays to support migrating away from deprecated behaviors
@@ -1604,6 +1611,9 @@ export interface LegacyHasManyField {
1604
1611
  *
1605
1612
  * If null, the relationship is unidirectional.
1606
1613
  *
1614
+ * If the inverse field definition uses a sourceKey,
1615
+ * this should still be the name of the field, not the sourceKey.
1616
+ *
1607
1617
  * @public
1608
1618
  */
1609
1619
  inverse: string | null;
@@ -1627,7 +1637,7 @@ export interface LegacyHasManyField {
1627
1637
  polymorphic?: boolean;
1628
1638
  /**
1629
1639
  * Whether this field should ever make use of the legacy support infra
1630
- * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.
1640
+ * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.
1631
1641
  *
1632
1642
  * When true, none of the legacy support will be utilized. Sync relationships
1633
1643
  * will be expected to already have all their data. When reloading a sync relationship
@@ -1742,7 +1752,7 @@ export interface LinksModeHasManyField {
1742
1752
  *
1743
1753
  * Configures which extensions this array is allowed to use.
1744
1754
  * Extensions are registered with the store's schema service
1745
- * via {@link SchemaService.registerDangerousArrayExtension}
1755
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
1746
1756
  *
1747
1757
  * Extensions should only be used for temporary enhancements
1748
1758
  * to arrays to support migrating away from deprecated behaviors
@@ -1777,6 +1787,9 @@ export interface LinksModeHasManyField {
1777
1787
  *
1778
1788
  * If null, the relationship is unidirectional.
1779
1789
  *
1790
+ * If the inverse field definition uses a sourceKey,
1791
+ * this should still be the name of the field, not the sourceKey.
1792
+ *
1780
1793
  * @public
1781
1794
  */
1782
1795
  inverse: string | null;
@@ -1800,7 +1813,7 @@ export interface LinksModeHasManyField {
1800
1813
  polymorphic?: boolean;
1801
1814
  /**
1802
1815
  * Whether this field should ever make use of the legacy support infra
1803
- * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.
1816
+ * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.
1804
1817
  *
1805
1818
  * MUST be true for PolarisMode + LinksMode
1806
1819
  *
@@ -2125,18 +2138,29 @@ export interface ObjectSchema {
2125
2138
  objectExtensions?: string[];
2126
2139
  }
2127
2140
  export type Schema = ResourceSchema | ObjectSchema;
2141
+ /**
2142
+ * A trait for use on a PolarisMode record
2143
+ */
2128
2144
  export interface PolarisTrait {
2129
2145
  name: string;
2130
2146
  mode: "polaris";
2131
2147
  fields: PolarisModeFieldSchema[];
2132
2148
  traits?: string[];
2133
2149
  }
2150
+ /**
2151
+ * A trait for use on a LegacyMode record
2152
+ */
2134
2153
  export interface LegacyTrait {
2135
2154
  name: string;
2136
2155
  mode: "legacy";
2137
2156
  fields: LegacyModeFieldSchema[];
2138
2157
  traits?: string[];
2139
2158
  }
2159
+ /**
2160
+ * A union of
2161
+ * - {@link LegacyTrait}
2162
+ * - {@link PolarisTrait}
2163
+ */
2140
2164
  export type Trait = LegacyTrait | PolarisTrait;
2141
2165
  /**
2142
2166
  * A no-op type utility that enables type-checking resource schema
@@ -1,9 +1,9 @@
1
- import type { CAUTION_MEGA_DANGER_ZONE_Extension, ProcessedExtension } from "../../../reactive.js";
2
- import type { ExtensibleField } from "../../../reactive/-private/schema.js";
3
- import type { ResourceKey } from "../../../types/identifier.js";
4
- import type { ObjectValue } from "../../../types/json/raw.js";
5
- import type { Derivation, HashFn, Transformation } from "../../../types/schema/concepts.js";
6
- import type { ArrayField, CacheableFieldSchema, DerivedField, FieldSchema, GenericField, HashField, IdentityField, LegacyAttributeField, LegacyRelationshipField, ObjectField, Schema, Trait } from "../../../types/schema/fields.js";
1
+ import type { CAUTION_MEGA_DANGER_ZONE_Extension, ProcessedExtension } from "../../reactive.js";
2
+ import type { ExtensibleField } from "../../reactive/-private/schema.js";
3
+ import type { ResourceKey } from "../identifier.js";
4
+ import type { ObjectValue } from "../json/raw.js";
5
+ import type { Derivation, HashFn, Transformation } from "./concepts.js";
6
+ import type { ArrayField, CacheableFieldSchema, DerivedField, FieldSchema, GenericField, HashField, IdentityField, LegacyAttributeField, LegacyRelationshipField, ObjectField, Schema, Trait } from "./fields.js";
7
7
  export type AttributesSchema = Record<string, LegacyAttributeField>;
8
8
  export type RelationshipsSchema = Record<string, LegacyRelationshipField>;
9
9
  interface ObjectWithStringTypeProperty {
@@ -21,7 +21,7 @@ interface ObjectWithStringTypeProperty {
21
21
  * The primary requirement is merely that any information the service needs to correctly
22
22
  * respond to an inquest is available by the time it is asked.
23
23
  *
24
- * The `@ember-data/model` package provides an implementation of this service which
24
+ * The `@warp-drive/legacy/model` package provides an implementation of this service which
25
25
  * makes use of your model classes as the source of information to respond to queries
26
26
  * about resource schema. While this is useful, this may not be ideal for your application.
27
27
  * For instance, Schema information could be sideloaded or pre-flighted for API calls,
@@ -32,7 +32,7 @@ interface ObjectWithStringTypeProperty {
32
32
  * hook to return an instance of your service.
33
33
  *
34
34
  * ```ts
35
- * import Store from '@ember-data/store';
35
+ * import { Store } from '@warp-drive/core';
36
36
  * import CustomSchemas from './custom-schemas';
37
37
  *
38
38
  * export default class extends Store {
@@ -66,7 +66,7 @@ export interface SchemaService {
66
66
  * Queries whether the SchemaService recognizes `type` as a resource type
67
67
  *
68
68
  * @public
69
- * @deprecated
69
+ * @deprecated - use {@link SchemaService.hasResource | hasResource}
70
70
  */
71
71
  doesTypeExist?(type: string): boolean;
72
72
  /**
@@ -229,7 +229,7 @@ export interface SchemaService {
229
229
  * be a string reference to a `transform`, and `options` which
230
230
  * should be dictionary in which any key:value pairs are permissable.
231
231
  *
232
- * For instance, when using `@ember-data/model`, the following attribute
232
+ * For instance, when using `@warp-drive/legacy/model`, the following attribute
233
233
  * definition:
234
234
  *
235
235
  * ```ts
@@ -251,7 +251,7 @@ export interface SchemaService {
251
251
  * ```
252
252
  *
253
253
  * @public
254
- * @deprecated
254
+ * @deprecated - use {@link SchemaService.fields | fields}
255
255
  */
256
256
  attributesDefinitionFor?(key: ResourceKey | ObjectWithStringTypeProperty): AttributesSchema;
257
257
  /**
@@ -283,7 +283,7 @@ export interface SchemaService {
283
283
  * - `options.as` a string representing the abstract type that the concrete side of
284
284
  * a relationship must specify when fulfilling a polymorphic inverse.
285
285
  *
286
- * For example, the following Model using @ember-data/model would generate this relationships
286
+ * For example, the following Model using @warp-drive/legacy/model would generate this relationships
287
287
  * definition by default:
288
288
  *
289
289
  * ```js
@@ -330,7 +330,7 @@ export interface SchemaService {
330
330
  * ```
331
331
  *
332
332
  * @public
333
- * @deprecated
333
+ * @deprecated - use {@link SchemaService.fields | fields}
334
334
  */
335
335
  relationshipsDefinitionFor?(key: ResourceKey | ObjectWithStringTypeProperty): RelationshipsSchema;
336
336
  /**
@@ -342,6 +342,8 @@ export interface SchemaService {
342
342
  /**
343
343
  * Register an extension for either objects or arrays
344
344
  *
345
+ * See also {@link CAUTION_MEGA_DANGER_ZONE_Extension}
346
+ *
345
347
  * @public
346
348
  */
347
349
  CAUTION_MEGA_DANGER_ZONE_registerExtension?(extension: CAUTION_MEGA_DANGER_ZONE_Extension): void;
@@ -1,11 +1,21 @@
1
1
  import type { PersistedResourceKey } from "../identifier.js";
2
2
  import type { ApiError } from "./error.js";
3
3
  import type { Links, Meta, PaginationLinks } from "./json-api-raw.js";
4
+ /**
5
+ * This type represents a raw {json:api} document for a meta-only
6
+ * document returned by a request intended to be inserted into the cache.
7
+ */
4
8
  export interface ResourceMetaDocument {
5
9
  lid?: string;
6
10
  meta: Meta;
7
11
  links?: Links | PaginationLinks;
8
12
  }
13
+ /**
14
+ * This type represents a raw {json:api} document for a single resource
15
+ * returned by a request intended to be inserted into the cache.
16
+ *
17
+ * For the Reactive value returned by a request using the store, use {@link ReactiveDataDocument} instead.
18
+ */
9
19
  export interface SingleResourceDataDocument<
10
20
  T = PersistedResourceKey,
11
21
  R = PersistedResourceKey
@@ -16,6 +26,12 @@ export interface SingleResourceDataDocument<
16
26
  data: T | null;
17
27
  included?: R[];
18
28
  }
29
+ /**
30
+ * This type represents a raw {json:api} document for a resource collection
31
+ * returned by a request intended to be inserted into the cache.
32
+ *
33
+ * For the Reactive value returned by a request using the store, use {@link ReactiveDataDocument} instead.
34
+ */
19
35
  export interface CollectionResourceDataDocument<T = PersistedResourceKey> {
20
36
  lid?: string;
21
37
  links?: Links | PaginationLinks;
@@ -23,11 +39,29 @@ export interface CollectionResourceDataDocument<T = PersistedResourceKey> {
23
39
  data: T[];
24
40
  included?: T[];
25
41
  }
42
+ /**
43
+ * A type useful for representing the raw {json:api} documents that
44
+ * the cache may use.
45
+ *
46
+ * For the Reactive value returned by a request using the store, use {@link ReactiveDataDocument} instead.
47
+ */
26
48
  export type ResourceDataDocument<T = PersistedResourceKey> = SingleResourceDataDocument<T> | CollectionResourceDataDocument<T>;
49
+ /**
50
+ * A type useful for representing the raw {json:api} Error documents that
51
+ * the cache may use.
52
+ *
53
+ * For the Reactive value returned by a request using the store, use {@link ReactiveErrorDocument} instead.
54
+ */
27
55
  export interface ResourceErrorDocument {
28
56
  lid?: string;
29
57
  links?: Links | PaginationLinks;
30
58
  meta?: Meta;
31
59
  errors: ApiError[];
32
60
  }
61
+ /**
62
+ * A type useful for representing the raw {json:api} documents that
63
+ * the cache may use.
64
+ *
65
+ * For the Reactive value returned by a request using the store, use {@link ReactiveDocument} instead.
66
+ */
33
67
  export type ResourceDocument<T = PersistedResourceKey> = ResourceMetaDocument | SingleResourceDataDocument<T> | CollectionResourceDataDocument<T> | ResourceErrorDocument;
@@ -9,7 +9,7 @@ export declare const RecordStore: "___(unique) Symbol(Store)";
9
9
  * record implementations to provide a typescript
10
10
  * hint for the type of the resource.
11
11
  *
12
- * When used, EmberData/WarpDrive APIs can
12
+ * When used, WarpDrive APIs can
13
13
  * take advantage of this to provide better type
14
14
  * safety and intellisense.
15
15
  *
@@ -45,7 +45,7 @@ export declare const Type: "___(unique) Symbol($type)";
45
45
  * record implementations to provide a typescript
46
46
  * hint for the type of the resource.
47
47
  *
48
- * When used, EmberData/WarpDrive APIs can
48
+ * When used, WarpDrive APIs can
49
49
  * take advantage of this to provide better type
50
50
  * safety and intellisense.
51
51
  *
@@ -7,5 +7,5 @@
7
7
  export type { StableRecordIdentifier, ResourceKey } from "./types/identifier.js";
8
8
  export type { CacheCapabilitiesManager } from "./store/-types/q/cache-capabilities-manager.js";
9
9
  export type { ModelSchema } from "./store/deprecated/-private.js";
10
- export type { SchemaService } from "./store/-types/q/schema-service.js";
10
+ export type { SchemaService } from "./types/schema/schema-service.js";
11
11
  export type { BaseFinderOptions, FindRecordOptions, LegacyResourceQuery, QueryOptions, FindAllOptions } from "./store/-types/q/store.js";
@@ -1 +1 @@
1
- export { setConfig } from '@warp-drive/build-config';
1
+ export { babelPlugin, setConfig } from '@warp-drive/build-config';