@ember-data/serializer 5.4.0-beta.1 → 5.4.0-beta.2
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 +2 -1
- package/addon/-private.js +3 -4
- package/addon/-private.js.map +1 -1
- package/addon/{embedded-records-mixin-d75385ff.js → embedded-records-mixin-HTw8JJT1.js} +57 -60
- package/addon/embedded-records-mixin-HTw8JJT1.js.map +1 -0
- package/addon/index.js +1 -0
- package/addon/index.js.map +1 -1
- package/addon/json-api.js +49 -173
- package/addon/json-api.js.map +1 -1
- package/addon/json.js +52 -53
- package/addon/json.js.map +1 -1
- package/addon/rest.js +31 -27
- package/addon/rest.js.map +1 -1
- package/addon/{string-22572f80.js → string-A02hFTMo.js} +139 -20
- package/addon/string-A02hFTMo.js.map +1 -0
- package/addon/transform.js +1 -2
- package/addon/transform.js.map +1 -1
- package/addon/{utils-075c5b79.js.map → utils-N1ERF6HN.js.map} +1 -1
- package/package.json +61 -28
- package/addon/embedded-records-mixin-d75385ff.js.map +0 -1
- package/addon/string-22572f80.js.map +0 -1
- /package/addon/{utils-075c5b79.js → utils-N1ERF6HN.js} +0 -0
package/README.md
CHANGED
|
@@ -35,7 +35,8 @@ pnpm add @ember-data/serializer
|
|
|
35
35
|
|
|
36
36
|
If using `ember-data` no additional setup is necesssary.
|
|
37
37
|
|
|
38
|
-
> **Note**
|
|
38
|
+
> **Note**
|
|
39
|
+
> When using [ember-data](https://github.com/emberjs/data/blob/main/packages/-ember-data) the below
|
|
39
40
|
> configuration is handled for you automatically.
|
|
40
41
|
|
|
41
42
|
To use legacy serializers you will need to have installed and configured the LegacyNetworkHandler from [@ember-data/legacy-compat](https://github.com/emberjs/data/blob/main/packages/-ember-data)
|
package/addon/-private.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { e as EmbeddedRecordsMixin } from "./embedded-records-mixin-
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { c as coerceId } from "./utils-075c5b79";
|
|
1
|
+
export { e as EmbeddedRecordsMixin } from "./embedded-records-mixin-HTw8JJT1";
|
|
2
|
+
export { B as BooleanTransform, D as DateTransform, N as NumberTransform, S as StringTransform, T as Transform } from "./string-A02hFTMo";
|
|
3
|
+
export { c as coerceId } from "./utils-N1ERF6HN";
|
package/addon/-private.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"-private.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"-private.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { A } from '@ember/array';
|
|
2
1
|
import { warn } from '@ember/debug';
|
|
3
2
|
import Mixin from '@ember/object/mixin';
|
|
4
3
|
import { camelize } from '@ember/string';
|
|
@@ -129,7 +128,7 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
129
128
|
@return {Object} the normalized hash
|
|
130
129
|
**/
|
|
131
130
|
normalize(typeClass, hash, prop) {
|
|
132
|
-
|
|
131
|
+
const normalizedHash = this._super(typeClass, hash, prop);
|
|
133
132
|
return this._extractEmbeddedRecords(this, this.store, typeClass, normalizedHash);
|
|
134
133
|
},
|
|
135
134
|
keyForRelationship(key, typeClass, method) {
|
|
@@ -184,19 +183,19 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
184
183
|
@param {Object} relationship
|
|
185
184
|
*/
|
|
186
185
|
serializeBelongsTo(snapshot, json, relationship) {
|
|
187
|
-
|
|
186
|
+
const attr = relationship.name;
|
|
188
187
|
if (this.noSerializeOptionSpecified(attr)) {
|
|
189
188
|
this._super(snapshot, json, relationship);
|
|
190
189
|
return;
|
|
191
190
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
const includeIds = this.hasSerializeIdsOption(attr);
|
|
192
|
+
const includeRecords = this.hasSerializeRecordsOption(attr);
|
|
193
|
+
const embeddedSnapshot = snapshot.belongsTo(attr);
|
|
195
194
|
if (includeIds) {
|
|
196
|
-
|
|
197
|
-
let serializedKey = this._getMappedKey(relationship.
|
|
198
|
-
if (serializedKey === relationship.
|
|
199
|
-
serializedKey = this.keyForRelationship(relationship.
|
|
195
|
+
const schema = this.store.modelFor(snapshot.modelName);
|
|
196
|
+
let serializedKey = this._getMappedKey(relationship.name, schema);
|
|
197
|
+
if (serializedKey === relationship.name && this.keyForRelationship) {
|
|
198
|
+
serializedKey = this.keyForRelationship(relationship.name, relationship.kind, 'serialize');
|
|
200
199
|
}
|
|
201
200
|
if (!embeddedSnapshot) {
|
|
202
201
|
json[serializedKey] = null;
|
|
@@ -211,11 +210,11 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
211
210
|
}
|
|
212
211
|
},
|
|
213
212
|
_serializeEmbeddedBelongsTo(snapshot, json, relationship) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
let serializedKey = this._getMappedKey(relationship.
|
|
217
|
-
if (serializedKey === relationship.
|
|
218
|
-
serializedKey = this.keyForRelationship(relationship.
|
|
213
|
+
const embeddedSnapshot = snapshot.belongsTo(relationship.name);
|
|
214
|
+
const schema = this.store.modelFor(snapshot.modelName);
|
|
215
|
+
let serializedKey = this._getMappedKey(relationship.name, schema);
|
|
216
|
+
if (serializedKey === relationship.name && this.keyForRelationship) {
|
|
217
|
+
serializedKey = this.keyForRelationship(relationship.name, relationship.kind, 'serialize');
|
|
219
218
|
}
|
|
220
219
|
if (!embeddedSnapshot) {
|
|
221
220
|
json[serializedKey] = null;
|
|
@@ -342,16 +341,16 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
342
341
|
@param {Object} relationship
|
|
343
342
|
*/
|
|
344
343
|
serializeHasMany(snapshot, json, relationship) {
|
|
345
|
-
|
|
344
|
+
const attr = relationship.name;
|
|
346
345
|
if (this.noSerializeOptionSpecified(attr)) {
|
|
347
346
|
this._super(snapshot, json, relationship);
|
|
348
347
|
return;
|
|
349
348
|
}
|
|
350
349
|
if (this.hasSerializeIdsOption(attr)) {
|
|
351
|
-
|
|
352
|
-
let serializedKey = this._getMappedKey(relationship.
|
|
353
|
-
if (serializedKey === relationship.
|
|
354
|
-
serializedKey = this.keyForRelationship(relationship.
|
|
350
|
+
const schema = this.store.modelFor(snapshot.modelName);
|
|
351
|
+
let serializedKey = this._getMappedKey(relationship.name, schema);
|
|
352
|
+
if (serializedKey === relationship.name && this.keyForRelationship) {
|
|
353
|
+
serializedKey = this.keyForRelationship(relationship.name, relationship.kind, 'serialize');
|
|
355
354
|
}
|
|
356
355
|
json[serializedKey] = snapshot.hasMany(attr, {
|
|
357
356
|
ids: true
|
|
@@ -372,9 +371,9 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
372
371
|
TODO: Make the default in Ember-data 3.0??
|
|
373
372
|
*/
|
|
374
373
|
_serializeHasManyAsIdsAndTypes(snapshot, json, relationship) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
json[serializedKey] =
|
|
374
|
+
const serializedKey = this.keyForAttribute(relationship.name, 'serialize');
|
|
375
|
+
const hasMany = snapshot.hasMany(relationship.name) || [];
|
|
376
|
+
json[serializedKey] = hasMany.map(function (recordSnapshot) {
|
|
378
377
|
//
|
|
379
378
|
// I'm sure I'm being utterly naive here. Probably id is a configurable property and
|
|
380
379
|
// type too, and the modelName has to be normalized somehow.
|
|
@@ -386,12 +385,12 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
386
385
|
});
|
|
387
386
|
},
|
|
388
387
|
_serializeEmbeddedHasMany(snapshot, json, relationship) {
|
|
389
|
-
|
|
390
|
-
let serializedKey = this._getMappedKey(relationship.
|
|
391
|
-
if (serializedKey === relationship.
|
|
392
|
-
serializedKey = this.keyForRelationship(relationship.
|
|
388
|
+
const schema = this.store.modelFor(snapshot.modelName);
|
|
389
|
+
let serializedKey = this._getMappedKey(relationship.name, schema);
|
|
390
|
+
if (serializedKey === relationship.name && this.keyForRelationship) {
|
|
391
|
+
serializedKey = this.keyForRelationship(relationship.name, relationship.kind, 'serialize');
|
|
393
392
|
}
|
|
394
|
-
warn(`The embedded relationship '${serializedKey}' is undefined for '${snapshot.modelName}' with id '${snapshot.id}'. Please include it in your original payload.`, typeof snapshot.hasMany(relationship.
|
|
393
|
+
warn(`The embedded relationship '${serializedKey}' is undefined for '${snapshot.modelName}' with id '${snapshot.id}'. Please include it in your original payload.`, typeof snapshot.hasMany(relationship.name) !== 'undefined', {
|
|
395
394
|
id: 'ds.serializer.embedded-relationship-undefined'
|
|
396
395
|
});
|
|
397
396
|
json[serializedKey] = this._generateSerializedHasMany(snapshot, relationship);
|
|
@@ -400,12 +399,11 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
400
399
|
Returns an array of embedded records serialized to JSON
|
|
401
400
|
*/
|
|
402
401
|
_generateSerializedHasMany(snapshot, relationship) {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
let
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
let embeddedJson = embeddedSnapshot.serialize({
|
|
402
|
+
const hasMany = snapshot.hasMany(relationship.name) || [];
|
|
403
|
+
const ret = new Array(hasMany.length);
|
|
404
|
+
for (let i = 0; i < hasMany.length; i++) {
|
|
405
|
+
const embeddedSnapshot = hasMany[i];
|
|
406
|
+
const embeddedJson = embeddedSnapshot.serialize({
|
|
409
407
|
includeId: true
|
|
410
408
|
});
|
|
411
409
|
this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, embeddedJson);
|
|
@@ -429,12 +427,12 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
429
427
|
*/
|
|
430
428
|
removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, json) {
|
|
431
429
|
if (relationship.kind === 'belongsTo') {
|
|
432
|
-
|
|
433
|
-
|
|
430
|
+
const schema = this.store.modelFor(snapshot.modelName);
|
|
431
|
+
const parentRecord = schema.inverseFor(relationship.name, this.store);
|
|
434
432
|
if (parentRecord) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
433
|
+
const name = parentRecord.name;
|
|
434
|
+
const embeddedSerializer = this.store.serializerFor(embeddedSnapshot.modelName);
|
|
435
|
+
const parentKey = embeddedSerializer.keyForRelationship(name, parentRecord.kind, 'deserialize');
|
|
438
436
|
if (parentKey) {
|
|
439
437
|
delete json[parentKey];
|
|
440
438
|
}
|
|
@@ -443,43 +441,42 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
443
441
|
return;
|
|
444
442
|
}*/
|
|
445
443
|
},
|
|
446
|
-
|
|
447
444
|
// checks config for attrs option to embedded (always) - serialize and deserialize
|
|
448
445
|
hasEmbeddedAlwaysOption(attr) {
|
|
449
|
-
|
|
446
|
+
const option = this.attrsOption(attr);
|
|
450
447
|
return option && option.embedded === 'always';
|
|
451
448
|
},
|
|
452
449
|
// checks config for attrs option to serialize ids
|
|
453
450
|
hasSerializeRecordsOption(attr) {
|
|
454
|
-
|
|
455
|
-
|
|
451
|
+
const alwaysEmbed = this.hasEmbeddedAlwaysOption(attr);
|
|
452
|
+
const option = this.attrsOption(attr);
|
|
456
453
|
return alwaysEmbed || option && option.serialize === 'records';
|
|
457
454
|
},
|
|
458
455
|
// checks config for attrs option to serialize records
|
|
459
456
|
hasSerializeIdsOption(attr) {
|
|
460
|
-
|
|
457
|
+
const option = this.attrsOption(attr);
|
|
461
458
|
return option && (option.serialize === 'ids' || option.serialize === 'id');
|
|
462
459
|
},
|
|
463
460
|
// checks config for attrs option to serialize records as objects containing id and types
|
|
464
461
|
hasSerializeIdsAndTypesOption(attr) {
|
|
465
|
-
|
|
462
|
+
const option = this.attrsOption(attr);
|
|
466
463
|
return option && (option.serialize === 'ids-and-types' || option.serialize === 'id-and-type');
|
|
467
464
|
},
|
|
468
465
|
// checks config for attrs option to serialize records
|
|
469
466
|
noSerializeOptionSpecified(attr) {
|
|
470
|
-
|
|
467
|
+
const option = this.attrsOption(attr);
|
|
471
468
|
return !(option && (option.serialize || option.embedded));
|
|
472
469
|
},
|
|
473
470
|
// checks config for attrs option to deserialize records
|
|
474
471
|
// a defined option object for a resource is treated the same as
|
|
475
472
|
// `deserialize: 'records'`
|
|
476
473
|
hasDeserializeRecordsOption(attr) {
|
|
477
|
-
|
|
478
|
-
|
|
474
|
+
const alwaysEmbed = this.hasEmbeddedAlwaysOption(attr);
|
|
475
|
+
const option = this.attrsOption(attr);
|
|
479
476
|
return alwaysEmbed || option && option.deserialize === 'records';
|
|
480
477
|
},
|
|
481
478
|
attrsOption(attr) {
|
|
482
|
-
|
|
479
|
+
const attrs = this.attrs;
|
|
483
480
|
return attrs && (attrs[camelize(attr)] || attrs[attr]);
|
|
484
481
|
},
|
|
485
482
|
/**
|
|
@@ -504,14 +501,14 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
504
501
|
@private
|
|
505
502
|
*/
|
|
506
503
|
_extractEmbeddedHasMany(store, key, hash, relationshipMeta) {
|
|
507
|
-
|
|
504
|
+
const relationshipHash = hash.data?.relationships?.[key]?.data;
|
|
508
505
|
if (!relationshipHash) {
|
|
509
506
|
return;
|
|
510
507
|
}
|
|
511
|
-
|
|
508
|
+
const hasMany = new Array(relationshipHash.length);
|
|
512
509
|
for (let i = 0; i < relationshipHash.length; i++) {
|
|
513
|
-
|
|
514
|
-
|
|
510
|
+
const item = relationshipHash[i];
|
|
511
|
+
const {
|
|
515
512
|
data,
|
|
516
513
|
included
|
|
517
514
|
} = this._normalizeEmbeddedRelationship(store, relationshipMeta, item);
|
|
@@ -525,7 +522,7 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
525
522
|
type: data.type
|
|
526
523
|
};
|
|
527
524
|
}
|
|
528
|
-
|
|
525
|
+
const relationship = {
|
|
529
526
|
data: hasMany
|
|
530
527
|
};
|
|
531
528
|
hash.data.relationships[key] = relationship;
|
|
@@ -535,11 +532,11 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
535
532
|
@private
|
|
536
533
|
*/
|
|
537
534
|
_extractEmbeddedBelongsTo(store, key, hash, relationshipMeta) {
|
|
538
|
-
|
|
535
|
+
const relationshipHash = hash.data?.relationships?.[key]?.data;
|
|
539
536
|
if (!relationshipHash) {
|
|
540
537
|
return;
|
|
541
538
|
}
|
|
542
|
-
|
|
539
|
+
const {
|
|
543
540
|
data,
|
|
544
541
|
included
|
|
545
542
|
} = this._normalizeEmbeddedRelationship(store, relationshipMeta, relationshipHash);
|
|
@@ -548,11 +545,11 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
548
545
|
if (included) {
|
|
549
546
|
hash.included = hash.included.concat(included);
|
|
550
547
|
}
|
|
551
|
-
|
|
548
|
+
const belongsTo = {
|
|
552
549
|
id: data.id,
|
|
553
550
|
type: data.type
|
|
554
551
|
};
|
|
555
|
-
|
|
552
|
+
const relationship = {
|
|
556
553
|
data: belongsTo
|
|
557
554
|
};
|
|
558
555
|
hash.data.relationships[key] = relationship;
|
|
@@ -566,8 +563,8 @@ var embeddedRecordsMixin = Mixin.create({
|
|
|
566
563
|
if (relationshipMeta.options.polymorphic) {
|
|
567
564
|
modelName = relationshipHash.type;
|
|
568
565
|
}
|
|
569
|
-
|
|
570
|
-
|
|
566
|
+
const modelClass = store.modelFor(modelName);
|
|
567
|
+
const serializer = store.serializerFor(modelName);
|
|
571
568
|
return serializer.normalize(modelClass, relationshipHash, null);
|
|
572
569
|
},
|
|
573
570
|
isEmbeddedRecordsMixin: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedded-records-mixin-HTw8JJT1.js","sources":["../src/-private/embedded-records-mixin.js"],"sourcesContent":["import { warn } from '@ember/debug';\nimport Mixin from '@ember/object/mixin';\nimport { camelize } from '@ember/string';\n\n/**\n @module @ember-data/serializer/rest\n*/\n\n/**\n ## Using Embedded Records\n\n `EmbeddedRecordsMixin` supports serializing embedded records.\n\n To set up embedded records, include the mixin when extending a serializer,\n then define and configure embedded (model) relationships.\n\n Note that embedded records will serialize with the serializer for their model instead of the serializer in which they are defined.\n\n Note also that this mixin does not work with JSONAPISerializer because the JSON:API specification does not describe how to format embedded resources.\n\n Below is an example of a per-type serializer (`post` type).\n\n ```app/serializers/post.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\n export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n author: { embedded: 'always' },\n comments: { serialize: 'ids' }\n }\n }\n ```\n Note that this use of `{ embedded: 'always' }` is unrelated to\n the `{ embedded: 'always' }` that is defined as an option on `attr` as part of\n defining a model while working with the `ActiveModelSerializer`. Nevertheless,\n using `{ embedded: 'always' }` as an option to `attr` is not a valid way to set up\n embedded records.\n\n The `attrs` option for a resource `{ embedded: 'always' }` is shorthand for:\n\n ```js\n {\n serialize: 'records',\n deserialize: 'records'\n }\n ```\n\n ### Configuring Attrs\n\n A resource's `attrs` option may be set to use `ids`, `records` or false for the\n `serialize` and `deserialize` settings.\n\n The `attrs` property can be set on the `ApplicationSerializer` or a per-type\n serializer.\n\n In the case where embedded JSON is expected while extracting a payload (reading)\n the setting is `deserialize: 'records'`, there is no need to use `ids` when\n extracting as that is the default behaviour without this mixin if you are using\n the vanilla `EmbeddedRecordsMixin`. Likewise, to embed JSON in the payload while\n serializing `serialize: 'records'` is the setting to use. There is an option of\n not embedding JSON in the serialized payload by using `serialize: 'ids'`. If you\n do not want the relationship sent at all, you can use `serialize: false`.\n\n\n ### EmbeddedRecordsMixin defaults\n If you do not overwrite `attrs` for a specific relationship, the `EmbeddedRecordsMixin`\n will behave in the following way:\n\n BelongsTo: `{ serialize: 'id', deserialize: 'id' }`\n HasMany: `{ serialize: false, deserialize: 'ids' }`\n\n ### Model Relationships\n\n Embedded records must have a model defined to be extracted and serialized. Note that\n when defining any relationships on your model such as `belongsTo` and `hasMany`, you\n should not both specify `async: true` and also indicate through the serializer's\n `attrs` attribute that the related model should be embedded for deserialization.\n If a model is declared embedded for deserialization (`embedded: 'always'` or `deserialize: 'records'`),\n then do not use `async: true`.\n\n To successfully extract and serialize embedded records the model relationships\n must be set up correctly. See the\n [defining relationships](https://guides.emberjs.com/current/models/relationships)\n section of the **Defining Models** guide page.\n\n Records without an `id` property are not considered embedded records, model\n instances must have an `id` property to be used with Ember Data.\n\n ### Example JSON payloads, Models and Serializers\n\n **When customizing a serializer it is important to grok what the customizations\n are. Please read the docs for the methods this mixin provides, in case you need\n to modify it to fit your specific needs.**\n\n For example, review the docs for each method of this mixin:\n * [normalize](/ember-data/release/classes/EmbeddedRecordsMixin/methods/normalize?anchor=normalize)\n * [serializeBelongsTo](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeBelongsTo?anchor=serializeBelongsTo)\n * [serializeHasMany](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeHasMany?anchor=serializeHasMany)\n\n @class EmbeddedRecordsMixin\n @public\n*/\nexport default Mixin.create({\n /**\n Normalize the record and recursively normalize/extract all the embedded records\n while pushing them into the store as they are encountered\n\n A payload with an attr configured for embedded records needs to be extracted:\n\n ```js\n {\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"comments\": [{\n \"id\": \"1\",\n \"body\": \"Rails is unagi\"\n }, {\n \"id\": \"2\",\n \"body\": \"Omakase O_o\"\n }]\n }\n }\n ```\n @method normalize\n @public\n @param {Model} typeClass\n @param {Object} hash to be normalized\n @param {String} prop the hash has been referenced by\n @return {Object} the normalized hash\n **/\n normalize(typeClass, hash, prop) {\n const normalizedHash = this._super(typeClass, hash, prop);\n return this._extractEmbeddedRecords(this, this.store, typeClass, normalizedHash);\n },\n\n keyForRelationship(key, typeClass, method) {\n if (\n (method === 'serialize' && this.hasSerializeRecordsOption(key)) ||\n (method === 'deserialize' && this.hasDeserializeRecordsOption(key))\n ) {\n return this.keyForAttribute(key, method);\n } else {\n return this._super(key, typeClass, method) || key;\n }\n },\n\n /**\n Serialize `belongsTo` relationship when it is configured as an embedded object.\n\n This example of an author model belongs to a post model:\n\n ```js\n import Model, { attr, belongsTo } from '@ember-data/model';\n\n Post = Model.extend({\n title: attr('string'),\n body: attr('string'),\n author: belongsTo('author')\n });\n\n Author = Model.extend({\n name: attr('string'),\n post: belongsTo('post')\n });\n ```\n\n Use a custom (type) serializer for the post model to configure embedded author\n\n ```app/serializers/post.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\n export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n author: { embedded: 'always' }\n }\n }\n ```\n\n A payload with an attribute configured for embedded records can serialize\n the records together under the root attribute's payload:\n\n ```js\n {\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"author\": {\n \"id\": \"2\"\n \"name\": \"dhh\"\n }\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 attr = relationship.name;\n if (this.noSerializeOptionSpecified(attr)) {\n this._super(snapshot, json, relationship);\n return;\n }\n const includeIds = this.hasSerializeIdsOption(attr);\n const includeRecords = this.hasSerializeRecordsOption(attr);\n const embeddedSnapshot = snapshot.belongsTo(attr);\n if (includeIds) {\n const schema = this.store.modelFor(snapshot.modelName);\n let serializedKey = this._getMappedKey(relationship.name, schema);\n if (serializedKey === relationship.name && this.keyForRelationship) {\n serializedKey = this.keyForRelationship(relationship.name, relationship.kind, 'serialize');\n }\n\n if (!embeddedSnapshot) {\n json[serializedKey] = null;\n } else {\n json[serializedKey] = embeddedSnapshot.id;\n\n if (relationship.options.polymorphic) {\n this.serializePolymorphicType(snapshot, json, relationship);\n }\n }\n } else if (includeRecords) {\n this._serializeEmbeddedBelongsTo(snapshot, json, relationship);\n }\n },\n\n _serializeEmbeddedBelongsTo(snapshot, json, relationship) {\n const embeddedSnapshot = snapshot.belongsTo(relationship.name);\n const schema = this.store.modelFor(snapshot.modelName);\n let serializedKey = this._getMappedKey(relationship.name, schema);\n if (serializedKey === relationship.name && this.keyForRelationship) {\n serializedKey = this.keyForRelationship(relationship.name, relationship.kind, 'serialize');\n }\n\n if (!embeddedSnapshot) {\n json[serializedKey] = null;\n } else {\n json[serializedKey] = embeddedSnapshot.serialize({ includeId: true });\n this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, json[serializedKey]);\n\n if (relationship.options.polymorphic) {\n this.serializePolymorphicType(snapshot, json, relationship);\n }\n }\n },\n\n /**\n Serializes `hasMany` relationships when it is configured as embedded objects.\n\n This example of a post model has many comments:\n\n ```js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n Post = Model.extend({\n title: attr('string'),\n body: attr('string'),\n comments: hasMany('comment')\n });\n\n Comment = Model.extend({\n body: attr('string'),\n post: belongsTo('post')\n });\n ```\n\n Use a custom (type) serializer for the post model to configure embedded comments\n\n ```app/serializers/post.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\n export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n comments: { embedded: 'always' }\n }\n }\n ```\n\n A payload with an attribute configured for embedded records can serialize\n the records together under the root attribute's payload:\n\n ```js\n {\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"body\": \"I want this for my ORM, I want that for my template language...\"\n \"comments\": [{\n \"id\": \"1\",\n \"body\": \"Rails is unagi\"\n }, {\n \"id\": \"2\",\n \"body\": \"Omakase O_o\"\n }]\n }\n }\n ```\n\n The attrs options object can use more specific instruction for extracting and\n serializing. When serializing, an option to embed `ids`, `ids-and-types` or `records` can be set.\n When extracting the only option is `records`.\n\n So `{ embedded: 'always' }` is shorthand for:\n `{ serialize: 'records', deserialize: 'records' }`\n\n To embed the `ids` for a related object (using a hasMany relationship):\n\n ```app/serializers/post.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\n export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n comments: { serialize: 'ids', deserialize: 'records' }\n }\n }\n ```\n\n ```js\n {\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"body\": \"I want this for my ORM, I want that for my template language...\"\n \"comments\": [\"1\", \"2\"]\n }\n }\n ```\n\n To embed the relationship as a collection of objects with `id` and `type` keys, set\n `ids-and-types` for the related object.\n\n This is particularly useful for polymorphic relationships where records don't share\n the same table and the `id` is not enough information.\n\n For example having a user that has many pets:\n\n ```js\n User = Model.extend({\n name: attr('string'),\n pets: hasMany('pet', { polymorphic: true })\n });\n\n Pet = Model.extend({\n name: attr('string'),\n });\n\n Cat = Pet.extend({\n // ...\n });\n\n Parrot = Pet.extend({\n // ...\n });\n ```\n\n ```app/serializers/user.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\n export default class UserSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n pets: { serialize: 'ids-and-types', deserialize: 'records' }\n }\n }\n ```\n\n ```js\n {\n \"user\": {\n \"id\": \"1\"\n \"name\": \"Bertin Osborne\",\n \"pets\": [\n { \"id\": \"1\", \"type\": \"Cat\" },\n { \"id\": \"1\", \"type\": \"Parrot\"}\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 attr = relationship.name;\n if (this.noSerializeOptionSpecified(attr)) {\n this._super(snapshot, json, relationship);\n return;\n }\n\n if (this.hasSerializeIdsOption(attr)) {\n const schema = this.store.modelFor(snapshot.modelName);\n let serializedKey = this._getMappedKey(relationship.name, schema);\n if (serializedKey === relationship.name && this.keyForRelationship) {\n serializedKey = this.keyForRelationship(relationship.name, relationship.kind, 'serialize');\n }\n\n json[serializedKey] = snapshot.hasMany(attr, { ids: true });\n } else if (this.hasSerializeRecordsOption(attr)) {\n this._serializeEmbeddedHasMany(snapshot, json, relationship);\n } else {\n if (this.hasSerializeIdsAndTypesOption(attr)) {\n this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);\n }\n }\n },\n\n /*\n Serializes a hasMany relationship as an array of objects containing only `id` and `type`\n keys.\n This has its use case on polymorphic hasMany relationships where the server is not storing\n all records in the same table using STI, and therefore the `id` is not enough information\n\n TODO: Make the default in Ember-data 3.0??\n */\n _serializeHasManyAsIdsAndTypes(snapshot, json, relationship) {\n const serializedKey = this.keyForAttribute(relationship.name, 'serialize');\n const hasMany = snapshot.hasMany(relationship.name) || [];\n\n json[serializedKey] = hasMany.map(function (recordSnapshot) {\n //\n // I'm sure I'm being utterly naive here. Probably id is a configurable property and\n // type too, and the modelName has to be normalized somehow.\n //\n return { id: recordSnapshot.id, type: recordSnapshot.modelName };\n });\n },\n\n _serializeEmbeddedHasMany(snapshot, json, relationship) {\n const schema = this.store.modelFor(snapshot.modelName);\n let serializedKey = this._getMappedKey(relationship.name, schema);\n if (serializedKey === relationship.name && this.keyForRelationship) {\n serializedKey = this.keyForRelationship(relationship.name, relationship.kind, 'serialize');\n }\n\n warn(\n `The embedded relationship '${serializedKey}' is undefined for '${snapshot.modelName}' with id '${snapshot.id}'. Please include it in your original payload.`,\n typeof snapshot.hasMany(relationship.name) !== 'undefined',\n { id: 'ds.serializer.embedded-relationship-undefined' }\n );\n\n json[serializedKey] = this._generateSerializedHasMany(snapshot, relationship);\n },\n\n /*\n Returns an array of embedded records serialized to JSON\n */\n _generateSerializedHasMany(snapshot, relationship) {\n const hasMany = snapshot.hasMany(relationship.name) || [];\n const ret = new Array(hasMany.length);\n\n for (let i = 0; i < hasMany.length; i++) {\n const embeddedSnapshot = hasMany[i];\n const embeddedJson = embeddedSnapshot.serialize({ includeId: true });\n this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, embeddedJson);\n ret[i] = embeddedJson;\n }\n\n return ret;\n },\n\n /**\n When serializing an embedded record, modify the property (in the `JSON` payload)\n that refers to the parent record (foreign key for the relationship).\n\n Serializing a `belongsTo` relationship removes the property that refers to the\n parent record\n\n Serializing a `hasMany` relationship does not remove the property that refers to\n the parent record.\n\n @method removeEmbeddedForeignKey\n @public\n @param {Snapshot} snapshot\n @param {Snapshot} embeddedSnapshot\n @param {Object} relationship\n @param {Object} json\n */\n removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, json) {\n if (relationship.kind === 'belongsTo') {\n const schema = this.store.modelFor(snapshot.modelName);\n const parentRecord = schema.inverseFor(relationship.name, this.store);\n if (parentRecord) {\n const name = parentRecord.name;\n const embeddedSerializer = this.store.serializerFor(embeddedSnapshot.modelName);\n const parentKey = embeddedSerializer.keyForRelationship(name, parentRecord.kind, 'deserialize');\n if (parentKey) {\n delete json[parentKey];\n }\n }\n } /*else if (relationship.kind === 'hasMany') {\n return;\n }*/\n },\n\n // checks config for attrs option to embedded (always) - serialize and deserialize\n hasEmbeddedAlwaysOption(attr) {\n const option = this.attrsOption(attr);\n return option && option.embedded === 'always';\n },\n\n // checks config for attrs option to serialize ids\n hasSerializeRecordsOption(attr) {\n const alwaysEmbed = this.hasEmbeddedAlwaysOption(attr);\n const option = this.attrsOption(attr);\n return alwaysEmbed || (option && option.serialize === 'records');\n },\n\n // checks config for attrs option to serialize records\n hasSerializeIdsOption(attr) {\n const option = this.attrsOption(attr);\n return option && (option.serialize === 'ids' || option.serialize === 'id');\n },\n\n // checks config for attrs option to serialize records as objects containing id and types\n hasSerializeIdsAndTypesOption(attr) {\n const option = this.attrsOption(attr);\n return option && (option.serialize === 'ids-and-types' || option.serialize === 'id-and-type');\n },\n\n // checks config for attrs option to serialize records\n noSerializeOptionSpecified(attr) {\n const option = this.attrsOption(attr);\n return !(option && (option.serialize || option.embedded));\n },\n\n // checks config for attrs option to deserialize records\n // a defined option object for a resource is treated the same as\n // `deserialize: 'records'`\n hasDeserializeRecordsOption(attr) {\n const alwaysEmbed = this.hasEmbeddedAlwaysOption(attr);\n const option = this.attrsOption(attr);\n return alwaysEmbed || (option && option.deserialize === 'records');\n },\n\n attrsOption(attr) {\n const attrs = this.attrs;\n return attrs && (attrs[camelize(attr)] || attrs[attr]);\n },\n\n /**\n @method _extractEmbeddedRecords\n @private\n */\n _extractEmbeddedRecords(serializer, store, typeClass, partial) {\n typeClass.eachRelationship((key, relationship) => {\n if (serializer.hasDeserializeRecordsOption(key)) {\n if (relationship.kind === 'hasMany') {\n this._extractEmbeddedHasMany(store, key, partial, relationship);\n }\n if (relationship.kind === 'belongsTo') {\n this._extractEmbeddedBelongsTo(store, key, partial, relationship);\n }\n }\n });\n return partial;\n },\n\n /**\n @method _extractEmbeddedHasMany\n @private\n */\n _extractEmbeddedHasMany(store, key, hash, relationshipMeta) {\n const relationshipHash = hash.data?.relationships?.[key]?.data;\n\n if (!relationshipHash) {\n return;\n }\n\n const hasMany = new Array(relationshipHash.length);\n\n for (let i = 0; i < relationshipHash.length; i++) {\n const item = relationshipHash[i];\n const { data, included } = this._normalizeEmbeddedRelationship(store, relationshipMeta, item);\n hash.included = hash.included || [];\n hash.included.push(data);\n if (included) {\n hash.included = hash.included.concat(included);\n }\n\n hasMany[i] = { id: data.id, type: data.type };\n }\n\n const relationship = { data: hasMany };\n hash.data.relationships[key] = relationship;\n },\n\n /**\n @method _extractEmbeddedBelongsTo\n @private\n */\n _extractEmbeddedBelongsTo(store, key, hash, relationshipMeta) {\n const relationshipHash = hash.data?.relationships?.[key]?.data;\n if (!relationshipHash) {\n return;\n }\n\n const { data, included } = this._normalizeEmbeddedRelationship(store, relationshipMeta, relationshipHash);\n hash.included = hash.included || [];\n hash.included.push(data);\n if (included) {\n hash.included = hash.included.concat(included);\n }\n\n const belongsTo = { id: data.id, type: data.type };\n const relationship = { data: belongsTo };\n\n hash.data.relationships[key] = relationship;\n },\n\n /**\n @method _normalizeEmbeddedRelationship\n @private\n */\n _normalizeEmbeddedRelationship(store, relationshipMeta, relationshipHash) {\n let modelName = relationshipMeta.type;\n if (relationshipMeta.options.polymorphic) {\n modelName = relationshipHash.type;\n }\n const modelClass = store.modelFor(modelName);\n const serializer = store.serializerFor(modelName);\n\n return serializer.normalize(modelClass, relationshipHash, null);\n },\n isEmbeddedRecordsMixin: true,\n});\n"],"names":["Mixin","create","normalize","typeClass","hash","prop","normalizedHash","_super","_extractEmbeddedRecords","store","keyForRelationship","key","method","hasSerializeRecordsOption","hasDeserializeRecordsOption","keyForAttribute","serializeBelongsTo","snapshot","json","relationship","attr","name","noSerializeOptionSpecified","includeIds","hasSerializeIdsOption","includeRecords","embeddedSnapshot","belongsTo","schema","modelFor","modelName","serializedKey","_getMappedKey","kind","id","options","polymorphic","serializePolymorphicType","_serializeEmbeddedBelongsTo","serialize","includeId","removeEmbeddedForeignKey","serializeHasMany","hasMany","ids","_serializeEmbeddedHasMany","hasSerializeIdsAndTypesOption","_serializeHasManyAsIdsAndTypes","map","recordSnapshot","type","warn","_generateSerializedHasMany","ret","Array","length","i","embeddedJson","parentRecord","inverseFor","embeddedSerializer","serializerFor","parentKey","hasEmbeddedAlwaysOption","option","attrsOption","embedded","alwaysEmbed","deserialize","attrs","camelize","serializer","partial","eachRelationship","_extractEmbeddedHasMany","_extractEmbeddedBelongsTo","relationshipMeta","relationshipHash","data","relationships","item","included","_normalizeEmbeddedRelationship","push","concat","modelClass","isEmbeddedRecordsMixin"],"mappings":";;;;AAIA;AACA;AACA;;AAEA;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;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,2BAAeA,KAAK,CAACC,MAAM,CAAC;AAC1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AAC1B,CAAC,CAAC;;;;"}
|
package/addon/index.js
CHANGED
|
@@ -144,6 +144,7 @@ let _class = (_class2 = class _class2 extends EmberObject {
|
|
|
144
144
|
@param {Object} [options]
|
|
145
145
|
@return {Object}
|
|
146
146
|
*/
|
|
147
|
+
|
|
147
148
|
/**
|
|
148
149
|
The `normalize` method is used to convert a payload received from your
|
|
149
150
|
external data source into the normalized form `store.push()` expects. You
|
package/addon/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","../../../node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js","../src/index.ts"],"sourcesContent":["export default function _initializerDefineProperty(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}","export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n return desc;\n}","/**\n ## Overview\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 serializer, 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 order to properly manage and present your data, EmberData\n needs to understand the structure of data it receives.\n\n `Serializers` convert data between the server's API format and\n the format EmberData understands.\n\n Data received from an API response is **normalized** into\n [JSON:API](https://jsonapi.org/) (the format used internally\n by EmberData), while data sent to an API is **serialized**\n into the format the API expects.\n\n ### Implementing a Serializer\n\n There are only two required serializer methods, one for\n normalizing data from the server API format into JSON:API, and\n another for serializing records via `Snapshots` into the expected\n server API format.\n\n To implement a serializer, export a class that conforms to the structure\n described by [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)\n from the `app/serializers/` directory. An example is below.\n\n ```ts\n import EmberObject from '@ember/object';\n\n export default class ApplicationSerializer extends EmberObject {\n normalizeResponse(store, schema, rawPayload) {\n return rawPayload;\n }\n\n serialize(snapshot, options) {\n const serializedResource = {\n id: snapshot.id,\n type: snapshot.modelName,\n attributes: snapshot.attributes()\n };\n\n return serializedResource;\n }\n }\n ```\n\n\n ### Serializer Resolution\n\n `store.serializerFor(name)` will lookup serializers defined in\n `app/serializers/` and return an instance. If no serializer is found, an\n error will be thrown.\n\n `serializerFor` first attempts to find a serializer with an exact match on `name`,\n then falls back to checking for the presence of a serializer named `application`.\n\n ```ts\n store.serializerFor('author');\n\n // lookup paths (in order) =>\n // app/serializers/author.js\n // app/serializers/application.js\n ```\n\n Most requests in EmberData are made with respect to a particular `type` (or `modelName`)\n (e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\n refer to this as the **primary** resource `type`.\n\n Typically `serializerFor` will be used to find a serializer with a name matching that of the primary\n resource `type` for the request, falling back to the `application` serializer for those types that\n do not have a defined serializer. This is often described as a `per-model` or `per-type` strategy\n for defining serializers. However, because APIs rarely format payloads per-type but rather\n per-API-version, this may not be a desired strategy.\n\n It is recommended that applications define only a single `application` adapter and serializer\n where possible.\n\n If you have multiple API formats and the per-type strategy is not viable, one strategy is to\n write an `application` adapter and serializer that make use of `options` to specify the desired\n format when making a request.\n\n ### Using a Serializer\n\n Any serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.\n\n ### Default Serializers\n\n For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**\n format the `@ember-data/serializer` package contains implementations these applications can\n extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.\n\n Many applications will find writing their own serializer to be more performant and less\n complex than extending these classes even when their API format is very close to that expected\n by these serializers.\n\n It is recommended that apps write their own serializer to best suit the needs of their API and\n application.\n\n @module @ember-data/serializer\n @main @ember-data/serializer\n*/\n\nimport EmberObject from '@ember/object';\nimport { inject as service } from '@ember/service';\n\nimport type Store from '@ember-data/store';\nimport { ModelSchema } from '@ember-data/types/q/ds-model';\n\n/**\n > ⚠️ CAUTION you likely want the docs for [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)\n > as extending this abstract class is unnecessary.\n\n `Serializer` is an abstract base class that you may override in your\n application to customize it for your backend. The minimum set of methods\n that you should implement is:\n\n * `normalizeResponse()`\n * `serialize()`\n\n And you can optionally override the following methods:\n\n * `normalize()`\n\n For an example implementation, see\n [JSONSerializer](JSONSerializer), the included JSON serializer.\n\n @class Serializer\n @public\n @extends Ember.EmberObject\n*/\n\nexport default class extends EmberObject {\n @service declare store: Store;\n /**\n The `store` property is the application's `store` that contains\n all records. It can be used to look up serializers for other model\n types that may be nested inside the payload response.\n\n Example:\n\n ```js\n Serializer.extend({\n extractRelationship(relationshipModelName, relationshipHash) {\n let modelClass = this.store.modelFor(relationshipModelName);\n let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n return relationshipSerializer.normalize(modelClass, relationshipHash);\n }\n });\n ```\n\n @property store\n @type {Store}\n @public\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 Example:\n\n ```js\n Serializer.extend({\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n if (requestType === 'findRecord') {\n return this.normalize(primaryModelClass, payload);\n } else {\n return payload.reduce(function(documentHash, item) {\n let { data, included } = this.normalize(primaryModelClass, item);\n documentHash.included.push(...included);\n documentHash.data.push(data);\n return documentHash;\n }, { data: [], included: [] })\n }\n }\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\n /**\n The `serialize` method is used when a record is saved in order to convert\n the record into the form that your external data source expects.\n\n `serialize` takes an optional `options` hash with a single option:\n\n - `includeId`: If this is `true`, `serialize` should include the ID\n in the serialized object it builds.\n\n Example:\n\n ```js\n Serializer.extend({\n serialize(snapshot, options) {\n let json = {\n id: snapshot.id\n };\n\n snapshot.eachAttribute((key, attribute) => {\n json[key] = snapshot.attr(key);\n });\n\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n json[key] = snapshot.belongsTo(key, { id: true });\n } else if (relationship.kind === 'hasMany') {\n json[key] = snapshot.hasMany(key, { ids: true });\n }\n });\n\n return json;\n },\n });\n ```\n\n @method serialize\n @public\n @param {Snapshot} snapshot\n @param {Object} [options]\n @return {Object}\n */\n\n /**\n The `normalize` method is used to convert a payload received from your\n external data source into the normalized form `store.push()` expects. You\n should override this method, munge the hash and return the normalized\n payload.\n\n Example:\n\n ```js\n Serializer.extend({\n normalize(modelClass, resourceHash) {\n let data = {\n id: resourceHash.id,\n type: modelClass.modelName,\n attributes: resourceHash\n };\n return { data: data };\n }\n })\n ```\n\n @method normalize\n @public\n @param {Model} typeClass\n @param {Object} hash\n @return {Object}\n */\n normalize(_typeClass: ModelSchema, hash: Record<string, unknown>): Record<string, unknown> {\n return hash;\n }\n}\n"],"names":["_initializerDefineProperty","target","property","descriptor","context","Object","defineProperty","enumerable","configurable","writable","value","initializer","call","_applyDecoratedDescriptor","decorators","desc","keys","forEach","key","slice","reverse","reduce","decorator","undefined","_class","_class2","EmberObject","constructor","args","_descriptor","normalize","_typeClass","hash","prototype","service"],"mappings":";;;AAAe,SAASA,0BAA0BA,CAACC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,OAAO,EAAE;EACxF,IAAI,CAACD,UAAU,EAAE,OAAA;AACjBE,EAAAA,MAAM,CAACC,cAAc,CAACL,MAAM,EAAEC,QAAQ,EAAE;IACtCK,UAAU,EAAEJ,UAAU,CAACI,UAAU;IACjCC,YAAY,EAAEL,UAAU,CAACK,YAAY;IACrCC,QAAQ,EAAEN,UAAU,CAACM,QAAQ;AAC7BC,IAAAA,KAAK,EAAEP,UAAU,CAACQ,WAAW,GAAGR,UAAU,CAACQ,WAAW,CAACC,IAAI,CAACR,OAAO,CAAC,GAAG,KAAK,CAAA;AAC9E,GAAC,CAAC,CAAA;AACJ;;ACRe,SAASS,yBAAyBA,CAACZ,MAAM,EAAEC,QAAQ,EAAEY,UAAU,EAAEX,UAAU,EAAEC,OAAO,EAAE;EACnG,IAAIW,IAAI,GAAG,EAAE,CAAA;EACbV,MAAM,CAACW,IAAI,CAACb,UAAU,CAAC,CAACc,OAAO,CAAC,UAAUC,GAAG,EAAE;AAC7CH,IAAAA,IAAI,CAACG,GAAG,CAAC,GAAGf,UAAU,CAACe,GAAG,CAAC,CAAA;AAC7B,GAAC,CAAC,CAAA;AACFH,EAAAA,IAAI,CAACR,UAAU,GAAG,CAAC,CAACQ,IAAI,CAACR,UAAU,CAAA;AACnCQ,EAAAA,IAAI,CAACP,YAAY,GAAG,CAAC,CAACO,IAAI,CAACP,YAAY,CAAA;AACvC,EAAA,IAAI,OAAO,IAAIO,IAAI,IAAIA,IAAI,CAACJ,WAAW,EAAE;IACvCI,IAAI,CAACN,QAAQ,GAAG,IAAI,CAAA;AACtB,GAAA;AACAM,EAAAA,IAAI,GAAGD,UAAU,CAACK,KAAK,EAAE,CAACC,O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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAME;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;AAUE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIEC,EAAAA,SAASA,CAACC,UAAuB,EAAEC,IAA6B,EAA2B;AACzF,IAAA,OAAOA,IAAI,CAAA;AACb,GAAA;AACF,CAAC,GAAAH,WAAA,GAAAhB,yBAAA,CAAAY,OAAA,CAAAQ,SAAA,EAAA,OAAA,EAAA,CAnIEC,MAAO,CAAA,EAAA;EAAA1B,YAAA,EAAA,IAAA;EAAAD,UAAA,EAAA,IAAA;EAAAE,QAAA,EAAA,IAAA;EAAAE,WAAA,EAAA,IAAA;AAAA,CAAA,CAAA,GAAAc,OAAA;;;;","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","../../../node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js","../src/index.ts"],"sourcesContent":["export default function _initializerDefineProperty(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}","export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n return desc;\n}","/**\n ## Overview\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 serializer, 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 order to properly manage and present your data, EmberData\n needs to understand the structure of data it receives.\n\n `Serializers` convert data between the server's API format and\n the format EmberData understands.\n\n Data received from an API response is **normalized** into\n [JSON:API](https://jsonapi.org/) (the format used internally\n by EmberData), while data sent to an API is **serialized**\n into the format the API expects.\n\n ### Implementing a Serializer\n\n There are only two required serializer methods, one for\n normalizing data from the server API format into JSON:API, and\n another for serializing records via `Snapshots` into the expected\n server API format.\n\n To implement a serializer, export a class that conforms to the structure\n described by [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)\n from the `app/serializers/` directory. An example is below.\n\n ```ts\n import EmberObject from '@ember/object';\n\n export default class ApplicationSerializer extends EmberObject {\n normalizeResponse(store, schema, rawPayload) {\n return rawPayload;\n }\n\n serialize(snapshot, options) {\n const serializedResource = {\n id: snapshot.id,\n type: snapshot.modelName,\n attributes: snapshot.attributes()\n };\n\n return serializedResource;\n }\n }\n ```\n\n\n ### Serializer Resolution\n\n `store.serializerFor(name)` will lookup serializers defined in\n `app/serializers/` and return an instance. If no serializer is found, an\n error will be thrown.\n\n `serializerFor` first attempts to find a serializer with an exact match on `name`,\n then falls back to checking for the presence of a serializer named `application`.\n\n ```ts\n store.serializerFor('author');\n\n // lookup paths (in order) =>\n // app/serializers/author.js\n // app/serializers/application.js\n ```\n\n Most requests in EmberData are made with respect to a particular `type` (or `modelName`)\n (e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\n refer to this as the **primary** resource `type`.\n\n Typically `serializerFor` will be used to find a serializer with a name matching that of the primary\n resource `type` for the request, falling back to the `application` serializer for those types that\n do not have a defined serializer. This is often described as a `per-model` or `per-type` strategy\n for defining serializers. However, because APIs rarely format payloads per-type but rather\n per-API-version, this may not be a desired strategy.\n\n It is recommended that applications define only a single `application` adapter and serializer\n where possible.\n\n If you have multiple API formats and the per-type strategy is not viable, one strategy is to\n write an `application` adapter and serializer that make use of `options` to specify the desired\n format when making a request.\n\n ### Using a Serializer\n\n Any serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.\n\n ### Default Serializers\n\n For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**\n format the `@ember-data/serializer` package contains implementations these applications can\n extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.\n\n Many applications will find writing their own serializer to be more performant and less\n complex than extending these classes even when their API format is very close to that expected\n by these serializers.\n\n It is recommended that apps write their own serializer to best suit the needs of their API and\n application.\n\n @module @ember-data/serializer\n @main @ember-data/serializer\n*/\n\nimport EmberObject from '@ember/object';\nimport { inject as service } from '@ember/service';\n\nimport type Store from '@ember-data/store';\nimport type { ModelSchema } from '@ember-data/store/-types/q/ds-model';\n\n/**\n > ⚠️ CAUTION you likely want the docs for [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)\n > as extending this abstract class is unnecessary.\n\n `Serializer` is an abstract base class that you may override in your\n application to customize it for your backend. The minimum set of methods\n that you should implement is:\n\n * `normalizeResponse()`\n * `serialize()`\n\n And you can optionally override the following methods:\n\n * `normalize()`\n\n For an example implementation, see\n [JSONSerializer](JSONSerializer), the included JSON serializer.\n\n @class Serializer\n @public\n @extends Ember.EmberObject\n*/\n\nexport default class extends EmberObject {\n @service declare store: Store;\n /**\n The `store` property is the application's `store` that contains\n all records. It can be used to look up serializers for other model\n types that may be nested inside the payload response.\n\n Example:\n\n ```js\n Serializer.extend({\n extractRelationship(relationshipModelName, relationshipHash) {\n let modelClass = this.store.modelFor(relationshipModelName);\n let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n return relationshipSerializer.normalize(modelClass, relationshipHash);\n }\n });\n ```\n\n @property store\n @type {Store}\n @public\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 Example:\n\n ```js\n Serializer.extend({\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n if (requestType === 'findRecord') {\n return this.normalize(primaryModelClass, payload);\n } else {\n return payload.reduce(function(documentHash, item) {\n let { data, included } = this.normalize(primaryModelClass, item);\n documentHash.included.push(...included);\n documentHash.data.push(data);\n return documentHash;\n }, { data: [], included: [] })\n }\n }\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\n /**\n The `serialize` method is used when a record is saved in order to convert\n the record into the form that your external data source expects.\n\n `serialize` takes an optional `options` hash with a single option:\n\n - `includeId`: If this is `true`, `serialize` should include the ID\n in the serialized object it builds.\n\n Example:\n\n ```js\n Serializer.extend({\n serialize(snapshot, options) {\n let json = {\n id: snapshot.id\n };\n\n snapshot.eachAttribute((key, attribute) => {\n json[key] = snapshot.attr(key);\n });\n\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n json[key] = snapshot.belongsTo(key, { id: true });\n } else if (relationship.kind === 'hasMany') {\n json[key] = snapshot.hasMany(key, { ids: true });\n }\n });\n\n return json;\n },\n });\n ```\n\n @method serialize\n @public\n @param {Snapshot} snapshot\n @param {Object} [options]\n @return {Object}\n */\n\n /**\n The `normalize` method is used to convert a payload received from your\n external data source into the normalized form `store.push()` expects. You\n should override this method, munge the hash and return the normalized\n payload.\n\n Example:\n\n ```js\n Serializer.extend({\n normalize(modelClass, resourceHash) {\n let data = {\n id: resourceHash.id,\n type: modelClass.modelName,\n attributes: resourceHash\n };\n return { data: data };\n }\n })\n ```\n\n @method normalize\n @public\n @param {Model} typeClass\n @param {Object} hash\n @return {Object}\n */\n normalize(_typeClass: ModelSchema, hash: Record<string, unknown>): Record<string, unknown> {\n return hash;\n }\n}\n"],"names":["_initializerDefineProperty","target","property","descriptor","context","Object","defineProperty","enumerable","configurable","writable","value","initializer","call","_applyDecoratedDescriptor","decorators","desc","keys","forEach","key","slice","reverse","reduce","decorator","undefined","_class","_class2","EmberObject","constructor","args","_descriptor","normalize","_typeClass","hash","prototype","service"],"mappings":";;;AAAe,SAASA,0BAA0BA,CAACC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,OAAO,EAAE;EACxF,IAAI,CAACD,UAAU,EAAE,OAAA;AACjBE,EAAAA,MAAM,CAACC,cAAc,CAACL,MAAM,EAAEC,QAAQ,EAAE;IACtCK,UAAU,EAAEJ,UAAU,CAACI,UAAU;IACjCC,YAAY,EAAEL,UAAU,CAACK,YAAY;IACrCC,QAAQ,EAAEN,UAAU,CAACM,QAAQ;AAC7BC,IAAAA,KAAK,EAAEP,UAAU,CAACQ,WAAW,GAAGR,UAAU,CAACQ,WAAW,CAACC,IAAI,CAACR,OAAO,CAAC,GAAG,KAAK,CAAA;AAC9E,GAAC,CAAC,CAAA;AACJ;;ACRe,SAASS,yBAAyBA,CAACZ,MAAM,EAAEC,QAAQ,EAAEY,UAAU,EAAEX,UAAU,EAAEC,OAAO,EAAE;EACnG,IAAIW,IAAI,GAAG,EAAE,CAAA;EACbV,MAAM,CAACW,IAAI,CAACb,UAAU,CAAC,CAACc,OAAO,CAAC,UAAUC,GAAG,EAAE;AAC7CH,IAAAA,IAAI,CAACG,GAAG,CAAC,GAAGf,UAAU,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,CAAC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAA5B,IAAAA,0BAAA,gBAAA6B,WAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;AAEvC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKE;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;;AAME;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;;AAUE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIEC,EAAAA,SAASA,CAACC,UAAuB,EAAEC,IAA6B,EAA2B;AACzF,IAAA,OAAOA,IAAI,CAAA;AACb,GAAA;AACF,CAAC,GAAAH,WAAA,GAAAhB,yBAAA,CAAAY,OAAA,CAAAQ,SAAA,EAAA,OAAA,EAAA,CAnIEC,MAAO,CAAA,EAAA;EAAA1B,YAAA,EAAA,IAAA;EAAAD,UAAA,EAAA,IAAA;EAAAE,QAAA,EAAA,IAAA;EAAAE,WAAA,EAAA,IAAA;AAAA,CAAA,CAAA,GAAAc,OAAA;;;;","x_google_ignoreList":[0,1]}
|