@warp-drive/legacy 5.8.0-alpha.30 → 5.8.0-alpha.34

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 (477) hide show
  1. package/declarations/adapter/error.d.ts +5 -5
  2. package/declarations/adapter/json-api.d.ts +2 -2
  3. package/declarations/compat/builders/find-all.d.ts +6 -6
  4. package/declarations/compat/builders/find-record.d.ts +8 -8
  5. package/declarations/compat/builders/query.d.ts +12 -12
  6. package/declarations/compat.d.ts +3 -3
  7. package/declarations/model/-private/references/belongs-to.d.ts +4 -4
  8. package/declarations/model/-private/references/has-many.d.ts +2 -2
  9. package/declarations/model/migration-support.d.ts +34 -18
  10. package/declarations/model.d.ts +2 -2
  11. package/declarations/serializer/-private/embedded-records-mixin.d.ts +1 -1
  12. package/declarations/serializer/json-api.d.ts +3 -3
  13. package/declarations/serializer/json.d.ts +1 -1
  14. package/declarations/serializer.d.ts +1 -1
  15. package/dist/adapter/error.js +7 -7
  16. package/dist/compat/builders.js +26 -26
  17. package/dist/compat/utils.js +0 -1
  18. package/dist/compat.js +3 -3
  19. package/dist/{errors-B9CDPh3R.js → errors-CIGPcDvd.js} +12 -12
  20. package/dist/{hooks-CQXyievu.js → hooks-QqRnX108.js} +1 -1
  21. package/dist/index.js +4 -4
  22. package/dist/{json-BHxlccxF.js → json-BNrV8EYG.js} +4 -4
  23. package/dist/model/-private.js +1 -1
  24. package/dist/model/migration-support.js +41 -24
  25. package/dist/{model-for-B0TSd9HU.js → model-for-CqXsIKws.js} +1 -1
  26. package/dist/model-fragments.js +2 -2
  27. package/dist/model.js +3 -3
  28. package/dist/{schema-provider-BnVr_CnJ.js → schema-provider-g5MfTj8n.js} +11 -11
  29. package/dist/serializer/json-api.js +7 -7
  30. package/dist/serializer/json.js +1 -1
  31. package/dist/serializer/rest.js +10 -10
  32. package/dist/serializer.js +1 -1
  33. package/dist/unpkg/dev/-private-B1pSSN52.js +1210 -0
  34. package/dist/unpkg/dev/adapter/-private.js +1 -0
  35. package/dist/unpkg/dev/adapter/error.js +336 -0
  36. package/dist/unpkg/dev/adapter/json-api.js +132 -0
  37. package/dist/unpkg/dev/adapter/rest.js +1257 -0
  38. package/dist/unpkg/dev/adapter.js +1253 -0
  39. package/dist/unpkg/dev/compat/-private.js +1 -0
  40. package/dist/unpkg/dev/compat/builders.js +273 -0
  41. package/dist/unpkg/dev/compat/extensions.js +243 -0
  42. package/dist/unpkg/dev/compat/utils.js +224 -0
  43. package/dist/unpkg/dev/compat.js +1020 -0
  44. package/dist/unpkg/dev/declarations/adapter/-private/build-url-mixin.d.ts +33 -0
  45. package/dist/unpkg/dev/declarations/adapter/-private/fastboot-interface.d.ts +8 -0
  46. package/dist/unpkg/dev/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -0
  47. package/dist/unpkg/dev/declarations/adapter/-private/utils/determine-body-promise.d.ts +4 -0
  48. package/dist/unpkg/dev/declarations/adapter/-private/utils/fetch.d.ts +8 -0
  49. package/dist/unpkg/dev/declarations/adapter/-private/utils/parse-response-headers.d.ts +1 -0
  50. package/dist/unpkg/dev/declarations/adapter/-private/utils/serialize-into-hash.d.ts +6 -0
  51. package/dist/unpkg/dev/declarations/adapter/-private/utils/serialize-query-params.d.ts +5 -0
  52. package/dist/unpkg/dev/declarations/adapter/-private.d.ts +5 -0
  53. package/dist/unpkg/dev/declarations/adapter/error.d.ts +215 -0
  54. package/dist/unpkg/dev/declarations/adapter/json-api.d.ts +231 -0
  55. package/dist/unpkg/dev/declarations/adapter/rest.d.ts +815 -0
  56. package/dist/unpkg/dev/declarations/adapter.d.ts +770 -0
  57. package/dist/unpkg/dev/declarations/compat/-private.d.ts +13 -0
  58. package/dist/unpkg/dev/declarations/compat/builders/find-all.d.ts +35 -0
  59. package/dist/unpkg/dev/declarations/compat/builders/find-record.d.ts +56 -0
  60. package/dist/unpkg/dev/declarations/compat/builders/query.d.ts +66 -0
  61. package/dist/unpkg/dev/declarations/compat/builders/save-record.d.ts +34 -0
  62. package/dist/unpkg/dev/declarations/compat/builders/utils.d.ts +3 -0
  63. package/dist/unpkg/dev/declarations/compat/builders.d.ts +14 -0
  64. package/dist/unpkg/dev/declarations/compat/extensions.d.ts +59 -0
  65. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/fetch-manager.d.ts +55 -0
  66. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -0
  67. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +11 -0
  68. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +5 -0
  69. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +2 -0
  70. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +524 -0
  71. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +213 -0
  72. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/serializer-response.d.ts +6 -0
  73. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +110 -0
  74. package/dist/unpkg/dev/declarations/compat/legacy-network-handler/snapshot.d.ts +255 -0
  75. package/dist/unpkg/dev/declarations/compat/utils.d.ts +137 -0
  76. package/dist/unpkg/dev/declarations/compat.d.ts +157 -0
  77. package/dist/unpkg/dev/declarations/index.d.ts +70 -0
  78. package/dist/unpkg/dev/declarations/model/-private/attr.d.ts +170 -0
  79. package/dist/unpkg/dev/declarations/model/-private/belongs-to.d.ts +174 -0
  80. package/dist/unpkg/dev/declarations/model/-private/debug/assert-polymorphic-type.d.ts +5 -0
  81. package/dist/unpkg/dev/declarations/model/-private/errors.d.ts +289 -0
  82. package/dist/unpkg/dev/declarations/model/-private/has-many.d.ts +162 -0
  83. package/dist/unpkg/dev/declarations/model/-private/hooks.d.ts +10 -0
  84. package/dist/unpkg/dev/declarations/model/-private/legacy-relationships-support.d.ts +47 -0
  85. package/dist/unpkg/dev/declarations/model/-private/model-for-mixin.d.ts +3 -0
  86. package/dist/unpkg/dev/declarations/model/-private/model-methods.d.ts +39 -0
  87. package/dist/unpkg/dev/declarations/model/-private/model.d.ts +1269 -0
  88. package/dist/unpkg/dev/declarations/model/-private/notify-changes.d.ts +4 -0
  89. package/dist/unpkg/dev/declarations/model/-private/promise-belongs-to.d.ts +40 -0
  90. package/dist/unpkg/dev/declarations/model/-private/promise-many-array.d.ts +124 -0
  91. package/dist/unpkg/dev/declarations/model/-private/record-state.d.ts +58 -0
  92. package/dist/unpkg/dev/declarations/model/-private/references/belongs-to.d.ts +498 -0
  93. package/dist/unpkg/dev/declarations/model/-private/references/has-many.d.ts +500 -0
  94. package/dist/unpkg/dev/declarations/model/-private/schema-provider.d.ts +56 -0
  95. package/dist/unpkg/dev/declarations/model/-private/type-utils.d.ts +57 -0
  96. package/dist/unpkg/dev/declarations/model/-private/util.d.ts +5 -0
  97. package/dist/unpkg/dev/declarations/model/-private.d.ts +8 -0
  98. package/dist/unpkg/dev/declarations/model/migration-support.d.ts +280 -0
  99. package/dist/unpkg/dev/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
  100. package/dist/unpkg/dev/declarations/model-fragments/extensions/fragment.d.ts +15 -0
  101. package/dist/unpkg/dev/declarations/model-fragments/hooks/model-for.d.ts +20 -0
  102. package/dist/unpkg/dev/declarations/model-fragments/index.d.ts +5 -0
  103. package/dist/unpkg/dev/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
  104. package/dist/unpkg/dev/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
  105. package/dist/unpkg/dev/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
  106. package/dist/unpkg/dev/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
  107. package/dist/unpkg/dev/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
  108. package/dist/unpkg/dev/declarations/model-fragments.d.ts +9 -0
  109. package/dist/unpkg/dev/declarations/model.d.ts +49 -0
  110. package/dist/unpkg/dev/declarations/serializer/-private/embedded-records-mixin.d.ts +91 -0
  111. package/dist/unpkg/dev/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
  112. package/dist/unpkg/dev/declarations/serializer/-private/transforms/date.d.ts +28 -0
  113. package/dist/unpkg/dev/declarations/serializer/-private/transforms/number.d.ts +29 -0
  114. package/dist/unpkg/dev/declarations/serializer/-private/transforms/string.d.ts +29 -0
  115. package/dist/unpkg/dev/declarations/serializer/-private/transforms/transform.d.ts +118 -0
  116. package/dist/unpkg/dev/declarations/serializer/-private/utils.d.ts +3 -0
  117. package/dist/unpkg/dev/declarations/serializer/json-api.d.ts +123 -0
  118. package/dist/unpkg/dev/declarations/serializer/json.d.ts +75 -0
  119. package/dist/unpkg/dev/declarations/serializer/rest.d.ts +51 -0
  120. package/dist/unpkg/dev/declarations/serializer/transform.d.ts +5 -0
  121. package/dist/unpkg/dev/declarations/serializer.d.ts +254 -0
  122. package/dist/unpkg/dev/declarations/store/-private.d.ts +223 -0
  123. package/dist/unpkg/dev/declarations/store.d.ts +3 -0
  124. package/dist/unpkg/dev/errors-CIGPcDvd.js +2595 -0
  125. package/dist/unpkg/dev/hooks-QqRnX108.js +74 -0
  126. package/dist/unpkg/dev/index.js +195 -0
  127. package/dist/unpkg/dev/json-BNrV8EYG.js +1272 -0
  128. package/dist/unpkg/dev/model/-private.js +1 -0
  129. package/dist/unpkg/dev/model/migration-support.js +579 -0
  130. package/dist/unpkg/dev/model-for-CqXsIKws.js +221 -0
  131. package/dist/unpkg/dev/model-fragments.js +76 -0
  132. package/dist/unpkg/dev/model.js +667 -0
  133. package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  134. package/dist/unpkg/dev/schema-provider-g5MfTj8n.js +2338 -0
  135. package/dist/unpkg/dev/serialize-into-hash-BnYvPex3.js +261 -0
  136. package/dist/unpkg/dev/serializer/json-api.js +527 -0
  137. package/dist/unpkg/dev/serializer/json.js +6 -0
  138. package/dist/unpkg/dev/serializer/rest.js +1243 -0
  139. package/dist/unpkg/dev/serializer/transform.js +278 -0
  140. package/dist/unpkg/dev/serializer.js +248 -0
  141. package/dist/unpkg/dev/store.js +636 -0
  142. package/dist/unpkg/dev/util-Dul6TZts.js +35 -0
  143. package/dist/unpkg/dev/utils-Cqw9eRj5.js +23 -0
  144. package/dist/unpkg/dev-deprecated/-private-B1pSSN52.js +1210 -0
  145. package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -0
  146. package/dist/unpkg/dev-deprecated/adapter/error.js +336 -0
  147. package/dist/unpkg/dev-deprecated/adapter/json-api.js +132 -0
  148. package/dist/unpkg/dev-deprecated/adapter/rest.js +1257 -0
  149. package/dist/unpkg/dev-deprecated/adapter.js +1253 -0
  150. package/dist/unpkg/dev-deprecated/compat/-private.js +1 -0
  151. package/dist/unpkg/dev-deprecated/compat/builders.js +273 -0
  152. package/dist/unpkg/dev-deprecated/compat/extensions.js +243 -0
  153. package/dist/unpkg/dev-deprecated/compat/utils.js +224 -0
  154. package/dist/unpkg/dev-deprecated/compat.js +1020 -0
  155. package/dist/unpkg/dev-deprecated/declarations/adapter/-private/build-url-mixin.d.ts +33 -0
  156. package/dist/unpkg/dev-deprecated/declarations/adapter/-private/fastboot-interface.d.ts +8 -0
  157. package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -0
  158. package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/determine-body-promise.d.ts +4 -0
  159. package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/fetch.d.ts +8 -0
  160. package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/parse-response-headers.d.ts +1 -0
  161. package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/serialize-into-hash.d.ts +6 -0
  162. package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/serialize-query-params.d.ts +5 -0
  163. package/dist/unpkg/dev-deprecated/declarations/adapter/-private.d.ts +5 -0
  164. package/dist/unpkg/dev-deprecated/declarations/adapter/error.d.ts +215 -0
  165. package/dist/unpkg/dev-deprecated/declarations/adapter/json-api.d.ts +231 -0
  166. package/dist/unpkg/dev-deprecated/declarations/adapter/rest.d.ts +815 -0
  167. package/dist/unpkg/dev-deprecated/declarations/adapter.d.ts +770 -0
  168. package/dist/unpkg/dev-deprecated/declarations/compat/-private.d.ts +13 -0
  169. package/dist/unpkg/dev-deprecated/declarations/compat/builders/find-all.d.ts +35 -0
  170. package/dist/unpkg/dev-deprecated/declarations/compat/builders/find-record.d.ts +56 -0
  171. package/dist/unpkg/dev-deprecated/declarations/compat/builders/query.d.ts +66 -0
  172. package/dist/unpkg/dev-deprecated/declarations/compat/builders/save-record.d.ts +34 -0
  173. package/dist/unpkg/dev-deprecated/declarations/compat/builders/utils.d.ts +3 -0
  174. package/dist/unpkg/dev-deprecated/declarations/compat/builders.d.ts +14 -0
  175. package/dist/unpkg/dev-deprecated/declarations/compat/extensions.d.ts +59 -0
  176. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/fetch-manager.d.ts +55 -0
  177. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -0
  178. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +11 -0
  179. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +5 -0
  180. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +2 -0
  181. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +524 -0
  182. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +213 -0
  183. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/serializer-response.d.ts +6 -0
  184. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +110 -0
  185. package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/snapshot.d.ts +255 -0
  186. package/dist/unpkg/dev-deprecated/declarations/compat/utils.d.ts +137 -0
  187. package/dist/unpkg/dev-deprecated/declarations/compat.d.ts +157 -0
  188. package/dist/unpkg/dev-deprecated/declarations/index.d.ts +70 -0
  189. package/dist/unpkg/dev-deprecated/declarations/model/-private/attr.d.ts +170 -0
  190. package/dist/unpkg/dev-deprecated/declarations/model/-private/belongs-to.d.ts +174 -0
  191. package/dist/unpkg/dev-deprecated/declarations/model/-private/debug/assert-polymorphic-type.d.ts +5 -0
  192. package/dist/unpkg/dev-deprecated/declarations/model/-private/errors.d.ts +289 -0
  193. package/dist/unpkg/dev-deprecated/declarations/model/-private/has-many.d.ts +162 -0
  194. package/dist/unpkg/dev-deprecated/declarations/model/-private/hooks.d.ts +10 -0
  195. package/dist/unpkg/dev-deprecated/declarations/model/-private/legacy-relationships-support.d.ts +47 -0
  196. package/dist/unpkg/dev-deprecated/declarations/model/-private/model-for-mixin.d.ts +3 -0
  197. package/dist/unpkg/dev-deprecated/declarations/model/-private/model-methods.d.ts +39 -0
  198. package/dist/unpkg/dev-deprecated/declarations/model/-private/model.d.ts +1269 -0
  199. package/dist/unpkg/dev-deprecated/declarations/model/-private/notify-changes.d.ts +4 -0
  200. package/dist/unpkg/dev-deprecated/declarations/model/-private/promise-belongs-to.d.ts +40 -0
  201. package/dist/unpkg/dev-deprecated/declarations/model/-private/promise-many-array.d.ts +124 -0
  202. package/dist/unpkg/dev-deprecated/declarations/model/-private/record-state.d.ts +58 -0
  203. package/dist/unpkg/dev-deprecated/declarations/model/-private/references/belongs-to.d.ts +498 -0
  204. package/dist/unpkg/dev-deprecated/declarations/model/-private/references/has-many.d.ts +500 -0
  205. package/dist/unpkg/dev-deprecated/declarations/model/-private/schema-provider.d.ts +56 -0
  206. package/dist/unpkg/dev-deprecated/declarations/model/-private/type-utils.d.ts +57 -0
  207. package/dist/unpkg/dev-deprecated/declarations/model/-private/util.d.ts +5 -0
  208. package/dist/unpkg/dev-deprecated/declarations/model/-private.d.ts +8 -0
  209. package/dist/unpkg/dev-deprecated/declarations/model/migration-support.d.ts +280 -0
  210. package/dist/unpkg/dev-deprecated/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
  211. package/dist/unpkg/dev-deprecated/declarations/model-fragments/extensions/fragment.d.ts +15 -0
  212. package/dist/unpkg/dev-deprecated/declarations/model-fragments/hooks/model-for.d.ts +20 -0
  213. package/dist/unpkg/dev-deprecated/declarations/model-fragments/index.d.ts +5 -0
  214. package/dist/unpkg/dev-deprecated/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
  215. package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
  216. package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
  217. package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
  218. package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
  219. package/dist/unpkg/dev-deprecated/declarations/model-fragments.d.ts +9 -0
  220. package/dist/unpkg/dev-deprecated/declarations/model.d.ts +49 -0
  221. package/dist/unpkg/dev-deprecated/declarations/serializer/-private/embedded-records-mixin.d.ts +91 -0
  222. package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
  223. package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/date.d.ts +28 -0
  224. package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/number.d.ts +29 -0
  225. package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/string.d.ts +29 -0
  226. package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/transform.d.ts +118 -0
  227. package/dist/unpkg/dev-deprecated/declarations/serializer/-private/utils.d.ts +3 -0
  228. package/dist/unpkg/dev-deprecated/declarations/serializer/json-api.d.ts +123 -0
  229. package/dist/unpkg/dev-deprecated/declarations/serializer/json.d.ts +75 -0
  230. package/dist/unpkg/dev-deprecated/declarations/serializer/rest.d.ts +51 -0
  231. package/dist/unpkg/dev-deprecated/declarations/serializer/transform.d.ts +5 -0
  232. package/dist/unpkg/dev-deprecated/declarations/serializer.d.ts +254 -0
  233. package/dist/unpkg/dev-deprecated/declarations/store/-private.d.ts +223 -0
  234. package/dist/unpkg/dev-deprecated/declarations/store.d.ts +3 -0
  235. package/dist/unpkg/dev-deprecated/errors-CIGPcDvd.js +2595 -0
  236. package/dist/unpkg/dev-deprecated/hooks-QqRnX108.js +74 -0
  237. package/dist/unpkg/dev-deprecated/index.js +195 -0
  238. package/dist/unpkg/dev-deprecated/json-BNrV8EYG.js +1272 -0
  239. package/dist/unpkg/dev-deprecated/model/-private.js +1 -0
  240. package/dist/unpkg/dev-deprecated/model/migration-support.js +579 -0
  241. package/dist/unpkg/dev-deprecated/model-for-CqXsIKws.js +221 -0
  242. package/dist/unpkg/dev-deprecated/model-fragments.js +76 -0
  243. package/dist/unpkg/dev-deprecated/model.js +667 -0
  244. package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  245. package/dist/unpkg/dev-deprecated/schema-provider-g5MfTj8n.js +2338 -0
  246. package/dist/unpkg/dev-deprecated/serialize-into-hash-BnYvPex3.js +261 -0
  247. package/dist/unpkg/dev-deprecated/serializer/json-api.js +527 -0
  248. package/dist/unpkg/dev-deprecated/serializer/json.js +6 -0
  249. package/dist/unpkg/dev-deprecated/serializer/rest.js +1243 -0
  250. package/dist/unpkg/dev-deprecated/serializer/transform.js +278 -0
  251. package/dist/unpkg/dev-deprecated/serializer.js +248 -0
  252. package/dist/unpkg/dev-deprecated/store.js +636 -0
  253. package/dist/unpkg/dev-deprecated/util-Dul6TZts.js +35 -0
  254. package/dist/unpkg/dev-deprecated/utils-Cqw9eRj5.js +23 -0
  255. package/dist/unpkg/prod/-private-B1pSSN52.js +1210 -0
  256. package/dist/unpkg/prod/adapter/-private.js +1 -0
  257. package/dist/unpkg/prod/adapter/error.js +336 -0
  258. package/dist/unpkg/prod/adapter/json-api.js +132 -0
  259. package/dist/unpkg/prod/adapter/rest.js +1257 -0
  260. package/dist/unpkg/prod/adapter.js +1253 -0
  261. package/dist/unpkg/prod/compat/-private.js +1 -0
  262. package/dist/unpkg/prod/compat/builders.js +273 -0
  263. package/dist/unpkg/prod/compat/extensions.js +243 -0
  264. package/dist/unpkg/prod/compat/utils.js +224 -0
  265. package/dist/unpkg/prod/compat.js +1020 -0
  266. package/dist/unpkg/prod/declarations/adapter/-private/build-url-mixin.d.ts +33 -0
  267. package/dist/unpkg/prod/declarations/adapter/-private/fastboot-interface.d.ts +8 -0
  268. package/dist/unpkg/prod/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -0
  269. package/dist/unpkg/prod/declarations/adapter/-private/utils/determine-body-promise.d.ts +4 -0
  270. package/dist/unpkg/prod/declarations/adapter/-private/utils/fetch.d.ts +8 -0
  271. package/dist/unpkg/prod/declarations/adapter/-private/utils/parse-response-headers.d.ts +1 -0
  272. package/dist/unpkg/prod/declarations/adapter/-private/utils/serialize-into-hash.d.ts +6 -0
  273. package/dist/unpkg/prod/declarations/adapter/-private/utils/serialize-query-params.d.ts +5 -0
  274. package/dist/unpkg/prod/declarations/adapter/-private.d.ts +5 -0
  275. package/dist/unpkg/prod/declarations/adapter/error.d.ts +215 -0
  276. package/dist/unpkg/prod/declarations/adapter/json-api.d.ts +231 -0
  277. package/dist/unpkg/prod/declarations/adapter/rest.d.ts +815 -0
  278. package/dist/unpkg/prod/declarations/adapter.d.ts +770 -0
  279. package/dist/unpkg/prod/declarations/compat/-private.d.ts +13 -0
  280. package/dist/unpkg/prod/declarations/compat/builders/find-all.d.ts +35 -0
  281. package/dist/unpkg/prod/declarations/compat/builders/find-record.d.ts +56 -0
  282. package/dist/unpkg/prod/declarations/compat/builders/query.d.ts +66 -0
  283. package/dist/unpkg/prod/declarations/compat/builders/save-record.d.ts +34 -0
  284. package/dist/unpkg/prod/declarations/compat/builders/utils.d.ts +3 -0
  285. package/dist/unpkg/prod/declarations/compat/builders.d.ts +14 -0
  286. package/dist/unpkg/prod/declarations/compat/extensions.d.ts +59 -0
  287. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/fetch-manager.d.ts +55 -0
  288. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -0
  289. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +11 -0
  290. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +5 -0
  291. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +2 -0
  292. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +524 -0
  293. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +213 -0
  294. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/serializer-response.d.ts +6 -0
  295. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +110 -0
  296. package/dist/unpkg/prod/declarations/compat/legacy-network-handler/snapshot.d.ts +255 -0
  297. package/dist/unpkg/prod/declarations/compat/utils.d.ts +137 -0
  298. package/dist/unpkg/prod/declarations/compat.d.ts +157 -0
  299. package/dist/unpkg/prod/declarations/index.d.ts +70 -0
  300. package/dist/unpkg/prod/declarations/model/-private/attr.d.ts +170 -0
  301. package/dist/unpkg/prod/declarations/model/-private/belongs-to.d.ts +174 -0
  302. package/dist/unpkg/prod/declarations/model/-private/debug/assert-polymorphic-type.d.ts +5 -0
  303. package/dist/unpkg/prod/declarations/model/-private/errors.d.ts +289 -0
  304. package/dist/unpkg/prod/declarations/model/-private/has-many.d.ts +162 -0
  305. package/dist/unpkg/prod/declarations/model/-private/hooks.d.ts +10 -0
  306. package/dist/unpkg/prod/declarations/model/-private/legacy-relationships-support.d.ts +47 -0
  307. package/dist/unpkg/prod/declarations/model/-private/model-for-mixin.d.ts +3 -0
  308. package/dist/unpkg/prod/declarations/model/-private/model-methods.d.ts +39 -0
  309. package/dist/unpkg/prod/declarations/model/-private/model.d.ts +1269 -0
  310. package/dist/unpkg/prod/declarations/model/-private/notify-changes.d.ts +4 -0
  311. package/dist/unpkg/prod/declarations/model/-private/promise-belongs-to.d.ts +40 -0
  312. package/dist/unpkg/prod/declarations/model/-private/promise-many-array.d.ts +124 -0
  313. package/dist/unpkg/prod/declarations/model/-private/record-state.d.ts +58 -0
  314. package/dist/unpkg/prod/declarations/model/-private/references/belongs-to.d.ts +498 -0
  315. package/dist/unpkg/prod/declarations/model/-private/references/has-many.d.ts +500 -0
  316. package/dist/unpkg/prod/declarations/model/-private/schema-provider.d.ts +56 -0
  317. package/dist/unpkg/prod/declarations/model/-private/type-utils.d.ts +57 -0
  318. package/dist/unpkg/prod/declarations/model/-private/util.d.ts +5 -0
  319. package/dist/unpkg/prod/declarations/model/-private.d.ts +8 -0
  320. package/dist/unpkg/prod/declarations/model/migration-support.d.ts +280 -0
  321. package/dist/unpkg/prod/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
  322. package/dist/unpkg/prod/declarations/model-fragments/extensions/fragment.d.ts +15 -0
  323. package/dist/unpkg/prod/declarations/model-fragments/hooks/model-for.d.ts +20 -0
  324. package/dist/unpkg/prod/declarations/model-fragments/index.d.ts +5 -0
  325. package/dist/unpkg/prod/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
  326. package/dist/unpkg/prod/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
  327. package/dist/unpkg/prod/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
  328. package/dist/unpkg/prod/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
  329. package/dist/unpkg/prod/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
  330. package/dist/unpkg/prod/declarations/model-fragments.d.ts +9 -0
  331. package/dist/unpkg/prod/declarations/model.d.ts +49 -0
  332. package/dist/unpkg/prod/declarations/serializer/-private/embedded-records-mixin.d.ts +91 -0
  333. package/dist/unpkg/prod/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
  334. package/dist/unpkg/prod/declarations/serializer/-private/transforms/date.d.ts +28 -0
  335. package/dist/unpkg/prod/declarations/serializer/-private/transforms/number.d.ts +29 -0
  336. package/dist/unpkg/prod/declarations/serializer/-private/transforms/string.d.ts +29 -0
  337. package/dist/unpkg/prod/declarations/serializer/-private/transforms/transform.d.ts +118 -0
  338. package/dist/unpkg/prod/declarations/serializer/-private/utils.d.ts +3 -0
  339. package/dist/unpkg/prod/declarations/serializer/json-api.d.ts +123 -0
  340. package/dist/unpkg/prod/declarations/serializer/json.d.ts +75 -0
  341. package/dist/unpkg/prod/declarations/serializer/rest.d.ts +51 -0
  342. package/dist/unpkg/prod/declarations/serializer/transform.d.ts +5 -0
  343. package/dist/unpkg/prod/declarations/serializer.d.ts +254 -0
  344. package/dist/unpkg/prod/declarations/store/-private.d.ts +223 -0
  345. package/dist/unpkg/prod/declarations/store.d.ts +3 -0
  346. package/dist/unpkg/prod/errors-CIGPcDvd.js +2595 -0
  347. package/dist/unpkg/prod/hooks-QqRnX108.js +74 -0
  348. package/dist/unpkg/prod/index.js +195 -0
  349. package/dist/unpkg/prod/json-BNrV8EYG.js +1272 -0
  350. package/dist/unpkg/prod/model/-private.js +1 -0
  351. package/dist/unpkg/prod/model/migration-support.js +579 -0
  352. package/dist/unpkg/prod/model-for-CqXsIKws.js +221 -0
  353. package/dist/unpkg/prod/model-fragments.js +76 -0
  354. package/dist/unpkg/prod/model.js +667 -0
  355. package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  356. package/dist/unpkg/prod/schema-provider-g5MfTj8n.js +2338 -0
  357. package/dist/unpkg/prod/serialize-into-hash-BnYvPex3.js +261 -0
  358. package/dist/unpkg/prod/serializer/json-api.js +527 -0
  359. package/dist/unpkg/prod/serializer/json.js +6 -0
  360. package/dist/unpkg/prod/serializer/rest.js +1243 -0
  361. package/dist/unpkg/prod/serializer/transform.js +278 -0
  362. package/dist/unpkg/prod/serializer.js +248 -0
  363. package/dist/unpkg/prod/store.js +636 -0
  364. package/dist/unpkg/prod/util-Dul6TZts.js +35 -0
  365. package/dist/unpkg/prod/utils-Cqw9eRj5.js +23 -0
  366. package/dist/unpkg/prod-deprecated/-private-B1pSSN52.js +1210 -0
  367. package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -0
  368. package/dist/unpkg/prod-deprecated/adapter/error.js +336 -0
  369. package/dist/unpkg/prod-deprecated/adapter/json-api.js +132 -0
  370. package/dist/unpkg/prod-deprecated/adapter/rest.js +1257 -0
  371. package/dist/unpkg/prod-deprecated/adapter.js +1253 -0
  372. package/dist/unpkg/prod-deprecated/compat/-private.js +1 -0
  373. package/dist/unpkg/prod-deprecated/compat/builders.js +273 -0
  374. package/dist/unpkg/prod-deprecated/compat/extensions.js +243 -0
  375. package/dist/unpkg/prod-deprecated/compat/utils.js +224 -0
  376. package/dist/unpkg/prod-deprecated/compat.js +1020 -0
  377. package/dist/unpkg/prod-deprecated/declarations/adapter/-private/build-url-mixin.d.ts +33 -0
  378. package/dist/unpkg/prod-deprecated/declarations/adapter/-private/fastboot-interface.d.ts +8 -0
  379. package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -0
  380. package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/determine-body-promise.d.ts +4 -0
  381. package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/fetch.d.ts +8 -0
  382. package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/parse-response-headers.d.ts +1 -0
  383. package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/serialize-into-hash.d.ts +6 -0
  384. package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/serialize-query-params.d.ts +5 -0
  385. package/dist/unpkg/prod-deprecated/declarations/adapter/-private.d.ts +5 -0
  386. package/dist/unpkg/prod-deprecated/declarations/adapter/error.d.ts +215 -0
  387. package/dist/unpkg/prod-deprecated/declarations/adapter/json-api.d.ts +231 -0
  388. package/dist/unpkg/prod-deprecated/declarations/adapter/rest.d.ts +815 -0
  389. package/dist/unpkg/prod-deprecated/declarations/adapter.d.ts +770 -0
  390. package/dist/unpkg/prod-deprecated/declarations/compat/-private.d.ts +13 -0
  391. package/dist/unpkg/prod-deprecated/declarations/compat/builders/find-all.d.ts +35 -0
  392. package/dist/unpkg/prod-deprecated/declarations/compat/builders/find-record.d.ts +56 -0
  393. package/dist/unpkg/prod-deprecated/declarations/compat/builders/query.d.ts +66 -0
  394. package/dist/unpkg/prod-deprecated/declarations/compat/builders/save-record.d.ts +34 -0
  395. package/dist/unpkg/prod-deprecated/declarations/compat/builders/utils.d.ts +3 -0
  396. package/dist/unpkg/prod-deprecated/declarations/compat/builders.d.ts +14 -0
  397. package/dist/unpkg/prod-deprecated/declarations/compat/extensions.d.ts +59 -0
  398. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/fetch-manager.d.ts +55 -0
  399. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -0
  400. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +11 -0
  401. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +5 -0
  402. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +2 -0
  403. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +524 -0
  404. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +213 -0
  405. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/serializer-response.d.ts +6 -0
  406. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +110 -0
  407. package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/snapshot.d.ts +255 -0
  408. package/dist/unpkg/prod-deprecated/declarations/compat/utils.d.ts +137 -0
  409. package/dist/unpkg/prod-deprecated/declarations/compat.d.ts +157 -0
  410. package/dist/unpkg/prod-deprecated/declarations/index.d.ts +70 -0
  411. package/dist/unpkg/prod-deprecated/declarations/model/-private/attr.d.ts +170 -0
  412. package/dist/unpkg/prod-deprecated/declarations/model/-private/belongs-to.d.ts +174 -0
  413. package/dist/unpkg/prod-deprecated/declarations/model/-private/debug/assert-polymorphic-type.d.ts +5 -0
  414. package/dist/unpkg/prod-deprecated/declarations/model/-private/errors.d.ts +289 -0
  415. package/dist/unpkg/prod-deprecated/declarations/model/-private/has-many.d.ts +162 -0
  416. package/dist/unpkg/prod-deprecated/declarations/model/-private/hooks.d.ts +10 -0
  417. package/dist/unpkg/prod-deprecated/declarations/model/-private/legacy-relationships-support.d.ts +47 -0
  418. package/dist/unpkg/prod-deprecated/declarations/model/-private/model-for-mixin.d.ts +3 -0
  419. package/dist/unpkg/prod-deprecated/declarations/model/-private/model-methods.d.ts +39 -0
  420. package/dist/unpkg/prod-deprecated/declarations/model/-private/model.d.ts +1269 -0
  421. package/dist/unpkg/prod-deprecated/declarations/model/-private/notify-changes.d.ts +4 -0
  422. package/dist/unpkg/prod-deprecated/declarations/model/-private/promise-belongs-to.d.ts +40 -0
  423. package/dist/unpkg/prod-deprecated/declarations/model/-private/promise-many-array.d.ts +124 -0
  424. package/dist/unpkg/prod-deprecated/declarations/model/-private/record-state.d.ts +58 -0
  425. package/dist/unpkg/prod-deprecated/declarations/model/-private/references/belongs-to.d.ts +498 -0
  426. package/dist/unpkg/prod-deprecated/declarations/model/-private/references/has-many.d.ts +500 -0
  427. package/dist/unpkg/prod-deprecated/declarations/model/-private/schema-provider.d.ts +56 -0
  428. package/dist/unpkg/prod-deprecated/declarations/model/-private/type-utils.d.ts +57 -0
  429. package/dist/unpkg/prod-deprecated/declarations/model/-private/util.d.ts +5 -0
  430. package/dist/unpkg/prod-deprecated/declarations/model/-private.d.ts +8 -0
  431. package/dist/unpkg/prod-deprecated/declarations/model/migration-support.d.ts +280 -0
  432. package/dist/unpkg/prod-deprecated/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
  433. package/dist/unpkg/prod-deprecated/declarations/model-fragments/extensions/fragment.d.ts +15 -0
  434. package/dist/unpkg/prod-deprecated/declarations/model-fragments/hooks/model-for.d.ts +20 -0
  435. package/dist/unpkg/prod-deprecated/declarations/model-fragments/index.d.ts +5 -0
  436. package/dist/unpkg/prod-deprecated/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
  437. package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
  438. package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
  439. package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
  440. package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
  441. package/dist/unpkg/prod-deprecated/declarations/model-fragments.d.ts +9 -0
  442. package/dist/unpkg/prod-deprecated/declarations/model.d.ts +49 -0
  443. package/dist/unpkg/prod-deprecated/declarations/serializer/-private/embedded-records-mixin.d.ts +91 -0
  444. package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
  445. package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/date.d.ts +28 -0
  446. package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/number.d.ts +29 -0
  447. package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/string.d.ts +29 -0
  448. package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/transform.d.ts +118 -0
  449. package/dist/unpkg/prod-deprecated/declarations/serializer/-private/utils.d.ts +3 -0
  450. package/dist/unpkg/prod-deprecated/declarations/serializer/json-api.d.ts +123 -0
  451. package/dist/unpkg/prod-deprecated/declarations/serializer/json.d.ts +75 -0
  452. package/dist/unpkg/prod-deprecated/declarations/serializer/rest.d.ts +51 -0
  453. package/dist/unpkg/prod-deprecated/declarations/serializer/transform.d.ts +5 -0
  454. package/dist/unpkg/prod-deprecated/declarations/serializer.d.ts +254 -0
  455. package/dist/unpkg/prod-deprecated/declarations/store/-private.d.ts +223 -0
  456. package/dist/unpkg/prod-deprecated/declarations/store.d.ts +3 -0
  457. package/dist/unpkg/prod-deprecated/errors-CIGPcDvd.js +2595 -0
  458. package/dist/unpkg/prod-deprecated/hooks-QqRnX108.js +74 -0
  459. package/dist/unpkg/prod-deprecated/index.js +195 -0
  460. package/dist/unpkg/prod-deprecated/json-BNrV8EYG.js +1272 -0
  461. package/dist/unpkg/prod-deprecated/model/-private.js +1 -0
  462. package/dist/unpkg/prod-deprecated/model/migration-support.js +579 -0
  463. package/dist/unpkg/prod-deprecated/model-for-CqXsIKws.js +221 -0
  464. package/dist/unpkg/prod-deprecated/model-fragments.js +76 -0
  465. package/dist/unpkg/prod-deprecated/model.js +667 -0
  466. package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  467. package/dist/unpkg/prod-deprecated/schema-provider-g5MfTj8n.js +2338 -0
  468. package/dist/unpkg/prod-deprecated/serialize-into-hash-BnYvPex3.js +261 -0
  469. package/dist/unpkg/prod-deprecated/serializer/json-api.js +527 -0
  470. package/dist/unpkg/prod-deprecated/serializer/json.js +6 -0
  471. package/dist/unpkg/prod-deprecated/serializer/rest.js +1243 -0
  472. package/dist/unpkg/prod-deprecated/serializer/transform.js +278 -0
  473. package/dist/unpkg/prod-deprecated/serializer.js +248 -0
  474. package/dist/unpkg/prod-deprecated/store.js +636 -0
  475. package/dist/unpkg/prod-deprecated/util-Dul6TZts.js +35 -0
  476. package/dist/unpkg/prod-deprecated/utils-Cqw9eRj5.js +23 -0
  477. package/package.json +30 -6
@@ -0,0 +1,770 @@
1
+ /**
2
+ * ## Overview
3
+ *
4
+ * :::danger
5
+ * ⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
6
+ * If starting a new app or thinking of implementing a new adapter, consider writing a
7
+ * {@link Handler} instead to be used with the {@link RequestManager}
8
+ * ::::
9
+ *
10
+ * In order to properly fetch and update data, @warp-drive/legacy
11
+ * needs to understand how to connect to your API.
12
+ *
13
+ * `Adapters` accept various kinds of requests from the store
14
+ * and manage fulfillment of the request from your API.
15
+ *
16
+ * ### Request Flow
17
+ *
18
+ * When the store decides it needs to issue a request it uses the following flow to manage the request and process the data.
19
+ *
20
+ * - find the appropriate adapter
21
+ * - issue the request to the adapter
22
+ * - await the adapter's response
23
+ * - if an error occurs reject with the error
24
+ * - if no error
25
+ * - if there is response data
26
+ * - pass the response data to the appropriate serializer
27
+ * - update the cache using the JSON:API formatted data from the serializer's response
28
+ * - return the primary record(s) associated with the request
29
+ *
30
+ * ### Request Errors
31
+ *
32
+ * When a request errors and your adapter does not have the ability to recover from the error,
33
+ * you may either reject the promise returned by your adapter method with the error or simply
34
+ * throw the error.
35
+ *
36
+ * If the request was for a `createRecord` `updateRecord` or `deleteRecord` special rules
37
+ * apply to how this error will affect the state of the store and additional properties on
38
+ * the `Error` class may be used. See the documentation for these methods in
39
+ * {@link MinimumAdapterInterface} for more information.
40
+ *
41
+ * ### Implementing an Adapter
42
+ *
43
+ * There are seven required adapter methods, one for each of
44
+ * the primary request types that @warp-drive/legacy issues.
45
+ *
46
+ * They are:
47
+ *
48
+ * - findRecord
49
+ * - findAll
50
+ * - queryRecord
51
+ * - query
52
+ * - createRecord
53
+ * - updateRecord
54
+ * - deleteRecord
55
+ *
56
+ * Each of these request types has a matching store method that triggers it
57
+ * and matching `requestType` that is passed to the serializer's
58
+ * `normalizeResponse` method.
59
+ *
60
+ * If your app only reads data but never writes data, it is not necessary
61
+ * to implement the methods for create, update, and delete. This extends to
62
+ * all of the store's find methods with the exception of `findRecord` (`findAll`,
63
+ * `query`, `queryRecord`): if you do not use the store method in your app then
64
+ * your Adapter does not need the method.
65
+ *
66
+ * ```ts
67
+ * async function fetchData(url, options = {}) {
68
+ * let response = await fetch(url, options);
69
+ * return response.toJSON();
70
+ * }
71
+ *
72
+ * export default class ApplicationAdapter {
73
+ * findRecord(_, { modelName }, id) {
74
+ * return fetchData(`./${modelName}s/${id}`);
75
+ * }
76
+ *
77
+ * static create() {
78
+ * return new this();
79
+ * }
80
+ * }
81
+ * ```
82
+ *
83
+ * ### Adapter Resolution
84
+ *
85
+ * `store.adapterFor(name)` will lookup adapters defined in `app/adapters/` and
86
+ * return an instance.
87
+ *
88
+ * `adapterFor` first attempts to find an adapter with an exact match on `name`,
89
+ then falls back to checking for the presence of an adapter named `application`.
90
+
91
+ If no adapter is found, an error will be thrown.
92
+
93
+ ```ts
94
+ store.adapterFor('author');
95
+
96
+ // lookup paths (in order) =>
97
+ // app/adapters/author.js
98
+ // app/adapters/application.js
99
+ ```
100
+
101
+ Most requests in @warp-drive/legacy are made with respect to a particular `type` (or `modelName`)
102
+ (e.g., "get me the full collection of **books**" or "get me the **employee** whose id is 37"). We
103
+ refer to this as the **primary** resource `type`.
104
+
105
+ `adapterFor` is used by the store to find an adapter with a name matching that of the primary
106
+ resource `type` for the request, which then falls back to the `application` adapter.
107
+
108
+ It is recommended that applications define only a single `application` adapter and serializer
109
+ where possible, only implementing an adapter specific to the `type` when absolutely necessary.
110
+
111
+ If you need to support multiple API versions for the same type, the per-type strategy for
112
+ defining adapters might not be adequate.
113
+
114
+ If you have multiple APIs or multiple API versions and the single application adapter and per-type
115
+ strategy does not suite your needs, one strategy is to write an `application` adapter and serializer
116
+ that make use of `options` to specify the desired format when making a request, then forwards to the
117
+ request to the desired adapter or serializer as needed.
118
+
119
+ ```js [app/adapters/application.js]
120
+ export default class Adapter extends EmberObject {
121
+ findRecord(store, schema, id, snapshot) {
122
+ let { apiVersion } = snapshot.adapterOptions;
123
+ return this.adapterFor(`-api-${apiVersion}`).findRecord(store, schema, id, snapshot);
124
+ }
125
+ }
126
+ ```
127
+
128
+ ### Overriding `Store.adapterFor`
129
+
130
+ ```js
131
+ import Store from '@ember-data/store';
132
+ import Adapter from '@ember-data/adapter/json-api';
133
+
134
+ class extends Store {
135
+ #adapter = new Adapter();
136
+
137
+ adapterFor() {
138
+ return this.#adapter;
139
+ }
140
+ }
141
+ ```
142
+
143
+
144
+ Note: If you are using Ember and would like to make use of `service` injections in your adapter, you will want to additionally `setOwner` for the Adapter.
145
+
146
+ ```js
147
+ import Store from '@ember-data/store';
148
+ import Adapter from '@ember-data/adapter/json-api';
149
+ import { getOwner, setOwner } from '@ember/owner';
150
+
151
+ class extends Store {
152
+ #adapter = null;
153
+
154
+ adapterFor() {
155
+ let adapter = this.#adapter;
156
+ if (!adapter) {
157
+ const owner = getOwner(this);
158
+ adapter = new Adapter();
159
+ setOwner(adapter, owner);
160
+ this.#adapter = adapter;
161
+ }
162
+
163
+ return adapter;
164
+ }
165
+ }
166
+ ```
167
+
168
+ By default when using with Ember you only need to implement this hook if you want your adapter usage to be statically analyzeable. *Ember***Data** will attempt to resolve adapters using Ember's resolver. To provide a single Adapter for your application like the above you would provide it as the default export of the file `app/adapters/application.{js/ts}`
169
+
170
+ ### Using an Adapter
171
+
172
+ Any adapter in `app/adapters/` can be looked up by `name` using `store.adapterFor(name)`.
173
+
174
+ ### Default Adapters
175
+
176
+ Applications whose API's structure endpoint URLs *very close to* or *exactly* the **REST**
177
+ or **JSON:API** convention, the `@ember-data/adapter` package contains implementations
178
+ these applications can extend.
179
+
180
+ Many applications will find writing their own adapter to be allow greater flexibility,
181
+ customization, and maintenance than attempting to override methods in these adapters.
182
+
183
+ @module
184
+ */
185
+ import EmberObject from "@ember/object";
186
+ import type { Store } from "@warp-drive/core";
187
+ import type { ModelSchema } from "@warp-drive/core/types";
188
+ import type { AdapterPayload, MinimumAdapterInterface, SerializerOptions } from "./compat.js";
189
+ import type { Snapshot, SnapshotRecordArray } from "./compat/-private.js";
190
+ /**
191
+ An adapter is an object that receives requests from a store and
192
+ translates them into the appropriate action to take against your
193
+ persistence layer. The persistence layer is usually an HTTP API but
194
+ may be anything, such as the browser's local storage. Typically the
195
+ adapter is not invoked directly instead its functionality is accessed
196
+ through the `store`.
197
+
198
+ > ⚠️ CAUTION you likely want the docs for {@link MinimumAdapterInterface}
199
+ > as extending this abstract class is unnecessary.
200
+
201
+ ### Creating an Adapter
202
+
203
+ Create a new subclass of `Adapter` in the `app/adapters` folder:
204
+
205
+ ```js [app/adapters/application.js]
206
+ import { Adapter } from '@warp-drive/legacy/adapter';
207
+
208
+ export default class extends Adapter {
209
+ // ...your code here
210
+ }
211
+ ```
212
+
213
+ Model-specific adapters can be created by putting your adapter
214
+ class in an `app/adapters/` + `model-name` + `.js` file of the application.
215
+
216
+ ```js [app/adapters/post.js]
217
+ import { Adapter } from '@warp-drive/legacy/adapter';
218
+
219
+ export default class extends Adapter {
220
+ // ...Post-specific adapter code goes here
221
+ }
222
+ ```
223
+
224
+ `Adapter` is an abstract base class that you should override in your
225
+ application to customize it for your backend. The minimum set of methods
226
+ that you should implement is:
227
+
228
+ * `findRecord()`
229
+ * `createRecord()`
230
+ * `updateRecord()`
231
+ * `deleteRecord()`
232
+ * `findAll()`
233
+ * `query()`
234
+
235
+ To improve the network performance of your application, you can optimize
236
+ your adapter by overriding these lower-level methods:
237
+
238
+ * `findMany()`
239
+
240
+
241
+ For an example of the implementation, see `RESTAdapter`, the
242
+ included REST adapter.
243
+
244
+ @public
245
+ */
246
+ export declare class Adapter extends EmberObject implements MinimumAdapterInterface {
247
+ store: Store;
248
+ _coalesceFindRequests: boolean;
249
+ /**
250
+ The `findRecord()` method is invoked when the store is asked for a record that
251
+ has not previously been loaded. In response to `findRecord()` being called, you
252
+ should query your persistence layer for a record with the given ID. The `findRecord`
253
+ method should return a promise that will resolve to a JavaScript object that will be
254
+ normalized by the serializer.
255
+
256
+ Here is an example of the `findRecord` implementation:
257
+
258
+ ```js [app/adapters/application.js]
259
+ import { Adapter } from '@warp-drive/legacy/adapter';
260
+ import RSVP from 'RSVP';
261
+ import $ from 'jquery';
262
+
263
+ export default class ApplicationAdapter extends Adapter {
264
+ findRecord(store, type, id, snapshot) {
265
+ return new RSVP.Promise(function(resolve, reject) {
266
+ $.getJSON(`/${type.modelName}/${id}`).then(function(data) {
267
+ resolve(data);
268
+ }, function(jqXHR) {
269
+ reject(jqXHR);
270
+ });
271
+ });
272
+ }
273
+ }
274
+ ```
275
+
276
+ @public
277
+ */
278
+ findRecord(store: Store, type: ModelSchema, id: string, snapshot: Snapshot): Promise<AdapterPayload>;
279
+ /**
280
+ The `findAll()` method is used to retrieve all records for a given type.
281
+
282
+ Example
283
+
284
+ ```js [app/adapters/application.js]
285
+ import { Adapter } from '@warp-drive/legacy/adapter';
286
+ import RSVP from 'RSVP';
287
+ import $ from 'jquery';
288
+
289
+ export default class ApplicationAdapter extends Adapter {
290
+ findAll(store, type) {
291
+ return new RSVP.Promise(function(resolve, reject) {
292
+ $.getJSON(`/${type.modelName}`).then(function(data) {
293
+ resolve(data);
294
+ }, function(jqXHR) {
295
+ reject(jqXHR);
296
+ });
297
+ });
298
+ }
299
+ }
300
+ ```
301
+
302
+ @param neverSet a value is never provided to this argument
303
+ @public
304
+ */
305
+ findAll(store: Store, type: ModelSchema, neverSet: null, snapshotRecordArray: SnapshotRecordArray): Promise<AdapterPayload>;
306
+ /**
307
+ This method is called when you call `query` on the store.
308
+
309
+ Example
310
+
311
+ ```js [app/adapters/application.js]
312
+ import { Adapter } from '@warp-drive/legacy/adapter';
313
+ import RSVP from 'RSVP';
314
+ import $ from 'jquery';
315
+
316
+ export default class ApplicationAdapter extends Adapter {
317
+ query(store, type, query) {
318
+ return new RSVP.Promise(function(resolve, reject) {
319
+ $.getJSON(`/${type.modelName}`, query).then(function(data) {
320
+ resolve(data);
321
+ }, function(jqXHR) {
322
+ reject(jqXHR);
323
+ });
324
+ });
325
+ }
326
+ }
327
+ ```
328
+
329
+ @public
330
+ */
331
+ query(store: Store, type: ModelSchema, query: Record<string, unknown>): Promise<AdapterPayload>;
332
+ /**
333
+ The `queryRecord()` method is invoked when the store is asked for a single
334
+ record through a query object.
335
+
336
+ In response to `queryRecord()` being called, you should always fetch fresh
337
+ data. Once found, you can asynchronously call the store's `push()` method
338
+ to push the record into the store.
339
+
340
+ Here is an example `queryRecord` implementation:
341
+
342
+ Example
343
+
344
+ ```js [app/adapters/application.js]
345
+ import { Adapter, BuildURLMixin } from '@warp-drive/legacy/adapter';
346
+
347
+ export default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {
348
+ queryRecord(store, type, query) {
349
+ return fetch(`/${type.modelName}`, { body: JSON.stringify(query) })
350
+ .then((response) => response.json());
351
+ }
352
+ }
353
+ ```
354
+
355
+ @public
356
+ */
357
+ queryRecord(store: Store, type: ModelSchema, query: Record<string, unknown>, adapterOptions: object): Promise<AdapterPayload>;
358
+ /**
359
+ If the globally unique IDs for your records should be generated on the client,
360
+ implement the `generateIdForRecord()` method. This method will be invoked
361
+ each time you create a new record, and the value returned from it will be
362
+ assigned to the record's `primaryKey`.
363
+
364
+ Most traditional REST-like HTTP APIs will not use this method. Instead, the ID
365
+ of the record will be set by the server, and your adapter will update the store
366
+ with the new ID when it calls `didCreateRecord()`. Only implement this method if
367
+ you intend to generate record IDs on the client-side.
368
+
369
+ The `generateIdForRecord()` method will be invoked with the requesting store as
370
+ the first parameter and the newly created record as the second parameter:
371
+
372
+ ```javascript
373
+ import { Adapter } from '@warp-drive/legacy/adapter';
374
+ import { v4 } from 'uuid';
375
+
376
+ export default class ApplicationAdapter extends Adapter {
377
+ generateIdForRecord(store, type, inputProperties) {
378
+ return v4();
379
+ }
380
+ }
381
+ ```
382
+
383
+ @param {Store} store
384
+ @param {Model} type the Model class of the record
385
+ @param {Object} inputProperties a hash of properties to set on the
386
+ newly created record.
387
+ @return {(String|Number)} id
388
+ @public
389
+ */
390
+ /**
391
+ Proxies to the serializer's `serialize` method.
392
+
393
+ Example
394
+
395
+ ```js [app/adapters/application.js]
396
+ import { Adapter } from '@warp-drive/legacy/adapter';
397
+
398
+ export default class ApplicationAdapter extends Adapter {
399
+ createRecord(store, type, snapshot) {
400
+ let data = this.serialize(snapshot, { includeId: true });
401
+ let url = `/${type.modelName}`;
402
+
403
+ // ...
404
+ }
405
+ }
406
+ ```
407
+
408
+ @public
409
+ */
410
+ serialize(snapshot: Snapshot, options: SerializerOptions): Record<string, unknown>;
411
+ /**
412
+ Implement this method in a subclass to handle the creation of
413
+ new records.
414
+
415
+ Serializes the record and sends it to the server.
416
+
417
+ Example
418
+
419
+ ```js [app/adapters/application.js]
420
+ import { Adapter } from '@warp-drive/legacy/adapter';
421
+ import RSVP from 'RSVP';
422
+ import $ from 'jquery';
423
+
424
+ export default class ApplicationAdapter extends Adapter {
425
+ createRecord(store, type, snapshot) {
426
+ let data = this.serialize(snapshot, { includeId: true });
427
+
428
+ return new RSVP.Promise(function (resolve, reject) {
429
+ $.ajax({
430
+ type: 'POST',
431
+ url: `/${type.modelName}`,
432
+ dataType: 'json',
433
+ data: data
434
+ }).then(function (data) {
435
+ resolve(data);
436
+ }, function (jqXHR) {
437
+ jqXHR.then = null; // tame jQuery's ill mannered promises
438
+ reject(jqXHR);
439
+ });
440
+ });
441
+ }
442
+ }
443
+ ```
444
+
445
+ @public
446
+ */
447
+ createRecord(store: Store, type: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload>;
448
+ /**
449
+ Implement this method in a subclass to handle the updating of
450
+ a record.
451
+
452
+ Serializes the record update and sends it to the server.
453
+
454
+ The updateRecord method is expected to return a promise that will
455
+ resolve with the serialized record. This allows the backend to
456
+ inform the Ember Data store the current state of this record after
457
+ the update. If it is not possible to return a serialized record
458
+ the updateRecord promise can also resolve with `undefined` and the
459
+ Ember Data store will assume all of the updates were successfully
460
+ applied on the backend.
461
+
462
+ Example
463
+
464
+ ```js [app/adapters/application.js]
465
+ import { Adapter } from '@warp-drive/legacy/adapter';
466
+ import RSVP from 'RSVP';
467
+ import $ from 'jquery';
468
+
469
+ export default class ApplicationAdapter extends Adapter {
470
+ updateRecord(store, type, snapshot) {
471
+ let data = this.serialize(snapshot, { includeId: true });
472
+ let id = snapshot.id;
473
+
474
+ return new RSVP.Promise(function(resolve, reject) {
475
+ $.ajax({
476
+ type: 'PUT',
477
+ url: `/${type.modelName}/${id}`,
478
+ dataType: 'json',
479
+ data: data
480
+ }).then(function(data) {
481
+ resolve(data);
482
+ }, function(jqXHR) {
483
+ jqXHR.then = null; // tame jQuery's ill mannered promises
484
+ reject(jqXHR);
485
+ });
486
+ });
487
+ }
488
+ }
489
+ ```
490
+
491
+ @param {Store} store
492
+ @param {Model} type the Model class of the record
493
+ @param {Snapshot} snapshot
494
+ @return {Promise} promise
495
+ @public
496
+ */
497
+ updateRecord(store: Store, type: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload>;
498
+ /**
499
+ Implement this method in a subclass to handle the deletion of
500
+ a record.
501
+
502
+ Sends a delete request for the record to the server.
503
+
504
+ Example
505
+
506
+ ```js [app/adapters/application.js]
507
+ import { Adapter } from '@warp-drive/legacy/adapter';
508
+ import RSVP from 'RSVP';
509
+ import $ from 'jquery';
510
+
511
+ export default class ApplicationAdapter extends Adapter {
512
+ deleteRecord(store, type, snapshot) {
513
+ let data = this.serialize(snapshot, { includeId: true });
514
+ let id = snapshot.id;
515
+
516
+ return new RSVP.Promise(function(resolve, reject) {
517
+ $.ajax({
518
+ type: 'DELETE',
519
+ url: `/${type.modelName}/${id}`,
520
+ dataType: 'json',
521
+ data: data
522
+ }).then(function(data) {
523
+ resolve(data)
524
+ }, function(jqXHR) {
525
+ jqXHR.then = null; // tame jQuery's ill mannered promises
526
+ reject(jqXHR);
527
+ });
528
+ });
529
+ }
530
+ }
531
+ ```
532
+
533
+ @param {Store} store
534
+ @param {Model} type the Model class of the record
535
+ @param {Snapshot} snapshot
536
+ @return {Promise} promise
537
+ @public
538
+ */
539
+ deleteRecord(store: Store, type: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload>;
540
+ /**
541
+ By default the store will try to coalesce all `findRecord` calls within the same runloop
542
+ into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.
543
+ You can opt out of this behaviour by either not implementing the findMany hook or by setting
544
+ coalesceFindRequests to false.
545
+
546
+ @property coalesceFindRequests
547
+ @public
548
+ @type {Boolean}
549
+ */
550
+ get coalesceFindRequests(): boolean;
551
+ set coalesceFindRequests(value: boolean);
552
+ /**
553
+ The store will call `findMany` instead of multiple `findRecord`
554
+ requests to find multiple records at once if coalesceFindRequests
555
+ is true.
556
+
557
+ ```js [app/adapters/application.js]
558
+ import { Adapter } from '@warp-drive/legacy/adapter';
559
+ import RSVP from 'RSVP';
560
+ import $ from 'jquery';
561
+
562
+ export default class ApplicationAdapter extends Adapter {
563
+ findMany(store, type, ids, snapshots) {
564
+ return new RSVP.Promise(function(resolve, reject) {
565
+ $.ajax({
566
+ type: 'GET',
567
+ url: `/${type.modelName}/`,
568
+ dataType: 'json',
569
+ data: { filter: { id: ids.join(',') } }
570
+ }).then(function(data) {
571
+ resolve(data);
572
+ }, function(jqXHR) {
573
+ jqXHR.then = null; // tame jQuery's ill mannered promises
574
+ reject(jqXHR);
575
+ });
576
+ });
577
+ }
578
+ }
579
+ ```
580
+
581
+ @param {Store} store
582
+ @param {Model} type the Model class of the records
583
+ @param {Array} ids
584
+ @param {Array} snapshots
585
+ @return {Promise} promise
586
+ @public
587
+ */
588
+ /**
589
+ Organize records into groups, each of which is to be passed to separate
590
+ calls to `findMany`.
591
+
592
+ For example, if your API has nested URLs that depend on the parent, you will
593
+ want to group records by their parent.
594
+
595
+ The default implementation returns the records as a single group.
596
+
597
+ @public
598
+ @param {Store} store
599
+ @param {Array} snapshots
600
+ @return {Array} an array of arrays of records, each of which is to be
601
+ loaded separately by `findMany`.
602
+ */
603
+ groupRecordsForFindMany(store: Store, snapshots: Snapshot[]): Snapshot[][];
604
+ /**
605
+ This method is used by the store to determine if the store should
606
+ reload a record from the adapter when a record is requested by
607
+ `store.findRecord`.
608
+
609
+ If this method returns `true`, the store will re-fetch a record from
610
+ the adapter. If this method returns `false`, the store will resolve
611
+ immediately using the cached record.
612
+
613
+ For example, if you are building an events ticketing system, in which users
614
+ can only reserve tickets for 20 minutes at a time, and want to ensure that
615
+ in each route you have data that is no more than 20 minutes old you could
616
+ write:
617
+
618
+ ```javascript
619
+ shouldReloadRecord(store, ticketSnapshot) {
620
+ let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');
621
+ let timeDiff = moment().diff(lastAccessedAt, 'minutes');
622
+
623
+ if (timeDiff > 20) {
624
+ return true;
625
+ } else {
626
+ return false;
627
+ }
628
+ }
629
+ ```
630
+
631
+ This method would ensure that whenever you do `store.findRecord('ticket',
632
+ id)` you will always get a ticket that is no more than 20 minutes old. In
633
+ case the cached version is more than 20 minutes old, `findRecord` will not
634
+ resolve until you fetched the latest version.
635
+
636
+ By default this hook returns `false`, as most UIs should not block user
637
+ interactions while waiting on data update.
638
+
639
+ Note that, with default settings, `shouldBackgroundReloadRecord` will always
640
+ re-fetch the records in the background even if `shouldReloadRecord` returns
641
+ `false`. You can override `shouldBackgroundReloadRecord` if this does not
642
+ suit your use case.
643
+
644
+ @since 1.13.0
645
+ @param {Store} store
646
+ @param {Snapshot} snapshot
647
+ @return {Boolean}
648
+ @public
649
+ */
650
+ shouldReloadRecord(store: Store, snapshot: Snapshot): boolean;
651
+ /**
652
+ This method is used by the store to determine if the store should
653
+ reload all records from the adapter when records are requested by
654
+ `store.findAll`.
655
+
656
+ If this method returns `true`, the store will re-fetch all records from
657
+ the adapter. If this method returns `false`, the store will resolve
658
+ immediately using the cached records.
659
+
660
+ For example, if you are building an events ticketing system, in which users
661
+ can only reserve tickets for 20 minutes at a time, and want to ensure that
662
+ in each route you have data that is no more than 20 minutes old you could
663
+ write:
664
+
665
+ ```javascript
666
+ shouldReloadAll(store, snapshotArray) {
667
+ let snapshots = snapshotArray.snapshots();
668
+
669
+ return snapshots.any((ticketSnapshot) => {
670
+ let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');
671
+ let timeDiff = moment().diff(lastAccessedAt, 'minutes');
672
+
673
+ if (timeDiff > 20) {
674
+ return true;
675
+ } else {
676
+ return false;
677
+ }
678
+ });
679
+ }
680
+ ```
681
+
682
+ This method would ensure that whenever you do `store.findAll('ticket')` you
683
+ will always get a list of tickets that are no more than 20 minutes old. In
684
+ case a cached version is more than 20 minutes old, `findAll` will not
685
+ resolve until you fetched the latest versions.
686
+
687
+ By default, this method returns `true` if the passed `snapshotRecordArray`
688
+ is empty (meaning that there are no records locally available yet),
689
+ otherwise, it returns `false`.
690
+
691
+ Note that, with default settings, `shouldBackgroundReloadAll` will always
692
+ re-fetch all the records in the background even if `shouldReloadAll` returns
693
+ `false`. You can override `shouldBackgroundReloadAll` if this does not suit
694
+ your use case.
695
+
696
+ @since 1.13.0
697
+ @param {Store} store
698
+ @param {SnapshotRecordArray} snapshotRecordArray
699
+ @return {Boolean}
700
+ @public
701
+ */
702
+ shouldReloadAll(store: Store, snapshotRecordArray: SnapshotRecordArray): boolean;
703
+ /**
704
+ This method is used by the store to determine if the store should
705
+ reload a record after the `store.findRecord` method resolves a
706
+ cached record.
707
+
708
+ This method is *only* checked by the store when the store is
709
+ returning a cached record.
710
+
711
+ If this method returns `true` the store will re-fetch a record from
712
+ the adapter.
713
+
714
+ For example, if you do not want to fetch complex data over a mobile
715
+ connection, or if the network is down, you can implement
716
+ `shouldBackgroundReloadRecord` as follows:
717
+
718
+ ```javascript
719
+ shouldBackgroundReloadRecord(store, snapshot) {
720
+ let { downlink, effectiveType } = navigator.connection;
721
+
722
+ return downlink > 0 && effectiveType === '4g';
723
+ }
724
+ ```
725
+
726
+ By default, this hook returns `true` so the data for the record is updated
727
+ in the background.
728
+
729
+ @since 1.13.0
730
+ @param {Store} store
731
+ @param {Snapshot} snapshot
732
+ @return {Boolean}
733
+ @public
734
+ */
735
+ shouldBackgroundReloadRecord(store: Store, snapshot: Snapshot): boolean;
736
+ /**
737
+ This method is used by the store to determine if the store should
738
+ reload a record array after the `store.findAll` method resolves
739
+ with a cached record array.
740
+
741
+ This method is *only* checked by the store when the store is
742
+ returning a cached record array.
743
+
744
+ If this method returns `true` the store will re-fetch all records
745
+ from the adapter.
746
+
747
+ For example, if you do not want to fetch complex data over a mobile
748
+ connection, or if the network is down, you can implement
749
+ `shouldBackgroundReloadAll` as follows:
750
+
751
+ ```javascript
752
+ shouldBackgroundReloadAll(store, snapshotArray) {
753
+ let { downlink, effectiveType } = navigator.connection;
754
+
755
+ return downlink > 0 && effectiveType === '4g';
756
+ }
757
+ ```
758
+
759
+ By default this method returns `true`, indicating that a background reload
760
+ should always be triggered.
761
+
762
+ @since 1.13.0
763
+ @param {Store} store
764
+ @param {SnapshotRecordArray} snapshotRecordArray
765
+ @return {Boolean}
766
+ @public
767
+ */
768
+ shouldBackgroundReloadAll(store: Store, snapshotRecordArray: SnapshotRecordArray): boolean;
769
+ }
770
+ export { BuildURLMixin } from "./adapter/-private/build-url-mixin.js";