@warp-drive/schema-record 0.0.0-alpha.50 → 0.0.0-alpha.57
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/addon-main.cjs +5 -0
- package/{addon → dist}/hooks.js +3 -2
- package/dist/hooks.js.map +1 -0
- package/{addon → dist}/record.js +202 -65
- package/dist/record.js.map +1 -0
- package/dist/schema.js +278 -0
- package/dist/schema.js.map +1 -0
- package/dist/symbols-CAUfvZjq.js +45 -0
- package/dist/symbols-CAUfvZjq.js.map +1 -0
- package/package.json +30 -42
- package/unstable-preview-types/hooks.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +4 -4
- package/unstable-preview-types/managed-array.d.ts +3 -6
- package/unstable-preview-types/managed-array.d.ts.map +1 -1
- package/unstable-preview-types/managed-object.d.ts +3 -6
- package/unstable-preview-types/managed-object.d.ts.map +1 -1
- package/unstable-preview-types/record.d.ts +2 -6
- package/unstable-preview-types/record.d.ts.map +1 -1
- package/unstable-preview-types/schema.d.ts +69 -52
- package/unstable-preview-types/schema.d.ts.map +1 -1
- package/unstable-preview-types/symbols.d.ts +14 -0
- package/unstable-preview-types/symbols.d.ts.map +1 -0
- package/addon/hooks.js.map +0 -1
- package/addon/managed-array.js +0 -164
- package/addon/managed-array.js.map +0 -1
- package/addon/record.js.map +0 -1
- package/addon/schema.js +0 -152
- package/addon/schema.js.map +0 -1
- package/addon-main.js +0 -94
- package/unstable-preview-types/-base-fields.d.ts +0 -23
- package/unstable-preview-types/-base-fields.d.ts.map +0 -1
package/dist/schema.js
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { deprecate } from '@ember/debug';
|
|
2
|
+
import { recordIdentifierFor } from '@ember-data/store';
|
|
3
|
+
import { createCache, getValue } from '@ember-data/tracking';
|
|
4
|
+
import { Signals } from '@ember-data/tracking/-private';
|
|
5
|
+
import { getOrSetGlobal } from '@warp-drive/core-types/-private';
|
|
6
|
+
import { Type } from '@warp-drive/core-types/symbols';
|
|
7
|
+
import { I as Identifier } from "./symbols-CAUfvZjq";
|
|
8
|
+
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
9
|
+
const Support = getOrSetGlobal('Support', new WeakMap());
|
|
10
|
+
const SchemaRecordFields = [{
|
|
11
|
+
type: '@constructor',
|
|
12
|
+
name: 'constructor',
|
|
13
|
+
kind: 'derived'
|
|
14
|
+
}, {
|
|
15
|
+
type: '@identity',
|
|
16
|
+
name: '$type',
|
|
17
|
+
kind: 'derived',
|
|
18
|
+
options: {
|
|
19
|
+
key: 'type'
|
|
20
|
+
}
|
|
21
|
+
}];
|
|
22
|
+
function _constructor(record) {
|
|
23
|
+
let state = Support.get(record);
|
|
24
|
+
if (!state) {
|
|
25
|
+
state = {};
|
|
26
|
+
Support.set(record, state);
|
|
27
|
+
}
|
|
28
|
+
return state._constructor = state._constructor || {
|
|
29
|
+
name: `SchemaRecord<${recordIdentifierFor(record).type}>`,
|
|
30
|
+
get modelName() {
|
|
31
|
+
throw new Error('Cannot access record.constructor.modelName on non-Legacy Schema Records.');
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
_constructor[Type] = '@constructor';
|
|
36
|
+
function withDefaults(schema) {
|
|
37
|
+
schema.identity = schema.identity || {
|
|
38
|
+
name: 'id',
|
|
39
|
+
kind: '@id'
|
|
40
|
+
};
|
|
41
|
+
schema.fields.push(...SchemaRecordFields);
|
|
42
|
+
return schema;
|
|
43
|
+
}
|
|
44
|
+
function fromIdentity(record, options, key) {
|
|
45
|
+
const identifier = record[Identifier];
|
|
46
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
47
|
+
if (!test) {
|
|
48
|
+
throw new Error(`Cannot compute @identity for a record without an identifier`);
|
|
49
|
+
}
|
|
50
|
+
})(identifier) : {};
|
|
51
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
52
|
+
if (!test) {
|
|
53
|
+
throw new Error(`Expected to receive a key to compute @identity, but got ${String(options)}`);
|
|
54
|
+
}
|
|
55
|
+
})(options?.key && ['lid', 'id', 'type', '^'].includes(options.key)) : {};
|
|
56
|
+
return options.key === '^' ? identifier : identifier[options.key];
|
|
57
|
+
}
|
|
58
|
+
fromIdentity[Type] = '@identity';
|
|
59
|
+
function registerDerivations(schema) {
|
|
60
|
+
schema.registerDerivation(fromIdentity);
|
|
61
|
+
schema.registerDerivation(_constructor);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Wraps a derivation in a new function with Derivation signature but that looks
|
|
65
|
+
* up the value in the cache before recomputing.
|
|
66
|
+
*
|
|
67
|
+
* @param record
|
|
68
|
+
* @param options
|
|
69
|
+
* @param prop
|
|
70
|
+
*/
|
|
71
|
+
function makeCachedDerivation(derivation) {
|
|
72
|
+
const memoizedDerivation = (record, options, prop) => {
|
|
73
|
+
const signals = record[Signals];
|
|
74
|
+
let signal = signals.get(prop);
|
|
75
|
+
if (!signal) {
|
|
76
|
+
signal = createCache(() => {
|
|
77
|
+
return derivation(record, options, prop);
|
|
78
|
+
}); // a total lie, for convenience of reusing the storage
|
|
79
|
+
signals.set(prop, signal);
|
|
80
|
+
}
|
|
81
|
+
return getValue(signal);
|
|
82
|
+
};
|
|
83
|
+
memoizedDerivation[Type] = derivation[Type];
|
|
84
|
+
return memoizedDerivation;
|
|
85
|
+
}
|
|
86
|
+
class SchemaService {
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
|
+
|
|
89
|
+
constructor() {
|
|
90
|
+
this._schemas = new Map();
|
|
91
|
+
this._transforms = new Map();
|
|
92
|
+
this._hashFns = new Map();
|
|
93
|
+
this._derivations = new Map();
|
|
94
|
+
}
|
|
95
|
+
hasTrait(type) {
|
|
96
|
+
return this._traits.has(type);
|
|
97
|
+
}
|
|
98
|
+
resourceHasTrait(resource, trait) {
|
|
99
|
+
return this._schemas.get(resource.type).traits.has(trait);
|
|
100
|
+
}
|
|
101
|
+
transformation(field) {
|
|
102
|
+
const kind = 'kind' in field ? field.kind : '<unknown kind>';
|
|
103
|
+
const name = 'name' in field ? field.name : '<unknown name>';
|
|
104
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
105
|
+
if (!test) {
|
|
106
|
+
throw new Error(`'${kind}' fields cannot be transformed. Only fields of kind 'field' 'object' or 'array' can specify a transformation. Attempted to find '${field.type ?? '<unknown type>'}' on field '${name}'.`);
|
|
107
|
+
}
|
|
108
|
+
})(!('kind' in field) || ['field', 'object', 'array'].includes(kind)) : {};
|
|
109
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
110
|
+
if (!test) {
|
|
111
|
+
throw new Error(`Expected the '${kind}' field '${name}' to specify a transformation via 'field.type', but none was present`);
|
|
112
|
+
}
|
|
113
|
+
})(field.type) : {};
|
|
114
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
115
|
+
if (!test) {
|
|
116
|
+
throw new Error(`No transformation registered with name '${field.type}' for '${kind}' field '${name}'`);
|
|
117
|
+
}
|
|
118
|
+
})(this._transforms.has(field.type)) : {};
|
|
119
|
+
return this._transforms.get(field.type);
|
|
120
|
+
}
|
|
121
|
+
derivation(field) {
|
|
122
|
+
const kind = 'kind' in field ? field.kind : '<unknown kind>';
|
|
123
|
+
const name = 'name' in field ? field.name : '<unknown name>';
|
|
124
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
125
|
+
if (!test) {
|
|
126
|
+
throw new Error(`The '${kind}' field '${name}' is not derived and so cannot be used to lookup a derivation`);
|
|
127
|
+
}
|
|
128
|
+
})(!('kind' in field) || kind === 'derived') : {};
|
|
129
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
130
|
+
if (!test) {
|
|
131
|
+
throw new Error(`Expected the '${kind}' field '${name}' to specify a derivation via 'field.type', but no value was present`);
|
|
132
|
+
}
|
|
133
|
+
})(field.type) : {};
|
|
134
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
135
|
+
if (!test) {
|
|
136
|
+
throw new Error(`No '${field.type}' derivation registered for use by the '${kind}' field '${name}'`);
|
|
137
|
+
}
|
|
138
|
+
})(this._derivations.has(field.type)) : {};
|
|
139
|
+
return this._derivations.get(field.type);
|
|
140
|
+
}
|
|
141
|
+
hashFn(field) {
|
|
142
|
+
const kind = 'kind' in field ? field.kind : '<unknown kind>';
|
|
143
|
+
const name = 'name' in field ? field.name : '<unknown name>';
|
|
144
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
145
|
+
if (!test) {
|
|
146
|
+
throw new Error(`The '${kind}' field '${name}' is not a HashField and so cannot be used to lookup a hash function`);
|
|
147
|
+
}
|
|
148
|
+
})(!('kind' in field) || kind === '@hash') : {};
|
|
149
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
150
|
+
if (!test) {
|
|
151
|
+
throw new Error(`Expected the '${kind}' field '${name}' to specify a hash function via 'field.type', but no value was present`);
|
|
152
|
+
}
|
|
153
|
+
})(field.type) : {};
|
|
154
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
155
|
+
if (!test) {
|
|
156
|
+
throw new Error(`No '${field.type}' hash function is registered for use by the '${kind}' field '${name}'`);
|
|
157
|
+
}
|
|
158
|
+
})(this._hashFns.has(field.type)) : {};
|
|
159
|
+
return this._hashFns.get(field.type);
|
|
160
|
+
}
|
|
161
|
+
resource(resource) {
|
|
162
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
163
|
+
if (!test) {
|
|
164
|
+
throw new Error(`No resource registered with name '${resource.type}'`);
|
|
165
|
+
}
|
|
166
|
+
})(this._schemas.has(resource.type)) : {};
|
|
167
|
+
return this._schemas.get(resource.type).original;
|
|
168
|
+
}
|
|
169
|
+
registerResources(schemas) {
|
|
170
|
+
schemas.forEach(schema => {
|
|
171
|
+
this.registerResource(schema);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
registerResource(schema) {
|
|
175
|
+
const fields = new Map();
|
|
176
|
+
const relationships = {};
|
|
177
|
+
const attributes = {};
|
|
178
|
+
schema.fields.forEach(field => {
|
|
179
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
180
|
+
if (!test) {
|
|
181
|
+
throw new Error(`${field.kind} is not valid inside a ResourceSchema's fields.`);
|
|
182
|
+
}
|
|
183
|
+
})(
|
|
184
|
+
// @ts-expect-error we are checking for mistakes at runtime
|
|
185
|
+
field.kind !== '@id' && field.kind !== '@hash') : {};
|
|
186
|
+
fields.set(field.name, field);
|
|
187
|
+
if (field.kind === 'attribute') {
|
|
188
|
+
attributes[field.name] = field;
|
|
189
|
+
} else if (field.kind === 'belongsTo' || field.kind === 'hasMany') {
|
|
190
|
+
relationships[field.name] = field;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
const traits = new Set(schema.traits);
|
|
194
|
+
traits.forEach(trait => {
|
|
195
|
+
this._traits.add(trait);
|
|
196
|
+
});
|
|
197
|
+
const internalSchema = {
|
|
198
|
+
original: schema,
|
|
199
|
+
fields,
|
|
200
|
+
relationships,
|
|
201
|
+
attributes,
|
|
202
|
+
traits
|
|
203
|
+
};
|
|
204
|
+
this._schemas.set(schema.type, internalSchema);
|
|
205
|
+
}
|
|
206
|
+
registerTransformation(transformation) {
|
|
207
|
+
this._transforms.set(transformation[Type], transformation);
|
|
208
|
+
}
|
|
209
|
+
registerDerivation(derivation) {
|
|
210
|
+
this._derivations.set(derivation[Type], makeCachedDerivation(derivation));
|
|
211
|
+
}
|
|
212
|
+
registerHashFn(hashFn) {
|
|
213
|
+
this._hashFns.set(hashFn[Type], hashFn);
|
|
214
|
+
}
|
|
215
|
+
fields({
|
|
216
|
+
type
|
|
217
|
+
}) {
|
|
218
|
+
const schema = this._schemas.get(type);
|
|
219
|
+
if (!schema) {
|
|
220
|
+
throw new Error(`No schema defined for ${type}`);
|
|
221
|
+
}
|
|
222
|
+
return schema.fields;
|
|
223
|
+
}
|
|
224
|
+
hasResource(resource) {
|
|
225
|
+
return this._schemas.has(resource.type);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA_SERVICE)) {
|
|
229
|
+
SchemaService.prototype.attributesDefinitionFor = function ({
|
|
230
|
+
type
|
|
231
|
+
}) {
|
|
232
|
+
deprecate(`Use \`schema.fields({ type })\` instead of \`schema.attributesDefinitionFor({ type })\``, false, {
|
|
233
|
+
id: 'ember-data:schema-service-updates',
|
|
234
|
+
until: '5.0',
|
|
235
|
+
for: 'ember-data',
|
|
236
|
+
since: {
|
|
237
|
+
available: '5.4',
|
|
238
|
+
enabled: '5.4'
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
const schema = this._schemas.get(type);
|
|
242
|
+
if (!schema) {
|
|
243
|
+
throw new Error(`No schema defined for ${type}`);
|
|
244
|
+
}
|
|
245
|
+
return schema.attributes;
|
|
246
|
+
};
|
|
247
|
+
SchemaService.prototype.relationshipsDefinitionFor = function ({
|
|
248
|
+
type
|
|
249
|
+
}) {
|
|
250
|
+
deprecate(`Use \`schema.fields({ type })\` instead of \`schema.relationshipsDefinitionFor({ type })\``, false, {
|
|
251
|
+
id: 'ember-data:schema-service-updates',
|
|
252
|
+
until: '5.0',
|
|
253
|
+
for: 'ember-data',
|
|
254
|
+
since: {
|
|
255
|
+
available: '5.4',
|
|
256
|
+
enabled: '5.4'
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
const schema = this._schemas.get(type);
|
|
260
|
+
if (!schema) {
|
|
261
|
+
throw new Error(`No schema defined for ${type}`);
|
|
262
|
+
}
|
|
263
|
+
return schema.relationships;
|
|
264
|
+
};
|
|
265
|
+
SchemaService.prototype.doesTypeExist = function (type) {
|
|
266
|
+
deprecate(`Use \`schema.hasResource({ type })\` instead of \`schema.doesTypeExist(type)\``, false, {
|
|
267
|
+
id: 'ember-data:schema-service-updates',
|
|
268
|
+
until: '5.0',
|
|
269
|
+
for: 'ember-data',
|
|
270
|
+
since: {
|
|
271
|
+
available: '5.4',
|
|
272
|
+
enabled: '5.4'
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
return this._schemas.has(type);
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
export { SchemaRecordFields, SchemaService, fromIdentity, registerDerivations, withDefaults };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sources":["../src/schema.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { recordIdentifierFor } from '@ember-data/store';\nimport type { SchemaService as SchemaServiceInterface } from '@ember-data/store/types';\nimport { createCache, getValue } from '@ember-data/tracking';\nimport type { Signal } from '@ember-data/tracking/-private';\nimport { Signals } from '@ember-data/tracking/-private';\nimport { ENABLE_LEGACY_SCHEMA_SERVICE } from '@warp-drive/build-config/deprecations';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport { getOrSetGlobal } from '@warp-drive/core-types/-private';\nimport type { ObjectValue, Value } from '@warp-drive/core-types/json/raw';\nimport type { Derivation, HashFn } from '@warp-drive/core-types/schema/concepts';\nimport type {\n ArrayField,\n DerivedField,\n FieldSchema,\n GenericField,\n HashField,\n LegacyAttributeField,\n LegacyRelationshipSchema,\n ObjectField,\n ResourceSchema,\n} from '@warp-drive/core-types/schema/fields';\nimport { Type } from '@warp-drive/core-types/symbols';\nimport type { WithPartial } from '@warp-drive/core-types/utils';\n\nimport type { SchemaRecord } from './record';\nimport { Identifier } from './symbols';\n\nconst Support = getOrSetGlobal('Support', new WeakMap<WeakKey, Record<string, unknown>>());\n\nexport const SchemaRecordFields: FieldSchema[] = [\n {\n type: '@constructor',\n name: 'constructor',\n kind: 'derived',\n },\n {\n type: '@identity',\n name: '$type',\n kind: 'derived',\n options: { key: 'type' },\n },\n];\n\nfunction _constructor(record: SchemaRecord) {\n let state = Support.get(record as WeakKey);\n if (!state) {\n state = {};\n Support.set(record as WeakKey, state);\n }\n\n return (state._constructor = state._constructor || {\n name: `SchemaRecord<${recordIdentifierFor(record).type}>`,\n get modelName() {\n throw new Error('Cannot access record.constructor.modelName on non-Legacy Schema Records.');\n },\n });\n}\n_constructor[Type] = '@constructor';\n\nexport function withDefaults(schema: WithPartial<ResourceSchema, 'identity'>): ResourceSchema {\n schema.identity = schema.identity || { name: 'id', kind: '@id' };\n schema.fields.push(...SchemaRecordFields);\n return schema as ResourceSchema;\n}\n\nexport function fromIdentity(record: SchemaRecord, options: { key: 'lid' } | { key: 'type' }, key: string): string;\nexport function fromIdentity(record: SchemaRecord, options: { key: 'id' }, key: string): string | null;\nexport function fromIdentity(record: SchemaRecord, options: { key: '^' }, key: string): StableRecordIdentifier;\nexport function fromIdentity(record: SchemaRecord, options: null, key: string): asserts options;\nexport function fromIdentity(\n record: SchemaRecord,\n options: { key: 'id' | 'lid' | 'type' | '^' } | null,\n key: string\n): StableRecordIdentifier | string | null {\n const identifier = record[Identifier];\n assert(`Cannot compute @identity for a record without an identifier`, identifier);\n assert(\n `Expected to receive a key to compute @identity, but got ${String(options)}`,\n options?.key && ['lid', 'id', 'type', '^'].includes(options.key)\n );\n\n return options.key === '^' ? identifier : identifier[options.key];\n}\nfromIdentity[Type] = '@identity';\n\nexport function registerDerivations(schema: SchemaServiceInterface) {\n schema.registerDerivation(fromIdentity);\n schema.registerDerivation(_constructor);\n}\n\ntype InternalSchema = {\n original: ResourceSchema;\n traits: Set<string>;\n fields: Map<string, FieldSchema>;\n attributes: Record<string, LegacyAttributeField>;\n relationships: Record<string, LegacyRelationshipSchema>;\n};\n\nexport type Transformation<T extends Value = Value, PT = unknown> = {\n serialize(value: PT, options: Record<string, unknown> | null, record: SchemaRecord): T;\n hydrate(value: T | undefined, options: Record<string, unknown> | null, record: SchemaRecord): PT;\n defaultValue?(options: Record<string, unknown> | null, identifier: StableRecordIdentifier): T;\n [Type]: string;\n};\n\n/**\n * Wraps a derivation in a new function with Derivation signature but that looks\n * up the value in the cache before recomputing.\n *\n * @param record\n * @param options\n * @param prop\n */\nfunction makeCachedDerivation<R, T, FM extends ObjectValue | null>(\n derivation: Derivation<R, T, FM>\n): Derivation<R, T, FM> {\n const memoizedDerivation = (record: R, options: FM, prop: string): T => {\n const signals = (record as { [Signals]: Map<string, Signal> })[Signals];\n let signal = signals.get(prop);\n if (!signal) {\n signal = createCache(() => {\n return derivation(record, options, prop);\n }) as unknown as Signal; // a total lie, for convenience of reusing the storage\n signals.set(prop, signal);\n }\n\n return getValue(signal as unknown as ReturnType<typeof createCache>) as T;\n };\n memoizedDerivation[Type] = derivation[Type];\n return memoizedDerivation;\n}\n\nexport interface SchemaService {\n doesTypeExist(type: string): boolean;\n attributesDefinitionFor(identifier: { type: string }): InternalSchema['attributes'];\n relationshipsDefinitionFor(identifier: { type: string }): InternalSchema['relationships'];\n}\nexport class SchemaService implements SchemaServiceInterface {\n declare _schemas: Map<string, InternalSchema>;\n declare _transforms: Map<string, Transformation>;\n declare _hashFns: Map<string, HashFn>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n declare _derivations: Map<string, Derivation<any, any, any>>;\n declare _traits: Set<string>;\n\n constructor() {\n this._schemas = new Map();\n this._transforms = new Map();\n this._hashFns = new Map();\n this._derivations = new Map();\n }\n hasTrait(type: string): boolean {\n return this._traits.has(type);\n }\n resourceHasTrait(resource: StableRecordIdentifier | { type: string }, trait: string): boolean {\n return this._schemas.get(resource.type)!.traits.has(trait);\n }\n transformation(field: GenericField | ObjectField | ArrayField | { type: string }): Transformation {\n const kind = 'kind' in field ? field.kind : '<unknown kind>';\n const name = 'name' in field ? field.name : '<unknown name>';\n assert(\n `'${kind}' fields cannot be transformed. Only fields of kind 'field' 'object' or 'array' can specify a transformation. Attempted to find '${field.type ?? '<unknown type>'}' on field '${name}'.`,\n !('kind' in field) || ['field', 'object', 'array'].includes(kind)\n );\n assert(\n `Expected the '${kind}' field '${name}' to specify a transformation via 'field.type', but none was present`,\n field.type\n );\n assert(\n `No transformation registered with name '${field.type}' for '${kind}' field '${name}'`,\n this._transforms.has(field.type)\n );\n return this._transforms.get(field.type)!;\n }\n derivation(field: DerivedField | { type: string }): Derivation {\n const kind = 'kind' in field ? field.kind : '<unknown kind>';\n const name = 'name' in field ? field.name : '<unknown name>';\n assert(\n `The '${kind}' field '${name}' is not derived and so cannot be used to lookup a derivation`,\n !('kind' in field) || kind === 'derived'\n );\n assert(\n `Expected the '${kind}' field '${name}' to specify a derivation via 'field.type', but no value was present`,\n field.type\n );\n assert(\n `No '${field.type}' derivation registered for use by the '${kind}' field '${name}'`,\n this._derivations.has(field.type)\n );\n return this._derivations.get(field.type)!;\n }\n hashFn(field: HashField | { type: string }): HashFn {\n const kind = 'kind' in field ? field.kind : '<unknown kind>';\n const name = 'name' in field ? field.name : '<unknown name>';\n assert(\n `The '${kind}' field '${name}' is not a HashField and so cannot be used to lookup a hash function`,\n !('kind' in field) || kind === '@hash'\n );\n assert(\n `Expected the '${kind}' field '${name}' to specify a hash function via 'field.type', but no value was present`,\n field.type\n );\n assert(\n `No '${field.type}' hash function is registered for use by the '${kind}' field '${name}'`,\n this._hashFns.has(field.type)\n );\n return this._hashFns.get(field.type)!;\n }\n resource(resource: StableRecordIdentifier | { type: string }): ResourceSchema {\n assert(`No resource registered with name '${resource.type}'`, this._schemas.has(resource.type));\n return this._schemas.get(resource.type)!.original;\n }\n registerResources(schemas: ResourceSchema[]): void {\n schemas.forEach((schema) => {\n this.registerResource(schema);\n });\n }\n registerResource(schema: ResourceSchema): void {\n const fields = new Map<string, FieldSchema>();\n const relationships: Record<string, LegacyRelationshipSchema> = {};\n const attributes: Record<string, LegacyAttributeField> = {};\n\n schema.fields.forEach((field) => {\n assert(\n `${field.kind} is not valid inside a ResourceSchema's fields.`,\n // @ts-expect-error we are checking for mistakes at runtime\n field.kind !== '@id' && field.kind !== '@hash'\n );\n fields.set(field.name, field);\n if (field.kind === 'attribute') {\n attributes[field.name] = field;\n } else if (field.kind === 'belongsTo' || field.kind === 'hasMany') {\n relationships[field.name] = field;\n }\n });\n\n const traits = new Set<string>(schema.traits);\n traits.forEach((trait) => {\n this._traits.add(trait);\n });\n\n const internalSchema: InternalSchema = { original: schema, fields, relationships, attributes, traits };\n this._schemas.set(schema.type, internalSchema);\n }\n\n registerTransformation<T extends Value = string, PT = unknown>(transformation: Transformation<T, PT>): void {\n this._transforms.set(transformation[Type], transformation as Transformation);\n }\n\n registerDerivation<R, T, FM extends ObjectValue | null>(derivation: Derivation<R, T, FM>): void {\n this._derivations.set(derivation[Type], makeCachedDerivation(derivation));\n }\n\n registerHashFn<T extends object>(hashFn: HashFn<T>): void {\n this._hashFns.set(hashFn[Type], hashFn as HashFn);\n }\n\n fields({ type }: { type: string }): InternalSchema['fields'] {\n const schema = this._schemas.get(type);\n\n if (!schema) {\n throw new Error(`No schema defined for ${type}`);\n }\n\n return schema.fields;\n }\n\n hasResource(resource: { type: string }): boolean {\n return this._schemas.has(resource.type);\n }\n}\n\nif (ENABLE_LEGACY_SCHEMA_SERVICE) {\n SchemaService.prototype.attributesDefinitionFor = function ({\n type,\n }: {\n type: string;\n }): InternalSchema['attributes'] {\n deprecate(`Use \\`schema.fields({ type })\\` instead of \\`schema.attributesDefinitionFor({ type })\\``, false, {\n id: 'ember-data:schema-service-updates',\n until: '5.0',\n for: 'ember-data',\n since: {\n available: '5.4',\n enabled: '5.4',\n },\n });\n const schema = this._schemas.get(type);\n\n if (!schema) {\n throw new Error(`No schema defined for ${type}`);\n }\n\n return schema.attributes;\n };\n\n SchemaService.prototype.relationshipsDefinitionFor = function ({\n type,\n }: {\n type: string;\n }): InternalSchema['relationships'] {\n deprecate(`Use \\`schema.fields({ type })\\` instead of \\`schema.relationshipsDefinitionFor({ type })\\``, false, {\n id: 'ember-data:schema-service-updates',\n until: '5.0',\n for: 'ember-data',\n since: {\n available: '5.4',\n enabled: '5.4',\n },\n });\n const schema = this._schemas.get(type);\n\n if (!schema) {\n throw new Error(`No schema defined for ${type}`);\n }\n\n return schema.relationships;\n };\n\n SchemaService.prototype.doesTypeExist = function (type: string): boolean {\n deprecate(`Use \\`schema.hasResource({ type })\\` instead of \\`schema.doesTypeExist(type)\\``, false, {\n id: 'ember-data:schema-service-updates',\n until: '5.0',\n for: 'ember-data',\n since: {\n available: '5.4',\n enabled: '5.4',\n },\n });\n return this._schemas.has(type);\n };\n}\n"],"names":["Support","getOrSetGlobal","WeakMap","SchemaRecordFields","type","name","kind","options","key","_constructor","record","state","get","set","recordIdentifierFor","modelName","Error","Type","withDefaults","schema","identity","fields","push","fromIdentity","identifier","Identifier","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","String","includes","registerDerivations","registerDerivation","makeCachedDerivation","derivation","memoizedDerivation","prop","signals","Signals","signal","createCache","getValue","SchemaService","constructor","_schemas","Map","_transforms","_hashFns","_derivations","hasTrait","_traits","has","resourceHasTrait","resource","trait","traits","transformation","field","hashFn","original","registerResources","schemas","forEach","registerResource","relationships","attributes","Set","add","internalSchema","registerTransformation","registerHashFn","hasResource","deprecations","ENABLE_LEGACY_SCHEMA_SERVICE","prototype","attributesDefinitionFor","deprecate","id","until","for","since","available","enabled","relationshipsDefinitionFor","doesTypeExist"],"mappings":";;;;;;;;;AA8BA,MAAMA,OAAO,GAAGC,cAAc,CAAC,SAAS,EAAE,IAAIC,OAAO,EAAoC,CAAC,CAAA;AAEnF,MAAMC,kBAAiC,GAAG,CAC/C;AACEC,EAAAA,IAAI,EAAE,cAAc;AACpBC,EAAAA,IAAI,EAAE,aAAa;AACnBC,EAAAA,IAAI,EAAE,SAAA;AACR,CAAC,EACD;AACEF,EAAAA,IAAI,EAAE,WAAW;AACjBC,EAAAA,IAAI,EAAE,OAAO;AACbC,EAAAA,IAAI,EAAE,SAAS;AACf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AACX,OAAA;AACF,KAAC,CAAC,CAAA;IACF,MAAMlE,MAAM,GAAG,IAAI,CAAC4B,QAAQ,CAACnC,GAAG,CAACR,IAAI,CAAC,CAAA;IAEtC,IAAI,CAACe,MAAM,EAAE;AACX,MAAA,MAAM,IAAIH,KAAK,CAAE,CAAwBZ,sBAAAA,EAAAA,IAAK,EAAC,CAAC,CAAA;AAClD,KAAA;IAEA,OAAOe,MAAM,CAACgD,aAAa,CAAA;GAC5B,CAAA;AAEDtB,EAAAA,aAAa,CAACgC,SAAS,CAACU,aAAa,GAAG,UAAUnF,IAAY,EAAW;AACvE2E,IAAAA,SAAS,CAAE,CAAA,8EAAA,CAA+E,EAAE,KAAK,EAAE;AACjGC,MAAAA,EAAE,EAAE,mCAAmC;AACvCC,MAAAA,KAAK,EAAE,KAAK;AACZC,MAAAA,GAAG,EAAE,YAAY;AACjBC,MAAAA,KAAK,EAAE;AACLC,QAAAA,SAAS,EAAE,KAAK;AAChBC,QAAAA,OAAO,EAAE,KAAA;AACX,OAAA;AACF,KAAC,CAAC,CAAA;AACF,IAAA,OAAO,IAAI,CAACtC,QAAQ,CAACO,GAAG,CAAClD,IAAI,CAAC,CAAA;GAC/B,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getOrSetGlobal } from '@warp-drive/core-types/-private';
|
|
2
|
+
|
|
3
|
+
///////////////////
|
|
4
|
+
///// WARNING /////
|
|
5
|
+
///////////////////
|
|
6
|
+
|
|
7
|
+
// Great, got your attention with that warning didn't we?
|
|
8
|
+
// Good. Here's the deal: typescript treats symbols as unique types.
|
|
9
|
+
// If by accident a module creating a symbol is processed more than
|
|
10
|
+
// once, the symbol will be different in each processing. This will
|
|
11
|
+
// cause a type error.
|
|
12
|
+
// It could also cause a runtime error if the symbol is used innapropriately.
|
|
13
|
+
// However, this case is extremely hard to hit and would require other things
|
|
14
|
+
// to go wrong first.
|
|
15
|
+
//
|
|
16
|
+
// So, why do the warning? And why do we lie about the types of the symbols?
|
|
17
|
+
//
|
|
18
|
+
// Because we intentionally create multiple copies of them within the types
|
|
19
|
+
// at build time. This is because we rollup our d.ts files in order to give
|
|
20
|
+
// our consumers a better experience.
|
|
21
|
+
//
|
|
22
|
+
// However, no tool today supports rolling up d.ts files with multiple entry
|
|
23
|
+
// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor
|
|
24
|
+
// which creates a fully unique stand-alone types file per-entry-point. Thus
|
|
25
|
+
// every entry point that uses one of these symbols somewhere will have accidentally
|
|
26
|
+
// created a new symbol type.
|
|
27
|
+
//
|
|
28
|
+
// This cast allows us to rollup these types using this tool while not encountering
|
|
29
|
+
// the unique symbol type issue.
|
|
30
|
+
//
|
|
31
|
+
// Note that none of these symbols are part of the public API, these are used for
|
|
32
|
+
// debugging DX and as a safe way to provide an intimate contract on public objects.
|
|
33
|
+
|
|
34
|
+
const SOURCE = getOrSetGlobal('SOURCE', Symbol('#source'));
|
|
35
|
+
getOrSetGlobal('MUTATE', Symbol('#update'));
|
|
36
|
+
const ARRAY_SIGNAL = getOrSetGlobal('ARRAY_SIGNAL', Symbol('#array-signal'));
|
|
37
|
+
const OBJECT_SIGNAL = getOrSetGlobal('OBJECT_SIGNAL', Symbol('#object-signal'));
|
|
38
|
+
getOrSetGlobal('NOTIFY', Symbol('#notify'));
|
|
39
|
+
const Destroy = getOrSetGlobal('Destroy', Symbol('Destroy'));
|
|
40
|
+
const Identifier = getOrSetGlobal('Identifier', Symbol('Identifier'));
|
|
41
|
+
const Editable = getOrSetGlobal('Editable', Symbol('Editable'));
|
|
42
|
+
const Parent = getOrSetGlobal('Parent', Symbol('Parent'));
|
|
43
|
+
const Checkout = getOrSetGlobal('Checkout', Symbol('Checkout'));
|
|
44
|
+
const Legacy = getOrSetGlobal('Legacy', Symbol('Legacy'));
|
|
45
|
+
export { ARRAY_SIGNAL as A, Checkout as C, Destroy as D, Editable as E, Identifier as I, Legacy as L, OBJECT_SIGNAL as O, Parent as P, SOURCE as S };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols-CAUfvZjq.js","sources":["../src/symbols.ts"],"sourcesContent":["///////////////////\n///// WARNING /////\n///////////////////\n\nimport { getOrSetGlobal } from '@warp-drive/core-types/-private';\n\n// Great, got your attention with that warning didn't we?\n// Good. Here's the deal: typescript treats symbols as unique types.\n// If by accident a module creating a symbol is processed more than\n// once, the symbol will be different in each processing. This will\n// cause a type error.\n// It could also cause a runtime error if the symbol is used innapropriately.\n// However, this case is extremely hard to hit and would require other things\n// to go wrong first.\n//\n// So, why do the warning? And why do we lie about the types of the symbols?\n//\n// Because we intentionally create multiple copies of them within the types\n// at build time. This is because we rollup our d.ts files in order to give\n// our consumers a better experience.\n//\n// However, no tool today supports rolling up d.ts files with multiple entry\n// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor\n// which creates a fully unique stand-alone types file per-entry-point. Thus\n// every entry point that uses one of these symbols somewhere will have accidentally\n// created a new symbol type.\n//\n// This cast allows us to rollup these types using this tool while not encountering\n// the unique symbol type issue.\n//\n// Note that none of these symbols are part of the public API, these are used for\n// debugging DX and as a safe way to provide an intimate contract on public objects.\n\nexport const SOURCE = getOrSetGlobal('SOURCE', Symbol('#source'));\nexport const MUTATE = getOrSetGlobal('MUTATE', Symbol('#update'));\nexport const ARRAY_SIGNAL = getOrSetGlobal('ARRAY_SIGNAL', Symbol('#array-signal'));\nexport const OBJECT_SIGNAL = getOrSetGlobal('OBJECT_SIGNAL', Symbol('#object-signal'));\nexport const NOTIFY = getOrSetGlobal('NOTIFY', Symbol('#notify'));\n\nexport const Destroy = getOrSetGlobal('Destroy', Symbol('Destroy'));\nexport const Identifier = getOrSetGlobal('Identifier', Symbol('Identifier'));\nexport const Editable = getOrSetGlobal('Editable', Symbol('Editable'));\nexport const Parent = getOrSetGlobal('Parent', Symbol('Parent'));\nexport const Checkout = getOrSetGlobal('Checkout', Symbol('Checkout'));\nexport const Legacy = getOrSetGlobal('Legacy', Symbol('Legacy'));\n"],"names":["SOURCE","getOrSetGlobal","Symbol","ARRAY_SIGNAL","OBJECT_SIGNAL","Destroy","Identifier","Editable","Parent","Checkout","Legacy"],"mappings":";;AAAA;AACA;AACA;;;AAIA;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;;AAEO,MAAMA,MAAM,GAAGC,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,SAAS,CAAC,EAAC;AAC3CD,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,SAAS,CAAC,EAAC;AAC1D,MAAMC,YAAY,GAAGF,cAAc,CAAC,cAAc,EAAEC,MAAM,CAAC,eAAe,CAAC,EAAC;AAC5E,MAAME,aAAa,GAAGH,cAAc,CAAC,eAAe,EAAEC,MAAM,CAAC,gBAAgB,CAAC,EAAC;AAChED,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,SAAS,CAAC,EAAC;AAE1D,MAAMG,OAAO,GAAGJ,cAAc,CAAC,SAAS,EAAEC,MAAM,CAAC,SAAS,CAAC,EAAC;AAC5D,MAAMI,UAAU,GAAGL,cAAc,CAAC,YAAY,EAAEC,MAAM,CAAC,YAAY,CAAC,EAAC;AACrE,MAAMK,QAAQ,GAAGN,cAAc,CAAC,UAAU,EAAEC,MAAM,CAAC,UAAU,CAAC,EAAC;AAC/D,MAAMM,MAAM,GAAGP,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,QAAQ,CAAC,EAAC;AACzD,MAAMO,QAAQ,GAAGR,cAAc,CAAC,UAAU,EAAEC,MAAM,CAAC,UAAU,CAAC,EAAC;AAC/D,MAAMQ,MAAM,GAAGT,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,QAAQ,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/schema-record",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.57",
|
|
4
4
|
"description": "Schema Driven Resource Presentation for WarpDrive and EmberData",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -13,20 +13,18 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": "",
|
|
15
15
|
"scripts": {
|
|
16
|
-
"lint": "eslint . --quiet --cache --cache-strategy=content --
|
|
17
|
-
"build:
|
|
18
|
-
"
|
|
19
|
-
"_build": "bun run build:runtime && bun run build:types",
|
|
20
|
-
"_syncPnpm": "bun run sync-dependencies-meta-injected"
|
|
16
|
+
"lint": "eslint . --quiet --cache --cache-strategy=content --report-unused-disable-directives",
|
|
17
|
+
"build:pkg": "vite build;",
|
|
18
|
+
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
|
|
21
19
|
},
|
|
22
20
|
"ember-addon": {
|
|
23
|
-
"main": "addon-main.
|
|
21
|
+
"main": "addon-main.cjs",
|
|
24
22
|
"type": "addon",
|
|
25
23
|
"version": 1
|
|
26
24
|
},
|
|
27
25
|
"files": [
|
|
28
|
-
"addon-main.
|
|
29
|
-
"
|
|
26
|
+
"addon-main.cjs",
|
|
27
|
+
"dist",
|
|
30
28
|
"README.md",
|
|
31
29
|
"LICENSE.md",
|
|
32
30
|
"NCC-1701-a.svg",
|
|
@@ -34,14 +32,12 @@
|
|
|
34
32
|
"unstable-preview-types"
|
|
35
33
|
],
|
|
36
34
|
"peerDependencies": {
|
|
37
|
-
"@ember-data/
|
|
38
|
-
"@
|
|
39
|
-
"@ember-data/tracking": "5.4.0-alpha.
|
|
35
|
+
"@ember-data/request": "5.4.0-alpha.71",
|
|
36
|
+
"@ember-data/store": "5.4.0-alpha.71",
|
|
37
|
+
"@ember-data/tracking": "5.4.0-alpha.71",
|
|
38
|
+
"@warp-drive/core-types": "0.0.0-alpha.57"
|
|
40
39
|
},
|
|
41
40
|
"dependenciesMeta": {
|
|
42
|
-
"@ember-data/private-build-infra": {
|
|
43
|
-
"injected": true
|
|
44
|
-
},
|
|
45
41
|
"@ember-data/request": {
|
|
46
42
|
"injected": true
|
|
47
43
|
},
|
|
@@ -56,50 +52,42 @@
|
|
|
56
52
|
},
|
|
57
53
|
"@ember/string": {
|
|
58
54
|
"injected": true
|
|
55
|
+
},
|
|
56
|
+
"@warp-drive/build-config": {
|
|
57
|
+
"injected": true
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
"dependencies": {
|
|
62
|
-
"@ember-data/private-build-infra": "5.4.0-alpha.64",
|
|
63
61
|
"@ember/edition-utils": "^1.2.0",
|
|
64
|
-
"@embroider/macros": "^1.
|
|
62
|
+
"@embroider/macros": "^1.16.1",
|
|
63
|
+
"@warp-drive/build-config": "0.0.0-alpha.8",
|
|
65
64
|
"ember-cli-babel": "^8.2.0"
|
|
66
65
|
},
|
|
67
66
|
"devDependencies": {
|
|
68
|
-
"@babel/
|
|
69
|
-
"@babel/
|
|
70
|
-
"@babel/
|
|
71
|
-
"@babel/plugin-transform-class-properties": "^7.24.1",
|
|
72
|
-
"@babel/plugin-transform-private-methods": "^7.24.1",
|
|
73
|
-
"@babel/plugin-transform-runtime": "^7.24.3",
|
|
74
|
-
"@babel/plugin-transform-typescript": "^7.24.4",
|
|
75
|
-
"@babel/preset-env": "^7.24.4",
|
|
67
|
+
"@babel/core": "^7.24.5",
|
|
68
|
+
"@babel/plugin-transform-typescript": "^7.24.5",
|
|
69
|
+
"@babel/preset-env": "^7.24.5",
|
|
76
70
|
"@babel/preset-typescript": "^7.24.1",
|
|
77
|
-
"@
|
|
78
|
-
"@ember-data/
|
|
79
|
-
"@ember-data/
|
|
80
|
-
"@ember
|
|
81
|
-
"@embroider/addon-dev": "^4.3.1",
|
|
71
|
+
"@ember-data/request": "5.4.0-alpha.71",
|
|
72
|
+
"@ember-data/store": "5.4.0-alpha.71",
|
|
73
|
+
"@ember-data/tracking": "5.4.0-alpha.71",
|
|
74
|
+
"@ember/string": "^3.1.1",
|
|
82
75
|
"@glimmer/component": "^1.1.2",
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"ember-source": "~5.7.0",
|
|
88
|
-
"pnpm-sync-dependencies-meta-injected": "0.0.10",
|
|
89
|
-
"rollup": "^4.14.3",
|
|
76
|
+
"@warp-drive/core-types": "0.0.0-alpha.57",
|
|
77
|
+
"@warp-drive/internal-config": "5.4.0-alpha.71",
|
|
78
|
+
"ember-source": "~5.8.0",
|
|
79
|
+
"pnpm-sync-dependencies-meta-injected": "0.0.14",
|
|
90
80
|
"typescript": "^5.4.5",
|
|
91
|
-
"
|
|
92
|
-
"webpack": "^5.91.0",
|
|
93
|
-
"@ember/string": "^3.1.1"
|
|
81
|
+
"vite": "^5.2.11"
|
|
94
82
|
},
|
|
95
83
|
"ember": {
|
|
96
84
|
"edition": "octane"
|
|
97
85
|
},
|
|
98
86
|
"engines": {
|
|
99
|
-
"node": ">=
|
|
87
|
+
"node": ">= 22.1.0"
|
|
100
88
|
},
|
|
101
89
|
"volta": {
|
|
102
90
|
"extends": "../../package.json"
|
|
103
91
|
},
|
|
104
|
-
"packageManager": "pnpm@8.15.
|
|
92
|
+
"packageManager": "pnpm@8.15.8"
|
|
105
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIxC,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,sBAAsB,EAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,YAAY,CAcd;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAEzD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference path="
|
|
1
|
+
/// <reference path="./symbols.d.ts" />
|
|
2
|
+
/// <reference path="./record.d.ts" />
|
|
3
|
+
/// <reference path="./managed-array.d.ts" />
|
|
2
4
|
/// <reference path="./hooks.d.ts" />
|
|
3
5
|
/// <reference path="./managed-object.d.ts" />
|
|
4
|
-
/// <reference path="./schema.d.ts" />
|
|
5
|
-
/// <reference path="./managed-array.d.ts" />
|
|
6
|
-
/// <reference path="./record.d.ts" />
|
|
6
|
+
/// <reference path="./schema.d.ts" />
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
declare module '@warp-drive/schema-record/managed-array' {
|
|
2
2
|
import type Store from '@ember-data/store';
|
|
3
|
-
import type { FieldSchema } from '@ember-data/store/-types/q/schema-service';
|
|
4
3
|
import type { Signal } from '@ember-data/tracking/-private';
|
|
5
4
|
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
6
5
|
import type { Cache } from '@warp-drive/core-types/cache';
|
|
6
|
+
import type { ArrayField } from '@warp-drive/core-types/schema/fields';
|
|
7
7
|
import type { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
8
8
|
import type { SchemaService } from '@warp-drive/schema-record/schema';
|
|
9
|
-
|
|
10
|
-
export const MUTATE: unique symbol;
|
|
11
|
-
export const ARRAY_SIGNAL: unique symbol;
|
|
12
|
-
export const NOTIFY: unique symbol;
|
|
9
|
+
import { ARRAY_SIGNAL, MUTATE, SOURCE } from '@warp-drive/schema-record/symbols';
|
|
13
10
|
export function notifyArray(arr: ManagedArray): void;
|
|
14
11
|
export interface ManagedArray extends Omit<Array<unknown>, '[]'> {
|
|
15
12
|
[MUTATE]?(target: unknown[], receiver: typeof Proxy<unknown[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
@@ -20,7 +17,7 @@ declare module '@warp-drive/schema-record/managed-array' {
|
|
|
20
17
|
key: string;
|
|
21
18
|
owner: SchemaRecord;
|
|
22
19
|
[ARRAY_SIGNAL]: Signal;
|
|
23
|
-
constructor(store: Store, schema: SchemaService, cache: Cache, field:
|
|
20
|
+
constructor(store: Store, schema: SchemaService, cache: Cache, field: ArrayField, data: unknown[], address: StableRecordIdentifier, key: string, owner: SchemaRecord);
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
//# sourceMappingURL=managed-array.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-array.d.ts","sourceRoot":"","sources":["../src/managed-array.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"managed-array.d.ts","sourceRoot":"","sources":["../src/managed-array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAG5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEzD,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,QAE5C;AA+ED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IAC9D,CAAC,MAAM,CAAC,CAAC,CACP,MAAM,EAAE,OAAO,EAAE,EACjB,QAAQ,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;CACZ;AAED,qBAAa,YAAY;IACvB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACZ,OAAO,EAAE,sBAAsB,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;gBAG7B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,sBAAsB,EAC/B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY;CAuHtB"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
declare module '@warp-drive/schema-record/managed-object' {
|
|
2
2
|
import type Store from '@ember-data/store';
|
|
3
|
-
import type { FieldSchema } from '@ember-data/store/-types/q/schema-service';
|
|
4
3
|
import type { Signal } from '@ember-data/tracking/-private';
|
|
5
4
|
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
6
5
|
import type { Cache } from '@warp-drive/core-types/cache';
|
|
6
|
+
import type { ObjectField } from '@warp-drive/core-types/schema/fields';
|
|
7
7
|
import type { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
8
8
|
import type { SchemaService } from '@warp-drive/schema-record/schema';
|
|
9
|
-
|
|
10
|
-
export const MUTATE: unique symbol;
|
|
11
|
-
export const OBJECT_SIGNAL: unique symbol;
|
|
12
|
-
export const NOTIFY: unique symbol;
|
|
9
|
+
import { MUTATE, OBJECT_SIGNAL, SOURCE } from '@warp-drive/schema-record/symbols';
|
|
13
10
|
export function notifyObject(obj: ManagedObject): void;
|
|
14
11
|
export interface ManagedObject {
|
|
15
12
|
[MUTATE]?(target: unknown[], receiver: typeof Proxy<unknown[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
@@ -20,7 +17,7 @@ declare module '@warp-drive/schema-record/managed-object' {
|
|
|
20
17
|
key: string;
|
|
21
18
|
owner: SchemaRecord;
|
|
22
19
|
[OBJECT_SIGNAL]: Signal;
|
|
23
|
-
constructor(store: Store, schema: SchemaService, cache: Cache, field:
|
|
20
|
+
constructor(store: Store, schema: SchemaService, cache: Cache, field: ObjectField, data: object, address: StableRecordIdentifier, key: string, owner: SchemaRecord);
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
//# sourceMappingURL=managed-object.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-object.d.ts","sourceRoot":"","sources":["../src/managed-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"managed-object.d.ts","sourceRoot":"","sources":["../src/managed-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE1D,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,QAE9C;AAID,MAAM,WAAW,aAAa;IAC5B,CAAC,MAAM,CAAC,CAAC,CACP,MAAM,EAAE,OAAO,EAAE,EACjB,QAAQ,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;CACZ;AAED,qBAAa,aAAa;IACxB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACT,OAAO,EAAE,sBAAsB,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;gBAG9B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,sBAAsB,EAC/B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY;CAuFtB"}
|
|
@@ -3,12 +3,8 @@ declare module '@warp-drive/schema-record/record' {
|
|
|
3
3
|
import { type Signal, Signals } from '@ember-data/tracking/-private';
|
|
4
4
|
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
5
5
|
import { RecordStore } from '@warp-drive/core-types/symbols';
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export const Editable: unique symbol;
|
|
9
|
-
export const Parent: unique symbol;
|
|
10
|
-
export const Checkout: unique symbol;
|
|
11
|
-
export const Legacy: unique symbol;
|
|
6
|
+
import { Checkout, Destroy, Editable, Identifier, Legacy } from '@warp-drive/schema-record/symbols';
|
|
7
|
+
export { Editable, Legacy } from '@warp-drive/schema-record/symbols';
|
|
12
8
|
export class SchemaRecord {
|
|
13
9
|
[RecordStore]: Store;
|
|
14
10
|
[Identifier]: StableRecordIdentifier;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAML,KAAK,MAAM,EACX,OAAO,EACR,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAerE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAK7D,OAAO,EAAgB,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAyB,MAAM,WAAW,CAAC;AAEjH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAuO7C,qBAAa,YAAY;IACf,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IACrB,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACrC,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;gBAErB,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,IAAI,EAAE;QAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE;IAwN9G,CAAC,OAAO,CAAC,IAAI,IAAI;IASjB,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC;CAGpC"}
|