@ember-data/serializer 4.12.8 → 4.13.0-alpha.3
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/README.md +11 -1
- package/addon-main.cjs +5 -0
- package/blueprints/serializer/index.js +71 -5
- package/blueprints/serializer-test/index.js +13 -7
- package/blueprints/serializer-test/qunit-files/__root__/__path__/__test__.js +8 -9
- package/blueprints/transform/index.js +14 -4
- package/blueprints/transform-test/index.js +13 -7
- package/blueprints/transform-test/qunit-files/__root__/__path__/__test__.js +3 -4
- package/dist/index.js +304 -0
- package/dist/index.js.map +1 -0
- package/{addon/json.js → dist/json-BwMH6O_R.js} +86 -65
- package/dist/json-BwMH6O_R.js.map +1 -0
- package/{addon → dist}/json-api.js +87 -187
- package/dist/json-api.js.map +1 -0
- package/dist/json.js +6 -0
- package/dist/json.js.map +1 -0
- package/dist/rest.js +1270 -0
- package/dist/rest.js.map +1 -0
- package/{addon/-private.js → dist/transform.js} +142 -22
- package/dist/transform.js.map +1 -0
- package/package.json +73 -35
- package/unstable-preview-types/-private/embedded-records-mixin.d.ts +102 -0
- package/unstable-preview-types/-private/embedded-records-mixin.d.ts.map +1 -0
- package/unstable-preview-types/-private/transforms/boolean.d.ts +52 -0
- package/unstable-preview-types/-private/transforms/boolean.d.ts.map +1 -0
- package/unstable-preview-types/-private/transforms/boolean.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/transforms/boolean.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/transforms/date.d.ts +33 -0
- package/unstable-preview-types/-private/transforms/date.d.ts.map +1 -0
- package/unstable-preview-types/-private/transforms/number.d.ts +34 -0
- package/unstable-preview-types/-private/transforms/number.d.ts.map +1 -0
- package/unstable-preview-types/-private/transforms/string.d.ts +34 -0
- package/unstable-preview-types/-private/transforms/string.d.ts.map +1 -0
- package/unstable-preview-types/-private/transforms/transform.d.ts +126 -0
- package/unstable-preview-types/-private/transforms/transform.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils.d.ts +6 -0
- package/unstable-preview-types/-private/utils.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +277 -0
- package/unstable-preview-types/index.d.ts.map +1 -0
- package/unstable-preview-types/json-api.d.ts +527 -0
- package/unstable-preview-types/json-api.d.ts.map +1 -0
- package/unstable-preview-types/json.d.ts +1093 -0
- package/unstable-preview-types/json.d.ts.map +1 -0
- package/unstable-preview-types/rest.d.ts +570 -0
- package/unstable-preview-types/rest.d.ts.map +1 -0
- package/unstable-preview-types/transform.d.ts +11 -0
- package/unstable-preview-types/transform.d.ts.map +1 -0
- package/addon/-private.js.map +0 -1
- package/addon/embedded-records-mixin-d75385ff.js +0 -575
- package/addon/embedded-records-mixin-d75385ff.js.map +0 -1
- package/addon/index.js +0 -180
- package/addon/index.js.map +0 -1
- package/addon/json-api.js.map +0 -1
- package/addon/json.js.map +0 -1
- package/addon/rest.js +0 -680
- package/addon/rest.js.map +0 -1
- package/addon/transform.js +0 -5
- package/addon/transform.js.map +0 -1
- package/addon-main.js +0 -93
- package/blueprints/serializer-test/mocha-files/__root__/__path__/__test__.js +0 -20
- package/blueprints/serializer-test/mocha-rfc-232-files/__root__/__path__/__test__.js +0 -25
- package/blueprints/transform-test/mocha-files/__root__/__path__/__test__.js +0 -17
- package/blueprints/transform-test/mocha-rfc-232-files/__root__/__path__/__test__.js +0 -14
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { getOwner } from '@ember/application';
|
|
2
|
-
import {
|
|
3
|
-
import { dasherize } from '@ember/string';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { warn } from '@ember/debug';
|
|
3
|
+
import { dasherize, singularize } from '@ember-data/request-utils/string';
|
|
4
|
+
import Serializer from "./index.js";
|
|
5
|
+
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
6
|
+
function coerceId(id) {
|
|
7
|
+
if (id === null || id === undefined || id === '') {
|
|
8
|
+
return null;
|
|
9
|
+
} else if (typeof id === 'string') {
|
|
10
|
+
return id;
|
|
11
|
+
} else if (typeof id === 'symbol') {
|
|
12
|
+
return id.toString();
|
|
13
|
+
} else {
|
|
14
|
+
return String(id);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
6
17
|
|
|
7
18
|
/**
|
|
8
19
|
* @module @ember-data/serializer/json
|
|
@@ -88,7 +99,7 @@ const PRIMARY_ATTRIBUTE_KEY = 'base';
|
|
|
88
99
|
@public
|
|
89
100
|
@extends Serializer
|
|
90
101
|
*/
|
|
91
|
-
const JSONSerializer =
|
|
102
|
+
const JSONSerializer = Serializer.extend({
|
|
92
103
|
/**
|
|
93
104
|
The `primaryKey` is used when serializing and deserializing
|
|
94
105
|
data. Ember Data always uses the `id` property to store the id of
|
|
@@ -176,13 +187,13 @@ const JSONSerializer = _class.extend({
|
|
|
176
187
|
@return {Object} data The transformed data object
|
|
177
188
|
*/
|
|
178
189
|
applyTransforms(typeClass, data) {
|
|
179
|
-
|
|
190
|
+
const attributes = typeClass.attributes;
|
|
180
191
|
typeClass.eachTransformedAttribute((key, typeClass) => {
|
|
181
192
|
if (data[key] === undefined) {
|
|
182
193
|
return;
|
|
183
194
|
}
|
|
184
|
-
|
|
185
|
-
|
|
195
|
+
const transform = this.transformFor(typeClass);
|
|
196
|
+
const transformMeta = attributes.get(key);
|
|
186
197
|
data[key] = transform.deserialize(data[key], transformMeta.options);
|
|
187
198
|
});
|
|
188
199
|
return data;
|
|
@@ -460,17 +471,21 @@ const JSONSerializer = _class.extend({
|
|
|
460
471
|
@private
|
|
461
472
|
*/
|
|
462
473
|
_normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {
|
|
463
|
-
|
|
474
|
+
const documentHash = {
|
|
464
475
|
data: null,
|
|
465
476
|
included: []
|
|
466
477
|
};
|
|
467
|
-
|
|
478
|
+
const meta = this.extractMeta(store, primaryModelClass, payload);
|
|
468
479
|
if (meta) {
|
|
469
|
-
|
|
480
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
481
|
+
if (!test) {
|
|
482
|
+
throw new Error('The `meta` returned from `extractMeta` has to be an object, not "' + typeof meta + '".');
|
|
483
|
+
}
|
|
484
|
+
})(typeof meta === 'object') : {};
|
|
470
485
|
documentHash.meta = meta;
|
|
471
486
|
}
|
|
472
487
|
if (isSingle) {
|
|
473
|
-
|
|
488
|
+
const {
|
|
474
489
|
data,
|
|
475
490
|
included
|
|
476
491
|
} = this.normalize(primaryModelClass, payload);
|
|
@@ -479,10 +494,10 @@ const JSONSerializer = _class.extend({
|
|
|
479
494
|
documentHash.included = included;
|
|
480
495
|
}
|
|
481
496
|
} else {
|
|
482
|
-
|
|
497
|
+
const ret = new Array(payload.length);
|
|
483
498
|
for (let i = 0, l = payload.length; i < l; i++) {
|
|
484
|
-
|
|
485
|
-
|
|
499
|
+
const item = payload[i];
|
|
500
|
+
const {
|
|
486
501
|
data,
|
|
487
502
|
included
|
|
488
503
|
} = this.normalize(primaryModelClass, item);
|
|
@@ -541,6 +556,9 @@ const JSONSerializer = _class.extend({
|
|
|
541
556
|
attributes: this.extractAttributes(modelClass, resourceHash),
|
|
542
557
|
relationships: this.extractRelationships(modelClass, resourceHash)
|
|
543
558
|
};
|
|
559
|
+
if (resourceHash.lid) {
|
|
560
|
+
data.lid = resourceHash.lid;
|
|
561
|
+
}
|
|
544
562
|
this.applyTransforms(modelClass, data.attributes);
|
|
545
563
|
}
|
|
546
564
|
return {
|
|
@@ -556,8 +574,8 @@ const JSONSerializer = _class.extend({
|
|
|
556
574
|
@return {String}
|
|
557
575
|
*/
|
|
558
576
|
extractId(modelClass, resourceHash) {
|
|
559
|
-
|
|
560
|
-
|
|
577
|
+
const primaryKey = this.primaryKey;
|
|
578
|
+
const id = resourceHash[primaryKey];
|
|
561
579
|
return coerceId(id);
|
|
562
580
|
},
|
|
563
581
|
/**
|
|
@@ -571,7 +589,7 @@ const JSONSerializer = _class.extend({
|
|
|
571
589
|
*/
|
|
572
590
|
extractAttributes(modelClass, resourceHash) {
|
|
573
591
|
let attributeKey;
|
|
574
|
-
|
|
592
|
+
const attributes = {};
|
|
575
593
|
modelClass.eachAttribute(key => {
|
|
576
594
|
attributeKey = this.keyForAttribute(key, 'deserialize');
|
|
577
595
|
if (resourceHash[attributeKey] !== undefined) {
|
|
@@ -602,7 +620,7 @@ const JSONSerializer = _class.extend({
|
|
|
602
620
|
if (relationshipHash.id) {
|
|
603
621
|
relationshipHash.id = coerceId(relationshipHash.id);
|
|
604
622
|
}
|
|
605
|
-
|
|
623
|
+
const modelClass = this.store.modelFor(relationshipModelName);
|
|
606
624
|
if (relationshipHash.type && !modelClass.fields.has('type')) {
|
|
607
625
|
relationshipHash.type = this.modelNameFromPayloadKey(relationshipHash.type);
|
|
608
626
|
}
|
|
@@ -610,7 +628,7 @@ const JSONSerializer = _class.extend({
|
|
|
610
628
|
}
|
|
611
629
|
return {
|
|
612
630
|
id: coerceId(relationshipHash),
|
|
613
|
-
type: relationshipModelName
|
|
631
|
+
type: dasherize(singularize(relationshipModelName))
|
|
614
632
|
};
|
|
615
633
|
},
|
|
616
634
|
/**
|
|
@@ -643,13 +661,13 @@ const JSONSerializer = _class.extend({
|
|
|
643
661
|
@return {Object}
|
|
644
662
|
*/
|
|
645
663
|
extractRelationships(modelClass, resourceHash) {
|
|
646
|
-
|
|
664
|
+
const relationships = {};
|
|
647
665
|
modelClass.eachRelationship((key, relationshipMeta) => {
|
|
648
666
|
let relationship = null;
|
|
649
|
-
|
|
667
|
+
const relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');
|
|
650
668
|
if (resourceHash[relationshipKey] !== undefined) {
|
|
651
669
|
let data = null;
|
|
652
|
-
|
|
670
|
+
const relationshipHash = resourceHash[relationshipKey];
|
|
653
671
|
if (relationshipMeta.kind === 'belongsTo') {
|
|
654
672
|
if (relationshipMeta.options.polymorphic) {
|
|
655
673
|
// extracting a polymorphic belongsTo may need more information
|
|
@@ -669,7 +687,7 @@ const JSONSerializer = _class.extend({
|
|
|
669
687
|
data = new Array(relationshipHash.length);
|
|
670
688
|
if (relationshipMeta.options.polymorphic) {
|
|
671
689
|
for (let i = 0, l = relationshipHash.length; i < l; i++) {
|
|
672
|
-
|
|
690
|
+
const item = relationshipHash[i];
|
|
673
691
|
data[i] = this.extractPolymorphicRelationship(relationshipMeta.type, item, {
|
|
674
692
|
key,
|
|
675
693
|
resourceHash,
|
|
@@ -678,7 +696,7 @@ const JSONSerializer = _class.extend({
|
|
|
678
696
|
}
|
|
679
697
|
} else {
|
|
680
698
|
for (let i = 0, l = relationshipHash.length; i < l; i++) {
|
|
681
|
-
|
|
699
|
+
const item = relationshipHash[i];
|
|
682
700
|
data[i] = this.extractRelationship(relationshipMeta.type, item);
|
|
683
701
|
}
|
|
684
702
|
}
|
|
@@ -688,9 +706,9 @@ const JSONSerializer = _class.extend({
|
|
|
688
706
|
data
|
|
689
707
|
};
|
|
690
708
|
}
|
|
691
|
-
|
|
709
|
+
const linkKey = this.keyForLink(key, relationshipMeta.kind);
|
|
692
710
|
if (resourceHash.links && resourceHash.links[linkKey] !== undefined) {
|
|
693
|
-
|
|
711
|
+
const related = resourceHash.links[linkKey];
|
|
694
712
|
relationship = relationship || {};
|
|
695
713
|
relationship.links = {
|
|
696
714
|
related
|
|
@@ -710,7 +728,7 @@ const JSONSerializer = _class.extend({
|
|
|
710
728
|
@return {String} the model's modelName
|
|
711
729
|
*/
|
|
712
730
|
modelNameFromPayloadKey(key) {
|
|
713
|
-
return dasherize(key);
|
|
731
|
+
return dasherize(singularize(key));
|
|
714
732
|
},
|
|
715
733
|
/**
|
|
716
734
|
@method normalizeRelationships
|
|
@@ -737,11 +755,11 @@ const JSONSerializer = _class.extend({
|
|
|
737
755
|
@private
|
|
738
756
|
*/
|
|
739
757
|
normalizeUsingDeclaredMapping(modelClass, hash) {
|
|
740
|
-
|
|
758
|
+
const attrs = this.attrs;
|
|
741
759
|
let normalizedKey;
|
|
742
760
|
let payloadKey;
|
|
743
761
|
if (attrs) {
|
|
744
|
-
for (
|
|
762
|
+
for (const key in attrs) {
|
|
745
763
|
normalizedKey = payloadKey = this._getMappedKey(key, modelClass);
|
|
746
764
|
if (hash[payloadKey] === undefined) {
|
|
747
765
|
continue;
|
|
@@ -771,7 +789,7 @@ const JSONSerializer = _class.extend({
|
|
|
771
789
|
warn('There is no attribute or relationship with the name `' + key + '` on `' + modelClass.modelName + '`. Check your serializers attrs hash.', modelClass.attributes.has(key) || modelClass.relationshipsByName.has(key), {
|
|
772
790
|
id: 'ds.serializer.no-mapped-attrs-key'
|
|
773
791
|
});
|
|
774
|
-
|
|
792
|
+
const attrs = this.attrs;
|
|
775
793
|
let mappedKey;
|
|
776
794
|
if (attrs && attrs[key]) {
|
|
777
795
|
mappedKey = attrs[key];
|
|
@@ -795,7 +813,7 @@ const JSONSerializer = _class.extend({
|
|
|
795
813
|
@return {boolean} true if the key can be serialized
|
|
796
814
|
*/
|
|
797
815
|
_canSerialize(key) {
|
|
798
|
-
|
|
816
|
+
const attrs = this.attrs;
|
|
799
817
|
return !attrs || !attrs[key] || attrs[key].serialize !== false;
|
|
800
818
|
},
|
|
801
819
|
/**
|
|
@@ -808,7 +826,7 @@ const JSONSerializer = _class.extend({
|
|
|
808
826
|
@return {boolean} true if the key must be serialized
|
|
809
827
|
*/
|
|
810
828
|
_mustSerialize(key) {
|
|
811
|
-
|
|
829
|
+
const attrs = this.attrs;
|
|
812
830
|
return attrs && attrs[key] && attrs[key].serialize === true;
|
|
813
831
|
},
|
|
814
832
|
/**
|
|
@@ -819,12 +837,12 @@ const JSONSerializer = _class.extend({
|
|
|
819
837
|
@public
|
|
820
838
|
@param {Snapshot} snapshot
|
|
821
839
|
@param {String} key
|
|
822
|
-
@param {
|
|
840
|
+
@param {RelationshipSchema} relationship
|
|
823
841
|
@return {boolean} true if the hasMany relationship should be serialized
|
|
824
842
|
*/
|
|
825
843
|
shouldSerializeHasMany(snapshot, key, relationship) {
|
|
826
844
|
const schema = this.store.modelFor(snapshot.modelName);
|
|
827
|
-
|
|
845
|
+
const relationshipType = schema.determineRelationshipType(relationship, this.store);
|
|
828
846
|
if (this._mustSerialize(key)) {
|
|
829
847
|
return true;
|
|
830
848
|
}
|
|
@@ -947,7 +965,7 @@ const JSONSerializer = _class.extend({
|
|
|
947
965
|
@return {Object} json
|
|
948
966
|
*/
|
|
949
967
|
serialize(snapshot, options) {
|
|
950
|
-
|
|
968
|
+
const json = {};
|
|
951
969
|
if (options && options.includeId) {
|
|
952
970
|
const id = snapshot.id;
|
|
953
971
|
if (id) {
|
|
@@ -976,10 +994,10 @@ const JSONSerializer = _class.extend({
|
|
|
976
994
|
For example, your server may expect underscored root objects.
|
|
977
995
|
```app/serializers/application.js
|
|
978
996
|
import RESTSerializer from '@ember-data/serializer/rest';
|
|
979
|
-
import {
|
|
997
|
+
import { underscoren} from '<app-name>/utils/string-utils';
|
|
980
998
|
export default class ApplicationSerializer extends RESTSerializer {
|
|
981
999
|
serializeIntoHash(data, type, snapshot, options) {
|
|
982
|
-
let root =
|
|
1000
|
+
let root = underscore(type.modelName);
|
|
983
1001
|
data[root] = this.serialize(snapshot, options);
|
|
984
1002
|
}
|
|
985
1003
|
}
|
|
@@ -1018,16 +1036,16 @@ const JSONSerializer = _class.extend({
|
|
|
1018
1036
|
*/
|
|
1019
1037
|
serializeAttribute(snapshot, json, key, attribute) {
|
|
1020
1038
|
if (this._canSerialize(key)) {
|
|
1021
|
-
|
|
1039
|
+
const type = attribute.type;
|
|
1022
1040
|
let value = snapshot.attr(key);
|
|
1023
1041
|
if (type) {
|
|
1024
|
-
|
|
1042
|
+
const transform = this.transformFor(type);
|
|
1025
1043
|
value = transform.serialize(value, attribute.options);
|
|
1026
1044
|
}
|
|
1027
1045
|
|
|
1028
1046
|
// if provided, use the mapping provided by `attrs` in
|
|
1029
1047
|
// the serializer
|
|
1030
|
-
|
|
1048
|
+
const schema = this.store.modelFor(snapshot.modelName);
|
|
1031
1049
|
let payloadKey = this._getMappedKey(key, schema);
|
|
1032
1050
|
if (payloadKey === key && this.keyForAttribute) {
|
|
1033
1051
|
payloadKey = this.keyForAttribute(key, 'serialize');
|
|
@@ -1043,7 +1061,7 @@ const JSONSerializer = _class.extend({
|
|
|
1043
1061
|
import JSONSerializer from '@ember-data/serializer/json';
|
|
1044
1062
|
export default class PostSerializer extends JSONSerializer {
|
|
1045
1063
|
serializeBelongsTo(snapshot, json, relationship) {
|
|
1046
|
-
let key = relationship.
|
|
1064
|
+
let key = relationship.name;
|
|
1047
1065
|
let belongsTo = snapshot.belongsTo(key);
|
|
1048
1066
|
key = this.keyForRelationship ? this.keyForRelationship(key, "belongsTo", "serialize") : key;
|
|
1049
1067
|
json[key] = !belongsTo ? null : belongsTo.record.toJSON();
|
|
@@ -1057,18 +1075,18 @@ const JSONSerializer = _class.extend({
|
|
|
1057
1075
|
@param {Object} relationship
|
|
1058
1076
|
*/
|
|
1059
1077
|
serializeBelongsTo(snapshot, json, relationship) {
|
|
1060
|
-
|
|
1061
|
-
if (this._canSerialize(
|
|
1062
|
-
|
|
1078
|
+
const name = relationship.name;
|
|
1079
|
+
if (this._canSerialize(name)) {
|
|
1080
|
+
const belongsToId = snapshot.belongsTo(name, {
|
|
1063
1081
|
id: true
|
|
1064
1082
|
});
|
|
1065
1083
|
|
|
1066
1084
|
// if provided, use the mapping provided by `attrs` in
|
|
1067
1085
|
// the serializer
|
|
1068
|
-
|
|
1069
|
-
let payloadKey = this._getMappedKey(
|
|
1070
|
-
if (payloadKey ===
|
|
1071
|
-
payloadKey = this.keyForRelationship(
|
|
1086
|
+
const schema = this.store.modelFor(snapshot.modelName);
|
|
1087
|
+
let payloadKey = this._getMappedKey(name, schema);
|
|
1088
|
+
if (payloadKey === name && this.keyForRelationship) {
|
|
1089
|
+
payloadKey = this.keyForRelationship(name, 'belongsTo', 'serialize');
|
|
1072
1090
|
}
|
|
1073
1091
|
|
|
1074
1092
|
//Need to check whether the id is there for new&async records
|
|
@@ -1090,7 +1108,7 @@ const JSONSerializer = _class.extend({
|
|
|
1090
1108
|
import JSONSerializer from '@ember-data/serializer/json';
|
|
1091
1109
|
export default class PostSerializer extends JSONSerializer {
|
|
1092
1110
|
serializeHasMany(snapshot, json, relationship) {
|
|
1093
|
-
let key = relationship.
|
|
1111
|
+
let key = relationship.name;
|
|
1094
1112
|
if (key === 'comments') {
|
|
1095
1113
|
return;
|
|
1096
1114
|
} else {
|
|
@@ -1106,25 +1124,24 @@ const JSONSerializer = _class.extend({
|
|
|
1106
1124
|
@param {Object} relationship
|
|
1107
1125
|
*/
|
|
1108
1126
|
serializeHasMany(snapshot, json, relationship) {
|
|
1109
|
-
|
|
1110
|
-
if (this.shouldSerializeHasMany(snapshot,
|
|
1111
|
-
|
|
1127
|
+
const name = relationship.name;
|
|
1128
|
+
if (this.shouldSerializeHasMany(snapshot, name, relationship)) {
|
|
1129
|
+
const hasMany = snapshot.hasMany(name, {
|
|
1112
1130
|
ids: true
|
|
1113
1131
|
});
|
|
1114
1132
|
if (hasMany !== undefined) {
|
|
1115
1133
|
// if provided, use the mapping provided by `attrs` in
|
|
1116
1134
|
// the serializer
|
|
1117
|
-
|
|
1118
|
-
let payloadKey = this._getMappedKey(
|
|
1119
|
-
if (payloadKey ===
|
|
1120
|
-
payloadKey = this.keyForRelationship(
|
|
1135
|
+
const schema = this.store.modelFor(snapshot.modelName);
|
|
1136
|
+
let payloadKey = this._getMappedKey(name, schema);
|
|
1137
|
+
if (payloadKey === name && this.keyForRelationship) {
|
|
1138
|
+
payloadKey = this.keyForRelationship(name, 'hasMany', 'serialize');
|
|
1121
1139
|
}
|
|
1122
1140
|
json[payloadKey] = hasMany;
|
|
1123
1141
|
// TODO support for polymorphic manyToNone and manyToMany relationships
|
|
1124
1142
|
}
|
|
1125
1143
|
}
|
|
1126
1144
|
},
|
|
1127
|
-
|
|
1128
1145
|
/**
|
|
1129
1146
|
You can use this method to customize how polymorphic objects are
|
|
1130
1147
|
serialized. Objects are considered to be polymorphic if
|
|
@@ -1135,7 +1152,7 @@ const JSONSerializer = _class.extend({
|
|
|
1135
1152
|
import JSONSerializer from '@ember-data/serializer/json';
|
|
1136
1153
|
export default class CommentSerializer extends JSONSerializer {
|
|
1137
1154
|
serializePolymorphicType(snapshot, json, relationship) {
|
|
1138
|
-
let key = relationship.
|
|
1155
|
+
let key = relationship.name;
|
|
1139
1156
|
let belongsTo = snapshot.belongsTo(key);
|
|
1140
1157
|
key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;
|
|
1141
1158
|
if (!belongsTo) {
|
|
@@ -1178,7 +1195,7 @@ const JSONSerializer = _class.extend({
|
|
|
1178
1195
|
*/
|
|
1179
1196
|
extractMeta(store, modelClass, payload) {
|
|
1180
1197
|
if (payload && payload['meta'] !== undefined) {
|
|
1181
|
-
|
|
1198
|
+
const meta = payload.meta;
|
|
1182
1199
|
delete payload.meta;
|
|
1183
1200
|
return meta;
|
|
1184
1201
|
}
|
|
@@ -1282,14 +1299,14 @@ const JSONSerializer = _class.extend({
|
|
|
1282
1299
|
// for each attr and relationship, make sure that we use
|
|
1283
1300
|
// the normalized key
|
|
1284
1301
|
typeClass.eachAttribute(name => {
|
|
1285
|
-
|
|
1302
|
+
const key = this.keyForAttribute(name, 'deserialize');
|
|
1286
1303
|
if (key !== name && extracted[key] !== undefined) {
|
|
1287
1304
|
extracted[name] = extracted[key];
|
|
1288
1305
|
delete extracted[key];
|
|
1289
1306
|
}
|
|
1290
1307
|
});
|
|
1291
1308
|
typeClass.eachRelationship(name => {
|
|
1292
|
-
|
|
1309
|
+
const key = this.keyForRelationship(name, 'deserialize');
|
|
1293
1310
|
if (key !== name && extracted[key] !== undefined) {
|
|
1294
1311
|
extracted[name] = extracted[key];
|
|
1295
1312
|
delete extracted[key];
|
|
@@ -1367,9 +1384,13 @@ const JSONSerializer = _class.extend({
|
|
|
1367
1384
|
@return {Transform} transform
|
|
1368
1385
|
*/
|
|
1369
1386
|
transformFor(attributeType, skipAssertion) {
|
|
1370
|
-
|
|
1371
|
-
|
|
1387
|
+
const transform = getOwner(this).lookup('transform:' + attributeType);
|
|
1388
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1389
|
+
if (!test) {
|
|
1390
|
+
throw new Error(`Unable to find the transform for \`attr('${attributeType}')\``);
|
|
1391
|
+
}
|
|
1392
|
+
})(skipAssertion || !!transform) : {};
|
|
1372
1393
|
return transform;
|
|
1373
1394
|
}
|
|
1374
1395
|
});
|
|
1375
|
-
export { JSONSerializer as
|
|
1396
|
+
export { JSONSerializer as J, coerceId as c };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-BwMH6O_R.js","sources":["../src/-private/utils.ts","../src/json.js"],"sourcesContent":["type Coercable = string | number | boolean | null | undefined | symbol;\n\nexport function coerceId(id: Coercable): string | null {\n if (id === null || id === undefined || id === '') {\n return null;\n } else if (typeof id === 'string') {\n return id;\n } else if (typeof id === 'symbol') {\n return id.toString();\n } else {\n return String(id);\n }\n}\n","/**\n * @module @ember-data/serializer/json\n */\nimport { getOwner } from '@ember/application';\nimport { warn } from '@ember/debug';\n\nimport { dasherize, singularize } from '@ember-data/request-utils/string';\nimport { assert } from '@warp-drive/build-config/macros';\n\nimport Serializer from '.';\nimport { coerceId } from './-private/utils';\n\nconst SOURCE_POINTER_REGEXP = /^\\/?data\\/(attributes|relationships)\\/(.*)/;\nconst SOURCE_POINTER_PRIMARY_REGEXP = /^\\/?data/;\nconst PRIMARY_ATTRIBUTE_KEY = 'base';\n\n/**\n * <blockquote style=\"margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;\">\n <p>\n ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n <a href=\"/ember-data/release/classes/%3CInterface%3E%20Handler\">Handler</a> instead to be used with the <a href=\"https://github.com/emberjs/data/tree/main/packages/request#readme\">RequestManager</a>\n </p>\n </blockquote>\n\n In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.\n\n By default, EmberData uses and recommends the `JSONAPISerializer`.\n\n `JSONSerializer` is useful for simpler or legacy backends that may\n not support the http://jsonapi.org/ spec.\n\n For example, given the following `User` model and JSON payload:\n\n ```app/models/user.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @hasMany('user') friends;\n @belongsTo('location') house;\n\n @attr('string') name;\n }\n ```\n\n ```js\n {\n id: 1,\n name: 'Sebastian',\n friends: [3, 4],\n links: {\n house: '/houses/lefkada'\n }\n }\n ```\n\n `JSONSerializer` will normalize the JSON payload to the JSON API format that the\n Ember Data store expects.\n\n You can customize how JSONSerializer processes its payload by passing options in\n the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks:\n\n - To customize how a single record is normalized, use the `normalize` hook.\n - To customize how `JSONSerializer` normalizes the whole server response, use the\n `normalizeResponse` hook.\n - To customize how `JSONSerializer` normalizes a specific response from the server,\n use one of the many specific `normalizeResponse` hooks.\n - To customize how `JSONSerializer` normalizes your id, attributes or relationships,\n use the `extractId`, `extractAttributes` and `extractRelationships` hooks.\n\n The `JSONSerializer` normalization process follows these steps:\n\n 1. `normalizeResponse`\n - entry method to the serializer.\n 2. `normalizeCreateRecordResponse`\n - a `normalizeResponse` for a specific operation is called.\n 3. `normalizeSingleResponse`|`normalizeArrayResponse`\n - for methods like `createRecord` we expect a single record back, while for methods like `findAll` we expect multiple records back.\n 4. `normalize`\n - `normalizeArrayResponse` iterates and calls `normalize` for each of its records while `normalizeSingle`\n calls it once. This is the method you most likely want to subclass.\n 5. `extractId` | `extractAttributes` | `extractRelationships`\n - `normalize` delegates to these methods to\n turn the record payload into the JSON API format.\n\n @main @ember-data/serializer/json\n @class JSONSerializer\n @public\n @extends Serializer\n*/\nconst JSONSerializer = Serializer.extend({\n /**\n The `primaryKey` is used when serializing and deserializing\n data. Ember Data always uses the `id` property to store the id of\n the record. The external source may not always follow this\n convention. In these cases it is useful to override the\n `primaryKey` property to match the `primaryKey` of your external\n store.\n\n Example\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class ApplicationSerializer extends JSONSerializer {\n primaryKey = '_id'\n }\n ```\n\n @property primaryKey\n @type {String}\n @public\n @default 'id'\n */\n primaryKey: 'id',\n\n /**\n The `attrs` object can be used to declare a simple mapping between\n property names on `Model` records and payload keys in the\n serialized JSON object representing the record. An object with the\n property `key` can also be used to designate the attribute's key on\n the response payload.\n\n Example\n\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('string') occupation;\n @attr('boolean') admin;\n }\n ```\n\n ```app/serializers/person.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PersonSerializer extends JSONSerializer {\n attrs = {\n admin: 'is_admin',\n occupation: { key: 'career' }\n }\n }\n ```\n\n You can also remove attributes and relationships by setting the `serialize`\n key to `false` in your mapping object.\n\n Example\n\n ```app/serializers/person.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n attrs = {\n admin: { serialize: false },\n occupation: { key: 'career' }\n }\n }\n ```\n\n When serialized:\n\n ```javascript\n {\n \"firstName\": \"Harry\",\n \"lastName\": \"Houdini\",\n \"career\": \"magician\"\n }\n ```\n\n Note that the `admin` is now not included in the payload.\n\n Setting `serialize` to `true` enforces serialization for hasMany\n relationships even if it's neither a many-to-many nor many-to-none\n relationship.\n\n @property attrs\n @public\n @type {Object}\n */\n mergedProperties: ['attrs'],\n\n /**\n Given a subclass of `Model` and a JSON object this method will\n iterate through each attribute of the `Model` and invoke the\n `Transform#deserialize` method on the matching property of the\n JSON object. This method is typically called after the\n serializer's `normalize` method.\n\n @method applyTransforms\n @private\n @param {Model} typeClass\n @param {Object} data The data to transform\n @return {Object} data The transformed data object\n */\n applyTransforms(typeClass, data) {\n const attributes = typeClass.attributes;\n\n typeClass.eachTransformedAttribute((key, typeClass) => {\n if (data[key] === undefined) {\n return;\n }\n\n const transform = this.transformFor(typeClass);\n const transformMeta = attributes.get(key);\n data[key] = transform.deserialize(data[key], transformMeta.options);\n });\n\n return data;\n },\n\n /**\n The `normalizeResponse` method is used to normalize a payload from the\n server to a JSON-API Document.\n\n http://jsonapi.org/format/#document-structure\n\n This method delegates to a more specific normalize method based on\n the `requestType`.\n\n To override this method with a custom one, make sure to call\n `return super.normalizeResponse(store, primaryModelClass, payload, id, requestType)` with your\n pre-processed data.\n\n Here's an example of using `normalizeResponse` manually:\n\n ```javascript\n socket.on('message', function(message) {\n let data = message.data;\n let modelClass = store.modelFor(data.modelName);\n let serializer = store.serializerFor(data.modelName);\n let normalized = serializer.normalizeSingleResponse(store, modelClass, data, data.id);\n\n store.push(normalized);\n });\n ```\n\n @since 1.13.0\n @method normalizeResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n switch (requestType) {\n case 'findRecord':\n return this.normalizeFindRecordResponse(...arguments);\n case 'queryRecord':\n return this.normalizeQueryRecordResponse(...arguments);\n case 'findAll':\n return this.normalizeFindAllResponse(...arguments);\n case 'findBelongsTo':\n return this.normalizeFindBelongsToResponse(...arguments);\n case 'findHasMany':\n return this.normalizeFindHasManyResponse(...arguments);\n case 'findMany':\n return this.normalizeFindManyResponse(...arguments);\n case 'query':\n return this.normalizeQueryResponse(...arguments);\n case 'createRecord':\n return this.normalizeCreateRecordResponse(...arguments);\n case 'deleteRecord':\n return this.normalizeDeleteRecordResponse(...arguments);\n case 'updateRecord':\n return this.normalizeUpdateRecordResponse(...arguments);\n }\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findRecord`\n\n @since 1.13.0\n @method normalizeFindRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `queryRecord`\n\n @since 1.13.0\n @method normalizeQueryRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeQueryRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findAll`\n\n @since 1.13.0\n @method normalizeFindAllResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindAllResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findBelongsTo`\n\n @since 1.13.0\n @method normalizeFindBelongsToResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindBelongsToResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findHasMany`\n\n @since 1.13.0\n @method normalizeFindHasManyResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindHasManyResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findMany`\n\n @since 1.13.0\n @method normalizeFindManyResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindManyResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `query`\n\n @since 1.13.0\n @method normalizeQueryResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeQueryResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `createRecord`\n\n @since 1.13.0\n @method normalizeCreateRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeCreateRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSaveResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `deleteRecord`\n\n @since 1.13.0\n @method normalizeDeleteRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeDeleteRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSaveResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `updateRecord`\n\n @since 1.13.0\n @method normalizeUpdateRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeUpdateRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSaveResponse(...arguments);\n },\n\n /**\n normalizeUpdateRecordResponse, normalizeCreateRecordResponse and\n normalizeDeleteRecordResponse delegate to this method by default.\n\n @since 1.13.0\n @method normalizeSaveResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeSaveResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n\n /**\n normalizeQueryResponse and normalizeFindRecordResponse delegate to this\n method by default.\n\n @since 1.13.0\n @method normalizeSingleResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeSingleResponse(store, primaryModelClass, payload, id, requestType) {\n return this._normalizeResponse(store, primaryModelClass, payload, id, requestType, true);\n },\n\n /**\n normalizeQueryResponse, normalizeFindManyResponse, and normalizeFindHasManyResponse delegate\n to this method by default.\n\n @since 1.13.0\n @method normalizeArrayResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n return this._normalizeResponse(store, primaryModelClass, payload, id, requestType, false);\n },\n\n /**\n @method _normalizeResponse\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @param {Boolean} isSingle\n @return {Object} JSON-API Document\n @private\n */\n _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {\n const documentHash = {\n data: null,\n included: [],\n };\n\n const meta = this.extractMeta(store, primaryModelClass, payload);\n if (meta) {\n assert(\n 'The `meta` returned from `extractMeta` has to be an object, not \"' + typeof meta + '\".',\n typeof meta === 'object'\n );\n documentHash.meta = meta;\n }\n\n if (isSingle) {\n const { data, included } = this.normalize(primaryModelClass, payload);\n documentHash.data = data;\n if (included) {\n documentHash.included = included;\n }\n } else {\n const ret = new Array(payload.length);\n for (let i = 0, l = payload.length; i < l; i++) {\n const item = payload[i];\n const { data, included } = this.normalize(primaryModelClass, item);\n if (included) {\n documentHash.included = documentHash.included.concat(included);\n }\n ret[i] = data;\n }\n\n documentHash.data = ret;\n }\n\n return documentHash;\n },\n\n /**\n Normalizes a part of the JSON payload returned by\n the server. You should override this method, munge the hash\n and call super if you have generic normalization to do.\n\n It takes the type of the record that is being normalized\n (as a Model class), the property where the hash was\n originally found, and the hash to normalize.\n\n You can use this method, for example, to normalize underscored keys to camelized\n or other general-purpose normalizations.\n\n Example\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '<app-name>/utils/string-utils';\n import { get } from '@ember/object';\n\n export default class ApplicationSerializer extends JSONSerializer {\n normalize(typeClass, hash) {\n let fields = typeClass.fields;\n\n fields.forEach(function(type, field) {\n let payloadField = underscore(field);\n if (field === payloadField) { return; }\n\n hash[field] = hash[payloadField];\n delete hash[payloadField];\n });\n\n return super.normalize(...arguments);\n }\n }\n ```\n\n @method normalize\n @public\n @param {Model} typeClass\n @param {Object} hash\n @return {Object}\n */\n normalize(modelClass, resourceHash) {\n let data = null;\n\n if (resourceHash) {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash);\n if (typeof resourceHash.links === 'object') {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash.links);\n }\n\n data = {\n id: this.extractId(modelClass, resourceHash),\n type: modelClass.modelName,\n attributes: this.extractAttributes(modelClass, resourceHash),\n relationships: this.extractRelationships(modelClass, resourceHash),\n };\n\n if (resourceHash.lid) {\n data.lid = resourceHash.lid;\n }\n\n this.applyTransforms(modelClass, data.attributes);\n }\n\n return { data };\n },\n\n /**\n Returns the resource's ID.\n\n @method extractId\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {String}\n */\n extractId(modelClass, resourceHash) {\n const primaryKey = this.primaryKey;\n const id = resourceHash[primaryKey];\n return coerceId(id);\n },\n\n /**\n Returns the resource's attributes formatted as a JSON-API \"attributes object\".\n\n http://jsonapi.org/format/#document-resource-object-attributes\n\n @method extractAttributes\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {Object}\n */\n extractAttributes(modelClass, resourceHash) {\n let attributeKey;\n const attributes = {};\n\n modelClass.eachAttribute((key) => {\n attributeKey = this.keyForAttribute(key, 'deserialize');\n if (resourceHash[attributeKey] !== undefined) {\n attributes[key] = resourceHash[attributeKey];\n }\n });\n\n return attributes;\n },\n\n /**\n Returns a relationship formatted as a JSON-API \"relationship object\".\n\n http://jsonapi.org/format/#document-resource-object-relationships\n\n @method extractRelationship\n @public\n @param {Object} relationshipModelName\n @param {Object} relationshipHash\n @return {Object}\n */\n extractRelationship(relationshipModelName, relationshipHash) {\n if (!relationshipHash) {\n return null;\n }\n /*\n When `relationshipHash` is an object it usually means that the relationship\n is polymorphic. It could however also be embedded resources that the\n EmbeddedRecordsMixin has be able to process.\n */\n if (relationshipHash && typeof relationshipHash === 'object' && !Array.isArray(relationshipHash)) {\n if (relationshipHash.id) {\n relationshipHash.id = coerceId(relationshipHash.id);\n }\n\n const modelClass = this.store.modelFor(relationshipModelName);\n if (relationshipHash.type && !modelClass.fields.has('type')) {\n relationshipHash.type = this.modelNameFromPayloadKey(relationshipHash.type);\n }\n\n return relationshipHash;\n }\n return { id: coerceId(relationshipHash), type: dasherize(singularize(relationshipModelName)) };\n },\n\n /**\n Returns a polymorphic relationship formatted as a JSON-API \"relationship object\".\n\n http://jsonapi.org/format/#document-resource-object-relationships\n\n `relationshipOptions` is a hash which contains more information about the\n polymorphic relationship which should be extracted:\n - `resourceHash` complete hash of the resource the relationship should be\n extracted from\n - `relationshipKey` key under which the value for the relationship is\n extracted from the resourceHash\n - `relationshipMeta` meta information about the relationship\n\n @method extractPolymorphicRelationship\n @public\n @param {Object} relationshipModelName\n @param {Object} relationshipHash\n @param {Object} relationshipOptions\n @return {Object}\n */\n extractPolymorphicRelationship(relationshipModelName, relationshipHash, relationshipOptions) {\n return this.extractRelationship(relationshipModelName, relationshipHash);\n },\n\n /**\n Returns the resource's relationships formatted as a JSON-API \"relationships object\".\n\n http://jsonapi.org/format/#document-resource-object-relationships\n\n @method extractRelationships\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {Object}\n */\n extractRelationships(modelClass, resourceHash) {\n const relationships = {};\n\n modelClass.eachRelationship((key, relationshipMeta) => {\n let relationship = null;\n const relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');\n if (resourceHash[relationshipKey] !== undefined) {\n let data = null;\n const relationshipHash = resourceHash[relationshipKey];\n if (relationshipMeta.kind === 'belongsTo') {\n if (relationshipMeta.options.polymorphic) {\n // extracting a polymorphic belongsTo may need more information\n // than the type and the hash (which might only be an id) for the\n // relationship, hence we pass the key, resource and\n // relationshipMeta too\n data = this.extractPolymorphicRelationship(relationshipMeta.type, relationshipHash, {\n key,\n resourceHash,\n relationshipMeta,\n });\n } else {\n data = this.extractRelationship(relationshipMeta.type, relationshipHash);\n }\n } else if (relationshipMeta.kind === 'hasMany') {\n if (relationshipHash) {\n data = new Array(relationshipHash.length);\n if (relationshipMeta.options.polymorphic) {\n for (let i = 0, l = relationshipHash.length; i < l; i++) {\n const item = relationshipHash[i];\n data[i] = this.extractPolymorphicRelationship(relationshipMeta.type, item, {\n key,\n resourceHash,\n relationshipMeta,\n });\n }\n } else {\n for (let i = 0, l = relationshipHash.length; i < l; i++) {\n const item = relationshipHash[i];\n data[i] = this.extractRelationship(relationshipMeta.type, item);\n }\n }\n }\n }\n relationship = { data };\n }\n\n const linkKey = this.keyForLink(key, relationshipMeta.kind);\n if (resourceHash.links && resourceHash.links[linkKey] !== undefined) {\n const related = resourceHash.links[linkKey];\n relationship = relationship || {};\n relationship.links = { related };\n }\n\n if (relationship) {\n relationships[key] = relationship;\n }\n });\n\n return relationships;\n },\n\n /**\n Dasherizes the model name in the payload\n\n @method modelNameFromPayloadKey\n @public\n @param {String} key\n @return {String} the model's modelName\n */\n modelNameFromPayloadKey(key) {\n return dasherize(singularize(key));\n },\n\n /**\n @method normalizeRelationships\n @private\n */\n normalizeRelationships(typeClass, hash) {\n let payloadKey;\n\n if (this.keyForRelationship) {\n typeClass.eachRelationship((key, relationship) => {\n payloadKey = this.keyForRelationship(key, relationship.kind, 'deserialize');\n if (key === payloadKey) {\n return;\n }\n if (hash[payloadKey] === undefined) {\n return;\n }\n\n hash[key] = hash[payloadKey];\n delete hash[payloadKey];\n });\n }\n },\n\n /**\n @method normalizeUsingDeclaredMapping\n @private\n */\n normalizeUsingDeclaredMapping(modelClass, hash) {\n const attrs = this.attrs;\n let normalizedKey;\n let payloadKey;\n\n if (attrs) {\n for (const key in attrs) {\n normalizedKey = payloadKey = this._getMappedKey(key, modelClass);\n\n if (hash[payloadKey] === undefined) {\n continue;\n }\n\n if (modelClass.attributes.has(key)) {\n normalizedKey = this.keyForAttribute(key, 'deserialize');\n }\n\n if (modelClass.relationshipsByName.has(key)) {\n normalizedKey = this.keyForRelationship(key, modelClass, 'deserialize');\n }\n\n if (payloadKey !== normalizedKey) {\n hash[normalizedKey] = hash[payloadKey];\n delete hash[payloadKey];\n }\n }\n }\n },\n\n /**\n Looks up the property key that was set by the custom `attr` mapping\n passed to the serializer.\n\n @method _getMappedKey\n @private\n @param {String} key\n @return {String} key\n */\n _getMappedKey(key, modelClass) {\n warn(\n 'There is no attribute or relationship with the name `' +\n key +\n '` on `' +\n modelClass.modelName +\n '`. Check your serializers attrs hash.',\n modelClass.attributes.has(key) || modelClass.relationshipsByName.has(key),\n {\n id: 'ds.serializer.no-mapped-attrs-key',\n }\n );\n\n const attrs = this.attrs;\n let mappedKey;\n if (attrs && attrs[key]) {\n mappedKey = attrs[key];\n //We need to account for both the { title: 'post_title' } and\n //{ title: { key: 'post_title' }} forms\n if (mappedKey.key) {\n mappedKey = mappedKey.key;\n }\n if (typeof mappedKey === 'string') {\n key = mappedKey;\n }\n }\n\n return key;\n },\n\n /**\n Check attrs.key.serialize property to inform if the `key`\n can be serialized\n\n @method _canSerialize\n @private\n @param {String} key\n @return {boolean} true if the key can be serialized\n */\n _canSerialize(key) {\n const attrs = this.attrs;\n\n return !attrs || !attrs[key] || attrs[key].serialize !== false;\n },\n\n /**\n When attrs.key.serialize is set to true then\n it takes priority over the other checks and the related\n attribute/relationship will be serialized\n\n @method _mustSerialize\n @private\n @param {String} key\n @return {boolean} true if the key must be serialized\n */\n _mustSerialize(key) {\n const attrs = this.attrs;\n\n return attrs && attrs[key] && attrs[key].serialize === true;\n },\n\n /**\n Check if the given hasMany relationship should be serialized\n\n By default only many-to-many and many-to-none relationships are serialized.\n This could be configured per relationship by Serializer's `attrs` object.\n\n @method shouldSerializeHasMany\n @public\n @param {Snapshot} snapshot\n @param {String} key\n @param {RelationshipSchema} relationship\n @return {boolean} true if the hasMany relationship should be serialized\n */\n shouldSerializeHasMany(snapshot, key, relationship) {\n const schema = this.store.modelFor(snapshot.modelName);\n const relationshipType = schema.determineRelationshipType(relationship, this.store);\n if (this._mustSerialize(key)) {\n return true;\n }\n return this._canSerialize(key) && (relationshipType === 'manyToNone' || relationshipType === 'manyToMany');\n },\n\n // SERIALIZE\n /**\n Called when a record is saved in order to convert the\n record into JSON.\n\n By default, it creates a JSON object with a key for\n each attribute and belongsTo relationship.\n\n For example, consider this model:\n\n ```app/models/comment.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @attr title;\n @attr body;\n\n @belongsTo('user') author;\n }\n ```\n\n The default serialization would create a JSON object like:\n\n ```javascript\n {\n \"title\": \"Rails is unagi\",\n \"body\": \"Rails? Omakase? O_O\",\n \"author\": 12\n }\n ```\n\n By default, attributes are passed through as-is, unless\n you specified an attribute type (`attr('date')`). If\n you specify a transform, the JavaScript value will be\n serialized when inserted into the JSON hash.\n\n By default, belongs-to relationships are converted into\n IDs when inserted into the JSON hash.\n\n ## IDs\n\n `serialize` takes an options hash with a single option:\n `includeId`. If this option is `true`, `serialize` will,\n by default include the ID in the JSON object it builds.\n\n The adapter passes in `includeId: true` when serializing\n a record for `createRecord`, but not for `updateRecord`.\n\n ## Customization\n\n Your server may expect a different JSON format than the\n built-in serialization format.\n\n In that case, you can implement `serialize` yourself and\n return a JSON hash of your choosing.\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = {\n POST_TTL: snapshot.attr('title'),\n POST_BDY: snapshot.attr('body'),\n POST_CMS: snapshot.hasMany('comments', { ids: true })\n };\n\n if (options.includeId) {\n json.POST_ID_ = snapshot.id;\n }\n\n return json;\n }\n }\n ```\n\n ## Customizing an App-Wide Serializer\n\n If you want to define a serializer for your entire\n application, you'll probably want to use `eachAttribute`\n and `eachRelationship` on the record.\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { singularize } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = {};\n\n snapshot.eachAttribute((name) => {\n json[serverAttributeName(name)] = snapshot.attr(name);\n });\n\n snapshot.eachRelationship((name, relationship) => {\n if (relationship.kind === 'hasMany') {\n json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n }\n });\n\n if (options.includeId) {\n json.ID_ = snapshot.id;\n }\n\n return json;\n }\n }\n\n function serverAttributeName(attribute) {\n return attribute.underscore().toUpperCase();\n }\n\n function serverHasManyName(name) {\n return serverAttributeName(singularize(name)) + \"_IDS\";\n }\n ```\n\n This serializer will generate JSON that looks like this:\n\n ```javascript\n {\n \"TITLE\": \"Rails is omakase\",\n \"BODY\": \"Yep. Omakase.\",\n \"COMMENT_IDS\": [ \"1\", \"2\", \"3\" ]\n }\n ```\n\n ## Tweaking the Default JSON\n\n If you just want to do some small tweaks on the default JSON,\n you can call `super.serialize` first and make the tweaks on\n the returned JSON.\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = super.serialize(...arguments);\n\n json.subject = json.title;\n delete json.title;\n\n return json;\n }\n }\n ```\n\n @method serialize\n @public\n @param {Snapshot} snapshot\n @param {Object} options\n @return {Object} json\n */\n serialize(snapshot, options) {\n const json = {};\n\n if (options && options.includeId) {\n const id = snapshot.id;\n if (id) {\n json[this.primaryKey] = id;\n }\n }\n\n snapshot.eachAttribute((key, attribute) => {\n this.serializeAttribute(snapshot, json, key, attribute);\n });\n\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n this.serializeBelongsTo(snapshot, json, relationship);\n } else if (relationship.kind === 'hasMany') {\n this.serializeHasMany(snapshot, json, relationship);\n }\n });\n\n return json;\n },\n\n /**\n You can use this method to customize how a serialized record is added to the complete\n JSON hash to be sent to the server. By default the JSON Serializer does not namespace\n the payload and just sends the raw serialized JSON object.\n If your server expects namespaced keys, you should consider using the RESTSerializer.\n Otherwise you can override this method to customize how the record is added to the hash.\n The hash property should be modified by reference.\n\n For example, your server may expect underscored root objects.\n\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n import { underscoren} from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends RESTSerializer {\n serializeIntoHash(data, type, snapshot, options) {\n let root = underscore(type.modelName);\n data[root] = this.serialize(snapshot, options);\n }\n }\n ```\n\n @method serializeIntoHash\n @public\n @param {Object} hash\n @param {Model} typeClass\n @param {Snapshot} snapshot\n @param {Object} options\n */\n serializeIntoHash(hash, typeClass, snapshot, options) {\n Object.assign(hash, this.serialize(snapshot, options));\n },\n\n /**\n `serializeAttribute` can be used to customize how `attr`\n properties are serialized\n\n For example if you wanted to ensure all your attributes were always\n serialized as properties on an `attributes` object you could\n write:\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class ApplicationSerializer extends JSONSerializer {\n serializeAttribute(snapshot, json, key, attributes) {\n json.attributes = json.attributes || {};\n super.serializeAttribute(snapshot, json.attributes, key, attributes);\n }\n }\n ```\n\n @method serializeAttribute\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {String} key\n @param {Object} attribute\n */\n serializeAttribute(snapshot, json, key, attribute) {\n if (this._canSerialize(key)) {\n const type = attribute.type;\n let value = snapshot.attr(key);\n if (type) {\n const transform = this.transformFor(type);\n value = transform.serialize(value, attribute.options);\n }\n\n // if provided, use the mapping provided by `attrs` in\n // the serializer\n const schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(key, schema);\n\n if (payloadKey === key && this.keyForAttribute) {\n payloadKey = this.keyForAttribute(key, 'serialize');\n }\n\n json[payloadKey] = value;\n }\n },\n\n /**\n `serializeBelongsTo` can be used to customize how `belongsTo`\n properties are serialized.\n\n Example\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n serializeBelongsTo(snapshot, json, relationship) {\n let key = relationship.name;\n let belongsTo = snapshot.belongsTo(key);\n\n key = this.keyForRelationship ? this.keyForRelationship(key, \"belongsTo\", \"serialize\") : key;\n\n json[key] = !belongsTo ? null : belongsTo.record.toJSON();\n }\n }\n ```\n\n @method serializeBelongsTo\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializeBelongsTo(snapshot, json, relationship) {\n const name = relationship.name;\n\n if (this._canSerialize(name)) {\n const belongsToId = snapshot.belongsTo(name, { id: true });\n\n // if provided, use the mapping provided by `attrs` in\n // the serializer\n const schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(name, schema);\n if (payloadKey === name && this.keyForRelationship) {\n payloadKey = this.keyForRelationship(name, 'belongsTo', 'serialize');\n }\n\n //Need to check whether the id is there for new&async records\n if (!belongsToId) {\n json[payloadKey] = null;\n } else {\n json[payloadKey] = belongsToId;\n }\n\n if (relationship.options.polymorphic) {\n this.serializePolymorphicType(snapshot, json, relationship);\n }\n }\n },\n\n /**\n `serializeHasMany` can be used to customize how `hasMany`\n properties are serialized.\n\n Example\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n serializeHasMany(snapshot, json, relationship) {\n let key = relationship.name;\n if (key === 'comments') {\n return;\n } else {\n super.serializeHasMany(...arguments);\n }\n }\n }\n ```\n\n @method serializeHasMany\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializeHasMany(snapshot, json, relationship) {\n const name = relationship.name;\n\n if (this.shouldSerializeHasMany(snapshot, name, relationship)) {\n const hasMany = snapshot.hasMany(name, { ids: true });\n if (hasMany !== undefined) {\n // if provided, use the mapping provided by `attrs` in\n // the serializer\n const schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(name, schema);\n if (payloadKey === name && this.keyForRelationship) {\n payloadKey = this.keyForRelationship(name, 'hasMany', 'serialize');\n }\n\n json[payloadKey] = hasMany;\n // TODO support for polymorphic manyToNone and manyToMany relationships\n }\n }\n },\n\n /**\n You can use this method to customize how polymorphic objects are\n serialized. Objects are considered to be polymorphic if\n `{ polymorphic: true }` is pass as the second argument to the\n `belongsTo` function.\n\n Example\n\n ```app/serializers/comment.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class CommentSerializer extends JSONSerializer {\n serializePolymorphicType(snapshot, json, relationship) {\n let key = relationship.name;\n let belongsTo = snapshot.belongsTo(key);\n\n key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;\n\n if (!belongsTo) {\n json[key + '_type'] = null;\n } else {\n json[key + '_type'] = belongsTo.modelName;\n }\n }\n }\n ```\n\n @method serializePolymorphicType\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializePolymorphicType() {},\n\n /**\n `extractMeta` is used to deserialize any meta information in the\n adapter payload. By default Ember Data expects meta information to\n be located on the `meta` property of the payload object.\n\n Example\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n extractMeta(store, typeClass, payload) {\n if (payload && payload.hasOwnProperty('_pagination')) {\n let meta = payload._pagination;\n delete payload._pagination;\n return meta;\n }\n }\n }\n ```\n\n @method extractMeta\n @public\n @param {Store} store\n @param {Model} modelClass\n @param {Object} payload\n */\n extractMeta(store, modelClass, payload) {\n if (payload && payload['meta'] !== undefined) {\n const meta = payload.meta;\n delete payload.meta;\n return meta;\n }\n },\n\n /**\n `extractErrors` is used to extract model errors when a call\n to `Model#save` fails with an `InvalidError`. By default\n Ember Data expects error information to be located on the `errors`\n property of the payload object.\n\n This serializer expects this `errors` object to be an Array similar\n to the following, compliant with the https://jsonapi.org/format/#errors specification:\n\n ```js\n {\n \"errors\": [\n {\n \"detail\": \"This username is already taken!\",\n \"source\": {\n \"pointer\": \"data/attributes/username\"\n }\n }, {\n \"detail\": \"Doesn't look like a valid email.\",\n \"source\": {\n \"pointer\": \"data/attributes/email\"\n }\n }\n ]\n }\n ```\n\n The key `detail` provides a textual description of the problem.\n Alternatively, the key `title` can be used for the same purpose.\n\n The nested keys `source.pointer` detail which specific element\n of the request data was invalid.\n\n Note that JSON-API also allows for object-level errors to be placed\n in an object with pointer `data`, signifying that the problem\n cannot be traced to a specific attribute:\n\n ```javascript\n {\n \"errors\": [\n {\n \"detail\": \"Some generic non property error message\",\n \"source\": {\n \"pointer\": \"data\"\n }\n }\n ]\n }\n ```\n\n When turn into a `Errors` object, you can read these errors\n through the property `base`:\n\n ```handlebars\n {{#each @model.errors.base as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n ```\n\n Example of alternative implementation, overriding the default\n behavior to deal with a different format of errors:\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n extractErrors(store, typeClass, payload, id) {\n if (payload && typeof payload === 'object' && payload._problems) {\n payload = payload._problems;\n this.normalizeErrors(typeClass, payload);\n }\n return payload;\n }\n }\n ```\n\n @method extractErrors\n @public\n @param {Store} store\n @param {Model} typeClass\n @param {Object} payload\n @param {(String|Number)} id\n @return {Object} json The deserialized errors\n */\n extractErrors(store, typeClass, payload, id) {\n if (payload && typeof payload === 'object' && payload.errors) {\n // the default assumption is that errors is already in JSON:API format\n const extracted = {};\n\n payload.errors.forEach((error) => {\n if (error.source && error.source.pointer) {\n let key = error.source.pointer.match(SOURCE_POINTER_REGEXP);\n\n if (key) {\n key = key[2];\n } else if (error.source.pointer.search(SOURCE_POINTER_PRIMARY_REGEXP) !== -1) {\n key = PRIMARY_ATTRIBUTE_KEY;\n }\n\n if (key) {\n extracted[key] = extracted[key] || [];\n extracted[key].push(error.detail || error.title);\n }\n }\n });\n\n // if the user has an attrs hash, convert keys using it\n this.normalizeUsingDeclaredMapping(typeClass, extracted);\n\n // for each attr and relationship, make sure that we use\n // the normalized key\n typeClass.eachAttribute((name) => {\n const key = this.keyForAttribute(name, 'deserialize');\n if (key !== name && extracted[key] !== undefined) {\n extracted[name] = extracted[key];\n delete extracted[key];\n }\n });\n\n typeClass.eachRelationship((name) => {\n const key = this.keyForRelationship(name, 'deserialize');\n if (key !== name && extracted[key] !== undefined) {\n extracted[name] = extracted[key];\n delete extracted[key];\n }\n });\n\n return extracted;\n }\n\n return payload;\n },\n\n /**\n `keyForAttribute` can be used to define rules for how to convert an\n attribute name in your model to a key in your JSON.\n\n Example\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends JSONSerializer {\n keyForAttribute(attr, method) {\n return underscore(attr).toUpperCase();\n }\n }\n ```\n\n @method keyForAttribute\n @public\n @param {String} key\n @param {String} method\n @return {String} normalized key\n */\n keyForAttribute(key, method) {\n return key;\n },\n\n /**\n `keyForRelationship` can be used to define a custom key when\n serializing and deserializing relationship properties. By default\n `JSONSerializer` does not provide an implementation of this method.\n\n Example\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default class PostSerializer extends JSONSerializer {\n keyForRelationship(key, relationship, method) {\n return `rel_${underscore(key)}`;\n }\n }\n ```\n\n @method keyForRelationship\n @public\n @param {String} key\n @param {String} typeClass\n @param {String} method\n @return {String} normalized key\n */\n keyForRelationship(key, typeClass, method) {\n return key;\n },\n\n /**\n `keyForLink` can be used to define a custom key when deserializing link\n properties.\n\n @method keyForLink\n @public\n @param {String} key\n @param {String} kind `belongsTo` or `hasMany`\n @return {String} normalized key\n */\n keyForLink(key, kind) {\n return key;\n },\n\n // HELPERS\n\n /**\n @method transformFor\n @private\n @param {String} attributeType\n @param {Boolean} skipAssertion\n @return {Transform} transform\n */\n transformFor(attributeType, skipAssertion) {\n const transform = getOwner(this).lookup('transform:' + attributeType);\n\n assert(`Unable to find the transform for \\`attr('${attributeType}')\\``, skipAssertion || !!transform);\n\n return transform;\n },\n});\n\nexport default JSONSerializer;\n"],"names":["coerceId","id","undefined","toString","String","SOURCE_POINTER_REGEXP","SOURCE_POINTER_PRIMARY_REGEXP","PRIMARY_ATTRIBUTE_KEY","JSONSerializer","Serializer","extend","primaryKey","mergedProperties","applyTransforms","typeClass","data","attributes","eachTransformedAttribute","key","transform","transformFor","transformMeta","get","deserialize","options","normalizeResponse","store","primaryModelClass","payload","requestType","normalizeFindRecordResponse","arguments","normalizeQueryRecordResponse","normalizeFindAllResponse","normalizeFindBelongsToResponse","normalizeFindHasManyResponse","normalizeFindManyResponse","normalizeQueryResponse","normalizeCreateRecordResponse","normalizeDeleteRecordResponse","normalizeUpdateRecordResponse","normalizeSingleResponse","normalizeArrayResponse","normalizeSaveResponse","_normalizeResponse","isSingle","documentHash","included","meta","extractMeta","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","normalize","ret","Array","length","i","l","item","concat","modelClass","resourceHash","normalizeUsingDeclaredMapping","links","extractId","type","modelName","extractAttributes","relationships","extractRelationships","lid","attributeKey","eachAttribute","keyForAttribute","extractRelationship","relationshipModelName","relationshipHash","isArray","modelFor","fields","has","modelNameFromPayloadKey","dasherize","singularize","extractPolymorphicRelationship","relationshipOptions","eachRelationship","relationshipMeta","relationship","relationshipKey","keyForRelationship","kind","polymorphic","linkKey","keyForLink","related","normalizeRelationships","hash","payloadKey","attrs","normalizedKey","_getMappedKey","relationshipsByName","warn","mappedKey","_canSerialize","serialize","_mustSerialize","shouldSerializeHasMany","snapshot","schema","relationshipType","determineRelationshipType","json","includeId","attribute","serializeAttribute","serializeBelongsTo","serializeHasMany","serializeIntoHash","Object","assign","value","attr","name","belongsToId","belongsTo","serializePolymorphicType","hasMany","ids","extractErrors","errors","extracted","forEach","error","source","pointer","match","search","push","detail","title","method","attributeType","skipAssertion","getOwner","lookup"],"mappings":";;;;;;AAEO,SAASA,QAAQA,CAACC,EAAa,EAAiB;EACrD,IAAIA,EAAE,KAAK,IAAI,IAAIA,EAAE,KAAKC,SAAS,IAAID,EAAE,KAAK,EAAE,EAAE;AAChD,IAAA,OAAO,IAAI;AACb,GAAC,MAAM,IAAI,OAAOA,EAAE,KAAK,QAAQ,EAAE;AACjC,IAAA,OAAOA,EAAE;AACX,GAAC,MAAM,IAAI,OAAOA,EAAE,KAAK,QAAQ,EAAE;AACjC,IAAA,OAAOA,EAAE,CAACE,QAAQ,EAAE;AACtB,GAAC,MAAM;IACL,OAAOC,MAAM,CAACH,EAAE,CAAC;AACnB;AACF;;ACZA;AACA;AACA;AAUA,MAAMI,qBAAqB,GAAG,4CAA4C;AAC1E,MAAMC,6BAA6B,GAAG,UAAU;AAChD,MAAMC,qBAAqB,GAAG,MAAM;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGC,UAAU,CAACC,MAAM,CAAC;AACvC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKEC,EAAAA,UAAU,EAAE,IAAI;AAEhB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAeEC,gBAAgB,EAAE,CAAC,OAAO,CAAC;AAE3B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEEC,EAAAA,eAAeA,CAACC,SAAS,EAAEC,IAAI,EAAE;AAC/B,IAAA,MAAMC,UAAU,GAAGF,SAAS,CAACE,UAAU;AAEvCF,IAAAA,SAAS,CAACG,wBAAwB,CAAC,CAACC,GAAG,EAAEJ,SAAS,KAAK;AACrD,MAAA,IAAIC,IAAI,CAACG,GAAG,CAAC,KAAKhB,SAAS,EAAE;AAC3B,QAAA;AACF;AAEA,MAAA,MAAMiB,SAAS,GAAG,IAAI,CAACC,YAAY,CAACN,SAAS,CAAC;AAC9C,MAAA,MAAMO,aAAa,GAAGL,UAAU,CAACM,GAAG,CAACJ,GAAG,CAAC;AACzCH,MAAAA,IAAI,CAACG,GAAG,CAAC,GAAGC,SAAS,CAACI,WAAW,CAACR,IAAI,CAACG,GAAG,CAAC,EAAEG,aAAa,CAACG,OAAO,CAAC;AACrE,KAAC,CAAC;AAEF,IAAA,OAAOT,IAAI;GACZ;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAQEU,iBAAiBA,CAACC,KAAK,EAAEC,iBAAiB,EAA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