@warp-drive/core 5.6.0-alpha.18 → 5.6.0-alpha.5

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