@warp-drive/core 5.9.0-beta.1 → 5.9.0-beta.3

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 (277) hide show
  1. package/dist/-private-BL9zXgJB.js +3530 -0
  2. package/dist/-private-BL9zXgJB.js.map +1 -0
  3. package/dist/{-private-DMzvF_Q6.js → -private-Cxa8cMBj.js} +2 -2
  4. package/dist/-private-Cxa8cMBj.js.map +1 -0
  5. package/dist/{unpkg/dev-deprecated/-private-DL4tfrv9.js → -private-xK1KgxZJ.js} +2 -2
  6. package/dist/{-private-b1g4dhl0.js.map → -private-xK1KgxZJ.js.map} +1 -1
  7. package/{declarations/concepts-LHsLJZMl.d.ts → dist/concepts-DFldVwEM.d.ts} +2 -2
  8. package/{declarations/concepts-LHsLJZMl.d.ts.map → dist/concepts-DFldVwEM.d.ts.map} +1 -1
  9. package/dist/configure.js +1 -1
  10. package/dist/graph/-private.d.ts +2 -0
  11. package/dist/graph/-private.js +46 -33
  12. package/dist/graph/-private.js.map +1 -1
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.js +1 -1
  15. package/{declarations/internal-Cz-893zD.d.ts → dist/internal-DtWOpxrR.d.ts} +2763 -2271
  16. package/dist/internal-DtWOpxrR.d.ts.map +1 -0
  17. package/dist/reactive/-private.d.ts +2 -0
  18. package/dist/reactive/-private.js +1 -1
  19. package/dist/reactive.d.ts +2 -0
  20. package/dist/reactive.js +3 -3
  21. package/{declarations → dist}/record-D3QQcaIR.d.ts.map +1 -1
  22. package/dist/{request--vRFALbQ.js → request-z2NByNx0.js} +2 -2
  23. package/dist/request-z2NByNx0.js.map +1 -0
  24. package/dist/request.d.ts +2 -0
  25. package/dist/request.js +1 -1
  26. package/dist/signals/-leaked.d.ts +1060 -0
  27. package/dist/signals/-leaked.d.ts.map +1 -0
  28. package/dist/signals/-leaked.js +2 -2
  29. package/dist/{src-Dex_phWI.js → src-s5HHjglV.js} +192 -53
  30. package/dist/src-s5HHjglV.js.map +1 -0
  31. package/dist/store/-private.d.ts +2 -0
  32. package/dist/store/-private.js +1 -1
  33. package/dist/store-DNF9Rgoh.js.map +1 -1
  34. package/dist/store.d.ts +2 -0
  35. package/{declarations → dist}/types/-private.d.ts +1 -1
  36. package/{declarations → dist}/types/-private.d.ts.map +1 -1
  37. package/dist/types/-private.js +1 -1
  38. package/dist/types/cache.d.ts +2 -0
  39. package/dist/types/record.js.map +1 -1
  40. package/dist/types/request.d.ts +2 -0
  41. package/dist/types/request.js +1 -1
  42. package/dist/types/request.js.map +1 -1
  43. package/dist/types/runtime.js +1 -1
  44. package/dist/types/schema/concepts.d.ts +2 -0
  45. package/dist/types/schema/fields.js.map +1 -1
  46. package/dist/types/schema/schema-service.d.ts +2 -0
  47. package/dist/types/symbols.js +1 -1
  48. package/dist/types/symbols.js.map +1 -1
  49. package/{declarations → dist}/types.d.ts +1 -1
  50. package/dist/{-private-b1g4dhl0.js → unpkg/dev/-private-BGCYELwo.js} +2 -2
  51. package/dist/unpkg/{dev-deprecated/-private-DL4tfrv9.js.map → dev/-private-BGCYELwo.js.map} +1 -1
  52. package/dist/unpkg/{dev-deprecated/-private-2RfQ2761.js → dev/-private-DhiS6yOR.js} +2 -2
  53. package/dist/unpkg/dev/-private-DhiS6yOR.js.map +1 -0
  54. package/dist/unpkg/dev/-private-pNQae3qH.js +3519 -0
  55. package/dist/unpkg/dev/-private-pNQae3qH.js.map +1 -0
  56. package/dist/unpkg/dev/configure.js +1 -1
  57. package/dist/unpkg/dev/graph/-private.js +46 -33
  58. package/dist/unpkg/dev/graph/-private.js.map +1 -1
  59. package/dist/unpkg/dev/index.js +1 -1
  60. package/dist/unpkg/dev/reactive/-private.js +1 -1
  61. package/dist/unpkg/dev/reactive.js +3 -3
  62. package/dist/unpkg/{dev-deprecated/request-DAuXbfYi.js → dev/request-BbbzRou7.js} +2 -2
  63. package/dist/unpkg/dev/request-BbbzRou7.js.map +1 -0
  64. package/dist/unpkg/dev/request.js +1 -1
  65. package/dist/unpkg/dev/{runtime-EoVKAhTv.js → runtime-DoDtzXJb.js} +2 -2
  66. package/dist/unpkg/dev/runtime-DoDtzXJb.js.map +1 -0
  67. package/dist/unpkg/dev/signals/-leaked.js +2 -2
  68. package/dist/unpkg/dev/{src-Bxlr_vue.js → src-Cf7NXXR2.js} +194 -55
  69. package/dist/unpkg/dev/src-Cf7NXXR2.js.map +1 -0
  70. package/dist/unpkg/dev/store/-private.js +1 -1
  71. package/dist/unpkg/{dev-deprecated/store-TcP2H4Af.js → dev/store-DamE3C4y.js} +2 -2
  72. package/dist/unpkg/dev/store-DamE3C4y.js.map +1 -0
  73. package/dist/unpkg/dev/store.js +1 -1
  74. package/dist/unpkg/dev/types/-private.js +1 -1
  75. package/dist/unpkg/dev/types/record.js.map +1 -1
  76. package/dist/unpkg/dev/types/request.js +1 -1
  77. package/dist/unpkg/dev/types/request.js.map +1 -1
  78. package/dist/unpkg/dev/types/runtime.js +1 -1
  79. package/dist/unpkg/dev/types/schema/fields.js.map +1 -1
  80. package/dist/unpkg/dev/types/symbols.js +1 -1
  81. package/dist/unpkg/dev/types/symbols.js.map +1 -1
  82. package/dist/unpkg/{dev/-private-DL4tfrv9.js → dev-deprecated/-private-BGCYELwo.js} +2 -2
  83. package/dist/unpkg/{prod/-private-Z9i0icpE.js.map → dev-deprecated/-private-BGCYELwo.js.map} +1 -1
  84. package/dist/unpkg/{dev/-private-2RfQ2761.js → dev-deprecated/-private-DhiS6yOR.js} +2 -2
  85. package/dist/unpkg/dev-deprecated/-private-DhiS6yOR.js.map +1 -0
  86. package/dist/unpkg/dev-deprecated/-private-pNQae3qH.js +3519 -0
  87. package/dist/unpkg/dev-deprecated/-private-pNQae3qH.js.map +1 -0
  88. package/dist/unpkg/dev-deprecated/configure.js +1 -1
  89. package/dist/unpkg/dev-deprecated/graph/-private.js +47 -34
  90. package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -1
  91. package/dist/unpkg/dev-deprecated/index.js +1 -1
  92. package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -1
  93. package/dist/unpkg/dev-deprecated/reactive.js +3 -3
  94. package/dist/unpkg/{dev/request-DAuXbfYi.js → dev-deprecated/request-BbbzRou7.js} +2 -2
  95. package/dist/unpkg/dev-deprecated/request-BbbzRou7.js.map +1 -0
  96. package/dist/unpkg/dev-deprecated/request.js +1 -1
  97. package/dist/unpkg/dev-deprecated/{runtime-BacZMq1r.js → runtime-CPL2BGgT.js} +2 -2
  98. package/dist/unpkg/dev-deprecated/runtime-CPL2BGgT.js.map +1 -0
  99. package/dist/unpkg/dev-deprecated/signals/-leaked.js +2 -2
  100. package/dist/unpkg/dev-deprecated/{src-DEl2Ca3T.js → src-CSuFUXv4.js} +195 -56
  101. package/dist/unpkg/dev-deprecated/src-CSuFUXv4.js.map +1 -0
  102. package/dist/unpkg/dev-deprecated/store/-private.js +1 -1
  103. package/dist/unpkg/{dev/store-DmiFvT1B.js → dev-deprecated/store-Bsdz5mRe.js} +2 -2
  104. package/dist/unpkg/dev-deprecated/store-Bsdz5mRe.js.map +1 -0
  105. package/dist/unpkg/dev-deprecated/store.js +1 -1
  106. package/dist/unpkg/dev-deprecated/types/-private.js +1 -1
  107. package/dist/unpkg/dev-deprecated/types/record.js.map +1 -1
  108. package/dist/unpkg/dev-deprecated/types/request.js +1 -1
  109. package/dist/unpkg/dev-deprecated/types/request.js.map +1 -1
  110. package/dist/unpkg/dev-deprecated/types/runtime.js +1 -1
  111. package/dist/unpkg/dev-deprecated/types/schema/fields.js.map +1 -1
  112. package/dist/unpkg/dev-deprecated/types/symbols.js +1 -1
  113. package/dist/unpkg/dev-deprecated/types/symbols.js.map +1 -1
  114. package/dist/unpkg/prod/-private-8gd8hbwm.js +22 -0
  115. package/dist/unpkg/{prod-deprecated/-private-Z9i0icpE.js.map → prod/-private-8gd8hbwm.js.map} +1 -1
  116. package/dist/unpkg/prod/{-private-BK71-uXR.js → -private-B6aLbrgV.js} +2 -2
  117. package/dist/unpkg/prod/-private-B6aLbrgV.js.map +1 -0
  118. package/dist/unpkg/prod/-private-ggVX_Iob.js +3294 -0
  119. package/dist/unpkg/prod/-private-ggVX_Iob.js.map +1 -0
  120. package/dist/unpkg/prod/configure.js +1 -1
  121. package/dist/unpkg/prod/graph/-private.js +45 -32
  122. package/dist/unpkg/prod/graph/-private.js.map +1 -1
  123. package/dist/unpkg/prod/index.js +1 -1
  124. package/dist/unpkg/prod/reactive/-private.js +1 -1
  125. package/dist/unpkg/prod/reactive.js +3 -3
  126. package/dist/unpkg/prod/{request-BcJNzSgv.js → request-BoeppjDj.js} +2 -2
  127. package/dist/unpkg/prod/request-BoeppjDj.js.map +1 -0
  128. package/dist/unpkg/prod/request.js +1 -1
  129. package/dist/unpkg/prod/signals/-leaked.js +2 -2
  130. package/dist/unpkg/prod/{src-Dzz-j6pp.js → src-C0wuASrN.js} +196 -53
  131. package/dist/unpkg/prod/src-C0wuASrN.js.map +1 -0
  132. package/dist/unpkg/prod/store/-private.js +1 -1
  133. package/dist/unpkg/prod/store-BWhmb7Ob.js.map +1 -1
  134. package/dist/unpkg/prod/types/-private.js +1 -1
  135. package/dist/unpkg/prod/types/record.js.map +1 -1
  136. package/dist/unpkg/prod/types/request.js +1 -1
  137. package/dist/unpkg/prod/types/request.js.map +1 -1
  138. package/dist/unpkg/prod/types/runtime.js +1 -1
  139. package/dist/unpkg/prod/types/schema/fields.js.map +1 -1
  140. package/dist/unpkg/prod/types/symbols.js +1 -1
  141. package/dist/unpkg/prod/types/symbols.js.map +1 -1
  142. package/dist/unpkg/prod-deprecated/{-private-Z9i0icpE.js → -private-8gd8hbwm.js} +2 -2
  143. package/dist/unpkg/{dev/-private-DL4tfrv9.js.map → prod-deprecated/-private-8gd8hbwm.js.map} +1 -1
  144. package/dist/unpkg/prod-deprecated/{-private-BK71-uXR.js → -private-B6aLbrgV.js} +2 -2
  145. package/dist/unpkg/prod-deprecated/-private-B6aLbrgV.js.map +1 -0
  146. package/dist/unpkg/prod-deprecated/-private-ggVX_Iob.js +3294 -0
  147. package/dist/unpkg/prod-deprecated/-private-ggVX_Iob.js.map +1 -0
  148. package/dist/unpkg/prod-deprecated/configure.js +1 -1
  149. package/dist/unpkg/prod-deprecated/graph/-private.js +46 -35
  150. package/dist/unpkg/prod-deprecated/graph/-private.js.map +1 -1
  151. package/dist/unpkg/prod-deprecated/index.js +1 -1
  152. package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -1
  153. package/dist/unpkg/prod-deprecated/reactive.js +3 -3
  154. package/dist/unpkg/prod-deprecated/{request-BcJNzSgv.js → request-BoeppjDj.js} +2 -2
  155. package/dist/unpkg/prod-deprecated/request-BoeppjDj.js.map +1 -0
  156. package/dist/unpkg/prod-deprecated/request.js +1 -1
  157. package/dist/unpkg/prod-deprecated/signals/-leaked.js +2 -2
  158. package/dist/unpkg/prod-deprecated/{src-BOifHFQ5.js → src-BXOgNqmz.js} +197 -54
  159. package/dist/unpkg/prod-deprecated/src-BXOgNqmz.js.map +1 -0
  160. package/dist/unpkg/prod-deprecated/store/-private.js +1 -1
  161. package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +1 -1
  162. package/dist/unpkg/prod-deprecated/types/-private.js +1 -1
  163. package/dist/unpkg/prod-deprecated/types/record.js.map +1 -1
  164. package/dist/unpkg/prod-deprecated/types/request.js +1 -1
  165. package/dist/unpkg/prod-deprecated/types/request.js.map +1 -1
  166. package/dist/unpkg/prod-deprecated/types/runtime.js +1 -1
  167. package/dist/unpkg/prod-deprecated/types/schema/fields.js.map +1 -1
  168. package/dist/unpkg/prod-deprecated/types/symbols.js +1 -1
  169. package/dist/unpkg/prod-deprecated/types/symbols.js.map +1 -1
  170. package/package.json +15 -19
  171. package/declarations/graph/-private.d.ts +0 -2
  172. package/declarations/index.d.ts +0 -2
  173. package/declarations/internal-Cz-893zD.d.ts.map +0 -1
  174. package/declarations/reactive/-private.d.ts +0 -2
  175. package/declarations/reactive.d.ts +0 -2
  176. package/declarations/request.d.ts +0 -2
  177. package/declarations/signals/-leaked.d.ts +0 -63
  178. package/declarations/signals/-leaked.d.ts.map +0 -1
  179. package/declarations/store/-private.d.ts +0 -2
  180. package/declarations/store.d.ts +0 -8358
  181. package/declarations/store.d.ts.map +0 -1
  182. package/declarations/types/cache.d.ts +0 -2
  183. package/declarations/types/request.d.ts +0 -2
  184. package/declarations/types/schema/concepts.d.ts +0 -2
  185. package/declarations/types/schema/schema-service.d.ts +0 -2
  186. package/dist/-private-DMzvF_Q6.js.map +0 -1
  187. package/dist/-private-HjaQ1wp1.js +0 -1695
  188. package/dist/-private-HjaQ1wp1.js.map +0 -1
  189. package/dist/request--vRFALbQ.js.map +0 -1
  190. package/dist/src-Dex_phWI.js.map +0 -1
  191. package/dist/unpkg/dev/-private-2RfQ2761.js.map +0 -1
  192. package/dist/unpkg/dev/-private-CM1zxNws.js +0 -1684
  193. package/dist/unpkg/dev/-private-CM1zxNws.js.map +0 -1
  194. package/dist/unpkg/dev/request-DAuXbfYi.js.map +0 -1
  195. package/dist/unpkg/dev/runtime-EoVKAhTv.js.map +0 -1
  196. package/dist/unpkg/dev/src-Bxlr_vue.js.map +0 -1
  197. package/dist/unpkg/dev/store-DmiFvT1B.js.map +0 -1
  198. package/dist/unpkg/dev-deprecated/-private-2RfQ2761.js.map +0 -1
  199. package/dist/unpkg/dev-deprecated/-private-CM1zxNws.js +0 -1684
  200. package/dist/unpkg/dev-deprecated/-private-CM1zxNws.js.map +0 -1
  201. package/dist/unpkg/dev-deprecated/request-DAuXbfYi.js.map +0 -1
  202. package/dist/unpkg/dev-deprecated/runtime-BacZMq1r.js.map +0 -1
  203. package/dist/unpkg/dev-deprecated/src-DEl2Ca3T.js.map +0 -1
  204. package/dist/unpkg/dev-deprecated/store-TcP2H4Af.js.map +0 -1
  205. package/dist/unpkg/prod/-private-BK71-uXR.js.map +0 -1
  206. package/dist/unpkg/prod/-private-TNaS5Piv.js +0 -1494
  207. package/dist/unpkg/prod/-private-TNaS5Piv.js.map +0 -1
  208. package/dist/unpkg/prod/-private-Z9i0icpE.js +0 -22
  209. package/dist/unpkg/prod/request-BcJNzSgv.js.map +0 -1
  210. package/dist/unpkg/prod/src-Dzz-j6pp.js.map +0 -1
  211. package/dist/unpkg/prod-deprecated/-private-BK71-uXR.js.map +0 -1
  212. package/dist/unpkg/prod-deprecated/-private-TNaS5Piv.js +0 -1494
  213. package/dist/unpkg/prod-deprecated/-private-TNaS5Piv.js.map +0 -1
  214. package/dist/unpkg/prod-deprecated/request-BcJNzSgv.js.map +0 -1
  215. package/dist/unpkg/prod-deprecated/src-BOifHFQ5.js.map +0 -1
  216. /package/{declarations → dist}/aliases-BWYW5EhX.d.ts +0 -0
  217. /package/{declarations → dist}/aliases-BWYW5EhX.d.ts.map +0 -0
  218. /package/{declarations → dist}/build-config/babel-macros.d.ts +0 -0
  219. /package/{declarations → dist}/build-config/canary-features.d.ts +0 -0
  220. /package/{declarations → dist}/build-config/debugging.d.ts +0 -0
  221. /package/{declarations → dist}/build-config/deprecations.d.ts +0 -0
  222. /package/{declarations → dist}/build-config/env.d.ts +0 -0
  223. /package/{declarations → dist}/build-config/macros.d.ts +0 -0
  224. /package/{declarations → dist}/build-config.d.ts +0 -0
  225. /package/{declarations → dist}/change-C7kqv2kW.d.ts +0 -0
  226. /package/{declarations → dist}/change-C7kqv2kW.d.ts.map +0 -0
  227. /package/{declarations → dist}/configure-B_F639tN.d.ts +0 -0
  228. /package/{declarations → dist}/configure-B_F639tN.d.ts.map +0 -0
  229. /package/{declarations → dist}/configure.d.ts +0 -0
  230. /package/{declarations → dist}/document-BEn91SwT.d.ts +0 -0
  231. /package/{declarations → dist}/document-BEn91SwT.d.ts.map +0 -0
  232. /package/{declarations → dist}/error-50OSEhsF.d.ts +0 -0
  233. /package/{declarations → dist}/error-50OSEhsF.d.ts.map +0 -0
  234. /package/{declarations → dist}/fields-FM7peCiM.d.ts +0 -0
  235. /package/{declarations → dist}/fields-FM7peCiM.d.ts.map +0 -0
  236. /package/{declarations → dist}/graph-DLqYXP2z.d.ts +0 -0
  237. /package/{declarations → dist}/graph-DLqYXP2z.d.ts.map +0 -0
  238. /package/{declarations → dist}/identifier-DQnqOSJK.d.ts +0 -0
  239. /package/{declarations → dist}/identifier-DQnqOSJK.d.ts.map +0 -0
  240. /package/{declarations → dist}/json-api-raw-C5APJHHB.d.ts +0 -0
  241. /package/{declarations → dist}/json-api-raw-C5APJHHB.d.ts.map +0 -0
  242. /package/{declarations → dist}/mutations-CqtoGB4t.d.ts +0 -0
  243. /package/{declarations → dist}/mutations-CqtoGB4t.d.ts.map +0 -0
  244. /package/{declarations → dist}/operations-D1qA6r0_.d.ts +0 -0
  245. /package/{declarations → dist}/operations-D1qA6r0_.d.ts.map +0 -0
  246. /package/{declarations → dist}/params-DrEx3bf8.d.ts +0 -0
  247. /package/{declarations → dist}/params-DrEx3bf8.d.ts.map +0 -0
  248. /package/{declarations → dist}/raw-D5hnjiq7.d.ts +0 -0
  249. /package/{declarations → dist}/raw-D5hnjiq7.d.ts.map +0 -0
  250. /package/{declarations → dist}/record-D3QQcaIR.d.ts +0 -0
  251. /package/{declarations → dist}/relationship-CmHzMPKf.d.ts +0 -0
  252. /package/{declarations → dist}/relationship-CmHzMPKf.d.ts.map +0 -0
  253. /package/{declarations → dist}/symbols-DjRDCeX0.d.ts +0 -0
  254. /package/{declarations → dist}/symbols-DjRDCeX0.d.ts.map +0 -0
  255. /package/{declarations → dist}/types/cache/aliases.d.ts +0 -0
  256. /package/{declarations → dist}/types/cache/change.d.ts +0 -0
  257. /package/{declarations → dist}/types/cache/mutations.d.ts +0 -0
  258. /package/{declarations → dist}/types/cache/operations.d.ts +0 -0
  259. /package/{declarations → dist}/types/cache/relationship.d.ts +0 -0
  260. /package/{declarations → dist}/types/graph.d.ts +0 -0
  261. /package/{declarations → dist}/types/identifier.d.ts +0 -0
  262. /package/{declarations → dist}/types/json/raw.d.ts +0 -0
  263. /package/{declarations → dist}/types/params.d.ts +0 -0
  264. /package/{declarations → dist}/types/record.d.ts +0 -0
  265. /package/{declarations → dist}/types/runtime.d.ts +0 -0
  266. /package/{declarations → dist}/types/runtime.d.ts.map +0 -0
  267. /package/{declarations → dist}/types/schema/fields.d.ts +0 -0
  268. /package/{declarations → dist}/types/schema/fields.type-test.d.ts +0 -0
  269. /package/{declarations → dist}/types/spec/document.d.ts +0 -0
  270. /package/{declarations → dist}/types/spec/error.d.ts +0 -0
  271. /package/{declarations → dist}/types/spec/json-api-raw.d.ts +0 -0
  272. /package/{declarations → dist}/types/symbols.d.ts +0 -0
  273. /package/{declarations → dist}/types/utils.d.ts +0 -0
  274. /package/{declarations → dist}/utils/string.d.ts +0 -0
  275. /package/{declarations → dist}/utils/string.d.ts.map +0 -0
  276. /package/{declarations → dist}/utils-BtURiy8l.d.ts +0 -0
  277. /package/{declarations → dist}/utils-BtURiy8l.d.ts.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","names":["resourceSchema","schema","objectSchema","isResourceSchema","identity","kind","isLegacyResourceSchema","legacy"],"sources":["../../../../../src/types/schema/fields.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { SchemaService } from '../../types.ts';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Cache } from '../cache.ts';\nimport type { ObjectValue, PrimitiveValue, Value } from '../json/raw.ts';\n\n/**\n * Options signature for Legacy Attributes.\n */\nexport interface AttrOptions {\n /**\n * A primitive value or a function which produces a value.\n */\n defaultValue?: PrimitiveValue | (() => Value);\n [key: string]: Value | (() => Value) | undefined;\n}\n\n/**\n * A generic \"field\" that can be used to define\n * primitive value fields.\n *\n * Replaces \"attribute\" for primitive value fields.\n * Can also be used to eject from deep-tracking of\n * objects or arrays.\n *\n * A major difference between \"field\" and \"attribute\"\n * is that \"type\" points to a legacy transform on\n * \"attribute\" that a serializer *might* use, while\n * \"type\" points to a new-style transform on \"field\"\n * that a record implmentation *must* use.\n *\n * @public\n */\nexport interface GenericField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'field';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link GenericField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * the name of the {@link Transformation} to use, if any\n *\n * @public\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * ~~AliasFields may utilize a transform, specified by type,\n * to pre/post process the raw data for the field.~~ (not yet implemented)\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @public\n */\nexport interface LegacyAliasField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @public\n */\n options:\n | GenericField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n // | ResourceField\n // | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField;\n}\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * ~~AliasFields may utilize a transform, specified by type,\n * to pre/post process the raw data for the field.~~ (not yet implemented)\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @public\n */\nexport interface PolarisAliasField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @public\n */\n options:\n | GenericField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n // | ResourceField\n // | CollectionField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n}\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * AliasFields may utilize a transform, specified by type,\n * to pre/post process the field.\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @public\n */\nexport interface ObjectAliasField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @public\n */\n options: GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField;\n}\n\n/**\n * Represents a field whose value is the primary\n * key of the resource.\n *\n * This allows any field to serve as the primary\n * key while still being able to drive identity\n * needs within the system.\n *\n * This is useful for resources that use for instance\n * 'uuid', 'urn' or 'entityUrn' or 'primaryKey' as their\n * primary key field instead of 'id'.\n *\n * @public\n */\nexport interface IdentityField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: '@id';\n\n /**\n * The name of the field that serves as the\n * primary key for the resource.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link IdentityField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * entityUrn: '324523-sadf34-345'\n * }\n * ```\n *\n * But the app desires to use `record.id; // '324523-sadf34-345'`\n *\n * Then `name` would be set to `'id'` and\n * `sourceKey` would be set to `'entityUrn'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n}\n\n/**\n * Represents a specialized field whose computed value\n * will be used as the primary key of a schema-object\n * for serializability and comparison purposes.\n *\n * This field functions similarly to derived fields in that\n * it is non-settable, derived state but differs in that\n * it is only able to compute off of cache state and is given\n * no access to a record instance.\n *\n * This means that if a hashing function wants to compute its value\n * taking into account transformations and derivations it must\n * perform those itself.\n *\n * A schema-array can declare its \"key\" value to be `@hash` if\n * the schema-objects it contains have such a field.\n *\n * Only one hash field is permittable per schema-object, and\n * it should be placed in the `ResourceSchema`'s `@id` field\n * in place of an `IdentityField`.\n *\n * @public\n */\nexport interface HashField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: '@hash';\n\n /**\n * The name of the field that serves as the\n * hash for the resource.\n *\n * Only required if access to this value by\n * the UI is desired, it can be `null` otherwise.\n *\n * @public\n */\n name: string | null;\n\n /**\n * The name of a function to run to compute the hash.\n * The function will only have access to the cached\n * data for the record.\n *\n * @public\n */\n type: string;\n\n /**\n * Any options that should be provided to the hash\n * function.\n *\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * Represents a field whose value is a local\n * value that is not stored in the cache, nor\n * is it sent to the server.\n *\n * Local fields can be written to, and their\n * value is both memoized and reactive (though\n * not deep-tracked).\n *\n * Because their state is not derived from the cache\n * data or the server, they represent a divorced\n * uncanonical source of state.\n *\n * For this reason Local fields should be used sparingly.\n *\n * Currently, while we document this feature here,\n * only allow our own ReactiveResource default fields to\n * utilize them and the feature should be considered private.\n *\n * Example use cases that drove the creation of local\n * fields are states like `isDestroying` and `isDestroyed`\n * which are specific to a record instance but not\n * stored in the cache. We wanted to be able to drive\n * these fields from schema the same as all other fields.\n *\n * Don't make us regret this decision.\n *\n * @public\n */\nexport interface LocalField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: '@local';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n /**\n * Not currently utilized, we are considering\n * allowing transforms to operate on local fields\n *\n * @public\n */\n type?: string;\n\n /**\n * Options for the field.\n *\n * @public\n */\n options?: {\n /**\n * The default value to use for the field when no value\n * has yet been set.\n */\n defaultValue?: PrimitiveValue;\n };\n}\n\n/**\n * Represents a field whose value is an object\n * with keys pointing to values that are primitive\n * values.\n *\n * If values of the keys are not primitives, or\n * if the key/value pairs have well-defined shape,\n * use 'schema-object' instead.\n *\n * @public\n */\nexport interface ObjectField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'object';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link ObjectField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of a transform to pass the entire object\n * through before displaying or serializing it.\n *\n * @public\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @public\n */\n options?: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n\n [key: string]: Value | undefined;\n };\n}\n\n/**\n * Represents a field whose value is an object\n * with a well-defined structure described by\n * a schema-object (a non-resource schema).\n *\n * If the object's structure is not well-defined,\n * use 'object' instead.\n *\n * By default, a SchemaObject within\n *\n * @public\n */\nexport interface SchemaObjectField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'schema-object';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link SchemaObjectField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * If the field is not polymorphic:\n *\n * The name of the ObjectSchema that describes the\n * structure of the object.\n *\n * If the field is polymorphic:\n *\n * The name of the hashFn to use to extract\n * the type from the contained value or null.\n *\n * @public\n */\n type: string | null;\n\n /**\n * Options for configuring the behavior of the\n * SchemaObject.\n *\n * - `polymorphic` : Whether this SchemaObject is Polymorphic.\n * - `type` : If the SchemaObject is Polymorphic, the key on the raw cache data to use as the \"resource-type\" value for the schema-object.\n *\n * @public\n */\n options?: {\n /**\n * If true, if no value for this field exists in the cache,\n * an empty `{}` will be used as the source for a new SchemaObject\n * of the associated schema type, as opposed to the field's\n * value being `null`.\n *\n * If `polymorphic` is `true`, defaultValue will be considered `false`.\n */\n defaultValue?: boolean;\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n\n /**\n * Whether this SchemaObject is Polymorphic.\n *\n * If the SchemaObject is polymorphic, `options.type` must also be supplied.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * If the SchemaObject is Polymorphic, the key on the raw cache data to use\n * as the \"resource-type\" value for the schema-object.\n *\n * The default is `'type'`.\n *\n * Valid options are:\n *\n * - `'@hash'` : will lookup the `@hash` function specified by\n * SchemaObjectField.type and use it to calculate the type for each value.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values.\n *\n * @public\n */\n type?: string;\n };\n}\n\n/**\n * Represents a field whose value is an array\n * of primitive values.\n *\n * If the array's elements are not primitive\n * values, use 'schema-array' instead.\n *\n * @public\n */\nexport interface ArrayField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'array';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link ArrayField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of a transform to pass each item\n * in the array through before displaying or\n * or serializing it.\n *\n * @public\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @public\n */\n options?: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n\n [key: string]: Value | undefined;\n };\n}\n\n/**\n * Represents a field whose value is an array\n * of objects with a well-defined structure\n * described by a non-resource schema.\n *\n * If the array's elements are not well-defined,\n * use 'array' instead.\n *\n * @public\n */\nexport interface SchemaArrayField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'schema-array';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link SchemaArrayField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * If the SchemaArray is not polymorphic:\n *\n * The name of the ObjectSchema that describes the\n * structure of the objects in the array.\n *\n * If the SchemaArray is polymorphic:\n *\n * The name of the hashFn to use to extract\n * the type from contained members or null.\n *\n * @public\n */\n type: string | null;\n\n /**\n * Options for configuring the behavior of the\n * SchemaArray.\n *\n * - `key`\n *\n * Configures how the SchemaArray determines whether an object in the cache is the same\n * as an object previously used to instantiate one of the schema-objects it contains.\n *\n * The default is `'@identity'`.\n *\n * Valid options are:\n *\n * - `'@identity'`(default) : the cached object's referential identity will be used.\n * This may result in significant instability when resource data is updated from the API\n * - `'@index'` : the cached object's index in the array will be used.\n * This is only a good choice for arrays that rarely if ever change membership\n * - `'@hash'` : will lookup the `@hash` function supplied in the ResourceSchema for\n * The contained schema-object and use the computed result to determine and compare identity.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values. The field value should be unique enough to guarantee two schema-objects\n * of the same type will not collide.\n *\n * - `polymorphic` : Whether this SchemaArray is Polymorphic.\n * - `type` : If the SchemaArray is Polymorphic, the key on the raw cache data to use as the \"resource-type\" value for the schema-object.\n *\n * @public\n */\n options?: {\n /**\n * If true, if no value for this field exists in the cache,\n * an empty `[]` will be used as the value of the field,\n * as opposed to the field's value being `null`.\n *\n */\n defaultValue?: boolean;\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n\n /**\n * Configures how the SchemaArray determines whether\n * an object in the cache is the same as an object\n * previously used to instantiate one of the schema-objects\n * it contains.\n *\n * The default is `'@identity'`.\n *\n * Valid options are:\n *\n * - `'@identity'` (default) : the cached object's referential identity will be used.\n * This may result in significant instability when resource data is updated from the API\n * - `'@index'` : the cached object's index in the array will be used.\n * This is only a good choice for arrays that rarely if ever change membership\n * - `'@hash'` : will lookup the `@hash` function supplied in the ResourceSchema for\n * The contained schema-object and use the computed result to determine and compare identity.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values. The field value should be unique enough to guarantee two schema-objects\n * of the same type will not collide.\n *\n */\n key?: '@identity' | '@index' | '@hash' | string;\n\n /**\n * Whether this SchemaArray is Polymorphic.\n *\n * If the SchemaArray is polymorphic, `options.type` must also be supplied.\n *\n */\n polymorphic?: boolean;\n\n /**\n * If the SchemaArray is Polymorphic, the key on the raw cache data to use\n * as the \"resource-type\" value for the schema-object.\n *\n * The default is `'type'`.\n *\n * Valid options are:\n *\n * - `'@hash'` : will lookup the `@hash` function specified by\n * SchemaArrayField.type and use it to calculate the type for each value.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values.\n */\n type?: string;\n };\n}\n\n/**\n * Represents a field whose value is derived\n * from other fields in the schema.\n *\n * The value is read-only, and is not stored\n * in the cache, nor is it sent to the server.\n *\n * Usage of derived fields should be minimized\n * to scenarios where the derivation is known\n * to be safe. For instance, derivations that\n * required fields that are not always loaded\n * or that require access to related resources\n * that may not be loaded should be avoided.\n *\n * @public\n */\nexport interface DerivedField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'derived';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the derivation to use.\n *\n * Derivations are functions that take the\n * record, options, and the name of the field\n * as arguments, and return the derived value.\n *\n * Derivations are memoized, and are only\n * recomputed when the fields they depend on\n * change.\n *\n * Derivations are not stored in the cache,\n * and are not sent to the server.\n *\n * Derivation functions must be explicitly\n * registered with the schema service.\n *\n * @public\n */\n type: string;\n\n /**\n * Options to pass to the derivation, if any\n *\n * Must comply to the specific derivation's\n * options schema.\n *\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * Represents a field that is a reference to\n * another resource.\n *\n * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED\n * BY ReactiveResource\n *\n * @public\n */\nexport interface ResourceField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'resource';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link ResourceField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for resources are optional. If\n * not present, all options are presumed\n * to be falsey\n *\n * @public\n */\n options?: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain a link\n * that can be used to fetch the related\n * resource when needed.\n *\n * @public\n */\n async?: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * @public\n */\n inverse?: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n };\n}\n\n/**\n * Represents a field that is a reference to\n * a collection of other resources, potentially\n * paginate.\n *\n * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED\n * BY ReactiveResource\n *\n * @public\n */\nexport interface CollectionField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'collection';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link CollectionField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for resources are optional. If\n * not present, all options are presumed\n * to be falsey\n *\n * @public\n */\n options?: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * that can be used to fetch the related\n * resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * When true, it is expected that the relationship\n * is paginated. If the relationship is not paginated,\n * then the cache data for \"page 1\" would contain the\n * full list of pointers, and loading \"page 1\" would\n * load all related resources.\n *\n * @public\n */\n async?: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * @public\n */\n inverse?: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n * > It cannot be used with PolarisMode\n *\n * A generic \"field\" that can be used to define\n * primitive value fields.\n *\n * If the field points to an object or array,\n * it will not be deep-tracked.\n *\n * Transforms when defined are legacy transforms\n * that a serializer *might* use, but their usage\n * is not guaranteed.\n *\n * @public\n */\nexport interface LegacyAttributeField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'attribute';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LegacyAttributeField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the transform to use, if any\n *\n * @public\n */\n type?: string | null;\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * See {@link AttrOptions} for more info.\n */\n options?: AttrOptions;\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * another resource.\n *\n * This is the legacy version of the `ResourceField`.\n *\n * @public\n */\nexport interface LegacyBelongsToField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'belongsTo';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LegacyBelongsToField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for belongsTo are mandatory.\n *\n * @public\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain a link\n * or a pointer that can be used to fetch\n * the related resource when needed.\n *\n * Pointers are highly discouraged.\n *\n * @public\n */\n async: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * If the inverse field definition uses a sourceKey,\n * this should still be the name of the field, not the sourceKey.\n *\n * @public\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy request infra\n * from @warp-drive/legacy/compat and the LegacyNetworkMiddleware for\n * adapters and serializers.\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * (`async: false`, currently the only supported combination) must satisfy\n * one of the following whenever pushed to the cache:\n *\n * - a `links.related` link is present, **or**\n * - the relationship is fully linked: `data` is `null`, or `data` points\n * to a resource present in the document's `included` array\n *\n * A related link lets you omit the related resource from `included`; a\n * `data` key that is missing entirely, or explicitly `undefined`, is never\n * valid unless a `links.related` link is present.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriend: {\n * links: { related: \"/users/1/bestFriend\" },\n * data: { type: 'user', id: '1' },\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * @public\n */\n linksMode?: true;\n\n /**\n * When omitted, the cache data for this field will\n * clear local state of all changes except for the\n * addition of records still in the \"new\" state any\n * time the remote data for this field is updated.\n *\n * When set to `false`, the cache data for this field\n * will instead intelligently commit any changes from\n * local state that are present in the remote data,\n * leaving any remaining changes in local state still.\n *\n * @public\n */\n resetOnRemoteUpdate?: false;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * another resource.\n *\n * This is the legacy version of the `ResourceField`.\n *\n * @public\n */\nexport interface LinksModeBelongsToField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'belongsTo';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LinksModeBelongsToField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for belongsTo are mandatory.\n *\n * @public\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * MUST be false for PolarisMode + LinksMode\n *\n * @public\n */\n async: false;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * If the inverse field definition uses a sourceKey,\n * this should still be the name of the field, not the sourceKey.\n *\n * @public\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * MUST be true for PolarisMode + LinksMode\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * (`async: false`, currently the only supported combination) must satisfy\n * one of the following whenever pushed to the cache:\n *\n * - a `links.related` link is present, **or**\n * - the relationship is fully linked: `data` is `null`, or `data` points\n * to a resource present in the document's `included` array\n *\n * A related link lets you omit the related resource from `included`; a\n * `data` key that is missing entirely, or explicitly `undefined`, is never\n * valid unless a `links.related` link is present.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriend: {\n * links: { related: \"/users/1/bestFriend\" },\n * data: { type: 'user', id: '1' },\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * Activating LinksMode will *also* deactivate the deprecated\n * `resetOnRemoteUpdate` behavior for this field.\n *\n * This means that when new remote state is received, the cache\n * will intelligently commit any changes from local state that\n * are present in the remote data for this field, leaving any remaining\n * changes in local state still.\n *\n * Previously, the cache would clear local state of all changes\n * except for the addition of records still in the \"new\" state any\n * time the remote data for this field was updated.\n *\n * @public\n */\n linksMode: true;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * a collection of other resources.\n *\n * This is the legacy version of the `CollectionField`.\n *\n * @public\n */\nexport interface LegacyHasManyField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'hasMany';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LegacyHasManyField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * the name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for hasMany are mandatory.\n *\n * @public\n */\n options: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * or pointers that can be used to fetch\n * the related resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * hasMany relationships do not support pagination.\n *\n * @public\n */\n async: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * If the inverse field definition uses a sourceKey,\n * this should still be the name of the field, not the sourceKey.\n *\n * @public\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * (`async: false`, currently the only supported combination) must satisfy\n * one of the following whenever pushed to the cache:\n *\n * - a `links.related` link is present, **or**\n * - the relationship is fully linked: `data` is `[]`, or every resource\n * identifier in `data` is present in the document's `included` array\n *\n * A related link lets you omit the related resources from `included`; a\n * `data` key that is missing entirely, or explicitly `undefined`, is never\n * valid unless a `links.related` link is present.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriends: {\n * links: { related: \"/users/1/bestFriends\" },\n * data: [ { type: 'user', id: '1' } ],\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * @public\n */\n linksMode?: true;\n\n /**\n * When omitted, the cache data for this field will\n * clear local state of all changes except for the\n * addition of records still in the \"new\" state any\n * time the remote data for this field is updated.\n *\n * When set to `false`, the cache data for this field\n * will instead intelligently commit any changes from\n * local state that are present in the remote data,\n * leaving any remaining changes in local state still.\n *\n * @public\n */\n resetOnRemoteUpdate?: false;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * a collection of other resources.\n *\n * This is the legacy version of the `CollectionField`.\n *\n * @public\n */\nexport interface LinksModeHasManyField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'hasMany';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LinksModeHasManyField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * the name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for hasMany are mandatory.\n *\n * @public\n */\n options: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n /**\n * Whether the relationship is async\n *\n * MUST be false for PolarisMode + LinksMode\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * or pointers that can be used to fetch\n * the related resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * hasMany relationships do not support pagination.\n *\n * @public\n */\n async: false;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * If the inverse field definition uses a sourceKey,\n * this should still be the name of the field, not the sourceKey.\n *\n * @public\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * MUST be true for PolarisMode + LinksMode\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * (`async: false`, currently the only supported combination) must satisfy\n * one of the following whenever pushed to the cache:\n *\n * - a `links.related` link is present, **or**\n * - the relationship is fully linked: `data` is `[]`, or every resource\n * identifier in `data` is present in the document's `included` array\n *\n * A related link lets you omit the related resources from `included`; a\n * `data` key that is missing entirely, or explicitly `undefined`, is never\n * valid unless a `links.related` link is present.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriends: {\n * links: { related: \"/users/1/bestFriends\" },\n * data: [ { type: 'user', id: '1' } ],\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * Activating LinksMode will *also* deactivate the deprecated\n * `resetOnRemoteUpdate` behavior for this field.\n *\n * This means that when new remote state is received, the cache\n * will intelligently commit any changes from local state that\n * are present in the remote data for this field, leaving any remaining\n * changes in local state still.\n *\n * Previously, the cache would clear local state of all changes\n * except for the addition of records still in the \"new\" state any\n * time the remote data for this field was updated.\n *\n * @public\n */\n linksMode: true;\n };\n}\n\n/**\n * A union of all possible LegacyMode field schemas.\n *\n * Available field schemas are:\n *\n * - {@link GenericField}\n * - {@link LegacyAliasField}\n * - {@link LocalField}\n * - {@link ObjectField}\n * - {@link SchemaObjectField}\n * - {@link ArrayField}\n * - {@link SchemaArrayField}\n * - {@link DerivedField}\n * - {@link ResourceField | ResourceField (not yet implemented)}\n * - {@link CollectionField | CollectionField (not yet implemented)}\n * - {@link LegacyAttributeField}\n * - {@link LegacyBelongsToField}\n * - {@link LegacyHasManyField}\n *\n * @public\n */\nexport type LegacyModeFieldSchema =\n | GenericField\n | LegacyAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n // | ResourceField // not yet implemented\n // | CollectionField // not yet implemented\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField;\n\n/**\n * A union of all possible PolarisMode field schemas.\n *\n * Available field schemas are:\n *\n * - {@link GenericField}\n * - {@link PolarisAliasField}\n * - {@link LocalField}\n * - {@link ObjectField}\n * - {@link SchemaObjectField}\n * - {@link ArrayField}\n * - {@link SchemaArrayField}\n * - {@link DerivedField}\n * - {@link ResourceField | ResourceField (not yet implemented)}\n * - {@link CollectionField | CollectionField (not yet implemented)}\n * - {@link LinksModeBelongsToField}\n * - {@link LinksModeHasManyField}\n *\n * @public\n */\nexport type PolarisModeFieldSchema =\n | GenericField\n | PolarisAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n // | ResourceField\n // | CollectionField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all possible LegacyMode and PolarisMode\n * field schemas.\n *\n * You likely will want to use PolarisModeFieldSchema,\n * LegacyModeFieldSchema, or ObjectFieldSchema instead\n * as appropriate as they are more specific and will\n * provide better guidance around what is valid.\n *\n * @public\n */\nexport type FieldSchema =\n | GenericField\n | LegacyAliasField\n | PolarisAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n | ResourceField\n | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all possible LegacyMode and PolarisMode\n * field schemas that represent data that could be in\n * the cache.\n *\n * In other words this will not include types like alias\n * fields, local fields, or derived fields.\n *\n * @public\n */\nexport type CacheableFieldSchema =\n | IdentityField\n | GenericField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | ResourceField\n | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all possible field schemas that can be\n * used in an ObjectSchema.\n *\n * @public\n */\nexport type ObjectFieldSchema =\n | LegacyAttributeField\n | GenericField\n | ObjectAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField;\n\n/**\n * Represents a schema for a primary resource in PolarisMode.\n *\n * Primary resources are objects with a unique identity of their\n * own which may allow them to appear in relationships, or in multiple\n * response documents.\n *\n * @public\n */\nexport interface PolarisResourceSchema {\n /**\n * A flag indicating that this is not a legacy resource schema.\n *\n * @public\n */\n legacy?: false;\n\n /**\n * For primary resources, this should be an IdentityField\n *\n * for schema-objects, this should be either a HashField or null\n *\n * @public\n */\n identity: IdentityField;\n\n /**\n * The name of the schema\n *\n * For cacheable resources, this should be the\n * primary resource type.\n *\n * For object schemas, this should be the name\n * of the object schema.\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the resource\n *\n * @public\n */\n fields: PolarisModeFieldSchema[];\n\n /**\n * A list of traits that this resource implements. The fields for these\n * traits should still be defined in the fields array.\n *\n * Each trait should be a string that matches the `type` of another\n * resource schema. The trait can be abstract and reference a resource\n * type that is never defined as a schema.\n *\n * @public\n */\n traits?: string[];\n}\n\n/**\n * Represents a schema for a primary resource in LegacyMode\n *\n * Primary resources are objects with a unique identity of their\n * own which may allow them to appear in relationships, or in multiple\n * response documents.\n *\n * @public\n */\nexport interface LegacyResourceSchema {\n /**\n * A flag indicating that this is a legacy resource schema\n *\n * @public\n */\n legacy: true;\n\n /**\n * This should be an IdentityField.\n *\n * To maximize compatibility with Model where `id` was the\n * name of the identity field, we recommend using `{ kind: '@id', name: 'id' }`\n * for records in legacy mode, but this is not required.\n *\n * @public\n */\n identity: IdentityField;\n\n /**\n * The name of the schema\n *\n * For cacheable resources, this should be the\n * primary resource type.\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the resource\n *\n * @public\n */\n fields: LegacyModeFieldSchema[];\n\n /**\n * A list of traits that this resource implements. The fields for these\n * traits should still be defined in the fields array.\n *\n * Each trait should be a string that matches the `type` of another\n * resource schema. The trait can be abstract and reference a resource\n * type that is never defined as a schema.\n *\n * @public\n */\n traits?: string[];\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this resource should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n}\n\n/**\n * A type which represents a valid JSON schema\n * definition for either a PolarisMode or a\n * LegacyMode resource.\n *\n * Note, this is separate from the type returned\n * by the SchemaService which provides fields as a Map\n * instead of as an Array.\n *\n * @public\n */\nexport type ResourceSchema = PolarisResourceSchema | LegacyResourceSchema;\n\n/**\n * Represents a schema for an object that is not\n * a primary resource (has no unique identity of its own).\n *\n * ObjectSchemas may not currently contain relationships.\n *\n * @public\n */\nexport interface ObjectSchema {\n /**\n * Either a HashField from which to calculate an identity or null\n *\n * In the case of `null`, the object's identity will be based\n * on the referential identity of the object in the cache itself\n * when an identity is needed.\n *\n * @public\n */\n identity: HashField | null;\n\n /**\n * The name of the schema\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the object\n *\n * @public\n */\n fields: ObjectFieldSchema[];\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n}\n\n/**\n * A union of {@link ResourceSchema} and {@link ObjectSchema} representing\n * any schema that can be registered with or returned by the SchemaService.\n *\n * @public\n */\nexport type Schema = ResourceSchema | ObjectSchema;\n\n/**\n * A trait for use on a PolarisMode record.\n *\n * Traits are reusable collections of fields that can be composed onto a\n * resource schema, often to describe a polymorphic capability shared by\n * multiple resource types.\n */\nexport interface PolarisTrait {\n /**\n * The name of the trait.\n *\n * This is the string referenced by a resource schema's `traits` array,\n * or by another trait's `traits` array, in order to make use of this\n * trait.\n */\n name: string;\n\n /**\n * The mode this trait is valid for use with.\n *\n * A PolarisTrait may only be applied to PolarisMode resource schemas.\n */\n mode: 'polaris';\n\n /**\n * The fields that this trait contributes to any resource schema\n * that implements it.\n */\n fields: PolarisModeFieldSchema[];\n\n /**\n * A list of other traits that this trait itself implements.\n *\n * As with a resource schema's `traits`, each entry should be a string\n * matching the `name` of another trait.\n */\n traits?: string[];\n}\n\n/**\n * A trait for use on a LegacyMode record.\n *\n * Traits are reusable collections of fields that can be composed onto a\n * resource schema, often to describe a polymorphic capability shared by\n * multiple resource types.\n */\nexport interface LegacyTrait {\n /**\n * The name of the trait.\n *\n * This is the string referenced by a resource schema's `traits` array,\n * or by another trait's `traits` array, in order to make use of this\n * trait.\n */\n name: string;\n\n /**\n * The mode this trait is valid for use with.\n *\n * A LegacyTrait may only be applied to LegacyMode resource schemas.\n */\n mode: 'legacy';\n\n /**\n * The fields that this trait contributes to any resource schema\n * that implements it.\n */\n fields: LegacyModeFieldSchema[];\n\n /**\n * A list of other traits that this trait itself implements.\n *\n * As with a resource schema's `traits`, each entry should be a string\n * matching the `name` of another trait.\n */\n traits?: string[];\n}\n\n/**\n * A union of\n * - {@link LegacyTrait}\n * - {@link PolarisTrait}\n */\nexport type Trait = LegacyTrait | PolarisTrait;\n\n/**\n * A no-op type utility that enables type-checking resource schema\n * definitions.\n *\n * Will return the passed in schema.\n *\n * This will not validate relationship inverses or related types,\n * as doing so would require a full schema graph to be passed in\n * and no cycles in the graph to be present.\n *\n * @public\n */\nexport function resourceSchema<T extends LegacyResourceSchema | PolarisResourceSchema>(\n schema: LegacyResourceSchema | PolarisResourceSchema\n): T {\n return schema as T;\n}\n\n/**\n * A no-op type utility that enables type-checking object schema\n * definitions.\n *\n * Will return the passed in schema.\n *\n * @public\n */\nexport function objectSchema<T extends ObjectSchema>(schema: T): T {\n return schema;\n}\n\n/**\n * A type utility to narrow a schema to a ResourceSchema\n *\n * @public\n */\nexport function isResourceSchema(schema: ResourceSchema | ObjectSchema): schema is ResourceSchema {\n return schema?.identity?.kind === '@id';\n}\n\n/**\n * A type utility to narrow a schema to LegacyResourceSchema\n *\n * @public\n */\nexport function isLegacyResourceSchema(schema: ResourceSchema | ObjectSchema): schema is LegacyResourceSchema {\n return isResourceSchema(schema) && schema.legacy === true;\n}\n\n/**\n * A union of all field schemas considered \"legacy\", i.e. those historically\n * associated with `@warp-drive/legacy/model`'s Attribute, BelongsTo and\n * HasMany fields, including their LinksMode variants.\n *\n * Available field schemas are:\n *\n * - {@link LegacyAttributeField}\n * - {@link LegacyBelongsToField}\n * - {@link LegacyHasManyField}\n * - {@link LinksModeBelongsToField}\n * - {@link LinksModeHasManyField}\n *\n * @public\n */\nexport type LegacyField =\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all legacy relationship field schemas, i.e. {@link LegacyField}\n * excluding {@link LegacyAttributeField}.\n *\n * Available field schemas are:\n *\n * - {@link LegacyBelongsToField}\n * - {@link LegacyHasManyField}\n * - {@link LinksModeBelongsToField}\n * - {@link LinksModeHasManyField}\n *\n * @public\n */\nexport type LegacyRelationshipField =\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA68EA,SAAgBA,eACdC,QACG;CACH,OAAOA;AACT;;;;;;;;;AAUA,SAAgBC,aAAqCD,QAAc;CACjE,OAAOA;AACT;;;;;;AAOA,SAAgBE,iBAAiBF,QAAiE;CAChG,OAAOA,QAAQG,UAAUC,SAAS;AACpC;;;;;;AAOA,SAAgBC,uBAAuBL,QAAuE;CAC5G,OAAOE,iBAAiBF,MAAM,KAAKA,OAAOM,WAAW;AACvD"}
1
+ {"version":3,"file":"fields.js","names":["resourceSchema","schema","objectSchema","isResourceSchema","identity","kind","isLegacyResourceSchema","legacy"],"sources":["../../../../../src/types/schema/fields.ts"],"sourcesContent":["// oxlint-disable-next-line no-unused-vars\nimport type { SchemaService } from '../../types.ts';\n// oxlint-disable-next-line no-unused-vars\nimport type { Cache } from '../cache.ts';\nimport type { ObjectValue, PrimitiveValue, Value } from '../json/raw.ts';\n\n/**\n * Options signature for Legacy Attributes.\n */\nexport interface AttrOptions {\n /**\n * A primitive value or a function which produces a value.\n */\n defaultValue?: PrimitiveValue | (() => Value);\n [key: string]: Value | (() => Value) | undefined;\n}\n\n/**\n * A generic \"field\" that can be used to define\n * primitive value fields.\n *\n * Replaces \"attribute\" for primitive value fields.\n * Can also be used to eject from deep-tracking of\n * objects or arrays.\n *\n * A major difference between \"field\" and \"attribute\"\n * is that \"type\" points to a legacy transform on\n * \"attribute\" that a serializer *might* use, while\n * \"type\" points to a new-style transform on \"field\"\n * that a record implmentation *must* use.\n *\n * @public\n */\nexport interface GenericField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'field';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link GenericField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * the name of the {@link Transformation} to use, if any\n *\n * @public\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * ~~AliasFields may utilize a transform, specified by type,\n * to pre/post process the raw data for the field.~~ (not yet implemented)\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @public\n */\nexport interface LegacyAliasField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @public\n */\n options:\n | GenericField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n // | ResourceField\n // | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField;\n}\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * ~~AliasFields may utilize a transform, specified by type,\n * to pre/post process the raw data for the field.~~ (not yet implemented)\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @public\n */\nexport interface PolarisAliasField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @public\n */\n options:\n | GenericField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n // | ResourceField\n // | CollectionField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n}\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * AliasFields may utilize a transform, specified by type,\n * to pre/post process the field.\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @public\n */\nexport interface ObjectAliasField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @public\n */\n options: GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField;\n}\n\n/**\n * Represents a field whose value is the primary\n * key of the resource.\n *\n * This allows any field to serve as the primary\n * key while still being able to drive identity\n * needs within the system.\n *\n * This is useful for resources that use for instance\n * 'uuid', 'urn' or 'entityUrn' or 'primaryKey' as their\n * primary key field instead of 'id'.\n *\n * @public\n */\nexport interface IdentityField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: '@id';\n\n /**\n * The name of the field that serves as the\n * primary key for the resource.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link IdentityField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * entityUrn: '324523-sadf34-345'\n * }\n * ```\n *\n * But the app desires to use `record.id; // '324523-sadf34-345'`\n *\n * Then `name` would be set to `'id'` and\n * `sourceKey` would be set to `'entityUrn'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n}\n\n/**\n * Represents a specialized field whose computed value\n * will be used as the primary key of a schema-object\n * for serializability and comparison purposes.\n *\n * This field functions similarly to derived fields in that\n * it is non-settable, derived state but differs in that\n * it is only able to compute off of cache state and is given\n * no access to a record instance.\n *\n * This means that if a hashing function wants to compute its value\n * taking into account transformations and derivations it must\n * perform those itself.\n *\n * A schema-array can declare its \"key\" value to be `@hash` if\n * the schema-objects it contains have such a field.\n *\n * Only one hash field is permittable per schema-object, and\n * it should be placed in the `ResourceSchema`'s `@id` field\n * in place of an `IdentityField`.\n *\n * @public\n */\nexport interface HashField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: '@hash';\n\n /**\n * The name of the field that serves as the\n * hash for the resource.\n *\n * Only required if access to this value by\n * the UI is desired, it can be `null` otherwise.\n *\n * @public\n */\n name: string | null;\n\n /**\n * The name of a function to run to compute the hash.\n * The function will only have access to the cached\n * data for the record.\n *\n * @public\n */\n type: string;\n\n /**\n * Any options that should be provided to the hash\n * function.\n *\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * Represents a field whose value is a local\n * value that is not stored in the cache, nor\n * is it sent to the server.\n *\n * Local fields can be written to, and their\n * value is both memoized and reactive (though\n * not deep-tracked).\n *\n * Because their state is not derived from the cache\n * data or the server, they represent a divorced\n * uncanonical source of state.\n *\n * For this reason Local fields should be used sparingly.\n *\n * Currently, while we document this feature here,\n * only allow our own ReactiveResource default fields to\n * utilize them and the feature should be considered private.\n *\n * Example use cases that drove the creation of local\n * fields are states like `isDestroying` and `isDestroyed`\n * which are specific to a record instance but not\n * stored in the cache. We wanted to be able to drive\n * these fields from schema the same as all other fields.\n *\n * Don't make us regret this decision.\n *\n * @public\n */\nexport interface LocalField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: '@local';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n /**\n * Not currently utilized, we are considering\n * allowing transforms to operate on local fields\n *\n * @public\n */\n type?: string;\n\n /**\n * Options for the field.\n *\n * @public\n */\n options?: {\n /**\n * The default value to use for the field when no value\n * has yet been set.\n */\n defaultValue?: PrimitiveValue;\n };\n}\n\n/**\n * Represents a field whose value is an object\n * with keys pointing to values that are primitive\n * values.\n *\n * If values of the keys are not primitives, or\n * if the key/value pairs have well-defined shape,\n * use 'schema-object' instead.\n *\n * @public\n */\nexport interface ObjectField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'object';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link ObjectField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of a transform to pass the entire object\n * through before displaying or serializing it.\n *\n * @public\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @public\n */\n options?: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n\n [key: string]: Value | undefined;\n };\n}\n\n/**\n * Represents a field whose value is an object\n * with a well-defined structure described by\n * a schema-object (a non-resource schema).\n *\n * If the object's structure is not well-defined,\n * use 'object' instead.\n *\n * By default, a SchemaObject within\n *\n * @public\n */\nexport interface SchemaObjectField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'schema-object';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link SchemaObjectField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * If the field is not polymorphic:\n *\n * The name of the ObjectSchema that describes the\n * structure of the object.\n *\n * If the field is polymorphic:\n *\n * The name of the hashFn to use to extract\n * the type from the contained value or null.\n *\n * @public\n */\n type: string | null;\n\n /**\n * Options for configuring the behavior of the\n * SchemaObject.\n *\n * - `polymorphic` : Whether this SchemaObject is Polymorphic.\n * - `type` : If the SchemaObject is Polymorphic, the key on the raw cache data to use as the \"resource-type\" value for the schema-object.\n *\n * @public\n */\n options?: {\n /**\n * If true, if no value for this field exists in the cache,\n * an empty `{}` will be used as the source for a new SchemaObject\n * of the associated schema type, as opposed to the field's\n * value being `null`.\n *\n * If `polymorphic` is `true`, defaultValue will be considered `false`.\n */\n defaultValue?: boolean;\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n\n /**\n * Whether this SchemaObject is Polymorphic.\n *\n * If the SchemaObject is polymorphic, `options.type` must also be supplied.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * If the SchemaObject is Polymorphic, the key on the raw cache data to use\n * as the \"resource-type\" value for the schema-object.\n *\n * The default is `'type'`.\n *\n * Valid options are:\n *\n * - `'@hash'` : will lookup the `@hash` function specified by\n * SchemaObjectField.type and use it to calculate the type for each value.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values.\n *\n * @public\n */\n type?: string;\n };\n}\n\n/**\n * Represents a field whose value is an array\n * of primitive values.\n *\n * If the array's elements are not primitive\n * values, use 'schema-array' instead.\n *\n * @public\n */\nexport interface ArrayField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'array';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link ArrayField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of a transform to pass each item\n * in the array through before displaying or\n * or serializing it.\n *\n * @public\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @public\n */\n options?: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n\n [key: string]: Value | undefined;\n };\n}\n\n/**\n * Represents a field whose value is an array\n * of objects with a well-defined structure\n * described by a non-resource schema.\n *\n * If the array's elements are not well-defined,\n * use 'array' instead.\n *\n * @public\n */\nexport interface SchemaArrayField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'schema-array';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link SchemaArrayField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * If the SchemaArray is not polymorphic:\n *\n * The name of the ObjectSchema that describes the\n * structure of the objects in the array.\n *\n * If the SchemaArray is polymorphic:\n *\n * The name of the hashFn to use to extract\n * the type from contained members or null.\n *\n * @public\n */\n type: string | null;\n\n /**\n * Options for configuring the behavior of the\n * SchemaArray.\n *\n * - `key`\n *\n * Configures how the SchemaArray determines whether an object in the cache is the same\n * as an object previously used to instantiate one of the schema-objects it contains.\n *\n * The default is `'@identity'`.\n *\n * Valid options are:\n *\n * - `'@identity'`(default) : the cached object's referential identity will be used.\n * This may result in significant instability when resource data is updated from the API\n * - `'@index'` : the cached object's index in the array will be used.\n * This is only a good choice for arrays that rarely if ever change membership\n * - `'@hash'` : will lookup the `@hash` function supplied in the ResourceSchema for\n * The contained schema-object and use the computed result to determine and compare identity.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values. The field value should be unique enough to guarantee two schema-objects\n * of the same type will not collide.\n *\n * - `polymorphic` : Whether this SchemaArray is Polymorphic.\n * - `type` : If the SchemaArray is Polymorphic, the key on the raw cache data to use as the \"resource-type\" value for the schema-object.\n *\n * @public\n */\n options?: {\n /**\n * If true, if no value for this field exists in the cache,\n * an empty `[]` will be used as the value of the field,\n * as opposed to the field's value being `null`.\n *\n */\n defaultValue?: boolean;\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n\n /**\n * Configures how the SchemaArray determines whether\n * an object in the cache is the same as an object\n * previously used to instantiate one of the schema-objects\n * it contains.\n *\n * The default is `'@identity'`.\n *\n * Valid options are:\n *\n * - `'@identity'` (default) : the cached object's referential identity will be used.\n * This may result in significant instability when resource data is updated from the API\n * - `'@index'` : the cached object's index in the array will be used.\n * This is only a good choice for arrays that rarely if ever change membership\n * - `'@hash'` : will lookup the `@hash` function supplied in the ResourceSchema for\n * The contained schema-object and use the computed result to determine and compare identity.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values. The field value should be unique enough to guarantee two schema-objects\n * of the same type will not collide.\n *\n */\n key?: '@identity' | '@index' | '@hash' | string;\n\n /**\n * Whether this SchemaArray is Polymorphic.\n *\n * If the SchemaArray is polymorphic, `options.type` must also be supplied.\n *\n */\n polymorphic?: boolean;\n\n /**\n * If the SchemaArray is Polymorphic, the key on the raw cache data to use\n * as the \"resource-type\" value for the schema-object.\n *\n * The default is `'type'`.\n *\n * Valid options are:\n *\n * - `'@hash'` : will lookup the `@hash` function specified by\n * SchemaArrayField.type and use it to calculate the type for each value.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values.\n */\n type?: string;\n };\n}\n\n/**\n * Represents a field whose value is derived\n * from other fields in the schema.\n *\n * The value is read-only, and is not stored\n * in the cache, nor is it sent to the server.\n *\n * Usage of derived fields should be minimized\n * to scenarios where the derivation is known\n * to be safe. For instance, derivations that\n * required fields that are not always loaded\n * or that require access to related resources\n * that may not be loaded should be avoided.\n *\n * @public\n */\nexport interface DerivedField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'derived';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the derivation to use.\n *\n * Derivations are functions that take the\n * record, options, and the name of the field\n * as arguments, and return the derived value.\n *\n * Derivations are memoized, and are only\n * recomputed when the fields they depend on\n * change.\n *\n * Derivations are not stored in the cache,\n * and are not sent to the server.\n *\n * Derivation functions must be explicitly\n * registered with the schema service.\n *\n * @public\n */\n type: string;\n\n /**\n * Options to pass to the derivation, if any\n *\n * Must comply to the specific derivation's\n * options schema.\n *\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * Represents a field that is a reference to\n * another resource.\n *\n * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED\n * BY ReactiveResource\n *\n * @public\n */\nexport interface ResourceField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'resource';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link ResourceField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for resources are optional. If\n * not present, all options are presumed\n * to be falsey\n *\n * @public\n */\n options?: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain a link\n * that can be used to fetch the related\n * resource when needed.\n *\n * @public\n */\n async?: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * @public\n */\n inverse?: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n };\n}\n\n/**\n * Represents a field that is a reference to\n * a collection of other resources, potentially\n * paginate.\n *\n * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED\n * BY ReactiveResource\n *\n * @public\n */\nexport interface CollectionField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'collection';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link CollectionField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for resources are optional. If\n * not present, all options are presumed\n * to be falsey\n *\n * @public\n */\n options?: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * that can be used to fetch the related\n * resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * When true, it is expected that the relationship\n * is paginated. If the relationship is not paginated,\n * then the cache data for \"page 1\" would contain the\n * full list of pointers, and loading \"page 1\" would\n * load all related resources.\n *\n * @public\n */\n async?: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * @public\n */\n inverse?: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n * > It cannot be used with PolarisMode\n *\n * A generic \"field\" that can be used to define\n * primitive value fields.\n *\n * If the field points to an object or array,\n * it will not be deep-tracked.\n *\n * Transforms when defined are legacy transforms\n * that a serializer *might* use, but their usage\n * is not guaranteed.\n *\n * @public\n */\nexport interface LegacyAttributeField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'attribute';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LegacyAttributeField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the transform to use, if any\n *\n * @public\n */\n type?: string | null;\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * See {@link AttrOptions} for more info.\n */\n options?: AttrOptions;\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * another resource.\n *\n * This is the legacy version of the `ResourceField`.\n *\n * @public\n */\nexport interface LegacyBelongsToField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'belongsTo';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LegacyBelongsToField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for belongsTo are mandatory.\n *\n * @public\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain a link\n * or a pointer that can be used to fetch\n * the related resource when needed.\n *\n * Pointers are highly discouraged.\n *\n * @public\n */\n async: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * If the inverse field definition uses a sourceKey,\n * this should still be the name of the field, not the sourceKey.\n *\n * @public\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy request infra\n * from @warp-drive/legacy/compat and the LegacyNetworkMiddleware for\n * adapters and serializers.\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * (`async: false`, currently the only supported combination) must satisfy\n * one of the following whenever pushed to the cache:\n *\n * - a `links.related` link is present, **or**\n * - the relationship is fully linked: `data` is `null`, or `data` points\n * to a resource present in the document's `included` array\n *\n * A related link lets you omit the related resource from `included`; a\n * `data` key that is missing entirely, or explicitly `undefined`, is never\n * valid unless a `links.related` link is present.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriend: {\n * links: { related: \"/users/1/bestFriend\" },\n * data: { type: 'user', id: '1' },\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * @public\n */\n linksMode?: true;\n\n /**\n * When omitted, the cache data for this field will\n * clear local state of all changes except for the\n * addition of records still in the \"new\" state any\n * time the remote data for this field is updated.\n *\n * When set to `false`, the cache data for this field\n * will instead intelligently commit any changes from\n * local state that are present in the remote data,\n * leaving any remaining changes in local state still.\n *\n * @public\n */\n resetOnRemoteUpdate?: false;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * another resource.\n *\n * This is the legacy version of the `ResourceField`.\n *\n * @public\n */\nexport interface LinksModeBelongsToField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'belongsTo';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LinksModeBelongsToField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for belongsTo are mandatory.\n *\n * @public\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * MUST be false for PolarisMode + LinksMode\n *\n * @public\n */\n async: false;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * If the inverse field definition uses a sourceKey,\n * this should still be the name of the field, not the sourceKey.\n *\n * @public\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * MUST be true for PolarisMode + LinksMode\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * (`async: false`, currently the only supported combination) must satisfy\n * one of the following whenever pushed to the cache:\n *\n * - a `links.related` link is present, **or**\n * - the relationship is fully linked: `data` is `null`, or `data` points\n * to a resource present in the document's `included` array\n *\n * A related link lets you omit the related resource from `included`; a\n * `data` key that is missing entirely, or explicitly `undefined`, is never\n * valid unless a `links.related` link is present.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriend: {\n * links: { related: \"/users/1/bestFriend\" },\n * data: { type: 'user', id: '1' },\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * Activating LinksMode will *also* deactivate the deprecated\n * `resetOnRemoteUpdate` behavior for this field.\n *\n * This means that when new remote state is received, the cache\n * will intelligently commit any changes from local state that\n * are present in the remote data for this field, leaving any remaining\n * changes in local state still.\n *\n * Previously, the cache would clear local state of all changes\n * except for the addition of records still in the \"new\" state any\n * time the remote data for this field was updated.\n *\n * @public\n */\n linksMode: true;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * a collection of other resources.\n *\n * This is the legacy version of the `CollectionField`.\n *\n * @public\n */\nexport interface LegacyHasManyField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'hasMany';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LegacyHasManyField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * the name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for hasMany are mandatory.\n *\n * @public\n */\n options: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * or pointers that can be used to fetch\n * the related resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * hasMany relationships do not support pagination.\n *\n * @public\n */\n async: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * If the inverse field definition uses a sourceKey,\n * this should still be the name of the field, not the sourceKey.\n *\n * @public\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * (`async: false`, currently the only supported combination) must satisfy\n * one of the following whenever pushed to the cache:\n *\n * - a `links.related` link is present, **or**\n * - the relationship is fully linked: `data` is `[]`, or every resource\n * identifier in `data` is present in the document's `included` array\n *\n * A related link lets you omit the related resources from `included`; a\n * `data` key that is missing entirely, or explicitly `undefined`, is never\n * valid unless a `links.related` link is present.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriends: {\n * links: { related: \"/users/1/bestFriends\" },\n * data: [ { type: 'user', id: '1' } ],\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * @public\n */\n linksMode?: true;\n\n /**\n * When omitted, the cache data for this field will\n * clear local state of all changes except for the\n * addition of records still in the \"new\" state any\n * time the remote data for this field is updated.\n *\n * When set to `false`, the cache data for this field\n * will instead intelligently commit any changes from\n * local state that are present in the remote data,\n * leaving any remaining changes in local state still.\n *\n * @public\n */\n resetOnRemoteUpdate?: false;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * a collection of other resources.\n *\n * This is the legacy version of the `CollectionField`.\n *\n * @public\n */\nexport interface LinksModeHasManyField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'hasMany';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the field as returned by the API\n * and inserted into the {@link Cache} if it differs\n * from {@link LinksModeHasManyField.name}\n *\n * For instance, if the API returns:\n *\n * ```ts\n * {\n * attributes: {\n * 'first-name': 'Chris'\n * }\n * }\n * ```\n *\n * But the app desires to use `record.firstName; // 'Chris'`\n *\n * Then `name` would be set to `'firstName'` and\n * `sourceKey` would be set to `'first-name'`.\n *\n * This option is only needed when the value differs from name.\n */\n sourceKey?: string;\n\n /**\n * the name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @public\n */\n type: string;\n\n /**\n * Options for hasMany are mandatory.\n *\n * @public\n */\n options: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n /**\n * Whether the relationship is async\n *\n * MUST be false for PolarisMode + LinksMode\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * or pointers that can be used to fetch\n * the related resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * hasMany relationships do not support pagination.\n *\n * @public\n */\n async: false;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * If the inverse field definition uses a sourceKey,\n * this should still be the name of the field, not the sourceKey.\n *\n * @public\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @public\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @public\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * MUST be true for PolarisMode + LinksMode\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * (`async: false`, currently the only supported combination) must satisfy\n * one of the following whenever pushed to the cache:\n *\n * - a `links.related` link is present, **or**\n * - the relationship is fully linked: `data` is `[]`, or every resource\n * identifier in `data` is present in the document's `included` array\n *\n * A related link lets you omit the related resources from `included`; a\n * `data` key that is missing entirely, or explicitly `undefined`, is never\n * valid unless a `links.related` link is present.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriends: {\n * links: { related: \"/users/1/bestFriends\" },\n * data: [ { type: 'user', id: '1' } ],\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * Activating LinksMode will *also* deactivate the deprecated\n * `resetOnRemoteUpdate` behavior for this field.\n *\n * This means that when new remote state is received, the cache\n * will intelligently commit any changes from local state that\n * are present in the remote data for this field, leaving any remaining\n * changes in local state still.\n *\n * Previously, the cache would clear local state of all changes\n * except for the addition of records still in the \"new\" state any\n * time the remote data for this field was updated.\n *\n * @public\n */\n linksMode: true;\n };\n}\n\n/**\n * A union of all possible LegacyMode field schemas.\n *\n * Available field schemas are:\n *\n * - {@link GenericField}\n * - {@link LegacyAliasField}\n * - {@link LocalField}\n * - {@link ObjectField}\n * - {@link SchemaObjectField}\n * - {@link ArrayField}\n * - {@link SchemaArrayField}\n * - {@link DerivedField}\n * - {@link ResourceField | ResourceField (not yet implemented)}\n * - {@link CollectionField | CollectionField (not yet implemented)}\n * - {@link LegacyAttributeField}\n * - {@link LegacyBelongsToField}\n * - {@link LegacyHasManyField}\n *\n * @public\n */\nexport type LegacyModeFieldSchema =\n | GenericField\n | LegacyAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n // | ResourceField // not yet implemented\n // | CollectionField // not yet implemented\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField;\n\n/**\n * A union of all possible PolarisMode field schemas.\n *\n * Available field schemas are:\n *\n * - {@link GenericField}\n * - {@link PolarisAliasField}\n * - {@link LocalField}\n * - {@link ObjectField}\n * - {@link SchemaObjectField}\n * - {@link ArrayField}\n * - {@link SchemaArrayField}\n * - {@link DerivedField}\n * - {@link ResourceField | ResourceField (not yet implemented)}\n * - {@link CollectionField | CollectionField (not yet implemented)}\n * - {@link LinksModeBelongsToField}\n * - {@link LinksModeHasManyField}\n *\n * @public\n */\nexport type PolarisModeFieldSchema =\n | GenericField\n | PolarisAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n // | ResourceField\n // | CollectionField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all possible LegacyMode and PolarisMode\n * field schemas.\n *\n * You likely will want to use PolarisModeFieldSchema,\n * LegacyModeFieldSchema, or ObjectFieldSchema instead\n * as appropriate as they are more specific and will\n * provide better guidance around what is valid.\n *\n * @public\n */\nexport type FieldSchema =\n | GenericField\n | LegacyAliasField\n | PolarisAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n | ResourceField\n | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all possible LegacyMode and PolarisMode\n * field schemas that represent data that could be in\n * the cache.\n *\n * In other words this will not include types like alias\n * fields, local fields, or derived fields.\n *\n * @public\n */\nexport type CacheableFieldSchema =\n | IdentityField\n | GenericField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | ResourceField\n | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all possible field schemas that can be\n * used in an ObjectSchema.\n *\n * @public\n */\nexport type ObjectFieldSchema =\n | LegacyAttributeField\n | GenericField\n | ObjectAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField;\n\n/**\n * Represents a schema for a primary resource in PolarisMode.\n *\n * Primary resources are objects with a unique identity of their\n * own which may allow them to appear in relationships, or in multiple\n * response documents.\n *\n * @public\n */\nexport interface PolarisResourceSchema {\n /**\n * A flag indicating that this is not a legacy resource schema.\n *\n * @public\n */\n legacy?: false;\n\n /**\n * For primary resources, this should be an IdentityField\n *\n * for schema-objects, this should be either a HashField or null\n *\n * @public\n */\n identity: IdentityField;\n\n /**\n * The name of the schema\n *\n * For cacheable resources, this should be the\n * primary resource type.\n *\n * For object schemas, this should be the name\n * of the object schema.\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the resource\n *\n * @public\n */\n fields: PolarisModeFieldSchema[];\n\n /**\n * A list of traits that this resource implements. The fields for these\n * traits should still be defined in the fields array.\n *\n * Each trait should be a string that matches the `type` of another\n * resource schema. The trait can be abstract and reference a resource\n * type that is never defined as a schema.\n *\n * @public\n */\n traits?: string[];\n}\n\n/**\n * Represents a schema for a primary resource in LegacyMode\n *\n * Primary resources are objects with a unique identity of their\n * own which may allow them to appear in relationships, or in multiple\n * response documents.\n *\n * @public\n */\nexport interface LegacyResourceSchema {\n /**\n * A flag indicating that this is a legacy resource schema\n *\n * @public\n */\n legacy: true;\n\n /**\n * This should be an IdentityField.\n *\n * To maximize compatibility with Model where `id` was the\n * name of the identity field, we recommend using `{ kind: '@id', name: 'id' }`\n * for records in legacy mode, but this is not required.\n *\n * @public\n */\n identity: IdentityField;\n\n /**\n * The name of the schema\n *\n * For cacheable resources, this should be the\n * primary resource type.\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the resource\n *\n * @public\n */\n fields: LegacyModeFieldSchema[];\n\n /**\n * A list of traits that this resource implements. The fields for these\n * traits should still be defined in the fields array.\n *\n * Each trait should be a string that matches the `type` of another\n * resource schema. The trait can be abstract and reference a resource\n * type that is never defined as a schema.\n *\n * @public\n */\n traits?: string[];\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this resource should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n}\n\n/**\n * A type which represents a valid JSON schema\n * definition for either a PolarisMode or a\n * LegacyMode resource.\n *\n * Note, this is separate from the type returned\n * by the SchemaService which provides fields as a Map\n * instead of as an Array.\n *\n * @public\n */\nexport type ResourceSchema = PolarisResourceSchema | LegacyResourceSchema;\n\n/**\n * Represents a schema for an object that is not\n * a primary resource (has no unique identity of its own).\n *\n * ObjectSchemas may not currently contain relationships.\n *\n * @public\n */\nexport interface ObjectSchema {\n /**\n * Either a HashField from which to calculate an identity or null\n *\n * In the case of `null`, the object's identity will be based\n * on the referential identity of the object in the cache itself\n * when an identity is needed.\n *\n * @public\n */\n identity: HashField | null;\n\n /**\n * The name of the schema\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the object\n *\n * @public\n */\n fields: ObjectFieldSchema[];\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n}\n\n/**\n * A union of {@link ResourceSchema} and {@link ObjectSchema} representing\n * any schema that can be registered with or returned by the SchemaService.\n *\n * @public\n */\nexport type Schema = ResourceSchema | ObjectSchema;\n\n/**\n * A trait for use on a PolarisMode record.\n *\n * Traits are reusable collections of fields that can be composed onto a\n * resource schema, often to describe a polymorphic capability shared by\n * multiple resource types.\n */\nexport interface PolarisTrait {\n /**\n * The name of the trait.\n *\n * This is the string referenced by a resource schema's `traits` array,\n * or by another trait's `traits` array, in order to make use of this\n * trait.\n */\n name: string;\n\n /**\n * The mode this trait is valid for use with.\n *\n * A PolarisTrait may only be applied to PolarisMode resource schemas.\n */\n mode: 'polaris';\n\n /**\n * The fields that this trait contributes to any resource schema\n * that implements it.\n */\n fields: PolarisModeFieldSchema[];\n\n /**\n * A list of other traits that this trait itself implements.\n *\n * As with a resource schema's `traits`, each entry should be a string\n * matching the `name` of another trait.\n */\n traits?: string[];\n}\n\n/**\n * A trait for use on a LegacyMode record.\n *\n * Traits are reusable collections of fields that can be composed onto a\n * resource schema, often to describe a polymorphic capability shared by\n * multiple resource types.\n */\nexport interface LegacyTrait {\n /**\n * The name of the trait.\n *\n * This is the string referenced by a resource schema's `traits` array,\n * or by another trait's `traits` array, in order to make use of this\n * trait.\n */\n name: string;\n\n /**\n * The mode this trait is valid for use with.\n *\n * A LegacyTrait may only be applied to LegacyMode resource schemas.\n */\n mode: 'legacy';\n\n /**\n * The fields that this trait contributes to any resource schema\n * that implements it.\n */\n fields: LegacyModeFieldSchema[];\n\n /**\n * A list of other traits that this trait itself implements.\n *\n * As with a resource schema's `traits`, each entry should be a string\n * matching the `name` of another trait.\n */\n traits?: string[];\n}\n\n/**\n * A union of\n * - {@link LegacyTrait}\n * - {@link PolarisTrait}\n */\nexport type Trait = LegacyTrait | PolarisTrait;\n\n/**\n * A no-op type utility that enables type-checking resource schema\n * definitions.\n *\n * Will return the passed in schema.\n *\n * This will not validate relationship inverses or related types,\n * as doing so would require a full schema graph to be passed in\n * and no cycles in the graph to be present.\n *\n * @public\n */\nexport function resourceSchema<T extends LegacyResourceSchema | PolarisResourceSchema>(\n schema: LegacyResourceSchema | PolarisResourceSchema\n): T {\n return schema as T;\n}\n\n/**\n * A no-op type utility that enables type-checking object schema\n * definitions.\n *\n * Will return the passed in schema.\n *\n * @public\n */\nexport function objectSchema<T extends ObjectSchema>(schema: T): T {\n return schema;\n}\n\n/**\n * A type utility to narrow a schema to a ResourceSchema\n *\n * @public\n */\nexport function isResourceSchema(schema: ResourceSchema | ObjectSchema): schema is ResourceSchema {\n return schema?.identity?.kind === '@id';\n}\n\n/**\n * A type utility to narrow a schema to LegacyResourceSchema\n *\n * @public\n */\nexport function isLegacyResourceSchema(schema: ResourceSchema | ObjectSchema): schema is LegacyResourceSchema {\n return isResourceSchema(schema) && schema.legacy === true;\n}\n\n/**\n * A union of all field schemas considered \"legacy\", i.e. those historically\n * associated with `@warp-drive/legacy/model`'s Attribute, BelongsTo and\n * HasMany fields, including their LinksMode variants.\n *\n * Available field schemas are:\n *\n * - {@link LegacyAttributeField}\n * - {@link LegacyBelongsToField}\n * - {@link LegacyHasManyField}\n * - {@link LinksModeBelongsToField}\n * - {@link LinksModeHasManyField}\n *\n * @public\n */\nexport type LegacyField =\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all legacy relationship field schemas, i.e. {@link LegacyField}\n * excluding {@link LegacyAttributeField}.\n *\n * Available field schemas are:\n *\n * - {@link LegacyBelongsToField}\n * - {@link LegacyHasManyField}\n * - {@link LinksModeBelongsToField}\n * - {@link LinksModeHasManyField}\n *\n * @public\n */\nexport type LegacyRelationshipField =\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA68EA,SAAgBA,eACdC,QACG;CACH,OAAOA;AACT;;;;;;;;;AAUA,SAAgBC,aAAqCD,QAAc;CACjE,OAAOA;AACT;;;;;;AAOA,SAAgBE,iBAAiBF,QAAiE;CAChG,OAAOA,QAAQG,UAAUC,SAAS;AACpC;;;;;;AAOA,SAAgBC,uBAAuBL,QAAuE;CAC5G,OAAOE,iBAAiBF,MAAM,KAAKA,OAAOM,WAAW;AACvD"}
@@ -1,4 +1,4 @@
1
- import { t as getOrSetGlobal } from "../-private-2RfQ2761.js";
1
+ import { t as getOrSetGlobal } from "../-private-DhiS6yOR.js";
2
2
 
3
3
  //#region src/types/symbols.ts
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"symbols.js","names":["getOrSetGlobal","RecordStore","Symbol","Type","ResourceType","TransformName","RequestSignature"],"sources":["../../../../src/types/symbols.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Store } from '../store/-private/store-service.ts';\nimport { getOrSetGlobal } from './-private.ts';\n\n/**\n * Symbol used internally to stash a reference to the owning\n * {@link Store} on a record instance.\n *\n * @type {Symbol}\n */\nexport const RecordStore: '___(unique) Symbol(Store)' = getOrSetGlobal('Store', Symbol('Store'));\n\n/**\n * Symbol for the name of a resource, transformation\n * or derivation.\n *\n * ### With Resources\n *\n * This is an optional feature that can be used by\n * record implementations to provide a typescript\n * hint for the type of the resource.\n *\n * When used, WarpDrive APIs can\n * take advantage of this to provide better type\n * safety and intellisense.\n *\n * ### With Derivations\n *\n * Required for derivations registered with\n * `store.registerDerivation(derivation)`.\n *\n * ```ts\n * function concat(record: object, options: ObjectValue | null, prop: string): string {}\n * concat[Name] = 'concat';\n * ```\n *\n * ### With Transforms\n *\n * Required for new-style transformations registered\n * with `store.registerTransform(transform)`.\n *\n * For legacy transforms, if not used,\n * `attr<Transform>('name')` will allow any string name.\n * `attr('name')` will always allow any string name.\n *\n * If used, `attr<Transform>('name')` will enforce\n * that the name is the same as the transform name.\n *\n * @type {Symbol}\n */\nexport const Type: '___(unique) Symbol($type)' = getOrSetGlobal('$type', Symbol('$type'));\n\n/**\n * Symbol for the type of a resource.\n *\n * This is an optional feature that can be used by\n * record implementations to provide a typescript\n * hint for the type of the resource.\n *\n * When used, WarpDrive APIs can\n * take advantage of this to provide better type\n * safety and intellisense.\n *\n * @type {Symbol}\n */\nexport const ResourceType: '___(unique) Symbol($type)' = Type;\n\n/**\n * Symbol for the name of a transform.\n *\n * This is an optional feature that can be used by\n * transform implementations to provide a typescript\n * hint for the name of the transform.\n *\n * If not used, `attr<Transform>('name')` will\n * allow any string name. `attr('name')` will always\n * allow any string name.\n *\n * If used, `attr<Transform>('name')` will enforce\n * that the name is the same as the transform name.\n *\n * @type {Symbol}\n */\nexport const TransformName: '___(unique) Symbol($type)' = Type;\n\n/**\n * Symbol for use by builders to indicate the return type\n * generic to use for store.request()\n *\n * @type {Symbol}\n */\nexport const RequestSignature: '___(unique) Symbol(RequestSignature)' = getOrSetGlobal(\n 'RequestSignature',\n Symbol('RequestSignature')\n);\n"],"mappings":";;;;;;;;;AAUA,MAAaC,cAA2CD,eAAe,SAASE,OAAO,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwC/F,MAAaC,OAAoCH,eAAe,SAASE,OAAO,OAAO,CAAC;;;;;;;;;;;;;;AAexF,MAAaE,eAA4CD;;;;;;;;;;;;;;;;;AAkBzD,MAAaE,gBAA6CF;;;;;;;AAQ1D,MAAaG,mBAA2DN,eACtE,oBACAE,OAAO,kBAAkB,CAC3B"}
1
+ {"version":3,"file":"symbols.js","names":["getOrSetGlobal","RecordStore","Symbol","Type","ResourceType","TransformName","RequestSignature"],"sources":["../../../../src/types/symbols.ts"],"sourcesContent":["// oxlint-disable-next-line no-unused-vars\nimport type { Store } from '../store/-private/store-service.ts';\nimport { getOrSetGlobal } from './-private.ts';\n\n/**\n * Symbol used internally to stash a reference to the owning\n * {@link Store} on a record instance.\n *\n * @type {Symbol}\n */\nexport const RecordStore: '___(unique) Symbol(Store)' = getOrSetGlobal('Store', Symbol('Store'));\n\n/**\n * Symbol for the name of a resource, transformation\n * or derivation.\n *\n * ### With Resources\n *\n * This is an optional feature that can be used by\n * record implementations to provide a typescript\n * hint for the type of the resource.\n *\n * When used, WarpDrive APIs can\n * take advantage of this to provide better type\n * safety and intellisense.\n *\n * ### With Derivations\n *\n * Required for derivations registered with\n * `store.registerDerivation(derivation)`.\n *\n * ```ts\n * function concat(record: object, options: ObjectValue | null, prop: string): string {}\n * concat[Name] = 'concat';\n * ```\n *\n * ### With Transforms\n *\n * Required for new-style transformations registered\n * with `store.registerTransform(transform)`.\n *\n * For legacy transforms, if not used,\n * `attr<Transform>('name')` will allow any string name.\n * `attr('name')` will always allow any string name.\n *\n * If used, `attr<Transform>('name')` will enforce\n * that the name is the same as the transform name.\n *\n * @type {Symbol}\n */\nexport const Type: '___(unique) Symbol($type)' = getOrSetGlobal('$type', Symbol('$type'));\n\n/**\n * Symbol for the type of a resource.\n *\n * This is an optional feature that can be used by\n * record implementations to provide a typescript\n * hint for the type of the resource.\n *\n * When used, WarpDrive APIs can\n * take advantage of this to provide better type\n * safety and intellisense.\n *\n * @type {Symbol}\n */\nexport const ResourceType: '___(unique) Symbol($type)' = Type;\n\n/**\n * Symbol for the name of a transform.\n *\n * This is an optional feature that can be used by\n * transform implementations to provide a typescript\n * hint for the name of the transform.\n *\n * If not used, `attr<Transform>('name')` will\n * allow any string name. `attr('name')` will always\n * allow any string name.\n *\n * If used, `attr<Transform>('name')` will enforce\n * that the name is the same as the transform name.\n *\n * @type {Symbol}\n */\nexport const TransformName: '___(unique) Symbol($type)' = Type;\n\n/**\n * Symbol for use by builders to indicate the return type\n * generic to use for store.request()\n *\n * @type {Symbol}\n */\nexport const RequestSignature: '___(unique) Symbol(RequestSignature)' = getOrSetGlobal(\n 'RequestSignature',\n Symbol('RequestSignature')\n);\n"],"mappings":";;;;;;;;;AAUA,MAAaC,cAA2CD,eAAe,SAASE,OAAO,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwC/F,MAAaC,OAAoCH,eAAe,SAASE,OAAO,OAAO,CAAC;;;;;;;;;;;;;;AAexF,MAAaE,eAA4CD;;;;;;;;;;;;;;;;;AAkBzD,MAAaE,gBAA6CF;;;;;;;AAQ1D,MAAaG,mBAA2DN,eACtE,oBACAE,OAAO,kBAAkB,CAC3B"}
@@ -0,0 +1,22 @@
1
+ import { t as getOrSetGlobal } from "./-private-B6aLbrgV.js";
2
+
3
+ //#region src/reactive/-private/symbols.ts
4
+ const SOURCE = getOrSetGlobal("SOURCE", Symbol("#source"));
5
+ const Destroy = getOrSetGlobal("Destroy", Symbol.dispose || Symbol.for("Dispose"));
6
+ /**
7
+ * Symbol for the method used to request a mutable copy of an otherwise
8
+ * immutable {@link ReactiveResource}.
9
+ *
10
+ * @deprecated use the {@link checkout} utility function instead.
11
+ */
12
+ const Checkout = getOrSetGlobal("Checkout", Symbol("Checkout"));
13
+ const Commit = getOrSetGlobal("Commit", Symbol("Commit"));
14
+ /**
15
+ * Symbol used to stash the internal field/resource context (schema, store,
16
+ * mutability, etc.) on a {@link ReactiveResource} or reactive field instance.
17
+ */
18
+ const Context = getOrSetGlobal("Context", Symbol("Context"));
19
+
20
+ //#endregion
21
+ export { SOURCE as a, Destroy as i, Commit as n, Context as r, Checkout as t };
22
+ //# sourceMappingURL=-private-8gd8hbwm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"-private-Z9i0icpE.js","names":["getOrSetGlobal","SOURCE","Symbol","Destroy","dispose","for","Checkout","Commit","Context"],"sources":["../../../src/reactive/-private/symbols.ts"],"sourcesContent":["///////////////////\n///// WARNING /////\n///////////////////\n\nimport { getOrSetGlobal } from '../../types/-private';\n\n// Great, got your attention with that warning didn't we?\n// Good. Here's the deal: typescript treats symbols as unique types.\n// If by accident a module creating a symbol is processed more than\n// once, the symbol will be different in each processing. This will\n// cause a type error.\n// It could also cause a runtime error if the symbol is used innapropriately.\n// However, this case is extremely hard to hit and would require other things\n// to go wrong first.\n//\n// So, why do the warning? And why do we lie about the types of the symbols?\n//\n// Because we intentionally create multiple copies of them within the types\n// at build time. This is because we rollup our d.ts files in order to give\n// our consumers a better experience.\n//\n// However, no tool today supports rolling up d.ts files with multiple entry\n// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor\n// which creates a fully unique stand-alone types file per-entry-point. Thus\n// every entry point that uses one of these symbols somewhere will have accidentally\n// created a new symbol type.\n//\n// This cast allows us to rollup these types using this tool while not encountering\n// the unique symbol type issue.\n//\n// Note that none of these symbols are part of the public API, these are used for\n// debugging DX and as a safe way to provide an intimate contract on public objects.\n\nexport const SOURCE: '___(unique) Symbol(SOURCE)' = getOrSetGlobal('SOURCE', Symbol('#source'));\n\nexport const Destroy: '___(unique) Symbol(Destroy)' = getOrSetGlobal(\n 'Destroy',\n Symbol.dispose || Symbol.for('Dispose')\n);\n/**\n * Symbol for the method used to request a mutable copy of an otherwise\n * immutable {@link ReactiveResource}.\n *\n * @deprecated use the {@link checkout} utility function instead.\n */\nexport const Checkout: '___(unique) Symbol(Checkout)' = getOrSetGlobal('Checkout', Symbol('Checkout'));\nexport const Commit: '___(unique) Symbol(Commit)' = getOrSetGlobal('Commit', Symbol('Commit'));\n\n/**\n * Symbol used to stash the internal field/resource context (schema, store,\n * mutability, etc.) on a {@link ReactiveResource} or reactive field instance.\n */\nexport const Context: '___(unique) Symbol(Context)' = getOrSetGlobal('Context', Symbol('Context'));\n"],"mappings":";;;AAiCA,MAAaC,SAAuCD,eAAe,UAAUE,OAAO,SAAS,CAAC;AAE9F,MAAaC,UAAyCH,eACpD,WACAE,OAAOE,WAAWF,OAAOG,IAAI,SAAS,CACxC;;;;;;;AAOA,MAAaC,WAA2CN,eAAe,YAAYE,OAAO,UAAU,CAAC;AACrG,MAAaK,SAAuCP,eAAe,UAAUE,OAAO,QAAQ,CAAC;;;;;AAM7F,MAAaM,UAAyCR,eAAe,WAAWE,OAAO,SAAS,CAAC"}
1
+ {"version":3,"file":"-private-8gd8hbwm.js","names":["getOrSetGlobal","SOURCE","Symbol","Destroy","dispose","for","Checkout","Commit","Context"],"sources":["../../../src/reactive/-private/symbols.ts"],"sourcesContent":["///////////////////\n///// WARNING /////\n///////////////////\n\nimport { getOrSetGlobal } from '../../types/-private';\n\n// Great, got your attention with that warning didn't we?\n// Good. Here's the deal: typescript treats symbols as unique types.\n// If by accident a module creating a symbol is processed more than\n// once, the symbol will be different in each processing. This will\n// cause a type error.\n// It could also cause a runtime error if the symbol is used innapropriately.\n// However, this case is extremely hard to hit and would require other things\n// to go wrong first.\n//\n// So, why do the warning? And why do we lie about the types of the symbols?\n//\n// Because we intentionally create multiple copies of them within the types\n// at build time. This is because we rollup our d.ts files in order to give\n// our consumers a better experience.\n//\n// However, no tool today supports rolling up d.ts files with multiple entry\n// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor\n// which creates a fully unique stand-alone types file per-entry-point. Thus\n// every entry point that uses one of these symbols somewhere will have accidentally\n// created a new symbol type.\n//\n// This cast allows us to rollup these types using this tool while not encountering\n// the unique symbol type issue.\n//\n// Note that none of these symbols are part of the public API, these are used for\n// debugging DX and as a safe way to provide an intimate contract on public objects.\n\nexport const SOURCE: '___(unique) Symbol(SOURCE)' = getOrSetGlobal('SOURCE', Symbol('#source'));\n\nexport const Destroy: '___(unique) Symbol(Destroy)' = getOrSetGlobal(\n 'Destroy',\n Symbol.dispose || Symbol.for('Dispose')\n);\n/**\n * Symbol for the method used to request a mutable copy of an otherwise\n * immutable {@link ReactiveResource}.\n *\n * @deprecated use the {@link checkout} utility function instead.\n */\nexport const Checkout: '___(unique) Symbol(Checkout)' = getOrSetGlobal('Checkout', Symbol('Checkout'));\nexport const Commit: '___(unique) Symbol(Commit)' = getOrSetGlobal('Commit', Symbol('Commit'));\n\n/**\n * Symbol used to stash the internal field/resource context (schema, store,\n * mutability, etc.) on a {@link ReactiveResource} or reactive field instance.\n */\nexport const Context: '___(unique) Symbol(Context)' = getOrSetGlobal('Context', Symbol('Context'));\n"],"mappings":";;;AAiCA,MAAaC,SAAuCD,eAAe,UAAUE,OAAO,SAAS,CAAC;AAE9F,MAAaC,UAAyCH,eACpD,WACAE,OAAOE,WAAWF,OAAOG,IAAI,SAAS,CACxC;;;;;;;AAOA,MAAaC,WAA2CN,eAAe,YAAYE,OAAO,UAAU,CAAC;AACrG,MAAaK,SAAuCP,eAAe,UAAUE,OAAO,QAAQ,CAAC;;;;;AAM7F,MAAaM,UAAyCR,eAAe,WAAWE,OAAO,SAAS,CAAC"}
@@ -1,6 +1,6 @@
1
1
  //#region package.json
2
2
  var name = "@warp-drive/core";
3
- var version = "5.9.0-beta.1";
3
+ var version = "5.9.0-beta.3";
4
4
 
5
5
  //#endregion
6
6
  //#region src/types/-private.ts
@@ -96,4 +96,4 @@ function setUniversalTransient(key, value) {
96
96
 
97
97
  //#endregion
98
98
  export { setTransient as a, peekUniversalTransient as i, getOrSetUniversal as n, setUniversalTransient as o, peekTransient as r, getOrSetGlobal as t };
99
- //# sourceMappingURL=-private-BK71-uXR.js.map
99
+ //# sourceMappingURL=-private-B6aLbrgV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"-private-B6aLbrgV.js","names":["name","version","GlobalRef","globalThis","UniversalCache","__warpDrive_universalCache","__version","GlobalSink","ModuleScopedCaches","__warpDrive_ModuleScopedCaches","__warpDrive_hasOtherCopy","Error","getOrSetGlobal","key","value","peekTransient","globalKey","setTransient","getOrSetUniversal","peekUniversalTransient","setUniversalTransient"],"sources":["../../../package.json","../../../src/types/-private.ts"],"sourcesContent":["","// in testing mode, we utilize globals to ensure only one copy exists of\n// these maps, due to bugs in ember-auto-import\nimport { DEBUG, TESTING } from '@warp-drive/core/build-config/env';\n\nimport { name, version } from '../../package.json';\n\ntype UniversalTransientKey =\n // @warp-drive/core/request\n 'REQ_ID';\n\ntype UniversalKey =\n | `(transient) ${UniversalTransientKey}`\n // @warp-drive/core/request\n | 'RequestMap'\n | 'PromiseCache'\n | 'RequestCache'\n // @warp-drive/core-types/request\n | 'SkipCache'\n | 'EnableHydration'\n // @warp-drive/core-types/runtime\n | 'WarpDriveRuntimeConfig';\n\ntype TransientKey =\n // @warp-drive/core/graph\n | 'transactionRef'\n // @warp-drive/core/store\n | 'configuredGenerationMethod'\n | 'configuredUpdateMethod'\n | 'configuredForgetMethod'\n | 'configuredResetMethod'\n | 'configuredKeyInfoMethod'\n | 'signalHooks';\n\ntype GlobalKey =\n | `(transient) ${TransientKey}`\n // @warp-drive/legacy/adapter\n | 'AdapterError'\n | 'InvalidError'\n | 'TimeoutError'\n | 'AbortError'\n | 'UnauthorizedError'\n | 'ForbiddenError'\n | 'NotFoundError'\n | 'ConflictError'\n | 'ServerError'\n // @warp-drive/core/store/reactivity\n | '#{}'\n | '#[]'\n | 'Signals'\n // @warp-drive/legacy LegacySupport\n | 'AvailableShims'\n // @warp-drive/core RecordArrayManager\n | 'FAKE_ARR'\n // @warp-drive/core ReactiveArray\n | '#source'\n | '#update'\n | '#notify'\n | 'IS_COLLECTION'\n // @warp-drive/core RequestCache\n | 'Touching'\n | 'RequestPromise'\n // @warp-drive/legacy/compat FetchManager\n | 'SaveOp'\n // @warp-drive/legacy Model\n | 'LEGACY_SUPPORT'\n | 'LegacySupport'\n // @warp-drive/core/graph\n | 'Graphs'\n // @warp-drive/core/request\n | 'IS_FROZEN'\n | 'IS_CACHE_HANDLER'\n // @warp-drive/utilities\n | 'CONFIG'\n // @warp-drive/core CacheKeyManager\n | 'DEBUG_MAP'\n | 'IDENTIFIERS'\n | 'DOCUMENTS'\n // @warp-drive/core InstanceCache\n | 'RecordCache'\n | 'StoreMap'\n // @warp-drive/core/types/symbols\n | 'Store'\n | '$type'\n | 'TransformName'\n | 'RequestSignature'\n // @warp-drive/core/types/request\n | 'IS_FUTURE'\n | 'DOC'\n // @warp-drive/core NotificationManager\n | 'UnscopedChannel'\n // @warp-drive/core/reactive\n | 'ManagedArrayMap'\n | 'ManagedObjectMap'\n | 'Support'\n | 'SOURCE'\n | 'Destroy'\n | 'Checkout'\n | 'Commit'\n | 'Context';\n\ntype ModuleScopedCaches = Record<GlobalKey, unknown>;\n\nconst GlobalRef = globalThis as unknown as Record<\n string,\n {\n __warpDrive_ModuleScopedCaches?: ModuleScopedCaches;\n __warpDrive_hasOtherCopy?: boolean;\n __version: string;\n }\n> & {\n __warpDrive_universalCache: Record<UniversalKey, unknown>;\n};\nconst UniversalCache = (GlobalRef.__warpDrive_universalCache =\n GlobalRef.__warpDrive_universalCache ?? ({} as Record<UniversalKey, unknown>));\n\n// in order to support mirror packages, we ensure that each\n// unique package name has its own global cache\nGlobalRef[name] = GlobalRef[name] ?? { __version: version };\nconst GlobalSink = GlobalRef[name];\n\nif (DEBUG) {\n if (GlobalSink.__version !== version) {\n throw new Error('Multiple versions of WarpDrive detected, the application will malfunction.');\n }\n}\n\nconst ModuleScopedCaches = GlobalSink.__warpDrive_ModuleScopedCaches ?? ({} as ModuleScopedCaches);\nif (TESTING) {\n if (!GlobalSink.__warpDrive_ModuleScopedCaches) {\n GlobalSink.__warpDrive_ModuleScopedCaches = ModuleScopedCaches;\n } else {\n // oxlint-disable-next-line no-console\n console.warn(`\nMultiple copies of WarpDrive have been detected. This may be due to a bug in ember-auto-import\n in which test assets get their own copy of some v2-addons. This can cause the application to\n malfunction as each copy will maintain its own separate state.`);\n }\n} else {\n if (GlobalSink.__warpDrive_hasOtherCopy) {\n throw new Error('Multiple copies of WarpDrive detected, the application will malfunction.');\n }\n GlobalSink.__warpDrive_hasOtherCopy = true;\n}\n\ntype UniqueSymbol<T extends string> = `___(unique) Symbol(${T})`;\ntype UniqueSymbolOr<T, K extends string> = T extends symbol ? UniqueSymbol<K> : T;\n\n/**\n * Coordinates creation of a singleton `value` (e.g. a symbol, WeakMap, or\n * error class) for `key` so that duplicate copies of this package loaded\n * into the same process observe the same instance instead of each creating\n * their own.\n *\n * In `TESTING` builds this stores/reads `value` from a cache namespaced to\n * this package's name on `globalThis` (see the file-level comments above for\n * why this is necessary). Outside of `TESTING`, only one copy of the package\n * is expected to exist, so this is a no-op that always returns `value`\n * unchanged.\n *\n * The return type lies about symbols being unique to work around the d.ts\n * rollup issue described in `reactive/-private/symbols.ts`.\n *\n * @private\n */\nexport function getOrSetGlobal<T, K extends GlobalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = ModuleScopedCaches[key];\n if (existing === undefined) {\n return (ModuleScopedCaches[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\n/**\n * Reads back the current value stored for `key` by {@link setTransient}, or\n * `null` if nothing has been stored yet.\n *\n * Unlike {@link getOrSetGlobal}, this always reads through the same\n * package-namespaced cache regardless of the `TESTING` flag, since this is\n * used for genuinely mutable state (not just singleton values) that must\n * stay in sync across any duplicate copies of this package.\n *\n * @private\n */\nexport function peekTransient<T>(key: TransientKey): T | null {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] as T) ?? null;\n}\n\n/**\n * Stores `value` for `key`, overwriting whatever was previously stored, so\n * that it can later be read back via {@link peekTransient}.\n *\n * See {@link peekTransient} for details on when/why this cache is shared.\n *\n * @private\n */\nexport function setTransient<T>(key: TransientKey, value: T): T {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] = value);\n}\n\n/**\n * Like {@link getOrSetGlobal}, but reads/writes a cache that is shared across\n * *all* copies of WarpDrive on `globalThis`, regardless of package name.\n *\n * This is used for keys (e.g. request/promise caches) that must be\n * coordinated even across \"mirror\" packages published under different\n * names, rather than only across duplicate copies of the same package name.\n *\n * @private\n */\nexport function getOrSetUniversal<T, K extends UniversalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = UniversalCache[key];\n if (existing === undefined) {\n return (UniversalCache[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\n/**\n * Like {@link peekTransient}, but reads from the package-name-independent\n * cache used by {@link getOrSetUniversal}. Always reads through this shared\n * cache regardless of the `TESTING` flag.\n *\n * @private\n */\nexport function peekUniversalTransient<T>(key: UniversalTransientKey): T | null {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] as T) ?? null;\n}\n\n/**\n * Like {@link setTransient}, but writes to the package-name-independent\n * cache used by {@link getOrSetUniversal}, so it can later be read via\n * {@link peekUniversalTransient}.\n *\n * @private\n */\nexport function setUniversalTransient<T>(key: UniversalTransientKey, value: T): T {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] = value);\n}\n"],"mappings":";;;;;;ACsGA,MAAME,YAAYC;AAUlB,MAAMC,iBAAkBF,UAAUG,6BAChCH,UAAUG,8BAA+B,CAAC;AAI5CH,UAAUF,QAAQE,UAAUF,SAAS,EAAEM,WAAWL,QAAQ;AAC1D,MAAMM,aAAaL,UAAUF;AAQ7B,MAAMQ,qBAAqBD,WAAWE,kCAAmC,CAAC;AAYxE,IAAIF,WAAWG,0BACb,MAAM,IAAIC,MAAM,0EAA0E;AAE5FJ,WAAWG,2BAA2B;;;;;;;;;;;;;;;;;;AAuBxC,SAAgBE,eAAuCC,KAAQC,OAAgC;CAS3F,OAAOA;AAEX;;;;;;;;;;;;AAaA,SAAgBC,cAAiBF,KAA6B;CAC5D,MAAMG,YAA2C,eAAeH;CAChE,OAAQL,mBAAmBQ,cAAoB;AACjD;;;;;;;;;AAUA,SAAgBC,aAAgBJ,KAAmBC,OAAa;CAC9D,MAAME,YAA2C,eAAeH;CAChE,OAAQL,mBAAmBQ,aAAaF;AAC1C;;;;;;;;;;;AAYA,SAAgBI,kBAA6CL,KAAQC,OAAgC;CASjG,OAAOA;AAEX;;;;;;;;AASA,SAAgBK,uBAA0BN,KAAsC;CAC9E,MAAMG,YAAoD,eAAeH;CACzE,OAAQT,eAAeY,cAAoB;AAC7C;;;;;;;;AASA,SAAgBI,sBAAyBP,KAA4BC,OAAa;CAChF,MAAME,YAAoD,eAAeH;CACzE,OAAQT,eAAeY,aAAaF;AACtC"}