@warp-drive/legacy 5.6.0-alpha.11

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 (211) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE.md +23 -0
  3. package/README.md +54 -0
  4. package/addon-main.cjs +5 -0
  5. package/declarations/adapter/-private/build-url-mixin.d.ts +34 -0
  6. package/declarations/adapter/-private/build-url-mixin.d.ts.map +1 -0
  7. package/declarations/adapter/-private/fastboot-interface.d.ts +9 -0
  8. package/declarations/adapter/-private/fastboot-interface.d.ts.map +1 -0
  9. package/declarations/adapter/-private/utils/continue-on-reject.d.ts +8 -0
  10. package/declarations/adapter/-private/utils/continue-on-reject.d.ts.map +1 -0
  11. package/declarations/adapter/-private/utils/determine-body-promise.d.ts +5 -0
  12. package/declarations/adapter/-private/utils/determine-body-promise.d.ts.map +1 -0
  13. package/declarations/adapter/-private/utils/fetch.d.ts +9 -0
  14. package/declarations/adapter/-private/utils/fetch.d.ts.map +1 -0
  15. package/declarations/adapter/-private/utils/parse-response-headers.d.ts +2 -0
  16. package/declarations/adapter/-private/utils/parse-response-headers.d.ts.map +1 -0
  17. package/declarations/adapter/-private/utils/serialize-into-hash.d.ts +7 -0
  18. package/declarations/adapter/-private/utils/serialize-into-hash.d.ts.map +1 -0
  19. package/declarations/adapter/-private/utils/serialize-query-params.d.ts +6 -0
  20. package/declarations/adapter/-private/utils/serialize-query-params.d.ts.map +1 -0
  21. package/declarations/adapter/-private.d.ts +6 -0
  22. package/declarations/adapter/-private.d.ts.map +1 -0
  23. package/declarations/adapter/error.d.ts +188 -0
  24. package/declarations/adapter/error.d.ts.map +1 -0
  25. package/declarations/adapter/json-api.d.ts +234 -0
  26. package/declarations/adapter/json-api.d.ts.map +1 -0
  27. package/declarations/adapter/rest.d.ts +823 -0
  28. package/declarations/adapter/rest.d.ts.map +1 -0
  29. package/declarations/adapter.d.ts +801 -0
  30. package/declarations/adapter.d.ts.map +1 -0
  31. package/declarations/compat/-private.d.ts +14 -0
  32. package/declarations/compat/-private.d.ts.map +1 -0
  33. package/declarations/compat/builders/find-all.d.ts +33 -0
  34. package/declarations/compat/builders/find-all.d.ts.map +1 -0
  35. package/declarations/compat/builders/find-record.d.ts +54 -0
  36. package/declarations/compat/builders/find-record.d.ts.map +1 -0
  37. package/declarations/compat/builders/query.d.ts +61 -0
  38. package/declarations/compat/builders/query.d.ts.map +1 -0
  39. package/declarations/compat/builders/save-record.d.ts +32 -0
  40. package/declarations/compat/builders/save-record.d.ts.map +1 -0
  41. package/declarations/compat/builders/utils.d.ts +4 -0
  42. package/declarations/compat/builders/utils.d.ts.map +1 -0
  43. package/declarations/compat/builders.d.ts +15 -0
  44. package/declarations/compat/builders.d.ts.map +1 -0
  45. package/declarations/compat/legacy-network-handler/fetch-manager.d.ts +47 -0
  46. package/declarations/compat/legacy-network-handler/fetch-manager.d.ts.map +1 -0
  47. package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +3 -0
  48. package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts.map +1 -0
  49. package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +12 -0
  50. package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts.map +1 -0
  51. package/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +6 -0
  52. package/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts.map +1 -0
  53. package/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +3 -0
  54. package/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts.map +1 -0
  55. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +527 -0
  56. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts.map +1 -0
  57. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +224 -0
  58. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts.map +1 -0
  59. package/declarations/compat/legacy-network-handler/serializer-response.d.ts +7 -0
  60. package/declarations/compat/legacy-network-handler/serializer-response.d.ts.map +1 -0
  61. package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +89 -0
  62. package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts.map +1 -0
  63. package/declarations/compat/legacy-network-handler/snapshot.d.ts +237 -0
  64. package/declarations/compat/legacy-network-handler/snapshot.d.ts.map +1 -0
  65. package/declarations/compat/utils.d.ts +138 -0
  66. package/declarations/compat/utils.d.ts.map +1 -0
  67. package/declarations/compat.d.ts +134 -0
  68. package/declarations/compat.d.ts.map +1 -0
  69. package/declarations/model/-private/attr.d.ts +165 -0
  70. package/declarations/model/-private/attr.d.ts.map +1 -0
  71. package/declarations/model/-private/attr.type-test.d.ts +2 -0
  72. package/declarations/model/-private/attr.type-test.d.ts.map +1 -0
  73. package/declarations/model/-private/belongs-to.d.ts +173 -0
  74. package/declarations/model/-private/belongs-to.d.ts.map +1 -0
  75. package/declarations/model/-private/belongs-to.type-test.d.ts +2 -0
  76. package/declarations/model/-private/belongs-to.type-test.d.ts.map +1 -0
  77. package/declarations/model/-private/debug/assert-polymorphic-type.d.ts +6 -0
  78. package/declarations/model/-private/debug/assert-polymorphic-type.d.ts.map +1 -0
  79. package/declarations/model/-private/errors.d.ts +290 -0
  80. package/declarations/model/-private/errors.d.ts.map +1 -0
  81. package/declarations/model/-private/has-many.d.ts +164 -0
  82. package/declarations/model/-private/has-many.d.ts.map +1 -0
  83. package/declarations/model/-private/has-many.type-test.d.ts +2 -0
  84. package/declarations/model/-private/has-many.type-test.d.ts.map +1 -0
  85. package/declarations/model/-private/hooks.d.ts +11 -0
  86. package/declarations/model/-private/hooks.d.ts.map +1 -0
  87. package/declarations/model/-private/legacy-relationships-support.d.ts +57 -0
  88. package/declarations/model/-private/legacy-relationships-support.d.ts.map +1 -0
  89. package/declarations/model/-private/model-for-mixin.d.ts +4 -0
  90. package/declarations/model/-private/model-for-mixin.d.ts.map +1 -0
  91. package/declarations/model/-private/model-methods.d.ts +35 -0
  92. package/declarations/model/-private/model-methods.d.ts.map +1 -0
  93. package/declarations/model/-private/model.d.ts +1270 -0
  94. package/declarations/model/-private/model.d.ts.map +1 -0
  95. package/declarations/model/-private/model.type-test.d.ts +2 -0
  96. package/declarations/model/-private/model.type-test.d.ts.map +1 -0
  97. package/declarations/model/-private/notify-changes.d.ts +5 -0
  98. package/declarations/model/-private/notify-changes.d.ts.map +1 -0
  99. package/declarations/model/-private/promise-belongs-to.d.ts +40 -0
  100. package/declarations/model/-private/promise-belongs-to.d.ts.map +1 -0
  101. package/declarations/model/-private/promise-many-array.d.ts +126 -0
  102. package/declarations/model/-private/promise-many-array.d.ts.map +1 -0
  103. package/declarations/model/-private/promise-proxy-base.d.ts +3 -0
  104. package/declarations/model/-private/promise-proxy-base.d.ts.map +1 -0
  105. package/declarations/model/-private/record-state.d.ts +78 -0
  106. package/declarations/model/-private/record-state.d.ts.map +1 -0
  107. package/declarations/model/-private/references/belongs-to.d.ts +495 -0
  108. package/declarations/model/-private/references/belongs-to.d.ts.map +1 -0
  109. package/declarations/model/-private/references/has-many.d.ts +504 -0
  110. package/declarations/model/-private/references/has-many.d.ts.map +1 -0
  111. package/declarations/model/-private/schema-provider.d.ts +63 -0
  112. package/declarations/model/-private/schema-provider.d.ts.map +1 -0
  113. package/declarations/model/-private/type-utils.d.ts +57 -0
  114. package/declarations/model/-private/type-utils.d.ts.map +1 -0
  115. package/declarations/model/-private/util.d.ts +6 -0
  116. package/declarations/model/-private/util.d.ts.map +1 -0
  117. package/declarations/model/-private.d.ts +8 -0
  118. package/declarations/model/-private.d.ts.map +1 -0
  119. package/declarations/model/migration-support.d.ts +287 -0
  120. package/declarations/model/migration-support.d.ts.map +1 -0
  121. package/declarations/model/migration-support.type-test.d.ts +2 -0
  122. package/declarations/model/migration-support.type-test.d.ts.map +1 -0
  123. package/declarations/model.d.ts +50 -0
  124. package/declarations/model.d.ts.map +1 -0
  125. package/declarations/serializer/-private/embedded-records-mixin.d.ts +97 -0
  126. package/declarations/serializer/-private/embedded-records-mixin.d.ts.map +1 -0
  127. package/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
  128. package/declarations/serializer/-private/transforms/boolean.d.ts.map +1 -0
  129. package/declarations/serializer/-private/transforms/boolean.type-test.d.ts +2 -0
  130. package/declarations/serializer/-private/transforms/boolean.type-test.d.ts.map +1 -0
  131. package/declarations/serializer/-private/transforms/date.d.ts +28 -0
  132. package/declarations/serializer/-private/transforms/date.d.ts.map +1 -0
  133. package/declarations/serializer/-private/transforms/number.d.ts +29 -0
  134. package/declarations/serializer/-private/transforms/number.d.ts.map +1 -0
  135. package/declarations/serializer/-private/transforms/string.d.ts +29 -0
  136. package/declarations/serializer/-private/transforms/string.d.ts.map +1 -0
  137. package/declarations/serializer/-private/transforms/transform.d.ts +119 -0
  138. package/declarations/serializer/-private/transforms/transform.d.ts.map +1 -0
  139. package/declarations/serializer/-private/utils.d.ts +4 -0
  140. package/declarations/serializer/-private/utils.d.ts.map +1 -0
  141. package/declarations/serializer/json-api.d.ts +496 -0
  142. package/declarations/serializer/json-api.d.ts.map +1 -0
  143. package/declarations/serializer/json.d.ts +1047 -0
  144. package/declarations/serializer/json.d.ts.map +1 -0
  145. package/declarations/serializer/rest.d.ts +554 -0
  146. package/declarations/serializer/rest.d.ts.map +1 -0
  147. package/declarations/serializer/transform.d.ts +6 -0
  148. package/declarations/serializer/transform.d.ts.map +1 -0
  149. package/declarations/serializer.d.ts +258 -0
  150. package/declarations/serializer.d.ts.map +1 -0
  151. package/dist/-private-DFfBszo5.js +1182 -0
  152. package/dist/-private-DFfBszo5.js.map +1 -0
  153. package/dist/adapter/-private.js +1 -0
  154. package/dist/adapter/-private.js.map +1 -0
  155. package/dist/adapter/error.js +254 -0
  156. package/dist/adapter/error.js.map +1 -0
  157. package/dist/adapter/json-api.js +129 -0
  158. package/dist/adapter/json-api.js.map +1 -0
  159. package/dist/adapter/rest.js +1262 -0
  160. package/dist/adapter/rest.js.map +1 -0
  161. package/dist/adapter.js +1284 -0
  162. package/dist/adapter.js.map +1 -0
  163. package/dist/compat/-private.js +1 -0
  164. package/dist/compat/-private.js.map +1 -0
  165. package/dist/compat/builders.js +292 -0
  166. package/dist/compat/builders.js.map +1 -0
  167. package/dist/compat/utils.js +225 -0
  168. package/dist/compat/utils.js.map +1 -0
  169. package/dist/compat.js +999 -0
  170. package/dist/compat.js.map +1 -0
  171. package/dist/errors-D74uk36r.js +2541 -0
  172. package/dist/errors-D74uk36r.js.map +1 -0
  173. package/dist/json-BCH3fil7.js +1349 -0
  174. package/dist/json-BCH3fil7.js.map +1 -0
  175. package/dist/model/-private.js +2 -0
  176. package/dist/model/-private.js.map +1 -0
  177. package/dist/model/migration-support.js +453 -0
  178. package/dist/model/migration-support.js.map +1 -0
  179. package/dist/model.js +736 -0
  180. package/dist/model.js.map +1 -0
  181. package/dist/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  182. package/dist/runtime-BPCpkOf1-BKOwiRJp.js.map +1 -0
  183. package/dist/schema-provider-CXFLTMjg.js +2228 -0
  184. package/dist/schema-provider-CXFLTMjg.js.map +1 -0
  185. package/dist/serialize-into-hash-BxfqWC8u.js +260 -0
  186. package/dist/serialize-into-hash-BxfqWC8u.js.map +1 -0
  187. package/dist/serializer/json-api.js +514 -0
  188. package/dist/serializer/json-api.js.map +1 -0
  189. package/dist/serializer/json.js +6 -0
  190. package/dist/serializer/json.js.map +1 -0
  191. package/dist/serializer/rest.js +1245 -0
  192. package/dist/serializer/rest.js.map +1 -0
  193. package/dist/serializer/transform.js +313 -0
  194. package/dist/serializer/transform.js.map +1 -0
  195. package/dist/serializer.js +252 -0
  196. package/dist/serializer.js.map +1 -0
  197. package/logos/NCC-1701-a-blue.svg +4 -0
  198. package/logos/NCC-1701-a-gold.svg +4 -0
  199. package/logos/NCC-1701-a-gold_100.svg +1 -0
  200. package/logos/NCC-1701-a-gold_base-64.txt +1 -0
  201. package/logos/NCC-1701-a.svg +4 -0
  202. package/logos/README.md +4 -0
  203. package/logos/docs-badge.svg +2 -0
  204. package/logos/ember-data-logo-dark.svg +12 -0
  205. package/logos/ember-data-logo-light.svg +12 -0
  206. package/logos/github-header.svg +444 -0
  207. package/logos/social1.png +0 -0
  208. package/logos/social2.png +0 -0
  209. package/logos/warp-drive-logo-dark.svg +4 -0
  210. package/logos/warp-drive-logo-gold.svg +4 -0
  211. package/package.json +72 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sources":["../src/adapter/-private/build-url-mixin.ts","../src/adapter.ts"],"sourcesContent":["import Mixin from '@ember/object/mixin';\n\nimport { camelize, pluralize } from '@warp-drive/utilities/string';\n\nimport type { Snapshot, SnapshotRecordArray } from '../../compat/-private.ts';\n\n/*\n The structure of this file is such because typing Mixins is hard. Here we've structured it in\n such a way as to maximize the type information that a consumer can utilize. There are simpler\n ways to type a mixin but we would not be able to provide the nice overload signature for buildURL\n*/\n// the interface must fully declare the function signatures that the individual functions\n// will also declare. If instead we try to keep them in sync by doing something like\n// `interface BuildURLMixin { buildURL: typeof buildURL }`\n// then an extending class overwriting one of the methods will break because typescript\n// thinks it is a switch from an instance prop (that is a method) to an instance method.\nexport interface BuildURLMixin {\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'findRecord'\n ): string;\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: null,\n snapshot: SnapshotRecordArray,\n requestType: 'findAll'\n ): string;\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: null,\n snapshot: null,\n requestType: 'query',\n query: Record<string, unknown>\n ): string;\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: null,\n snapshot: null,\n requestType: 'queryRecord',\n query: Record<string, unknown>\n ): string;\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string[],\n snapshot: Snapshot[],\n requestType: 'findMany'\n ): string;\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'findHasMany'\n ): string;\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'findBelongsTo'\n ): string;\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string | null,\n snapshot: Snapshot,\n requestType: 'createRecord'\n ): string;\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'updateRecord'\n ): string;\n buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'deleteRecord'\n ): string;\n buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot): string;\n _buildURL(this: MixtBuildURLMixin, modelName: string | null | undefined, id?: string | null): string;\n urlForFindRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;\n urlForFindAll(this: MixtBuildURLMixin, modelName: string, snapshots: SnapshotRecordArray): string;\n urlForQueryRecord(this: MixtBuildURLMixin, query: Record<string, unknown>, modelName: string): string;\n urlForQuery(this: MixtBuildURLMixin, query: Record<string, unknown>, modelName: string): string;\n urlForFindMany(this: MixtBuildURLMixin, ids: string[], modelName: string, snapshots: Snapshot[]): string;\n urlForFindHasMany(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;\n urlForFindBelongsTo(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;\n urlForCreateRecord(this: MixtBuildURLMixin, modelName: string, snapshot: Snapshot): string;\n urlForUpdateRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;\n urlForDeleteRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;\n urlPrefix(this: MixtBuildURLMixin, path?: string | null, parentURL?: string): string;\n pathForType(this: MixtBuildURLMixin, modelName: string): string;\n}\n\n// prevents the final constructed object from needing to add\n// host and namespace which are provided by the final consuming\n// class to the prototype which can result in overwrite errors\nexport interface MixtBuildURLMixin extends BuildURLMixin {\n host: string | null;\n namespace: string | null;\n}\n\n/**\n ## Using BuildURLMixin\n\n To use URL building, include the mixin when extending an adapter, and call `buildURL` where needed.\n The default behaviour is designed for RESTAdapter.\n\n ### Example\n\n ```javascript\n import Adapter, { BuildURLMixin } from '@ember-data/adapter';\n\n export default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n findRecord(store, type, id, snapshot) {\n var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');\n return this.ajax(url, 'GET');\n }\n }\n ```\n\n ### Attributes\n\n The `host` and `namespace` attributes will be used if defined, and are optional.\n\n @class BuildURLMixin\n @public\n*/\n/**\n Builds a URL for a given type and optional ID.\n\n By default, it pluralizes the type's name (for example, 'post'\n becomes 'posts' and 'person' becomes 'people'). To override the\n pluralization see [pathForType](./pathForType?anchor=pathForType).\n\n If an ID is specified, it adds the ID to the path generated\n for the type, separated by a `/`.\n\n When called by `RESTAdapter.findMany()` the `id` and `snapshot` parameters\n will be arrays of ids and snapshots.\n\n @public\n @param {String} modelName\n @param {(String|Array|Object)} id single id or array of ids or query\n @param {(Snapshot|SnapshotRecordArray)} snapshot single snapshot or array of snapshots\n @param {String} requestType\n @param {Object} query object of query parameters to send for query requests.\n @return {String} url\n */\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'findRecord'\n): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: null,\n snapshot: SnapshotRecordArray,\n requestType: 'findAll'\n): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: null,\n snapshot: null,\n requestType: 'query',\n query: Record<string, unknown>\n): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: null,\n snapshot: null,\n requestType: 'queryRecord',\n query: Record<string, unknown>\n): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string[],\n snapshot: Snapshot[],\n requestType: 'findMany'\n): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'findHasMany'\n): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'findBelongsTo'\n): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string | null,\n snapshot: Snapshot,\n requestType: 'createRecord'\n): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'updateRecord'\n): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string,\n snapshot: Snapshot,\n requestType: 'deleteRecord'\n): string;\nfunction buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot): string;\nfunction buildURL(\n this: MixtBuildURLMixin,\n modelName: string,\n id: string | string[] | Record<string, unknown> | null,\n snapshot: Snapshot | Snapshot[] | SnapshotRecordArray | null,\n requestType?:\n | 'findRecord'\n | 'findAll'\n | 'query'\n | 'queryRecord'\n | 'findMany'\n | 'findHasMany'\n | 'findBelongsTo'\n | 'createRecord'\n | 'updateRecord'\n | 'deleteRecord',\n query?: Record<string, unknown>\n): string {\n /*\n Switch statements in typescript don't currently narrow even when the function is implemented\n with overloads.\n\n We still extract this to stand alone so that we can provide nice overloads for calling signatures,\n but we will still require all of this casting (or a ridiculous number of assertsthat narrow it down\n for us).\n */\n switch (requestType) {\n case 'findRecord':\n return this.urlForFindRecord(id as string, modelName, snapshot as Snapshot);\n case 'findAll':\n return this.urlForFindAll(modelName, snapshot as SnapshotRecordArray);\n case 'query':\n return this.urlForQuery(query || {}, modelName);\n case 'queryRecord':\n return this.urlForQueryRecord(query || {}, modelName);\n case 'findMany':\n return this.urlForFindMany(id as string[], modelName, snapshot as Snapshot[]);\n case 'findHasMany':\n return this.urlForFindHasMany(id as string, modelName, snapshot as Snapshot);\n case 'findBelongsTo':\n return this.urlForFindBelongsTo(id as string, modelName, snapshot as Snapshot);\n case 'createRecord':\n return this.urlForCreateRecord(modelName, snapshot as Snapshot);\n case 'updateRecord':\n return this.urlForUpdateRecord(id as string, modelName, snapshot as Snapshot);\n case 'deleteRecord':\n return this.urlForDeleteRecord(id as string, modelName, snapshot as Snapshot);\n default:\n // this is the 'never' case but someone may call `buildURL` manually so\n // we try to do something for them.\n return this._buildURL(modelName, id as string | null);\n }\n}\n\n/**\n @private\n @param {String} modelName\n @param {String} id\n @return {String} url\n */\nfunction _buildURL(this: MixtBuildURLMixin, modelName: string | null | undefined, id?: string | null): string {\n let path: string;\n const url: string[] = [];\n const { host } = this;\n const prefix = this.urlPrefix();\n\n if (modelName) {\n path = this.pathForType(modelName);\n if (path) {\n url.push(path);\n }\n }\n\n if (id) {\n url.push(encodeURIComponent(id));\n }\n if (prefix) {\n url.unshift(prefix);\n }\n\n let urlString = url.join('/');\n if (!host && urlString && urlString.charAt(0) !== '/') {\n urlString = '/' + urlString;\n }\n\n return urlString;\n}\n\n/**\n Builds a URL for a `store.findRecord(type, id)` call.\n\n Example:\n\n ```js [app/adapters/user.js]\n import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindRecord(id, modelName, snapshot) {\n let baseUrl = this.buildURL(modelName, id, snapshot);\n return `${baseUrl}/users/${snapshot.adapterOptions.user_id}/playlists/${id}`;\n }\n }\n ```\n\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n\n */\nfunction urlForFindRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string {\n return this._buildURL(modelName, id);\n}\n\n/**\n Builds a URL for a `store.findAll(type)` call.\n\n Example:\n\n ```js [app/adapters/comment.js]\n import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindAll(modelName, snapshot) {\n let baseUrl = this.buildURL(modelName);\n return `${baseUrl}/data/comments.json`;\n }\n }\n ```\n\n @public\n @param {String} modelName\n @param {SnapshotRecordArray} snapshot\n @return {String} url\n */\nfunction urlForFindAll(this: MixtBuildURLMixin, modelName: string, snapshots: SnapshotRecordArray): string {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for a `store.query(type, query)` call.\n\n Example:\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.github.com';\n urlForQuery (query, modelName) {\n switch(modelName) {\n case 'repo':\n return `https://api.github.com/orgs/${query.orgId}/repos`;\n default:\n return super.urlForQuery(...arguments);\n }\n }\n }\n ```\n\n @public\n @param {Object} query\n @param {String} modelName\n @return {String} url\n */\nfunction urlForQuery(this: MixtBuildURLMixin, query: Record<string, unknown>, modelName: string): string {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for a `store.queryRecord(type, query)` call.\n\n Example:\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForQueryRecord({ slug }, modelName) {\n let baseUrl = this.buildURL();\n return `${baseUrl}/${encodeURIComponent(slug)}`;\n }\n }\n ```\n\n @public\n @param {Object} query\n @param {String} modelName\n @return {String} url\n */\nfunction urlForQueryRecord(this: MixtBuildURLMixin, query: Record<string, unknown>, modelName: string): string {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for coalescing multiple `store.findRecord(type, id)`\n records into 1 request when the adapter's `coalesceFindRequests`\n property is `true`.\n\n Example:\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForFindMany(ids, modelName) {\n let baseUrl = this.buildURL();\n return `${baseUrl}/coalesce`;\n }\n }\n ```\n\n @public\n @param {Array} ids\n @param {String} modelName\n @param {Array} snapshots\n @return {String} url\n */\nfunction urlForFindMany(this: MixtBuildURLMixin, ids: string[], modelName: string, snapshots: Snapshot[]): string {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for fetching an async `hasMany` relationship when a URL\n is not provided by the server.\n\n Example:\n\n ```js [app/adapters/application.js]\n import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindHasMany(id, modelName, snapshot) {\n let baseUrl = this.buildURL(modelName, id);\n return `${baseUrl}/relationships`;\n }\n }\n ```\n\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForFindHasMany(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string {\n return this._buildURL(modelName, id);\n}\n\n/**\n Builds a URL for fetching an async `belongsTo` relationship when a url\n is not provided by the server.\n\n Example:\n\n ```js [app/adapters/application.js]\n import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindBelongsTo(id, modelName, snapshot) {\n let baseUrl = this.buildURL(modelName, id);\n return `${baseUrl}/relationships`;\n }\n }\n ```\n\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForFindBelongsTo(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string {\n return this._buildURL(modelName, id);\n}\n\n/**\n Builds a URL for a `record.save()` call when the record was created\n locally using `store.createRecord()`.\n\n Example:\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForCreateRecord(modelName, snapshot) {\n return super.urlForCreateRecord(...arguments) + '/new';\n }\n }\n ```\n\n @public\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForCreateRecord(this: MixtBuildURLMixin, modelName: string, snapshot: Snapshot): string {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for a `record.save()` call when the record has been updated locally.\n\n Example:\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForUpdateRecord(id, modelName, snapshot) {\n return `/${id}/feed?access_token=${snapshot.adapterOptions.token}`;\n }\n }\n ```\n\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForUpdateRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string {\n return this._buildURL(modelName, id);\n}\n\n/**\n Builds a URL for a `record.save()` call when the record has been deleted locally.\n\n Example:\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForDeleteRecord(id, modelName, snapshot) {\n return super.urlForDeleteRecord(...arguments) + '/destroy';\n }\n }\n ```\n\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForDeleteRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string {\n return this._buildURL(modelName, id);\n}\n\n/**\n @private\n @param {String} path\n @param {String} parentURL\n @return {String} urlPrefix\n */\nfunction urlPrefix(this: MixtBuildURLMixin, path?: string | null, parentURL?: string): string {\n const { namespace } = this;\n let { host } = this;\n\n if (!host || host === '/') {\n host = '';\n }\n\n if (path) {\n // Protocol relative url\n if (/^\\/\\//.test(path) || /http(s)?:\\/\\//.test(path)) {\n // Do nothing, the full host is already included.\n return path;\n\n // Absolute path\n } else if (path.charAt(0) === '/') {\n return `${host}${path}`;\n // Relative path\n } else {\n return `${parentURL}/${path}`;\n }\n }\n\n // No path provided\n const url: string[] = [];\n if (host) {\n url.push(host);\n }\n if (namespace) {\n url.push(namespace);\n }\n return url.join('/');\n}\n\n/**\n Determines the pathname for a given type.\n\n By default, it pluralizes the type's name (for example,\n 'post' becomes 'posts' and 'person' becomes 'people').\n\n ### Pathname customization\n\n For example, if you have an object `LineItem` with an\n endpoint of `/line_items/`.\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n import { undesrcore, pluralize } from '<app-name>/utils/string-utils';\n\n export default class ApplicationAdapter extends RESTAdapter {\n pathForType(modelName) {\n return pluralize(underscore(modelName));\n }\n }\n ```\n\n @public\n @param {String} modelName\n @return {String} path\n **/\nfunction pathForType(this: MixtBuildURLMixin, modelName: string): string {\n const camelized = camelize(modelName);\n return pluralize(camelized);\n}\n\n// we build it this way vs casting to BuildURLMixin so that any\n// changes to the interface surface as errors here.\nconst mixinProps: BuildURLMixin = {\n buildURL,\n _buildURL,\n urlForFindRecord,\n urlForFindAll,\n urlForQueryRecord,\n urlForQuery,\n urlForFindMany,\n urlForFindHasMany,\n urlForFindBelongsTo,\n urlForCreateRecord,\n urlForDeleteRecord,\n urlForUpdateRecord,\n urlPrefix,\n pathForType,\n};\n\nexport const BuildURLMixin = Mixin.create(mixinProps);\n","/**\n * ## Overview\n *\n * <blockquote style=\"margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;\">\n * <p>\n * ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.\n * If starting a new app or thinking of implementing a new adapter, consider writing a\n * <a href=\"/ember-data/release/classes/%3CInterface%3E%20Handler\">Handler</a> instead to be used with the <a href=\"https://github.com/emberjs/data/tree/main/packages/request#readme\">RequestManager</a>\n * </p>\n * </blockquote>\n *\n * In order to properly fetch and update data, @warp-drive/legacy\n * needs to understand how to connect to your API.\n *\n * `Adapters` accept various kinds of requests from the store\n * and manage fulfillment of the request from your API.\n *\n * ### Request Flow\n *\n * When the store decides it needs to issue a request it uses the following flow to manage the request and process the data.\n *\n * - find the appropriate adapter\n * - issue the request to the adapter\n * - await the adapter's response\n * - if an error occurs reject with the error\n * - if no error\n * - if there is response data\n * - pass the response data to the appropriate serializer\n * - update the cache using the JSON:API formatted data from the serializer's response\n * - return the primary record(s) associated with the request\n *\n * ### Request Errors\n *\n * When a request errors and your adapter does not have the ability to recover from the error,\n * you may either reject the promise returned by your adapter method with the error or simply\n * throw the error.\n *\n * If the request was for a `createRecord` `updateRecord` or `deleteRecord` special rules\n * apply to how this error will affect the state of the store and additional properties on\n * the `Error` class may be used. See the documentation for these methods in\n * {@link MinimumAdapterInterface} for more information.\n *\n * ### Implementing an Adapter\n *\n * There are seven required adapter methods, one for each of\n * the primary request types that @warp-drive/legacy issues.\n *\n * They are:\n *\n * - findRecord\n * - findAll\n * - queryRecord\n * - query\n * - createRecord\n * - updateRecord\n * - deleteRecord\n *\n * Each of these request types has a matching store method that triggers it\n * and matching `requestType` that is passed to the serializer's\n * `normalizeResponse` method.\n *\n * If your app only reads data but never writes data, it is not necessary\n * to implement the methods for create, update, and delete. This extends to\n * all of the store's find methods with the exception of `findRecord` (`findAll`,\n * `query`, `queryRecord`): if you do not use the store method in your app then\n * your Adapter does not need the method.\n *\n * ```ts\n * async function fetchData(url, options = {}) {\n * let response = await fetch(url, options);\n * return response.toJSON();\n * }\n *\n * export default class ApplicationAdapter {\n * findRecord(_, { modelName }, id) {\n * return fetchData(`./${modelName}s/${id}`);\n * }\n *\n * static create() {\n * return new this();\n * }\n * }\n * ```\n *\n * ### Adapter Resolution\n *\n * `store.adapterFor(name)` will lookup adapters defined in `app/adapters/` and\n * return an instance.\n *\n * `adapterFor` first attempts to find an adapter with an exact match on `name`,\n then falls back to checking for the presence of an adapter named `application`.\n\n If no adapter is found, an error will be thrown.\n\n ```ts\n store.adapterFor('author');\n\n // lookup paths (in order) =>\n // app/adapters/author.js\n // app/adapters/application.js\n ```\n\n Most requests in @warp-drive/legacy are made with respect to a particular `type` (or `modelName`)\n (e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\n refer to this as the **primary** resource `type`.\n\n `adapterFor` is used by the store to find an adapter with a name matching that of the primary\n resource `type` for the request, which then falls back to the `application` adapter.\n\n It is recommended that applications define only a single `application` adapter and serializer\n where possible, only implementing an adapter specific to the `type` when absolutely necessary.\n\n If you need to support multiple API versions for the same type, the per-type strategy for\n defining adapters might not be adequate.\n\n If you have multiple APIs or multiple API versions and the single application adapter and per-type\n strategy does not suite your needs, one strategy is to write an `application` adapter and serializer\n that make use of `options` to specify the desired format when making a request, then forwards to the\n request to the desired adapter or serializer as needed.\n\n ```js [app/adapters/application.js]\n export default class Adapter extends EmberObject {\n findRecord(store, schema, id, snapshot) {\n let { apiVersion } = snapshot.adapterOptions;\n return this.adapterFor(`-api-${apiVersion}`).findRecord(store, schema, id, snapshot);\n }\n }\n ```\n\n ### Overriding `Store.adapterFor`\n\n ```js\n import Store from '@ember-data/store';\n import Adapter from '@ember-data/adapter/json-api';\n\n class extends Store {\n #adapter = new Adapter();\n\n adapterFor() {\n return this.#adapter;\n }\n }\n ```\n\n\nNote: 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.\n\n ```js\n import Store from '@ember-data/store';\n import Adapter from '@ember-data/adapter/json-api';\n import { getOwner, setOwner } from '@ember/owner';\n\n class extends Store {\n #adapter = null;\n\n adapterFor() {\n let adapter = this.#adapter;\n if (!adapter) {\n const owner = getOwner(this);\n adapter = new Adapter();\n setOwner(adapter, owner);\n this.#adapter = adapter;\n }\n\n return adapter;\n }\n }\n ```\n\nBy 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}`\n\n ### Using an Adapter\n\n Any adapter in `app/adapters/` can be looked up by `name` using `store.adapterFor(name)`.\n\n ### Default Adapters\n\n Applications whose API's structure endpoint URLs *very close to* or *exactly* the **REST**\n or **JSON:API** convention, the `@ember-data/adapter` package contains implementations\n these applications can extend.\n\n Many applications will find writing their own adapter to be allow greater flexibility,\n customization, and maintenance than attempting to override methods in these adapters.\n\n @module\n*/\n\nimport EmberObject from '@ember/object';\nimport * as s from '@ember/service';\n\nimport type { Store } from '@warp-drive/core';\nimport { DEBUG } from '@warp-drive/core/build-config/env';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { ModelSchema } from '@warp-drive/core/types';\n\nimport type { AdapterPayload, MinimumAdapterInterface, SerializerOptions } from './compat.ts';\nimport type { Snapshot, SnapshotRecordArray } from './compat/-private.ts';\n\nconst service = s.service ?? s.inject;\n/**\n An adapter is an object that receives requests from a store and\n translates them into the appropriate action to take against your\n persistence layer. The persistence layer is usually an HTTP API but\n may be anything, such as the browser's local storage. Typically the\n adapter is not invoked directly instead its functionality is accessed\n through the `store`.\n\n > ⚠️ CAUTION you likely want the docs for {@link MinimumAdapterInterface}\n > as extending this abstract class is unnecessary.\n\n ### Creating an Adapter\n\n Create a new subclass of `Adapter` in the `app/adapters` folder:\n\n ```js [app/adapters/application.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n\n export default class extends Adapter {\n // ...your code here\n }\n ```\n\n Model-specific adapters can be created by putting your adapter\n class in an `app/adapters/` + `model-name` + `.js` file of the application.\n\n ```js [app/adapters/post.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n\n export default class extends Adapter {\n // ...Post-specific adapter code goes here\n }\n ```\n\n `Adapter` is an abstract base class that you should override in your\n application to customize it for your backend. The minimum set of methods\n that you should implement is:\n\n * `findRecord()`\n * `createRecord()`\n * `updateRecord()`\n * `deleteRecord()`\n * `findAll()`\n * `query()`\n\n To improve the network performance of your application, you can optimize\n your adapter by overriding these lower-level methods:\n\n * `findMany()`\n\n\n For an example of the implementation, see `RESTAdapter`, the\n included REST adapter.\n\n @class Adapter\n @public\n*/\nexport class Adapter extends EmberObject implements MinimumAdapterInterface {\n @service declare store: Store;\n\n declare _coalesceFindRequests: boolean;\n\n /**\n The `findRecord()` method is invoked when the store is asked for a record that\n has not previously been loaded. In response to `findRecord()` being called, you\n should query your persistence layer for a record with the given ID. The `findRecord`\n method should return a promise that will resolve to a JavaScript object that will be\n normalized by the serializer.\n\n Here is an example of the `findRecord` implementation:\n\n ```js [app/adapters/application.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n\n export default class ApplicationAdapter extends Adapter {\n findRecord(store, type, id, snapshot) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}/${id}`).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n }\n ```\n\n @param {Store} store\n @param {Model} type\n @param {String} id\n @param {Snapshot} snapshot\n @return {Promise} promise\n @public\n */\n // @ts-expect-error\n findRecord(store: Store, type: ModelSchema, id: string, snapshot: Snapshot): Promise<AdapterPayload> {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a findRecord override');\n }\n }\n\n /**\n The `findAll()` method is used to retrieve all records for a given type.\n\n Example\n\n ```js [app/adapters/application.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n\n export default class ApplicationAdapter extends Adapter {\n findAll(store, type) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}`).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n }\n ```\n\n @param {Store} store\n @param {Model} type\n @param {null} neverSet a value is never provided to this argument\n @param {SnapshotRecordArray} snapshotRecordArray\n @return {Promise} promise\n @public\n */\n findAll(\n store: Store,\n type: ModelSchema,\n neverSet: null,\n snapshotRecordArray: SnapshotRecordArray\n // @ts-expect-error\n ): Promise<AdapterPayload> {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a findAll override');\n }\n }\n\n /**\n This method is called when you call `query` on the store.\n\n Example\n\n ```js [app/adapters/application.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n\n export default class ApplicationAdapter extends Adapter {\n query(store, type, query) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}`, query).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n }\n ```\n\n @param {Store} store\n @param {Model} type\n @param {Object} query\n @param {Collection} recordArray\n @param {Object} adapterOptions\n @return {Promise} promise\n @public\n */\n // @ts-expect-error\n query(store: Store, type: ModelSchema, query): Promise<AdapterPayload> {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a query override');\n }\n }\n\n /**\n The `queryRecord()` method is invoked when the store is asked for a single\n record through a query object.\n\n In response to `queryRecord()` being called, you should always fetch fresh\n data. Once found, you can asynchronously call the store's `push()` method\n to push the record into the store.\n\n Here is an example `queryRecord` implementation:\n\n Example\n\n ```js [app/adapters/application.js]\n import { Adapter, BuildURLMixin } from '@warp-drive/legacy/adapter';\n\n export default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n queryRecord(store, type, query) {\n return fetch(`/${type.modelName}`, { body: JSON.stringify(query) })\n .then((response) => response.json());\n }\n }\n ```\n\n @param {Store} store\n @param {subclass of Model} type\n @param {Object} query\n @param {Object} adapterOptions\n @return {Promise} promise\n @public\n */\n // @ts-expect-error\n queryRecord(store: Store, type: ModelSchema, query, adapterOptions): Promise<AdapterPayload> {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a queryRecord override');\n }\n }\n\n /**\n If the globally unique IDs for your records should be generated on the client,\n implement the `generateIdForRecord()` method. This method will be invoked\n each time you create a new record, and the value returned from it will be\n assigned to the record's `primaryKey`.\n\n Most traditional REST-like HTTP APIs will not use this method. Instead, the ID\n of the record will be set by the server, and your adapter will update the store\n with the new ID when it calls `didCreateRecord()`. Only implement this method if\n you intend to generate record IDs on the client-side.\n\n The `generateIdForRecord()` method will be invoked with the requesting store as\n the first parameter and the newly created record as the second parameter:\n\n ```javascript\n import { Adapter } from '@warp-drive/legacy/adapter';\n import { v4 } from 'uuid';\n\n export default class ApplicationAdapter extends Adapter {\n generateIdForRecord(store, type, inputProperties) {\n return v4();\n }\n }\n ```\n\n @param {Store} store\n @param {Model} type the Model class of the record\n @param {Object} inputProperties a hash of properties to set on the\n newly created record.\n @return {(String|Number)} id\n @public\n */\n\n /**\n Proxies to the serializer's `serialize` method.\n\n Example\n\n ```js [app/adapters/application.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n\n export default class ApplicationAdapter extends Adapter {\n createRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n let url = `/${type.modelName}`;\n\n // ...\n }\n }\n ```\n\n @param {Snapshot} snapshot\n @param {Object} options\n @return {Object} serialized snapshot\n @public\n */\n serialize(snapshot: Snapshot, options: SerializerOptions): Record<string, unknown> {\n const serialized = snapshot.serialize(options);\n assert(\n `Your adapter's serialize method must return an object, but it returned ${typeof serialized}`,\n serialized && typeof serialized === 'object'\n );\n return serialized as Record<string, unknown>;\n }\n\n /**\n Implement this method in a subclass to handle the creation of\n new records.\n\n Serializes the record and sends it to the server.\n\n Example\n\n ```js [app/adapters/application.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n\n export default class ApplicationAdapter extends Adapter {\n createRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n\n return new RSVP.Promise(function (resolve, reject) {\n $.ajax({\n type: 'POST',\n url: `/${type.modelName}`,\n dataType: 'json',\n data: data\n }).then(function (data) {\n resolve(data);\n }, function (jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n reject(jqXHR);\n });\n });\n }\n }\n ```\n\n @param {Store} store\n @param {Model} type the Model class of the record\n @param {Snapshot} snapshot\n @return {Promise} promise\n @public\n */\n // @ts-expect-error\n createRecord(store: Store, type: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload> {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a createRecord override');\n }\n }\n\n /**\n Implement this method in a subclass to handle the updating of\n a record.\n\n Serializes the record update and sends it to the server.\n\n The updateRecord method is expected to return a promise that will\n resolve with the serialized record. This allows the backend to\n inform the Ember Data store the current state of this record after\n the update. If it is not possible to return a serialized record\n the updateRecord promise can also resolve with `undefined` and the\n Ember Data store will assume all of the updates were successfully\n applied on the backend.\n\n Example\n\n ```js [app/adapters/application.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n\n export default class ApplicationAdapter extends Adapter {\n updateRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n let id = snapshot.id;\n\n return new RSVP.Promise(function(resolve, reject) {\n $.ajax({\n type: 'PUT',\n url: `/${type.modelName}/${id}`,\n dataType: 'json',\n data: data\n }).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n reject(jqXHR);\n });\n });\n }\n }\n ```\n\n @param {Store} store\n @param {Model} type the Model class of the record\n @param {Snapshot} snapshot\n @return {Promise} promise\n @public\n */\n // @ts-expect-error\n updateRecord(store: Store, type: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload> {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a updateRecord override');\n }\n }\n\n /**\n Implement this method in a subclass to handle the deletion of\n a record.\n\n Sends a delete request for the record to the server.\n\n Example\n\n ```js [app/adapters/application.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n\n export default class ApplicationAdapter extends Adapter {\n deleteRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n let id = snapshot.id;\n\n return new RSVP.Promise(function(resolve, reject) {\n $.ajax({\n type: 'DELETE',\n url: `/${type.modelName}/${id}`,\n dataType: 'json',\n data: data\n }).then(function(data) {\n resolve(data)\n }, function(jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n reject(jqXHR);\n });\n });\n }\n }\n ```\n\n @param {Store} store\n @param {Model} type the Model class of the record\n @param {Snapshot} snapshot\n @return {Promise} promise\n @public\n */\n // @ts-expect-error\n deleteRecord(store: Store, type: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload> {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a deleteRecord override');\n }\n }\n\n /**\n By default the store will try to coalesce all `findRecord` calls within the same runloop\n into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.\n You can opt out of this behaviour by either not implementing the findMany hook or by setting\n coalesceFindRequests to false.\n\n @property coalesceFindRequests\n @public\n @type {Boolean}\n */\n get coalesceFindRequests() {\n const coalesceFindRequests = this._coalesceFindRequests;\n if (typeof coalesceFindRequests === 'boolean') {\n return coalesceFindRequests;\n }\n return (this._coalesceFindRequests = true);\n }\n\n set coalesceFindRequests(value: boolean) {\n this._coalesceFindRequests = value;\n }\n\n /**\n The store will call `findMany` instead of multiple `findRecord`\n requests to find multiple records at once if coalesceFindRequests\n is true.\n\n ```js [app/adapters/application.js]\n import { Adapter } from '@warp-drive/legacy/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n\n export default class ApplicationAdapter extends Adapter {\n findMany(store, type, ids, snapshots) {\n return new RSVP.Promise(function(resolve, reject) {\n $.ajax({\n type: 'GET',\n url: `/${type.modelName}/`,\n dataType: 'json',\n data: { filter: { id: ids.join(',') } }\n }).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n reject(jqXHR);\n });\n });\n }\n }\n ```\n\n @param {Store} store\n @param {Model} type the Model class of the records\n @param {Array} ids\n @param {Array} snapshots\n @return {Promise} promise\n @public\n */\n\n /**\n Organize records into groups, each of which is to be passed to separate\n calls to `findMany`.\n\n For example, if your API has nested URLs that depend on the parent, you will\n want to group records by their parent.\n\n The default implementation returns the records as a single group.\n\n @public\n @param {Store} store\n @param {Array} snapshots\n @return {Array} an array of arrays of records, each of which is to be\n loaded separately by `findMany`.\n */\n groupRecordsForFindMany(store: Store, snapshots: Snapshot[]): Snapshot[][] {\n return [snapshots];\n }\n\n /**\n This method is used by the store to determine if the store should\n reload a record from the adapter when a record is requested by\n `store.findRecord`.\n\n If this method returns `true`, the store will re-fetch a record from\n the adapter. If this method returns `false`, the store will resolve\n immediately using the cached record.\n\n For example, if you are building an events ticketing system, in which users\n can only reserve tickets for 20 minutes at a time, and want to ensure that\n in each route you have data that is no more than 20 minutes old you could\n write:\n\n ```javascript\n shouldReloadRecord(store, ticketSnapshot) {\n let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n if (timeDiff > 20) {\n return true;\n } else {\n return false;\n }\n }\n ```\n\n This method would ensure that whenever you do `store.findRecord('ticket',\n id)` you will always get a ticket that is no more than 20 minutes old. In\n case the cached version is more than 20 minutes old, `findRecord` will not\n resolve until you fetched the latest version.\n\n By default this hook returns `false`, as most UIs should not block user\n interactions while waiting on data update.\n\n Note that, with default settings, `shouldBackgroundReloadRecord` will always\n re-fetch the records in the background even if `shouldReloadRecord` returns\n `false`. You can override `shouldBackgroundReloadRecord` if this does not\n suit your use case.\n\n @since 1.13.0\n @param {Store} store\n @param {Snapshot} snapshot\n @return {Boolean}\n @public\n */\n shouldReloadRecord(store: Store, snapshot: Snapshot): boolean {\n return false;\n }\n\n /**\n This method is used by the store to determine if the store should\n reload all records from the adapter when records are requested by\n `store.findAll`.\n\n If this method returns `true`, the store will re-fetch all records from\n the adapter. If this method returns `false`, the store will resolve\n immediately using the cached records.\n\n For example, if you are building an events ticketing system, in which users\n can only reserve tickets for 20 minutes at a time, and want to ensure that\n in each route you have data that is no more than 20 minutes old you could\n write:\n\n ```javascript\n shouldReloadAll(store, snapshotArray) {\n let snapshots = snapshotArray.snapshots();\n\n return snapshots.any((ticketSnapshot) => {\n let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n if (timeDiff > 20) {\n return true;\n } else {\n return false;\n }\n });\n }\n ```\n\n This method would ensure that whenever you do `store.findAll('ticket')` you\n will always get a list of tickets that are no more than 20 minutes old. In\n case a cached version is more than 20 minutes old, `findAll` will not\n resolve until you fetched the latest versions.\n\n By default, this method returns `true` if the passed `snapshotRecordArray`\n is empty (meaning that there are no records locally available yet),\n otherwise, it returns `false`.\n\n Note that, with default settings, `shouldBackgroundReloadAll` will always\n re-fetch all the records in the background even if `shouldReloadAll` returns\n `false`. You can override `shouldBackgroundReloadAll` if this does not suit\n your use case.\n\n @since 1.13.0\n @param {Store} store\n @param {SnapshotRecordArray} snapshotRecordArray\n @return {Boolean}\n @public\n */\n shouldReloadAll(store: Store, snapshotRecordArray: SnapshotRecordArray): boolean {\n return !snapshotRecordArray.length;\n }\n\n /**\n This method is used by the store to determine if the store should\n reload a record after the `store.findRecord` method resolves a\n cached record.\n\n This method is *only* checked by the store when the store is\n returning a cached record.\n\n If this method returns `true` the store will re-fetch a record from\n the adapter.\n\n For example, if you do not want to fetch complex data over a mobile\n connection, or if the network is down, you can implement\n `shouldBackgroundReloadRecord` as follows:\n\n ```javascript\n shouldBackgroundReloadRecord(store, snapshot) {\n let { downlink, effectiveType } = navigator.connection;\n\n return downlink > 0 && effectiveType === '4g';\n }\n ```\n\n By default, this hook returns `true` so the data for the record is updated\n in the background.\n\n @since 1.13.0\n @param {Store} store\n @param {Snapshot} snapshot\n @return {Boolean}\n @public\n */\n shouldBackgroundReloadRecord(store: Store, snapshot: Snapshot): boolean {\n return true;\n }\n\n /**\n This method is used by the store to determine if the store should\n reload a record array after the `store.findAll` method resolves\n with a cached record array.\n\n This method is *only* checked by the store when the store is\n returning a cached record array.\n\n If this method returns `true` the store will re-fetch all records\n from the adapter.\n\n For example, if you do not want to fetch complex data over a mobile\n connection, or if the network is down, you can implement\n `shouldBackgroundReloadAll` as follows:\n\n ```javascript\n shouldBackgroundReloadAll(store, snapshotArray) {\n let { downlink, effectiveType } = navigator.connection;\n\n return downlink > 0 && effectiveType === '4g';\n }\n ```\n\n By default this method returns `true`, indicating that a background reload\n should always be triggered.\n\n @since 1.13.0\n @param {Store} store\n @param {SnapshotRecordArray} snapshotRecordArray\n @return {Boolean}\n @public\n */\n shouldBackgroundReloadAll(store: Store, snapshotRecordArray: SnapshotRecordArray): boolean {\n return true;\n }\n}\n\nexport { BuildURLMixin } from './adapter/-private/build-url-mixin.ts';\n"],"names":["buildURL","modelName","id","snapshot","requestType","query","urlForFindRecord","urlForFindAll","urlForQuery","urlForQueryRecord","urlForFindMany","urlForFindHasMany","urlForFindBelongsTo","urlForCreateRecord","urlForUpdateRecord","urlForDeleteRecord","_buildURL","path","url","host","prefix","urlPrefix","pathForType","push","encodeURIComponent","unshift","urlString","join","charAt","snapshots","ids","parentURL","namespace","test","camelized","camelize","pluralize","mixinProps","BuildURLMixin","Mixin","create","service","s","inject","Adapter","EmberObject","g","prototype","i","void 0","findRecord","store","type","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","Error","findAll","neverSet","snapshotRecordArray","queryRecord","adapterOptions","serialize","options","serialized","createRecord","updateRecord","deleteRecord","coalesceFindRequests","_coalesceFindRequests","value","groupRecordsForFindMany","shouldReloadRecord","shouldReloadAll","length","shouldBackgroundReloadRecord","shouldBackgroundReloadAll"],"mappings":";;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0FA;AACA;AACA;;AAMA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0EA,SAASA,QAAQA,CAEfC,SAAiB,EACjBC,EAAsD,EACtDC,QAA4D,EAC5DC,WAUkB,EAClBC,KAA+B,EACvB;AACR;AACF;AACA;AACA;AACA;AACA;AACA;AAEE,EAAA,QAAQD,WAAW;AACjB,IAAA,KAAK,YAAY;MACf,OAAO,IAAI,CAACE,gBAAgB,CAACJ,EAAE,EAAYD,SAAS,EAAEE,QAAoB,CAAC;AAC7E,IAAA,KAAK,SAAS;A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AAMC,GAAa,GAAG,EAAE;AACxB,EAAA,IAAIC,IAAI,EAAE;AACRD,IAAAA,GAAG,CAACK,IAAI,CAACJ,IAAI,CAAC;AAChB;AACA,EAAA,IAAIa,SAAS,EAAE;AACbd,IAAAA,GAAG,CAACK,IAAI,CAACS,SAAS,CAAC;AACrB;AACA,EAAA,OAAOd,GAAG,CAACS,IAAI,CAAC,GAAG,CAAC;AACtB;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAASL,WAAWA,CAA0BrB,SAAiB,EAAU;AACvE,EAAA,MAAMiC,SAAS,GAAGC,QAAQ,CAAClC,SAAS,CAAC;EACrC,OAAOmC,SAAS,CAACF,SAAS,CAAC;AAC7B;;AAEA;AACA;AACA,MAAMG,UAAyB,GAAG;EAChCrC,QAAQ;EACRgB,SAAS;EACTV,gBAAgB;EAChBC,aAAa;EACbE,iBAAiB;EACjBD,WAAW;EACXE,cAAc;EACdC,iBAAiB;EACjBC,mBAAmB;EACnBC,kBAAkB;EAClBE,kBAAkB;EAClBD,kBAAkB;EAClBO,SAAS;AACTC,EAAAA;AACF,CAAC;AAEM,MAAMgB,aAAa,GAAGC,KAAK,CAACC,MAAM,CAACH,UAAU;;ACnqBpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAaA,MAAMI,OAAO,GAAGC,CAAC,CAACD,OAAO,IAAIC,CAAC,CAACC,MAAM;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;AAGA;AACA;;AAEA;AACA;AACA;AACO,MAAMC,OAAO,SAASC,WAAW,CAAoC;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,OAAA,EAAA,CACzEN,OAAO,CAAA,CAAA;AAAA;AAAA,EAAA,MAAA,IAAAO,2BAAA,CAAA,IAAA,EAAA,OAAA,CAAA,EAAAC,MAAA;AAIR;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKE;EACAC,UAAUA,CAACC,KAAY,EAAEC,IAAiB,EAAElD,EAAU,EAAEC,QAAkB,EAA2B;IACnG,IAAAkD,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAW,EAAA;AACT,MAAA,MAAM,IAAIC,KAAK,CAAC,oEAAoE,CAAC;AACvF;AACF;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKEC,OAAOA,CACLR,KAAY,EACZC,IAAiB,EACjBQ,QAAc,EACdC,mBAAwC,EAEf;IACzB,IAAAR,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAW,EAAA;AACT,MAAA,MAAM,IAAIC,KAAK,CAAC,iEAAiE,CAAC;AACpF;AACF;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKE;AACArD,EAAAA,KAAKA,CAAC8C,KAAY,EAAEC,IAAiB,EAAE/C,KAAK,EAA2B;IACrE,IAAAgD,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAW,EAAA;AACT,MAAA,MAAM,IAAIC,KAAK,CAAC,+DAA+D,CAAC;AAClF;AACF;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOE;EACAI,WAAWA,CAACX,KAAY,EAAEC,IAAiB,EAAE/C,KAAK,EAAE0D,cAAc,EAA2B;IAC3F,IAAAV,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAW,EAAA;AACT,MAAA,MAAM,IAAIC,KAAK,CAAC,qEAAqE,CAAC;AACxF;AACF;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMEM,EAAAA,SAASA,CAAC7D,QAAkB,EAAE8D,OAA0B,EAA2B;AACjF,IAAA,MAAMC,UAAU,GAAG/D,QAAQ,CAAC6D,SAAS,CAACC,OAAO,CAAC;IAC9CZ,cAAA,CAAAC,eAAA,EAAAC,CAAAA,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAA,GAAA,CAAAxB,IAAA,IAAA;AAAA,MAAA,IAAA,CAAAA,IAAA,EAAA;AAAA,QAAA,MAAA,IAAAyB,KAAA,CACE,CAA0E,uEAAA,EAAA,OAAOQ,UAAU,CAAE,CAAA,CAAA;AAAA;AAAA,KAAA,EAC7FA,UAAU,IAAI,OAAOA,UAAU,KAAK,QAAQ,CAAA,GAAA,EAAA;AAE9C,IAAA,OAAOA,UAAU;AACnB;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOE;AACAC,EAAAA,YAAYA,CAAChB,KAAY,EAAEC,IAAiB,EAAEjD,QAAkB,EAA2B;IACzF,IAAAkD,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAW,EAAA;AACT,MAAA,MAAM,IAAIC,KAAK,CAAC,sEAAsE,CAAC;AACzF;AACF;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQE;AACAU,EAAAA,YAAYA,CAACjB,KAAY,EAAEC,IAAiB,EAAEjD,QAAkB,EAA2B;IACzF,IAAAkD,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAW,EAAA;AACT,MAAA,MAAM,IAAIC,KAAK,CAAC,sEAAsE,CAAC;AACzF;AACF;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOE;AACAW,EAAAA,YAAYA,CAAClB,KAAY,EAAEC,IAAiB,EAAEjD,QAAkB,EAA2B;IACzF,IAAAkD,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAW,EAAA;AACT,MAAA,MAAM,IAAIC,KAAK,CAAC,sEAAsE,CAAC;AACzF;AACF;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAEE,IAAIY,oBAAoBA,GAAG;AACzB,IAAA,MAAMA,oBAAoB,GAAG,IAAI,CAACC,qBAAqB;AACvD,IAAA,IAAI,OAAOD,oBAAoB,KAAK,SAAS,EAAE;AAC7C,MAAA,OAAOA,oBAAoB;AAC7B;AACA,IAAA,OAAQ,IAAI,CAACC,qBAAqB,GAAG,IAAI;AAC3C;EAEA,IAAID,oBAAoBA,CAACE,KAAc,EAAE;IACvC,IAAI,CAACD,qBAAqB,GAAGC,KAAK;AACpC;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIEC,EAAAA,uBAAuBA,CAACtB,KAAY,EAAEtB,SAAqB,EAAgB;IACzE,OAAO,CAACA,SAAS,CAAC;AACpB;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASE6C,EAAAA,kBAAkBA,CAACvB,KAAY,EAAEhD,QAAkB,EAAW;AAC5D,IAAA,OAAO,KAAK;AACd;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUEwE,EAAAA,eAAeA,CAACxB,KAAY,EAAEU,mBAAwC,EAAW;IAC/E,OAAO,CAACA,mBAAmB,CAACe,MAAM;AACpC;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQEC,EAAAA,4BAA4BA,CAAC1B,KAAY,EAAEhD,QAAkB,EAAW;AACtE,IAAA,OAAO,IAAI;AACb;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQE2E,EAAAA,yBAAyBA,CAAC3B,KAAY,EAAEU,mBAAwC,EAAW;AACzF,IAAA,OAAO,IAAI;AACb;AACF;;;;"}
@@ -0,0 +1 @@
1
+ export { F as FetchManager, S as SaveOp, c as Snapshot, b as SnapshotRecordArray, u as upgradeStore } from "../-private-DFfBszo5.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"-private.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,292 @@
1
+ import { SkipCache } from '@warp-drive/core/types/request';
2
+ import { deprecate } from '@ember/debug';
3
+ import { dasherize } from '@warp-drive/utilities/string';
4
+ import { macroCondition, getGlobalConfig } from '@embroider/macros';
5
+ import { ensureStringId, constructResource } from '@warp-drive/core/store/-private';
6
+ import { storeFor, recordIdentifierFor } from '@warp-drive/core';
7
+ function isMaybeIdentifier(maybeIdentifier) {
8
+ return Boolean(maybeIdentifier !== null && typeof maybeIdentifier === 'object' && ('id' in maybeIdentifier && 'type' in maybeIdentifier && maybeIdentifier.id && maybeIdentifier.type || maybeIdentifier.lid));
9
+ }
10
+ function normalizeModelName(type) {
11
+ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_NON_STRICT_TYPES)) {
12
+ const result = dasherize(type);
13
+ deprecate(`The resource type '${type}' is not normalized. Update your application code to use '${result}' instead of '${type}'.`, result === type, {
14
+ id: 'ember-data:deprecate-non-strict-types',
15
+ until: '6.0',
16
+ for: 'ember-data',
17
+ since: {
18
+ available: '4.13',
19
+ enabled: '5.3'
20
+ }
21
+ });
22
+ return result;
23
+ }
24
+ return type;
25
+ }
26
+
27
+ /**
28
+ This function builds a request config to perform a `findAll` request for the given type.
29
+ When passed to `store.request`, this config will result in the same behavior as a `store.findAll` request.
30
+ Additionally, it takes the same options as `store.findAll`.
31
+
32
+ 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.
33
+ 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.
34
+ To that end, these builders are deprecated and will be removed in a future version of Ember Data.
35
+
36
+ @deprecated
37
+ @public
38
+ @param {String} type the name of the resource
39
+ @param {Object} query a query to be used by the adapter
40
+ @param {FindAllBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.findAll
41
+ @return {FindAllRequestInput} request config
42
+ */
43
+ function findAllBuilder(type, options = {}) {
44
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
45
+ if (!test) {
46
+ throw new Error(`You need to pass a model name to the findAll builder`);
47
+ }
48
+ })(type) : {};
49
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
50
+ if (!test) {
51
+ throw new Error(`Model name passed to the findAll builder must be a dasherized string instead of ${type}`);
52
+ }
53
+ })(typeof type === 'string') : {};
54
+ return {
55
+ op: 'findAll',
56
+ data: {
57
+ type: normalizeModelName(type),
58
+ options: options || {}
59
+ },
60
+ cacheOptions: {
61
+ [SkipCache]: true
62
+ }
63
+ };
64
+ }
65
+
66
+ /**
67
+ This function builds a request config to find the record for a given identifier or type and id combination.
68
+ When passed to `store.request`, this config will result in the same behavior as a `store.findRecord` request.
69
+ Additionally, it takes the same options as `store.findRecord`, with the exception of `preload` (which is unsupported).
70
+
71
+ **Example 1**
72
+
73
+ ```ts
74
+ import { findRecord } from '@ember-data/legacy-compat/builders';
75
+ const { content: post } = await store.request<Post>(findRecord<Post>('post', '1'));
76
+ ```
77
+
78
+ **Example 2**
79
+
80
+ `findRecord` can be called with a single identifier argument instead of the combination
81
+ of `type` (modelName) and `id` as separate arguments. You may recognize this combo as
82
+ the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)
83
+
84
+ ```ts
85
+ import { findRecord } from '@ember-data/legacy-compat/builders';
86
+ const { content: post } = await store.request<Post>(findRecord<Post>({ type: 'post', id }));
87
+ ```
88
+
89
+ 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.
90
+ 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.
91
+ To that end, these builders are deprecated and will be removed in a future version of Ember Data.
92
+
93
+ @deprecated
94
+ @public
95
+ @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
96
+ @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
97
+ @param {FindRecordBuilderOptions} [options] - if the first param is a string this will be the optional options for the request. See examples for available options.
98
+ @return {FindRecordRequestInput} request config
99
+ */
100
+ function findRecordBuilder(resource, idOrOptions, options) {
101
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
102
+ if (!test) {
103
+ throw new Error(`You need to pass a modelName or resource identifier as the first argument to the findRecord builder`);
104
+ }
105
+ })(resource) : {};
106
+ if (isMaybeIdentifier(resource)) {
107
+ options = idOrOptions;
108
+ } else {
109
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
110
+ if (!test) {
111
+ throw new Error(`You need to pass a modelName or resource identifier as the first argument to the findRecord builder (passed ${resource})`);
112
+ }
113
+ })(typeof resource === 'string') : {};
114
+ const type = normalizeModelName(resource);
115
+ const normalizedId = ensureStringId(idOrOptions);
116
+ resource = constructResource(type, normalizedId);
117
+ }
118
+ options = options || {};
119
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
120
+ if (!test) {
121
+ throw new Error('findRecord builder does not support options.preload');
122
+ }
123
+ })(!options.preload) : {};
124
+ return {
125
+ op: 'findRecord',
126
+ data: {
127
+ record: resource,
128
+ options
129
+ },
130
+ cacheOptions: {
131
+ [SkipCache]: true
132
+ }
133
+ };
134
+ }
135
+
136
+ /**
137
+ This function builds a request config for a given type and query object.
138
+ When passed to `store.request`, this config will result in the same behavior as a `store.query` request.
139
+ Additionally, it takes the same options as `store.query`.
140
+
141
+ 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.
142
+ 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.
143
+ To that end, these builders are deprecated and will be removed in a future version of Ember Data.
144
+
145
+ @deprecated
146
+ @public
147
+ @param {String} type the name of the resource
148
+ @param {Object} query a query to be used by the adapter
149
+ @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query
150
+ @return {QueryRequestInput} request config
151
+ */
152
+ function queryBuilder(type, query, options = {}) {
153
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
154
+ if (!test) {
155
+ throw new Error(`You need to pass a model name to the query builder`);
156
+ }
157
+ })(type) : {};
158
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
159
+ if (!test) {
160
+ throw new Error(`You need to pass a query hash to the query builder`);
161
+ }
162
+ })(query) : {};
163
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
164
+ if (!test) {
165
+ throw new Error(`Model name passed to the query builder must be a dasherized string instead of ${type}`);
166
+ }
167
+ })(typeof type === 'string') : {};
168
+ return {
169
+ op: 'query',
170
+ data: {
171
+ type: normalizeModelName(type),
172
+ query,
173
+ options: options
174
+ },
175
+ cacheOptions: {
176
+ [SkipCache]: true
177
+ }
178
+ };
179
+ }
180
+
181
+ /**
182
+ This function builds a request config for a given type and query object.
183
+ When passed to `store.request`, this config will result in the same behavior as a `store.queryRecord` request.
184
+ Additionally, it takes the same options as `store.queryRecord`.
185
+
186
+ 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.
187
+ 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.
188
+ To that end, these builders are deprecated and will be removed in a future version of Ember Data.
189
+
190
+ @deprecated
191
+ @public
192
+ @param {String} type the name of the resource
193
+ @param {Object} query a query to be used by the adapter
194
+ @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query
195
+ @return {QueryRecordRequestInput} request config
196
+ */
197
+
198
+ function queryRecordBuilder(type, query, options) {
199
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
200
+ if (!test) {
201
+ throw new Error(`You need to pass a model name to the queryRecord builder`);
202
+ }
203
+ })(type) : {};
204
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
205
+ if (!test) {
206
+ throw new Error(`You need to pass a query hash to the queryRecord builder`);
207
+ }
208
+ })(query) : {};
209
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
210
+ if (!test) {
211
+ throw new Error(`Model name passed to the queryRecord builder must be a dasherized string instead of ${type}`);
212
+ }
213
+ })(typeof type === 'string') : {};
214
+ return {
215
+ op: 'queryRecord',
216
+ data: {
217
+ type: normalizeModelName(type),
218
+ query,
219
+ options: options || {}
220
+ },
221
+ cacheOptions: {
222
+ [SkipCache]: true
223
+ }
224
+ };
225
+ }
226
+ function _resourceIsFullDeleted(identifier, cache) {
227
+ return cache.isDeletionCommitted(identifier) || cache.isNew(identifier) && cache.isDeleted(identifier);
228
+ }
229
+ function resourceIsFullyDeleted(instanceCache, identifier) {
230
+ const cache = instanceCache.cache;
231
+ return !cache || _resourceIsFullDeleted(identifier, cache);
232
+ }
233
+
234
+ /**
235
+ This function builds a request config for saving the given record (e.g. creating, updating, or deleting the record).
236
+ When passed to `store.request`, this config will result in the same behavior as a legacy `store.saveRecord` request.
237
+ Additionally, it takes the same options as `store.saveRecord`.
238
+
239
+ 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.
240
+ 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.
241
+ To that end, these builders are deprecated and will be removed in a future version of Ember Data.
242
+
243
+ @deprecated
244
+ @public
245
+ @param {Object} record a record to save
246
+ @param {SaveRecordBuilderOptions} options optional, may include `adapterOptions` hash which will be passed to adapter.saveRecord
247
+ @return {SaveRecordRequestInput} request config
248
+ */
249
+ function saveRecordBuilder(record, options = {}) {
250
+ const store = storeFor(record);
251
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
252
+ if (!test) {
253
+ throw new Error(`Unable to initiate save for a record in a disconnected state`);
254
+ }
255
+ })(store) : {};
256
+ const identifier = recordIdentifierFor(record);
257
+ if (!identifier) {
258
+ // this commonly means we're disconnected
259
+ // but just in case we throw here to prevent bad things.
260
+ throw new Error(`Record Is Disconnected`);
261
+ }
262
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
263
+ if (!test) {
264
+ throw new Error(`Cannot initiate a save request for an unloaded record: ${identifier.lid}`);
265
+ }
266
+ })(store._instanceCache.recordIsLoaded(identifier)) : {};
267
+ if (resourceIsFullyDeleted(store._instanceCache, identifier)) {
268
+ throw new Error('cannot build saveRecord request for deleted record');
269
+ }
270
+ if (!options) {
271
+ options = {};
272
+ }
273
+ let operation = 'updateRecord';
274
+ const cache = store.cache;
275
+ if (cache.isNew(identifier)) {
276
+ operation = 'createRecord';
277
+ } else if (cache.isDeleted(identifier)) {
278
+ operation = 'deleteRecord';
279
+ }
280
+ return {
281
+ op: operation,
282
+ data: {
283
+ options,
284
+ record: identifier
285
+ },
286
+ records: [identifier],
287
+ cacheOptions: {
288
+ [SkipCache]: true
289
+ }
290
+ };
291
+ }
292
+ export { findAllBuilder as findAll, findRecordBuilder as findRecord, queryBuilder as query, queryRecordBuilder as queryRecord, saveRecordBuilder as saveRecord };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builders.js","sources":["../../src/compat/builders/utils.ts","../../src/compat/builders/find-all.ts","../../src/compat/builders/find-record.ts","../../src/compat/builders/query.ts","../../src/compat/builders/save-record.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { DEPRECATE_NON_STRICT_TYPES } from '@warp-drive/core/build-config/deprecations';\nimport type { ResourceIdentifierObject } from '@warp-drive/core/types/spec/json-api-raw';\nimport { dasherize } from '@warp-drive/utilities/string';\n\nexport function isMaybeIdentifier(\n maybeIdentifier: string | ResourceIdentifierObject\n): maybeIdentifier is ResourceIdentifierObject {\n return Boolean(\n maybeIdentifier !== null &&\n typeof maybeIdentifier === 'object' &&\n (('id' in maybeIdentifier && 'type' in maybeIdentifier && maybeIdentifier.id && maybeIdentifier.type) ||\n maybeIdentifier.lid)\n );\n}\n\nexport function normalizeModelName(type: string): string {\n if (DEPRECATE_NON_STRICT_TYPES) {\n const result = dasherize(type);\n\n deprecate(\n `The resource type '${type}' is not normalized. Update your application code to use '${result}' instead of '${type}'.`,\n result === type,\n {\n id: 'ember-data:deprecate-non-strict-types',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '4.13',\n enabled: '5.3',\n },\n }\n );\n\n return result;\n }\n\n return type;\n}\n","import type { StoreRequestInput } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { FindAllOptions } from '@warp-drive/core/types';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core/types/record';\nimport { SkipCache } from '@warp-drive/core/types/request';\nimport type { RequestSignature } from '@warp-drive/core/types/symbols';\n\nimport { normalizeModelName } from './utils.ts';\n\ntype FindAllRequestInput<T extends string = string, RT = unknown[]> = StoreRequestInput & {\n op: 'findAll';\n data: {\n type: T;\n options: FindAllBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\ntype FindAllBuilderOptions<T = unknown> = FindAllOptions<T>;\n\n/**\n This function builds a request config to perform a `findAll` request for the given type.\n When passed to `store.request`, this config will result in the same behavior as a `store.findAll` request.\n Additionally, it takes the same options as `store.findAll`.\n\n 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.\n 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.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @deprecated\n @public\n @param {String} type the name of the resource\n @param {Object} query a query to be used by the adapter\n @param {FindAllBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.findAll\n @return {FindAllRequestInput} request config\n*/\nexport function findAllBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n options?: FindAllBuilderOptions<T>\n): FindAllRequestInput<TypeFromInstance<T>, T[]>;\nexport function findAllBuilder(type: string, options?: FindAllBuilderOptions): FindAllRequestInput;\nexport function findAllBuilder(type: string, options: FindAllBuilderOptions = {}): FindAllRequestInput {\n assert(`You need to pass a model name to the findAll builder`, type);\n assert(\n `Model name passed to the findAll builder must be a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n return {\n op: 'findAll',\n data: {\n type: normalizeModelName(type),\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n","import type { StoreRequestInput } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport { constructResource, ensureStringId } from '@warp-drive/core/store/-private';\nimport type { BaseFinderOptions, FindRecordOptions } from '@warp-drive/core/types';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core/types/record';\nimport { SkipCache } from '@warp-drive/core/types/request';\nimport type { ResourceIdentifierObject } from '@warp-drive/core/types/spec/json-api-raw';\nimport type { RequestSignature } from '@warp-drive/core/types/symbols';\n\nimport { isMaybeIdentifier, normalizeModelName } from './utils.ts';\n\ntype FindRecordRequestInput<T extends string = string, RT = unknown> = StoreRequestInput & {\n op: 'findRecord';\n data: {\n record: ResourceIdentifierObject<T>;\n options: FindRecordBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\ntype FindRecordBuilderOptions = Omit<FindRecordOptions, 'preload'>;\n\n/**\n This function builds a request config to find the record for a given identifier or type and id combination.\n When passed to `store.request`, this config will result in the same behavior as a `store.findRecord` request.\n Additionally, it takes the same options as `store.findRecord`, with the exception of `preload` (which is unsupported).\n\n **Example 1**\n\n ```ts\n import { findRecord } from '@ember-data/legacy-compat/builders';\n const { content: post } = await store.request<Post>(findRecord<Post>('post', '1'));\n ```\n\n **Example 2**\n\n `findRecord` can be called with a single identifier argument instead of the combination\n of `type` (modelName) and `id` as separate arguments. You may recognize this combo as\n the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)\n\n ```ts\n import { findRecord } from '@ember-data/legacy-compat/builders';\n const { content: post } = await store.request<Post>(findRecord<Post>({ type: 'post', id }));\n ```\n\n 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.\n 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.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @deprecated\n @public\n @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\n @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\n @param {FindRecordBuilderOptions} [options] - if the first param is a string this will be the optional options for the request. See examples for available options.\n @return {FindRecordRequestInput} request config\n*/\nexport function findRecordBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n id: string,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput<TypeFromInstance<T>, T>;\nexport function findRecordBuilder(type: string, id: string, options?: FindRecordBuilderOptions): FindRecordRequestInput;\nexport function findRecordBuilder<T extends TypedRecordInstance>(\n resource: ResourceIdentifierObject<TypeFromInstance<T>>,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput<TypeFromInstance<T>, T>;\nexport function findRecordBuilder(\n resource: ResourceIdentifierObject,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput;\nexport function findRecordBuilder(\n resource: string | ResourceIdentifierObject,\n idOrOptions?: string | FindRecordBuilderOptions,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput {\n assert(\n `You need to pass a modelName or resource identifier as the first argument to the findRecord builder`,\n resource\n );\n if (isMaybeIdentifier(resource)) {\n options = idOrOptions as BaseFinderOptions | undefined;\n } else {\n assert(\n `You need to pass a modelName or resource identifier as the first argument to the findRecord builder (passed ${resource})`,\n typeof resource === 'string'\n );\n const type = normalizeModelName(resource);\n const normalizedId = ensureStringId(idOrOptions as string | number);\n resource = constructResource(type, normalizedId);\n }\n\n options = options || {};\n\n assert('findRecord builder does not support options.preload', !(options as FindRecordOptions).preload);\n\n return {\n op: 'findRecord' as const,\n data: {\n record: resource,\n options,\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n","import type { StoreRequestInput } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { LegacyResourceQuery, QueryOptions } from '@warp-drive/core/types';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core/types/record';\nimport { SkipCache } from '@warp-drive/core/types/request';\nimport type { RequestSignature } from '@warp-drive/core/types/symbols';\n\nimport { normalizeModelName } from './utils.ts';\n\ntype QueryRequestInput<T extends string = string, RT = unknown[]> = StoreRequestInput & {\n op: 'query';\n data: {\n type: T;\n query: LegacyResourceQuery;\n options: QueryBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\ntype QueryBuilderOptions = QueryOptions;\n\n/**\n This function builds a request config for a given type and query object.\n When passed to `store.request`, this config will result in the same behavior as a `store.query` request.\n Additionally, it takes the same options as `store.query`.\n\n 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.\n 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.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @deprecated\n @public\n @param {String} type the name of the resource\n @param {Object} query a query to be used by the adapter\n @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query\n @return {QueryRequestInput} request config\n*/\nexport function queryBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n query: LegacyResourceQuery<T>,\n options?: QueryBuilderOptions\n): QueryRequestInput<TypeFromInstance<T>, T[]>;\nexport function queryBuilder(\n type: string,\n query: LegacyResourceQuery,\n options?: QueryBuilderOptions\n): QueryRequestInput;\nexport function queryBuilder(\n type: string,\n query: LegacyResourceQuery,\n options: QueryBuilderOptions = {}\n): QueryRequestInput {\n assert(`You need to pass a model name to the query builder`, type);\n assert(`You need to pass a query hash to the query builder`, query);\n assert(\n `Model name passed to the query builder must be a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n return {\n op: 'query' as const,\n data: {\n type: normalizeModelName(type),\n query,\n options: options,\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n\ntype QueryRecordRequestInput<T extends string = string, RT = unknown> = StoreRequestInput & {\n op: 'queryRecord';\n data: {\n type: T;\n query: LegacyResourceQuery;\n options: QueryBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\n/**\n This function builds a request config for a given type and query object.\n When passed to `store.request`, this config will result in the same behavior as a `store.queryRecord` request.\n Additionally, it takes the same options as `store.queryRecord`.\n\n 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.\n 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.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @deprecated\n @public\n @param {String} type the name of the resource\n @param {Object} query a query to be used by the adapter\n @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query\n @return {QueryRecordRequestInput} request config\n*/\nexport function queryRecordBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n query: LegacyResourceQuery<T>,\n options?: QueryBuilderOptions\n): QueryRecordRequestInput<TypeFromInstance<T>, T | null>;\nexport function queryRecordBuilder(\n type: string,\n query: LegacyResourceQuery,\n options?: QueryBuilderOptions\n): QueryRecordRequestInput;\nexport function queryRecordBuilder(\n type: string,\n query: LegacyResourceQuery,\n options?: QueryBuilderOptions\n): QueryRecordRequestInput {\n assert(`You need to pass a model name to the queryRecord builder`, type);\n assert(`You need to pass a query hash to the queryRecord builder`, query);\n assert(\n `Model name passed to the queryRecord builder must be a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n return {\n op: 'queryRecord',\n data: {\n type: normalizeModelName(type),\n query,\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n","import { recordIdentifierFor, storeFor, type StoreRequestInput } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { InstanceCache } from '@warp-drive/core/store/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core/types';\nimport type { Cache } from '@warp-drive/core/types/cache';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core/types/record';\nimport { SkipCache } from '@warp-drive/core/types/request';\nimport type { RequestSignature } from '@warp-drive/core/types/symbols';\n\ntype SaveRecordRequestInput<T extends string = string, RT = unknown> = StoreRequestInput & {\n op: 'createRecord' | 'deleteRecord' | 'updateRecord';\n data: {\n record: StableRecordIdentifier<T>;\n options: SaveRecordBuilderOptions;\n };\n records: [StableRecordIdentifier<T>];\n [RequestSignature]?: RT;\n};\n\ntype SaveRecordBuilderOptions = Record<string, unknown>;\n\nfunction _resourceIsFullDeleted(identifier: StableRecordIdentifier, cache: Cache): boolean {\n return cache.isDeletionCommitted(identifier) || (cache.isNew(identifier) && cache.isDeleted(identifier));\n}\n\nfunction resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: StableRecordIdentifier): boolean {\n const cache = instanceCache.cache;\n return !cache || _resourceIsFullDeleted(identifier, cache);\n}\n\n/**\n This function builds a request config for saving the given record (e.g. creating, updating, or deleting the record).\n When passed to `store.request`, this config will result in the same behavior as a legacy `store.saveRecord` request.\n Additionally, it takes the same options as `store.saveRecord`.\n\n 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.\n 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.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @deprecated\n @public\n @param {Object} record a record to save\n @param {SaveRecordBuilderOptions} options optional, may include `adapterOptions` hash which will be passed to adapter.saveRecord\n @return {SaveRecordRequestInput} request config\n*/\nexport function saveRecordBuilder<T extends TypedRecordInstance>(\n record: T,\n options: Record<string, unknown> = {}\n): SaveRecordRequestInput<TypeFromInstance<T>, T> {\n const store = storeFor(record);\n assert(`Unable to initiate save for a record in a disconnected state`, store);\n const identifier = recordIdentifierFor<T>(record);\n\n if (!identifier) {\n // this commonly means we're disconnected\n // but just in case we throw here to prevent bad things.\n throw new Error(`Record Is Disconnected`);\n }\n assert(\n `Cannot initiate a save request for an unloaded record: ${identifier.lid}`,\n store._instanceCache.recordIsLoaded(identifier)\n );\n if (resourceIsFullyDeleted(store._instanceCache, identifier)) {\n throw new Error('cannot build saveRecord request for deleted record');\n }\n\n if (!options) {\n options = {};\n }\n let operation: 'createRecord' | 'deleteRecord' | 'updateRecord' = 'updateRecord';\n\n const cache = store.cache;\n if (cache.isNew(identifier)) {\n operation = 'createRecord';\n } else if (cache.isDeleted(identifier)) {\n operation = 'deleteRecord';\n }\n\n return {\n op: operation,\n data: {\n options,\n record: identifier,\n },\n records: [identifier],\n cacheOptions: { [SkipCache]: true },\n };\n}\n"],"names":["isMaybeIdentifier","maybeIdentifier","Boolean","id","type","lid","normalizeModelName","macroCondition","getGlobalConfig","WarpDrive","deprecations","DEPRECATE_NON_STRICT_TYPES","result","dasherize","deprecate","until","for","since","available","enabled","findAllBuilder","options","env","DEBUG","test","Error","op","data","cacheOptions","SkipCache","findRecordBuilder","resource","idOrOptions","normalizedId","ensureStringId","constructResource","preload","record","queryBuilder","query","queryRecordBuilder","_resourceIsFullDeleted","identifier","cache","isDeletionCommitted","isNew","isDeleted","resourceIsFullyDeleted","instanceCache","saveRecordBuilder","store","storeFor","recordIdentifierFor","_instanceCache","recordIsLoaded","operation","records"],"mappings":";;;;;;;AAMO,SAASA,iBAAiBA,CAC/BC,eAAkD,EACL;AAC7C,EAAA,OAAOC,OAAO,CACZD,eAAe,KAAK,IAAI,IACtB,OAAOA,eAAe,KAAK,QAAQ,KACjC,IAAI,IAAIA,eAAe,IAAI,MAAM,IAAIA,eAAe,IAAIA,eAAe,CAACE,EAAE,IAAIF,eAAe,CAACG,IAAI,IAClG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