@warp-drive/schema-record 5.4.0-alpha.142 → 5.4.0-alpha.144
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 -8
- package/README.md +2 -2
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- 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/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 +17 -18
- package/unstable-preview-types/-private/hooks.d.ts.map +1 -1
- package/unstable-preview-types/-private/schema.d.ts +7 -7
- package/unstable-preview-types/-private/schema.d.ts.map +1 -1
- /package/{NCC-1701-a-blue.svg → logos/NCC-1701-a-blue.svg} +0 -0
- /package/{NCC-1701-a.svg → logos/NCC-1701-a.svg} +0 -0
package/LICENSE.md
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (
|
|
4
|
-
Copyright (
|
|
5
|
-
|
|
6
|
-
Portions Copyright (C) 2011 LivingSocial Inc.
|
|
3
|
+
Copyright (c) 2017-2025 Ember.js and contributors
|
|
4
|
+
Copyright (c) 2011-2017 Tilde, Inc. and contributors
|
|
5
|
+
Copyright (c) 2011 LivingSocial Inc.
|
|
7
6
|
|
|
8
|
-
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:
|
|
9
13
|
|
|
10
|
-
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.
|
|
11
16
|
|
|
12
|
-
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,13 +1,13 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<img
|
|
3
3
|
class="project-logo"
|
|
4
|
-
src="./NCC-1701-a-blue.svg#gh-light-mode-only"
|
|
4
|
+
src="./logos/NCC-1701-a-blue.svg#gh-light-mode-only"
|
|
5
5
|
alt="WarpDrive"
|
|
6
6
|
width="120px"
|
|
7
7
|
title="WarpDrive" />
|
|
8
8
|
<img
|
|
9
9
|
class="project-logo"
|
|
10
|
-
src="./NCC-1701-a.svg#gh-dark-mode-only"
|
|
10
|
+
src="./logos/NCC-1701-a.svg#gh-dark-mode-only"
|
|
11
11
|
alt="WarpDrive"
|
|
12
12
|
width="120px"
|
|
13
13
|
title="WarpDrive" />
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isResourceSchema } from '@warp-drive/core-types/schema/fields';
|
|
1
2
|
import { macroCondition, getGlobalConfig, dependencySatisfies, importSync } from '@embroider/macros';
|
|
2
3
|
import { SOURCE as SOURCE$1, fastPush, RelatedCollection, setRecordIdentifier, recordIdentifierFor } from '@ember-data/store/-private';
|
|
3
4
|
import { createSignal, subscribe, defineSignal, peekSignal, getSignal, Signals, addToTransaction, entangleSignal } from '@ember-data/tracking/-private';
|
|
@@ -1328,7 +1329,13 @@ class SchemaRecord {
|
|
|
1328
1329
|
}
|
|
1329
1330
|
function instantiateRecord(store, identifier, createArgs) {
|
|
1330
1331
|
const schema = store.schema;
|
|
1331
|
-
const
|
|
1332
|
+
const resourceSchema = schema.resource(identifier);
|
|
1333
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1334
|
+
if (!test) {
|
|
1335
|
+
throw new Error(`Expected a resource schema`);
|
|
1336
|
+
}
|
|
1337
|
+
})(isResourceSchema(resourceSchema)) : {};
|
|
1338
|
+
const isLegacy = resourceSchema?.legacy ?? false;
|
|
1332
1339
|
const isEditable = isLegacy || store.cache.isNew(identifier);
|
|
1333
1340
|
const record = new SchemaRecord(store, identifier, {
|
|
1334
1341
|
[Editable]: isEditable,
|
|
@@ -1534,7 +1541,7 @@ class SchemaService {
|
|
|
1534
1541
|
relationships[field.name] = field;
|
|
1535
1542
|
}
|
|
1536
1543
|
});
|
|
1537
|
-
const traits = new Set(schema.traits);
|
|
1544
|
+
const traits = new Set(isResourceSchema(schema) ? schema.traits : []);
|
|
1538
1545
|
traits.forEach(trait => {
|
|
1539
1546
|
this._traits.add(trait);
|
|
1540
1547
|
});
|