@ember-data/model 5.4.0-alpha.64 → 5.4.0-alpha.70
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/blueprints/model/index.js +18 -5
- package/blueprints/model-test/index.js +16 -10
- package/blueprints/model-test/qunit-files/__root__/__path__/__test__.js +4 -5
- package/{addon → dist}/-private.js +2 -2
- package/{addon/has-many-BuTJfT5a.js → dist/has-many-CR10J-rp.js} +49 -26
- package/dist/has-many-CR10J-rp.js.map +1 -0
- package/dist/hooks-BNw6VdLr.js +75 -0
- package/dist/hooks-BNw6VdLr.js.map +1 -0
- package/dist/hooks.js +2 -0
- package/{addon → dist}/hooks.js.map +1 -1
- package/dist/index.js +4 -0
- package/{addon → dist}/index.js.map +1 -1
- package/dist/migration-support.js +211 -0
- package/dist/migration-support.js.map +1 -0
- package/{addon/model-DJ9C4aZ-.js → dist/model-CsbDNxap.js} +821 -250
- package/dist/model-CsbDNxap.js.map +1 -0
- package/dist/schema-provider-C5vR7TBr.js +256 -0
- package/dist/schema-provider-C5vR7TBr.js.map +1 -0
- package/package.json +39 -59
- package/unstable-preview-types/-private/attr.d.ts.map +1 -1
- package/unstable-preview-types/-private/belongs-to.d.ts.map +1 -1
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts +2 -2
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts.map +1 -1
- package/unstable-preview-types/-private/errors.d.ts +2 -5
- package/unstable-preview-types/-private/errors.d.ts.map +1 -1
- package/unstable-preview-types/-private/has-many.d.ts.map +1 -1
- package/unstable-preview-types/-private/hooks.d.ts.map +1 -1
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts +16 -20
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts.map +1 -1
- package/unstable-preview-types/-private/many-array.d.ts +11 -13
- package/unstable-preview-types/-private/many-array.d.ts.map +1 -1
- package/unstable-preview-types/-private/model-methods.d.ts +6 -5
- package/unstable-preview-types/-private/model-methods.d.ts.map +1 -1
- package/unstable-preview-types/-private/model.d.ts +38 -35
- package/unstable-preview-types/-private/model.d.ts.map +1 -1
- package/unstable-preview-types/-private/notify-changes.d.ts +1 -1
- package/unstable-preview-types/-private/notify-changes.d.ts.map +1 -1
- package/unstable-preview-types/-private/promise-belongs-to.d.ts +1 -2
- package/unstable-preview-types/-private/promise-belongs-to.d.ts.map +1 -1
- package/unstable-preview-types/-private/promise-many-array.d.ts +4 -4
- package/unstable-preview-types/-private/promise-many-array.d.ts.map +1 -1
- package/unstable-preview-types/-private/record-state.d.ts +3 -4
- package/unstable-preview-types/-private/record-state.d.ts.map +1 -1
- package/unstable-preview-types/-private/references/belongs-to.d.ts +4 -4
- package/unstable-preview-types/-private/references/belongs-to.d.ts.map +1 -1
- package/unstable-preview-types/-private/references/has-many.d.ts +7 -7
- package/unstable-preview-types/-private/references/has-many.d.ts.map +1 -1
- package/unstable-preview-types/-private/schema-provider.d.ts +46 -15
- package/unstable-preview-types/-private/schema-provider.d.ts.map +1 -1
- package/unstable-preview-types/-private/type-utils.d.ts +64 -0
- package/unstable-preview-types/-private/type-utils.d.ts.map +1 -0
- package/unstable-preview-types/-private.d.ts +4 -3
- package/unstable-preview-types/-private.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +20 -20
- package/unstable-preview-types/index.d.ts.map +1 -1
- package/unstable-preview-types/migration-support.d.ts +45 -6
- package/unstable-preview-types/migration-support.d.ts.map +1 -1
- package/addon/has-many-BuTJfT5a.js.map +0 -1
- package/addon/hooks-BMoEt0SI.js +0 -176
- package/addon/hooks-BMoEt0SI.js.map +0 -1
- package/addon/hooks.js +0 -1
- package/addon/index.js +0 -3
- package/addon/migration-support.js +0 -118
- package/addon/migration-support.js.map +0 -1
- package/addon/model-DJ9C4aZ-.js.map +0 -1
- package/addon/util-CSYkrwfb.js +0 -35
- package/addon/util-CSYkrwfb.js.map +0 -1
- package/addon-main.js +0 -94
- package/unstable-preview-types/-private/promise-proxy-base.d.ts +0 -35
- /package/{addon → dist}/-private.js.map +0 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { getOwner } from '@ember/application';
|
|
2
|
+
import { deprecate } from '@ember/debug';
|
|
3
|
+
import { M as Model, n as normalizeModelName } from "./model-CsbDNxap";
|
|
4
|
+
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
In case someone defined a relationship to a mixin, for example:
|
|
8
|
+
```ts
|
|
9
|
+
class CommentModel extends Model {
|
|
10
|
+
@belongsTo('commentable', { polymorphic: true }) owner;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let Commentable = Mixin.create({
|
|
14
|
+
@hasMany('comment') comments;
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
we want to look up a Commentable class which has all the necessary
|
|
18
|
+
relationship meta data. Thus, we look up the mixin and create a mock
|
|
19
|
+
Model, so we can access the relationship CPs of the mixin (`comments`)
|
|
20
|
+
in this case
|
|
21
|
+
*/
|
|
22
|
+
function modelForMixin(store, normalizedModelName) {
|
|
23
|
+
const owner = getOwner(store);
|
|
24
|
+
const MaybeMixin = owner.factoryFor(`mixin:${normalizedModelName}`);
|
|
25
|
+
const mixin = MaybeMixin && MaybeMixin.class;
|
|
26
|
+
if (mixin) {
|
|
27
|
+
const ModelForMixin = Model.extend(mixin);
|
|
28
|
+
ModelForMixin.__isMixin = true;
|
|
29
|
+
ModelForMixin.__mixin = mixin;
|
|
30
|
+
//Cache the class as a model
|
|
31
|
+
owner.register(`model:${normalizedModelName}`, ModelForMixin);
|
|
32
|
+
}
|
|
33
|
+
return owner.factoryFor(`model:${normalizedModelName}`);
|
|
34
|
+
}
|
|
35
|
+
class ModelSchemaProvider {
|
|
36
|
+
constructor(store) {
|
|
37
|
+
this.store = store;
|
|
38
|
+
this._schemas = new Map();
|
|
39
|
+
this._typeMisses = new Set();
|
|
40
|
+
}
|
|
41
|
+
hasTrait(type) {
|
|
42
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
43
|
+
{
|
|
44
|
+
throw new Error(`hasTrait is not available with @ember-data/model's SchemaService`);
|
|
45
|
+
}
|
|
46
|
+
})() : {};
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
resourceHasTrait(resource, trait) {
|
|
50
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
51
|
+
{
|
|
52
|
+
throw new Error(`resourceHasTrait is not available with @ember-data/model's SchemaService`);
|
|
53
|
+
}
|
|
54
|
+
})() : {};
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
transformation(name) {
|
|
58
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
59
|
+
{
|
|
60
|
+
throw new Error(`transformation is not available with @ember-data/model's SchemaService`);
|
|
61
|
+
}
|
|
62
|
+
})() : {};
|
|
63
|
+
}
|
|
64
|
+
hashFn(name) {
|
|
65
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
66
|
+
{
|
|
67
|
+
throw new Error(`hashFn is not available with @ember-data/model's SchemaService`);
|
|
68
|
+
}
|
|
69
|
+
})() : {};
|
|
70
|
+
}
|
|
71
|
+
derivation(name) {
|
|
72
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
73
|
+
{
|
|
74
|
+
throw new Error(`derivation is not available with @ember-data/model's SchemaService`);
|
|
75
|
+
}
|
|
76
|
+
})() : {};
|
|
77
|
+
}
|
|
78
|
+
resource(resource) {
|
|
79
|
+
const type = normalizeModelName(resource.type);
|
|
80
|
+
if (!this._schemas.has(type)) {
|
|
81
|
+
this._loadModelSchema(type);
|
|
82
|
+
}
|
|
83
|
+
return this._schemas.get(type).schema;
|
|
84
|
+
}
|
|
85
|
+
registerResources(schemas) {
|
|
86
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
87
|
+
{
|
|
88
|
+
throw new Error(`registerResources is not available with @ember-data/model's SchemaService`);
|
|
89
|
+
}
|
|
90
|
+
})() : {};
|
|
91
|
+
}
|
|
92
|
+
registerResource(schema) {
|
|
93
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
94
|
+
{
|
|
95
|
+
throw new Error(`registerResource is not available with @ember-data/model's SchemaService`);
|
|
96
|
+
}
|
|
97
|
+
})() : {};
|
|
98
|
+
}
|
|
99
|
+
registerTransformation(transform) {
|
|
100
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
101
|
+
{
|
|
102
|
+
throw new Error(`registerTransformation is not available with @ember-data/model's SchemaService`);
|
|
103
|
+
}
|
|
104
|
+
})() : {};
|
|
105
|
+
}
|
|
106
|
+
registerDerivation(derivation) {
|
|
107
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
108
|
+
{
|
|
109
|
+
throw new Error(`registerDerivation is not available with @ember-data/model's SchemaService`);
|
|
110
|
+
}
|
|
111
|
+
})() : {};
|
|
112
|
+
}
|
|
113
|
+
registerHashFn(hashFn) {
|
|
114
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
115
|
+
{
|
|
116
|
+
throw new Error(`registerHashFn is not available with @ember-data/model's SchemaService`);
|
|
117
|
+
}
|
|
118
|
+
})() : {};
|
|
119
|
+
}
|
|
120
|
+
_loadModelSchema(type) {
|
|
121
|
+
const modelClass = this.store.modelFor(type);
|
|
122
|
+
const attributeMap = modelClass.attributes;
|
|
123
|
+
const attributes = Object.create(null);
|
|
124
|
+
attributeMap.forEach((meta, name) => attributes[name] = meta);
|
|
125
|
+
const relationships = modelClass.relationshipsObject || null;
|
|
126
|
+
const fields = new Map();
|
|
127
|
+
for (const attr of Object.values(attributes)) {
|
|
128
|
+
fields.set(attr.name, attr);
|
|
129
|
+
}
|
|
130
|
+
for (const rel of Object.values(relationships)) {
|
|
131
|
+
fields.set(rel.name, rel);
|
|
132
|
+
}
|
|
133
|
+
const schema = {
|
|
134
|
+
legacy: true,
|
|
135
|
+
identity: {
|
|
136
|
+
name: 'id',
|
|
137
|
+
kind: '@id'
|
|
138
|
+
},
|
|
139
|
+
type,
|
|
140
|
+
fields: Array.from(fields.values())
|
|
141
|
+
};
|
|
142
|
+
const internalSchema = {
|
|
143
|
+
schema,
|
|
144
|
+
attributes,
|
|
145
|
+
relationships,
|
|
146
|
+
fields
|
|
147
|
+
};
|
|
148
|
+
this._schemas.set(type, internalSchema);
|
|
149
|
+
return internalSchema;
|
|
150
|
+
}
|
|
151
|
+
fields(resource) {
|
|
152
|
+
const type = normalizeModelName(resource.type);
|
|
153
|
+
if (!this._schemas.has(type)) {
|
|
154
|
+
this._loadModelSchema(type);
|
|
155
|
+
}
|
|
156
|
+
return this._schemas.get(type).fields;
|
|
157
|
+
}
|
|
158
|
+
hasResource(resource) {
|
|
159
|
+
const type = normalizeModelName(resource.type);
|
|
160
|
+
if (this._schemas.has(type)) {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
if (this._typeMisses.has(type)) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
const factory = getModelFactory(this.store, type);
|
|
167
|
+
const exists = factory !== null;
|
|
168
|
+
if (!exists) {
|
|
169
|
+
this._typeMisses.add(type);
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA_SERVICE)) {
|
|
176
|
+
ModelSchemaProvider.prototype.doesTypeExist = function (type) {
|
|
177
|
+
deprecate(`Use \`schema.hasResource({ type })\` instead of \`schema.doesTypeExist(type)\``, false, {
|
|
178
|
+
id: 'ember-data:schema-service-updates',
|
|
179
|
+
until: '5.0',
|
|
180
|
+
for: 'ember-data',
|
|
181
|
+
since: {
|
|
182
|
+
available: '5.4',
|
|
183
|
+
enabled: '5.4'
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
return this.hasResource({
|
|
187
|
+
type
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
ModelSchemaProvider.prototype.attributesDefinitionFor = function (resource) {
|
|
191
|
+
deprecate(`Use \`schema.fields({ type })\` instead of \`schema.attributesDefinitionFor({ type })\``, false, {
|
|
192
|
+
id: 'ember-data:schema-service-updates',
|
|
193
|
+
until: '5.0',
|
|
194
|
+
for: 'ember-data',
|
|
195
|
+
since: {
|
|
196
|
+
available: '5.4',
|
|
197
|
+
enabled: '5.4'
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
const type = normalizeModelName(resource.type);
|
|
201
|
+
if (!this._schemas.has(type)) {
|
|
202
|
+
this._loadModelSchema(type);
|
|
203
|
+
}
|
|
204
|
+
return this._schemas.get(type).attributes;
|
|
205
|
+
};
|
|
206
|
+
ModelSchemaProvider.prototype.relationshipsDefinitionFor = function (resource) {
|
|
207
|
+
deprecate(`Use \`schema.fields({ type })\` instead of \`schema.relationshipsDefinitionFor({ type })\``, false, {
|
|
208
|
+
id: 'ember-data:schema-service-updates',
|
|
209
|
+
until: '5.0',
|
|
210
|
+
for: 'ember-data',
|
|
211
|
+
since: {
|
|
212
|
+
available: '5.4',
|
|
213
|
+
enabled: '5.4'
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
const type = normalizeModelName(resource.type);
|
|
217
|
+
if (!this._schemas.has(type)) {
|
|
218
|
+
this._loadModelSchema(type);
|
|
219
|
+
}
|
|
220
|
+
return this._schemas.get(type).relationships;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function buildSchema(store) {
|
|
224
|
+
return new ModelSchemaProvider(store);
|
|
225
|
+
}
|
|
226
|
+
function getModelFactory(store, type) {
|
|
227
|
+
if (!store._modelFactoryCache) {
|
|
228
|
+
store._modelFactoryCache = Object.create(null);
|
|
229
|
+
}
|
|
230
|
+
const cache = store._modelFactoryCache;
|
|
231
|
+
let factory = cache[type];
|
|
232
|
+
if (!factory) {
|
|
233
|
+
const owner = getOwner(store);
|
|
234
|
+
factory = owner.factoryFor(`model:${type}`);
|
|
235
|
+
if (!factory) {
|
|
236
|
+
//Support looking up mixins as base types for polymorphic relationships
|
|
237
|
+
factory = modelForMixin(store, type);
|
|
238
|
+
}
|
|
239
|
+
if (!factory) {
|
|
240
|
+
// we don't cache misses in case someone wants to register a missing model
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
const klass = factory.class;
|
|
244
|
+
if (klass.isModel) {
|
|
245
|
+
const hasOwnModelNameSet = klass.modelName && Object.prototype.hasOwnProperty.call(klass, 'modelName');
|
|
246
|
+
if (!hasOwnModelNameSet) {
|
|
247
|
+
Object.defineProperty(klass, 'modelName', {
|
|
248
|
+
value: type
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
cache[type] = factory;
|
|
253
|
+
}
|
|
254
|
+
return factory;
|
|
255
|
+
}
|
|
256
|
+
export { ModelSchemaProvider as M, buildSchema as b, getModelFactory as g };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-provider-C5vR7TBr.js","sources":["../src/-private/model-for-mixin.ts","../src/-private/schema-provider.ts"],"sourcesContent":["import { getOwner } from '@ember/application';\n\nimport type Store from '@ember-data/store';\n\nimport { Model, type ModelFactory } from './model';\n\n/*\n In case someone defined a relationship to a mixin, for example:\n ```ts\n class CommentModel extends Model {\n @belongsTo('commentable', { polymorphic: true }) owner;\n }\n\n let Commentable = Mixin.create({\n @hasMany('comment') comments;\n });\n ```\n we want to look up a Commentable class which has all the necessary\n relationship meta data. Thus, we look up the mixin and create a mock\n Model, so we can access the relationship CPs of the mixin (`comments`)\n in this case\n */\nexport default function modelForMixin(store: Store, normalizedModelName: string): ModelFactory | undefined {\n const owner = getOwner(store)!;\n const MaybeMixin = owner.factoryFor(`mixin:${normalizedModelName}`);\n const mixin = MaybeMixin && MaybeMixin.class;\n if (mixin) {\n const ModelForMixin = Model.extend(mixin) as unknown as { __isMixin: boolean; __mixin: typeof mixin };\n ModelForMixin.__isMixin = true;\n ModelForMixin.__mixin = mixin;\n //Cache the class as a model\n owner.register(`model:${normalizedModelName}`, ModelForMixin);\n }\n return owner.factoryFor(`model:${normalizedModelName}`) as ModelFactory | undefined;\n}\n","import { getOwner } from '@ember/application';\nimport { deprecate } from '@ember/debug';\n\nimport type Store from '@ember-data/store';\nimport type { SchemaService } from '@ember-data/store/types';\nimport { ENABLE_LEGACY_SCHEMA_SERVICE } from '@warp-drive/build-config/deprecations';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { RecordIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';\nimport type { ObjectValue } from '@warp-drive/core-types/json/raw';\nimport type { Derivation, HashFn, Transformation } from '@warp-drive/core-types/schema/concepts';\nimport type {\n LegacyAttributeField,\n LegacyFieldSchema,\n LegacyRelationshipSchema,\n ResourceSchema,\n} from '@warp-drive/core-types/schema/fields';\n\nimport type { FactoryCache, Model, ModelFactory, ModelStore } from './model';\nimport _modelForMixin from './model-for-mixin';\nimport { normalizeModelName } from './util';\n\ntype AttributesSchema = ReturnType<Exclude<SchemaService['attributesDefinitionFor'], undefined>>;\ntype RelationshipsSchema = ReturnType<Exclude<SchemaService['relationshipsDefinitionFor'], undefined>>;\n\ntype InternalSchema = {\n schema: ResourceSchema;\n fields: Map<string, LegacyAttributeField | LegacyRelationshipSchema>;\n attributes: Record<string, LegacyAttributeField>;\n relationships: Record<string, LegacyRelationshipSchema>;\n};\n\nexport interface ModelSchemaProvider {\n attributesDefinitionFor(resource: RecordIdentifier | { type: string }): AttributesSchema;\n\n relationshipsDefinitionFor(resource: RecordIdentifier | { type: string }): RelationshipsSchema;\n\n doesTypeExist(type: string): boolean;\n}\nexport class ModelSchemaProvider implements SchemaService {\n declare store: ModelStore;\n declare _schemas: Map<string, InternalSchema>;\n declare _typeMisses: Set<string>;\n\n constructor(store: ModelStore) {\n this.store = store;\n this._schemas = new Map();\n this._typeMisses = new Set();\n }\n\n hasTrait(type: string): boolean {\n assert(`hasTrait is not available with @ember-data/model's SchemaService`);\n return false;\n }\n resourceHasTrait(resource: StableRecordIdentifier | { type: string }, trait: string): boolean {\n assert(`resourceHasTrait is not available with @ember-data/model's SchemaService`);\n return false;\n }\n transformation(name: string): Transformation {\n assert(`transformation is not available with @ember-data/model's SchemaService`);\n }\n hashFn(name: string): HashFn {\n assert(`hashFn is not available with @ember-data/model's SchemaService`);\n }\n derivation(name: string): Derivation {\n assert(`derivation is not available with @ember-data/model's SchemaService`);\n }\n resource(resource: StableRecordIdentifier | { type: string }): ResourceSchema {\n const type = normalizeModelName(resource.type);\n\n if (!this._schemas.has(type)) {\n this._loadModelSchema(type);\n }\n\n return this._schemas.get(type)!.schema;\n }\n registerResources(schemas: ResourceSchema[]): void {\n assert(`registerResources is not available with @ember-data/model's SchemaService`);\n }\n registerResource(schema: ResourceSchema): void {\n assert(`registerResource is not available with @ember-data/model's SchemaService`);\n }\n registerTransformation(transform: Transformation): void {\n assert(`registerTransformation is not available with @ember-data/model's SchemaService`);\n }\n registerDerivation<R, T, FM extends ObjectValue | null>(derivation: Derivation<R, T, FM>): void {\n assert(`registerDerivation is not available with @ember-data/model's SchemaService`);\n }\n registerHashFn(hashFn: HashFn): void {\n assert(`registerHashFn is not available with @ember-data/model's SchemaService`);\n }\n _loadModelSchema(type: string) {\n const modelClass = this.store.modelFor(type) as typeof Model;\n const attributeMap = modelClass.attributes;\n\n const attributes = Object.create(null) as AttributesSchema;\n attributeMap.forEach((meta, name) => (attributes[name] = meta));\n const relationships = modelClass.relationshipsObject || null;\n const fields = new Map<string, LegacyAttributeField | LegacyRelationshipSchema>();\n\n for (const attr of Object.values(attributes)) {\n fields.set(attr.name, attr);\n }\n\n for (const rel of Object.values(relationships)) {\n fields.set(rel.name, rel);\n }\n\n const schema: ResourceSchema = {\n legacy: true,\n identity: { name: 'id', kind: '@id' },\n type,\n fields: Array.from(fields.values()),\n };\n\n const internalSchema: InternalSchema = {\n schema,\n attributes,\n relationships,\n fields,\n };\n\n this._schemas.set(type, internalSchema);\n\n return internalSchema;\n }\n\n fields(resource: RecordIdentifier | { type: string }): Map<string, LegacyFieldSchema> {\n const type = normalizeModelName(resource.type);\n\n if (!this._schemas.has(type)) {\n this._loadModelSchema(type);\n }\n\n return this._schemas.get(type)!.fields;\n }\n\n hasResource(resource: { type: string }): boolean {\n const type = normalizeModelName(resource.type);\n\n if (this._schemas.has(type)) {\n return true;\n }\n\n if (this._typeMisses.has(type)) {\n return false;\n }\n\n const factory = getModelFactory(this.store, type);\n const exists = factory !== null;\n\n if (!exists) {\n this._typeMisses.add(type);\n return false;\n }\n\n return true;\n }\n}\n\nif (ENABLE_LEGACY_SCHEMA_SERVICE) {\n ModelSchemaProvider.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.hasResource({ type });\n };\n\n ModelSchemaProvider.prototype.attributesDefinitionFor = function (\n resource: RecordIdentifier | { type: string }\n ): AttributesSchema {\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 type = normalizeModelName(resource.type);\n\n if (!this._schemas.has(type)) {\n this._loadModelSchema(type);\n }\n\n return this._schemas.get(type)!.attributes;\n };\n\n ModelSchemaProvider.prototype.relationshipsDefinitionFor = function (\n resource: RecordIdentifier | { type: string }\n ): RelationshipsSchema {\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 type = normalizeModelName(resource.type);\n\n if (!this._schemas.has(type)) {\n this._loadModelSchema(type);\n }\n\n return this._schemas.get(type)!.relationships;\n };\n}\n\nexport function buildSchema(store: Store): SchemaService {\n return new ModelSchemaProvider(store as ModelStore);\n}\n\nexport function getModelFactory(store: ModelStore, type: string): ModelFactory | null {\n if (!store._modelFactoryCache) {\n store._modelFactoryCache = Object.create(null) as FactoryCache;\n }\n const cache = store._modelFactoryCache;\n let factory: ModelFactory | undefined = cache[type];\n\n if (!factory) {\n const owner = getOwner(store)!;\n factory = owner.factoryFor(`model:${type}`) as ModelFactory | undefined;\n\n if (!factory) {\n //Support looking up mixins as base types for polymorphic relationships\n factory = _modelForMixin(store, type);\n }\n\n if (!factory) {\n // we don't cache misses in case someone wants to register a missing model\n return null;\n }\n\n const klass = factory.class;\n\n if (klass.isModel) {\n const hasOwnModelNameSet = klass.modelName && Object.prototype.hasOwnProperty.call(klass, 'modelName');\n if (!hasOwnModelNameSet) {\n Object.defineProperty(klass, 'modelName', { value: type });\n }\n }\n\n cache[type] = factory;\n }\n\n return factory;\n}\n"],"names":["modelForMixin","store","normalizedModelName","owner","getOwner","MaybeMixin","factoryFor","mixin","class","ModelForMixin","Model","extend","__isMixin","__mixin","register","ModelSchemaProvider","constructor","_schemas","Map","_typeMisses","Set","hasTrait","type","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","resourceHasTrait","resource","trait","transformation","name","hashFn","derivation","normalizeModelName","has","_loadModelSchema","get","schema","registerResources","schemas","registerResource","registerTransformation","transform","registerDerivation","registerHashFn","modelClass","modelFor","attributeMap","attributes","Object","create","forEach","meta","relationships","relationshipsObject","fields","attr","values","set","rel","legacy","identity","kind","Array","from","internalSchema","hasResource","factory","getModelFactory","exists","add","deprecations","ENABLE_LEGACY_SCHEMA_SERVICE","prototype","doesTypeExist","deprecate","id","until","for","since","available","enabled","attributesDefinitionFor","relationshipsDefinitionFor","buildSchema","_modelFactoryCache","cache","_modelForMixin","klass","isModel","hasOwnModelNameSet","modelName","hasOwnProperty","call","defineProperty","value"],"mappings":";;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAaA,CAACC,KAAY,EAAEC,mBAA2B,EAA4B;AACzG,EAAA,MAAMC,KAAK,GAAGC,QAAQ,CAACH,KAAK,CAAE,CAAA;EAC9B,MAAMI,UAAU,GAAGF,KAAK,CAACG,UAAU,CAAE,CAAA,MAAA,EAAQJ,mBAAoB,CAAA,CAAC,CAAC,CAAA;AACnE,EAAA,MAAMK,KAAK,GAAGF,UAAU,IAAIA,UAAU,CAACG,KAAK,CAAA;AAC5C,EAAA,IAAID,KAAK,EAAE;AACT,IAAA,MAAME,aAAa,GAAGC,KAAK,CAACC,MAAM,CAACJ,KAAK,CAA6D,CAAA;IACrGE,aAAa,CAACG,SAAS,GAAG,IAAI,CAAA;IAC9BH,aAAa,CAACI,OAAO,GAAGN,KAAK,CAAA;AAC7B;IACAJ,KAAK,CAACW,QAAQ,CAAE,CAAA,MAAA,EAAQZ,mBAAoB,CAAC,CAAA,EAAEO,aAAa,CAAC,CAAA;AAC/D,GAAA;AACA,EAAA,OAAON,KAAK,CAACG,UAAU,CAAE,CAAQJ,MAAAA,EAAAA,mBAAoB,EAAC,CAAC,CAAA;AACzD;;ACIO,MAAMa,mBAAmB,CAA0B;EAKxDC,WAAWA,CAACf,KAAiB,EAAE;IAC7B,IAAI,CAACA,KAAK,GAAGA,KAAK,CAAA;AAClB,IAAA,IAAI,CAACgB,QAAQ,GAAG,IAAIC,GAAG,EAAE,CAAA;AACzB,IAAA,IAAI,CAACC,WAAW,GAAG,IAAIC,GAAG,EAAE,CAAA;AAC9B,GAAA;EAEAC,QAAQA,CAACC,IAAY,EAAW;IAC9BC,cAAA,CAAAC,eAAA,EAAAC,CAAAA,SAAA,CAAA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AAW,CAAC,CAAA;MACtG,IAAI,CAACE,kBAAkB,EAAE;AACvBzC,QAAAA,MAAM,CAAC6C,cAAc,CAACN,KAAK,EAAE,WAAW,EAAE;AAAEO,UAAAA,KAAK,EAAE7E,IAAAA;AAAK,SAAC,CAAC,CAAA;AAC5D,OAAA;AACF,KAAA;AAEAoE,IAAAA,KAAK,CAACpE,IAAI,CAAC,GAAGiD,OAAO,CAAA;AACvB,GAAA;AAEA,EAAA,OAAOA,OAAO,CAAA;AAChB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/model",
|
|
3
|
-
"version": "5.4.0-alpha.
|
|
3
|
+
"version": "5.4.0-alpha.70",
|
|
4
4
|
"description": "A basic Ember implementation of a resource presentation layer for use with @ember-data/store",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -14,37 +14,33 @@
|
|
|
14
14
|
"author": "",
|
|
15
15
|
"directories": {},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"lint": "eslint . --quiet --cache --cache-strategy=content --
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js",
|
|
21
|
-
"_build": "bun run build:client && bun run build:types",
|
|
22
|
-
"_syncPnpm": "bun run sync-dependencies-meta-injected"
|
|
17
|
+
"lint": "eslint . --quiet --cache --cache-strategy=content --report-unused-disable-directives",
|
|
18
|
+
"build:pkg": "vite build;",
|
|
19
|
+
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
|
|
23
20
|
},
|
|
24
21
|
"ember-addon": {
|
|
25
|
-
"main": "addon-main.
|
|
22
|
+
"main": "addon-main.cjs",
|
|
26
23
|
"type": "addon",
|
|
27
24
|
"version": 1
|
|
28
25
|
},
|
|
29
26
|
"files": [
|
|
30
27
|
"unstable-preview-types",
|
|
31
28
|
"blueprints",
|
|
32
|
-
"addon-main.
|
|
33
|
-
"
|
|
29
|
+
"addon-main.cjs",
|
|
30
|
+
"dist",
|
|
34
31
|
"README.md",
|
|
35
32
|
"LICENSE.md",
|
|
36
33
|
"ember-data-logo-dark.svg",
|
|
37
34
|
"ember-data-logo-light.svg"
|
|
38
35
|
],
|
|
39
36
|
"peerDependencies": {
|
|
40
|
-
"@ember-data/
|
|
41
|
-
"@ember-data/
|
|
42
|
-
"@ember-data/
|
|
43
|
-
"@ember-data/
|
|
44
|
-
"@ember-data/
|
|
45
|
-
"@ember-data/tracking": "5.4.0-alpha.64",
|
|
37
|
+
"@ember-data/graph": "5.4.0-alpha.70",
|
|
38
|
+
"@ember-data/json-api": "5.4.0-alpha.70",
|
|
39
|
+
"@ember-data/legacy-compat": "5.4.0-alpha.70",
|
|
40
|
+
"@ember-data/store": "5.4.0-alpha.70",
|
|
41
|
+
"@ember-data/tracking": "5.4.0-alpha.70",
|
|
46
42
|
"@ember/string": "^3.1.1",
|
|
47
|
-
"@warp-drive/core-types": "0.0.0-alpha.
|
|
43
|
+
"@warp-drive/core-types": "0.0.0-alpha.56",
|
|
48
44
|
"ember-inflector": "^4.0.2"
|
|
49
45
|
},
|
|
50
46
|
"peerDependenciesMeta": {
|
|
@@ -53,15 +49,9 @@
|
|
|
53
49
|
},
|
|
54
50
|
"@ember-data/graph": {
|
|
55
51
|
"optional": true
|
|
56
|
-
},
|
|
57
|
-
"@ember-data/debug": {
|
|
58
|
-
"optional": true
|
|
59
52
|
}
|
|
60
53
|
},
|
|
61
54
|
"dependenciesMeta": {
|
|
62
|
-
"@ember-data/private-build-infra": {
|
|
63
|
-
"injected": true
|
|
64
|
-
},
|
|
65
55
|
"@ember-data/store": {
|
|
66
56
|
"injected": true
|
|
67
57
|
},
|
|
@@ -77,9 +67,6 @@
|
|
|
77
67
|
"@ember-data/legacy-compat": {
|
|
78
68
|
"injected": true
|
|
79
69
|
},
|
|
80
|
-
"@ember-data/debug": {
|
|
81
|
-
"injected": true
|
|
82
|
-
},
|
|
83
70
|
"@warp-drive/core-types": {
|
|
84
71
|
"injected": true
|
|
85
72
|
},
|
|
@@ -94,57 +81,50 @@
|
|
|
94
81
|
},
|
|
95
82
|
"@ember-data/request-utils": {
|
|
96
83
|
"injected": true
|
|
84
|
+
},
|
|
85
|
+
"@warp-drive/build-config": {
|
|
86
|
+
"injected": true
|
|
97
87
|
}
|
|
98
88
|
},
|
|
99
89
|
"dependencies": {
|
|
100
|
-
"@ember-data/private-build-infra": "5.4.0-alpha.64",
|
|
101
90
|
"@ember/edition-utils": "^1.2.0",
|
|
102
|
-
"@embroider/macros": "^1.
|
|
103
|
-
"ember-cli-babel": "^8.2.0",
|
|
91
|
+
"@embroider/macros": "^1.16.1",
|
|
104
92
|
"ember-cli-string-utils": "^1.1.0",
|
|
105
93
|
"ember-cli-test-info": "^1.0.0",
|
|
106
|
-
"inflection": "~3.0.0"
|
|
94
|
+
"inflection": "~3.0.0",
|
|
95
|
+
"@warp-drive/build-config": "0.0.0-alpha.7",
|
|
96
|
+
"ember-cli-babel": "^8.2.0"
|
|
107
97
|
},
|
|
108
98
|
"devDependencies": {
|
|
109
|
-
"@babel/
|
|
110
|
-
"@babel/
|
|
111
|
-
"@babel/
|
|
112
|
-
"@babel/plugin-transform-class-properties": "^7.24.1",
|
|
113
|
-
"@babel/plugin-transform-private-methods": "^7.24.1",
|
|
114
|
-
"@babel/plugin-transform-runtime": "^7.24.3",
|
|
115
|
-
"@babel/plugin-transform-typescript": "^7.24.4",
|
|
116
|
-
"@babel/preset-env": "^7.24.4",
|
|
99
|
+
"@babel/core": "^7.24.5",
|
|
100
|
+
"@babel/plugin-transform-typescript": "^7.24.5",
|
|
101
|
+
"@babel/preset-env": "^7.24.5",
|
|
117
102
|
"@babel/preset-typescript": "^7.24.1",
|
|
118
|
-
"@
|
|
119
|
-
"@ember-data/
|
|
120
|
-
"@ember-data/
|
|
121
|
-
"@ember-data/
|
|
122
|
-
"@ember-data/
|
|
123
|
-
"@ember-data/
|
|
124
|
-
"@ember-data/
|
|
125
|
-
"@ember-
|
|
126
|
-
"@ember-data/tracking": "5.4.0-alpha.64",
|
|
103
|
+
"@ember-data/graph": "5.4.0-alpha.70",
|
|
104
|
+
"@ember-data/json-api": "5.4.0-alpha.70",
|
|
105
|
+
"@ember-data/legacy-compat": "5.4.0-alpha.70",
|
|
106
|
+
"@ember-data/request": "5.4.0-alpha.70",
|
|
107
|
+
"@ember-data/request-utils": "5.4.0-alpha.70",
|
|
108
|
+
"@ember-data/store": "5.4.0-alpha.70",
|
|
109
|
+
"@ember-data/tracking": "5.4.0-alpha.70",
|
|
110
|
+
"@ember/test-waiters": "^3.1.0",
|
|
127
111
|
"@ember/string": "^3.1.1",
|
|
128
|
-
"@embroider/addon-dev": "^4.3.1",
|
|
129
112
|
"@glimmer/component": "^1.1.2",
|
|
130
|
-
"@
|
|
131
|
-
"@
|
|
132
|
-
"
|
|
133
|
-
"@warp-drive/internal-config": "5.4.0-alpha.64",
|
|
113
|
+
"@warp-drive/core-types": "0.0.0-alpha.56",
|
|
114
|
+
"@warp-drive/internal-config": "5.4.0-alpha.70",
|
|
115
|
+
"decorator-transforms": "^2.0.0",
|
|
134
116
|
"ember-inflector": "^4.0.2",
|
|
135
|
-
"ember-source": "~5.
|
|
117
|
+
"ember-source": "~5.8.0",
|
|
136
118
|
"expect-type": "^0.19.0",
|
|
137
|
-
"pnpm-sync-dependencies-meta-injected": "0.0.
|
|
138
|
-
"rollup": "^4.14.3",
|
|
119
|
+
"pnpm-sync-dependencies-meta-injected": "0.0.14",
|
|
139
120
|
"typescript": "^5.4.5",
|
|
140
|
-
"
|
|
141
|
-
"webpack": "^5.91.0"
|
|
121
|
+
"vite": "^5.2.11"
|
|
142
122
|
},
|
|
143
123
|
"engines": {
|
|
144
|
-
"node": ">=
|
|
124
|
+
"node": ">= 22.1.0"
|
|
145
125
|
},
|
|
146
126
|
"volta": {
|
|
147
127
|
"extends": "../../package.json"
|
|
148
128
|
},
|
|
149
|
-
"packageManager": "pnpm@8.15.
|
|
129
|
+
"packageManager": "pnpm@8.15.8"
|
|
150
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attr.d.ts","sourceRoot":"","sources":["../../src/-private/attr.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAS,MAAM,iCAAiC,CAAC;AACtG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAGpE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAG1D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,WAAW,CAAC,EAAE,GAAG,cAAc,GAAG,MAAM,GAAG,OAAO,EAAE,IAAI;IAClE;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,EAAE,SAAS,cAAc,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;CAC1D,CAAC;
|
|
1
|
+
{"version":3,"file":"attr.d.ts","sourceRoot":"","sources":["../../src/-private/attr.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAS,MAAM,iCAAiC,CAAC;AACtG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAGpE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAG1D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,WAAW,CAAC,EAAE,GAAG,cAAc,GAAG,MAAM,GAAG,OAAO,EAAE,IAAI;IAClE;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,EAAE,SAAS,cAAc,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;CAC1D,CAAC;AA0EF,KAAK,sBAAsB,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,SAAS,MAAM,IAAI;IACzD;;;;OAIG;IAGH,SAAS,EAAE,C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ongs-to.d.ts","sourceRoot":"","sources":["../../src/-private/belongs-to.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"belongs-to.d.ts","sourceRoot":"","sources":["../../src/-private/belongs-to.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMtE;;EAEE;AAEF,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,OAAO,SAAS,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAE5D,MAAM,MAAM,mBAAmB,CAAC,CAAC,EAAE,KAAK,SAAS,OAAO,IAAI;IAC1D,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,MAAM,GAAG,MAAM,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAQzC,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;AA+E5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8JE;AAEF,wBAAgB,SAAS,IAAI,KAAK,CAAC;AACnC,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;AAC/C,wBAAgB,SAAS,CAAC,CAAC,EACzB,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,mBAAmB,CAAC,CAAC,EAAE,OAAO,CAAC,GACvC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAK5B,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare module '@ember-data/model/-private/debug/assert-polymorphic-type' {
|
|
2
|
-
import type {
|
|
2
|
+
import type { UpgradedMeta } from '@ember-data/graph/-private';
|
|
3
3
|
import type Store from '@ember-data/store';
|
|
4
|
-
import type {
|
|
4
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
5
5
|
let assertPolymorphicType: (parentIdentifier: StableRecordIdentifier, parentDefinition: UpgradedMeta, addedIdentifier: StableRecordIdentifier, store: Store) => void;
|
|
6
6
|
export { assertPolymorphicType };
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert-polymorphic-type.d.ts","sourceRoot":"","sources":["../../../src/-private/debug/assert-polymorphic-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assert-polymorphic-type.d.ts","sourceRoot":"","sources":["../../../src/-private/debug/assert-polymorphic-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAG3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAcrE,QAAA,IAAI,qBAAqB,EAAE,CACzB,gBAAgB,EAAE,sBAAsB,EACxC,gBAAgB,EAAE,YAAY,EAC9B,eAAe,EAAE,sBAAsB,EACvC,KAAK,EAAE,KAAK,KACT,IAAI,CAAC;AA2BV,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -92,7 +92,7 @@ declare module '@ember-data/model/-private/errors' {
|
|
|
92
92
|
@public
|
|
93
93
|
@extends Ember.ArrayProxy
|
|
94
94
|
*/
|
|
95
|
-
class Errors extends ArrayProxyWithCustomOverrides<ValidationError> {
|
|
95
|
+
export class Errors extends ArrayProxyWithCustomOverrides<ValidationError> {
|
|
96
96
|
__record: {
|
|
97
97
|
currentState: RecordState;
|
|
98
98
|
};
|
|
@@ -282,9 +282,6 @@ declare module '@ember-data/model/-private/errors' {
|
|
|
282
282
|
Checks if there are error messages for the given attribute.
|
|
283
283
|
|
|
284
284
|
```app/controllers/user/edit.js
|
|
285
|
-
import Controller from '@ember/controller';
|
|
286
|
-
import { action } from '@ember/object';
|
|
287
|
-
|
|
288
285
|
export default class UserEditController extends Controller {
|
|
289
286
|
@action
|
|
290
287
|
save(user) {
|
|
@@ -303,6 +300,6 @@ declare module '@ember-data/model/-private/errors' {
|
|
|
303
300
|
*/
|
|
304
301
|
has(attribute: string): boolean;
|
|
305
302
|
}
|
|
306
|
-
export
|
|
303
|
+
export {};
|
|
307
304
|
}
|
|
308
305
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/-private/errors.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAK,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,UAAU,MAAM,oBAAoB,CAAC;AAI5C,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAE9C,KAAK,eAAe,GAAG;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF;;EAEE;AACF,UAAU,6BAA6B,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,SA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AE,WAAW,CAAC,eAAe,CAAC,CAAC,CAErE;IAED;;;;;;;;;;;;;;;;;;MAkBE;IACF,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,CAAC,eAAe,CAAC;IAmB1D;;;;;;;;;;;;;;;MAeE;IAEM,QAAQ,EAAE,MAAM,EAAE,CAAC;IAE3B;;;;MAIE;IACF,IACI,OAAO,IAAI,WAAW,CAAC,eAAe,CAAC,CAE1C;IAED;;;MAGE;IACF,eAAe,CAAC,SAAS,EAAE,MAAM;IAQjC;;;;;;;MAOE;IAEF;;;;;;;MAOE;IAEM,OAAO,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI;IAUzD;;;MAGE;IACF,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,eAAe,EAAE;IAqBxF;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM;IAwBxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,KAAK,IAAI,IAAI;IAqBb;;;;;;;;;;;;;;;;;;;MAmBE;IACF,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;CAGhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-many.d.ts","sourceRoot":"","sources":["../../src/-private/has-many.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"has-many.d.ts","sourceRoot":"","sources":["../../src/-private/has-many.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAgFvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+JE;AACF,wBAAgB,OAAO,IAAI,KAAK,CAAC;AACjC,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,mBAAmB,CAAC,CAAC,EAAE,OAAO,CAAC,GACvC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAK5B,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/-private/hooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/-private/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoC,KAAK,KAAK,EAAY,MAAM,4BAA4B,CAAC;AAEpG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAA4B,MAAM,+BAA+B,CAAC;AAEhG,OAAO,KAAK,EAAE,KAAK,EAAc,MAAM,SAAS,CAAC;AAMjD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,KAAK,EACX,UAAU,EAAE,sBAAsB,EAClC,gBAAgB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GAC3C,KAAK,CAwBP;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAMlD;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,GAAG,IAAI,CAAC;AAC5E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,KAAK,GAAG,IAAI,CAAC"}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
declare module '@ember-data/model/-private/legacy-relationships-support' {
|
|
2
|
-
import type { UpgradedMeta } from '@ember-data/graph/-private
|
|
3
|
-
import type { CollectionEdge } from '@ember-data/graph/-private/edges/collection';
|
|
4
|
-
import type { ResourceEdge } from '@ember-data/graph/-private/edges/resource';
|
|
5
|
-
import type { Graph } from '@ember-data/graph/-private/graph';
|
|
2
|
+
import type { CollectionEdge, Graph, ResourceEdge, UpgradedMeta } from '@ember-data/graph/-private';
|
|
6
3
|
import type Store from '@ember-data/store';
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
|
|
10
|
-
import type { BaseFinderOptions } from '@ember-data/store/-types/q/store';
|
|
4
|
+
import type { LiveArray } from '@ember-data/store/-private';
|
|
5
|
+
import type { BaseFinderOptions } from '@ember-data/store/types';
|
|
11
6
|
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
7
|
+
import type { Cache } from '@warp-drive/core-types/cache';
|
|
12
8
|
import type { CollectionRelationship } from '@warp-drive/core-types/cache/relationship';
|
|
13
9
|
import type { LocalRelationshipOperation } from '@warp-drive/core-types/graph';
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
16
|
-
import RelatedCollection from '@ember-data/model/-private/many-array';
|
|
10
|
+
import type { OpaqueRecordInstance, TypeFromInstanceOrString } from '@warp-drive/core-types/record';
|
|
11
|
+
import type { CollectionResourceRelationship, InnerRelationshipDocument, SingleResourceRelationship } from '@warp-drive/core-types/spec/json-api-raw';
|
|
12
|
+
import { RelatedCollection as ManyArray } from '@ember-data/model/-private/many-array';
|
|
17
13
|
import type { MinimalLegacyRecord } from '@ember-data/model/-private/model-methods';
|
|
18
14
|
import type { BelongsToProxyCreateArgs } from '@ember-data/model/-private/promise-belongs-to';
|
|
19
15
|
import { PromiseBelongsTo } from '@ember-data/model/-private/promise-belongs-to';
|
|
20
16
|
import type { HasManyProxyCreateArgs } from '@ember-data/model/-private/promise-many-array';
|
|
21
|
-
import PromiseManyArray from '@ember-data/model/-private/promise-many-array';
|
|
17
|
+
import { PromiseManyArray } from '@ember-data/model/-private/promise-many-array';
|
|
22
18
|
import BelongsToReference from '@ember-data/model/-private/references/belongs-to';
|
|
23
19
|
import HasManyReference from '@ember-data/model/-private/references/has-many';
|
|
24
20
|
export const LEGACY_SUPPORT: Map<StableRecordIdentifier | MinimalLegacyRecord, LegacySupport>;
|
|
@@ -30,24 +26,24 @@ declare module '@ember-data/model/-private/legacy-relationships-support' {
|
|
|
30
26
|
cache: Cache;
|
|
31
27
|
references: Record<string, BelongsToReference | HasManyReference>;
|
|
32
28
|
identifier: StableRecordIdentifier;
|
|
33
|
-
_manyArrayCache: Record<string,
|
|
34
|
-
_relationshipPromisesCache: Record<string, Promise<
|
|
29
|
+
_manyArrayCache: Record<string, ManyArray>;
|
|
30
|
+
_relationshipPromisesCache: Record<string, Promise<ManyArray | OpaqueRecordInstance>>;
|
|
35
31
|
_relationshipProxyCache: Record<string, PromiseManyArray | PromiseBelongsTo | undefined>;
|
|
36
32
|
_pending: Record<string, Promise<StableRecordIdentifier | null> | undefined>;
|
|
37
33
|
isDestroying: boolean;
|
|
38
34
|
isDestroyed: boolean;
|
|
39
35
|
constructor(record: MinimalLegacyRecord);
|
|
40
|
-
_syncArray(array:
|
|
36
|
+
_syncArray(array: LiveArray): void;
|
|
41
37
|
mutate(mutation: LocalRelationshipOperation): void;
|
|
42
38
|
_findBelongsTo(key: string, resource: SingleResourceRelationship, relationship: ResourceEdge, options?: BaseFinderOptions): Promise<OpaqueRecordInstance | null>;
|
|
43
39
|
reloadBelongsTo(key: string, options?: BaseFinderOptions): Promise<OpaqueRecordInstance | null>;
|
|
44
40
|
getBelongsTo(key: string, options?: BaseFinderOptions): PromiseBelongsTo | OpaqueRecordInstance | null;
|
|
45
41
|
setDirtyBelongsTo(key: string, value: OpaqueRecordInstance | null): void;
|
|
46
|
-
_getCurrentState(identifier: StableRecordIdentifier, field: string): [StableRecordIdentifier[], CollectionRelationship];
|
|
47
|
-
getManyArray<T>(key: string, definition?: UpgradedMeta):
|
|
48
|
-
fetchAsyncHasMany(key: string, relationship: CollectionEdge, manyArray:
|
|
42
|
+
_getCurrentState<T>(identifier: StableRecordIdentifier, field: string): [StableRecordIdentifier<TypeFromInstanceOrString<T>>[], CollectionRelationship];
|
|
43
|
+
getManyArray<T>(key: string, definition?: UpgradedMeta): ManyArray<T>;
|
|
44
|
+
fetchAsyncHasMany(key: string, relationship: CollectionEdge, manyArray: ManyArray, options?: BaseFinderOptions): Promise<ManyArray>;
|
|
49
45
|
reloadHasMany<T>(key: string, options?: BaseFinderOptions): Promise<ManyArray<T>> | PromiseManyArray<T>;
|
|
50
|
-
getHasMany(key: string, options?: BaseFinderOptions): PromiseManyArray |
|
|
46
|
+
getHasMany(key: string, options?: BaseFinderOptions): PromiseManyArray | ManyArray;
|
|
51
47
|
_updatePromiseProxyFor(kind: 'hasMany', key: string, args: HasManyProxyCreateArgs): PromiseManyArray;
|
|
52
48
|
_updatePromiseProxyFor(kind: 'belongsTo', key: string, args: BelongsToProxyCreateArgs): PromiseBelongsTo;
|
|
53
49
|
_updatePromiseProxyFor(kind: 'belongsTo', key: string, args: {
|
|
@@ -59,6 +55,6 @@ declare module '@ember-data/model/-private/legacy-relationships-support' {
|
|
|
59
55
|
_findBelongsToByJsonApiResource(resource: SingleResourceRelationship, parentIdentifier: StableRecordIdentifier, relationship: ResourceEdge, options?: BaseFinderOptions): Promise<StableRecordIdentifier | null>;
|
|
60
56
|
destroy(): void;
|
|
61
57
|
}
|
|
62
|
-
export function areAllInverseRecordsLoaded(store: Store, resource:
|
|
58
|
+
export function areAllInverseRecordsLoaded(store: Store, resource: InnerRelationshipDocument): boolean;
|
|
63
59
|
}
|
|
64
60
|
//# sourceMappingURL=legacy-relationships-support.d.ts.map
|