@warp-drive/core 5.9.0-alpha.19 → 5.9.0-alpha.20

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