@ember-data/model 5.5.0-alpha.10 → 5.5.0-alpha.12
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/LICENSE.md +19 -7
- package/README.md +21 -2
- 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/dist/-private.js +3 -0
- package/{addon → dist}/-private.js.map +1 -1
- package/dist/has-many-DT3JBYYG.js +674 -0
- package/dist/has-many-DT3JBYYG.js.map +1 -0
- package/dist/hooks-CNY5g4Ab.js +75 -0
- package/dist/hooks-CNY5g4Ab.js.map +1 -0
- package/dist/hooks.js +2 -0
- package/{addon → dist}/hooks.js.map +1 -1
- package/dist/index.js +5 -0
- package/{addon → dist}/index.js.map +1 -1
- package/dist/migration-support.js +213 -0
- package/dist/migration-support.js.map +1 -0
- package/{addon/model-b8502183.js → dist/model-rk3atPqV.js} +2527 -2389
- package/dist/model-rk3atPqV.js.map +1 -0
- package/dist/schema-provider-Bvogtzx9.js +259 -0
- package/dist/schema-provider-Bvogtzx9.js.map +1 -0
- package/logos/NCC-1701-a-blue.svg +4 -0
- package/logos/NCC-1701-a-gold.svg +4 -0
- package/logos/NCC-1701-a-gold_100.svg +1 -0
- package/logos/NCC-1701-a-gold_base-64.txt +1 -0
- package/logos/NCC-1701-a.svg +4 -0
- package/logos/README.md +4 -0
- package/logos/docs-badge.svg +2 -0
- package/logos/ember-data-logo-dark.svg +12 -0
- package/logos/ember-data-logo-light.svg +12 -0
- package/logos/github-header.svg +444 -0
- package/logos/social1.png +0 -0
- package/logos/social2.png +0 -0
- package/logos/warp-drive-logo-dark.svg +4 -0
- package/logos/warp-drive-logo-gold.svg +4 -0
- package/package.json +64 -58
- package/unstable-preview-types/-private/attr.d.ts +175 -0
- package/unstable-preview-types/-private/attr.d.ts.map +1 -0
- package/unstable-preview-types/-private/attr.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/attr.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/belongs-to.d.ts +181 -0
- package/unstable-preview-types/-private/belongs-to.d.ts.map +1 -0
- package/unstable-preview-types/-private/belongs-to.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/belongs-to.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts +8 -0
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts.map +1 -0
- package/unstable-preview-types/-private/errors.d.ts +303 -0
- package/unstable-preview-types/-private/errors.d.ts.map +1 -0
- package/unstable-preview-types/-private/has-many.d.ts +169 -0
- package/unstable-preview-types/-private/has-many.d.ts.map +1 -0
- package/unstable-preview-types/-private/has-many.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/has-many.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/hooks.d.ts +13 -0
- package/unstable-preview-types/-private/hooks.d.ts.map +1 -0
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts +60 -0
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts.map +1 -0
- package/unstable-preview-types/-private/model-for-mixin.d.ts +6 -0
- package/unstable-preview-types/-private/model-for-mixin.d.ts.map +1 -0
- package/unstable-preview-types/-private/model-methods.d.ts +37 -0
- package/unstable-preview-types/-private/model-methods.d.ts.map +1 -0
- package/unstable-preview-types/-private/model.d.ts +1303 -0
- package/unstable-preview-types/-private/model.d.ts.map +1 -0
- package/unstable-preview-types/-private/model.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/model.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/notify-changes.d.ts +8 -0
- package/unstable-preview-types/-private/notify-changes.d.ts.map +1 -0
- package/unstable-preview-types/-private/promise-belongs-to.d.ts +46 -0
- package/unstable-preview-types/-private/promise-belongs-to.d.ts.map +1 -0
- package/unstable-preview-types/-private/promise-many-array.d.ts +131 -0
- package/unstable-preview-types/-private/promise-many-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/promise-proxy-base.d.ts +5 -0
- package/unstable-preview-types/-private/promise-proxy-base.d.ts.map +1 -0
- package/unstable-preview-types/-private/record-state.d.ts +80 -0
- package/unstable-preview-types/-private/record-state.d.ts.map +1 -0
- package/unstable-preview-types/-private/references/belongs-to.d.ts +503 -0
- package/unstable-preview-types/-private/references/belongs-to.d.ts.map +1 -0
- package/unstable-preview-types/-private/references/has-many.d.ts +515 -0
- package/unstable-preview-types/-private/references/has-many.d.ts.map +1 -0
- package/unstable-preview-types/-private/schema-provider.d.ts +65 -0
- package/unstable-preview-types/-private/schema-provider.d.ts.map +1 -0
- 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/util.d.ts +8 -0
- package/unstable-preview-types/-private/util.d.ts.map +1 -0
- package/unstable-preview-types/-private.d.ts +13 -0
- package/unstable-preview-types/-private.d.ts.map +1 -0
- package/unstable-preview-types/hooks.d.ts +5 -0
- package/unstable-preview-types/hooks.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +76 -0
- package/unstable-preview-types/index.d.ts.map +1 -0
- package/unstable-preview-types/migration-support.d.ts +64 -0
- package/unstable-preview-types/migration-support.d.ts.map +1 -0
- package/addon/-private.js +0 -2
- package/addon/has-many-7b6b78ec.js +0 -323
- package/addon/has-many-7b6b78ec.js.map +0 -1
- package/addon/hooks-cf42b319.js +0 -157
- package/addon/hooks-cf42b319.js.map +0 -1
- package/addon/hooks.js +0 -1
- package/addon/index.js +0 -3
- package/addon/model-b8502183.js.map +0 -1
- package/addon-main.js +0 -93
package/LICENSE.md
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Copyright (c) 2017-2025 Ember.js and contributors
|
|
4
|
+
Copyright (c) 2011-2017 Tilde, Inc. and contributors
|
|
5
|
+
Copyright (c) 2011 LivingSocial Inc.
|
|
6
6
|
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
8
13
|
|
|
9
|
-
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
10
16
|
|
|
11
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<img
|
|
3
3
|
class="project-logo"
|
|
4
|
-
src="./ember-data-logo-dark.svg#gh-dark-mode-only"
|
|
4
|
+
src="./logos/ember-data-logo-dark.svg#gh-dark-mode-only"
|
|
5
5
|
alt="EmberData Model"
|
|
6
6
|
width="240px"
|
|
7
7
|
title="EmberData Model"
|
|
8
8
|
/>
|
|
9
9
|
<img
|
|
10
10
|
class="project-logo"
|
|
11
|
-
src="./ember-data-logo-light.svg#gh-light-mode-only"
|
|
11
|
+
src="./logos/ember-data-logo-light.svg#gh-light-mode-only"
|
|
12
12
|
alt="EmberData Model"
|
|
13
13
|
width="240px"
|
|
14
14
|
title="EmberData Model"
|
|
15
15
|
/>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
+
<p align="center">Runtime Classes for use as a Schema Source and Resource Presentation for EmberData</p>
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
Install using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)
|
|
23
|
+
|
|
24
|
+
```no-highlight
|
|
25
|
+
pnpm add @ember-data/model
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Tagged Releases**
|
|
29
|
+
|
|
30
|
+
- 
|
|
31
|
+
- 
|
|
32
|
+
- 
|
|
33
|
+
- 
|
|
34
|
+
- 
|
|
35
|
+
|
|
36
|
+
|
|
18
37
|
<p align="center">Provides a Presentation Model for resource data in an EmberData Cache</p>
|
|
19
38
|
|
|
20
39
|
This package implements the EmberData Store's `instantiateRecord` and `teardownRecord` hooks
|
package/addon-main.cjs
ADDED
|
@@ -1,17 +1,28 @@
|
|
|
1
|
+
const path = require('path');
|
|
1
2
|
const EOL = require('os').EOL;
|
|
2
3
|
|
|
4
|
+
const { has } = require('@ember/edition-utils');
|
|
5
|
+
|
|
3
6
|
const inflection = require('inflection');
|
|
4
7
|
const stringUtils = require('ember-cli-string-utils');
|
|
5
|
-
const useEditionDetector = require('@ember-data/private-build-infra/src/utilities/edition-detector');
|
|
6
|
-
const { has } = require('@ember/edition-utils');
|
|
7
8
|
|
|
8
|
-
module.exports =
|
|
9
|
-
description: 'Generates an ember-data
|
|
9
|
+
module.exports = {
|
|
10
|
+
description: 'Generates an ember-data Model.',
|
|
10
11
|
|
|
11
12
|
anonymousOptions: ['name', 'attr:type'],
|
|
12
13
|
|
|
13
14
|
root: __dirname,
|
|
14
15
|
|
|
16
|
+
filesPath() {
|
|
17
|
+
let hasOctane = has('octane');
|
|
18
|
+
if (hasOctane && process.env.EMBER_EDITION === 'classic') {
|
|
19
|
+
hasOctane = false; //forcible override
|
|
20
|
+
}
|
|
21
|
+
let rootPath = hasOctane ? 'native-files' : 'files';
|
|
22
|
+
return path.join(__dirname, rootPath);
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
|
|
15
26
|
locals(options) {
|
|
16
27
|
let attrs = [];
|
|
17
28
|
let needs = [];
|
|
@@ -109,7 +120,7 @@ module.exports = useEditionDetector({
|
|
|
109
120
|
needs,
|
|
110
121
|
};
|
|
111
122
|
},
|
|
112
|
-
}
|
|
123
|
+
}
|
|
113
124
|
|
|
114
125
|
function nativeAttr(attr) {
|
|
115
126
|
let name = attr.name,
|
|
@@ -148,3 +159,5 @@ function classicAttr(attr) {
|
|
|
148
159
|
}
|
|
149
160
|
return propertyName + ': ' + result;
|
|
150
161
|
}
|
|
162
|
+
|
|
163
|
+
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
|
|
3
3
|
const testInfo = require('ember-cli-test-info');
|
|
4
|
-
const
|
|
5
|
-
const modulePrefixForProject = require('@ember-data/private-build-infra/src/utilities/module-prefix-for-project');
|
|
4
|
+
const { dasherize } = require('ember-cli-string-utils');
|
|
6
5
|
|
|
7
6
|
const ModelBlueprint = require('../model');
|
|
8
7
|
|
|
9
|
-
module.exports =
|
|
10
|
-
description: 'Generates
|
|
8
|
+
module.exports = {
|
|
9
|
+
description: 'Generates an EmberData Model unit test',
|
|
10
|
+
supportsAddon() { return false; },
|
|
11
11
|
|
|
12
12
|
root: __dirname,
|
|
13
13
|
|
|
14
|
-
fileMapTokens(
|
|
14
|
+
fileMapTokens() {
|
|
15
15
|
return {
|
|
16
16
|
__root__() {
|
|
17
17
|
return 'tests';
|
|
@@ -24,10 +24,16 @@ module.exports = useTestFrameworkDetector({
|
|
|
24
24
|
|
|
25
25
|
locals(options) {
|
|
26
26
|
const result = ModelBlueprint.locals.apply(this, arguments);
|
|
27
|
+
const modulePrefix = dasherize(options.project.config().modulePrefix);
|
|
28
|
+
return {
|
|
29
|
+
...result,
|
|
30
|
+
friendlyTestDescription: testInfo.description(options.entity.name, 'Unit', 'Model'),
|
|
31
|
+
modulePrefix,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
27
34
|
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
filesPath() {
|
|
36
|
+
return path.join(__dirname, 'qunit-files')
|
|
37
|
+
}
|
|
38
|
+
};
|
|
30
39
|
|
|
31
|
-
return result;
|
|
32
|
-
},
|
|
33
|
-
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { module, test } from 'qunit';
|
|
2
|
-
|
|
3
1
|
import { setupTest } from '<%= modulePrefix %>/tests/helpers';
|
|
2
|
+
import { module, test } from 'qunit';
|
|
4
3
|
|
|
5
4
|
module('<%= friendlyTestDescription %>', function (hooks) {
|
|
6
5
|
setupTest(hooks);
|
|
7
6
|
|
|
8
7
|
// Replace this with your real tests.
|
|
9
8
|
test('it exists', function (assert) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
assert.ok(model);
|
|
9
|
+
const store = this.owner.lookup('service:store');
|
|
10
|
+
const model = store.createRecord('<%= dasherizedModuleName %>', {});
|
|
11
|
+
assert.ok(model, 'model exists');
|
|
13
12
|
});
|
|
14
13
|
});
|
package/dist/-private.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { a as attr, b as belongsTo, h as hasMany } from "./has-many-DT3JBYYG.js";
|
|
2
|
+
export { E as Errors, L as LEGACY_SUPPORT, M as Model, P as PromiseBelongsTo, a as PromiseManyArray, l as lookupLegacySupport } from "./model-rk3atPqV.js";
|
|
3
|
+
export { RelatedCollection as ManyArray } from '@ember-data/store/-private';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"-private.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"-private.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|