@warp-drive/core 5.9.0-beta.0 → 5.9.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/dist/-private-BYn1Vh-L.js +22 -0
  2. package/dist/-private-BYn1Vh-L.js.map +1 -0
  3. package/dist/-private-CyhhcK1a.js +120 -0
  4. package/dist/-private-CyhhcK1a.js.map +1 -0
  5. package/dist/-private-zrP4VGAf.js +3530 -0
  6. package/dist/-private-zrP4VGAf.js.map +1 -0
  7. package/dist/aliases-BWYW5EhX.d.ts +17 -0
  8. package/dist/aliases-BWYW5EhX.d.ts.map +1 -0
  9. package/dist/build-config/babel-macros.d.ts +2 -0
  10. package/dist/build-config/babel-macros.js +3 -1
  11. package/dist/build-config/canary-features.d.ts +1 -0
  12. package/dist/build-config/canary-features.js +1 -1
  13. package/dist/build-config/debugging.d.ts +1 -0
  14. package/dist/build-config/debugging.js +1 -1
  15. package/dist/build-config/deprecations.d.ts +1 -0
  16. package/dist/build-config/deprecations.js +1 -1
  17. package/dist/build-config/env.d.ts +2 -0
  18. package/dist/build-config/env.js +3 -1
  19. package/dist/build-config/macros.d.ts +2 -0
  20. package/dist/build-config/macros.js +3 -1
  21. package/dist/build-config.d.ts +2 -0
  22. package/dist/build-config.js +3 -1
  23. package/dist/change-C7kqv2kW.d.ts +41 -0
  24. package/dist/change-C7kqv2kW.d.ts.map +1 -0
  25. package/dist/concepts-DFldVwEM.d.ts +77 -0
  26. package/dist/concepts-DFldVwEM.d.ts.map +1 -0
  27. package/dist/configure-B_F639tN.d.ts +134 -0
  28. package/dist/configure-B_F639tN.d.ts.map +1 -0
  29. package/dist/configure.d.ts +2 -0
  30. package/dist/configure.js +3 -2
  31. package/dist/document-BEn91SwT.d.ts +129 -0
  32. package/dist/document-BEn91SwT.d.ts.map +1 -0
  33. package/dist/error-50OSEhsF.d.ts +77 -0
  34. package/dist/error-50OSEhsF.d.ts.map +1 -0
  35. package/dist/fields-FM7peCiM.d.ts +2327 -0
  36. package/dist/fields-FM7peCiM.d.ts.map +1 -0
  37. package/dist/graph/-private.d.ts +2 -0
  38. package/dist/graph/-private.js +2200 -3196
  39. package/dist/graph/-private.js.map +1 -0
  40. package/dist/graph-DLqYXP2z.d.ts +186 -0
  41. package/dist/graph-DLqYXP2z.d.ts.map +1 -0
  42. package/dist/identifier-DQnqOSJK.d.ts +112 -0
  43. package/dist/identifier-DQnqOSJK.d.ts.map +1 -0
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.js +3 -8
  46. package/dist/internal-DtWOpxrR.d.ts +9182 -0
  47. package/dist/internal-DtWOpxrR.d.ts.map +1 -0
  48. package/dist/json-api-raw-C5APJHHB.d.ts +378 -0
  49. package/dist/json-api-raw-C5APJHHB.d.ts.map +1 -0
  50. package/dist/mutations-CqtoGB4t.d.ts +165 -0
  51. package/dist/mutations-CqtoGB4t.d.ts.map +1 -0
  52. package/dist/operations-D1qA6r0_.d.ts +244 -0
  53. package/dist/operations-D1qA6r0_.d.ts.map +1 -0
  54. package/dist/params-DrEx3bf8.d.ts +41 -0
  55. package/dist/params-DrEx3bf8.d.ts.map +1 -0
  56. package/dist/raw-D5hnjiq7.d.ts +31 -0
  57. package/dist/raw-D5hnjiq7.d.ts.map +1 -0
  58. package/dist/reactive/-private.d.ts +2 -0
  59. package/dist/reactive/-private.js +3 -1
  60. package/dist/reactive.d.ts +2 -0
  61. package/dist/reactive.js +5 -4
  62. package/dist/record-D3QQcaIR.d.ts +254 -0
  63. package/dist/record-D3QQcaIR.d.ts.map +1 -0
  64. package/dist/relationship-CmHzMPKf.d.ts +65 -0
  65. package/dist/relationship-CmHzMPKf.d.ts.map +1 -0
  66. package/dist/request-7BJFgSu_.js +766 -0
  67. package/dist/request-7BJFgSu_.js.map +1 -0
  68. package/dist/request.d.ts +2 -0
  69. package/dist/request.js +2 -48
  70. package/dist/signals/-leaked.d.ts +1060 -0
  71. package/dist/signals/-leaked.d.ts.map +1 -0
  72. package/dist/signals/-leaked.js +3 -1
  73. package/dist/src-BOAWJH_S.js +9227 -0
  74. package/dist/src-BOAWJH_S.js.map +1 -0
  75. package/dist/store/-private.d.ts +2 -0
  76. package/dist/store/-private.js +3 -1
  77. package/dist/store-DNF9Rgoh.js +462 -0
  78. package/dist/store-DNF9Rgoh.js.map +1 -0
  79. package/dist/store.d.ts +2 -0
  80. package/dist/store.js +3 -1
  81. package/dist/symbols-DjRDCeX0.d.ts +88 -0
  82. package/dist/symbols-DjRDCeX0.d.ts.map +1 -0
  83. package/dist/types/-private.d.ts +76 -0
  84. package/dist/types/-private.d.ts.map +1 -0
  85. package/dist/types/-private.js +1 -77
  86. package/dist/types/cache/aliases.d.ts +2 -0
  87. package/dist/types/cache/change.d.ts +2 -0
  88. package/dist/types/cache/mutations.d.ts +2 -0
  89. package/dist/types/cache/operations.d.ts +2 -0
  90. package/dist/types/cache/relationship.d.ts +2 -0
  91. package/dist/types/cache.d.ts +2 -0
  92. package/dist/types/graph.d.ts +2 -0
  93. package/dist/types/identifier.d.ts +2 -0
  94. package/dist/types/identifier.js +60 -52
  95. package/dist/types/identifier.js.map +1 -0
  96. package/dist/types/json/raw.d.ts +2 -0
  97. package/dist/types/params.d.ts +2 -0
  98. package/dist/types/record.d.ts +2 -0
  99. package/dist/types/record.js +211 -181
  100. package/dist/types/record.js.map +1 -0
  101. package/dist/types/request.d.ts +2 -0
  102. package/dist/types/request.js +138 -69
  103. package/dist/types/request.js.map +1 -0
  104. package/dist/types/runtime.d.ts +55 -0
  105. package/dist/types/runtime.d.ts.map +1 -0
  106. package/dist/types/runtime.js +54 -26
  107. package/dist/types/runtime.js.map +1 -0
  108. package/dist/types/schema/concepts.d.ts +2 -0
  109. package/dist/types/schema/fields.d.ts +2 -0
  110. package/dist/types/schema/fields.js +501 -495
  111. package/dist/types/schema/fields.js.map +1 -0
  112. package/dist/types/schema/fields.type-test.d.ts +1 -0
  113. package/dist/types/schema/fields.type-test.js +79 -0
  114. package/dist/types/schema/fields.type-test.js.map +1 -0
  115. package/dist/types/schema/schema-service.d.ts +2 -0
  116. package/dist/types/spec/document.d.ts +2 -0
  117. package/dist/types/spec/error.d.ts +2 -0
  118. package/dist/types/spec/json-api-raw.d.ts +2 -0
  119. package/dist/types/symbols.d.ts +2 -0
  120. package/dist/types/symbols.js +84 -77
  121. package/dist/types/symbols.js.map +1 -0
  122. package/dist/types/utils.d.ts +2 -0
  123. package/dist/types.d.ts +3 -0
  124. package/dist/unpkg/dev/-private-BoSTJwp9.js +3519 -0
  125. package/dist/unpkg/dev/-private-BoSTJwp9.js.map +1 -0
  126. package/dist/unpkg/dev/-private-CUkeqUhO.js +22 -0
  127. package/dist/unpkg/dev/-private-CUkeqUhO.js.map +1 -0
  128. package/dist/unpkg/dev/-private-D6Tw25AD.js +111 -0
  129. package/dist/unpkg/dev/-private-D6Tw25AD.js.map +1 -0
  130. package/dist/unpkg/dev/build-config/babel-macros.js +3 -1
  131. package/dist/unpkg/dev/build-config/canary-features.js +1 -1
  132. package/dist/unpkg/dev/build-config/debugging.js +1 -1
  133. package/dist/unpkg/dev/build-config/deprecations.js +1 -1
  134. package/dist/unpkg/dev/build-config/env.js +3 -1
  135. package/dist/unpkg/dev/build-config/macros.js +3 -1
  136. package/dist/unpkg/dev/build-config.js +3 -1
  137. package/dist/unpkg/dev/configure.js +3 -1
  138. package/dist/unpkg/dev/graph/-private.js +1958 -2953
  139. package/dist/unpkg/dev/graph/-private.js.map +1 -0
  140. package/dist/unpkg/dev/index.js +3 -6
  141. package/dist/unpkg/dev/reactive/-private.js +3 -1
  142. package/dist/unpkg/dev/reactive.js +5 -3
  143. package/dist/unpkg/dev/request-CwjpJB3r.js +756 -0
  144. package/dist/unpkg/dev/request-CwjpJB3r.js.map +1 -0
  145. package/dist/unpkg/dev/request.js +2 -48
  146. package/dist/unpkg/dev/runtime-DoDtzXJb.js +110 -0
  147. package/dist/unpkg/dev/runtime-DoDtzXJb.js.map +1 -0
  148. package/dist/unpkg/dev/signals/-leaked.js +3 -1
  149. package/dist/unpkg/dev/src-CP6e_ozt.js +8331 -0
  150. package/dist/unpkg/dev/src-CP6e_ozt.js.map +1 -0
  151. package/dist/unpkg/dev/store/-private.js +3 -55
  152. package/dist/unpkg/dev/store-DamE3C4y.js +427 -0
  153. package/dist/unpkg/dev/store-DamE3C4y.js.map +1 -0
  154. package/dist/unpkg/dev/store.js +1 -556
  155. package/dist/unpkg/dev/types/-private.js +1 -67
  156. package/dist/unpkg/dev/types/identifier.js +63 -56
  157. package/dist/unpkg/dev/types/identifier.js.map +1 -0
  158. package/dist/unpkg/dev/types/record.js +211 -181
  159. package/dist/unpkg/dev/types/record.js.map +1 -0
  160. package/dist/unpkg/dev/types/request.js +138 -69
  161. package/dist/unpkg/dev/types/request.js.map +1 -0
  162. package/dist/unpkg/dev/types/runtime.js +54 -26
  163. package/dist/unpkg/dev/types/runtime.js.map +1 -0
  164. package/dist/unpkg/dev/types/schema/fields.js +501 -495
  165. package/dist/unpkg/dev/types/schema/fields.js.map +1 -0
  166. package/dist/unpkg/dev/types/schema/fields.type-test.js +79 -0
  167. package/dist/unpkg/dev/types/schema/fields.type-test.js.map +1 -0
  168. package/dist/unpkg/dev/types/symbols.js +84 -77
  169. package/dist/unpkg/dev/types/symbols.js.map +1 -0
  170. package/dist/unpkg/dev/utils/string.js +79 -85
  171. package/dist/unpkg/dev/utils/string.js.map +1 -0
  172. package/dist/unpkg/dev-deprecated/-private-BoSTJwp9.js +3519 -0
  173. package/dist/unpkg/dev-deprecated/-private-BoSTJwp9.js.map +1 -0
  174. package/dist/unpkg/dev-deprecated/-private-CUkeqUhO.js +22 -0
  175. package/dist/unpkg/dev-deprecated/-private-CUkeqUhO.js.map +1 -0
  176. package/dist/unpkg/dev-deprecated/-private-D6Tw25AD.js +111 -0
  177. package/dist/unpkg/dev-deprecated/-private-D6Tw25AD.js.map +1 -0
  178. package/dist/unpkg/dev-deprecated/build-config/babel-macros.js +3 -1
  179. package/dist/unpkg/dev-deprecated/build-config/canary-features.js +1 -1
  180. package/dist/unpkg/dev-deprecated/build-config/debugging.js +1 -1
  181. package/dist/unpkg/dev-deprecated/build-config/deprecations.js +1 -1
  182. package/dist/unpkg/dev-deprecated/build-config/env.js +3 -1
  183. package/dist/unpkg/dev-deprecated/build-config/macros.js +3 -1
  184. package/dist/unpkg/dev-deprecated/build-config.js +3 -1
  185. package/dist/unpkg/dev-deprecated/configure.js +3 -1
  186. package/dist/unpkg/dev-deprecated/graph/-private.js +2077 -3147
  187. package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -0
  188. package/dist/unpkg/dev-deprecated/index.js +3 -5
  189. package/dist/unpkg/dev-deprecated/reactive/-private.js +3 -1
  190. package/dist/unpkg/dev-deprecated/reactive.js +5 -3
  191. package/dist/unpkg/dev-deprecated/request-CwjpJB3r.js +756 -0
  192. package/dist/unpkg/dev-deprecated/request-CwjpJB3r.js.map +1 -0
  193. package/dist/unpkg/dev-deprecated/request.js +2 -48
  194. package/dist/unpkg/dev-deprecated/runtime-CPL2BGgT.js +110 -0
  195. package/dist/unpkg/dev-deprecated/runtime-CPL2BGgT.js.map +1 -0
  196. package/dist/unpkg/dev-deprecated/signals/-leaked.js +3 -1
  197. package/dist/unpkg/dev-deprecated/src-De8OV58h.js +8884 -0
  198. package/dist/unpkg/dev-deprecated/src-De8OV58h.js.map +1 -0
  199. package/dist/unpkg/dev-deprecated/store/-private.js +3 -1
  200. package/dist/unpkg/dev-deprecated/store-Bsdz5mRe.js +427 -0
  201. package/dist/unpkg/dev-deprecated/store-Bsdz5mRe.js.map +1 -0
  202. package/dist/unpkg/dev-deprecated/store.js +1 -556
  203. package/dist/unpkg/dev-deprecated/types/-private.js +1 -67
  204. package/dist/unpkg/dev-deprecated/types/identifier.js +63 -56
  205. package/dist/unpkg/dev-deprecated/types/identifier.js.map +1 -0
  206. package/dist/unpkg/dev-deprecated/types/record.js +211 -181
  207. package/dist/unpkg/dev-deprecated/types/record.js.map +1 -0
  208. package/dist/unpkg/dev-deprecated/types/request.js +138 -69
  209. package/dist/unpkg/dev-deprecated/types/request.js.map +1 -0
  210. package/dist/unpkg/dev-deprecated/types/runtime.js +54 -26
  211. package/dist/unpkg/dev-deprecated/types/runtime.js.map +1 -0
  212. package/dist/unpkg/dev-deprecated/types/schema/fields.js +501 -495
  213. package/dist/unpkg/dev-deprecated/types/schema/fields.js.map +1 -0
  214. package/dist/unpkg/dev-deprecated/types/schema/fields.type-test.js +79 -0
  215. package/dist/unpkg/dev-deprecated/types/schema/fields.type-test.js.map +1 -0
  216. package/dist/unpkg/dev-deprecated/types/symbols.js +84 -77
  217. package/dist/unpkg/dev-deprecated/types/symbols.js.map +1 -0
  218. package/dist/unpkg/dev-deprecated/utils/string.js +79 -85
  219. package/dist/unpkg/dev-deprecated/utils/string.js.map +1 -0
  220. package/dist/unpkg/prod/-private-B36B1ztP.js +22 -0
  221. package/dist/unpkg/prod/-private-B36B1ztP.js.map +1 -0
  222. package/dist/unpkg/prod/-private-DHco-h0q.js +3294 -0
  223. package/dist/unpkg/prod/-private-DHco-h0q.js.map +1 -0
  224. package/dist/unpkg/prod/-private-Dhl123OI.js +99 -0
  225. package/dist/unpkg/prod/-private-Dhl123OI.js.map +1 -0
  226. package/dist/unpkg/prod/build-config/babel-macros.js +3 -1
  227. package/dist/unpkg/prod/build-config/canary-features.js +1 -1
  228. package/dist/unpkg/prod/build-config/debugging.js +1 -1
  229. package/dist/unpkg/prod/build-config/deprecations.js +1 -1
  230. package/dist/unpkg/prod/build-config/env.js +3 -1
  231. package/dist/unpkg/prod/build-config/macros.js +3 -1
  232. package/dist/unpkg/prod/build-config.js +3 -1
  233. package/dist/unpkg/prod/configure.js +3 -2
  234. package/dist/unpkg/prod/graph/-private.js +1494 -2101
  235. package/dist/unpkg/prod/graph/-private.js.map +1 -0
  236. package/dist/unpkg/prod/index.js +2 -482
  237. package/dist/unpkg/prod/reactive/-private.js +3 -1
  238. package/dist/unpkg/prod/reactive.js +5 -30
  239. package/dist/unpkg/prod/request-BBdC1Sz7.js +480 -0
  240. package/dist/unpkg/prod/request-BBdC1Sz7.js.map +1 -0
  241. package/dist/unpkg/prod/request.js +3 -2
  242. package/dist/unpkg/prod/signals/-leaked.js +3 -1
  243. package/dist/unpkg/prod/src-nFHlZgKa.js +6942 -0
  244. package/dist/unpkg/prod/src-nFHlZgKa.js.map +1 -0
  245. package/dist/unpkg/prod/store/-private.js +3 -126
  246. package/dist/unpkg/prod/store-BWhmb7Ob.js +359 -0
  247. package/dist/unpkg/prod/store-BWhmb7Ob.js.map +1 -0
  248. package/dist/unpkg/prod/store.js +1 -435
  249. package/dist/unpkg/prod/types/-private.js +1 -47
  250. package/dist/unpkg/prod/types/identifier.js +63 -56
  251. package/dist/unpkg/prod/types/identifier.js.map +1 -0
  252. package/dist/unpkg/prod/types/record.js +211 -181
  253. package/dist/unpkg/prod/types/record.js.map +1 -0
  254. package/dist/unpkg/prod/types/request.js +138 -69
  255. package/dist/unpkg/prod/types/request.js.map +1 -0
  256. package/dist/unpkg/prod/types/runtime.js +54 -26
  257. package/dist/unpkg/prod/types/runtime.js.map +1 -0
  258. package/dist/unpkg/prod/types/schema/fields.js +501 -495
  259. package/dist/unpkg/prod/types/schema/fields.js.map +1 -0
  260. package/dist/unpkg/prod/types/schema/fields.type-test.js +79 -0
  261. package/dist/unpkg/prod/types/schema/fields.type-test.js.map +1 -0
  262. package/dist/unpkg/prod/types/symbols.js +84 -77
  263. package/dist/unpkg/prod/types/symbols.js.map +1 -0
  264. package/dist/unpkg/prod/utils/string.js +70 -66
  265. package/dist/unpkg/prod/utils/string.js.map +1 -0
  266. package/dist/unpkg/prod-deprecated/-private-B36B1ztP.js +22 -0
  267. package/dist/unpkg/prod-deprecated/-private-B36B1ztP.js.map +1 -0
  268. package/dist/unpkg/prod-deprecated/-private-DHco-h0q.js +3294 -0
  269. package/dist/unpkg/prod-deprecated/-private-DHco-h0q.js.map +1 -0
  270. package/dist/unpkg/prod-deprecated/-private-Dhl123OI.js +99 -0
  271. package/dist/unpkg/prod-deprecated/-private-Dhl123OI.js.map +1 -0
  272. package/dist/unpkg/prod-deprecated/build-config/babel-macros.js +3 -1
  273. package/dist/unpkg/prod-deprecated/build-config/canary-features.js +1 -1
  274. package/dist/unpkg/prod-deprecated/build-config/debugging.js +1 -1
  275. package/dist/unpkg/prod-deprecated/build-config/deprecations.js +1 -1
  276. package/dist/unpkg/prod-deprecated/build-config/env.js +3 -1
  277. package/dist/unpkg/prod-deprecated/build-config/macros.js +3 -1
  278. package/dist/unpkg/prod-deprecated/build-config.js +3 -1
  279. package/dist/unpkg/prod-deprecated/configure.js +3 -2
  280. package/dist/unpkg/prod-deprecated/graph/-private.js +1603 -2272
  281. package/dist/unpkg/prod-deprecated/graph/-private.js.map +1 -0
  282. package/dist/unpkg/prod-deprecated/index.js +2 -482
  283. package/dist/unpkg/prod-deprecated/reactive/-private.js +3 -1
  284. package/dist/unpkg/prod-deprecated/reactive.js +5 -5
  285. package/dist/unpkg/prod-deprecated/request-BBdC1Sz7.js +480 -0
  286. package/dist/unpkg/prod-deprecated/request-BBdC1Sz7.js.map +1 -0
  287. package/dist/unpkg/prod-deprecated/request.js +3 -2
  288. package/dist/unpkg/prod-deprecated/signals/-leaked.js +3 -1
  289. package/dist/unpkg/prod-deprecated/src-Cku5ymUJ.js +7375 -0
  290. package/dist/unpkg/prod-deprecated/src-Cku5ymUJ.js.map +1 -0
  291. package/dist/unpkg/prod-deprecated/store/-private.js +3 -88
  292. package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js +359 -0
  293. package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +1 -0
  294. package/dist/unpkg/prod-deprecated/store.js +1 -435
  295. package/dist/unpkg/prod-deprecated/types/-private.js +1 -47
  296. package/dist/unpkg/prod-deprecated/types/identifier.js +63 -56
  297. package/dist/unpkg/prod-deprecated/types/identifier.js.map +1 -0
  298. package/dist/unpkg/prod-deprecated/types/record.js +211 -181
  299. package/dist/unpkg/prod-deprecated/types/record.js.map +1 -0
  300. package/dist/unpkg/prod-deprecated/types/request.js +138 -69
  301. package/dist/unpkg/prod-deprecated/types/request.js.map +1 -0
  302. package/dist/unpkg/prod-deprecated/types/runtime.js +54 -26
  303. package/dist/unpkg/prod-deprecated/types/runtime.js.map +1 -0
  304. package/dist/unpkg/prod-deprecated/types/schema/fields.js +501 -495
  305. package/dist/unpkg/prod-deprecated/types/schema/fields.js.map +1 -0
  306. package/dist/unpkg/prod-deprecated/types/schema/fields.type-test.js +79 -0
  307. package/dist/unpkg/prod-deprecated/types/schema/fields.type-test.js.map +1 -0
  308. package/dist/unpkg/prod-deprecated/types/symbols.js +84 -77
  309. package/dist/unpkg/prod-deprecated/types/symbols.js.map +1 -0
  310. package/dist/unpkg/prod-deprecated/utils/string.js +70 -66
  311. package/dist/unpkg/prod-deprecated/utils/string.js.map +1 -0
  312. package/dist/utils/string.d.ts +54 -0
  313. package/dist/utils/string.d.ts.map +1 -0
  314. package/dist/utils/string.js +84 -85
  315. package/dist/utils/string.js.map +1 -0
  316. package/dist/utils-BtURiy8l.d.ts +24 -0
  317. package/dist/utils-BtURiy8l.d.ts.map +1 -0
  318. package/package.json +17 -21
  319. package/declarations/build-config/babel-macros.d.ts +0 -1
  320. package/declarations/build-config/canary-features.d.ts +0 -1
  321. package/declarations/build-config/debugging.d.ts +0 -1
  322. package/declarations/build-config/deprecations.d.ts +0 -1
  323. package/declarations/build-config/env.d.ts +0 -1
  324. package/declarations/build-config/macros.d.ts +0 -1
  325. package/declarations/build-config.d.ts +0 -18
  326. package/declarations/configure.d.ts +0 -7
  327. package/declarations/graph/-private/-diff.d.ts +0 -19
  328. package/declarations/graph/-private/-edge-definition.d.ts +0 -149
  329. package/declarations/graph/-private/-state.d.ts +0 -9
  330. package/declarations/graph/-private/-utils.d.ts +0 -25
  331. package/declarations/graph/-private/coerce-id.d.ts +0 -4
  332. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +0 -6
  333. package/declarations/graph/-private/edges/collection.d.ts +0 -39
  334. package/declarations/graph/-private/edges/implicit.d.ts +0 -43
  335. package/declarations/graph/-private/edges/resource.d.ts +0 -23
  336. package/declarations/graph/-private/graph.d.ts +0 -56
  337. package/declarations/graph/-private/normalize-link.d.ts +0 -2
  338. package/declarations/graph/-private/operations/add-to-related-records.d.ts +0 -4
  339. package/declarations/graph/-private/operations/merge-identifier.d.ts +0 -3
  340. package/declarations/graph/-private/operations/remove-from-related-records.d.ts +0 -4
  341. package/declarations/graph/-private/operations/replace-related-record.d.ts +0 -3
  342. package/declarations/graph/-private/operations/replace-related-records.d.ts +0 -7
  343. package/declarations/graph/-private/operations/update-relationship.d.ts +0 -9
  344. package/declarations/graph/-private.d.ts +0 -13
  345. package/declarations/index.d.ts +0 -96
  346. package/declarations/reactive/-private/default-mode.d.ts +0 -73
  347. package/declarations/reactive/-private/document.d.ts +0 -142
  348. package/declarations/reactive/-private/fields/extension.d.ts +0 -8
  349. package/declarations/reactive/-private/fields/get-field-key.d.ts +0 -8
  350. package/declarations/reactive/-private/fields/managed-array.d.ts +0 -18
  351. package/declarations/reactive/-private/fields/managed-object.d.ts +0 -17
  352. package/declarations/reactive/-private/fields/many-array-manager.d.ts +0 -19
  353. package/declarations/reactive/-private/hooks.d.ts +0 -5
  354. package/declarations/reactive/-private/kind/alias-field.d.ts +0 -4
  355. package/declarations/reactive/-private/kind/array-field.d.ts +0 -4
  356. package/declarations/reactive/-private/kind/attribute-field.d.ts +0 -4
  357. package/declarations/reactive/-private/kind/belongs-to-field.d.ts +0 -4
  358. package/declarations/reactive/-private/kind/collection-field.d.ts +0 -4
  359. package/declarations/reactive/-private/kind/derived-field.d.ts +0 -4
  360. package/declarations/reactive/-private/kind/generic-field.d.ts +0 -4
  361. package/declarations/reactive/-private/kind/has-many-field.d.ts +0 -4
  362. package/declarations/reactive/-private/kind/hash-field.d.ts +0 -4
  363. package/declarations/reactive/-private/kind/identity-field.d.ts +0 -4
  364. package/declarations/reactive/-private/kind/local-field.d.ts +0 -4
  365. package/declarations/reactive/-private/kind/object-field.d.ts +0 -4
  366. package/declarations/reactive/-private/kind/resource-field.d.ts +0 -4
  367. package/declarations/reactive/-private/kind/schema-array-field.d.ts +0 -4
  368. package/declarations/reactive/-private/kind/schema-object-field.d.ts +0 -4
  369. package/declarations/reactive/-private/record.d.ts +0 -83
  370. package/declarations/reactive/-private/schema.d.ts +0 -326
  371. package/declarations/reactive/-private/symbols.d.ts +0 -5
  372. package/declarations/reactive/-private.d.ts +0 -2
  373. package/declarations/reactive.d.ts +0 -286
  374. package/declarations/request/-private/context.d.ts +0 -39
  375. package/declarations/request/-private/debug.d.ts +0 -4
  376. package/declarations/request/-private/fetch.d.ts +0 -33
  377. package/declarations/request/-private/future.d.ts +0 -7
  378. package/declarations/request/-private/manager.d.ts +0 -158
  379. package/declarations/request/-private/promise-cache.d.ts +0 -28
  380. package/declarations/request/-private/types.d.ts +0 -234
  381. package/declarations/request/-private/utils.d.ts +0 -57
  382. package/declarations/request.d.ts +0 -52
  383. package/declarations/signals/-leaked.d.ts +0 -2
  384. package/declarations/signals/-private.d.ts +0 -6
  385. package/declarations/signals/promise-state.d.ts +0 -264
  386. package/declarations/signals/reactivity/configure.d.ts +0 -138
  387. package/declarations/signals/reactivity/internal.d.ts +0 -154
  388. package/declarations/signals/reactivity/signal.d.ts +0 -56
  389. package/declarations/signals/request-state.d.ts +0 -372
  390. package/declarations/signals/request-subscription.d.ts +0 -177
  391. package/declarations/store/-private/cache-handler/handler.d.ts +0 -56
  392. package/declarations/store/-private/cache-handler/types.d.ts +0 -84
  393. package/declarations/store/-private/cache-handler/utils.d.ts +0 -31
  394. package/declarations/store/-private/caches/instance-cache.d.ts +0 -58
  395. package/declarations/store/-private/caches/resource-utils.d.ts +0 -9
  396. package/declarations/store/-private/debug/utils.d.ts +0 -7
  397. package/declarations/store/-private/default-cache-policy.d.ts +0 -387
  398. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +0 -34
  399. package/declarations/store/-private/managers/cache-key-manager.d.ts +0 -304
  400. package/declarations/store/-private/managers/cache-manager.d.ts +0 -367
  401. package/declarations/store/-private/managers/notification-manager.d.ts +0 -83
  402. package/declarations/store/-private/managers/record-array-manager.d.ts +0 -100
  403. package/declarations/store/-private/network/request-cache.d.ts +0 -103
  404. package/declarations/store/-private/record-arrays/-utils.d.ts +0 -80
  405. package/declarations/store/-private/record-arrays/legacy-live-array.d.ts +0 -81
  406. package/declarations/store/-private/record-arrays/legacy-many-array.d.ts +0 -133
  407. package/declarations/store/-private/record-arrays/legacy-query.d.ts +0 -81
  408. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +0 -3
  409. package/declarations/store/-private/record-arrays/resource-array.d.ts +0 -67
  410. package/declarations/store/-private/store-service.d.ts +0 -874
  411. package/declarations/store/-private/utils/coerce-id.d.ts +0 -4
  412. package/declarations/store/-private/utils/construct-resource.d.ts +0 -6
  413. package/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
  414. package/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
  415. package/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
  416. package/declarations/store/-private.d.ts +0 -24
  417. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +0 -90
  418. package/declarations/store/-types/q/identifier.d.ts +0 -23
  419. package/declarations/store/-types/q/record-instance.d.ts +0 -22
  420. package/declarations/store/-types/q/store.d.ts +0 -31
  421. package/declarations/store/deprecated/-private.d.ts +0 -223
  422. package/declarations/store/deprecated/store.d.ts +0 -784
  423. package/declarations/store.d.ts +0 -2
  424. package/declarations/types/-private.d.ts +0 -22
  425. package/declarations/types/cache/aliases.d.ts +0 -1
  426. package/declarations/types/cache/change.d.ts +0 -6
  427. package/declarations/types/cache/mutations.d.ts +0 -38
  428. package/declarations/types/cache/operations.d.ts +0 -168
  429. package/declarations/types/cache/relationship.d.ts +0 -13
  430. package/declarations/types/cache.d.ts +0 -429
  431. package/declarations/types/graph.d.ts +0 -47
  432. package/declarations/types/identifier.d.ts +0 -86
  433. package/declarations/types/json/raw.d.ts +0 -6
  434. package/declarations/types/params.d.ts +0 -8
  435. package/declarations/types/record.d.ts +0 -269
  436. package/declarations/types/request.d.ts +0 -367
  437. package/declarations/types/runtime.d.ts +0 -14
  438. package/declarations/types/schema/concepts.d.ts +0 -23
  439. package/declarations/types/schema/fields.d.ts +0 -2200
  440. package/declarations/types/schema/fields.type-test.d.ts +0 -1
  441. package/declarations/types/schema/schema-service.d.ts +0 -380
  442. package/declarations/types/spec/document.d.ts +0 -67
  443. package/declarations/types/spec/error.d.ts +0 -18
  444. package/declarations/types/spec/json-api-raw.d.ts +0 -139
  445. package/declarations/types/symbols.d.ts +0 -78
  446. package/declarations/types/utils.d.ts +0 -5
  447. package/declarations/types.d.ts +0 -11
  448. package/declarations/utils/string.d.ts +0 -47
  449. package/dist/configure-DPUFCemT.js +0 -1940
  450. package/dist/default-cache-policy-D7_u4YRH.js +0 -572
  451. package/dist/future-BKkJJkj7.js +0 -678
  452. package/dist/index-CQP2NSqg.js +0 -9982
  453. package/dist/symbols-3C1OkYtZ.js +0 -39
  454. package/dist/unpkg/dev/-leaked-Co0EI6Go.js +0 -1939
  455. package/dist/unpkg/dev/-private-sql1_mdx.js +0 -39
  456. package/dist/unpkg/dev/future-DFfOzSoe.js +0 -672
  457. package/dist/unpkg/dev/index-BzcBOnw9.js +0 -9392
  458. package/dist/unpkg/dev/runtime-E1M51_-O.js +0 -135
  459. package/dist/unpkg/dev-deprecated/-leaked-DjMeRqdU.js +0 -1939
  460. package/dist/unpkg/dev-deprecated/-private-3C1OkYtZ.js +0 -39
  461. package/dist/unpkg/dev-deprecated/future-DFfOzSoe.js +0 -672
  462. package/dist/unpkg/dev-deprecated/index-6TnTv-WG.js +0 -10007
  463. package/dist/unpkg/dev-deprecated/runtime-DAu5b0IR.js +0 -135
  464. package/dist/unpkg/prod/-leaked-DUONXQDB.js +0 -1676
  465. package/dist/unpkg/prod/-private-sql1_mdx.js +0 -39
  466. package/dist/unpkg/prod/handler-EU_8ncB2.js +0 -1619
  467. package/dist/unpkg/prod/promise-cache-DIT8Ypjq.js +0 -19
  468. package/dist/unpkg/prod/request-BrJSCG6r.js +0 -421
  469. package/dist/unpkg/prod/schema-BSkHyoWz.js +0 -5219
  470. package/dist/unpkg/prod-deprecated/-leaked-DRNv9VIX.js +0 -1676
  471. package/dist/unpkg/prod-deprecated/-private-3C1OkYtZ.js +0 -39
  472. package/dist/unpkg/prod-deprecated/handler-CCIu4sQ3.js +0 -334
  473. package/dist/unpkg/prod-deprecated/hooks-Dv4Np0MY.js +0 -26
  474. package/dist/unpkg/prod-deprecated/promise-cache-DIT8Ypjq.js +0 -19
  475. package/dist/unpkg/prod-deprecated/request-BrJSCG6r.js +0 -421
  476. package/dist/unpkg/prod-deprecated/schema-CJcjHv0E.js +0 -6939
@@ -0,0 +1,2327 @@
1
+ import { i as Value, n as ObjectValue, r as PrimitiveValue } from "./raw-D5hnjiq7.js";
2
+ //#region src/types/schema/fields.d.ts
3
+ /**
4
+ * Options signature for Legacy Attributes.
5
+ */
6
+ interface AttrOptions {
7
+ /**
8
+ * A primitive value or a function which produces a value.
9
+ */
10
+ defaultValue?: PrimitiveValue | (() => Value);
11
+ [key: string]: Value | (() => Value) | undefined;
12
+ }
13
+ /**
14
+ * A generic "field" that can be used to define
15
+ * primitive value fields.
16
+ *
17
+ * Replaces "attribute" for primitive value fields.
18
+ * Can also be used to eject from deep-tracking of
19
+ * objects or arrays.
20
+ *
21
+ * A major difference between "field" and "attribute"
22
+ * is that "type" points to a legacy transform on
23
+ * "attribute" that a serializer *might* use, while
24
+ * "type" points to a new-style transform on "field"
25
+ * that a record implmentation *must* use.
26
+ *
27
+ * @public
28
+ */
29
+ interface GenericField {
30
+ /**
31
+ * The kind of field this is.
32
+ *
33
+ * @public
34
+ */
35
+ kind: "field";
36
+ /**
37
+ * The name of the field.
38
+ *
39
+ * @public
40
+ */
41
+ name: string;
42
+ /**
43
+ * The name of the field as returned by the API
44
+ * and inserted into the {@link Cache} if it differs
45
+ * from {@link GenericField.name}
46
+ *
47
+ * For instance, if the API returns:
48
+ *
49
+ * ```ts
50
+ * {
51
+ * attributes: {
52
+ * 'first-name': 'Chris'
53
+ * }
54
+ * }
55
+ * ```
56
+ *
57
+ * But the app desires to use `record.firstName; // 'Chris'`
58
+ *
59
+ * Then `name` would be set to `'firstName'` and
60
+ * `sourceKey` would be set to `'first-name'`.
61
+ *
62
+ * This option is only needed when the value differs from name.
63
+ */
64
+ sourceKey?: string;
65
+ /**
66
+ * the name of the {@link Transformation} to use, if any
67
+ *
68
+ * @public
69
+ */
70
+ type?: string;
71
+ /**
72
+ * Options to pass to the transform, if any
73
+ *
74
+ * Must comply to the specific transform's options
75
+ * schema.
76
+ *
77
+ * @public
78
+ */
79
+ options?: ObjectValue;
80
+ }
81
+ /**
82
+ * A field that can be used to alias one key to another
83
+ * key present in the cache version of the resource.
84
+ *
85
+ * Unlike DerivedField, an AliasField may write to its
86
+ * source when a record is in an editable mode.
87
+ *
88
+ * ~~AliasFields may utilize a transform, specified by type,
89
+ * to pre/post process the raw data for the field.~~ (not yet implemented)
90
+ *
91
+ * An AliasField may also specify a `kind` via options.
92
+ * `kind` may be any other valid field kind other than
93
+ *
94
+ * - `@hash`
95
+ * - `@id`
96
+ * - `@local`
97
+ * - `derived`
98
+ *
99
+ * This allows an AliasField to rename any field in the cache.
100
+ *
101
+ * Alias fields are generally intended to be used to support migrating
102
+ * between different schemas, though there are times where they are useful
103
+ * as a form of advanced derivation when used with a transform. For instance,
104
+ * an AliasField could be used to expose both a string and a Date version of the
105
+ * same field, with both being capable of being written to.
106
+ *
107
+ * @public
108
+ */
109
+ interface LegacyAliasField {
110
+ /**
111
+ * The kind of field this is.
112
+ *
113
+ * @public
114
+ */
115
+ kind: "alias";
116
+ /**
117
+ * The name of the field.
118
+ *
119
+ * @public
120
+ */
121
+ name: string;
122
+ /**
123
+ * Always null (for now)
124
+ *
125
+ * @public
126
+ */
127
+ type: null;
128
+ /**
129
+ * The field def for which this is an alias.
130
+ *
131
+ * @public
132
+ */
133
+ options: GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | LegacyAttributeField | LegacyBelongsToField | LegacyHasManyField;
134
+ }
135
+ /**
136
+ * A field that can be used to alias one key to another
137
+ * key present in the cache version of the resource.
138
+ *
139
+ * Unlike DerivedField, an AliasField may write to its
140
+ * source when a record is in an editable mode.
141
+ *
142
+ * ~~AliasFields may utilize a transform, specified by type,
143
+ * to pre/post process the raw data for the field.~~ (not yet implemented)
144
+ *
145
+ * An AliasField may also specify a `kind` via options.
146
+ * `kind` may be any other valid field kind other than
147
+ *
148
+ * - `@hash`
149
+ * - `@id`
150
+ * - `@local`
151
+ * - `derived`
152
+ *
153
+ * This allows an AliasField to rename any field in the cache.
154
+ *
155
+ * Alias fields are generally intended to be used to support migrating
156
+ * between different schemas, though there are times where they are useful
157
+ * as a form of advanced derivation when used with a transform. For instance,
158
+ * an AliasField could be used to expose both a string and a Date version of the
159
+ * same field, with both being capable of being written to.
160
+ *
161
+ * @public
162
+ */
163
+ interface PolarisAliasField {
164
+ /**
165
+ * The kind of field this is.
166
+ *
167
+ * @public
168
+ */
169
+ kind: "alias";
170
+ /**
171
+ * The name of the field.
172
+ *
173
+ * @public
174
+ */
175
+ name: string;
176
+ /**
177
+ * Always null (for now)
178
+ *
179
+ * @public
180
+ */
181
+ type: null;
182
+ /**
183
+ * The field def for which this is an alias.
184
+ *
185
+ * @public
186
+ */
187
+ options: GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | LinksModeBelongsToField | LinksModeHasManyField;
188
+ }
189
+ /**
190
+ * A field that can be used to alias one key to another
191
+ * key present in the cache version of the resource.
192
+ *
193
+ * Unlike DerivedField, an AliasField may write to its
194
+ * source when a record is in an editable mode.
195
+ *
196
+ * AliasFields may utilize a transform, specified by type,
197
+ * to pre/post process the field.
198
+ *
199
+ * An AliasField may also specify a `kind` via options.
200
+ * `kind` may be any other valid field kind other than
201
+ *
202
+ * - `@hash`
203
+ * - `@id`
204
+ * - `@local`
205
+ * - `derived`
206
+ *
207
+ * This allows an AliasField to rename any field in the cache.
208
+ *
209
+ * Alias fields are generally intended to be used to support migrating
210
+ * between different schemas, though there are times where they are useful
211
+ * as a form of advanced derivation when used with a transform. For instance,
212
+ * an AliasField could be used to expose both a string and a Date version of the
213
+ * same field, with both being capable of being written to.
214
+ *
215
+ * @public
216
+ */
217
+ interface ObjectAliasField {
218
+ /**
219
+ * The kind of field this is.
220
+ *
221
+ * @public
222
+ */
223
+ kind: "alias";
224
+ /**
225
+ * The name of the field.
226
+ *
227
+ * @public
228
+ */
229
+ name: string;
230
+ /**
231
+ * Always null (for now)
232
+ *
233
+ * @public
234
+ */
235
+ type: null;
236
+ /**
237
+ * The field def for which this is an alias.
238
+ *
239
+ * @public
240
+ */
241
+ options: GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField;
242
+ }
243
+ /**
244
+ * Represents a field whose value is the primary
245
+ * key of the resource.
246
+ *
247
+ * This allows any field to serve as the primary
248
+ * key while still being able to drive identity
249
+ * needs within the system.
250
+ *
251
+ * This is useful for resources that use for instance
252
+ * 'uuid', 'urn' or 'entityUrn' or 'primaryKey' as their
253
+ * primary key field instead of 'id'.
254
+ *
255
+ * @public
256
+ */
257
+ interface IdentityField {
258
+ /**
259
+ * The kind of field this is.
260
+ *
261
+ * @public
262
+ */
263
+ kind: "@id";
264
+ /**
265
+ * The name of the field that serves as the
266
+ * primary key for the resource.
267
+ *
268
+ * @public
269
+ */
270
+ name: string;
271
+ /**
272
+ * The name of the field as returned by the API
273
+ * and inserted into the {@link Cache} if it differs
274
+ * from {@link IdentityField.name}
275
+ *
276
+ * For instance, if the API returns:
277
+ *
278
+ * ```ts
279
+ * {
280
+ * entityUrn: '324523-sadf34-345'
281
+ * }
282
+ * ```
283
+ *
284
+ * But the app desires to use `record.id; // '324523-sadf34-345'`
285
+ *
286
+ * Then `name` would be set to `'id'` and
287
+ * `sourceKey` would be set to `'entityUrn'`.
288
+ *
289
+ * This option is only needed when the value differs from name.
290
+ */
291
+ sourceKey?: string;
292
+ }
293
+ /**
294
+ * Represents a specialized field whose computed value
295
+ * will be used as the primary key of a schema-object
296
+ * for serializability and comparison purposes.
297
+ *
298
+ * This field functions similarly to derived fields in that
299
+ * it is non-settable, derived state but differs in that
300
+ * it is only able to compute off of cache state and is given
301
+ * no access to a record instance.
302
+ *
303
+ * This means that if a hashing function wants to compute its value
304
+ * taking into account transformations and derivations it must
305
+ * perform those itself.
306
+ *
307
+ * A schema-array can declare its "key" value to be `@hash` if
308
+ * the schema-objects it contains have such a field.
309
+ *
310
+ * Only one hash field is permittable per schema-object, and
311
+ * it should be placed in the `ResourceSchema`'s `@id` field
312
+ * in place of an `IdentityField`.
313
+ *
314
+ * @public
315
+ */
316
+ interface HashField {
317
+ /**
318
+ * The kind of field this is.
319
+ *
320
+ * @public
321
+ */
322
+ kind: "@hash";
323
+ /**
324
+ * The name of the field that serves as the
325
+ * hash for the resource.
326
+ *
327
+ * Only required if access to this value by
328
+ * the UI is desired, it can be `null` otherwise.
329
+ *
330
+ * @public
331
+ */
332
+ name: string | null;
333
+ /**
334
+ * The name of a function to run to compute the hash.
335
+ * The function will only have access to the cached
336
+ * data for the record.
337
+ *
338
+ * @public
339
+ */
340
+ type: string;
341
+ /**
342
+ * Any options that should be provided to the hash
343
+ * function.
344
+ *
345
+ * @public
346
+ */
347
+ options?: ObjectValue;
348
+ }
349
+ /**
350
+ * Represents a field whose value is a local
351
+ * value that is not stored in the cache, nor
352
+ * is it sent to the server.
353
+ *
354
+ * Local fields can be written to, and their
355
+ * value is both memoized and reactive (though
356
+ * not deep-tracked).
357
+ *
358
+ * Because their state is not derived from the cache
359
+ * data or the server, they represent a divorced
360
+ * uncanonical source of state.
361
+ *
362
+ * For this reason Local fields should be used sparingly.
363
+ *
364
+ * Currently, while we document this feature here,
365
+ * only allow our own ReactiveResource default fields to
366
+ * utilize them and the feature should be considered private.
367
+ *
368
+ * Example use cases that drove the creation of local
369
+ * fields are states like `isDestroying` and `isDestroyed`
370
+ * which are specific to a record instance but not
371
+ * stored in the cache. We wanted to be able to drive
372
+ * these fields from schema the same as all other fields.
373
+ *
374
+ * Don't make us regret this decision.
375
+ *
376
+ * @public
377
+ */
378
+ interface LocalField {
379
+ /**
380
+ * The kind of field this is.
381
+ *
382
+ * @public
383
+ */
384
+ kind: "@local";
385
+ /**
386
+ * The name of the field.
387
+ *
388
+ * @public
389
+ */
390
+ name: string;
391
+ /**
392
+ * Not currently utilized, we are considering
393
+ * allowing transforms to operate on local fields
394
+ *
395
+ * @public
396
+ */
397
+ type?: string;
398
+ /**
399
+ * Options for the field.
400
+ *
401
+ * @public
402
+ */
403
+ options?: {
404
+ /**
405
+ * The default value to use for the field when no value
406
+ * has yet been set.
407
+ */
408
+ defaultValue?: PrimitiveValue;
409
+ };
410
+ }
411
+ /**
412
+ * Represents a field whose value is an object
413
+ * with keys pointing to values that are primitive
414
+ * values.
415
+ *
416
+ * If values of the keys are not primitives, or
417
+ * if the key/value pairs have well-defined shape,
418
+ * use 'schema-object' instead.
419
+ *
420
+ * @public
421
+ */
422
+ interface ObjectField {
423
+ /**
424
+ * The kind of field this is.
425
+ *
426
+ * @public
427
+ */
428
+ kind: "object";
429
+ /**
430
+ * The name of the field.
431
+ *
432
+ * @public
433
+ */
434
+ name: string;
435
+ /**
436
+ * The name of the field as returned by the API
437
+ * and inserted into the {@link Cache} if it differs
438
+ * from {@link ObjectField.name}
439
+ *
440
+ * For instance, if the API returns:
441
+ *
442
+ * ```ts
443
+ * {
444
+ * attributes: {
445
+ * 'first-name': 'Chris'
446
+ * }
447
+ * }
448
+ * ```
449
+ *
450
+ * But the app desires to use `record.firstName; // 'Chris'`
451
+ *
452
+ * Then `name` would be set to `'firstName'` and
453
+ * `sourceKey` would be set to `'first-name'`.
454
+ *
455
+ * This option is only needed when the value differs from name.
456
+ */
457
+ sourceKey?: string;
458
+ /**
459
+ * The name of a transform to pass the entire object
460
+ * through before displaying or serializing it.
461
+ *
462
+ * @public
463
+ */
464
+ type?: string;
465
+ /**
466
+ * Options to pass to the transform, if any
467
+ *
468
+ * Must comply to the specific transform's options
469
+ * schema.
470
+ *
471
+ * @public
472
+ */
473
+ options?: {
474
+ /**
475
+ * ::: warning ⚠️ Dangerous Feature Ahead
476
+ * :::
477
+ *
478
+ * Configures which extensions this object should use.
479
+ *
480
+ * Extensions are registered with the store's schema service
481
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
482
+ *
483
+ * Extensions should only be used for temporary enhancements
484
+ * to objects to support migrating away from deprecated patterns
485
+ * like custom getters, computeds, and methods
486
+ */
487
+ objectExtensions?: string[];
488
+ [key: string]: Value | undefined;
489
+ };
490
+ }
491
+ /**
492
+ * Represents a field whose value is an object
493
+ * with a well-defined structure described by
494
+ * a schema-object (a non-resource schema).
495
+ *
496
+ * If the object's structure is not well-defined,
497
+ * use 'object' instead.
498
+ *
499
+ * By default, a SchemaObject within
500
+ *
501
+ * @public
502
+ */
503
+ interface SchemaObjectField {
504
+ /**
505
+ * The kind of field this is.
506
+ *
507
+ * @public
508
+ */
509
+ kind: "schema-object";
510
+ /**
511
+ * The name of the field.
512
+ *
513
+ * @public
514
+ */
515
+ name: string;
516
+ /**
517
+ * The name of the field as returned by the API
518
+ * and inserted into the {@link Cache} if it differs
519
+ * from {@link SchemaObjectField.name}
520
+ *
521
+ * For instance, if the API returns:
522
+ *
523
+ * ```ts
524
+ * {
525
+ * attributes: {
526
+ * 'first-name': 'Chris'
527
+ * }
528
+ * }
529
+ * ```
530
+ *
531
+ * But the app desires to use `record.firstName; // 'Chris'`
532
+ *
533
+ * Then `name` would be set to `'firstName'` and
534
+ * `sourceKey` would be set to `'first-name'`.
535
+ *
536
+ * This option is only needed when the value differs from name.
537
+ */
538
+ sourceKey?: string;
539
+ /**
540
+ * If the field is not polymorphic:
541
+ *
542
+ * The name of the ObjectSchema that describes the
543
+ * structure of the object.
544
+ *
545
+ * If the field is polymorphic:
546
+ *
547
+ * The name of the hashFn to use to extract
548
+ * the type from the contained value or null.
549
+ *
550
+ * @public
551
+ */
552
+ type: string | null;
553
+ /**
554
+ * Options for configuring the behavior of the
555
+ * SchemaObject.
556
+ *
557
+ * - `polymorphic` : Whether this SchemaObject is Polymorphic.
558
+ * - `type` : If the SchemaObject is Polymorphic, the key on the raw cache data to use as the "resource-type" value for the schema-object.
559
+ *
560
+ * @public
561
+ */
562
+ options?: {
563
+ /**
564
+ * If true, if no value for this field exists in the cache,
565
+ * an empty `{}` will be used as the source for a new SchemaObject
566
+ * of the associated schema type, as opposed to the field's
567
+ * value being `null`.
568
+ *
569
+ * If `polymorphic` is `true`, defaultValue will be considered `false`.
570
+ */
571
+ defaultValue?: boolean;
572
+ /**
573
+ * ::: warning ⚠️ Dangerous Feature Ahead
574
+ * :::
575
+ *
576
+ * Configures which extensions this object should use.
577
+ *
578
+ * Extensions are registered with the store's schema service
579
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
580
+ *
581
+ * Extensions should only be used for temporary enhancements
582
+ * to objects to support migrating away from deprecated patterns
583
+ * like custom getters, computeds, and methods
584
+ */
585
+ objectExtensions?: string[];
586
+ /**
587
+ * Whether this SchemaObject is Polymorphic.
588
+ *
589
+ * If the SchemaObject is polymorphic, `options.type` must also be supplied.
590
+ *
591
+ * @public
592
+ */
593
+ polymorphic?: boolean;
594
+ /**
595
+ * If the SchemaObject is Polymorphic, the key on the raw cache data to use
596
+ * as the "resource-type" value for the schema-object.
597
+ *
598
+ * The default is `'type'`.
599
+ *
600
+ * Valid options are:
601
+ *
602
+ * - `'@hash'` : will lookup the `@hash` function specified by
603
+ * SchemaObjectField.type and use it to calculate the type for each value.
604
+ * - \<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)
605
+ * Are valid field names for this purpose. The cache state without transforms applied will be
606
+ * used when comparing values.
607
+ *
608
+ * @public
609
+ */
610
+ type?: string;
611
+ };
612
+ }
613
+ /**
614
+ * Represents a field whose value is an array
615
+ * of primitive values.
616
+ *
617
+ * If the array's elements are not primitive
618
+ * values, use 'schema-array' instead.
619
+ *
620
+ * @public
621
+ */
622
+ interface ArrayField {
623
+ /**
624
+ * The kind of field this is.
625
+ *
626
+ * @public
627
+ */
628
+ kind: "array";
629
+ /**
630
+ * The name of the field.
631
+ *
632
+ * @public
633
+ */
634
+ name: string;
635
+ /**
636
+ * The name of the field as returned by the API
637
+ * and inserted into the {@link Cache} if it differs
638
+ * from {@link ArrayField.name}
639
+ *
640
+ * For instance, if the API returns:
641
+ *
642
+ * ```ts
643
+ * {
644
+ * attributes: {
645
+ * 'first-name': 'Chris'
646
+ * }
647
+ * }
648
+ * ```
649
+ *
650
+ * But the app desires to use `record.firstName; // 'Chris'`
651
+ *
652
+ * Then `name` would be set to `'firstName'` and
653
+ * `sourceKey` would be set to `'first-name'`.
654
+ *
655
+ * This option is only needed when the value differs from name.
656
+ */
657
+ sourceKey?: string;
658
+ /**
659
+ * The name of a transform to pass each item
660
+ * in the array through before displaying or
661
+ * or serializing it.
662
+ *
663
+ * @public
664
+ */
665
+ type?: string;
666
+ /**
667
+ * Options to pass to the transform, if any
668
+ *
669
+ * Must comply to the specific transform's options
670
+ * schema.
671
+ *
672
+ * @public
673
+ */
674
+ options?: {
675
+ /**
676
+ * ::: warning ⚠️ Dangerous Feature Ahead
677
+ * :::
678
+ *
679
+ * Configures which extensions this array is allowed to use.
680
+ * Extensions are registered with the store's schema service
681
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
682
+ *
683
+ * Extensions should only be used for temporary enhancements
684
+ * to arrays to support migrating away from deprecated behaviors
685
+ * such as Ember's "ArrayLike" and FragmentArray from ember-data-model-fragments
686
+ */
687
+ arrayExtensions?: string[];
688
+ [key: string]: Value | undefined;
689
+ };
690
+ }
691
+ /**
692
+ * Represents a field whose value is an array
693
+ * of objects with a well-defined structure
694
+ * described by a non-resource schema.
695
+ *
696
+ * If the array's elements are not well-defined,
697
+ * use 'array' instead.
698
+ *
699
+ * @public
700
+ */
701
+ interface SchemaArrayField {
702
+ /**
703
+ * The kind of field this is.
704
+ *
705
+ * @public
706
+ */
707
+ kind: "schema-array";
708
+ /**
709
+ * The name of the field.
710
+ *
711
+ * @public
712
+ */
713
+ name: string;
714
+ /**
715
+ * The name of the field as returned by the API
716
+ * and inserted into the {@link Cache} if it differs
717
+ * from {@link SchemaArrayField.name}
718
+ *
719
+ * For instance, if the API returns:
720
+ *
721
+ * ```ts
722
+ * {
723
+ * attributes: {
724
+ * 'first-name': 'Chris'
725
+ * }
726
+ * }
727
+ * ```
728
+ *
729
+ * But the app desires to use `record.firstName; // 'Chris'`
730
+ *
731
+ * Then `name` would be set to `'firstName'` and
732
+ * `sourceKey` would be set to `'first-name'`.
733
+ *
734
+ * This option is only needed when the value differs from name.
735
+ */
736
+ sourceKey?: string;
737
+ /**
738
+ * If the SchemaArray is not polymorphic:
739
+ *
740
+ * The name of the ObjectSchema that describes the
741
+ * structure of the objects in the array.
742
+ *
743
+ * If the SchemaArray is polymorphic:
744
+ *
745
+ * The name of the hashFn to use to extract
746
+ * the type from contained members or null.
747
+ *
748
+ * @public
749
+ */
750
+ type: string | null;
751
+ /**
752
+ * Options for configuring the behavior of the
753
+ * SchemaArray.
754
+ *
755
+ * - `key`
756
+ *
757
+ * Configures how the SchemaArray determines whether an object in the cache is the same
758
+ * as an object previously used to instantiate one of the schema-objects it contains.
759
+ *
760
+ * The default is `'@identity'`.
761
+ *
762
+ * Valid options are:
763
+ *
764
+ * - `'@identity'`(default) : the cached object's referential identity will be used.
765
+ * This may result in significant instability when resource data is updated from the API
766
+ * - `'@index'` : the cached object's index in the array will be used.
767
+ * This is only a good choice for arrays that rarely if ever change membership
768
+ * - `'@hash'` : will lookup the `@hash` function supplied in the ResourceSchema for
769
+ * The contained schema-object and use the computed result to determine and compare identity.
770
+ * - \<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)
771
+ * Are valid field names for this purpose. The cache state without transforms applied will be
772
+ * used when comparing values. The field value should be unique enough to guarantee two schema-objects
773
+ * of the same type will not collide.
774
+ *
775
+ * - `polymorphic` : Whether this SchemaArray is Polymorphic.
776
+ * - `type` : If the SchemaArray is Polymorphic, the key on the raw cache data to use as the "resource-type" value for the schema-object.
777
+ *
778
+ * @public
779
+ */
780
+ options?: {
781
+ /**
782
+ * If true, if no value for this field exists in the cache,
783
+ * an empty `[]` will be used as the value of the field,
784
+ * as opposed to the field's value being `null`.
785
+ *
786
+ */
787
+ defaultValue?: boolean;
788
+ /**
789
+ * ::: warning ⚠️ Dangerous Feature Ahead
790
+ * :::
791
+ *
792
+ * Configures which extensions this array is allowed to use.
793
+ * Extensions are registered with the store's schema service
794
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
795
+ *
796
+ * Extensions should only be used for temporary enhancements
797
+ * to arrays to support migrating away from deprecated behaviors
798
+ * such as Ember's "ArrayLike" and FragmentArray from ember-data-model-fragments
799
+ */
800
+ arrayExtensions?: string[];
801
+ /**
802
+ * ::: warning ⚠️ Dangerous Feature Ahead
803
+ * :::
804
+ *
805
+ * Configures which extensions this object should use.
806
+ *
807
+ * Extensions are registered with the store's schema service
808
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
809
+ *
810
+ * Extensions should only be used for temporary enhancements
811
+ * to objects to support migrating away from deprecated patterns
812
+ * like custom getters, computeds, and methods
813
+ */
814
+ objectExtensions?: string[];
815
+ /**
816
+ * Configures how the SchemaArray determines whether
817
+ * an object in the cache is the same as an object
818
+ * previously used to instantiate one of the schema-objects
819
+ * it contains.
820
+ *
821
+ * The default is `'@identity'`.
822
+ *
823
+ * Valid options are:
824
+ *
825
+ * - `'@identity'` (default) : the cached object's referential identity will be used.
826
+ * This may result in significant instability when resource data is updated from the API
827
+ * - `'@index'` : the cached object's index in the array will be used.
828
+ * This is only a good choice for arrays that rarely if ever change membership
829
+ * - `'@hash'` : will lookup the `@hash` function supplied in the ResourceSchema for
830
+ * The contained schema-object and use the computed result to determine and compare identity.
831
+ * - \<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)
832
+ * Are valid field names for this purpose. The cache state without transforms applied will be
833
+ * used when comparing values. The field value should be unique enough to guarantee two schema-objects
834
+ * of the same type will not collide.
835
+ *
836
+ */
837
+ key?: "@identity" | "@index" | "@hash" | string;
838
+ /**
839
+ * Whether this SchemaArray is Polymorphic.
840
+ *
841
+ * If the SchemaArray is polymorphic, `options.type` must also be supplied.
842
+ *
843
+ */
844
+ polymorphic?: boolean;
845
+ /**
846
+ * If the SchemaArray is Polymorphic, the key on the raw cache data to use
847
+ * as the "resource-type" value for the schema-object.
848
+ *
849
+ * The default is `'type'`.
850
+ *
851
+ * Valid options are:
852
+ *
853
+ * - `'@hash'` : will lookup the `@hash` function specified by
854
+ * SchemaArrayField.type and use it to calculate the type for each value.
855
+ * - \<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)
856
+ * Are valid field names for this purpose. The cache state without transforms applied will be
857
+ * used when comparing values.
858
+ */
859
+ type?: string;
860
+ };
861
+ }
862
+ /**
863
+ * Represents a field whose value is derived
864
+ * from other fields in the schema.
865
+ *
866
+ * The value is read-only, and is not stored
867
+ * in the cache, nor is it sent to the server.
868
+ *
869
+ * Usage of derived fields should be minimized
870
+ * to scenarios where the derivation is known
871
+ * to be safe. For instance, derivations that
872
+ * required fields that are not always loaded
873
+ * or that require access to related resources
874
+ * that may not be loaded should be avoided.
875
+ *
876
+ * @public
877
+ */
878
+ interface DerivedField {
879
+ /**
880
+ * The kind of field this is.
881
+ *
882
+ * @public
883
+ */
884
+ kind: "derived";
885
+ /**
886
+ * The name of the field.
887
+ *
888
+ * @public
889
+ */
890
+ name: string;
891
+ /**
892
+ * The name of the derivation to use.
893
+ *
894
+ * Derivations are functions that take the
895
+ * record, options, and the name of the field
896
+ * as arguments, and return the derived value.
897
+ *
898
+ * Derivations are memoized, and are only
899
+ * recomputed when the fields they depend on
900
+ * change.
901
+ *
902
+ * Derivations are not stored in the cache,
903
+ * and are not sent to the server.
904
+ *
905
+ * Derivation functions must be explicitly
906
+ * registered with the schema service.
907
+ *
908
+ * @public
909
+ */
910
+ type: string;
911
+ /**
912
+ * Options to pass to the derivation, if any
913
+ *
914
+ * Must comply to the specific derivation's
915
+ * options schema.
916
+ *
917
+ * @public
918
+ */
919
+ options?: ObjectValue;
920
+ }
921
+ /**
922
+ * Represents a field that is a reference to
923
+ * another resource.
924
+ *
925
+ * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED
926
+ * BY ReactiveResource
927
+ *
928
+ * @public
929
+ */
930
+ interface ResourceField {
931
+ /**
932
+ * The kind of field this is.
933
+ *
934
+ * @public
935
+ */
936
+ kind: "resource";
937
+ /**
938
+ * The name of the field.
939
+ *
940
+ * @public
941
+ */
942
+ name: string;
943
+ /**
944
+ * The name of the field as returned by the API
945
+ * and inserted into the {@link Cache} if it differs
946
+ * from {@link ResourceField.name}
947
+ *
948
+ * For instance, if the API returns:
949
+ *
950
+ * ```ts
951
+ * {
952
+ * attributes: {
953
+ * 'first-name': 'Chris'
954
+ * }
955
+ * }
956
+ * ```
957
+ *
958
+ * But the app desires to use `record.firstName; // 'Chris'`
959
+ *
960
+ * Then `name` would be set to `'firstName'` and
961
+ * `sourceKey` would be set to `'first-name'`.
962
+ *
963
+ * This option is only needed when the value differs from name.
964
+ */
965
+ sourceKey?: string;
966
+ /**
967
+ * The name of the resource that this field
968
+ * refers to. In the case of a polymorphic
969
+ * relationship, this should be the trait
970
+ * or abstract type.
971
+ *
972
+ * @public
973
+ */
974
+ type: string;
975
+ /**
976
+ * Options for resources are optional. If
977
+ * not present, all options are presumed
978
+ * to be falsey
979
+ *
980
+ * @public
981
+ */
982
+ options?: {
983
+ /**
984
+ * Whether the relationship is async
985
+ *
986
+ * If true, it is expected that the cache
987
+ * data for this field will contain a link
988
+ * that can be used to fetch the related
989
+ * resource when needed.
990
+ *
991
+ * @public
992
+ */
993
+ async?: boolean;
994
+ /**
995
+ * The name of the inverse field on the
996
+ * related resource that points back to
997
+ * this field on this resource to form a
998
+ * bidirectional relationship.
999
+ *
1000
+ * If null, the relationship is unidirectional.
1001
+ *
1002
+ * @public
1003
+ */
1004
+ inverse?: string | null;
1005
+ /**
1006
+ * If this field is satisfying a polymorphic
1007
+ * relationship on another resource, then this
1008
+ * should be set to the trait or abstract type
1009
+ * that this resource implements.
1010
+ *
1011
+ * @public
1012
+ */
1013
+ as?: string;
1014
+ /**
1015
+ * Whether this field is a polymorphic relationship,
1016
+ * meaning that it can point to multiple types of
1017
+ * resources so long as they implement the trait
1018
+ * or abstract type specified in `type`.
1019
+ *
1020
+ * @public
1021
+ */
1022
+ polymorphic?: boolean;
1023
+ };
1024
+ }
1025
+ /**
1026
+ * Represents a field that is a reference to
1027
+ * a collection of other resources, potentially
1028
+ * paginate.
1029
+ *
1030
+ * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED
1031
+ * BY ReactiveResource
1032
+ *
1033
+ * @public
1034
+ */
1035
+ interface CollectionField {
1036
+ /**
1037
+ * The kind of field this is.
1038
+ *
1039
+ * @public
1040
+ */
1041
+ kind: "collection";
1042
+ /**
1043
+ * The name of the field.
1044
+ *
1045
+ * @public
1046
+ */
1047
+ name: string;
1048
+ /**
1049
+ * The name of the field as returned by the API
1050
+ * and inserted into the {@link Cache} if it differs
1051
+ * from {@link CollectionField.name}
1052
+ *
1053
+ * For instance, if the API returns:
1054
+ *
1055
+ * ```ts
1056
+ * {
1057
+ * attributes: {
1058
+ * 'first-name': 'Chris'
1059
+ * }
1060
+ * }
1061
+ * ```
1062
+ *
1063
+ * But the app desires to use `record.firstName; // 'Chris'`
1064
+ *
1065
+ * Then `name` would be set to `'firstName'` and
1066
+ * `sourceKey` would be set to `'first-name'`.
1067
+ *
1068
+ * This option is only needed when the value differs from name.
1069
+ */
1070
+ sourceKey?: string;
1071
+ /**
1072
+ * The name of the resource that this field
1073
+ * refers to. In the case of a polymorphic
1074
+ * relationship, this should be the trait
1075
+ * or abstract type.
1076
+ *
1077
+ * @public
1078
+ */
1079
+ type: string;
1080
+ /**
1081
+ * Options for resources are optional. If
1082
+ * not present, all options are presumed
1083
+ * to be falsey
1084
+ *
1085
+ * @public
1086
+ */
1087
+ options?: {
1088
+ /**
1089
+ * Whether the relationship is async
1090
+ *
1091
+ * If true, it is expected that the cache
1092
+ * data for this field will contain links
1093
+ * that can be used to fetch the related
1094
+ * resources when needed.
1095
+ *
1096
+ * When false, it is expected that all related
1097
+ * resources are loaded together with this resource,
1098
+ * and that the cache data for this field will
1099
+ * contain the full list of pointers.
1100
+ *
1101
+ * When true, it is expected that the relationship
1102
+ * is paginated. If the relationship is not paginated,
1103
+ * then the cache data for "page 1" would contain the
1104
+ * full list of pointers, and loading "page 1" would
1105
+ * load all related resources.
1106
+ *
1107
+ * @public
1108
+ */
1109
+ async?: boolean;
1110
+ /**
1111
+ * The name of the inverse field on the
1112
+ * related resource that points back to
1113
+ * this field on this resource to form a
1114
+ * bidirectional relationship.
1115
+ *
1116
+ * If null, the relationship is unidirectional.
1117
+ *
1118
+ * @public
1119
+ */
1120
+ inverse?: string | null;
1121
+ /**
1122
+ * If this field is satisfying a polymorphic
1123
+ * relationship on another resource, then this
1124
+ * should be set to the trait or abstract type
1125
+ * that this resource implements.
1126
+ *
1127
+ * @public
1128
+ */
1129
+ as?: string;
1130
+ /**
1131
+ * Whether this field is a polymorphic relationship,
1132
+ * meaning that it can point to multiple types of
1133
+ * resources so long as they implement the trait
1134
+ * or abstract type specified in `type`.
1135
+ *
1136
+ * @public
1137
+ */
1138
+ polymorphic?: boolean;
1139
+ };
1140
+ }
1141
+ /**
1142
+ * > [!CAUTION]
1143
+ * > This Field is LEGACY
1144
+ * > It cannot be used with PolarisMode
1145
+ *
1146
+ * A generic "field" that can be used to define
1147
+ * primitive value fields.
1148
+ *
1149
+ * If the field points to an object or array,
1150
+ * it will not be deep-tracked.
1151
+ *
1152
+ * Transforms when defined are legacy transforms
1153
+ * that a serializer *might* use, but their usage
1154
+ * is not guaranteed.
1155
+ *
1156
+ * @public
1157
+ */
1158
+ interface LegacyAttributeField {
1159
+ /**
1160
+ * The kind of field this is.
1161
+ *
1162
+ * @public
1163
+ */
1164
+ kind: "attribute";
1165
+ /**
1166
+ * The name of the field.
1167
+ *
1168
+ * @public
1169
+ */
1170
+ name: string;
1171
+ /**
1172
+ * The name of the field as returned by the API
1173
+ * and inserted into the {@link Cache} if it differs
1174
+ * from {@link LegacyAttributeField.name}
1175
+ *
1176
+ * For instance, if the API returns:
1177
+ *
1178
+ * ```ts
1179
+ * {
1180
+ * attributes: {
1181
+ * 'first-name': 'Chris'
1182
+ * }
1183
+ * }
1184
+ * ```
1185
+ *
1186
+ * But the app desires to use `record.firstName; // 'Chris'`
1187
+ *
1188
+ * Then `name` would be set to `'firstName'` and
1189
+ * `sourceKey` would be set to `'first-name'`.
1190
+ *
1191
+ * This option is only needed when the value differs from name.
1192
+ */
1193
+ sourceKey?: string;
1194
+ /**
1195
+ * The name of the transform to use, if any
1196
+ *
1197
+ * @public
1198
+ */
1199
+ type?: string | null;
1200
+ /**
1201
+ * Options to pass to the transform, if any
1202
+ *
1203
+ * Must comply to the specific transform's options
1204
+ * schema.
1205
+ *
1206
+ * See {@link AttrOptions} for more info.
1207
+ */
1208
+ options?: AttrOptions;
1209
+ }
1210
+ /**
1211
+ * > [!CAUTION]
1212
+ * > This Field is LEGACY
1213
+ *
1214
+ * Represents a field that is a reference to
1215
+ * another resource.
1216
+ *
1217
+ * This is the legacy version of the `ResourceField`.
1218
+ *
1219
+ * @public
1220
+ */
1221
+ interface LegacyBelongsToField {
1222
+ /**
1223
+ * The kind of field this is.
1224
+ *
1225
+ * @public
1226
+ */
1227
+ kind: "belongsTo";
1228
+ /**
1229
+ * The name of the field.
1230
+ *
1231
+ * @public
1232
+ */
1233
+ name: string;
1234
+ /**
1235
+ * The name of the field as returned by the API
1236
+ * and inserted into the {@link Cache} if it differs
1237
+ * from {@link LegacyBelongsToField.name}
1238
+ *
1239
+ * For instance, if the API returns:
1240
+ *
1241
+ * ```ts
1242
+ * {
1243
+ * attributes: {
1244
+ * 'first-name': 'Chris'
1245
+ * }
1246
+ * }
1247
+ * ```
1248
+ *
1249
+ * But the app desires to use `record.firstName; // 'Chris'`
1250
+ *
1251
+ * Then `name` would be set to `'firstName'` and
1252
+ * `sourceKey` would be set to `'first-name'`.
1253
+ *
1254
+ * This option is only needed when the value differs from name.
1255
+ */
1256
+ sourceKey?: string;
1257
+ /**
1258
+ * The name of the resource that this field
1259
+ * refers to. In the case of a polymorphic
1260
+ * relationship, this should be the trait
1261
+ * or abstract type.
1262
+ *
1263
+ * @public
1264
+ */
1265
+ type: string;
1266
+ /**
1267
+ * Options for belongsTo are mandatory.
1268
+ *
1269
+ * @public
1270
+ */
1271
+ options: {
1272
+ /**
1273
+ * Whether the relationship is async
1274
+ *
1275
+ * If true, it is expected that the cache
1276
+ * data for this field will contain a link
1277
+ * or a pointer that can be used to fetch
1278
+ * the related resource when needed.
1279
+ *
1280
+ * Pointers are highly discouraged.
1281
+ *
1282
+ * @public
1283
+ */
1284
+ async: boolean;
1285
+ /**
1286
+ * The name of the inverse field on the
1287
+ * related resource that points back to
1288
+ * this field on this resource to form a
1289
+ * bidirectional relationship.
1290
+ *
1291
+ * If null, the relationship is unidirectional.
1292
+ *
1293
+ * If the inverse field definition uses a sourceKey,
1294
+ * this should still be the name of the field, not the sourceKey.
1295
+ *
1296
+ * @public
1297
+ */
1298
+ inverse: string | null;
1299
+ /**
1300
+ * If this field is satisfying a polymorphic
1301
+ * relationship on another resource, then this
1302
+ * should be set to the trait or abstract type
1303
+ * that this resource implements.
1304
+ *
1305
+ * @public
1306
+ */
1307
+ as?: string;
1308
+ /**
1309
+ * Whether this field is a polymorphic relationship,
1310
+ * meaning that it can point to multiple types of
1311
+ * resources so long as they implement the trait
1312
+ * or abstract type specified in `type`.
1313
+ *
1314
+ * @public
1315
+ */
1316
+ polymorphic?: boolean;
1317
+ /**
1318
+ * Whether this field should ever make use of the legacy request infra
1319
+ * from @warp-drive/legacy/compat and the LegacyNetworkMiddleware for
1320
+ * adapters and serializers.
1321
+ *
1322
+ * When true, none of the legacy support will be utilized. Sync relationships
1323
+ * (`async: false`, currently the only supported combination) must satisfy
1324
+ * one of the following whenever pushed to the cache:
1325
+ *
1326
+ * - a `links.related` link is present, **or**
1327
+ * - the relationship is fully linked: `data` is `null`, or `data` points
1328
+ * to a resource present in the document's `included` array
1329
+ *
1330
+ * A related link lets you omit the related resource from `included`; a
1331
+ * `data` key that is missing entirely, or explicitly `undefined`, is never
1332
+ * valid unless a `links.related` link is present.
1333
+ *
1334
+ * ```ts
1335
+ * {
1336
+ * data: {
1337
+ * type: 'user',
1338
+ * id: '2',
1339
+ * attributes: { name: 'Chris' },
1340
+ * relationships: {
1341
+ * bestFriend: {
1342
+ * links: { related: "/users/1/bestFriend" },
1343
+ * data: { type: 'user', id: '1' },
1344
+ * }
1345
+ * }
1346
+ * },
1347
+ * included: [
1348
+ * { type: 'user', id: '1', attributes: { name: 'Krystan' } }
1349
+ * ]
1350
+ * }
1351
+ * ```
1352
+ *
1353
+ * Async relationships will be loaded via their link if needed.
1354
+ *
1355
+ * @public
1356
+ */
1357
+ linksMode?: true;
1358
+ /**
1359
+ * When omitted, the cache data for this field will
1360
+ * clear local state of all changes except for the
1361
+ * addition of records still in the "new" state any
1362
+ * time the remote data for this field is updated.
1363
+ *
1364
+ * When set to `false`, the cache data for this field
1365
+ * will instead intelligently commit any changes from
1366
+ * local state that are present in the remote data,
1367
+ * leaving any remaining changes in local state still.
1368
+ *
1369
+ * @public
1370
+ */
1371
+ resetOnRemoteUpdate?: false;
1372
+ };
1373
+ }
1374
+ /**
1375
+ * > [!CAUTION]
1376
+ * > This Field is LEGACY
1377
+ *
1378
+ * Represents a field that is a reference to
1379
+ * another resource.
1380
+ *
1381
+ * This is the legacy version of the `ResourceField`.
1382
+ *
1383
+ * @public
1384
+ */
1385
+ interface LinksModeBelongsToField {
1386
+ /**
1387
+ * The kind of field this is.
1388
+ *
1389
+ * @public
1390
+ */
1391
+ kind: "belongsTo";
1392
+ /**
1393
+ * The name of the field.
1394
+ *
1395
+ * @public
1396
+ */
1397
+ name: string;
1398
+ /**
1399
+ * The name of the field as returned by the API
1400
+ * and inserted into the {@link Cache} if it differs
1401
+ * from {@link LinksModeBelongsToField.name}
1402
+ *
1403
+ * For instance, if the API returns:
1404
+ *
1405
+ * ```ts
1406
+ * {
1407
+ * attributes: {
1408
+ * 'first-name': 'Chris'
1409
+ * }
1410
+ * }
1411
+ * ```
1412
+ *
1413
+ * But the app desires to use `record.firstName; // 'Chris'`
1414
+ *
1415
+ * Then `name` would be set to `'firstName'` and
1416
+ * `sourceKey` would be set to `'first-name'`.
1417
+ *
1418
+ * This option is only needed when the value differs from name.
1419
+ */
1420
+ sourceKey?: string;
1421
+ /**
1422
+ * The name of the resource that this field
1423
+ * refers to. In the case of a polymorphic
1424
+ * relationship, this should be the trait
1425
+ * or abstract type.
1426
+ *
1427
+ * @public
1428
+ */
1429
+ type: string;
1430
+ /**
1431
+ * Options for belongsTo are mandatory.
1432
+ *
1433
+ * @public
1434
+ */
1435
+ options: {
1436
+ /**
1437
+ * Whether the relationship is async
1438
+ *
1439
+ * MUST be false for PolarisMode + LinksMode
1440
+ *
1441
+ * @public
1442
+ */
1443
+ async: false;
1444
+ /**
1445
+ * The name of the inverse field on the
1446
+ * related resource that points back to
1447
+ * this field on this resource to form a
1448
+ * bidirectional relationship.
1449
+ *
1450
+ * If null, the relationship is unidirectional.
1451
+ *
1452
+ * If the inverse field definition uses a sourceKey,
1453
+ * this should still be the name of the field, not the sourceKey.
1454
+ *
1455
+ * @public
1456
+ */
1457
+ inverse: string | null;
1458
+ /**
1459
+ * If this field is satisfying a polymorphic
1460
+ * relationship on another resource, then this
1461
+ * should be set to the trait or abstract type
1462
+ * that this resource implements.
1463
+ *
1464
+ * @public
1465
+ */
1466
+ as?: string;
1467
+ /**
1468
+ * Whether this field is a polymorphic relationship,
1469
+ * meaning that it can point to multiple types of
1470
+ * resources so long as they implement the trait
1471
+ * or abstract type specified in `type`.
1472
+ *
1473
+ * @public
1474
+ */
1475
+ polymorphic?: boolean;
1476
+ /**
1477
+ * Whether this field should ever make use of the legacy support infra
1478
+ * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.
1479
+ *
1480
+ * MUST be true for PolarisMode + LinksMode
1481
+ *
1482
+ * When true, none of the legacy support will be utilized. Sync relationships
1483
+ * (`async: false`, currently the only supported combination) must satisfy
1484
+ * one of the following whenever pushed to the cache:
1485
+ *
1486
+ * - a `links.related` link is present, **or**
1487
+ * - the relationship is fully linked: `data` is `null`, or `data` points
1488
+ * to a resource present in the document's `included` array
1489
+ *
1490
+ * A related link lets you omit the related resource from `included`; a
1491
+ * `data` key that is missing entirely, or explicitly `undefined`, is never
1492
+ * valid unless a `links.related` link is present.
1493
+ *
1494
+ * ```ts
1495
+ * {
1496
+ * data: {
1497
+ * type: 'user',
1498
+ * id: '2',
1499
+ * attributes: { name: 'Chris' },
1500
+ * relationships: {
1501
+ * bestFriend: {
1502
+ * links: { related: "/users/1/bestFriend" },
1503
+ * data: { type: 'user', id: '1' },
1504
+ * }
1505
+ * }
1506
+ * },
1507
+ * included: [
1508
+ * { type: 'user', id: '1', attributes: { name: 'Krystan' } }
1509
+ * ]
1510
+ * }
1511
+ * ```
1512
+ *
1513
+ * Async relationships will be loaded via their link if needed.
1514
+ *
1515
+ * Activating LinksMode will *also* deactivate the deprecated
1516
+ * `resetOnRemoteUpdate` behavior for this field.
1517
+ *
1518
+ * This means that when new remote state is received, the cache
1519
+ * will intelligently commit any changes from local state that
1520
+ * are present in the remote data for this field, leaving any remaining
1521
+ * changes in local state still.
1522
+ *
1523
+ * Previously, the cache would clear local state of all changes
1524
+ * except for the addition of records still in the "new" state any
1525
+ * time the remote data for this field was updated.
1526
+ *
1527
+ * @public
1528
+ */
1529
+ linksMode: true;
1530
+ };
1531
+ }
1532
+ /**
1533
+ * > [!CAUTION]
1534
+ * > This Field is LEGACY
1535
+ *
1536
+ * Represents a field that is a reference to
1537
+ * a collection of other resources.
1538
+ *
1539
+ * This is the legacy version of the `CollectionField`.
1540
+ *
1541
+ * @public
1542
+ */
1543
+ interface LegacyHasManyField {
1544
+ /**
1545
+ * The kind of field this is.
1546
+ *
1547
+ * @public
1548
+ */
1549
+ kind: "hasMany";
1550
+ /**
1551
+ * The name of the field.
1552
+ *
1553
+ * @public
1554
+ */
1555
+ name: string;
1556
+ /**
1557
+ * The name of the field as returned by the API
1558
+ * and inserted into the {@link Cache} if it differs
1559
+ * from {@link LegacyHasManyField.name}
1560
+ *
1561
+ * For instance, if the API returns:
1562
+ *
1563
+ * ```ts
1564
+ * {
1565
+ * attributes: {
1566
+ * 'first-name': 'Chris'
1567
+ * }
1568
+ * }
1569
+ * ```
1570
+ *
1571
+ * But the app desires to use `record.firstName; // 'Chris'`
1572
+ *
1573
+ * Then `name` would be set to `'firstName'` and
1574
+ * `sourceKey` would be set to `'first-name'`.
1575
+ *
1576
+ * This option is only needed when the value differs from name.
1577
+ */
1578
+ sourceKey?: string;
1579
+ /**
1580
+ * the name of the resource that this field
1581
+ * refers to. In the case of a polymorphic
1582
+ * relationship, this should be the trait
1583
+ * or abstract type.
1584
+ *
1585
+ * @public
1586
+ */
1587
+ type: string;
1588
+ /**
1589
+ * Options for hasMany are mandatory.
1590
+ *
1591
+ * @public
1592
+ */
1593
+ options: {
1594
+ /**
1595
+ * ::: warning ⚠️ Dangerous Feature Ahead
1596
+ * :::
1597
+ *
1598
+ * Configures which extensions this array is allowed to use.
1599
+ * Extensions are registered with the store's schema service
1600
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
1601
+ *
1602
+ * Extensions should only be used for temporary enhancements
1603
+ * to arrays to support migrating away from deprecated behaviors
1604
+ * such as Ember's "ArrayLike" and FragmentArray from ember-data-model-fragments
1605
+ */
1606
+ arrayExtensions?: string[];
1607
+ /**
1608
+ * Whether the relationship is async
1609
+ *
1610
+ * If true, it is expected that the cache
1611
+ * data for this field will contain links
1612
+ * or pointers that can be used to fetch
1613
+ * the related resources when needed.
1614
+ *
1615
+ * When false, it is expected that all related
1616
+ * resources are loaded together with this resource,
1617
+ * and that the cache data for this field will
1618
+ * contain the full list of pointers.
1619
+ *
1620
+ * hasMany relationships do not support pagination.
1621
+ *
1622
+ * @public
1623
+ */
1624
+ async: boolean;
1625
+ /**
1626
+ * The name of the inverse field on the
1627
+ * related resource that points back to
1628
+ * this field on this resource to form a
1629
+ * bidirectional relationship.
1630
+ *
1631
+ * If null, the relationship is unidirectional.
1632
+ *
1633
+ * If the inverse field definition uses a sourceKey,
1634
+ * this should still be the name of the field, not the sourceKey.
1635
+ *
1636
+ * @public
1637
+ */
1638
+ inverse: string | null;
1639
+ /**
1640
+ * If this field is satisfying a polymorphic
1641
+ * relationship on another resource, then this
1642
+ * should be set to the trait or abstract type
1643
+ * that this resource implements.
1644
+ *
1645
+ * @public
1646
+ */
1647
+ as?: string;
1648
+ /**
1649
+ * Whether this field is a polymorphic relationship,
1650
+ * meaning that it can point to multiple types of
1651
+ * resources so long as they implement the trait
1652
+ * or abstract type specified in `type`.
1653
+ *
1654
+ * @public
1655
+ */
1656
+ polymorphic?: boolean;
1657
+ /**
1658
+ * Whether this field should ever make use of the legacy support infra
1659
+ * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.
1660
+ *
1661
+ * When true, none of the legacy support will be utilized. Sync relationships
1662
+ * (`async: false`, currently the only supported combination) must satisfy
1663
+ * one of the following whenever pushed to the cache:
1664
+ *
1665
+ * - a `links.related` link is present, **or**
1666
+ * - the relationship is fully linked: `data` is `[]`, or every resource
1667
+ * identifier in `data` is present in the document's `included` array
1668
+ *
1669
+ * A related link lets you omit the related resources from `included`; a
1670
+ * `data` key that is missing entirely, or explicitly `undefined`, is never
1671
+ * valid unless a `links.related` link is present.
1672
+ *
1673
+ * ```ts
1674
+ * {
1675
+ * data: {
1676
+ * type: 'user',
1677
+ * id: '2',
1678
+ * attributes: { name: 'Chris' },
1679
+ * relationships: {
1680
+ * bestFriends: {
1681
+ * links: { related: "/users/1/bestFriends" },
1682
+ * data: [ { type: 'user', id: '1' } ],
1683
+ * }
1684
+ * }
1685
+ * },
1686
+ * included: [
1687
+ * { type: 'user', id: '1', attributes: { name: 'Krystan' } }
1688
+ * ]
1689
+ * }
1690
+ * ```
1691
+ *
1692
+ * Async relationships will be loaded via their link if needed.
1693
+ *
1694
+ * @public
1695
+ */
1696
+ linksMode?: true;
1697
+ /**
1698
+ * When omitted, the cache data for this field will
1699
+ * clear local state of all changes except for the
1700
+ * addition of records still in the "new" state any
1701
+ * time the remote data for this field is updated.
1702
+ *
1703
+ * When set to `false`, the cache data for this field
1704
+ * will instead intelligently commit any changes from
1705
+ * local state that are present in the remote data,
1706
+ * leaving any remaining changes in local state still.
1707
+ *
1708
+ * @public
1709
+ */
1710
+ resetOnRemoteUpdate?: false;
1711
+ };
1712
+ }
1713
+ /**
1714
+ * > [!CAUTION]
1715
+ * > This Field is LEGACY
1716
+ *
1717
+ * Represents a field that is a reference to
1718
+ * a collection of other resources.
1719
+ *
1720
+ * This is the legacy version of the `CollectionField`.
1721
+ *
1722
+ * @public
1723
+ */
1724
+ interface LinksModeHasManyField {
1725
+ /**
1726
+ * The kind of field this is.
1727
+ *
1728
+ * @public
1729
+ */
1730
+ kind: "hasMany";
1731
+ /**
1732
+ * The name of the field.
1733
+ *
1734
+ * @public
1735
+ */
1736
+ name: string;
1737
+ /**
1738
+ * The name of the field as returned by the API
1739
+ * and inserted into the {@link Cache} if it differs
1740
+ * from {@link LinksModeHasManyField.name}
1741
+ *
1742
+ * For instance, if the API returns:
1743
+ *
1744
+ * ```ts
1745
+ * {
1746
+ * attributes: {
1747
+ * 'first-name': 'Chris'
1748
+ * }
1749
+ * }
1750
+ * ```
1751
+ *
1752
+ * But the app desires to use `record.firstName; // 'Chris'`
1753
+ *
1754
+ * Then `name` would be set to `'firstName'` and
1755
+ * `sourceKey` would be set to `'first-name'`.
1756
+ *
1757
+ * This option is only needed when the value differs from name.
1758
+ */
1759
+ sourceKey?: string;
1760
+ /**
1761
+ * the name of the resource that this field
1762
+ * refers to. In the case of a polymorphic
1763
+ * relationship, this should be the trait
1764
+ * or abstract type.
1765
+ *
1766
+ * @public
1767
+ */
1768
+ type: string;
1769
+ /**
1770
+ * Options for hasMany are mandatory.
1771
+ *
1772
+ * @public
1773
+ */
1774
+ options: {
1775
+ /**
1776
+ * ::: warning ⚠️ Dangerous Feature Ahead
1777
+ * :::
1778
+ *
1779
+ * Configures which extensions this array is allowed to use.
1780
+ * Extensions are registered with the store's schema service
1781
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
1782
+ *
1783
+ * Extensions should only be used for temporary enhancements
1784
+ * to arrays to support migrating away from deprecated behaviors
1785
+ * such as Ember's "ArrayLike" and FragmentArray from ember-data-model-fragments
1786
+ */
1787
+ arrayExtensions?: string[];
1788
+ /**
1789
+ * Whether the relationship is async
1790
+ *
1791
+ * MUST be false for PolarisMode + LinksMode
1792
+ *
1793
+ * If true, it is expected that the cache
1794
+ * data for this field will contain links
1795
+ * or pointers that can be used to fetch
1796
+ * the related resources when needed.
1797
+ *
1798
+ * When false, it is expected that all related
1799
+ * resources are loaded together with this resource,
1800
+ * and that the cache data for this field will
1801
+ * contain the full list of pointers.
1802
+ *
1803
+ * hasMany relationships do not support pagination.
1804
+ *
1805
+ * @public
1806
+ */
1807
+ async: false;
1808
+ /**
1809
+ * The name of the inverse field on the
1810
+ * related resource that points back to
1811
+ * this field on this resource to form a
1812
+ * bidirectional relationship.
1813
+ *
1814
+ * If null, the relationship is unidirectional.
1815
+ *
1816
+ * If the inverse field definition uses a sourceKey,
1817
+ * this should still be the name of the field, not the sourceKey.
1818
+ *
1819
+ * @public
1820
+ */
1821
+ inverse: string | null;
1822
+ /**
1823
+ * If this field is satisfying a polymorphic
1824
+ * relationship on another resource, then this
1825
+ * should be set to the trait or abstract type
1826
+ * that this resource implements.
1827
+ *
1828
+ * @public
1829
+ */
1830
+ as?: string;
1831
+ /**
1832
+ * Whether this field is a polymorphic relationship,
1833
+ * meaning that it can point to multiple types of
1834
+ * resources so long as they implement the trait
1835
+ * or abstract type specified in `type`.
1836
+ *
1837
+ * @public
1838
+ */
1839
+ polymorphic?: boolean;
1840
+ /**
1841
+ * Whether this field should ever make use of the legacy support infra
1842
+ * from @warp-drive/legacy/model and the LegacyNetworkMiddleware for adapters and serializers.
1843
+ *
1844
+ * MUST be true for PolarisMode + LinksMode
1845
+ *
1846
+ * When true, none of the legacy support will be utilized. Sync relationships
1847
+ * (`async: false`, currently the only supported combination) must satisfy
1848
+ * one of the following whenever pushed to the cache:
1849
+ *
1850
+ * - a `links.related` link is present, **or**
1851
+ * - the relationship is fully linked: `data` is `[]`, or every resource
1852
+ * identifier in `data` is present in the document's `included` array
1853
+ *
1854
+ * A related link lets you omit the related resources from `included`; a
1855
+ * `data` key that is missing entirely, or explicitly `undefined`, is never
1856
+ * valid unless a `links.related` link is present.
1857
+ *
1858
+ * ```ts
1859
+ * {
1860
+ * data: {
1861
+ * type: 'user',
1862
+ * id: '2',
1863
+ * attributes: { name: 'Chris' },
1864
+ * relationships: {
1865
+ * bestFriends: {
1866
+ * links: { related: "/users/1/bestFriends" },
1867
+ * data: [ { type: 'user', id: '1' } ],
1868
+ * }
1869
+ * }
1870
+ * },
1871
+ * included: [
1872
+ * { type: 'user', id: '1', attributes: { name: 'Krystan' } }
1873
+ * ]
1874
+ * }
1875
+ * ```
1876
+ *
1877
+ * Async relationships will be loaded via their link if needed.
1878
+ *
1879
+ * Activating LinksMode will *also* deactivate the deprecated
1880
+ * `resetOnRemoteUpdate` behavior for this field.
1881
+ *
1882
+ * This means that when new remote state is received, the cache
1883
+ * will intelligently commit any changes from local state that
1884
+ * are present in the remote data for this field, leaving any remaining
1885
+ * changes in local state still.
1886
+ *
1887
+ * Previously, the cache would clear local state of all changes
1888
+ * except for the addition of records still in the "new" state any
1889
+ * time the remote data for this field was updated.
1890
+ *
1891
+ * @public
1892
+ */
1893
+ linksMode: true;
1894
+ };
1895
+ }
1896
+ /**
1897
+ * A union of all possible LegacyMode field schemas.
1898
+ *
1899
+ * Available field schemas are:
1900
+ *
1901
+ * - {@link GenericField}
1902
+ * - {@link LegacyAliasField}
1903
+ * - {@link LocalField}
1904
+ * - {@link ObjectField}
1905
+ * - {@link SchemaObjectField}
1906
+ * - {@link ArrayField}
1907
+ * - {@link SchemaArrayField}
1908
+ * - {@link DerivedField}
1909
+ * - {@link ResourceField | ResourceField (not yet implemented)}
1910
+ * - {@link CollectionField | CollectionField (not yet implemented)}
1911
+ * - {@link LegacyAttributeField}
1912
+ * - {@link LegacyBelongsToField}
1913
+ * - {@link LegacyHasManyField}
1914
+ *
1915
+ * @public
1916
+ */
1917
+ type LegacyModeFieldSchema = GenericField | LegacyAliasField | LocalField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | DerivedField | LegacyAttributeField | LegacyBelongsToField | LegacyHasManyField;
1918
+ /**
1919
+ * A union of all possible PolarisMode field schemas.
1920
+ *
1921
+ * Available field schemas are:
1922
+ *
1923
+ * - {@link GenericField}
1924
+ * - {@link PolarisAliasField}
1925
+ * - {@link LocalField}
1926
+ * - {@link ObjectField}
1927
+ * - {@link SchemaObjectField}
1928
+ * - {@link ArrayField}
1929
+ * - {@link SchemaArrayField}
1930
+ * - {@link DerivedField}
1931
+ * - {@link ResourceField | ResourceField (not yet implemented)}
1932
+ * - {@link CollectionField | CollectionField (not yet implemented)}
1933
+ * - {@link LinksModeBelongsToField}
1934
+ * - {@link LinksModeHasManyField}
1935
+ *
1936
+ * @public
1937
+ */
1938
+ type PolarisModeFieldSchema = GenericField | PolarisAliasField | LocalField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | DerivedField | LinksModeBelongsToField | LinksModeHasManyField;
1939
+ /**
1940
+ * A union of all possible LegacyMode and PolarisMode
1941
+ * field schemas.
1942
+ *
1943
+ * You likely will want to use PolarisModeFieldSchema,
1944
+ * LegacyModeFieldSchema, or ObjectFieldSchema instead
1945
+ * as appropriate as they are more specific and will
1946
+ * provide better guidance around what is valid.
1947
+ *
1948
+ * @public
1949
+ */
1950
+ type FieldSchema = GenericField | LegacyAliasField | PolarisAliasField | LocalField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | DerivedField | ResourceField | CollectionField | LegacyAttributeField | LegacyBelongsToField | LegacyHasManyField | LinksModeBelongsToField | LinksModeHasManyField;
1951
+ /**
1952
+ * A union of all possible LegacyMode and PolarisMode
1953
+ * field schemas that represent data that could be in
1954
+ * the cache.
1955
+ *
1956
+ * In other words this will not include types like alias
1957
+ * fields, local fields, or derived fields.
1958
+ *
1959
+ * @public
1960
+ */
1961
+ type CacheableFieldSchema = IdentityField | GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | ResourceField | CollectionField | LegacyAttributeField | LegacyBelongsToField | LegacyHasManyField | LinksModeBelongsToField | LinksModeHasManyField;
1962
+ /**
1963
+ * A union of all possible field schemas that can be
1964
+ * used in an ObjectSchema.
1965
+ *
1966
+ * @public
1967
+ */
1968
+ type ObjectFieldSchema = LegacyAttributeField | GenericField | ObjectAliasField | LocalField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | DerivedField;
1969
+ /**
1970
+ * Represents a schema for a primary resource in PolarisMode.
1971
+ *
1972
+ * Primary resources are objects with a unique identity of their
1973
+ * own which may allow them to appear in relationships, or in multiple
1974
+ * response documents.
1975
+ *
1976
+ * @public
1977
+ */
1978
+ interface PolarisResourceSchema {
1979
+ /**
1980
+ * A flag indicating that this is not a legacy resource schema.
1981
+ *
1982
+ * @public
1983
+ */
1984
+ legacy?: false;
1985
+ /**
1986
+ * For primary resources, this should be an IdentityField
1987
+ *
1988
+ * for schema-objects, this should be either a HashField or null
1989
+ *
1990
+ * @public
1991
+ */
1992
+ identity: IdentityField;
1993
+ /**
1994
+ * The name of the schema
1995
+ *
1996
+ * For cacheable resources, this should be the
1997
+ * primary resource type.
1998
+ *
1999
+ * For object schemas, this should be the name
2000
+ * of the object schema.
2001
+ *
2002
+ * The names of object and resource schemas share
2003
+ * a single namespace and must not conflict.
2004
+ *
2005
+ * We recommend a naming convention for object schemas
2006
+ * such as below for ensuring uniqueness:
2007
+ *
2008
+ * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`
2009
+ * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`
2010
+ * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`
2011
+ *
2012
+ * @public
2013
+ */
2014
+ type: string;
2015
+ /**
2016
+ * The fields that make up the shape of the resource
2017
+ *
2018
+ * @public
2019
+ */
2020
+ fields: PolarisModeFieldSchema[];
2021
+ /**
2022
+ * A list of traits that this resource implements. The fields for these
2023
+ * traits should still be defined in the fields array.
2024
+ *
2025
+ * Each trait should be a string that matches the `type` of another
2026
+ * resource schema. The trait can be abstract and reference a resource
2027
+ * type that is never defined as a schema.
2028
+ *
2029
+ * @public
2030
+ */
2031
+ traits?: string[];
2032
+ }
2033
+ /**
2034
+ * Represents a schema for a primary resource in LegacyMode
2035
+ *
2036
+ * Primary resources are objects with a unique identity of their
2037
+ * own which may allow them to appear in relationships, or in multiple
2038
+ * response documents.
2039
+ *
2040
+ * @public
2041
+ */
2042
+ interface LegacyResourceSchema {
2043
+ /**
2044
+ * A flag indicating that this is a legacy resource schema
2045
+ *
2046
+ * @public
2047
+ */
2048
+ legacy: true;
2049
+ /**
2050
+ * This should be an IdentityField.
2051
+ *
2052
+ * To maximize compatibility with Model where `id` was the
2053
+ * name of the identity field, we recommend using `{ kind: '@id', name: 'id' }`
2054
+ * for records in legacy mode, but this is not required.
2055
+ *
2056
+ * @public
2057
+ */
2058
+ identity: IdentityField;
2059
+ /**
2060
+ * The name of the schema
2061
+ *
2062
+ * For cacheable resources, this should be the
2063
+ * primary resource type.
2064
+ *
2065
+ * The names of object and resource schemas share
2066
+ * a single namespace and must not conflict.
2067
+ *
2068
+ * We recommend a naming convention for object schemas
2069
+ * such as below for ensuring uniqueness:
2070
+ *
2071
+ * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`
2072
+ * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`
2073
+ * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`
2074
+ *
2075
+ * @public
2076
+ */
2077
+ type: string;
2078
+ /**
2079
+ * The fields that make up the shape of the resource
2080
+ *
2081
+ * @public
2082
+ */
2083
+ fields: LegacyModeFieldSchema[];
2084
+ /**
2085
+ * A list of traits that this resource implements. The fields for these
2086
+ * traits should still be defined in the fields array.
2087
+ *
2088
+ * Each trait should be a string that matches the `type` of another
2089
+ * resource schema. The trait can be abstract and reference a resource
2090
+ * type that is never defined as a schema.
2091
+ *
2092
+ * @public
2093
+ */
2094
+ traits?: string[];
2095
+ /**
2096
+ * ::: warning ⚠️ Dangerous Feature Ahead
2097
+ * :::
2098
+ *
2099
+ * Configures which extensions this resource should use.
2100
+ *
2101
+ * Extensions are registered with the store's schema service
2102
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
2103
+ *
2104
+ * Extensions should only be used for temporary enhancements
2105
+ * to objects to support migrating away from deprecated patterns
2106
+ * like custom getters, computeds, and methods
2107
+ */
2108
+ objectExtensions?: string[];
2109
+ }
2110
+ /**
2111
+ * A type which represents a valid JSON schema
2112
+ * definition for either a PolarisMode or a
2113
+ * LegacyMode resource.
2114
+ *
2115
+ * Note, this is separate from the type returned
2116
+ * by the SchemaService which provides fields as a Map
2117
+ * instead of as an Array.
2118
+ *
2119
+ * @public
2120
+ */
2121
+ type ResourceSchema = PolarisResourceSchema | LegacyResourceSchema;
2122
+ /**
2123
+ * Represents a schema for an object that is not
2124
+ * a primary resource (has no unique identity of its own).
2125
+ *
2126
+ * ObjectSchemas may not currently contain relationships.
2127
+ *
2128
+ * @public
2129
+ */
2130
+ interface ObjectSchema {
2131
+ /**
2132
+ * Either a HashField from which to calculate an identity or null
2133
+ *
2134
+ * In the case of `null`, the object's identity will be based
2135
+ * on the referential identity of the object in the cache itself
2136
+ * when an identity is needed.
2137
+ *
2138
+ * @public
2139
+ */
2140
+ identity: HashField | null;
2141
+ /**
2142
+ * The name of the schema
2143
+ *
2144
+ * The names of object and resource schemas share
2145
+ * a single namespace and must not conflict.
2146
+ *
2147
+ * We recommend a naming convention for object schemas
2148
+ * such as below for ensuring uniqueness:
2149
+ *
2150
+ * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`
2151
+ * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`
2152
+ * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`
2153
+ *
2154
+ * @public
2155
+ */
2156
+ type: string;
2157
+ /**
2158
+ * The fields that make up the shape of the object
2159
+ *
2160
+ * @public
2161
+ */
2162
+ fields: ObjectFieldSchema[];
2163
+ /**
2164
+ * ::: warning ⚠️ Dangerous Feature Ahead
2165
+ * :::
2166
+ *
2167
+ * Configures which extensions this object should use.
2168
+ *
2169
+ * Extensions are registered with the store's schema service
2170
+ * via {@link SchemaService.CAUTION_MEGA_DANGER_ZONE_registerExtension}
2171
+ *
2172
+ * Extensions should only be used for temporary enhancements
2173
+ * to objects to support migrating away from deprecated patterns
2174
+ * like custom getters, computeds, and methods
2175
+ */
2176
+ objectExtensions?: string[];
2177
+ }
2178
+ /**
2179
+ * A union of {@link ResourceSchema} and {@link ObjectSchema} representing
2180
+ * any schema that can be registered with or returned by the SchemaService.
2181
+ *
2182
+ * @public
2183
+ */
2184
+ type Schema = ResourceSchema | ObjectSchema;
2185
+ /**
2186
+ * A trait for use on a PolarisMode record.
2187
+ *
2188
+ * Traits are reusable collections of fields that can be composed onto a
2189
+ * resource schema, often to describe a polymorphic capability shared by
2190
+ * multiple resource types.
2191
+ */
2192
+ interface PolarisTrait {
2193
+ /**
2194
+ * The name of the trait.
2195
+ *
2196
+ * This is the string referenced by a resource schema's `traits` array,
2197
+ * or by another trait's `traits` array, in order to make use of this
2198
+ * trait.
2199
+ */
2200
+ name: string;
2201
+ /**
2202
+ * The mode this trait is valid for use with.
2203
+ *
2204
+ * A PolarisTrait may only be applied to PolarisMode resource schemas.
2205
+ */
2206
+ mode: "polaris";
2207
+ /**
2208
+ * The fields that this trait contributes to any resource schema
2209
+ * that implements it.
2210
+ */
2211
+ fields: PolarisModeFieldSchema[];
2212
+ /**
2213
+ * A list of other traits that this trait itself implements.
2214
+ *
2215
+ * As with a resource schema's `traits`, each entry should be a string
2216
+ * matching the `name` of another trait.
2217
+ */
2218
+ traits?: string[];
2219
+ }
2220
+ /**
2221
+ * A trait for use on a LegacyMode record.
2222
+ *
2223
+ * Traits are reusable collections of fields that can be composed onto a
2224
+ * resource schema, often to describe a polymorphic capability shared by
2225
+ * multiple resource types.
2226
+ */
2227
+ interface LegacyTrait {
2228
+ /**
2229
+ * The name of the trait.
2230
+ *
2231
+ * This is the string referenced by a resource schema's `traits` array,
2232
+ * or by another trait's `traits` array, in order to make use of this
2233
+ * trait.
2234
+ */
2235
+ name: string;
2236
+ /**
2237
+ * The mode this trait is valid for use with.
2238
+ *
2239
+ * A LegacyTrait may only be applied to LegacyMode resource schemas.
2240
+ */
2241
+ mode: "legacy";
2242
+ /**
2243
+ * The fields that this trait contributes to any resource schema
2244
+ * that implements it.
2245
+ */
2246
+ fields: LegacyModeFieldSchema[];
2247
+ /**
2248
+ * A list of other traits that this trait itself implements.
2249
+ *
2250
+ * As with a resource schema's `traits`, each entry should be a string
2251
+ * matching the `name` of another trait.
2252
+ */
2253
+ traits?: string[];
2254
+ }
2255
+ /**
2256
+ * A union of
2257
+ * - {@link LegacyTrait}
2258
+ * - {@link PolarisTrait}
2259
+ */
2260
+ type Trait = LegacyTrait | PolarisTrait;
2261
+ /**
2262
+ * A no-op type utility that enables type-checking resource schema
2263
+ * definitions.
2264
+ *
2265
+ * Will return the passed in schema.
2266
+ *
2267
+ * This will not validate relationship inverses or related types,
2268
+ * as doing so would require a full schema graph to be passed in
2269
+ * and no cycles in the graph to be present.
2270
+ *
2271
+ * @public
2272
+ */
2273
+ declare function resourceSchema<T extends LegacyResourceSchema | PolarisResourceSchema>(schema: LegacyResourceSchema | PolarisResourceSchema): T;
2274
+ /**
2275
+ * A no-op type utility that enables type-checking object schema
2276
+ * definitions.
2277
+ *
2278
+ * Will return the passed in schema.
2279
+ *
2280
+ * @public
2281
+ */
2282
+ declare function objectSchema<T extends ObjectSchema>(schema: T): T;
2283
+ /**
2284
+ * A type utility to narrow a schema to a ResourceSchema
2285
+ *
2286
+ * @public
2287
+ */
2288
+ declare function isResourceSchema(schema: ResourceSchema | ObjectSchema): schema is ResourceSchema;
2289
+ /**
2290
+ * A type utility to narrow a schema to LegacyResourceSchema
2291
+ *
2292
+ * @public
2293
+ */
2294
+ declare function isLegacyResourceSchema(schema: ResourceSchema | ObjectSchema): schema is LegacyResourceSchema;
2295
+ /**
2296
+ * A union of all field schemas considered "legacy", i.e. those historically
2297
+ * associated with `@warp-drive/legacy/model`'s Attribute, BelongsTo and
2298
+ * HasMany fields, including their LinksMode variants.
2299
+ *
2300
+ * Available field schemas are:
2301
+ *
2302
+ * - {@link LegacyAttributeField}
2303
+ * - {@link LegacyBelongsToField}
2304
+ * - {@link LegacyHasManyField}
2305
+ * - {@link LinksModeBelongsToField}
2306
+ * - {@link LinksModeHasManyField}
2307
+ *
2308
+ * @public
2309
+ */
2310
+ type LegacyField = LegacyAttributeField | LegacyBelongsToField | LegacyHasManyField | LinksModeBelongsToField | LinksModeHasManyField;
2311
+ /**
2312
+ * A union of all legacy relationship field schemas, i.e. {@link LegacyField}
2313
+ * excluding {@link LegacyAttributeField}.
2314
+ *
2315
+ * Available field schemas are:
2316
+ *
2317
+ * - {@link LegacyBelongsToField}
2318
+ * - {@link LegacyHasManyField}
2319
+ * - {@link LinksModeBelongsToField}
2320
+ * - {@link LinksModeHasManyField}
2321
+ *
2322
+ * @public
2323
+ */
2324
+ type LegacyRelationshipField = LegacyBelongsToField | LegacyHasManyField | LinksModeBelongsToField | LinksModeHasManyField;
2325
+ //#endregion
2326
+ export { ResourceField as A, ObjectField as C, PolarisModeFieldSchema as D, PolarisAliasField as E, Trait as F, isLegacyResourceSchema as I, isResourceSchema as L, Schema as M, SchemaArrayField as N, PolarisResourceSchema as O, SchemaObjectField as P, objectSchema as R, ObjectAliasField as S, ObjectSchema as T, LegacyResourceSchema as _, DerivedField as a, LinksModeHasManyField as b, HashField as c, LegacyAttributeField as d, LegacyBelongsToField as f, LegacyRelationshipField as g, LegacyModeFieldSchema as h, CollectionField as i, ResourceSchema as j, PolarisTrait as k, IdentityField as l, LegacyHasManyField as m, AttrOptions as n, FieldSchema as o, LegacyField as p, CacheableFieldSchema as r, GenericField as s, ArrayField as t, LegacyAliasField as u, LegacyTrait as v, ObjectFieldSchema as w, LocalField as x, LinksModeBelongsToField as y, resourceSchema as z };
2327
+ //# sourceMappingURL=fields-FM7peCiM.d.ts.map