@ember-data/store 4.5.0-alpha.4 → 4.5.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.
|
@@ -1857,7 +1857,7 @@ abstract class CoreStore extends Service {
|
|
|
1857
1857
|
@param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter.queryRecord
|
|
1858
1858
|
@return {Promise} promise which resolves with the found record or `null`
|
|
1859
1859
|
*/
|
|
1860
|
-
queryRecord(modelName: string, query, options): PromiseObject<RecordInstance | null> {
|
|
1860
|
+
queryRecord(modelName: string, query, options?): PromiseObject<RecordInstance | null> {
|
|
1861
1861
|
if (DEBUG) {
|
|
1862
1862
|
assertDestroyingStore(this, 'queryRecord');
|
|
1863
1863
|
}
|
|
@@ -3031,7 +3031,7 @@ abstract class CoreStore extends Service {
|
|
|
3031
3031
|
@param {String} modelName
|
|
3032
3032
|
@return Adapter
|
|
3033
3033
|
*/
|
|
3034
|
-
adapterFor(modelName) {
|
|
3034
|
+
adapterFor(modelName: string) {
|
|
3035
3035
|
if (DEBUG) {
|
|
3036
3036
|
assertDestroyingStore(this, 'adapterFor');
|
|
3037
3037
|
}
|
|
@@ -3048,7 +3048,7 @@ abstract class CoreStore extends Service {
|
|
|
3048
3048
|
return adapter;
|
|
3049
3049
|
}
|
|
3050
3050
|
|
|
3051
|
-
let owner = getOwner(this);
|
|
3051
|
+
let owner: any = getOwner(this);
|
|
3052
3052
|
|
|
3053
3053
|
// name specific adapter
|
|
3054
3054
|
adapter = owner.lookup(`adapter:${normalizedModelName}`);
|
|
@@ -3119,7 +3119,7 @@ abstract class CoreStore extends Service {
|
|
|
3119
3119
|
return serializer;
|
|
3120
3120
|
}
|
|
3121
3121
|
|
|
3122
|
-
let owner = getOwner(this);
|
|
3122
|
+
let owner: any = getOwner(this);
|
|
3123
3123
|
|
|
3124
3124
|
// by name
|
|
3125
3125
|
serializer = owner.lookup(`serializer:${normalizedModelName}`);
|
|
@@ -19,10 +19,13 @@ import InternalModel from './model/internal-model';
|
|
|
19
19
|
@internal
|
|
20
20
|
*/
|
|
21
21
|
export default class InternalModelMap {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
_idToModel: ConfidentDict<InternalModel> = Object.create(null);
|
|
23
|
+
_models: InternalModel[] = [];
|
|
24
|
+
modelName: string;
|
|
24
25
|
|
|
25
|
-
constructor(
|
|
26
|
+
constructor(modelName: string) {
|
|
27
|
+
this.modelName = modelName;
|
|
28
|
+
}
|
|
26
29
|
|
|
27
30
|
get(id: string): InternalModel | null {
|
|
28
31
|
return this._idToModel[id] || null;
|
|
@@ -105,7 +105,8 @@ export function promiseArray<I, T extends EmberArrayLike<I>>(promise: Promise<T>
|
|
|
105
105
|
// constructor is accessed in some internals but not including it in the copyright for the deprecation
|
|
106
106
|
const ALLOWABLE_METHODS = ['constructor', 'then', 'catch', 'finally'];
|
|
107
107
|
|
|
108
|
-
export function deprecatedPromiseObject<T>(promise:
|
|
108
|
+
export function deprecatedPromiseObject<T>(promise: Promise<T>): PromiseObjectProxy<T> {
|
|
109
|
+
const promiseObjectProxy: PromiseObjectProxy<T> = promiseObject(promise);
|
|
109
110
|
const handler = {
|
|
110
111
|
get(target: object, prop: string, receiver?: object): unknown {
|
|
111
112
|
if (!ALLOWABLE_METHODS.includes(prop)) {
|
|
@@ -124,9 +125,14 @@ export function deprecatedPromiseObject<T>(promise: PromiseObjectProxy<T>): Prom
|
|
|
124
125
|
);
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
const value: unknown = Reflect.get(target, prop, receiver);
|
|
129
|
+
if (value && typeof value === 'function' && typeof value.bind === 'function') {
|
|
130
|
+
return value.bind(target);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return value;
|
|
128
134
|
},
|
|
129
135
|
};
|
|
130
136
|
|
|
131
|
-
return new Proxy(
|
|
137
|
+
return new Proxy(promiseObjectProxy, handler) as PromiseObjectProxy<T>;
|
|
132
138
|
}
|
|
@@ -114,7 +114,7 @@ export function getModelFactory(store: Store, cache, normalizedModelName: string
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
export function _lookupModelFactory(store: Store, normalizedModelName: string): Model | null {
|
|
117
|
-
let owner = getOwner(store);
|
|
117
|
+
let owner: any = getOwner(store);
|
|
118
118
|
|
|
119
119
|
return owner.factoryFor(`model:${normalizedModelName}`);
|
|
120
120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/store",
|
|
3
|
-
"version": "4.5.0-alpha.
|
|
3
|
+
"version": "4.5.0-alpha.5",
|
|
4
4
|
"description": "The default blueprint for ember-cli addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
"start": "ember serve"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ember-data/canary-features": "4.5.0-alpha.
|
|
21
|
-
"@ember-data/private-build-infra": "4.5.0-alpha.
|
|
20
|
+
"@ember-data/canary-features": "4.5.0-alpha.5",
|
|
21
|
+
"@ember-data/private-build-infra": "4.5.0-alpha.5",
|
|
22
22
|
"@ember/string": "^3.0.0",
|
|
23
23
|
"@embroider/macros": "^1.2.0",
|
|
24
24
|
"@glimmer/tracking": "^1.0.4",
|
|
25
|
-
"ember-auto-import": "^2.2
|
|
25
|
+
"ember-auto-import": "^2.4.2",
|
|
26
26
|
"ember-cached-decorator-polyfill": "^0.1.4",
|
|
27
27
|
"ember-cli-babel": "^7.26.11",
|
|
28
28
|
"ember-cli-path-utils": "^1.0.0",
|
|
29
29
|
"ember-cli-typescript": "^5.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ember-data/unpublished-test-infra": "4.5.0-alpha.
|
|
32
|
+
"@ember-data/unpublished-test-infra": "4.5.0-alpha.5",
|
|
33
33
|
"@ember/optional-features": "^2.0.0",
|
|
34
|
-
"@ember/test-helpers": "
|
|
34
|
+
"@ember/test-helpers": "~2.7.0",
|
|
35
35
|
"@types/ember": "^4.0.0",
|
|
36
36
|
"@types/rsvp": "^4.0.4",
|
|
37
37
|
"broccoli-asset-rev": "^3.0.0",
|
|
38
|
-
"ember-cli": "~4.
|
|
38
|
+
"ember-cli": "~4.5.0",
|
|
39
39
|
"ember-cli-dependency-checker": "^3.3.1",
|
|
40
40
|
"ember-cli-htmlbars": "^6.0.1",
|
|
41
41
|
"ember-cli-inject-live-reload": "^2.0.2",
|
|
@@ -47,22 +47,23 @@
|
|
|
47
47
|
"ember-maybe-import-regenerator": "^1.0.0",
|
|
48
48
|
"ember-qunit": "^5.1.5",
|
|
49
49
|
"ember-resolver": "^8.0.3",
|
|
50
|
-
"ember-source": "~4.
|
|
50
|
+
"ember-source": "~4.5.0",
|
|
51
51
|
"ember-source-channel-url": "^3.0.0",
|
|
52
52
|
"ember-try": "^2.0.0",
|
|
53
53
|
"loader.js": "^4.7.0",
|
|
54
54
|
"qunit": "^2.17.0",
|
|
55
55
|
"qunit-dom": "^2.0.0",
|
|
56
|
-
"webpack": "^5.
|
|
56
|
+
"webpack": "^5.73.0"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
|
-
"node": "12.* || >= 14.*"
|
|
59
|
+
"node": "12.* || >= 14.*",
|
|
60
|
+
"yarn": "1.22.19"
|
|
60
61
|
},
|
|
61
62
|
"ember-addon": {
|
|
62
63
|
"configPath": "tests/dummy/config"
|
|
63
64
|
},
|
|
64
65
|
"volta": {
|
|
65
|
-
"node": "
|
|
66
|
-
"yarn": "1.22.
|
|
66
|
+
"node": "16.16.0",
|
|
67
|
+
"yarn": "1.22.19"
|
|
67
68
|
}
|
|
68
69
|
}
|