@warp-drive-mirror/core 5.10.0-alpha.12 → 5.10.0-alpha.13

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 (267) hide show
  1. package/README.md +32 -0
  2. package/dist/{-private-CjK1Dmuh.js → -private-BpyvBYFj.js} +508 -144
  3. package/dist/-private-BpyvBYFj.js.map +1 -0
  4. package/dist/{unpkg/dev/-private-Dtj8O5W7.js → -private-CmNOwhK0.js} +3 -1
  5. package/dist/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
  6. package/dist/{aliases-BWYW5EhX.d.ts → aliases-BQmAxXmb.d.ts} +4 -1
  7. package/dist/aliases-BQmAxXmb.d.ts.map +1 -0
  8. package/dist/{change-C7kqv2kW.d.ts → change-DClXcHvr.d.ts} +4 -2
  9. package/dist/change-DClXcHvr.d.ts.map +1 -0
  10. package/dist/{concepts-DFldVwEM.d.ts → concepts-DzuY5M1K.d.ts} +14 -5
  11. package/dist/concepts-DzuY5M1K.d.ts.map +1 -0
  12. package/dist/{configure-B_F639tN.d.ts → configure-CjsojjiI.d.ts} +7 -1
  13. package/dist/configure-CjsojjiI.d.ts.map +1 -0
  14. package/dist/configure.d.ts +1 -1
  15. package/dist/configure.js +1 -1
  16. package/dist/{document-Ca4ZZBd9.d.ts → document-Ni8Ns26t.d.ts} +22 -4
  17. package/dist/document-Ni8Ns26t.d.ts.map +1 -0
  18. package/dist/{error-0uD6GkNX.d.ts → error-APuUdUGk.d.ts} +4 -2
  19. package/dist/error-APuUdUGk.d.ts.map +1 -0
  20. package/dist/{fields-CnlWuUd5.d.ts → fields-D6173Q_a.d.ts} +126 -5
  21. package/dist/fields-D6173Q_a.d.ts.map +1 -0
  22. package/dist/graph/-private.d.ts +1 -1
  23. package/dist/graph/-private.js +2 -0
  24. package/dist/graph/-private.js.map +1 -1
  25. package/dist/{graph-DLqYXP2z.d.ts → graph-rjTyJ-gd.d.ts} +25 -5
  26. package/dist/graph-rjTyJ-gd.d.ts.map +1 -0
  27. package/dist/{identifier-DQnqOSJK.d.ts → identifier-B_tK3FUw.d.ts} +29 -4
  28. package/dist/identifier-B_tK3FUw.d.ts.map +1 -0
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +1 -1
  31. package/dist/{internal-DBnp5uP6.d.ts → internal-CgOlgOt3.d.ts} +496 -31
  32. package/dist/internal-CgOlgOt3.d.ts.map +1 -0
  33. package/dist/{json-api-raw-C5APJHHB.d.ts → json-api-raw-BxzNsCg0.d.ts} +44 -2
  34. package/dist/json-api-raw-BxzNsCg0.d.ts.map +1 -0
  35. package/dist/{mutations-CqtoGB4t.d.ts → mutations-C81gbYjB.d.ts} +18 -2
  36. package/dist/mutations-C81gbYjB.d.ts.map +1 -0
  37. package/dist/{operations-D1qA6r0_.d.ts → operations-B4pQM7D6.d.ts} +39 -5
  38. package/dist/operations-B4pQM7D6.d.ts.map +1 -0
  39. package/dist/{params-DrEx3bf8.d.ts → params-dbHiSOMF.d.ts} +11 -1
  40. package/dist/params-dbHiSOMF.d.ts.map +1 -0
  41. package/dist/{raw-D5hnjiq7.d.ts → raw-CiC64nCY.d.ts} +10 -1
  42. package/dist/raw-CiC64nCY.d.ts.map +1 -0
  43. package/dist/reactive/-private.d.ts +1 -1
  44. package/dist/reactive/-private.js +1 -1
  45. package/dist/reactive.d.ts +2 -2
  46. package/dist/reactive.js +3 -3
  47. package/dist/{record-D3QQcaIR.d.ts → record-DDxPtzcY.d.ts} +22 -2
  48. package/dist/record-DDxPtzcY.d.ts.map +1 -0
  49. package/dist/{relationship-CmHzMPKf.d.ts → relationship-BlGIXgj4.d.ts} +10 -3
  50. package/dist/relationship-BlGIXgj4.d.ts.map +1 -0
  51. package/dist/{request-Di274pQz.js → request-MiwUbGdT.js} +26 -1
  52. package/dist/request-MiwUbGdT.js.map +1 -0
  53. package/dist/request.d.ts +1 -1
  54. package/dist/request.js +1 -1
  55. package/dist/signals/-leaked.d.ts +86 -4
  56. package/dist/signals/-leaked.d.ts.map +1 -1
  57. package/dist/signals/-leaked.js +1 -1
  58. package/dist/{src-B9WcEdYg.js → src-DlNeupkA.js} +221 -20
  59. package/dist/src-DlNeupkA.js.map +1 -0
  60. package/dist/store/-private.d.ts +1 -1
  61. package/dist/store/-private.js +1 -1
  62. package/dist/{store-DNF9Rgoh.js → store-lcyaxrpj.js} +16 -1
  63. package/dist/store-lcyaxrpj.js.map +1 -0
  64. package/dist/store.d.ts +1 -1
  65. package/dist/store.js +1 -1
  66. package/dist/{symbols-DjRDCeX0.d.ts → symbols-Cu9un1NR.d.ts} +10 -1
  67. package/dist/symbols-Cu9un1NR.d.ts.map +1 -0
  68. package/dist/types/-private.js +1 -1
  69. package/dist/types/cache/aliases.d.ts +1 -1
  70. package/dist/types/cache/change.d.ts +1 -1
  71. package/dist/types/cache/mutations.d.ts +1 -1
  72. package/dist/types/cache/operations.d.ts +1 -1
  73. package/dist/types/cache/relationship.d.ts +1 -1
  74. package/dist/types/cache.d.ts +1 -1
  75. package/dist/types/graph.d.ts +1 -1
  76. package/dist/types/identifier.d.ts +1 -1
  77. package/dist/types/identifier.js +33 -3
  78. package/dist/types/identifier.js.map +1 -1
  79. package/dist/types/json/raw.d.ts +1 -1
  80. package/dist/types/params.d.ts +1 -1
  81. package/dist/types/record.d.ts +1 -1
  82. package/dist/types/record.js +25 -0
  83. package/dist/types/record.js.map +1 -1
  84. package/dist/types/request.d.ts +1 -1
  85. package/dist/types/request.js +80 -0
  86. package/dist/types/request.js.map +1 -1
  87. package/dist/types/runtime.d.ts.map +1 -1
  88. package/dist/types/schema/concepts.d.ts +1 -1
  89. package/dist/types/schema/fields.d.ts +1 -1
  90. package/dist/types/schema/fields.js +132 -3
  91. package/dist/types/schema/fields.js.map +1 -1
  92. package/dist/types/schema/schema-service.d.ts +1 -1
  93. package/dist/types/spec/document.d.ts +1 -1
  94. package/dist/types/spec/error.d.ts +1 -1
  95. package/dist/types/spec/json-api-raw.d.ts +1 -1
  96. package/dist/types/symbols.d.ts +1 -1
  97. package/dist/types/symbols.js +14 -0
  98. package/dist/types/symbols.js.map +1 -1
  99. package/dist/types/utils.d.ts +1 -1
  100. package/dist/types.d.ts +2 -2
  101. package/dist/unpkg/{dev-deprecated/-private-DrQgwtNS.js → dev/-private-BH4O810v.js} +508 -144
  102. package/dist/unpkg/dev/-private-BH4O810v.js.map +1 -0
  103. package/dist/{-private-Dtj8O5W7.js → unpkg/dev/-private-CmNOwhK0.js} +3 -1
  104. package/dist/unpkg/dev/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
  105. package/dist/unpkg/dev/configure.js +1 -1
  106. package/dist/unpkg/dev/graph/-private.js +2 -0
  107. package/dist/unpkg/dev/graph/-private.js.map +1 -1
  108. package/dist/unpkg/dev/index.js +1 -1
  109. package/dist/unpkg/dev/reactive/-private.js +1 -1
  110. package/dist/unpkg/dev/reactive.js +3 -3
  111. package/dist/unpkg/{dev-deprecated/request-nAaeDlS9.js → dev/request-Fe-vpe-u.js} +26 -1
  112. package/dist/unpkg/dev/request-Fe-vpe-u.js.map +1 -0
  113. package/dist/unpkg/dev/request.js +1 -1
  114. package/dist/unpkg/dev/signals/-leaked.js +1 -1
  115. package/dist/unpkg/dev/{src-CkkrRFE1.js → src-FSk0Z_Lp.js} +212 -13
  116. package/dist/unpkg/dev/src-FSk0Z_Lp.js.map +1 -0
  117. package/dist/unpkg/dev/store/-private.js +1 -1
  118. package/dist/unpkg/dev/{store-BIFNM_fB.js → store-BUV8Pfi7.js} +16 -1
  119. package/dist/unpkg/dev/store-BUV8Pfi7.js.map +1 -0
  120. package/dist/unpkg/dev/store.js +1 -1
  121. package/dist/unpkg/dev/types/-private.js +1 -1
  122. package/dist/unpkg/dev/types/identifier.js +33 -3
  123. package/dist/unpkg/dev/types/identifier.js.map +1 -1
  124. package/dist/unpkg/dev/types/record.js +25 -0
  125. package/dist/unpkg/dev/types/record.js.map +1 -1
  126. package/dist/unpkg/dev/types/request.js +80 -0
  127. package/dist/unpkg/dev/types/request.js.map +1 -1
  128. package/dist/unpkg/dev/types/schema/fields.js +132 -3
  129. package/dist/unpkg/dev/types/schema/fields.js.map +1 -1
  130. package/dist/unpkg/dev/types/symbols.js +14 -0
  131. package/dist/unpkg/dev/types/symbols.js.map +1 -1
  132. package/dist/unpkg/{dev/-private-DrQgwtNS.js → dev-deprecated/-private-BH4O810v.js} +508 -144
  133. package/dist/unpkg/dev-deprecated/-private-BH4O810v.js.map +1 -0
  134. package/dist/unpkg/{prod-deprecated/-private-Dtj8O5W7.js → dev-deprecated/-private-CmNOwhK0.js} +3 -1
  135. package/dist/unpkg/dev-deprecated/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
  136. package/dist/unpkg/dev-deprecated/configure.js +1 -1
  137. package/dist/unpkg/dev-deprecated/graph/-private.js +2 -0
  138. package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -1
  139. package/dist/unpkg/dev-deprecated/index.js +1 -1
  140. package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -1
  141. package/dist/unpkg/dev-deprecated/reactive.js +3 -3
  142. package/dist/unpkg/{dev/request-nAaeDlS9.js → dev-deprecated/request-Fe-vpe-u.js} +26 -1
  143. package/dist/unpkg/dev-deprecated/request-Fe-vpe-u.js.map +1 -0
  144. package/dist/unpkg/dev-deprecated/request.js +1 -1
  145. package/dist/unpkg/dev-deprecated/signals/-leaked.js +1 -1
  146. package/dist/unpkg/dev-deprecated/{src-oz6OaQXu.js → src-Isk_Je7q.js} +214 -13
  147. package/dist/unpkg/dev-deprecated/src-Isk_Je7q.js.map +1 -0
  148. package/dist/unpkg/dev-deprecated/store/-private.js +1 -1
  149. package/dist/unpkg/dev-deprecated/{store-X1WN7P_O.js → store-CCZBSe0p.js} +16 -1
  150. package/dist/unpkg/dev-deprecated/store-CCZBSe0p.js.map +1 -0
  151. package/dist/unpkg/dev-deprecated/store.js +1 -1
  152. package/dist/unpkg/dev-deprecated/types/-private.js +1 -1
  153. package/dist/unpkg/dev-deprecated/types/identifier.js +33 -3
  154. package/dist/unpkg/dev-deprecated/types/identifier.js.map +1 -1
  155. package/dist/unpkg/dev-deprecated/types/record.js +25 -0
  156. package/dist/unpkg/dev-deprecated/types/record.js.map +1 -1
  157. package/dist/unpkg/dev-deprecated/types/request.js +80 -0
  158. package/dist/unpkg/dev-deprecated/types/request.js.map +1 -1
  159. package/dist/unpkg/dev-deprecated/types/schema/fields.js +132 -3
  160. package/dist/unpkg/dev-deprecated/types/schema/fields.js.map +1 -1
  161. package/dist/unpkg/dev-deprecated/types/symbols.js +14 -0
  162. package/dist/unpkg/dev-deprecated/types/symbols.js.map +1 -1
  163. package/dist/unpkg/prod/-private-CmNOwhK0.js +24 -0
  164. package/dist/unpkg/prod/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
  165. package/dist/unpkg/prod/{-private-Dg1vsF-H.js → -private-DKVDMUfT.js} +481 -138
  166. package/dist/unpkg/prod/-private-DKVDMUfT.js.map +1 -0
  167. package/dist/unpkg/prod/configure.js +1 -1
  168. package/dist/unpkg/prod/graph/-private.js +2 -0
  169. package/dist/unpkg/prod/graph/-private.js.map +1 -1
  170. package/dist/unpkg/prod/index.js +1 -1
  171. package/dist/unpkg/prod/reactive/-private.js +1 -1
  172. package/dist/unpkg/prod/reactive.js +3 -3
  173. package/dist/unpkg/prod/{request-DK7nNaAf.js → request-ndw2Fy91.js} +26 -1
  174. package/dist/unpkg/prod/request-ndw2Fy91.js.map +1 -0
  175. package/dist/unpkg/prod/request.js +1 -1
  176. package/dist/unpkg/prod/signals/-leaked.js +1 -1
  177. package/dist/unpkg/prod/{src-BGKCOL5L.js → src-CoSpuocQ.js} +212 -13
  178. package/dist/unpkg/prod/src-CoSpuocQ.js.map +1 -0
  179. package/dist/unpkg/prod/store/-private.js +1 -1
  180. package/dist/unpkg/{prod-deprecated/store-BWhmb7Ob.js → prod/store-CQOsqdST.js} +16 -1
  181. package/dist/unpkg/prod/store-CQOsqdST.js.map +1 -0
  182. package/dist/unpkg/prod/store.js +1 -1
  183. package/dist/unpkg/prod/types/-private.js +1 -1
  184. package/dist/unpkg/prod/types/identifier.js +33 -3
  185. package/dist/unpkg/prod/types/identifier.js.map +1 -1
  186. package/dist/unpkg/prod/types/record.js +25 -0
  187. package/dist/unpkg/prod/types/record.js.map +1 -1
  188. package/dist/unpkg/prod/types/request.js +80 -0
  189. package/dist/unpkg/prod/types/request.js.map +1 -1
  190. package/dist/unpkg/prod/types/schema/fields.js +132 -3
  191. package/dist/unpkg/prod/types/schema/fields.js.map +1 -1
  192. package/dist/unpkg/prod/types/symbols.js +14 -0
  193. package/dist/unpkg/prod/types/symbols.js.map +1 -1
  194. package/dist/unpkg/{dev-deprecated/-private-Dtj8O5W7.js → prod-deprecated/-private-CmNOwhK0.js} +3 -1
  195. package/dist/unpkg/prod-deprecated/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
  196. package/dist/unpkg/prod-deprecated/{-private-Dg1vsF-H.js → -private-DKVDMUfT.js} +481 -138
  197. package/dist/unpkg/prod-deprecated/-private-DKVDMUfT.js.map +1 -0
  198. package/dist/unpkg/prod-deprecated/configure.js +1 -1
  199. package/dist/unpkg/prod-deprecated/graph/-private.js +2 -0
  200. package/dist/unpkg/prod-deprecated/graph/-private.js.map +1 -1
  201. package/dist/unpkg/prod-deprecated/index.js +1 -1
  202. package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -1
  203. package/dist/unpkg/prod-deprecated/reactive.js +3 -3
  204. package/dist/unpkg/prod-deprecated/{request-DK7nNaAf.js → request-ndw2Fy91.js} +26 -1
  205. package/dist/unpkg/prod-deprecated/request-ndw2Fy91.js.map +1 -0
  206. package/dist/unpkg/prod-deprecated/request.js +1 -1
  207. package/dist/unpkg/prod-deprecated/signals/-leaked.js +1 -1
  208. package/dist/unpkg/prod-deprecated/{src-CGypdIsf.js → src-FK_rMde5.js} +214 -13
  209. package/dist/unpkg/prod-deprecated/src-FK_rMde5.js.map +1 -0
  210. package/dist/unpkg/prod-deprecated/store/-private.js +1 -1
  211. package/dist/unpkg/{prod/store-BWhmb7Ob.js → prod-deprecated/store-CQOsqdST.js} +16 -1
  212. package/dist/unpkg/prod-deprecated/store-CQOsqdST.js.map +1 -0
  213. package/dist/unpkg/prod-deprecated/store.js +1 -1
  214. package/dist/unpkg/prod-deprecated/types/-private.js +1 -1
  215. package/dist/unpkg/prod-deprecated/types/identifier.js +33 -3
  216. package/dist/unpkg/prod-deprecated/types/identifier.js.map +1 -1
  217. package/dist/unpkg/prod-deprecated/types/record.js +25 -0
  218. package/dist/unpkg/prod-deprecated/types/record.js.map +1 -1
  219. package/dist/unpkg/prod-deprecated/types/request.js +80 -0
  220. package/dist/unpkg/prod-deprecated/types/request.js.map +1 -1
  221. package/dist/unpkg/prod-deprecated/types/schema/fields.js +132 -3
  222. package/dist/unpkg/prod-deprecated/types/schema/fields.js.map +1 -1
  223. package/dist/unpkg/prod-deprecated/types/symbols.js +14 -0
  224. package/dist/unpkg/prod-deprecated/types/symbols.js.map +1 -1
  225. package/dist/{utils-BtURiy8l.d.ts → utils-CNmQoKm8.d.ts} +8 -1
  226. package/dist/utils-CNmQoKm8.d.ts.map +1 -0
  227. package/package.json +5 -5
  228. package/dist/-private-CjK1Dmuh.js.map +0 -1
  229. package/dist/aliases-BWYW5EhX.d.ts.map +0 -1
  230. package/dist/change-C7kqv2kW.d.ts.map +0 -1
  231. package/dist/concepts-DFldVwEM.d.ts.map +0 -1
  232. package/dist/configure-B_F639tN.d.ts.map +0 -1
  233. package/dist/document-Ca4ZZBd9.d.ts.map +0 -1
  234. package/dist/error-0uD6GkNX.d.ts.map +0 -1
  235. package/dist/fields-CnlWuUd5.d.ts.map +0 -1
  236. package/dist/graph-DLqYXP2z.d.ts.map +0 -1
  237. package/dist/identifier-DQnqOSJK.d.ts.map +0 -1
  238. package/dist/internal-DBnp5uP6.d.ts.map +0 -1
  239. package/dist/json-api-raw-C5APJHHB.d.ts.map +0 -1
  240. package/dist/mutations-CqtoGB4t.d.ts.map +0 -1
  241. package/dist/operations-D1qA6r0_.d.ts.map +0 -1
  242. package/dist/params-DrEx3bf8.d.ts.map +0 -1
  243. package/dist/raw-D5hnjiq7.d.ts.map +0 -1
  244. package/dist/record-D3QQcaIR.d.ts.map +0 -1
  245. package/dist/relationship-CmHzMPKf.d.ts.map +0 -1
  246. package/dist/request-Di274pQz.js.map +0 -1
  247. package/dist/src-B9WcEdYg.js.map +0 -1
  248. package/dist/store-DNF9Rgoh.js.map +0 -1
  249. package/dist/symbols-DjRDCeX0.d.ts.map +0 -1
  250. package/dist/unpkg/dev/-private-DrQgwtNS.js.map +0 -1
  251. package/dist/unpkg/dev/request-nAaeDlS9.js.map +0 -1
  252. package/dist/unpkg/dev/src-CkkrRFE1.js.map +0 -1
  253. package/dist/unpkg/dev/store-BIFNM_fB.js.map +0 -1
  254. package/dist/unpkg/dev-deprecated/-private-DrQgwtNS.js.map +0 -1
  255. package/dist/unpkg/dev-deprecated/request-nAaeDlS9.js.map +0 -1
  256. package/dist/unpkg/dev-deprecated/src-oz6OaQXu.js.map +0 -1
  257. package/dist/unpkg/dev-deprecated/store-X1WN7P_O.js.map +0 -1
  258. package/dist/unpkg/prod/-private-Dg1vsF-H.js.map +0 -1
  259. package/dist/unpkg/prod/-private-Dtj8O5W7.js +0 -22
  260. package/dist/unpkg/prod/request-DK7nNaAf.js.map +0 -1
  261. package/dist/unpkg/prod/src-BGKCOL5L.js.map +0 -1
  262. package/dist/unpkg/prod/store-BWhmb7Ob.js.map +0 -1
  263. package/dist/unpkg/prod-deprecated/-private-Dg1vsF-H.js.map +0 -1
  264. package/dist/unpkg/prod-deprecated/request-DK7nNaAf.js.map +0 -1
  265. package/dist/unpkg/prod-deprecated/src-CGypdIsf.js.map +0 -1
  266. package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +0 -1
  267. package/dist/utils-BtURiy8l.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","names":["getOrSetGlobal","getOrSetUniversal","SkipCache","Symbol","for","EnableHydration","IS_FUTURE","STRUCTURED"],"sources":["../../../../src/types/request.ts"],"sourcesContent":["// oxlint-disable-next-line no-unused-vars\nimport type { Future, Handler } from '../request.ts';\n// oxlint-disable-next-line no-unused-vars\nimport type { Fetch } from '../request/-private/fetch.ts';\n// oxlint-disable-next-line no-unused-vars\nimport type { RequestManager } from '../request/-private/manager.ts';\nimport type { FetchError } from '../request/-private/utils.ts';\n// oxlint-disable-next-line no-unused-vars\nimport type { RequestLoadingState } from '../signals/request-state.ts';\nimport type { Store } from '../store/-private.ts';\nimport { getOrSetGlobal, getOrSetUniversal } from './-private.ts';\nimport type { ResourceKey } from './identifier.ts';\nimport type { QueryParamsSerializationOptions } from './params.ts';\nimport type {\n // oxlint-disable-next-line no-unused-vars\n Includes,\n TypeFromInstanceOrString,\n} from './record.ts';\nimport type { ResourceIdentifierObject } from './spec/json-api-raw.ts';\nimport type { RequestSignature } from './symbols.ts';\n\n/**\n * A {@link RequestInfo.cacheOptions | cacheOptions} flag which, when set,\n * signals that a request should never be handled by the cache-manager and\n * thus will never resolve from cache nor update the cache.\n */\nexport const SkipCache: '___(unique) Symbol(SkipCache)' = getOrSetUniversal('SkipCache', Symbol.for('wd:skip-cache'));\n/**\n * A {@link RequestInfo} flag which, when set, signals to the store's\n * `instantiateRecord` hook that the resolved content should be hydrated\n * into reactive records rather than returned as raw data.\n */\nexport const EnableHydration: '___(unique) Symbol(EnableHydration)' = getOrSetUniversal(\n 'EnableHydration',\n Symbol.for('wd:enable-hydration')\n);\n/**\n * @private\n */\nexport const IS_FUTURE: '___(unique) Symbol(IS_FUTURE)' = getOrSetGlobal('IS_FUTURE', Symbol('IS_FUTURE'));\n/**\n * @private\n */\nexport const STRUCTURED: '___(unique) Symbol(DOC)' = getOrSetGlobal('DOC', Symbol('DOC'));\n\nexport type { FetchError };\n\n/**\n * The HTTP methods WarpDrive's request layer supports.\n */\nexport type HTTPMethod =\n | 'QUERY'\n | 'GET'\n | 'OPTIONS'\n | 'POST'\n | 'PUT'\n | 'PATCH'\n | 'DELETE'\n | 'HEAD'\n | 'CONNECT'\n | 'TRACE';\n\n/**\n * Use these options to adjust {@link CacheHandler} behavior for a request\n * via {@link RequestInfo.cacheOptions}.\n *\n */\nexport interface CacheOptions {\n /**\n * A key that uniquely identifies this request. If not present, the url wil be used\n * as the key for any GET request, while all other requests will not be cached.\n *\n */\n key?: string;\n /**\n * If true, the request will be made even if a cached response is present\n * and not expired.\n *\n */\n reload?: boolean;\n /**\n * If true, and a cached response is present and not expired, the request\n * will be made in the background and the cached response will be returned.\n *\n */\n backgroundReload?: boolean;\n /**\n * Useful for metadata around when to invalidate the cache. Typically used\n * by strategies that invalidate requests by resource type when a new resource\n * of that type has been created. See the CachePolicy implementation\n * provided by `@ember-data-mirror/request-utils` for an example.\n *\n * It is recommended to only use this for query/queryRecord requests where\n * new records created later would affect the results, though using it for\n * findRecord requests is also supported if desired where it may be useful\n * when a create may affect the result of a sideloaded relationship.\n *\n * Generally it is better to patch the cache directly for relationship updates\n * than to invalidate findRecord requests for one.\n *\n */\n // TODO: Ideally this would be T extends TypedRecordInstance ? ExtractSuggestedCacheTypes<T>[] : string[];\n // but that leads to `Type instantiation is excessively deep and possibly infinite.`\n // issues when `T` has many properties.\n types?: string[];\n\n /**\n * If true, the request will never be handled by the cache-manager and thus\n * will never resolve from cache nor update the cache.\n *\n * Generally this is only used for legacy request that manage resource cache\n * updates in a non-standard way via the LegacyNetworkHandler.\n *\n */\n [SkipCache]?: boolean;\n}\n/**\n * The request shape produced by the `findRecord` request builders, for\n * use with {@link Store.request}.\n */\nexport type FindRecordRequestOptions<RT = unknown, T = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'GET';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * see {@link CacheOptions}\n */\n cacheOptions?: CacheOptions;\n /**\n * the name of the request operation\n */\n op: 'findRecord';\n /**\n * the resource being requested\n */\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The request shape produced by the `query` request builders, for\n * use with {@link Store.request}.\n */\nexport type QueryRequestOptions<RT = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'GET';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * see {@link CacheOptions}\n */\n cacheOptions?: CacheOptions;\n /**\n * the name of the request operation\n */\n op: 'query';\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The request shape produced by the `postQuery` request builders, for\n * use with {@link Store.request}.\n */\nexport type PostQueryRequestOptions<RT = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'POST' | 'QUERY';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * the body to send with the request\n */\n body?: string | BodyInit | FormData;\n /**\n * see {@link CacheOptions}. A `key` is required since `POST`/`QUERY`\n * requests otherwise have no cache-safe way to derive one from the url.\n */\n cacheOptions: CacheOptions & {\n /**\n * a key that uniquely identifies this request\n */\n key: string;\n };\n /**\n * the name of the request operation\n */\n op: 'query';\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The request shape produced by the `deleteRecord` request builders, for\n * use with {@link Store.request}.\n */\nexport type DeleteRequestOptions<RT = unknown, T = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'DELETE';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * the name of the request operation\n */\n op: 'deleteRecord';\n /**\n * the body to send with the request\n */\n body?: string | BodyInit | FormData;\n /**\n * data for handlers to convert into the request body\n */\n data: {\n /**\n * the resource being deleted\n */\n record: ResourceKey<TypeFromInstanceOrString<T>>;\n };\n /**\n * the resource being deleted\n */\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\ntype ImmutableRequest<T> = Readonly<T> & {\n readonly headers: ImmutableHeaders;\n readonly records: [ResourceKey];\n};\n\n/**\n * The request shape produced by the `updateRecord` request builders, for\n * use with {@link Store.request}.\n */\nexport type UpdateRequestOptions<RT = unknown, T = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'PATCH' | 'PUT';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * the name of the request operation\n */\n op: 'updateRecord';\n /**\n * the body to send with the request\n */\n body?: string | BodyInit | FormData;\n /**\n * data for handlers to convert into the request body\n */\n data: {\n /**\n * the resource being updated\n */\n record: ResourceKey<TypeFromInstanceOrString<T>>;\n };\n /**\n * the resource being updated\n */\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The request shape produced by the `createRecord` request builders, for\n * use with {@link Store.request}.\n */\nexport type CreateRequestOptions<RT = unknown, T = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'POST';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * the name of the request operation\n */\n op: 'createRecord';\n /**\n * the body to send with the request\n */\n body?: string | BodyInit | FormData;\n /**\n * data for handlers to convert into the request body\n */\n data: {\n /**\n * the resource being created\n */\n record: ResourceKey<TypeFromInstanceOrString<T>>;\n };\n /**\n * the resource being created\n */\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The immutable, handler-facing form of {@link DeleteRequestOptions}.\n */\nexport type ImmutableDeleteRequestOptions = ImmutableRequest<DeleteRequestOptions>;\n/**\n * The immutable, handler-facing form of {@link UpdateRequestOptions}.\n */\nexport type ImmutableUpdateRequestOptions = ImmutableRequest<UpdateRequestOptions>;\n/**\n * The immutable, handler-facing form of {@link CreateRequestOptions}.\n */\nexport type ImmutableCreateRequestOptions = ImmutableRequest<CreateRequestOptions>;\n\n/**\n * A minimal reference to a resource sufficient to build a URL for it,\n * as accepted by the request builders.\n */\nexport type RemotelyAccessibleIdentifier<T extends string = string> = {\n /**\n * the resource's persisted id\n */\n id: string;\n /**\n * the resource's type\n */\n type: T;\n /**\n * the local identifier WarpDrive has assigned to the resource, if known\n */\n lid?: string;\n};\n\n/**\n * Options accepted by the request builders for constraining how a\n * request's url is constructed and how the request interacts with the cache.\n */\nexport interface ConstrainedRequestOptions {\n /**\n * If true, the request will be made even if a cached response is present\n * and not expired.\n */\n reload?: boolean;\n /**\n * If true, and a cached response is present and not expired, the request\n * will be made in the background and the cached response will be returned.\n */\n backgroundReload?: boolean;\n /**\n * The host to use when constructing the request's url, overriding any\n * host configured via `setBuildURLConfig`.\n */\n host?: string;\n /**\n * The namespace to use when constructing the request's url, overriding\n * any namespace configured via `setBuildURLConfig`.\n */\n namespace?: string;\n /**\n * The resource path to use when constructing the request's url,\n * overriding the default of pluralizing the resource's type.\n */\n resourcePath?: string;\n /**\n * Options for how to serialize the request's query params, see {@link QueryParamsSerializationOptions}.\n */\n urlParamsSettings?: QueryParamsSerializationOptions;\n}\n\n/**\n * Options accepted by the `findRecord` request builders.\n */\nexport interface FindRecordOptions extends ConstrainedRequestOptions {\n /**\n * the relationship paths to sideload, see {@link Includes}\n */\n include?: string | string[];\n}\n\n/**\n * When a {@link Future} resolves, it returns an object\n * containing the original {@link RequestInfo | request},\n * the {@link Response | response} set by the handler chain (if any), and\n * the processed content.\n */\nexport interface StructuredDataDocument<T> {\n /**\n * @private\n */\n [STRUCTURED]?: true;\n /**\n * @see {@link ImmutableRequestInfo}\n */\n request: ImmutableRequestInfo;\n /**\n * the response set by the handler chain, if any\n */\n response: Response | ResponseInfo | null;\n /**\n * the processed content of the response\n */\n content: T;\n}\n\n/**\n * When a {@link Future} rejects, it throws either an {@link Error}\n * an {@link AggregateError} or a {@link DOMException} that maintains\n * the `{ request, response, content }` shape but is also an Error instance\n * itself.\n *\n * If using the error originates from the {@link Fetch | Fetch Handler}\n * the error will be a {@link FetchError}\n */\nexport interface StructuredErrorDocument<T = unknown> extends Error {\n /**\n * @private\n */\n [STRUCTURED]?: true;\n /**\n * @see {@link ImmutableRequestInfo}\n */\n request: ImmutableRequestInfo;\n /**\n * the response set by the handler chain, if any\n */\n response: Response | ResponseInfo | null;\n /**\n * the error that caused the request to fail\n */\n error: string | object;\n /**\n * the processed content of the response, if any was received before the failure\n */\n content?: T;\n}\n\n/**\n * A union of the resolve/reject data types for the {@link Future}\n * returned by {@link Store.request | request}\n *\n * See also the docs for:\n *\n * - {@link Future}\n * - {@link StructuredDataDocument} (resolved/successful requests)\n * - {@link StructuredErrorDocument} (rejected/failed requests)\n */\nexport type StructuredDocument<T> = StructuredDataDocument<T> | StructuredErrorDocument<T>;\n\n/**\n * The {@link RequestInit} interface accepted by the native {@link fetch} API.\n *\n * WarpDrive provides our own typings due to incompleteness in the native typings.\n *\n * @privateRemarks\n * - [MDN Reference (fetch)](https://developer.mozilla.org/docs/Web/API/Window/fetch)\n * - [MDN Reference (RequestInit)](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit)\n * - [MDN Reference (Request)](https://developer.mozilla.org/docs/Web/API/Request)\n *\n */\ninterface NativeRequestInit {\n /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.\n */\n cache?: RequestCache;\n /** Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.\n */\n credentials?: RequestCredentials;\n /** Returns the kind of resource requested by request, e.g., \"document\" or \"script\".\n */\n destination?: RequestDestination;\n /** Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the \"Host\" header.\n */\n headers?: Headers;\n /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]\n */\n integrity?: string;\n /** Returns a boolean indicating whether or not request can outlive the global in which it was created.\n */\n keepalive?: boolean;\n /** Returns request's HTTP method, which is \"GET\" by default.\n */\n method?: HTTPMethod;\n /** Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.\n *\n * `no-cors` is not allowed for streaming request bodies.\n *\n */\n mode?: RequestMode;\n /**\n * provides an explicit priority hint for the request.\n */\n priority?: RequestPriority;\n /** Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.\n */\n redirect?: RequestRedirect;\n /** Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and \"about:client\" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.\n */\n referrer?: string;\n /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.\n */\n referrerPolicy?: ReferrerPolicy;\n /** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.\n */\n signal?: AbortSignal;\n /** Returns the URL of request as a string.\n */\n url?: string;\n /** Any body that you want to add to your request. Note that a GET or HEAD request may not have a body.\n */\n body?: BodyInit | null;\n\n /**\n * When sending a ReadableStream as the body of a request, 'half' must be\n * specified.\n *\n * [Half Duplex Further Reading](https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests#half_duplex)\n *\n */\n duplex?: 'half';\n}\n\n/**\n * A read-only {@link Headers} instance, as passed to {@link Handler | Handlers}\n * via {@link ImmutableRequestInfo.headers}.\n */\nexport interface ImmutableHeaders extends Headers {\n /**\n * Returns a mutable clone of these headers, if supported by the implementation.\n */\n clone?(): Headers;\n /**\n * Returns the headers as an array of `[key, value]` pairs.\n */\n toJSON(): [string, string][];\n}\n\n/**\n * Extends JavaScript's native {@link fetch} {@link NativeRequestInit | RequestInit} with additional\n * properties specific to the {@link RequestManager | RequestManager's} capabilities.\n *\n * This interface is used to define the shape of a request that can be made via\n * either the {@link RequestManager.request} or {@link Store.request} methods.\n *\n * @privateRemarks\n * - [MDN Reference (fetch)](https://developer.mozilla.org/docs/Web/API/Window/fetch)\n * - [MDN Reference (RequestInit)](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit)\n * - [MDN Reference (Request)](https://developer.mozilla.org/docs/Web/API/Request)\n *\n * @public\n * @since 4.12\n */\nexport interface RequestInfo<RT = unknown> extends NativeRequestInit {\n /**\n * If provided, used instead of the AbortController auto-configured for each request by the RequestManager\n *\n */\n controller?: AbortController;\n\n /**\n * @see {@link CacheOptions}\n */\n cacheOptions?: CacheOptions;\n /**\n * The {@link Store} the request was made against, if made via\n * {@link Store.request} rather than directly against a {@link RequestManager}.\n *\n * A {@link Handler} can read this off of {@link RequestContext.request | context.request}\n * to reach store state (the cache, other services attached to a custom\n * store subclass, etc.) without needing any Ember DI/`setOwner` wiring at\n * handler-construction time. This works for a handler of any shape (a\n * function, plain object, or class) because the store is attached to each\n * request individually rather than to the handler itself.\n *\n * The trade-off is that this is only populated for requests issued via\n * {@link Store.request | store.request(...)}; a request issued directly\n * against a {@link RequestManager} will not have it set unless the caller\n * supplies it explicitly. Handlers that rely on it should treat it as\n * optional.\n *\n * @example\n * ```ts\n * const LoggingHandler = {\n * request<T>(context: RequestContext, next: NextFn<T>) {\n * const store = context.request.store;\n * if (store) {\n * console.log(`[${store.constructor.name}] ${context.request.url ?? ''}`);\n * }\n * return next(context.request);\n * },\n * };\n * ```\n */\n store?: Store;\n\n /**\n * The name of the request operation, if any (e.g. `'findRecord'`, `'query'`).\n */\n op?: string;\n\n /**\n * The {@link ResourceKey | ResourceKeys} of the primary resources involved in the request\n * (if any). This may be used by handlers to perform transactional\n * operations on the store.\n *\n */\n records?: ResourceKey[];\n\n /**\n * If true, this request will not be tracked by test waiters.\n */\n disableTestWaiter?: boolean;\n /**\n * data that a handler should convert into\n * the query (GET) or body (POST).\n *\n * Note: It is recommended that builders set query params\n * and body directly in most scenarios.\n *\n */\n data?: Record<string, unknown>;\n /**\n * options specifically intended for {@link Handler | Handlers}\n * to utilize to process the request\n *\n */\n options?: Record<string, unknown>;\n\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n\n /**\n * see {@link EnableHydration}\n */\n [EnableHydration]?: boolean;\n}\n\n/**\n * Immutable version of {@link RequestInfo}. This is what is passed to handlers.\n *\n */\nexport type ImmutableRequestInfo<RT = unknown> = Readonly<Omit<RequestInfo<RT>, 'controller'>> & {\n /**\n * see {@link CacheOptions}\n */\n readonly cacheOptions?: Readonly<CacheOptions>;\n /**\n * see {@link ImmutableHeaders}\n */\n readonly headers?: ImmutableHeaders;\n /**\n * see {@link RequestInfo.data}\n */\n readonly data?: Readonly<Record<string, unknown>>;\n /**\n * see {@link RequestInfo.options}\n */\n readonly options?: Readonly<Record<string, unknown>>;\n\n /** Whether the request body has been read.\n */\n readonly bodyUsed?: boolean;\n};\n\n/**\n * An immutable, JSON-serializable subset of the native {@link Response}\n * interface.\n */\nexport interface ResponseInfo {\n /**\n * see {@link ImmutableHeaders}\n */\n readonly headers: ImmutableHeaders; // to do, maybe not this?\n /**\n * whether the response's status code was in the 200-299 range\n */\n readonly ok: boolean;\n /**\n * whether the response is the result of a redirect\n */\n readonly redirected: boolean;\n /**\n * the response's HTTP status code\n */\n readonly status: number;\n /**\n * the status message associated with the response's status code\n */\n readonly statusText: string;\n /**\n * the type of the response, see [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)\n */\n readonly type: ResponseType;\n /**\n * the url of the response\n */\n readonly url: string;\n}\n\n/**\n * The object a {@link Handler} uses to fulfill a request: it provides a\n * readonly view of the {@link RequestContext.request | request} and methods\n * for supplying the {@link Future}'s stream and final response.\n */\nexport interface RequestContext {\n /**\n * @see {@link ImmutableRequestInfo}\n */\n request: ImmutableRequestInfo;\n /**\n * a unique id for this request\n */\n id: number;\n\n /**\n * Supplies the stream of the response's content, if available, enabling\n * consumers to monitor download progress via {@link RequestLoadingState}.\n */\n setStream(stream: ReadableStream | Promise<ReadableStream | null>): void;\n /**\n * Supplies the response for the request.\n */\n setResponse(response: Response | ResponseInfo | null): void;\n}\n"],"mappings":";;;;;;;;AA0BA,MAAaE,YAA6CD,kBAAkB,aAAaE,OAAOC,IAAI,eAAe,CAAC;;;;;;AAMpH,MAAaC,kBAAyDJ,kBACpE,mBACAE,OAAOC,IAAI,qBAAqB,CAClC;;;;AAIA,MAAaE,YAA6CN,eAAe,aAAaG,OAAO,WAAW,CAAC;;;;AAIzG,MAAaI,aAAwCP,eAAe,OAAOG,OAAO,KAAK,CAAC"}
1
+ {"version":3,"file":"request.js","names":["getOrSetGlobal","getOrSetUniversal","SkipCache","Symbol","for","EnableHydration","IS_FUTURE","STRUCTURED"],"sources":["../../../../src/types/request.ts"],"sourcesContent":["/**\n * @module\n * @summary Types for requests and responses: `RequestInfo`, the request shapes builders return, cache options, the\n * handler context and the documents a request's `Future` settles with.\n */\n\n// oxlint-disable-next-line no-unused-vars\nimport type { Future, Handler } from '../request.ts';\n// oxlint-disable-next-line no-unused-vars\nimport type { Fetch } from '../request/-private/fetch.ts';\n// oxlint-disable-next-line no-unused-vars\nimport type { RequestManager } from '../request/-private/manager.ts';\nimport type { FetchError } from '../request/-private/utils.ts';\n// oxlint-disable-next-line no-unused-vars\nimport type { RequestLoadingState } from '../signals/request-state.ts';\nimport type { Store } from '../store/-private.ts';\nimport { getOrSetGlobal, getOrSetUniversal } from './-private.ts';\nimport type { ResourceKey } from './identifier.ts';\nimport type { QueryParamsSerializationOptions } from './params.ts';\nimport type {\n // oxlint-disable-next-line no-unused-vars\n Includes,\n TypeFromInstanceOrString,\n} from './record.ts';\nimport type { ResourceIdentifierObject } from './spec/json-api-raw.ts';\nimport type { RequestSignature } from './symbols.ts';\n\n/**\n * A {@link RequestInfo.cacheOptions | cacheOptions} flag which, when set,\n * signals that a request should never be handled by the cache-manager and\n * thus will never resolve from cache nor update the cache.\n *\n * @summary Symbol key for a request's `cacheOptions` that, when true, makes the request bypass the CacheHandler so it\n * neither resolves from nor updates the cache.\n */\nexport const SkipCache: '___(unique) Symbol(SkipCache)' = getOrSetUniversal('SkipCache', Symbol.for('wd:skip-cache'));\n/**\n * A {@link RequestInfo} flag which, when set, signals to the store's\n * `instantiateRecord` hook that the resolved content should be hydrated\n * into reactive records rather than returned as raw data.\n *\n * @summary Symbol flag on a request that makes the CacheHandler return reactive records instead of raw cache\n * documents; `store.request` sets it automatically.\n */\nexport const EnableHydration: '___(unique) Symbol(EnableHydration)' = getOrSetUniversal(\n 'EnableHydration',\n Symbol.for('wd:enable-hydration')\n);\n/**\n * @private\n */\nexport const IS_FUTURE: '___(unique) Symbol(IS_FUTURE)' = getOrSetGlobal('IS_FUTURE', Symbol('IS_FUTURE'));\n/**\n * @private\n */\nexport const STRUCTURED: '___(unique) Symbol(DOC)' = getOrSetGlobal('DOC', Symbol('DOC'));\n\nexport type { FetchError };\n\n/**\n * The HTTP methods WarpDrive's request layer supports.\n *\n * @summary Union of the HTTP method strings, including `QUERY`, that a WarpDrive request's `method` may be set to.\n */\nexport type HTTPMethod =\n | 'QUERY'\n | 'GET'\n | 'OPTIONS'\n | 'POST'\n | 'PUT'\n | 'PATCH'\n | 'DELETE'\n | 'HEAD'\n | 'CONNECT'\n | 'TRACE';\n\n/**\n * Use these options to adjust {@link CacheHandler} behavior for a request\n * via {@link RequestInfo.cacheOptions}.\n *\n * @summary Per-request settings on `cacheOptions` that control the cache key, forced or background reloads,\n * invalidation by resource type, and cache bypass.\n */\nexport interface CacheOptions {\n /**\n * A key that uniquely identifies this request. If not present, the url wil be used\n * as the key for any GET request, while all other requests will not be cached.\n *\n */\n key?: string;\n /**\n * If true, the request will be made even if a cached response is present\n * and not expired.\n *\n */\n reload?: boolean;\n /**\n * If true, and a cached response is present and not expired, the request\n * will be made in the background and the cached response will be returned.\n *\n */\n backgroundReload?: boolean;\n /**\n * Useful for metadata around when to invalidate the cache. Typically used\n * by strategies that invalidate requests by resource type when a new resource\n * of that type has been created. See the CachePolicy implementation\n * provided by `@ember-data-mirror/request-utils` for an example.\n *\n * It is recommended to only use this for query/queryRecord requests where\n * new records created later would affect the results, though using it for\n * findRecord requests is also supported if desired where it may be useful\n * when a create may affect the result of a sideloaded relationship.\n *\n * Generally it is better to patch the cache directly for relationship updates\n * than to invalidate findRecord requests for one.\n *\n */\n // TODO: Ideally this would be T extends TypedRecordInstance ? ExtractSuggestedCacheTypes<T>[] : string[];\n // but that leads to `Type instantiation is excessively deep and possibly infinite.`\n // issues when `T` has many properties.\n types?: string[];\n\n /**\n * If true, the request will never be handled by the cache-manager and thus\n * will never resolve from cache nor update the cache.\n *\n * Generally this is only used for legacy request that manage resource cache\n * updates in a non-standard way via the LegacyNetworkHandler.\n *\n */\n [SkipCache]?: boolean;\n}\n/**\n * The request shape produced by the `findRecord` request builders, for\n * use with {@link Store.request}.\n *\n * @summary Shape of the `GET` request object that `findRecord` builders return for `store.request`, carrying the url,\n * headers, and requested resource identifier.\n */\nexport type FindRecordRequestOptions<RT = unknown, T = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'GET';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * see {@link CacheOptions}\n */\n cacheOptions?: CacheOptions;\n /**\n * the name of the request operation\n */\n op: 'findRecord';\n /**\n * the resource being requested\n */\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The request shape produced by the `query` request builders, for\n * use with {@link Store.request}.\n *\n * @summary Shape of the `GET` request object that `query` builders return for `store.request`, carrying the url,\n * headers, and cache options.\n */\nexport type QueryRequestOptions<RT = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'GET';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * see {@link CacheOptions}\n */\n cacheOptions?: CacheOptions;\n /**\n * the name of the request operation\n */\n op: 'query';\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The request shape produced by the `postQuery` request builders, for\n * use with {@link Store.request}.\n *\n * @summary Shape of the `POST` or `QUERY` request object that `postQuery` builders return, with a body and a required\n * cache key since the url cannot serve as one.\n */\nexport type PostQueryRequestOptions<RT = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'POST' | 'QUERY';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * the body to send with the request\n */\n body?: string | BodyInit | FormData;\n /**\n * see {@link CacheOptions}. A `key` is required since `POST`/`QUERY`\n * requests otherwise have no cache-safe way to derive one from the url.\n */\n cacheOptions: CacheOptions & {\n /**\n * a key that uniquely identifies this request\n */\n key: string;\n };\n /**\n * the name of the request operation\n */\n op: 'query';\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The request shape produced by the `deleteRecord` request builders, for\n * use with {@link Store.request}.\n *\n * @summary Shape of the `DELETE` request object that `deleteRecord` builders return for `store.request`, identifying\n * the resource being deleted.\n */\nexport type DeleteRequestOptions<RT = unknown, T = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'DELETE';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * the name of the request operation\n */\n op: 'deleteRecord';\n /**\n * the body to send with the request\n */\n body?: string | BodyInit | FormData;\n /**\n * data for handlers to convert into the request body\n */\n data: {\n /**\n * the resource being deleted\n */\n record: ResourceKey<TypeFromInstanceOrString<T>>;\n };\n /**\n * the resource being deleted\n */\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\ntype ImmutableRequest<T> = Readonly<T> & {\n readonly headers: ImmutableHeaders;\n readonly records: [ResourceKey];\n};\n\n/**\n * The request shape produced by the `updateRecord` request builders, for\n * use with {@link Store.request}.\n *\n * @summary Shape of the `PATCH` or `PUT` request object that `updateRecord` builders return for `store.request`,\n * identifying the resource being saved.\n */\nexport type UpdateRequestOptions<RT = unknown, T = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'PATCH' | 'PUT';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * the name of the request operation\n */\n op: 'updateRecord';\n /**\n * the body to send with the request\n */\n body?: string | BodyInit | FormData;\n /**\n * data for handlers to convert into the request body\n */\n data: {\n /**\n * the resource being updated\n */\n record: ResourceKey<TypeFromInstanceOrString<T>>;\n };\n /**\n * the resource being updated\n */\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The request shape produced by the `createRecord` request builders, for\n * use with {@link Store.request}.\n *\n * @summary Shape of the `POST` request object that `createRecord` builders return for `store.request`, identifying the\n * new resource being saved.\n */\nexport type CreateRequestOptions<RT = unknown, T = unknown> = {\n /**\n * the url to request\n */\n url: string;\n /**\n * the HTTP method to use\n */\n method: 'POST';\n /**\n * the headers to send with the request\n */\n headers: Headers;\n /**\n * the name of the request operation\n */\n op: 'createRecord';\n /**\n * the body to send with the request\n */\n body?: string | BodyInit | FormData;\n /**\n * data for handlers to convert into the request body\n */\n data: {\n /**\n * the resource being created\n */\n record: ResourceKey<TypeFromInstanceOrString<T>>;\n };\n /**\n * the resource being created\n */\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n};\n\n/**\n * The immutable, handler-facing form of {@link DeleteRequestOptions}.\n *\n * @summary Read-only view of a `deleteRecord` request as a handler receives it, with immutable headers and `records`\n * as resource keys.\n */\nexport type ImmutableDeleteRequestOptions = ImmutableRequest<DeleteRequestOptions>;\n/**\n * The immutable, handler-facing form of {@link UpdateRequestOptions}.\n *\n * @summary Read-only view of an `updateRecord` request as a handler receives it, with immutable headers and `records`\n * as resource keys.\n */\nexport type ImmutableUpdateRequestOptions = ImmutableRequest<UpdateRequestOptions>;\n/**\n * The immutable, handler-facing form of {@link CreateRequestOptions}.\n *\n * @summary Read-only view of a `createRecord` request as a handler receives it, with immutable headers and `records`\n * as resource keys.\n */\nexport type ImmutableCreateRequestOptions = ImmutableRequest<CreateRequestOptions>;\n\n/**\n * A minimal reference to a resource sufficient to build a URL for it,\n * as accepted by the request builders.\n *\n * @summary A resource reference with a persisted `id` and `type` and an optional `lid`, which is enough for request\n * builders to construct its url.\n */\nexport type RemotelyAccessibleIdentifier<T extends string = string> = {\n /**\n * the resource's persisted id\n */\n id: string;\n /**\n * the resource's type\n */\n type: T;\n /**\n * the local identifier WarpDrive has assigned to the resource, if known\n */\n lid?: string;\n};\n\n/**\n * Options accepted by the request builders for constraining how a\n * request's url is constructed and how the request interacts with the cache.\n *\n * @summary Options the request builders accept to set reload behavior and override the url's host, namespace, resource\n * path, and query param serialization.\n */\nexport interface ConstrainedRequestOptions {\n /**\n * If true, the request will be made even if a cached response is present\n * and not expired.\n */\n reload?: boolean;\n /**\n * If true, and a cached response is present and not expired, the request\n * will be made in the background and the cached response will be returned.\n */\n backgroundReload?: boolean;\n /**\n * The host to use when constructing the request's url, overriding any\n * host configured via `setBuildURLConfig`.\n */\n host?: string;\n /**\n * The namespace to use when constructing the request's url, overriding\n * any namespace configured via `setBuildURLConfig`.\n */\n namespace?: string;\n /**\n * The resource path to use when constructing the request's url,\n * overriding the default of pluralizing the resource's type.\n */\n resourcePath?: string;\n /**\n * Options for how to serialize the request's query params, see {@link QueryParamsSerializationOptions}.\n */\n urlParamsSettings?: QueryParamsSerializationOptions;\n}\n\n/**\n * Options accepted by the `findRecord` request builders.\n *\n * @summary Options the `findRecord` request builders accept: the shared url and reload options plus the relationship\n * paths to `include`.\n */\nexport interface FindRecordOptions extends ConstrainedRequestOptions {\n /**\n * the relationship paths to sideload, see {@link Includes}\n */\n include?: string | string[];\n}\n\n/**\n * When a {@link Future} resolves, it returns an object\n * containing the original {@link RequestInfo | request},\n * the {@link Response | response} set by the handler chain (if any), and\n * the processed content.\n *\n * @summary The `{ request, response, content }` object that a request's `Future` resolves with when the request\n * succeeds.\n */\nexport interface StructuredDataDocument<T> {\n /**\n * @private\n */\n [STRUCTURED]?: true;\n /**\n * @see {@link ImmutableRequestInfo}\n */\n request: ImmutableRequestInfo;\n /**\n * the response set by the handler chain, if any\n */\n response: Response | ResponseInfo | null;\n /**\n * the processed content of the response\n */\n content: T;\n}\n\n/**\n * When a {@link Future} rejects, it throws either an {@link Error}\n * an {@link AggregateError} or a {@link DOMException} that maintains\n * the `{ request, response, content }` shape but is also an Error instance\n * itself.\n *\n * If using the error originates from the {@link Fetch | Fetch Handler}\n * the error will be a {@link FetchError}\n *\n * @summary The Error a request's `Future` rejects with when the request fails, carrying the `request`, `response`,\n * `error`, and any `content` received.\n */\nexport interface StructuredErrorDocument<T = unknown> extends Error {\n /**\n * @private\n */\n [STRUCTURED]?: true;\n /**\n * @see {@link ImmutableRequestInfo}\n */\n request: ImmutableRequestInfo;\n /**\n * the response set by the handler chain, if any\n */\n response: Response | ResponseInfo | null;\n /**\n * the error that caused the request to fail\n */\n error: string | object;\n /**\n * the processed content of the response, if any was received before the failure\n */\n content?: T;\n}\n\n/**\n * A union of the resolve/reject data types for the {@link Future}\n * returned by {@link Store.request | request}\n *\n * The [Using The Response](/guides/the-manual/requests/using-the-response) guide shows\n * how to read one.\n *\n * See also the docs for:\n *\n * - {@link Future}\n * - {@link StructuredDataDocument} (resolved/successful requests)\n * - {@link StructuredErrorDocument} (rejected/failed requests)\n *\n * @summary Union of the success and error documents that a request's `Future` resolves or rejects with.\n */\nexport type StructuredDocument<T> = StructuredDataDocument<T> | StructuredErrorDocument<T>;\n\n/**\n * The {@link RequestInit} interface accepted by the native {@link fetch} API.\n *\n * WarpDrive provides our own typings due to incompleteness in the native typings.\n *\n * @privateRemarks\n * - [MDN Reference (fetch)](https://developer.mozilla.org/docs/Web/API/Window/fetch)\n * - [MDN Reference (RequestInit)](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit)\n * - [MDN Reference (Request)](https://developer.mozilla.org/docs/Web/API/Request)\n *\n */\ninterface NativeRequestInit {\n /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.\n */\n cache?: RequestCache;\n /** Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.\n */\n credentials?: RequestCredentials;\n /** Returns the kind of resource requested by request, e.g., \"document\" or \"script\".\n */\n destination?: RequestDestination;\n /** Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the \"Host\" header.\n */\n headers?: Headers;\n /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]\n */\n integrity?: string;\n /** Returns a boolean indicating whether or not request can outlive the global in which it was created.\n */\n keepalive?: boolean;\n /** Returns request's HTTP method, which is \"GET\" by default.\n */\n method?: HTTPMethod;\n /** Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.\n *\n * `no-cors` is not allowed for streaming request bodies.\n *\n */\n mode?: RequestMode;\n /**\n * provides an explicit priority hint for the request.\n */\n priority?: RequestPriority;\n /** Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.\n */\n redirect?: RequestRedirect;\n /** Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and \"about:client\" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.\n */\n referrer?: string;\n /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.\n */\n referrerPolicy?: ReferrerPolicy;\n /** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.\n */\n signal?: AbortSignal;\n /** Returns the URL of request as a string.\n */\n url?: string;\n /** Any body that you want to add to your request. Note that a GET or HEAD request may not have a body.\n */\n body?: BodyInit | null;\n\n /**\n * When sending a ReadableStream as the body of a request, 'half' must be\n * specified.\n *\n * [Half Duplex Further Reading](https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests#half_duplex)\n *\n */\n duplex?: 'half';\n}\n\n/**\n * A read-only {@link Headers} instance, as passed to {@link Handler | Handlers}\n * via {@link ImmutableRequestInfo.headers}.\n *\n * @summary Read-only `Headers` that handlers see on a request, adding `toJSON` to serialize them as `[key, value]`\n * pairs and an optional mutable `clone`.\n */\nexport interface ImmutableHeaders extends Headers {\n /**\n * Returns a mutable clone of these headers, if supported by the implementation.\n */\n clone?(): Headers;\n /**\n * Returns the headers as an array of `[key, value]` pairs.\n */\n toJSON(): [string, string][];\n}\n\n/**\n * Extends JavaScript's native {@link fetch} {@link NativeRequestInit | RequestInit} with additional\n * properties specific to the {@link RequestManager | RequestManager's} capabilities.\n *\n * This interface is used to define the shape of a request that can be made via\n * either the {@link RequestManager.request} or {@link Store.request} methods.\n *\n * The [Making Requests](/guides/the-manual/requests/#request-options) guide explains\n * its options.\n *\n * @summary Describes a request for `store.request` or `RequestManager.request`: native fetch options plus cache\n * options, operation name, records, data, and the store.\n * @privateRemarks\n * - [MDN Reference (fetch)](https://developer.mozilla.org/docs/Web/API/Window/fetch)\n * - [MDN Reference (RequestInit)](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit)\n * - [MDN Reference (Request)](https://developer.mozilla.org/docs/Web/API/Request)\n *\n * @public\n * @since 4.12\n */\nexport interface RequestInfo<RT = unknown> extends NativeRequestInit {\n /**\n * If provided, used instead of the AbortController auto-configured for each request by the RequestManager\n *\n */\n controller?: AbortController;\n\n /**\n * @see {@link CacheOptions}\n */\n cacheOptions?: CacheOptions;\n /**\n * The {@link Store} the request was made against, if made via\n * {@link Store.request} rather than directly against a {@link RequestManager}.\n *\n * A {@link Handler} can read this off of {@link RequestContext.request | context.request}\n * to reach store state (the cache, other services attached to a custom\n * store subclass, etc.) without needing any Ember DI/`setOwner` wiring at\n * handler-construction time. This works for a handler of any shape (a\n * function, plain object, or class) because the store is attached to each\n * request individually rather than to the handler itself.\n *\n * The trade-off is that this is only populated for requests issued via\n * {@link Store.request | store.request(...)}; a request issued directly\n * against a {@link RequestManager} will not have it set unless the caller\n * supplies it explicitly. Handlers that rely on it should treat it as\n * optional.\n *\n * @example\n * ```ts\n * const LoggingHandler = {\n * request<T>(context: RequestContext, next: NextFn<T>) {\n * const store = context.request.store;\n * if (store) {\n * console.log(`[${store.constructor.name}] ${context.request.url ?? ''}`);\n * }\n * return next(context.request);\n * },\n * };\n * ```\n */\n store?: Store;\n\n /**\n * The name of the request operation, if any (e.g. `'findRecord'`, `'query'`).\n */\n op?: string;\n\n /**\n * The {@link ResourceKey | ResourceKeys} of the primary resources involved in the request\n * (if any). This may be used by handlers to perform transactional\n * operations on the store.\n *\n */\n records?: ResourceKey[];\n\n /**\n * If true, this request will not be tracked by test waiters.\n */\n disableTestWaiter?: boolean;\n /**\n * data that a handler should convert into\n * the query (GET) or body (POST).\n *\n * Note: It is recommended that builders set query params\n * and body directly in most scenarios.\n *\n */\n data?: Record<string, unknown>;\n /**\n * options specifically intended for {@link Handler | Handlers}\n * to utilize to process the request\n *\n */\n options?: Record<string, unknown>;\n\n /**\n * @private used only to carry the response type for type inference purposes\n */\n [RequestSignature]?: RT;\n\n /**\n * see {@link EnableHydration}\n */\n [EnableHydration]?: boolean;\n}\n\n/**\n * Immutable version of {@link RequestInfo}. This is what is passed to handlers.\n *\n * @summary Read-only form of a request as handlers receive it, with frozen headers, data, options, and cache options\n * and no `controller`.\n */\nexport type ImmutableRequestInfo<RT = unknown> = Readonly<Omit<RequestInfo<RT>, 'controller'>> & {\n /**\n * see {@link CacheOptions}\n */\n readonly cacheOptions?: Readonly<CacheOptions>;\n /**\n * see {@link ImmutableHeaders}\n */\n readonly headers?: ImmutableHeaders;\n /**\n * see {@link RequestInfo.data}\n */\n readonly data?: Readonly<Record<string, unknown>>;\n /**\n * see {@link RequestInfo.options}\n */\n readonly options?: Readonly<Record<string, unknown>>;\n\n /** Whether the request body has been read.\n */\n readonly bodyUsed?: boolean;\n};\n\n/**\n * An immutable, JSON-serializable subset of the native {@link Response}\n * interface.\n *\n * @summary Immutable, JSON-serializable snapshot of a fetch `Response`'s headers, status, url, and type, usable in\n * place of a `Response` in request results.\n */\nexport interface ResponseInfo {\n /**\n * see {@link ImmutableHeaders}\n */\n readonly headers: ImmutableHeaders; // to do, maybe not this?\n /**\n * whether the response's status code was in the 200-299 range\n */\n readonly ok: boolean;\n /**\n * whether the response is the result of a redirect\n */\n readonly redirected: boolean;\n /**\n * the response's HTTP status code\n */\n readonly status: number;\n /**\n * the status message associated with the response's status code\n */\n readonly statusText: string;\n /**\n * the type of the response, see [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)\n */\n readonly type: ResponseType;\n /**\n * the url of the response\n */\n readonly url: string;\n}\n\n/**\n * The object a {@link Handler} uses to fulfill a request: it provides a\n * readonly view of the {@link RequestContext.request | request} and methods\n * for supplying the {@link Future}'s stream and final response.\n *\n * The [Handlers](/guides/the-manual/requests/handlers) guide shows a handler using it.\n *\n * @summary Object passed to each request handler with the immutable request, a request id, and methods for setting the\n * response stream and the response.\n */\nexport interface RequestContext {\n /**\n * @see {@link ImmutableRequestInfo}\n */\n request: ImmutableRequestInfo;\n /**\n * a unique id for this request\n */\n id: number;\n\n /**\n * Supplies the stream of the response's content, if available, enabling\n * consumers to monitor download progress via {@link RequestLoadingState}.\n */\n setStream(stream: ReadableStream | Promise<ReadableStream | null>): void;\n /**\n * Supplies the response for the request.\n */\n setResponse(response: Response | ResponseInfo | null): void;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmCA,MAAaE,YAA6CD,kBAAkB,aAAaE,OAAOC,IAAI,eAAe,CAAC;;;;;;;;;AASpH,MAAaC,kBAAyDJ,kBACpE,mBACAE,OAAOC,IAAI,qBAAqB,CAClC;;;;AAIA,MAAaE,YAA6CN,eAAe,aAAaG,OAAO,WAAW,CAAC;;;;AAIzG,MAAaI,aAAwCP,eAAe,OAAOG,OAAO,KAAK,CAAC"}
@@ -1,11 +1,25 @@
1
1
  //#region src/types/schema/fields.ts
2
2
  /**
3
+ * The [Schemas](/guides/the-manual/schemas/) guide teaches how these schemas and
4
+ * fields fit together.
5
+ *
6
+ * @module
7
+ * @summary Types for every field schema kind and for PolarisMode and LegacyMode resource, object and trait schemas,
8
+ * plus the `resourceSchema` and `objectSchema` helpers and type guards.
9
+ */
10
+ /**
3
11
  * Options signature for Legacy Attributes.
12
+ *
13
+ * @summary Options object on a legacy `attribute` field schema, holding a `defaultValue` (a primitive or a function
14
+ * producing one) plus any transform-specific options.
4
15
  */
5
16
  /**
6
17
  * A generic "field" that can be used to define
7
18
  * primitive value fields.
8
19
  *
20
+ * The [SimpleFields](/guides/the-manual/schemas/simple-fields) guide shows how to
21
+ * define them.
22
+ *
9
23
  * Replaces "attribute" for primitive value fields.
10
24
  * Can also be used to eject from deep-tracking of
11
25
  * objects or arrays.
@@ -16,6 +30,8 @@
16
30
  * "type" points to a new-style transform on "field"
17
31
  * that a record implmentation *must* use.
18
32
  *
33
+ * @summary Field schema of kind `field` for a primitive value, optionally converted by a registered `Transformation`;
34
+ * objects and arrays in it are not deep-tracked.
19
35
  * @public
20
36
  */
21
37
  /**
@@ -44,6 +60,8 @@
44
60
  * an AliasField could be used to expose both a string and a Date version of the
45
61
  * same field, with both being capable of being written to.
46
62
  *
63
+ * @summary Field schema of kind `alias` for LegacyMode resources that exposes another field's cache value, including
64
+ * legacy attributes and relationships, under a new name.
47
65
  * @public
48
66
  */
49
67
  /**
@@ -72,6 +90,8 @@
72
90
  * an AliasField could be used to expose both a string and a Date version of the
73
91
  * same field, with both being capable of being written to.
74
92
  *
93
+ * @summary Field schema of kind `alias` for PolarisMode resources that exposes another field's cache value, including
94
+ * LinksMode relationships, under a new name.
75
95
  * @public
76
96
  */
77
97
  /**
@@ -100,12 +120,17 @@
100
120
  * an AliasField could be used to expose both a string and a Date version of the
101
121
  * same field, with both being capable of being written to.
102
122
  *
123
+ * @summary Field schema of kind `alias` for object schemas that exposes another non-relationship field's cache value
124
+ * under a new name.
103
125
  * @public
104
126
  */
105
127
  /**
106
128
  * Represents a field whose value is the primary
107
129
  * key of the resource.
108
130
  *
131
+ * The [ResourceSchemas](/guides/the-manual/schemas/resources/) guide shows where it
132
+ * sits in a schema.
133
+ *
109
134
  * This allows any field to serve as the primary
110
135
  * key while still being able to drive identity
111
136
  * needs within the system.
@@ -114,6 +139,8 @@
114
139
  * 'uuid', 'urn' or 'entityUrn' or 'primaryKey' as their
115
140
  * primary key field instead of 'id'.
116
141
  *
142
+ * @summary Field schema of kind `@id` naming which field holds a resource's primary key, with an optional `sourceKey`
143
+ * when the API uses another name like `uuid`.
117
144
  * @public
118
145
  */
119
146
  /**
@@ -137,6 +164,8 @@
137
164
  * it should be placed in the `ResourceSchema`'s `@id` field
138
165
  * in place of an `IdentityField`.
139
166
  *
167
+ * @summary Field schema of kind `@hash` that computes a schema-object's identity from its cache data using a registered
168
+ * hash function.
140
169
  * @public
141
170
  */
142
171
  /**
@@ -166,6 +195,8 @@
166
195
  *
167
196
  * Don't make us regret this decision.
168
197
  *
198
+ * @summary Field schema of kind `@local` for memoized, writable per-record state that is never cached or sent to the
199
+ * server; currently private to built-in fields.
169
200
  * @public
170
201
  */
171
202
  /**
@@ -177,6 +208,8 @@
177
208
  * if the key/value pairs have well-defined shape,
178
209
  * use 'schema-object' instead.
179
210
  *
211
+ * @summary Field schema of kind `object` for a plain object of primitive values, optionally passed as a whole through a
212
+ * registered transformation.
180
213
  * @public
181
214
  */
182
215
  /**
@@ -184,11 +217,16 @@
184
217
  * with a well-defined structure described by
185
218
  * a schema-object (a non-resource schema).
186
219
  *
220
+ * The [Complex Fields](/guides/the-manual/schemas/complex-fields#schema-objects) guide
221
+ * shows how to use it.
222
+ *
187
223
  * If the object's structure is not well-defined,
188
224
  * use 'object' instead.
189
225
  *
190
226
  * By default, a SchemaObject within
191
227
  *
228
+ * @summary Field schema of kind `schema-object` for a nested object whose shape is described by an `ObjectSchema`, with
229
+ * optional polymorphism.
192
230
  * @public
193
231
  */
194
232
  /**
@@ -198,6 +236,8 @@
198
236
  * If the array's elements are not primitive
199
237
  * values, use 'schema-array' instead.
200
238
  *
239
+ * @summary Field schema of kind `array` for an array of primitive values, each optionally passed through a registered
240
+ * transformation.
201
241
  * @public
202
242
  */
203
243
  /**
@@ -205,15 +245,23 @@
205
245
  * of objects with a well-defined structure
206
246
  * described by a non-resource schema.
207
247
  *
248
+ * The [Complex Fields](/guides/the-manual/schemas/complex-fields#schema-arrays) guide
249
+ * shows how to use it.
250
+ *
208
251
  * If the array's elements are not well-defined,
209
252
  * use 'array' instead.
210
253
  *
254
+ * @summary Field schema of kind `schema-array` for an array of objects described by an `ObjectSchema`, with options for
255
+ * member identity keys and polymorphism.
211
256
  * @public
212
257
  */
213
258
  /**
214
259
  * Represents a field whose value is derived
215
260
  * from other fields in the schema.
216
261
  *
262
+ * The [Derivations](/guides/the-manual/schemas/derivations) guide explains when to
263
+ * use one and how to register its derivation.
264
+ *
217
265
  * The value is read-only, and is not stored
218
266
  * in the cache, nor is it sent to the server.
219
267
  *
@@ -224,15 +272,24 @@
224
272
  * or that require access to related resources
225
273
  * that may not be loaded should be avoided.
226
274
  *
275
+ * @summary Field schema of kind `derived` for a read-only, memoized value computed by a registered derivation and never
276
+ * cached or sent to the server.
227
277
  * @public
228
278
  */
229
279
  /**
230
280
  * Represents a field that is a reference to
231
281
  * another resource.
232
282
  *
233
- * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED
234
- * BY ReactiveResource
283
+ * SUPPORT FOR THIS FEATURE IS NOT YET COMPLETE
284
+ * IN ReactiveResource. It is not yet part of
285
+ * {@link PolarisModeFieldSchema} or {@link LegacyModeFieldSchema}.
286
+ * Reading the field returns an object with the related
287
+ * record as `data`, plus `links`, `meta` and a `fetch()`
288
+ * method, but it does not yet update when the
289
+ * relationship changes, and setting it is not supported.
235
290
  *
291
+ * @summary Field schema of kind `resource` for a reference to another resource; not yet implemented by
292
+ * `ReactiveResource`.
236
293
  * @public
237
294
  */
238
295
  /**
@@ -241,8 +298,13 @@
241
298
  * paginate.
242
299
  *
243
300
  * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED
244
- * BY ReactiveResource
301
+ * BY ReactiveResource. It is not yet part of
302
+ * {@link PolarisModeFieldSchema} or {@link LegacyModeFieldSchema},
303
+ * and reading or setting the field fails an assertion
304
+ * in development builds.
245
305
  *
306
+ * @summary Field schema of kind `collection` for a possibly paginated reference to other resources; not yet implemented
307
+ * by `ReactiveResource`.
246
308
  * @public
247
309
  */
248
310
  /**
@@ -256,10 +318,15 @@
256
318
  * If the field points to an object or array,
257
319
  * it will not be deep-tracked.
258
320
  *
321
+ * The [LegacyMode](/guides/the-manual/schemas/resources/legacy-mode#defining-legacy-schemas)
322
+ * guide shows how to use it.
323
+ *
259
324
  * Transforms when defined are legacy transforms
260
325
  * that a serializer *might* use, but their usage
261
326
  * is not guaranteed.
262
327
  *
328
+ * @summary Legacy field schema of kind `attribute` for a primitive value whose `type` names a legacy transform a
329
+ * serializer may apply; LegacyMode only.
263
330
  * @public
264
331
  */
265
332
  /**
@@ -271,6 +338,11 @@
271
338
  *
272
339
  * This is the legacy version of the `ResourceField`.
273
340
  *
341
+ * The [LegacyMode](/guides/the-manual/schemas/resources/legacy-mode#defining-legacy-schemas)
342
+ * guide shows how to use it.
343
+ *
344
+ * @summary Legacy field schema of kind `belongsTo` for a reference to one related resource, with required `async` and
345
+ * `inverse` options and optional `linksMode`.
274
346
  * @public
275
347
  */
276
348
  /**
@@ -282,6 +354,8 @@
282
354
  *
283
355
  * This is the legacy version of the `ResourceField`.
284
356
  *
357
+ * @summary Legacy field schema of kind `belongsTo` in LinksMode: a sync reference to one related resource, loaded via
358
+ * links without adapters, usable in PolarisMode.
285
359
  * @public
286
360
  */
287
361
  /**
@@ -293,6 +367,11 @@
293
367
  *
294
368
  * This is the legacy version of the `CollectionField`.
295
369
  *
370
+ * The [LegacyMode](/guides/the-manual/schemas/resources/legacy-mode#defining-legacy-schemas)
371
+ * guide shows how to use it.
372
+ *
373
+ * @summary Legacy field schema of kind `hasMany` for a reference to many related resources, with required `async` and
374
+ * `inverse` options and optional `linksMode`.
296
375
  * @public
297
376
  */
298
377
  /**
@@ -304,6 +383,8 @@
304
383
  *
305
384
  * This is the legacy version of the `CollectionField`.
306
385
  *
386
+ * @summary Legacy field schema of kind `hasMany` in LinksMode: a sync reference to many related resources, loaded via
387
+ * links without adapters, usable in PolarisMode.
307
388
  * @public
308
389
  */
309
390
  /**
@@ -325,6 +406,8 @@
325
406
  * - {@link LegacyBelongsToField}
326
407
  * - {@link LegacyHasManyField}
327
408
  *
409
+ * @summary Union of every field schema allowed on a LegacyMode resource schema, including legacy attribute, belongsTo,
410
+ * and hasMany fields.
328
411
  * @public
329
412
  */
330
413
  /**
@@ -345,6 +428,8 @@
345
428
  * - {@link LinksModeBelongsToField}
346
429
  * - {@link LinksModeHasManyField}
347
430
  *
431
+ * @summary Union of every field schema allowed on a PolarisMode resource schema, with relationships limited to their
432
+ * LinksMode forms.
348
433
  * @public
349
434
  */
350
435
  /**
@@ -356,6 +441,8 @@
356
441
  * as appropriate as they are more specific and will
357
442
  * provide better guidance around what is valid.
358
443
  *
444
+ * @summary Union of every LegacyMode and PolarisMode field schema; prefer the mode-specific unions for more precise
445
+ * type-checking.
359
446
  * @public
360
447
  */
361
448
  /**
@@ -366,12 +453,14 @@
366
453
  * In other words this will not include types like alias
367
454
  * fields, local fields, or derived fields.
368
455
  *
456
+ * @summary Union of the field schemas whose values live in the cache, excluding alias, local, and derived fields.
369
457
  * @public
370
458
  */
371
459
  /**
372
460
  * A union of all possible field schemas that can be
373
461
  * used in an ObjectSchema.
374
462
  *
463
+ * @summary Union of the field schemas allowed in an `ObjectSchema`, which excludes identity and relationship fields.
375
464
  * @public
376
465
  */
377
466
  /**
@@ -381,15 +470,22 @@
381
470
  * own which may allow them to appear in relationships, or in multiple
382
471
  * response documents.
383
472
  *
473
+ * @summary Schema describing a PolarisMode resource type: its `@id` identity field, its fields, and the traits it
474
+ * implements.
384
475
  * @public
385
476
  */
386
477
  /**
387
478
  * Represents a schema for a primary resource in LegacyMode
388
479
  *
480
+ * The [LegacyMode](/guides/the-manual/schemas/resources/legacy-mode#defining-legacy-schemas)
481
+ * guide shows how to define one.
482
+ *
389
483
  * Primary resources are objects with a unique identity of their
390
484
  * own which may allow them to appear in relationships, or in multiple
391
485
  * response documents.
392
486
  *
487
+ * @summary Schema describing a LegacyMode resource type, marked `legacy: true`, with its identity field, fields,
488
+ * traits, and optional extensions.
393
489
  * @public
394
490
  */
395
491
  /**
@@ -397,24 +493,36 @@
397
493
  * definition for either a PolarisMode or a
398
494
  * LegacyMode resource.
399
495
  *
496
+ * The [ResourceSchemas](/guides/the-manual/schemas/resources/) guide shows how to
497
+ * create and register one.
498
+ *
400
499
  * Note, this is separate from the type returned
401
500
  * by the SchemaService which provides fields as a Map
402
501
  * instead of as an Array.
403
502
  *
503
+ * @summary Union of the PolarisMode and LegacyMode schema definitions for a primary resource type, as registered with
504
+ * the schema service.
404
505
  * @public
405
506
  */
406
507
  /**
407
508
  * Represents a schema for an object that is not
408
509
  * a primary resource (has no unique identity of its own).
409
510
  *
511
+ * The [ObjectSchemas](/guides/the-manual/schemas/object-schemas) guide shows how to
512
+ * define and register one.
513
+ *
410
514
  * ObjectSchemas may not currently contain relationships.
411
515
  *
516
+ * @summary Schema describing an embedded object that has no identity of its own, used by `schema-object` and
517
+ * `schema-array` fields.
412
518
  * @public
413
519
  */
414
520
  /**
415
521
  * A union of {@link ResourceSchema} and {@link ObjectSchema} representing
416
522
  * any schema that can be registered with or returned by the SchemaService.
417
523
  *
524
+ * @summary Union of resource and object schemas, covering any schema that can be registered with or returned by the
525
+ * schema service.
418
526
  * @public
419
527
  */
420
528
  /**
@@ -423,6 +531,9 @@
423
531
  * Traits are reusable collections of fields that can be composed onto a
424
532
  * resource schema, often to describe a polymorphic capability shared by
425
533
  * multiple resource types.
534
+ *
535
+ * @summary A named, reusable set of PolarisMode fields that resource schemas compose in via their `traits`, often to
536
+ * model polymorphic capabilities.
426
537
  */
427
538
  /**
428
539
  * A trait for use on a LegacyMode record.
@@ -430,11 +541,19 @@
430
541
  * Traits are reusable collections of fields that can be composed onto a
431
542
  * resource schema, often to describe a polymorphic capability shared by
432
543
  * multiple resource types.
544
+ *
545
+ * @summary A named, reusable set of LegacyMode fields that resource schemas compose in via their `traits`, often to
546
+ * model polymorphic capabilities.
433
547
  */
434
548
  /**
435
549
  * A union of
436
550
  * - {@link LegacyTrait}
437
551
  * - {@link PolarisTrait}
552
+ *
553
+ * The [Traits](/guides/the-manual/schemas/traits) guide shows how to create, register
554
+ * and use one.
555
+ *
556
+ * @summary Union of the LegacyMode and PolarisMode trait definitions that can be registered with the schema service.
438
557
  */
439
558
  /**
440
559
  * A no-op type utility that enables type-checking resource schema
@@ -446,6 +565,8 @@
446
565
  * as doing so would require a full schema graph to be passed in
447
566
  * and no cycles in the graph to be present.
448
567
  *
568
+ * @summary Returns the given resource schema unchanged, typed so its definition is type-checked; relationship inverses
569
+ * and related types are not validated.
449
570
  * @public
450
571
  */
451
572
  function resourceSchema(schema) {
@@ -457,6 +578,7 @@ function resourceSchema(schema) {
457
578
  *
458
579
  * Will return the passed in schema.
459
580
  *
581
+ * @summary Returns the given object schema unchanged, typed so its definition is type-checked.
460
582
  * @public
461
583
  */
462
584
  function objectSchema(schema) {
@@ -465,6 +587,8 @@ function objectSchema(schema) {
465
587
  /**
466
588
  * A type utility to narrow a schema to a ResourceSchema
467
589
  *
590
+ * @summary Type guard that returns true when a schema is a resource schema, meaning its identity field is of kind
591
+ * `@id`.
468
592
  * @public
469
593
  */
470
594
  function isResourceSchema(schema) {
@@ -473,6 +597,8 @@ function isResourceSchema(schema) {
473
597
  /**
474
598
  * A type utility to narrow a schema to LegacyResourceSchema
475
599
  *
600
+ * @summary Type guard that returns true when a schema is a LegacyMode resource schema, meaning it is a resource schema
601
+ * with `legacy: true`.
476
602
  * @public
477
603
  */
478
604
  function isLegacyResourceSchema(schema) {
@@ -491,6 +617,8 @@ function isLegacyResourceSchema(schema) {
491
617
  * - {@link LinksModeBelongsToField}
492
618
  * - {@link LinksModeHasManyField}
493
619
  *
620
+ * @summary Union of the legacy attribute, belongsTo, and hasMany field schemas, including the LinksMode relationship
621
+ * variants.
494
622
  * @public
495
623
  */
496
624
  /**
@@ -504,6 +632,7 @@ function isLegacyResourceSchema(schema) {
504
632
  * - {@link LinksModeBelongsToField}
505
633
  * - {@link LinksModeHasManyField}
506
634
  *
635
+ * @summary Union of the legacy belongsTo and hasMany field schemas, including their LinksMode variants.
507
636
  * @public
508
637
  */
509
638
  //#endregion