@warp-drive/core-types 5.4.0-alpha.143 → 5.4.0-alpha.144

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.
package/dist/-private.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
2
2
  const name = "@warp-drive/core-types";
3
- const version = "5.4.0-alpha.143";
3
+ const version = "5.4.0-alpha.144";
4
4
 
5
5
  // in testing mode, we utilize globals to ensure only one copy exists of
6
6
  // these maps, due to bugs in ember-auto-import
@@ -0,0 +1,307 @@
1
+ /**
2
+ * @module @warp-drive/core-types
3
+ */
4
+
5
+ /**
6
+ * A generic "field" that can be used to define
7
+ * primitive value fields.
8
+ *
9
+ * Replaces "attribute" for primitive value fields.
10
+ * Can also be used to eject from deep-tracking of
11
+ * objects or arrays.
12
+ *
13
+ * A major difference between "field" and "attribute"
14
+ * is that "type" points to a legacy transform on
15
+ * "attribute" that a serializer *might* use, while
16
+ * "type" points to a new-style transform on "field"
17
+ * that a record implmentation *must* use.
18
+ *
19
+ * @typedoc
20
+ */
21
+
22
+ /**
23
+ * A field that can be used to alias one key to another
24
+ * key present in the cache version of the resource.
25
+ *
26
+ * Unlike DerivedField, an AliasField may write to its
27
+ * source when a record is in an editable mode.
28
+ *
29
+ * AliasFields may utilize a transform, specified by type,
30
+ * to pre/post process the field.
31
+ *
32
+ * An AliasField may also specify a `kind` via options.
33
+ * `kind` may be any other valid field kind other than
34
+ *
35
+ * - `@hash`
36
+ * - `@id`
37
+ * - `@local`
38
+ * - `derived`
39
+ *
40
+ * This allows an AliasField to rename any field in the cache.
41
+ *
42
+ * Alias fields are generally intended to be used to support migrating
43
+ * between different schemas, though there are times where they are useful
44
+ * as a form of advanced derivation when used with a transform. For instance,
45
+ * an AliasField could be used to expose both a string and a Date version of the
46
+ * same field, with both being capable of being written to.
47
+ *
48
+ * @typedoc
49
+ */
50
+
51
+ /**
52
+ * Represents a field whose value is the primary
53
+ * key of the resource.
54
+ *
55
+ * This allows any field to serve as the primary
56
+ * key while still being able to drive identity
57
+ * needs within the system.
58
+ *
59
+ * This is useful for resources that use for instance
60
+ * 'uuid', 'urn' or 'entityUrn' or 'primaryKey' as their
61
+ * primary key field instead of 'id'.
62
+ *
63
+ * @typedoc
64
+ */
65
+
66
+ /**
67
+ * Represents a specialized field whose computed value
68
+ * will be used as the primary key of a schema-object
69
+ * for serializability and comparison purposes.
70
+ *
71
+ * This field functions similarly to derived fields in that
72
+ * it is non-settable, derived state but differs in that
73
+ * it is only able to compute off of cache state and is given
74
+ * no access to a record instance.
75
+ *
76
+ * This means that if a hashing function wants to compute its value
77
+ * taking into account transformations and derivations it must
78
+ * perform those itself.
79
+ *
80
+ * A schema-array can declare its "key" value to be `@hash` if
81
+ * a schema-object has such a field.
82
+ *
83
+ * Only one hash field is permittable per schema-object, and
84
+ * it should be placed in the `ResourceSchema`'s `@id` field
85
+ * in place of an `IdentityField`.
86
+ *
87
+ * @typedoc
88
+ */
89
+
90
+ /**
91
+ * Represents a field whose value is a local
92
+ * value that is not stored in the cache, nor
93
+ * is it sent to the server.
94
+ *
95
+ * Local fields can be written to, and their
96
+ * value is both memoized and reactive (though
97
+ * not deep-tracked).
98
+ *
99
+ * Because their state is not derived from the cache
100
+ * data or the server, they represent a divorced
101
+ * uncanonical source of state.
102
+ *
103
+ * For this reason Local fields should be used sparingly.
104
+ *
105
+ * Currently, while we document this feature here,
106
+ * only allow our own SchemaRecord should utilize them
107
+ * and the feature should be considered private.
108
+ *
109
+ * Example use cases that drove the creation of local
110
+ * fields are states like `isDestroying` and `isDestroyed`
111
+ * which are specific to a record instance but not
112
+ * stored in the cache. We wanted to be able to drive
113
+ * these fields from schema the same as all other fields.
114
+ *
115
+ * Don't make us regret this decision.
116
+ *
117
+ * @typedoc
118
+ */
119
+
120
+ /**
121
+ * Represents a field whose value is an object
122
+ * with keys pointing to values that are primitive
123
+ * values.
124
+ *
125
+ * If values of the keys are not primitives, or
126
+ * if the key/value pairs have well-defined shape,
127
+ * use 'schema-object' instead.
128
+ *
129
+ * @typedoc
130
+ */
131
+
132
+ /**
133
+ * Represents a field whose value is an object
134
+ * with a well-defined structure described by
135
+ * a non-resource schema.
136
+ *
137
+ * If the object's structure is not well-defined,
138
+ * use 'object' instead.
139
+ *
140
+ * @typedoc
141
+ */
142
+
143
+ /**
144
+ * Represents a field whose value is an array
145
+ * of primitive values.
146
+ *
147
+ * If the array's elements are not primitive
148
+ * values, use 'schema-array' instead.
149
+ *
150
+ * @typedoc
151
+ */
152
+
153
+ /**
154
+ * Represents a field whose value is an array
155
+ * of objects with a well-defined structure
156
+ * described by a non-resource schema.
157
+ *
158
+ * If the array's elements are not well-defined,
159
+ * use 'array' instead.
160
+ *
161
+ * @typedoc
162
+ */
163
+
164
+ /**
165
+ * Represents a field whose value is derived
166
+ * from other fields in the schema.
167
+ *
168
+ * The value is read-only, and is not stored
169
+ * in the cache, nor is it sent to the server.
170
+ *
171
+ * Usage of derived fields should be minimized
172
+ * to scenarios where the derivation is known
173
+ * to be safe. For instance, derivations that
174
+ * required fields that are not always loaded
175
+ * or that require access to related resources
176
+ * that may not be loaded should be avoided.
177
+ *
178
+ * @typedoc
179
+ */
180
+
181
+ /**
182
+ * Represents a field that is a reference to
183
+ * another resource.
184
+ *
185
+ * @typedoc
186
+ */
187
+
188
+ /**
189
+ * Represents a field that is a reference to
190
+ * a collection of other resources, potentially
191
+ * paginate.
192
+ *
193
+ * @typedoc
194
+ */
195
+
196
+ /**
197
+ * > [!CAUTION]
198
+ * > This Field is LEGACY
199
+ *
200
+ * A generic "field" that can be used to define
201
+ * primitive value fields.
202
+ *
203
+ * If the field points to an object or array,
204
+ * it will not be deep-tracked.
205
+ *
206
+ * Transforms when defined are legacy transforms
207
+ * that a serializer *might* use, but their usage
208
+ * is not guaranteed.
209
+ *
210
+ * @typedoc
211
+ */
212
+
213
+ /**
214
+ * > [!CAUTION]
215
+ * > This Field is LEGACY
216
+ *
217
+ * Represents a field that is a reference to
218
+ * another resource.
219
+ *
220
+ * This is the legacy version of the `ResourceField`.
221
+ *
222
+ * @typedoc
223
+ */
224
+
225
+ /**
226
+ * > [!CAUTION]
227
+ * > This Field is LEGACY
228
+ *
229
+ * Represents a field that is a reference to
230
+ * a collection of other resources.
231
+ *
232
+ * This is the legacy version of the `CollectionField`.
233
+ *
234
+ * @typedoc
235
+ */
236
+
237
+ /**
238
+ * Represents a schema for a primary resource.
239
+ *
240
+ * Primary resources are objects with a unique identity of their
241
+ * own which may allow them to appear in relationships, or is multiple
242
+ * response document.
243
+ *
244
+ * @typedoc
245
+ */
246
+
247
+ /**
248
+ * Represents a schema for an object that is not
249
+ * a primary resource (has no unique identity of its own).
250
+ *
251
+ * ObjectSchemas may not currently contain relationships.
252
+ *
253
+ * @typedoc
254
+ */
255
+
256
+ /**
257
+ * A no-op type utility that enables type-checking resource schema
258
+ * definitions.
259
+ *
260
+ * Will return the passed in schema.
261
+ *
262
+ * This will not validate relationship inverses or related types,
263
+ * as doing so would require a full schema graph to be passed in
264
+ * and no cycles in the graph to be present.
265
+ *
266
+ * @method resourceSchema
267
+ * @static
268
+ * @for @warp-drive/core-types
269
+ * @param {ResourceSchema} schema
270
+ * @returns {ResourceSchema} the passed in schema
271
+ * @public
272
+ */
273
+ function resourceSchema(schema) {
274
+ return schema;
275
+ }
276
+
277
+ /**
278
+ * A no-op type utility that enables type-checking object schema
279
+ * definitions.
280
+ *
281
+ * Will return the passed in schema.
282
+ *
283
+ * @method objectSchema
284
+ * @static
285
+ * @for @warp-drive/core-types
286
+ * @param {ObjectSchema} schema
287
+ * @returns {ObjectSchema} the passed in schema
288
+ * @public
289
+ */
290
+ function objectSchema(schema) {
291
+ return schema;
292
+ }
293
+
294
+ /**
295
+ * A type utility to narrow a schema to a ResourceSchema
296
+ *
297
+ * @method isResourceSchema
298
+ * @static
299
+ * @for @warp-drive/core-types
300
+ * @param schema
301
+ * @returns {boolean}
302
+ * @public
303
+ */
304
+ function isResourceSchema(schema) {
305
+ return schema?.identity?.kind === '@id';
306
+ }
307
+ export { isResourceSchema, objectSchema, resourceSchema };
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"fields.js","sources":["../../src/schema/fields.ts"],"sourcesContent":["/**\n * @module @warp-drive/core-types\n */\nimport type { ObjectValue, PrimitiveValue } from '../json/raw';\n\n/**\n * A generic \"field\" that can be used to define\n * primitive value fields.\n *\n * Replaces \"attribute\" for primitive value fields.\n * Can also be used to eject from deep-tracking of\n * objects or arrays.\n *\n * A major difference between \"field\" and \"attribute\"\n * is that \"type\" points to a legacy transform on\n * \"attribute\" that a serializer *might* use, while\n * \"type\" points to a new-style transform on \"field\"\n * that a record implmentation *must* use.\n *\n * @typedoc\n */\nexport type GenericField = {\n kind: 'field';\n name: string;\n /**\n * the name of the transform to use, if any\n * @typedoc\n */\n type?: string;\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @typedoc\n */\n options?: ObjectValue;\n};\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * AliasFields may utilize a transform, specified by type,\n * to pre/post process the field.\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @typedoc\n */\nexport type AliasField = {\n kind: 'alias';\n name: string;\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @typedoc\n */\n options:\n | GenericField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | ResourceField\n | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField;\n};\n\n/**\n * Represents a field whose value is the primary\n * key of the resource.\n *\n * This allows any field to serve as the primary\n * key while still being able to drive identity\n * needs within the system.\n *\n * This is useful for resources that use for instance\n * 'uuid', 'urn' or 'entityUrn' or 'primaryKey' as their\n * primary key field instead of 'id'.\n *\n * @typedoc\n */\nexport type IdentityField = {\n kind: '@id';\n\n /**\n * The name of the field that serves as the\n * primary key for the resource.\n *\n * @typedoc\n */\n name: string;\n};\n\n/**\n * Represents a specialized field whose computed value\n * will be used as the primary key of a schema-object\n * for serializability and comparison purposes.\n *\n * This field functions similarly to derived fields in that\n * it is non-settable, derived state but differs in that\n * it is only able to compute off of cache state and is given\n * no access to a record instance.\n *\n * This means that if a hashing function wants to compute its value\n * taking into account transformations and derivations it must\n * perform those itself.\n *\n * A schema-array can declare its \"key\" value to be `@hash` if\n * a schema-object has such a field.\n *\n * Only one hash field is permittable per schema-object, and\n * it should be placed in the `ResourceSchema`'s `@id` field\n * in place of an `IdentityField`.\n *\n * @typedoc\n */\nexport type HashField = {\n kind: '@hash';\n\n /**\n * The name of the field that serves as the\n * hash for the resource.\n *\n * Only required if access to this value by\n * the UI is desired, it can be `null` otherwise.\n *\n * @typedoc\n */\n name: string | null;\n\n /**\n * The name of a function to run to compute the hash.\n * The function will only have access to the cached\n * data for the record.\n *\n * @typedoc\n */\n type: string;\n\n /**\n * Any options that should be provided to the hash\n * function.\n *\n * @typedoc\n */\n options?: ObjectValue;\n};\n\n/**\n * Represents a field whose value is a local\n * value that is not stored in the cache, nor\n * is it sent to the server.\n *\n * Local fields can be written to, and their\n * value is both memoized and reactive (though\n * not deep-tracked).\n *\n * Because their state is not derived from the cache\n * data or the server, they represent a divorced\n * uncanonical source of state.\n *\n * For this reason Local fields should be used sparingly.\n *\n * Currently, while we document this feature here,\n * only allow our own SchemaRecord should utilize them\n * and the feature should be considered private.\n *\n * Example use cases that drove the creation of local\n * fields are states like `isDestroying` and `isDestroyed`\n * which are specific to a record instance but not\n * stored in the cache. We wanted to be able to drive\n * these fields from schema the same as all other fields.\n *\n * Don't make us regret this decision.\n *\n * @typedoc\n */\nexport type LocalField = {\n kind: '@local';\n name: string;\n /**\n * Not currently utilized, we are considering\n * allowing transforms to operate on local fields\n *\n * @typedoc\n */\n type?: string;\n options?: { defaultValue?: PrimitiveValue };\n};\n\n/**\n * Represents a field whose value is an object\n * with keys pointing to values that are primitive\n * values.\n *\n * If values of the keys are not primitives, or\n * if the key/value pairs have well-defined shape,\n * use 'schema-object' instead.\n *\n * @typedoc\n */\nexport type ObjectField = {\n kind: 'object';\n name: string;\n\n /**\n * The name of a transform to pass the entire object\n * through before displaying or serializing it.\n *\n * @typedoc\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @typedoc\n */\n options?: ObjectValue;\n};\n\n/**\n * Represents a field whose value is an object\n * with a well-defined structure described by\n * a non-resource schema.\n *\n * If the object's structure is not well-defined,\n * use 'object' instead.\n *\n * @typedoc\n */\nexport type SchemaObjectField = {\n kind: 'schema-object';\n name: string;\n\n /**\n * The name of the schema that describes the\n * structure of the object.\n *\n * These schemas\n *\n * @typedoc\n */\n type: string;\n\n options?: {\n /**\n * Whether this SchemaObject is Polymorphic.\n *\n * If the SchemaObject is polymorphic, `options.type` must also be supplied.\n *\n * @typedoc\n */\n polymorphic?: boolean;\n\n /**\n * If the SchemaObject is Polymorphic, the key on the raw cache data to use\n * as the \"resource-type\" value for the schema-object.\n *\n * Defaults to \"type\".\n *\n * @typedoc\n */\n type?: string;\n };\n};\n\n/**\n * Represents a field whose value is an array\n * of primitive values.\n *\n * If the array's elements are not primitive\n * values, use 'schema-array' instead.\n *\n * @typedoc\n */\nexport type ArrayField = {\n kind: 'array';\n name: string;\n\n /**\n * The name of a transform to pass each item\n * in the array through before displaying or\n * or serializing it.\n *\n * @typedoc\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @typedoc\n */\n options?: ObjectValue;\n};\n\n/**\n * Represents a field whose value is an array\n * of objects with a well-defined structure\n * described by a non-resource schema.\n *\n * If the array's elements are not well-defined,\n * use 'array' instead.\n *\n * @typedoc\n */\nexport type SchemaArrayField = {\n kind: 'schema-array';\n name: string;\n\n /**\n * The name of the schema that describes the\n * structure of the objects in the array.\n *\n * @typedoc\n */\n type: string;\n\n /**\n * Options for configuring the behavior of the\n * SchemaArray.\n *\n * @typedoc\n */\n\n /**\n * Options for configuring the behavior of the\n * SchemaArray.\n *\n * @typedoc\n */\n options?: {\n /**\n * Configures how the SchemaArray determines whether\n * an object in the cache is the same as an object\n * previously used to instantiate one of the schema-objects\n * it contains.\n *\n * The default is `'@identity'`.\n *\n * Valid options are:\n *\n * - `'@identity'` (default) : the cached object's referential identity will be used.\n * This may result in significant instability when resource data is updated from the API\n * - `'@index'` : the cached object's index in the array will be used.\n * This is only a good choice for arrays that rarely if ever change membership\n * - `'@hash'` : will lookup the `@hash` function supplied in the ResourceSchema for\n * The contained schema-object and use the computed result to determine and compare identity.\n * - <field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values. The field value should be unique enough to guarantee two schema-objects\n * of the same type will not collide.\n *\n * @typedoc\n */\n key?: '@identity' | '@index' | '@hash' | string;\n\n /**\n * Whether this SchemaArray is Polymorphic.\n *\n * If the SchemaArray is polymorphic, `options.type` must also be supplied.\n *\n * @typedoc\n */\n polymorphic?: boolean;\n\n /**\n * If the SchemaArray is Polymorphic, the key on the raw cache data to use\n * as the \"resource-type\" value for the schema-object.\n *\n * Defaults to \"type\".\n *\n * @typedoc\n */\n type?: string;\n };\n};\n\n/**\n * Represents a field whose value is derived\n * from other fields in the schema.\n *\n * The value is read-only, and is not stored\n * in the cache, nor is it sent to the server.\n *\n * Usage of derived fields should be minimized\n * to scenarios where the derivation is known\n * to be safe. For instance, derivations that\n * required fields that are not always loaded\n * or that require access to related resources\n * that may not be loaded should be avoided.\n *\n * @typedoc\n */\nexport type DerivedField = {\n kind: 'derived';\n name: string;\n\n /**\n * The name of the derivation to use.\n *\n * Derivations are functions that take the\n * record, options, and the name of the field\n * as arguments, and return the derived value.\n *\n * Derivations are memoized, and are only\n * recomputed when the fields they depend on\n * change.\n *\n * Derivations are not stored in the cache,\n * and are not sent to the server.\n *\n * Derivation functions must be explicitly\n * registered with the schema service.\n *\n * @typedoc\n */\n type: string;\n\n /**\n * Options to pass to the derivation, if any\n *\n * Must comply to the specific derivation's\n * options schema.\n *\n * @typedoc\n */\n options?: ObjectValue;\n};\n\n/**\n * Represents a field that is a reference to\n * another resource.\n *\n * @typedoc\n */\nexport type ResourceField = {\n kind: 'resource';\n name: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @typedoc\n */\n type: string;\n\n /**\n * Options for resources are optional. If\n * not present, all options are presumed\n * to be falsey\n *\n * @typedoc\n */\n options?: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain a link\n * that can be used to fetch the related\n * resource when needed.\n *\n * @typedoc\n */\n async?: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * @typedoc\n */\n inverse?: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @typedoc\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @typedoc\n */\n polymorphic?: boolean;\n };\n};\n\n/**\n * Represents a field that is a reference to\n * a collection of other resources, potentially\n * paginate.\n *\n * @typedoc\n */\nexport type CollectionField = {\n kind: 'collection';\n name: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @typedoc\n */\n type: string;\n\n /**\n * Options for resources are optional. If\n * not present, all options are presumed\n * to be falsey\n *\n * @typedoc\n */\n options?: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * that can be used to fetch the related\n * resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * When true, it is expected that the relationship\n * is paginated. If the relationship is not paginated,\n * then the cache data for \"page 1\" would contain the\n * full list of pointers, and loading \"page 1\" would\n * load all related resources.\n *\n * @typedoc\n */\n async?: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * @typedoc\n */\n inverse?: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @typedoc\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @typedoc\n */\n polymorphic?: boolean;\n };\n};\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * A generic \"field\" that can be used to define\n * primitive value fields.\n *\n * If the field points to an object or array,\n * it will not be deep-tracked.\n *\n * Transforms when defined are legacy transforms\n * that a serializer *might* use, but their usage\n * is not guaranteed.\n *\n * @typedoc\n */\nexport type LegacyAttributeField = {\n kind: 'attribute';\n name: string;\n /**\n * The name of the transform to use, if any\n *\n * @typedoc\n */\n type?: string | null;\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @typedoc\n */\n options?: ObjectValue;\n};\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * another resource.\n *\n * This is the legacy version of the `ResourceField`.\n *\n * @typedoc\n */\nexport type LegacyBelongsToField = {\n kind: 'belongsTo';\n name: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @typedoc\n */\n type: string;\n\n /**\n * Options for belongsTo are mandatory.\n *\n * @typedoc\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain a link\n * or a pointer that can be used to fetch\n * the related resource when needed.\n *\n * Pointers are highly discouraged.\n *\n * @typedoc\n */\n async: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * @typedoc\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @typedoc\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @typedoc\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * will be expected to already have all their data. When reloading a sync relationship\n * you would be expected to have a `related link` available from a prior relationship\n * payload e.g.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriend: {\n * links: { related: \"/users/1/bestFriend\" },\n * data: { type: 'user', id: '1' },\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * @typedoc\n */\n linksMode?: true;\n\n /**\n * When omitted, the cache data for this field will\n * clear local state of all changes except for the\n * addition of records still in the \"new\" state any\n * time the remote data for this field is updated.\n *\n * When set to `false`, the cache data for this field\n * will instead intelligently commit any changes from\n * local state that are present in the remote data,\n * leaving any remaining changes in local state still.\n *\n * @typedoc\n */\n resetOnRemoteUpdate?: false;\n };\n};\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * a collection of other resources.\n *\n * This is the legacy version of the `CollectionField`.\n *\n * @typedoc\n */\nexport type LegacyHasManyField = {\n kind: 'hasMany';\n name: string;\n type: string;\n\n /**\n * Options for hasMany are mandatory.\n *\n * @typedoc\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * or pointers that can be used to fetch\n * the related resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * hasMany relationships do not support pagination.\n *\n * @typedoc\n */\n async: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n * @typedoc\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n * @typedoc\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n * @typedoc\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * will be expected to already have all their data. When reloading a sync relationship\n * you would be expected to have a `related link` available from a prior relationship\n * payload e.g.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriends: {\n * links: { related: \"/users/1/bestFriends\" },\n * data: [ { type: 'user', id: '1' } ],\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * @typedoc\n */\n linksMode?: true;\n\n /**\n * When omitted, the cache data for this field will\n * clear local state of all changes except for the\n * addition of records still in the \"new\" state any\n * time the remote data for this field is updated.\n *\n * When set to `false`, the cache data for this field\n * will instead intelligently commit any changes from\n * local state that are present in the remote data,\n * leaving any remaining changes in local state still.\n *\n * @typedoc\n */\n resetOnRemoteUpdate?: false;\n };\n};\n\nexport type FieldSchema =\n | GenericField\n | AliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n | ResourceField\n | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField;\n\nexport type ObjectFieldSchema =\n | GenericField\n | AliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField;\n\n/**\n * Represents a schema for a primary resource.\n *\n * Primary resources are objects with a unique identity of their\n * own which may allow them to appear in relationships, or is multiple\n * response document.\n *\n * @typedoc\n */\nexport interface ResourceSchema {\n legacy?: boolean;\n\n /**\n * For primary resources, this should be an IdentityField\n *\n * for schema-objects, this should be either a HashField or null\n *\n * @typedoc\n */\n identity: IdentityField;\n\n /**\n * The name of the schema\n *\n * For cacheable resources, this should be the\n * primary resource type.\n *\n * For object schemas, this should be the name\n * of the object schema.\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @typedoc\n */\n type: string;\n\n /**\n * The fields that make up the shape of the resource\n *\n * @typedoc\n */\n fields: FieldSchema[];\n\n /**\n * A list of traits that this resource implements. The fields for these\n * traits should still be defined in the fields array.\n *\n * Each trait should be a string that matches the `type` of another\n * resource schema. The trait can be abstract and reference a resource\n * type that is never defined as a schema.\n *\n * @typedoc\n */\n traits?: string[];\n}\n\n/**\n * Represents a schema for an object that is not\n * a primary resource (has no unique identity of its own).\n *\n * ObjectSchemas may not currently contain relationships.\n *\n * @typedoc\n */\nexport interface ObjectSchema {\n /**\n * Either a HashField from which to calculate an identity or null\n *\n * In the case of `null`, the object's identity will be based\n * on the referential identity of the object in the cache itself\n * when an identity is needed.\n *\n * @typedoc\n */\n identity: HashField | null;\n\n /**\n * The name of the schema\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @typedoc\n */\n type: string;\n\n /**\n * The fields that make up the shape of the object\n *\n * @typedoc\n */\n fields: ObjectFieldSchema[];\n}\n\n/**\n * A no-op type utility that enables type-checking resource schema\n * definitions.\n *\n * Will return the passed in schema.\n *\n * This will not validate relationship inverses or related types,\n * as doing so would require a full schema graph to be passed in\n * and no cycles in the graph to be present.\n *\n * @method resourceSchema\n * @static\n * @for @warp-drive/core-types\n * @param {ResourceSchema} schema\n * @returns {ResourceSchema} the passed in schema\n * @public\n */\nexport function resourceSchema<T extends ResourceSchema>(schema: T): T {\n return schema;\n}\n\n/**\n * A no-op type utility that enables type-checking object schema\n * definitions.\n *\n * Will return the passed in schema.\n *\n * @method objectSchema\n * @static\n * @for @warp-drive/core-types\n * @param {ObjectSchema} schema\n * @returns {ObjectSchema} the passed in schema\n * @public\n */\nexport function objectSchema<T extends ObjectSchema>(schema: T): T {\n return schema;\n}\n\n/**\n * A type utility to narrow a schema to a ResourceSchema\n *\n * @method isResourceSchema\n * @static\n * @for @warp-drive/core-types\n * @param schema\n * @returns {boolean}\n * @public\n */\nexport function isResourceSchema(schema: ResourceSchema | ObjectSchema): schema is ResourceSchema {\n return schema?.identity?.kind === '@id';\n}\n\nexport type LegacyFieldSchema = LegacyAttributeField | LegacyBelongsToField | LegacyHasManyField;\nexport type LegacyRelationshipSchema = LegacyBelongsToField | LegacyHasManyField;\n"],"names":["resourceSchema","schema","objectSchema","isResourceSchema","identity","kind"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqCA;AACA;AACA;AACA;AACA;AACA;;AAqEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAcA,CAA2BC,MAAS,EAAK;AACrE,EAAA,OAAOA,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAyBD,MAAS,EAAK;AACjE,EAAA,OAAOA,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAACF,MAAqC,EAA4B;AAChG,EAAA,OAAOA,MAAM,EAAEG,QAAQ,EAAEC,IAAI,KAAK,KAAK;AACzC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warp-drive/core-types",
3
- "version": "5.4.0-alpha.143",
3
+ "version": "5.4.0-alpha.144",
4
4
  "description": "Provides core logic, utils and types for WarpDrive and EmberData",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -33,13 +33,13 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@embroider/macros": "^1.16.11",
36
- "@warp-drive/build-config": "5.4.0-alpha.143"
36
+ "@warp-drive/build-config": "5.4.0-alpha.144"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@babel/core": "^7.26.9",
40
40
  "@babel/plugin-transform-typescript": "^7.26.8",
41
41
  "@babel/preset-typescript": "^7.26.0",
42
- "@warp-drive/internal-config": "5.4.0-alpha.143",
42
+ "@warp-drive/internal-config": "5.4.0-alpha.144",
43
43
  "typescript": "^5.8.2",
44
44
  "vite": "^5.4.14"
45
45
  },
@@ -20,6 +20,13 @@
20
20
  /// <reference path="./spec/document.d.ts" />
21
21
  /// <reference path="./spec/json-api-raw.d.ts" />
22
22
  declare module '@warp-drive/core-types' {
23
+ /**
24
+ * This package provides core types, type-utilities, symbols
25
+ * and constants used across the WarpDrive ecosystem.
26
+ *
27
+ * @module @warp-drive/core-types
28
+ * @main @warp-drive/core-types
29
+ */
23
30
  export type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
24
31
  }
25
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,YAAY,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
@@ -1,4 +1,7 @@
1
1
  declare module '@warp-drive/core-types/schema/fields' {
2
+ /**
3
+ * @module @warp-drive/core-types
4
+ */
2
5
  import type { ObjectValue, PrimitiveValue } from '@warp-drive/core-types/json/raw';
3
6
  /**
4
7
  * A generic "field" that can be used to define
@@ -840,7 +843,17 @@ declare module '@warp-drive/core-types/schema/fields' {
840
843
  };
841
844
  };
842
845
  export type FieldSchema = GenericField | AliasField | LocalField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | DerivedField | ResourceField | CollectionField | LegacyAttributeField | LegacyBelongsToField | LegacyHasManyField;
843
- export type ResourceSchema = {
846
+ export type ObjectFieldSchema = GenericField | AliasField | LocalField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | DerivedField;
847
+ /**
848
+ * Represents a schema for a primary resource.
849
+ *
850
+ * Primary resources are objects with a unique identity of their
851
+ * own which may allow them to appear in relationships, or is multiple
852
+ * response document.
853
+ *
854
+ * @typedoc
855
+ */
856
+ export interface ResourceSchema {
844
857
  legacy?: boolean;
845
858
  /**
846
859
  * For primary resources, this should be an IdentityField
@@ -849,7 +862,7 @@ declare module '@warp-drive/core-types/schema/fields' {
849
862
  *
850
863
  * @typedoc
851
864
  */
852
- identity: IdentityField | HashField | null;
865
+ identity: IdentityField;
853
866
  /**
854
867
  * The name of the schema
855
868
  *
@@ -857,8 +870,13 @@ declare module '@warp-drive/core-types/schema/fields' {
857
870
  * primary resource type.
858
871
  *
859
872
  * For object schemas, this should be the name
860
- * of the object schema. object schemas should
861
- * follow the following guidelines for naming
873
+ * of the object schema.
874
+ *
875
+ * The names of object and resource schemas share
876
+ * a single namespace and must not conflict.
877
+ *
878
+ * We recommend a naming convention for object schemas
879
+ * such as below for ensuring uniqueness:
862
880
  *
863
881
  * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`
864
882
  * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`
@@ -867,9 +885,109 @@ declare module '@warp-drive/core-types/schema/fields' {
867
885
  * @typedoc
868
886
  */
869
887
  type: string;
870
- traits?: string[];
888
+ /**
889
+ * The fields that make up the shape of the resource
890
+ *
891
+ * @typedoc
892
+ */
871
893
  fields: FieldSchema[];
872
- };
894
+ /**
895
+ * A list of traits that this resource implements. The fields for these
896
+ * traits should still be defined in the fields array.
897
+ *
898
+ * Each trait should be a string that matches the `type` of another
899
+ * resource schema. The trait can be abstract and reference a resource
900
+ * type that is never defined as a schema.
901
+ *
902
+ * @typedoc
903
+ */
904
+ traits?: string[];
905
+ }
906
+ /**
907
+ * Represents a schema for an object that is not
908
+ * a primary resource (has no unique identity of its own).
909
+ *
910
+ * ObjectSchemas may not currently contain relationships.
911
+ *
912
+ * @typedoc
913
+ */
914
+ export interface ObjectSchema {
915
+ /**
916
+ * Either a HashField from which to calculate an identity or null
917
+ *
918
+ * In the case of `null`, the object's identity will be based
919
+ * on the referential identity of the object in the cache itself
920
+ * when an identity is needed.
921
+ *
922
+ * @typedoc
923
+ */
924
+ identity: HashField | null;
925
+ /**
926
+ * The name of the schema
927
+ *
928
+ * The names of object and resource schemas share
929
+ * a single namespace and must not conflict.
930
+ *
931
+ * We recommend a naming convention for object schemas
932
+ * such as below for ensuring uniqueness:
933
+ *
934
+ * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`
935
+ * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`
936
+ * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`
937
+ *
938
+ * @typedoc
939
+ */
940
+ type: string;
941
+ /**
942
+ * The fields that make up the shape of the object
943
+ *
944
+ * @typedoc
945
+ */
946
+ fields: ObjectFieldSchema[];
947
+ }
948
+ /**
949
+ * A no-op type utility that enables type-checking resource schema
950
+ * definitions.
951
+ *
952
+ * Will return the passed in schema.
953
+ *
954
+ * This will not validate relationship inverses or related types,
955
+ * as doing so would require a full schema graph to be passed in
956
+ * and no cycles in the graph to be present.
957
+ *
958
+ * @method resourceSchema
959
+ * @static
960
+ * @for @warp-drive/core-types
961
+ * @param {ResourceSchema} schema
962
+ * @returns {ResourceSchema} the passed in schema
963
+ * @public
964
+ */
965
+ export function resourceSchema<T extends ResourceSchema>(schema: T): T;
966
+ /**
967
+ * A no-op type utility that enables type-checking object schema
968
+ * definitions.
969
+ *
970
+ * Will return the passed in schema.
971
+ *
972
+ * @method objectSchema
973
+ * @static
974
+ * @for @warp-drive/core-types
975
+ * @param {ObjectSchema} schema
976
+ * @returns {ObjectSchema} the passed in schema
977
+ * @public
978
+ */
979
+ export function objectSchema<T extends ObjectSchema>(schema: T): T;
980
+ /**
981
+ * A type utility to narrow a schema to a ResourceSchema
982
+ *
983
+ * @method isResourceSchema
984
+ * @static
985
+ * @for @warp-drive/core-types
986
+ * @param schema
987
+ * @returns {boolean}
988
+ * @public
989
+ */
990
+ export function isResourceSchema(schema: ResourceSchema | ObjectSchema): schema is ResourceSchema;
873
991
  export type LegacyFieldSchema = LegacyAttributeField | LegacyBelongsToField | LegacyHasManyField;
874
992
  export type LegacyRelationshipSchema = LegacyBelongsToField | LegacyHasManyField;
875
993
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/schema/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IAEX;;;;OAIG;IACH,OAAO,EACH,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,UAAU,GACV,gBAAgB,GAChB,aAAa,GACb,eAAe,GACf,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,KAAK,CAAC;IAEZ;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,OAAO,CAAC;IAEd;;;;;;;;OAQG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB;;;;;;OAM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