@ember-data/model 5.3.0-alpha.3 → 5.3.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addon/-private.js +2 -37
- package/addon/-private.js.map +1 -1
- package/addon/has-many-435cd213.js +496 -0
- package/addon/has-many-435cd213.js.map +1 -0
- package/addon/hooks-f9d9fb4f.js +157 -0
- package/addon/hooks-f9d9fb4f.js.map +1 -0
- package/addon/hooks.js +1 -0
- package/addon/hooks.js.map +1 -0
- package/addon/index.js +3 -1
- package/addon/index.js.map +1 -1
- package/addon/{has-many-2baf73c0.js → model-99cdd629.js} +32 -515
- package/addon/model-99cdd629.js.map +1 -0
- package/package.json +20 -20
- package/addon/has-many-2baf73c0.js.map +0 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { getOwner, setOwner } from '@ember/application';
|
|
2
|
+
import { assert } from '@ember/debug';
|
|
3
|
+
import { setRecordIdentifier, StoreMap, setCacheFor } from '@ember-data/store/-private';
|
|
4
|
+
import { M as Model, n as normalizeModelName } from "./model-99cdd629";
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
In case someone defined a relationship to a mixin, for example:
|
|
8
|
+
```
|
|
9
|
+
import Model, { belongsTo, hasMany } from '@ember-data/model';
|
|
10
|
+
import Mixin from '@ember/object/mixin';
|
|
11
|
+
|
|
12
|
+
class CommentModel extends Model {
|
|
13
|
+
@belongsTo('commentable', { polymorphic: true }) owner;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let Commentable = Mixin.create({
|
|
17
|
+
@hasMany('comment') comments;
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
we want to look up a Commentable class which has all the necessary
|
|
21
|
+
relationship meta data. Thus, we look up the mixin and create a mock
|
|
22
|
+
Model, so we can access the relationship CPs of the mixin (`comments`)
|
|
23
|
+
in this case
|
|
24
|
+
*/
|
|
25
|
+
function modelForMixin(store, normalizedModelName) {
|
|
26
|
+
let owner = getOwner(store);
|
|
27
|
+
let MaybeMixin = owner.factoryFor(`mixin:${normalizedModelName}`);
|
|
28
|
+
let mixin = MaybeMixin && MaybeMixin.class;
|
|
29
|
+
if (mixin) {
|
|
30
|
+
let ModelForMixin = Model.extend(mixin);
|
|
31
|
+
ModelForMixin.__isMixin = true;
|
|
32
|
+
ModelForMixin.__mixin = mixin;
|
|
33
|
+
//Cache the class as a model
|
|
34
|
+
owner.register('model:' + normalizedModelName, ModelForMixin);
|
|
35
|
+
}
|
|
36
|
+
return owner.factoryFor(`model:${normalizedModelName}`);
|
|
37
|
+
}
|
|
38
|
+
class ModelSchemaProvider {
|
|
39
|
+
constructor(store) {
|
|
40
|
+
this.store = store;
|
|
41
|
+
this._relationshipsDefCache = Object.create(null);
|
|
42
|
+
this._attributesDefCache = Object.create(null);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Following the existing RD implementation
|
|
46
|
+
attributesDefinitionFor(identifier) {
|
|
47
|
+
const {
|
|
48
|
+
type
|
|
49
|
+
} = identifier;
|
|
50
|
+
let attributes;
|
|
51
|
+
attributes = this._attributesDefCache[type];
|
|
52
|
+
if (attributes === undefined) {
|
|
53
|
+
let modelClass = this.store.modelFor(type);
|
|
54
|
+
let attributeMap = modelClass.attributes;
|
|
55
|
+
attributes = Object.create(null);
|
|
56
|
+
attributeMap.forEach((meta, name) => attributes[name] = meta);
|
|
57
|
+
this._attributesDefCache[type] = attributes;
|
|
58
|
+
}
|
|
59
|
+
return attributes;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Following the existing RD implementation
|
|
63
|
+
relationshipsDefinitionFor(identifier) {
|
|
64
|
+
const {
|
|
65
|
+
type
|
|
66
|
+
} = identifier;
|
|
67
|
+
let relationships;
|
|
68
|
+
relationships = this._relationshipsDefCache[type];
|
|
69
|
+
if (relationships === undefined) {
|
|
70
|
+
let modelClass = this.store.modelFor(type);
|
|
71
|
+
relationships = modelClass.relationshipsObject || null;
|
|
72
|
+
this._relationshipsDefCache[type] = relationships;
|
|
73
|
+
}
|
|
74
|
+
return relationships;
|
|
75
|
+
}
|
|
76
|
+
doesTypeExist(modelName) {
|
|
77
|
+
const type = normalizeModelName(modelName);
|
|
78
|
+
const factory = getModelFactory(this.store, type);
|
|
79
|
+
return factory !== null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function buildSchema(store) {
|
|
83
|
+
return new ModelSchemaProvider(store);
|
|
84
|
+
}
|
|
85
|
+
function getModelFactory(store, type) {
|
|
86
|
+
if (!store._modelFactoryCache) {
|
|
87
|
+
store._modelFactoryCache = Object.create(null);
|
|
88
|
+
}
|
|
89
|
+
const cache = store._modelFactoryCache;
|
|
90
|
+
let factory = cache[type];
|
|
91
|
+
if (!factory) {
|
|
92
|
+
const owner = getOwner(store);
|
|
93
|
+
factory = owner.factoryFor(`model:${type}`);
|
|
94
|
+
if (!factory) {
|
|
95
|
+
//Support looking up mixins as base types for polymorphic relationships
|
|
96
|
+
factory = modelForMixin(store, type);
|
|
97
|
+
}
|
|
98
|
+
if (!factory) {
|
|
99
|
+
// we don't cache misses in case someone wants to register a missing model
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
let klass = factory.class;
|
|
103
|
+
if (klass.isModel) {
|
|
104
|
+
let hasOwnModelNameSet = klass.modelName && Object.prototype.hasOwnProperty.call(klass, 'modelName');
|
|
105
|
+
if (!hasOwnModelNameSet) {
|
|
106
|
+
Object.defineProperty(klass, 'modelName', {
|
|
107
|
+
value: type
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
cache[type] = factory;
|
|
112
|
+
}
|
|
113
|
+
return factory;
|
|
114
|
+
}
|
|
115
|
+
function instantiateRecord(identifier, createRecordArgs) {
|
|
116
|
+
const type = identifier.type;
|
|
117
|
+
const cache = this.cache;
|
|
118
|
+
// TODO deprecate allowing unknown args setting
|
|
119
|
+
const createOptions = {
|
|
120
|
+
_createProps: createRecordArgs,
|
|
121
|
+
// TODO @deprecate consider deprecating accessing record properties during init which the below is necessary for
|
|
122
|
+
_secretInit: {
|
|
123
|
+
identifier,
|
|
124
|
+
cache,
|
|
125
|
+
store: this,
|
|
126
|
+
cb: secretInit
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// ensure that `getOwner(this)` works inside a model instance
|
|
131
|
+
setOwner(createOptions, getOwner(this));
|
|
132
|
+
const factory = getModelFactory(this, type);
|
|
133
|
+
assert(`No model was found for '${type}'`, factory);
|
|
134
|
+
return factory.class.create(createOptions);
|
|
135
|
+
}
|
|
136
|
+
function teardownRecord(record) {
|
|
137
|
+
assert(`expected to receive an instance of DSModel. If using a custom model make sure you implement teardownRecord`, 'destroy' in record);
|
|
138
|
+
record.destroy();
|
|
139
|
+
}
|
|
140
|
+
function modelFor(modelName) {
|
|
141
|
+
assert(`You need to pass a model name to the store's modelFor method`, modelName);
|
|
142
|
+
assert(`Please pass a proper model name to the store's modelFor method`, typeof modelName === 'string' && modelName.length);
|
|
143
|
+
const type = normalizeModelName(modelName);
|
|
144
|
+
const maybeFactory = getModelFactory(this, type);
|
|
145
|
+
const klass = maybeFactory && maybeFactory.class ? maybeFactory.class : null;
|
|
146
|
+
const ignoreType = !klass || !klass.isModel || this._forceShim;
|
|
147
|
+
if (!ignoreType) {
|
|
148
|
+
return klass;
|
|
149
|
+
}
|
|
150
|
+
assert(`No model was found for '${type}' and no schema handles the type`, this.getSchemaDefinitionService().doesTypeExist(type));
|
|
151
|
+
}
|
|
152
|
+
function secretInit(record, cache, identifier, store) {
|
|
153
|
+
setRecordIdentifier(record, identifier);
|
|
154
|
+
StoreMap.set(record, store);
|
|
155
|
+
setCacheFor(record, cache);
|
|
156
|
+
}
|
|
157
|
+
export { ModelSchemaProvider as M, buildSchema as b, instantiateRecord as i, modelFor as m, teardownRecord as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks-f9d9fb4f.js","sources":["../src/-private/model-for-mixin.ts","../src/-private/schema-provider.ts","../src/-private/hooks.ts"],"sourcesContent":["import { getOwner } from '@ember/application';\n\nimport type Store from '@ember-data/store';\n\nimport Model from './model';\n\n/*\n In case someone defined a relationship to a mixin, for example:\n ```\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n import Mixin from '@ember/object/mixin';\n\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): Model | null {\n let owner: any = getOwner(store);\n let MaybeMixin = owner.factoryFor(`mixin:${normalizedModelName}`);\n let mixin = MaybeMixin && MaybeMixin.class;\n if (mixin) {\n let ModelForMixin = Model.extend(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}`);\n}\n","import { getOwner } from '@ember/application';\n\nimport type Store from '@ember-data/store';\nimport type { DSModelSchema, FactoryCache, ModelFactory, ModelStore } from '@ember-data/types/q/ds-model';\nimport type { RecordIdentifier } from '@ember-data/types/q/identifier';\nimport type { AttributesSchema, RelationshipsSchema } from '@ember-data/types/q/record-data-schemas';\n\nimport _modelForMixin from './model-for-mixin';\nimport { normalizeModelName } from './util';\n\nexport class ModelSchemaProvider {\n declare store: ModelStore;\n declare _relationshipsDefCache: Record<string, RelationshipsSchema>;\n declare _attributesDefCache: Record<string, AttributesSchema>;\n\n constructor(store: ModelStore) {\n this.store = store;\n this._relationshipsDefCache = Object.create(null) as Record<string, RelationshipsSchema>;\n this._attributesDefCache = Object.create(null) as Record<string, AttributesSchema>;\n }\n\n // Following the existing RD implementation\n attributesDefinitionFor(identifier: RecordIdentifier | { type: string }): AttributesSchema {\n const { type } = identifier;\n let attributes: AttributesSchema;\n\n attributes = this._attributesDefCache[type];\n\n if (attributes === undefined) {\n let modelClass = this.store.modelFor(type);\n let attributeMap = modelClass.attributes;\n\n attributes = Object.create(null) as AttributesSchema;\n attributeMap.forEach((meta, name) => (attributes[name] = meta));\n this._attributesDefCache[type] = attributes;\n }\n\n return attributes;\n }\n\n // Following the existing RD implementation\n relationshipsDefinitionFor(identifier: RecordIdentifier | { type: string }): RelationshipsSchema {\n const { type } = identifier;\n let relationships: RelationshipsSchema;\n\n relationships = this._relationshipsDefCache[type];\n\n if (relationships === undefined) {\n let modelClass = this.store.modelFor(type) as DSModelSchema;\n relationships = modelClass.relationshipsObject || null;\n this._relationshipsDefCache[type] = relationships;\n }\n\n return relationships;\n }\n\n doesTypeExist(modelName: string): boolean {\n const type = normalizeModelName(modelName);\n const factory = getModelFactory(this.store, type);\n\n return factory !== null;\n }\n}\n\nexport function buildSchema(store: Store) {\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 let klass = factory.class;\n\n if (klass.isModel) {\n let 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","import { getOwner, setOwner } from '@ember/application';\nimport { assert } from '@ember/debug';\n\nimport { setCacheFor, setRecordIdentifier, type Store, StoreMap } from '@ember-data/store/-private';\nimport type { Cache } from '@ember-data/types/cache/cache';\nimport type { DSModel, DSModelSchema, ModelStore } from '@ember-data/types/q/ds-model';\nimport type { StableRecordIdentifier } from '@ember-data/types/q/identifier';\n\nimport { getModelFactory } from './schema-provider';\nimport { normalizeModelName } from './util';\n\nexport function instantiateRecord(\n this: ModelStore,\n identifier: StableRecordIdentifier,\n createRecordArgs: { [key: string]: unknown }\n): DSModel {\n const type = identifier.type;\n\n const cache = this.cache;\n // TODO deprecate allowing unknown args setting\n const createOptions = {\n _createProps: createRecordArgs,\n // TODO @deprecate consider deprecating accessing record properties during init which the below is necessary for\n _secretInit: {\n identifier,\n cache,\n store: this,\n cb: secretInit,\n },\n };\n\n // ensure that `getOwner(this)` works inside a model instance\n setOwner(createOptions, getOwner(this)!);\n const factory = getModelFactory(this, type);\n\n assert(`No model was found for '${type}'`, factory);\n return factory.class.create(createOptions);\n}\n\nexport function teardownRecord(record: DSModel): void {\n assert(\n `expected to receive an instance of DSModel. If using a custom model make sure you implement teardownRecord`,\n 'destroy' in record\n );\n record.destroy();\n}\n\nexport function modelFor(this: Store, modelName: string): DSModelSchema | void {\n assert(`You need to pass a model name to the store's modelFor method`, modelName);\n assert(\n `Please pass a proper model name to the store's modelFor method`,\n typeof modelName === 'string' && modelName.length\n );\n const type = normalizeModelName(modelName);\n const maybeFactory = getModelFactory(this as ModelStore, type);\n const klass = maybeFactory && maybeFactory.class ? maybeFactory.class : null;\n\n const ignoreType = !klass || !klass.isModel || this._forceShim;\n if (!ignoreType) {\n return klass;\n }\n assert(\n `No model was found for '${type}' and no schema handles the type`,\n this.getSchemaDefinitionService().doesTypeExist(type)\n );\n}\n\nfunction secretInit(record: DSModel, cache: Cache, identifier: StableRecordIdentifier, store: Store): void {\n setRecordIdentifier(record, identifier);\n StoreMap.set(record, store);\n setCacheFor(record, cache);\n}\n"],"names":["modelForMixin","store","normalizedModelName","owner","getOwner","MaybeMixin","factoryFor","mixin","class","ModelForMixin","Model","extend","__isMixin","__mixin","register","ModelSchemaProvider","constructor","_relationshipsDefCache","Object","create","_attributesDefCache","attributesDefinitionFor","identifier","type","attributes","undefined","modelClass","modelFor","attributeMap","forEach","meta","name","relationshipsDefinitionFor","relationships","relationshipsObject","doesTypeExist","modelName","normalizeModelName","factory","getModelFactory","buildSchema","_modelFactoryCache","cache","_modelForMixin","klass","isModel","hasOwnModelNameSet","prototype","hasOwnProperty","call","defineProperty","value","instantiateRecord","createRecordArgs","createOptions","_createProps","_secretInit","cb","secretInit","setOwner","assert","teardownRecord","record","destroy","length","maybeFactory","ignoreType","_forceShim","getSchemaDefinitionService","setRecordIdentifier","StoreMap","set","setCacheFor"],"mappings":";;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAaA,CAACC,KAAY,EAAEC,mBAA2B,EAAgB;AAC7F,EAAA,IAAIC,KAAU,GAAGC,QAAQ,CAACH,KAAK,CAAC,CAAA;EAChC,IAAII,UAAU,GAAGF,KAAK,CAACG,UAAU,CAAE,CAAA,MAAA,EAAQJ,mBAAoB,CAAA,CAAC,CAAC,CAAA;AACjE,EAAA,IAAIK,KAAK,GAAGF,UAAU,IAAIA,UAAU,CAACG,KAAK,CAAA;AAC1C,EAAA,IAAID,KAAK,EAAE;AACT,IAAA,IAAIE,aAAa,GAAGC,KAAK,CAACC,MAAM,CAACJ,KAAK,CAAC,CAAA;IACvCE,aAAa,CAACG,SAAS,GAAG,IAAI,CAAA;IAC9BH,aAAa,CAACI,OAAO,GAAGN,KAAK,CAAA;AAC7B;IACAJ,KAAK,CAACW,QAAQ,CAAC,QAAQ,GAAGZ,mBAAmB,EAAEO,aAAa,CAAC,CAAA;AAC/D,GAAA;AACA,EAAA,OAAON,KAAK,CAACG,UAAU,CAAE,CAAQJ,MAAAA,EAAAA,mBAAoB,EAAC,CAAC,CAAA;AACzD;;AC3BO,MAAMa,mBAAmB,CAAC;EAK/BC,WAAW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B,KAAY,EAAQ;AACzGoE,EAAAA,mBAAmB,CAACP,MAAM,EAAExC,UAAU,CAAC,CAAA;AACvCgD,EAAAA,QAAQ,CAACC,GAAG,CAACT,MAAM,EAAE7D,KAAK,CAAC,CAAA;AAC3BuE,EAAAA,WAAW,CAACV,MAAM,EAAEpB,KAAK,CAAC,CAAA;AAC5B;;;;"}
|
package/addon/hooks.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { b as buildSchema, i as instantiateRecord, m as modelFor, t as teardownRecord } from "./hooks-f9d9fb4f";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/addon/index.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export { a as attr, b as belongsTo,
|
|
1
|
+
export { a as attr, b as belongsTo, h as hasMany } from "./has-many-435cd213";
|
|
2
|
+
export { M as default } from "./model-99cdd629";
|
|
3
|
+
export { M as ModelSchemaProvider, i as instantiateRecord, m as modelFor, t as teardownRecord } from "./hooks-f9d9fb4f";
|
package/addon/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|