@warp-drive/legacy 5.8.0-beta.0 → 5.8.0-beta.2

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 (214) hide show
  1. package/README.md +16 -26
  2. package/declarations/adapter/error.d.ts +7 -7
  3. package/declarations/adapter/json-api.d.ts +6 -8
  4. package/declarations/adapter/rest.d.ts +26 -112
  5. package/declarations/adapter.d.ts +6 -8
  6. package/declarations/compat/-private.d.ts +1 -1
  7. package/declarations/compat/builders/find-all.d.ts +6 -6
  8. package/declarations/compat/builders/find-record.d.ts +8 -8
  9. package/declarations/compat/builders/query.d.ts +12 -12
  10. package/declarations/compat/extensions.d.ts +1 -1
  11. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +7 -9
  12. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +20 -30
  13. package/declarations/compat/utils.d.ts +17 -17
  14. package/declarations/compat.d.ts +35 -11
  15. package/declarations/index.d.ts +102 -0
  16. package/declarations/model/-private/attr.d.ts +5 -6
  17. package/declarations/model/-private/belongs-to.d.ts +4 -5
  18. package/declarations/model/-private/has-many.d.ts +4 -5
  19. package/declarations/model/-private/hooks.d.ts +1 -1
  20. package/declarations/model/-private/legacy-relationships-support.d.ts +2 -2
  21. package/declarations/model/-private/model.d.ts +18 -59
  22. package/declarations/model/-private/promise-many-array.d.ts +0 -18
  23. package/declarations/model/-private/record-state.d.ts +1 -1
  24. package/declarations/model/-private/references/belongs-to.d.ts +19 -29
  25. package/declarations/model/-private/references/has-many.d.ts +14 -16
  26. package/declarations/model/migration-support.d.ts +46 -21
  27. package/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
  28. package/declarations/model-fragments/extensions/fragment.d.ts +15 -0
  29. package/declarations/model-fragments/hooks/model-for.d.ts +20 -0
  30. package/declarations/model-fragments/index.d.ts +5 -0
  31. package/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
  32. package/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
  33. package/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
  34. package/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
  35. package/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
  36. package/declarations/model-fragments.d.ts +9 -0
  37. package/declarations/model.d.ts +2 -2
  38. package/declarations/serializer/-private/embedded-records-mixin.d.ts +1 -6
  39. package/declarations/serializer/-private/transforms/boolean.d.ts +2 -2
  40. package/declarations/serializer/-private/transforms/date.d.ts +2 -2
  41. package/declarations/serializer/-private/transforms/number.d.ts +1 -1
  42. package/declarations/serializer/-private/transforms/string.d.ts +1 -1
  43. package/declarations/serializer/json-api.d.ts +11 -12
  44. package/declarations/serializer/json.d.ts +9 -11
  45. package/declarations/serializer/rest.d.ts +4 -6
  46. package/declarations/serializer.d.ts +9 -12
  47. package/dist/{-private-8UmnAf9J.js → -private-BG3bMiKp.js} +3 -2
  48. package/dist/adapter/-private.js +1 -1
  49. package/dist/adapter/error.js +14 -15
  50. package/dist/adapter/json-api.js +4 -1
  51. package/dist/adapter/rest.js +38 -125
  52. package/dist/adapter.js +6 -8
  53. package/dist/compat/-private.js +1 -1
  54. package/dist/compat/builders.js +26 -26
  55. package/dist/compat/utils.js +17 -18
  56. package/dist/compat.js +61 -43
  57. package/dist/{errors-8kD2mSe_.js → errors-Cz5KrzBk.js} +115 -122
  58. package/dist/hooks-D6diaM34.js +74 -0
  59. package/dist/index.js +195 -0
  60. package/dist/{json-Et4mt_LM.js → json-ChdEfB0X.js} +18 -35
  61. package/dist/model/-private.js +1 -1
  62. package/dist/model/migration-support.js +59 -27
  63. package/dist/model-for-CqXsIKws.js +221 -0
  64. package/dist/model-fragments.js +76 -0
  65. package/dist/model.js +18 -90
  66. package/dist/{schema-provider-DQu4Rjco.js → schema-provider-DJCV_6AF.js} +50 -95
  67. package/dist/{serialize-into-hash-CS0MIv4F.js → serialize-into-hash-DPZYoF-i.js} +1 -1
  68. package/dist/serializer/json-api.js +18 -45
  69. package/dist/serializer/json.js +1 -1
  70. package/dist/serializer/rest.js +14 -21
  71. package/dist/serializer/transform.js +15 -6
  72. package/dist/serializer.js +9 -13
  73. package/dist/store.js +5 -1
  74. package/dist/unpkg/dev/-private-DtjBbEgy.js +1206 -0
  75. package/dist/unpkg/dev/adapter/-private.js +1 -0
  76. package/dist/unpkg/dev/adapter/error.js +335 -0
  77. package/dist/unpkg/dev/adapter/json-api.js +271 -0
  78. package/dist/unpkg/dev/adapter/rest.js +1171 -0
  79. package/dist/unpkg/dev/adapter.js +1252 -0
  80. package/dist/unpkg/dev/compat/-private.js +1 -0
  81. package/dist/unpkg/dev/compat/builders.js +275 -0
  82. package/dist/unpkg/dev/compat/extensions.js +242 -0
  83. package/dist/unpkg/dev/compat/utils.js +223 -0
  84. package/dist/unpkg/dev/compat.js +1147 -0
  85. package/dist/unpkg/dev/errors-DmGGJr3T.js +2562 -0
  86. package/dist/unpkg/dev/hooks-CkYiE6Ud.js +73 -0
  87. package/dist/unpkg/dev/index.js +197 -0
  88. package/dist/unpkg/dev/json-Cu1LNgmQ.js +1256 -0
  89. package/dist/unpkg/dev/model/-private.js +1 -0
  90. package/dist/unpkg/dev/model/migration-support.js +553 -0
  91. package/dist/unpkg/dev/model-for-CqXsIKws.js +221 -0
  92. package/dist/unpkg/dev/model-fragments.js +76 -0
  93. package/dist/unpkg/dev/model.js +678 -0
  94. package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  95. package/dist/unpkg/dev/schema-provider-DDVYxmUV.js +2186 -0
  96. package/dist/unpkg/dev/serialize-into-hash-B2xDbuo5.js +259 -0
  97. package/dist/unpkg/dev/serializer/json-api.js +649 -0
  98. package/dist/unpkg/dev/serializer/json.js +4 -0
  99. package/dist/unpkg/dev/serializer/rest.js +1242 -0
  100. package/dist/unpkg/dev/serializer/transform.js +278 -0
  101. package/dist/unpkg/dev/serializer.js +248 -0
  102. package/dist/unpkg/dev/store.js +637 -0
  103. package/dist/unpkg/dev/util-DvanW33H.js +20 -0
  104. package/dist/unpkg/dev/utils-BhvS1iTS.js +8 -0
  105. package/dist/unpkg/dev-deprecated/-private-DtjBbEgy.js +1206 -0
  106. package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -0
  107. package/dist/unpkg/dev-deprecated/adapter/error.js +335 -0
  108. package/dist/unpkg/dev-deprecated/adapter/json-api.js +271 -0
  109. package/dist/unpkg/dev-deprecated/adapter/rest.js +1171 -0
  110. package/dist/unpkg/dev-deprecated/adapter.js +1252 -0
  111. package/dist/unpkg/dev-deprecated/compat/-private.js +1 -0
  112. package/dist/unpkg/dev-deprecated/compat/builders.js +275 -0
  113. package/dist/unpkg/dev-deprecated/compat/extensions.js +242 -0
  114. package/dist/unpkg/dev-deprecated/compat/utils.js +223 -0
  115. package/dist/unpkg/dev-deprecated/compat.js +1147 -0
  116. package/dist/unpkg/dev-deprecated/errors-Spt6ubMd.js +2565 -0
  117. package/dist/unpkg/dev-deprecated/hooks-DOXegvhL.js +73 -0
  118. package/dist/unpkg/dev-deprecated/index.js +196 -0
  119. package/dist/unpkg/dev-deprecated/json-Cu1LNgmQ.js +1256 -0
  120. package/dist/unpkg/dev-deprecated/model/-private.js +1 -0
  121. package/dist/unpkg/dev-deprecated/model/migration-support.js +570 -0
  122. package/dist/unpkg/dev-deprecated/model-for-CqXsIKws.js +221 -0
  123. package/dist/unpkg/dev-deprecated/model-fragments.js +76 -0
  124. package/dist/unpkg/dev-deprecated/model.js +682 -0
  125. package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  126. package/dist/unpkg/dev-deprecated/schema-provider-BP6_8N-V.js +2211 -0
  127. package/dist/unpkg/dev-deprecated/serialize-into-hash-B2xDbuo5.js +259 -0
  128. package/dist/unpkg/dev-deprecated/serializer/json-api.js +649 -0
  129. package/dist/unpkg/dev-deprecated/serializer/json.js +4 -0
  130. package/dist/unpkg/dev-deprecated/serializer/rest.js +1242 -0
  131. package/dist/unpkg/dev-deprecated/serializer/transform.js +278 -0
  132. package/dist/unpkg/dev-deprecated/serializer.js +248 -0
  133. package/dist/unpkg/dev-deprecated/store.js +637 -0
  134. package/dist/unpkg/dev-deprecated/util-CWr5WQOT.js +24 -0
  135. package/dist/unpkg/dev-deprecated/utils-C9PJehtL.js +12 -0
  136. package/dist/unpkg/prod/-private-BdyZaGEh.js +971 -0
  137. package/dist/unpkg/prod/adapter/-private.js +1 -0
  138. package/dist/unpkg/prod/adapter/error.js +330 -0
  139. package/dist/unpkg/prod/adapter/json-api.js +266 -0
  140. package/dist/unpkg/prod/adapter/rest.js +1134 -0
  141. package/dist/unpkg/prod/adapter.js +1219 -0
  142. package/dist/unpkg/prod/compat/-private.js +1 -0
  143. package/dist/unpkg/prod/compat/builders.js +210 -0
  144. package/dist/unpkg/prod/compat/extensions.js +232 -0
  145. package/dist/unpkg/prod/compat/utils.js +218 -0
  146. package/dist/unpkg/prod/compat.js +727 -0
  147. package/dist/unpkg/prod/errors-BGVFCBmi.js +2314 -0
  148. package/dist/unpkg/prod/hooks-BztVA_x0.js +41 -0
  149. package/dist/unpkg/prod/index.js +151 -0
  150. package/dist/unpkg/prod/json-BWrZ5546.js +1243 -0
  151. package/dist/unpkg/prod/model/-private.js +1 -0
  152. package/dist/unpkg/prod/model/migration-support.js +546 -0
  153. package/dist/unpkg/prod/model-for-CqXsIKws.js +221 -0
  154. package/dist/unpkg/prod/model-fragments.js +76 -0
  155. package/dist/unpkg/prod/model.js +593 -0
  156. package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  157. package/dist/unpkg/prod/schema-provider-DJtD_8jZ.js +1861 -0
  158. package/dist/unpkg/prod/serialize-into-hash-DGlzQteF.js +215 -0
  159. package/dist/unpkg/prod/serializer/json-api.js +592 -0
  160. package/dist/unpkg/prod/serializer/json.js +4 -0
  161. package/dist/unpkg/prod/serializer/rest.js +1210 -0
  162. package/dist/unpkg/prod/serializer/transform.js +278 -0
  163. package/dist/unpkg/prod/serializer.js +248 -0
  164. package/dist/unpkg/prod/store.js +505 -0
  165. package/dist/unpkg/prod/util-DvanW33H.js +20 -0
  166. package/dist/unpkg/prod/utils-BhvS1iTS.js +8 -0
  167. package/dist/unpkg/prod-deprecated/-private-BdyZaGEh.js +971 -0
  168. package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -0
  169. package/dist/unpkg/prod-deprecated/adapter/error.js +330 -0
  170. package/dist/unpkg/prod-deprecated/adapter/json-api.js +266 -0
  171. package/dist/unpkg/prod-deprecated/adapter/rest.js +1134 -0
  172. package/dist/unpkg/prod-deprecated/adapter.js +1219 -0
  173. package/dist/unpkg/prod-deprecated/compat/-private.js +1 -0
  174. package/dist/unpkg/prod-deprecated/compat/builders.js +210 -0
  175. package/dist/unpkg/prod-deprecated/compat/extensions.js +232 -0
  176. package/dist/unpkg/prod-deprecated/compat/utils.js +218 -0
  177. package/dist/unpkg/prod-deprecated/compat.js +727 -0
  178. package/dist/unpkg/prod-deprecated/errors-CdDaK81x.js +2317 -0
  179. package/dist/unpkg/prod-deprecated/hooks-yId87yyG.js +41 -0
  180. package/dist/unpkg/prod-deprecated/index.js +150 -0
  181. package/dist/unpkg/prod-deprecated/json-BWrZ5546.js +1243 -0
  182. package/dist/unpkg/prod-deprecated/model/-private.js +1 -0
  183. package/dist/unpkg/prod-deprecated/model/migration-support.js +563 -0
  184. package/dist/unpkg/prod-deprecated/model-for-CqXsIKws.js +221 -0
  185. package/dist/unpkg/prod-deprecated/model-fragments.js +76 -0
  186. package/dist/unpkg/prod-deprecated/model.js +596 -0
  187. package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  188. package/dist/unpkg/prod-deprecated/schema-provider-CjX55uSY.js +1904 -0
  189. package/dist/unpkg/prod-deprecated/serialize-into-hash-DGlzQteF.js +215 -0
  190. package/dist/unpkg/prod-deprecated/serializer/json-api.js +592 -0
  191. package/dist/unpkg/prod-deprecated/serializer/json.js +4 -0
  192. package/dist/unpkg/prod-deprecated/serializer/rest.js +1210 -0
  193. package/dist/unpkg/prod-deprecated/serializer/transform.js +278 -0
  194. package/dist/unpkg/prod-deprecated/serializer.js +248 -0
  195. package/dist/unpkg/prod-deprecated/store.js +505 -0
  196. package/dist/unpkg/prod-deprecated/util-B6cn-i93.js +23 -0
  197. package/dist/unpkg/prod-deprecated/utils-BUWwQwCh.js +11 -0
  198. package/logos/README.md +2 -2
  199. package/logos/logo-yellow-slab.svg +1 -0
  200. package/logos/word-mark-black.svg +1 -0
  201. package/logos/word-mark-white.svg +1 -0
  202. package/package.json +15 -7
  203. package/logos/NCC-1701-a-blue.svg +0 -4
  204. package/logos/NCC-1701-a-gold.svg +0 -4
  205. package/logos/NCC-1701-a-gold_100.svg +0 -1
  206. package/logos/NCC-1701-a-gold_base-64.txt +0 -1
  207. package/logos/NCC-1701-a.svg +0 -4
  208. package/logos/docs-badge.svg +0 -2
  209. package/logos/ember-data-logo-dark.svg +0 -12
  210. package/logos/ember-data-logo-light.svg +0 -12
  211. package/logos/social1.png +0 -0
  212. package/logos/social2.png +0 -0
  213. package/logos/warp-drive-logo-dark.svg +0 -4
  214. package/logos/warp-drive-logo-gold.svg +0 -4
@@ -9,16 +9,16 @@ import { storeFor, recordIdentifierFor } from '@warp-drive/core';
9
9
  When passed to `store.request`, this config will result in the same behavior as a `store.findAll` request.
10
10
  Additionally, it takes the same options as `store.findAll`.
11
11
 
12
- All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
12
+ All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
13
13
  This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
14
- To that end, these builders are deprecated and will be removed in a future version of Ember Data.
14
+ To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
15
15
 
16
16
  @deprecated
17
17
  @public
18
- @param {String} type the name of the resource
19
- @param {Object} query a query to be used by the adapter
20
- @param {FindAllBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.findAll
21
- @return {FindAllRequestInput} request config
18
+ @param type the name of the resource
19
+ @param query a query to be used by the adapter
20
+ @param options optional, may include `adapterOptions` hash which will be passed to adapter.findAll
21
+ @return request config
22
22
  */
23
23
  function findAllBuilder(type, options = {}) {
24
24
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
@@ -51,7 +51,7 @@ function findAllBuilder(type, options = {}) {
51
51
  **Example 1**
52
52
 
53
53
  ```ts
54
- import { findRecord } from '@ember-data/legacy-compat/builders';
54
+ import { findRecord } from '@warp-drive/legacy/compat/builders';
55
55
  const { content: post } = await store.request<Post>(findRecord<Post>('post', '1'));
56
56
  ```
57
57
 
@@ -62,20 +62,20 @@ function findAllBuilder(type, options = {}) {
62
62
  the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)
63
63
 
64
64
  ```ts
65
- import { findRecord } from '@ember-data/legacy-compat/builders';
65
+ import { findRecord } from '@warp-drive/legacy/compat/builders';
66
66
  const { content: post } = await store.request<Post>(findRecord<Post>({ type: 'post', id }));
67
67
  ```
68
68
 
69
- All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
69
+ All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
70
70
  This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
71
- To that end, these builders are deprecated and will be removed in a future version of Ember Data.
71
+ To that end, these builders are deprecated and will be removed in a future version of Warp Drive.
72
72
 
73
73
  @deprecated
74
74
  @public
75
- @param {string|object} resource - either a string representing the name of the resource or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record
76
- @param {string|number|object} id - optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved
77
- @param {FindRecordBuilderOptions} [options] - if the first param is a string this will be the optional options for the request. See examples for available options.
78
- @return {FindRecordRequestInput} request config
75
+ @param resource - either a string representing the name of the resource or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record
76
+ @param id - optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved
77
+ @param options - if the first param is a string this will be the optional options for the request. See examples for available options.
78
+ @return request config
79
79
  */
80
80
  function findRecordBuilder(resource, idOrOptions, options) {
81
81
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
@@ -118,16 +118,16 @@ function findRecordBuilder(resource, idOrOptions, options) {
118
118
  When passed to `store.request`, this config will result in the same behavior as a `store.query` request.
119
119
  Additionally, it takes the same options as `store.query`.
120
120
 
121
- All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
121
+ All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
122
122
  This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
123
- To that end, these builders are deprecated and will be removed in a future version of Ember Data.
123
+ To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
124
124
 
125
125
  @deprecated
126
126
  @public
127
- @param {String} type the name of the resource
128
- @param {Object} query a query to be used by the adapter
129
- @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query
130
- @return {QueryRequestInput} request config
127
+ @param type the name of the resource
128
+ @param query a query to be used by the adapter
129
+ @param options optional, may include `adapterOptions` hash which will be passed to adapter.query
130
+ @return request config
131
131
  */
132
132
  function queryBuilder(type, query, options = {}) {
133
133
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
@@ -163,16 +163,16 @@ function queryBuilder(type, query, options = {}) {
163
163
  When passed to `store.request`, this config will result in the same behavior as a `store.queryRecord` request.
164
164
  Additionally, it takes the same options as `store.queryRecord`.
165
165
 
166
- All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
166
+ All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
167
167
  This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
168
- To that end, these builders are deprecated and will be removed in a future version of Ember Data.
168
+ To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
169
169
 
170
170
  @deprecated
171
171
  @public
172
- @param {String} type the name of the resource
173
- @param {Object} query a query to be used by the adapter
174
- @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query
175
- @return {QueryRecordRequestInput} request config
172
+ @param type the name of the resource
173
+ @param query a query to be used by the adapter
174
+ @param options optional, may include `adapterOptions` hash which will be passed to adapter.query
175
+ @return request config
176
176
  */
177
177
 
178
178
  function queryRecordBuilder(type, query, options) {
@@ -6,7 +6,6 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
6
6
  and more consistent use of IDs and types.
7
7
 
8
8
  @module
9
- @deprecated
10
9
  */
11
10
 
12
11
  let MismatchReporter = function () {};
@@ -33,7 +32,7 @@ let NormalizedType = str => {
33
32
  * changes during normalization. This is useful for instrumenting
34
33
  * to discover places where usage in the app is not consistent.
35
34
  *
36
- * @param method a function which takes a mismatch-type ('formatted-id' | 'formatted-type'), actual, and expected value
35
+ * @param fn - a function which takes a mismatch-type ('formatted-id' | 'formatted-type'), actual, and expected value
37
36
  * @public
38
37
  */
39
38
  function configureMismatchReporter(fn) {
@@ -45,7 +44,7 @@ function configureMismatchReporter(fn) {
45
44
  * fails validation. This is useful for instrumenting
46
45
  * to discover places where usage in the app is not consistent.
47
46
  *
48
- * @param method a function which takes a message and a condition
47
+ * @param fn - a function which takes a message and a condition
49
48
  * @public
50
49
  */
51
50
  function configureAssertFn(fn) {
@@ -62,7 +61,7 @@ function configureAssertFn(fn) {
62
61
  * the configured mismatch reporter and assert functions will
63
62
  * be called.
64
63
  *
65
- * @param method a function which takes a string and returns a string
64
+ * @param fn - a function which takes a string and returns a string
66
65
  * @public
67
66
  */
68
67
  function configureTypeNormalization(fn) {
@@ -72,7 +71,7 @@ const NORMALIZED_TYPES = new Map();
72
71
 
73
72
  /**
74
73
  * Converts a potentially unnormalized type into the format expected
75
- * by our EmberData Cache. Currently this is singular-dasherized.
74
+ * by our WarpDrive Cache. Currently this is singular-dasherized.
76
75
  *
77
76
  * you should not rely on this function to give you an exact format
78
77
  * for display purposes. Formatting for display should be handled
@@ -95,8 +94,8 @@ const NORMALIZED_TYPES = new Map();
95
94
  * formattedType('PostComment'); // => 'post-comment'
96
95
  * ```
97
96
  *
98
- * @param {String} type the potentially un-normalized type
99
- * @return {String} the normalized type
97
+ * @param type the potentially un-normalized type
98
+ * @return the normalized type
100
99
  * @public
101
100
  */
102
101
  function formattedType(type) {
@@ -116,7 +115,7 @@ function formattedType(type) {
116
115
  }
117
116
 
118
117
  /**
119
- * Format an id to the format expected by the EmberData Cache.
118
+ * Format an id to the format expected by the WarpDrive Cache.
120
119
  * Currently this means that id should be `string | null`.
121
120
  *
122
121
  * Asserts invalid IDs (undefined, '', 0, '0') in dev.
@@ -131,8 +130,8 @@ function formattedType(type) {
131
130
  * formattedId(null); // => null
132
131
  * ```
133
132
  *
134
- * @param {String | Number | null} id the potentially un-normalized id
135
- * @return {String | null} the normalized id
133
+ * @param id the potentially un-normalized id
134
+ * @return the normalized id
136
135
  * @public
137
136
  */
138
137
 
@@ -154,7 +153,7 @@ function expectId(id) {
154
153
 
155
154
  /**
156
155
  * Compares two types for strict equality, converting them to
157
- * the format expected by the EmberData Cache to ensure
156
+ * the format expected by the WarpDrive Cache to ensure
158
157
  * differences in format are accounted for in the comparison.
159
158
  *
160
159
  * Asserts when expected or actual are invalid types in dev.
@@ -172,9 +171,9 @@ function expectId(id) {
172
171
  * isEquivType('posts', null); // false
173
172
  * ```
174
173
  *
175
- * @param {String} expected a potentially unnormalized type to match against
176
- * @param {String} actual a potentially unnormalized type to match against
177
- * @return {Boolean} true if the types are equivalent
174
+ * @param expected a potentially unnormalized type to match against
175
+ * @param actual a potentially unnormalized type to match against
176
+ * @return true if the types are equivalent
178
177
  * @public
179
178
  */
180
179
  function isEquivType(expected, actual) {
@@ -191,7 +190,7 @@ function isEquivType(expected, actual) {
191
190
 
192
191
  /**
193
192
  * Compares two IDs for strict equality, converting them to
194
- * the format expected by the EmberData Cache to ensure
193
+ * the format expected by the WarpDrive Cache to ensure
195
194
  * differences in format are accounted for in the comparison.
196
195
  *
197
196
  * Asserts when expected or actual are invalid IDs in dev.
@@ -205,9 +204,9 @@ function isEquivType(expected, actual) {
205
204
  * isEquivId(1, null); // false
206
205
  * ```
207
206
  *
208
- * @param {string | number} expected a potentially un-normalized id to match against
209
- * @param {string | number} actual a potentially un-normalized id to match against
210
- * @return {Boolean} true if the ids are equivalent
207
+ * @param expected a potentially un-normalized id to match against
208
+ * @param actual a potentially un-normalized id to match against
209
+ * @return true if the ids are equivalent
211
210
  * @public
212
211
  */
213
212
  function isEquivId(expected, actual) {
package/dist/compat.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { getOwner } from '@ember/application';
2
2
  import { recordIdentifierFor } from '@warp-drive/core';
3
- import { assertPrivateStore, waitFor, _deprecatingNormalize } from '@warp-drive/core/store/-private';
3
+ import { assertPrivateStore, _deprecatingNormalize } from '@warp-drive/core/store/-private';
4
4
  import '@warp-drive/core/reactive/-private';
5
- import { p as payloadIsNotBlank, n as normalizeResponseHelper, i as iterateData, F as FetchManager, S as SaveOp, a as assertIdentifierHasId, b as SnapshotRecordArray } from "./-private-8UmnAf9J.js";
5
+ import { p as payloadIsNotBlank, n as normalizeResponseHelper, i as iterateData, F as FetchManager, S as SaveOp, a as assertIdentifierHasId, b as SnapshotRecordArray } from "./-private-BG3bMiKp.js";
6
6
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
7
+ import { waitFor } from '@warp-drive/core/signals/-leaked';
7
8
  function _findHasMany(adapter, store, identifier, link, relationship, options) {
8
9
  const promise = Promise.resolve().then(() => {
9
10
  const snapshot = store._fetchManager.createSnapshot(identifier, options);
@@ -162,7 +163,7 @@ function ensureRelationshipIsSetToParent(payload, parentIdentifier, store, paren
162
163
  const other = data ? `<${data.type}:${data.id}>` : null;
163
164
  const relationshipFetched = `${expectedModel}.${parentRelationship.kind}("${parentRelationship.name}")`;
164
165
  const includedRecord = `<${type}:${id}>`;
165
- const message = [`Encountered mismatched relationship: Ember Data expected ${path} in the payload from ${relationshipFetched} to include ${expected} but got ${got} instead.\n`, `The ${includedRecord} record loaded at ${prefix} in the payload specified ${other} as its ${quotedInverse}, but should have specified ${expectedModel} (the record the relationship is being loaded from) as its ${quotedInverse} instead.`, `This could mean that the response for ${relationshipFetched} may have accidentally returned ${quotedType} records that aren't related to ${expectedModel} and could be related to a different ${parentIdentifier.type} record instead.`, `Ember Data has corrected the ${includedRecord} record's ${quotedInverse} relationship to ${expectedModel} so that ${relationshipFetched} will include ${includedRecord}.`, `Please update the response from the server or change your serializer to either ensure that the response for only includes ${quotedType} records that specify ${expectedModel} as their ${quotedInverse}, or omit the ${quotedInverse} relationship from the response.`].join('\n');
166
+ const message = [`Encountered mismatched relationship: WarpDrive expected ${path} in the payload from ${relationshipFetched} to include ${expected} but got ${got} instead.\n`, `The ${includedRecord} record loaded at ${prefix} in the payload specified ${other} as its ${quotedInverse}, but should have specified ${expectedModel} (the record the relationship is being loaded from) as its ${quotedInverse} instead.`, `This could mean that the response for ${relationshipFetched} may have accidentally returned ${quotedType} records that aren't related to ${expectedModel} and could be related to a different ${parentIdentifier.type} record instead.`, `WarpDrive has corrected the ${includedRecord} record's ${quotedInverse} relationship to ${expectedModel} so that ${relationshipFetched} will include ${includedRecord}.`, `Please update the response from the server or change your serializer to either ensure that the response for only includes ${quotedType} records that specify ${expectedModel} as their ${quotedInverse}, or omit the ${quotedInverse} relationship from the response.`].join('\n');
166
167
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
167
168
  {
168
169
  throw new Error(message);
@@ -737,18 +738,30 @@ function queryRecord(context) {
737
738
  }
738
739
 
739
740
  /**
740
- Returns an instance of the adapter for a given type. For
741
- example, `adapterFor('person')` will return an instance of
742
- the adapter located at `app/adapters/person.js`
741
+ * Extends the signature of {@link Store} with additional
742
+ * methods available when using the legacy network layer.
743
+ *
744
+ * @public
745
+ * @noInheritDoc
746
+ * @legacy
747
+ */
743
748
 
744
- If no `person` adapter is found, this method will look
745
- for an `application` adapter (the default adapter for
746
- your entire application).
749
+ /**
750
+ * @deprecated - use {@link LegacyStoreCompat} instead
751
+ */
747
752
 
748
- @public
749
- @param {String} modelName
750
- @return {Adapter}
751
- */
753
+ /**
754
+ Returns an instance of the adapter for a given type. For
755
+ example, `adapterFor('person')` will return an instance of
756
+ the adapter located at `app/adapters/person.js`
757
+
758
+ If no `person` adapter is found, this method will look
759
+ for an `application` adapter (the default adapter for
760
+ your entire application).
761
+
762
+ @public
763
+ @param modelName
764
+ */
752
765
 
753
766
  function adapterFor(modelName, _allowMissing) {
754
767
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
@@ -799,20 +812,19 @@ function adapterFor(modelName, _allowMissing) {
799
812
  }
800
813
 
801
814
  /**
802
- Returns an instance of the serializer for a given type. For
803
- example, `serializerFor('person')` will return an instance of
804
- `App.PersonSerializer`.
815
+ Returns an instance of the serializer for a given type. For
816
+ example, `serializerFor('person')` will return an instance of
817
+ `App.PersonSerializer`.
805
818
 
806
- If no `App.PersonSerializer` is found, this method will look
807
- for an `App.ApplicationSerializer` (the default serializer for
808
- your entire application).
819
+ If no `App.PersonSerializer` is found, this method will look
820
+ for an `App.ApplicationSerializer` (the default serializer for
821
+ your entire application).
809
822
 
810
- If a serializer cannot be found on the adapter, it will fall back
811
- to an instance of `JSONSerializer`.
823
+ If a serializer cannot be found on the adapter, it will fall back
824
+ to an instance of `JSONSerializer`.
812
825
 
813
- @public
814
- @param {String} modelName the record to serialize
815
- @return {Serializer}
826
+ @public
827
+ @param modelName the record to serialize
816
828
  */
817
829
  function serializerFor(modelName) {
818
830
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
@@ -859,23 +871,29 @@ function serializerFor(modelName) {
859
871
  }
860
872
 
861
873
  /**
862
- `normalize` converts a json payload into the normalized form that
863
- [push](../methods/push?anchor=push) expects.
874
+ `normalize` converts a json payload into the normalized form expected by
875
+ {@link Store.push | push} using the serializer specified by `modelName`
864
876
 
865
- Example
877
+ :::warning
878
+ Generally it would be better to invoke the serializer yourself directly,
879
+ or write a more specialized normalization utility.
880
+ :::
866
881
 
867
- ```js
868
- socket.on('message', function(message) {
869
- let modelName = message.model;
870
- let data = message.data;
871
- store.push(store.normalize(modelName, data));
872
- });
873
- ```
882
+ Example
874
883
 
875
- @public
876
- @param modelName The name of the model type for this payload
877
- @return The normalized payload
878
- */
884
+ ```js
885
+ socket.on('message', function(message) {
886
+ let modelName = message.model;
887
+ let data = message.data;
888
+ store.push(store.normalize(modelName, data));
889
+ });
890
+ ```
891
+
892
+ @legacy
893
+ @public
894
+ @param modelName The name of the model type for this payload
895
+ @return The normalized payload
896
+ */
879
897
  // TODO @runspired @deprecate users should call normalize on the associated serializer directly
880
898
  function normalize(modelName, payload) {
881
899
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
@@ -914,7 +932,7 @@ function normalize(modelName, payload) {
914
932
  serializer.
915
933
 
916
934
  ```js [app/serializers/application.js]
917
- import RESTSerializer from '@ember-data/serializer/rest';
935
+ import RESTSerializer from '@warp-drive/legacy/serializer/rest';
918
936
 
919
937
  export default class ApplicationSerializer extends RESTSerializer;
920
938
  ```
@@ -939,13 +957,13 @@ function normalize(modelName, payload) {
939
957
  will determine which serializer will process the payload.
940
958
 
941
959
  ```js [app/serializers/application.js]
942
- import RESTSerializer from '@ember-data/serializer/rest';
960
+ import RESTSerializer from '@warp-drive/legacy/serializer/rest';
943
961
 
944
962
  export default class ApplicationSerializer extends RESTSerializer;
945
963
  ```
946
964
 
947
965
  ```js [app/serializers/post.js]
948
- import JSONSerializer from '@ember-data/serializer/json';
966
+ import JSONSerializer from '@warp-drive/legacy/serializer/json';
949
967
 
950
968
  export default JSONSerializer;
951
969
  ```
@@ -956,8 +974,8 @@ function normalize(modelName, payload) {
956
974
  ```
957
975
 
958
976
  @public
959
- @param {String} modelName Optionally, a model type used to determine which serializer will be used
960
- @param {Object} inputPayload
977
+ @param modelName Optionally, a model type used to determine which serializer will be used
978
+ @param inputPayload
961
979
  */
962
980
  // TODO @runspired @deprecate pushPayload in favor of looking up the serializer
963
981
  function pushPayload(modelName, inputPayload) {