@ember-data-mirror/serializer 5.4.0-alpha.129 → 5.4.0-alpha.131
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/dist/json-BwMH6O_R.js +2 -2
- package/dist/json-api.js +8 -8
- package/dist/rest.js +3 -3
- package/package.json +14 -14
package/dist/json-BwMH6O_R.js
CHANGED
|
@@ -477,7 +477,7 @@ const JSONSerializer = Serializer.extend({
|
|
|
477
477
|
};
|
|
478
478
|
const meta = this.extractMeta(store, primaryModelClass, payload);
|
|
479
479
|
if (meta) {
|
|
480
|
-
macroCondition(getGlobalConfig().
|
|
480
|
+
macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
|
|
481
481
|
if (!test) {
|
|
482
482
|
throw new Error('The `meta` returned from `extractMeta` has to be an object, not "' + typeof meta + '".');
|
|
483
483
|
}
|
|
@@ -1385,7 +1385,7 @@ const JSONSerializer = Serializer.extend({
|
|
|
1385
1385
|
*/
|
|
1386
1386
|
transformFor(attributeType, skipAssertion) {
|
|
1387
1387
|
const transform = getOwner(this).lookup('transform:' + attributeType);
|
|
1388
|
-
macroCondition(getGlobalConfig().
|
|
1388
|
+
macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
|
|
1389
1389
|
if (!test) {
|
|
1390
1390
|
throw new Error(`Unable to find the transform for \`attr('${attributeType}')\``);
|
|
1391
1391
|
}
|
package/dist/json-api.js
CHANGED
|
@@ -55,7 +55,7 @@ const JSONAPISerializer = JSONSerializer.extend({
|
|
|
55
55
|
@private
|
|
56
56
|
*/
|
|
57
57
|
_normalizeResourceHelper(resourceHash) {
|
|
58
|
-
macroCondition(getGlobalConfig().
|
|
58
|
+
macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
|
|
59
59
|
if (!test) {
|
|
60
60
|
throw new Error(this.warnMessageForUndefinedType());
|
|
61
61
|
}
|
|
@@ -104,7 +104,7 @@ const JSONAPISerializer = JSONSerializer.extend({
|
|
|
104
104
|
},
|
|
105
105
|
normalizeQueryRecordResponse() {
|
|
106
106
|
const normalized = this._super(...arguments);
|
|
107
|
-
macroCondition(getGlobalConfig().
|
|
107
|
+
macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
|
|
108
108
|
if (!test) {
|
|
109
109
|
throw new Error('Expected the primary data returned by the serializer for a `queryRecord` response to be a single object but instead it was an array.');
|
|
110
110
|
}
|
|
@@ -119,9 +119,9 @@ const JSONAPISerializer = JSONSerializer.extend({
|
|
|
119
119
|
if (resourceHash.attributes[attributeKey] !== undefined) {
|
|
120
120
|
attributes[key] = resourceHash.attributes[attributeKey];
|
|
121
121
|
}
|
|
122
|
-
if (macroCondition(getGlobalConfig().
|
|
122
|
+
if (macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG)) {
|
|
123
123
|
if (resourceHash.attributes[attributeKey] === undefined && resourceHash.attributes[key] !== undefined) {
|
|
124
|
-
macroCondition(getGlobalConfig().
|
|
124
|
+
macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
|
|
125
125
|
{
|
|
126
126
|
throw new Error(`Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${attributeKey}'. This is most likely because Ember Data's JSON API serializer dasherizes attribute keys by default. You should subclass JSONAPISerializer and implement 'keyForAttribute(key) { return key; }' to prevent Ember Data from customizing your attribute keys.`);
|
|
127
127
|
}
|
|
@@ -171,9 +171,9 @@ const JSONAPISerializer = JSONSerializer.extend({
|
|
|
171
171
|
const relationshipHash = resourceHash.relationships[relationshipKey];
|
|
172
172
|
relationships[key] = this.extractRelationship(relationshipHash);
|
|
173
173
|
}
|
|
174
|
-
if (macroCondition(getGlobalConfig().
|
|
174
|
+
if (macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG)) {
|
|
175
175
|
if (resourceHash.relationships[relationshipKey] === undefined && resourceHash.relationships[key] !== undefined) {
|
|
176
|
-
macroCondition(getGlobalConfig().
|
|
176
|
+
macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
|
|
177
177
|
{
|
|
178
178
|
throw new Error(`Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${relationshipKey}'. This is most likely because Ember Data's JSON API serializer dasherizes relationship keys by default. You should subclass JSONAPISerializer and implement 'keyForRelationship(key) { return key; }' to prevent Ember Data from customizing your relationship keys.`);
|
|
179
179
|
}
|
|
@@ -504,11 +504,11 @@ const JSONAPISerializer = JSONSerializer.extend({
|
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
|
-
if (macroCondition(getGlobalConfig().
|
|
507
|
+
if (macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG)) {
|
|
508
508
|
JSONAPISerializer.reopen({
|
|
509
509
|
init(...args) {
|
|
510
510
|
this._super(...args);
|
|
511
|
-
macroCondition(getGlobalConfig().
|
|
511
|
+
macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
|
|
512
512
|
if (!test) {
|
|
513
513
|
throw new Error(`You've used the EmbeddedRecordsMixin in ${this.toString()} which is not fully compatible with the JSON:API specification. Please confirm that this works for your specific API and add \`this.isEmbeddedRecordsMixinCompatible = true\` to your serializer.`);
|
|
514
514
|
}
|
package/dist/rest.js
CHANGED
|
@@ -783,7 +783,7 @@ const RESTSerializer = JSONSerializer.extend({
|
|
|
783
783
|
};
|
|
784
784
|
const meta = this.extractMeta(store, primaryModelClass, payload);
|
|
785
785
|
if (meta) {
|
|
786
|
-
macroCondition(getGlobalConfig().
|
|
786
|
+
macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
|
|
787
787
|
if (!test) {
|
|
788
788
|
throw new Error('The `meta` returned from `extractMeta` has to be an object, not "' + typeof meta + '".');
|
|
789
789
|
}
|
|
@@ -831,7 +831,7 @@ const RESTSerializer = JSONSerializer.extend({
|
|
|
831
831
|
if (value === null) {
|
|
832
832
|
continue;
|
|
833
833
|
}
|
|
834
|
-
macroCondition(getGlobalConfig().
|
|
834
|
+
macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
|
|
835
835
|
if (!test) {
|
|
836
836
|
throw new Error('The adapter returned an array for the primary data of a `queryRecord` response. `queryRecord` should return a single record.');
|
|
837
837
|
}
|
|
@@ -1260,7 +1260,7 @@ const RESTSerializer = JSONSerializer.extend({
|
|
|
1260
1260
|
return this._super(...arguments);
|
|
1261
1261
|
}
|
|
1262
1262
|
});
|
|
1263
|
-
if (macroCondition(getGlobalConfig().
|
|
1263
|
+
if (macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG)) {
|
|
1264
1264
|
RESTSerializer.reopen({
|
|
1265
1265
|
warnMessageNoModelForKey(prop, typeKey) {
|
|
1266
1266
|
return 'Encountered "' + prop + '" in payload, but no model was found for model name "' + typeKey + '" (resolved model name using ' + this.constructor.toString() + '.modelNameFromPayloadKey("' + prop + '"))';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data-mirror/serializer",
|
|
3
|
-
"version": "5.4.0-alpha.
|
|
3
|
+
"version": "5.4.0-alpha.131",
|
|
4
4
|
"description": "Provides Legacy JSON, JSON:API and REST Implementations of the Serializer Interface for use with @ember-data-mirror/store",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"ember-source": "3.28.12 || ^4.0.4 || ^5.0.0 || ^6.0.0",
|
|
44
|
-
"@warp-drive-mirror/core-types": "5.4.0-alpha.
|
|
45
|
-
"@ember-data-mirror/legacy-compat": "5.4.0-alpha.
|
|
46
|
-
"@ember-data-mirror/request-utils": "5.4.0-alpha.
|
|
47
|
-
"@ember-data-mirror/store": "5.4.0-alpha.
|
|
44
|
+
"@warp-drive-mirror/core-types": "5.4.0-alpha.131",
|
|
45
|
+
"@ember-data-mirror/legacy-compat": "5.4.0-alpha.131",
|
|
46
|
+
"@ember-data-mirror/request-utils": "5.4.0-alpha.131",
|
|
47
|
+
"@ember-data-mirror/store": "5.4.0-alpha.131"
|
|
48
48
|
},
|
|
49
49
|
"dependenciesMeta": {
|
|
50
50
|
"@warp-drive-mirror/core-types": {
|
|
@@ -78,23 +78,23 @@
|
|
|
78
78
|
"ember-cli-string-utils": "^1.1.0",
|
|
79
79
|
"ember-cli-path-utils": "^1.0.0",
|
|
80
80
|
"@ember/edition-utils": "1.2.0",
|
|
81
|
-
"@warp-drive-mirror/build-config": "5.4.0-alpha.
|
|
81
|
+
"@warp-drive-mirror/build-config": "5.4.0-alpha.131"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@babel/core": "^7.24.5",
|
|
85
85
|
"@babel/plugin-transform-typescript": "^7.24.5",
|
|
86
86
|
"@babel/preset-env": "^7.24.5",
|
|
87
87
|
"@babel/preset-typescript": "^7.24.1",
|
|
88
|
-
"@ember-data-mirror/model": "5.4.0-alpha.
|
|
89
|
-
"@ember-data-mirror/request": "5.4.0-alpha.
|
|
90
|
-
"@ember-data-mirror/request-utils": "5.4.0-alpha.
|
|
91
|
-
"@ember-data-mirror/store": "5.4.0-alpha.
|
|
92
|
-
"@ember-data-mirror/tracking": "5.4.0-alpha.
|
|
93
|
-
"@ember-data-mirror/legacy-compat": "5.4.0-alpha.
|
|
88
|
+
"@ember-data-mirror/model": "5.4.0-alpha.131",
|
|
89
|
+
"@ember-data-mirror/request": "5.4.0-alpha.131",
|
|
90
|
+
"@ember-data-mirror/request-utils": "5.4.0-alpha.131",
|
|
91
|
+
"@ember-data-mirror/store": "5.4.0-alpha.131",
|
|
92
|
+
"@ember-data-mirror/tracking": "5.4.0-alpha.131",
|
|
93
|
+
"@ember-data-mirror/legacy-compat": "5.4.0-alpha.131",
|
|
94
94
|
"@ember/test-waiters": "^3.1.0",
|
|
95
95
|
"@glimmer/component": "^1.1.2",
|
|
96
|
-
"@warp-drive-mirror/core-types": "5.4.0-alpha.
|
|
97
|
-
"@warp-drive/internal-config": "5.4.0-alpha.
|
|
96
|
+
"@warp-drive-mirror/core-types": "5.4.0-alpha.131",
|
|
97
|
+
"@warp-drive/internal-config": "5.4.0-alpha.131",
|
|
98
98
|
"decorator-transforms": "^2.2.2",
|
|
99
99
|
"ember-source": "~5.12.0",
|
|
100
100
|
"pnpm-sync-dependencies-meta-injected": "0.0.14",
|