@ember-data-mirror/serializer 4.13.0-alpha.1

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.
Files changed (52) hide show
  1. package/LICENSE.md +11 -0
  2. package/README.md +107 -0
  3. package/addon-main.cjs +5 -0
  4. package/blueprints/serializer/files/__root__/__path__/__name__.js +4 -0
  5. package/blueprints/serializer/index.js +80 -0
  6. package/blueprints/serializer/native-files/__root__/__path__/__name__.js +4 -0
  7. package/blueprints/serializer-test/index.js +35 -0
  8. package/blueprints/serializer-test/qunit-files/__root__/__path__/__test__.js +23 -0
  9. package/blueprints/transform/files/__root__/__path__/__name__.js +13 -0
  10. package/blueprints/transform/index.js +17 -0
  11. package/blueprints/transform/native-files/__root__/__path__/__name__.js +13 -0
  12. package/blueprints/transform-test/index.js +35 -0
  13. package/blueprints/transform-test/qunit-files/__root__/__path__/__test__.js +12 -0
  14. package/dist/index.js +304 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/json-BwMH6O_R.js +1396 -0
  17. package/dist/json-BwMH6O_R.js.map +1 -0
  18. package/dist/json-api.js +529 -0
  19. package/dist/json-api.js.map +1 -0
  20. package/dist/json.js +6 -0
  21. package/dist/json.js.map +1 -0
  22. package/dist/rest.js +1270 -0
  23. package/dist/rest.js.map +1 -0
  24. package/dist/transform.js +336 -0
  25. package/dist/transform.js.map +1 -0
  26. package/package.json +116 -0
  27. package/unstable-preview-types/-private/embedded-records-mixin.d.ts +102 -0
  28. package/unstable-preview-types/-private/embedded-records-mixin.d.ts.map +1 -0
  29. package/unstable-preview-types/-private/transforms/boolean.d.ts +52 -0
  30. package/unstable-preview-types/-private/transforms/boolean.d.ts.map +1 -0
  31. package/unstable-preview-types/-private/transforms/boolean.type-test.d.ts +4 -0
  32. package/unstable-preview-types/-private/transforms/boolean.type-test.d.ts.map +1 -0
  33. package/unstable-preview-types/-private/transforms/date.d.ts +33 -0
  34. package/unstable-preview-types/-private/transforms/date.d.ts.map +1 -0
  35. package/unstable-preview-types/-private/transforms/number.d.ts +34 -0
  36. package/unstable-preview-types/-private/transforms/number.d.ts.map +1 -0
  37. package/unstable-preview-types/-private/transforms/string.d.ts +34 -0
  38. package/unstable-preview-types/-private/transforms/string.d.ts.map +1 -0
  39. package/unstable-preview-types/-private/transforms/transform.d.ts +126 -0
  40. package/unstable-preview-types/-private/transforms/transform.d.ts.map +1 -0
  41. package/unstable-preview-types/-private/utils.d.ts +6 -0
  42. package/unstable-preview-types/-private/utils.d.ts.map +1 -0
  43. package/unstable-preview-types/index.d.ts +277 -0
  44. package/unstable-preview-types/index.d.ts.map +1 -0
  45. package/unstable-preview-types/json-api.d.ts +527 -0
  46. package/unstable-preview-types/json-api.d.ts.map +1 -0
  47. package/unstable-preview-types/json.d.ts +1093 -0
  48. package/unstable-preview-types/json.d.ts.map +1 -0
  49. package/unstable-preview-types/rest.d.ts +570 -0
  50. package/unstable-preview-types/rest.d.ts.map +1 -0
  51. package/unstable-preview-types/transform.d.ts +11 -0
  52. package/unstable-preview-types/transform.d.ts.map +1 -0
@@ -0,0 +1,529 @@
1
+ import { warn } from '@ember/debug';
2
+ import { dasherize, singularize, pluralize } from '@ember-data-mirror/request-utils/string';
3
+ import { J as JSONSerializer } from "./json-BwMH6O_R.js";
4
+ import { macroCondition, getGlobalConfig } from '@embroider/macros';
5
+
6
+ /**
7
+ * @module @ember-data-mirror/serializer/json-api
8
+ */
9
+ const JSONAPISerializer = JSONSerializer.extend({
10
+ /**
11
+ @method _normalizeDocumentHelper
12
+ @param {Object} documentHash
13
+ @return {Object}
14
+ @private
15
+ */
16
+ _normalizeDocumentHelper(documentHash) {
17
+ if (Array.isArray(documentHash.data)) {
18
+ const ret = new Array(documentHash.data.length);
19
+ for (let i = 0; i < documentHash.data.length; i++) {
20
+ const data = documentHash.data[i];
21
+ ret[i] = this._normalizeResourceHelper(data);
22
+ }
23
+ documentHash.data = ret;
24
+ } else if (documentHash.data && typeof documentHash.data === 'object') {
25
+ documentHash.data = this._normalizeResourceHelper(documentHash.data);
26
+ }
27
+ if (Array.isArray(documentHash.included)) {
28
+ const ret = new Array();
29
+ for (let i = 0; i < documentHash.included.length; i++) {
30
+ const included = documentHash.included[i];
31
+ const normalized = this._normalizeResourceHelper(included);
32
+ if (normalized !== null) {
33
+ // can be null when unknown type is encountered
34
+ ret.push(normalized);
35
+ }
36
+ }
37
+ documentHash.included = ret;
38
+ }
39
+ return documentHash;
40
+ },
41
+ /**
42
+ @method _normalizeRelationshipDataHelper
43
+ @param {Object} relationshipDataHash
44
+ @return {Object}
45
+ @private
46
+ */
47
+ _normalizeRelationshipDataHelper(relationshipDataHash) {
48
+ relationshipDataHash.type = this.modelNameFromPayloadKey(relationshipDataHash.type);
49
+ return relationshipDataHash;
50
+ },
51
+ /**
52
+ @method _normalizeResourceHelper
53
+ @param {Object} resourceHash
54
+ @return {Object}
55
+ @private
56
+ */
57
+ _normalizeResourceHelper(resourceHash) {
58
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
59
+ if (!test) {
60
+ throw new Error(this.warnMessageForUndefinedType());
61
+ }
62
+ })(resourceHash.type) : {};
63
+ const type = this.modelNameFromPayloadKey(resourceHash.type);
64
+ if (!this.store.schema.hasResource({
65
+ type
66
+ })) {
67
+ warn(this.warnMessageNoModelForType(type, resourceHash.type, 'modelNameFromPayloadKey'), false, {
68
+ id: 'ds.serializer.model-for-type-missing'
69
+ });
70
+ return null;
71
+ }
72
+ const modelClass = this.store.modelFor(type);
73
+ const serializer = this.store.serializerFor(type);
74
+ const {
75
+ data
76
+ } = serializer.normalize(modelClass, resourceHash);
77
+ return data;
78
+ },
79
+ /**
80
+ Normalize some data and push it into the store.
81
+ @method pushPayload
82
+ @public
83
+ @param {Store} store
84
+ @param {Object} payload
85
+ */
86
+ pushPayload(store, payload) {
87
+ const normalizedPayload = this._normalizeDocumentHelper(payload);
88
+ store.push(normalizedPayload);
89
+ },
90
+ /**
91
+ @method _normalizeResponse
92
+ @param {Store} store
93
+ @param {Model} primaryModelClass
94
+ @param {Object} payload
95
+ @param {String|Number} id
96
+ @param {String} requestType
97
+ @param {Boolean} isSingle
98
+ @return {Object} JSON-API Document
99
+ @private
100
+ */
101
+ _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {
102
+ const normalizedPayload = this._normalizeDocumentHelper(payload);
103
+ return normalizedPayload;
104
+ },
105
+ normalizeQueryRecordResponse() {
106
+ const normalized = this._super(...arguments);
107
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
108
+ if (!test) {
109
+ throw new Error('Expected the primary data returned by the serializer for a `queryRecord` response to be a single object but instead it was an array.');
110
+ }
111
+ })(!Array.isArray(normalized.data)) : {};
112
+ return normalized;
113
+ },
114
+ extractAttributes(modelClass, resourceHash) {
115
+ const attributes = {};
116
+ if (resourceHash.attributes) {
117
+ modelClass.eachAttribute(key => {
118
+ const attributeKey = this.keyForAttribute(key, 'deserialize');
119
+ if (resourceHash.attributes[attributeKey] !== undefined) {
120
+ attributes[key] = resourceHash.attributes[attributeKey];
121
+ }
122
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
123
+ if (resourceHash.attributes[attributeKey] === undefined && resourceHash.attributes[key] !== undefined) {
124
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
125
+ {
126
+ throw new Error(`Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${attributeKey}'. This is most likely because Ember Data's JSON API serializer dasherizes attribute keys by default. You should subclass JSONAPISerializer and implement 'keyForAttribute(key) { return key; }' to prevent Ember Data from customizing your attribute keys.`);
127
+ }
128
+ })() : {};
129
+ }
130
+ }
131
+ });
132
+ }
133
+ return attributes;
134
+ },
135
+ /**
136
+ Returns a relationship formatted as a JSON-API "relationship object".
137
+ http://jsonapi.org/format/#document-resource-object-relationships
138
+ @method extractRelationship
139
+ @public
140
+ @param {Object} relationshipHash
141
+ @return {Object}
142
+ */
143
+ extractRelationship(relationshipHash) {
144
+ if (Array.isArray(relationshipHash.data)) {
145
+ const ret = new Array(relationshipHash.data.length);
146
+ for (let i = 0; i < relationshipHash.data.length; i++) {
147
+ const data = relationshipHash.data[i];
148
+ ret[i] = this._normalizeRelationshipDataHelper(data);
149
+ }
150
+ relationshipHash.data = ret;
151
+ } else if (relationshipHash.data && typeof relationshipHash.data === 'object') {
152
+ relationshipHash.data = this._normalizeRelationshipDataHelper(relationshipHash.data);
153
+ }
154
+ return relationshipHash;
155
+ },
156
+ /**
157
+ Returns the resource's relationships formatted as a JSON-API "relationships object".
158
+ http://jsonapi.org/format/#document-resource-object-relationships
159
+ @method extractRelationships
160
+ @public
161
+ @param {Object} modelClass
162
+ @param {Object} resourceHash
163
+ @return {Object}
164
+ */
165
+ extractRelationships(modelClass, resourceHash) {
166
+ const relationships = {};
167
+ if (resourceHash.relationships) {
168
+ modelClass.eachRelationship((key, relationshipMeta) => {
169
+ const relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');
170
+ if (resourceHash.relationships[relationshipKey] !== undefined) {
171
+ const relationshipHash = resourceHash.relationships[relationshipKey];
172
+ relationships[key] = this.extractRelationship(relationshipHash);
173
+ }
174
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
175
+ if (resourceHash.relationships[relationshipKey] === undefined && resourceHash.relationships[key] !== undefined) {
176
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
177
+ {
178
+ throw new Error(`Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${relationshipKey}'. This is most likely because Ember Data's JSON API serializer dasherizes relationship keys by default. You should subclass JSONAPISerializer and implement 'keyForRelationship(key) { return key; }' to prevent Ember Data from customizing your relationship keys.`);
179
+ }
180
+ })() : {};
181
+ }
182
+ }
183
+ });
184
+ }
185
+ return relationships;
186
+ },
187
+ /**
188
+ @method _extractType
189
+ @param {Model} modelClass
190
+ @param {Object} resourceHash
191
+ @return {String}
192
+ @private
193
+ */
194
+ _extractType(modelClass, resourceHash) {
195
+ return this.modelNameFromPayloadKey(resourceHash.type);
196
+ },
197
+ /**
198
+ Dasherizes and singularizes the model name in the payload to match
199
+ the format Ember Data uses internally for the model name.
200
+ For example the key `posts` would be converted to `post` and the
201
+ key `studentAssesments` would be converted to `student-assesment`.
202
+ @method modelNameFromPayloadKey
203
+ @public
204
+ @param {String} key
205
+ @return {String} the model's modelName
206
+ */
207
+ modelNameFromPayloadKey(key) {
208
+ return dasherize(singularize(key));
209
+ },
210
+ /**
211
+ Converts the model name to a pluralized version of the model name.
212
+ For example `post` would be converted to `posts` and
213
+ `student-assesment` would be converted to `student-assesments`.
214
+ @method payloadKeyFromModelName
215
+ @public
216
+ @param {String} modelName
217
+ @return {String}
218
+ */
219
+ payloadKeyFromModelName(modelName) {
220
+ return pluralize(modelName);
221
+ },
222
+ normalize(modelClass, resourceHash) {
223
+ if (resourceHash.attributes) {
224
+ this.normalizeUsingDeclaredMapping(modelClass, resourceHash.attributes);
225
+ }
226
+ if (resourceHash.relationships) {
227
+ this.normalizeUsingDeclaredMapping(modelClass, resourceHash.relationships);
228
+ }
229
+ const data = {
230
+ id: this.extractId(modelClass, resourceHash),
231
+ type: this._extractType(modelClass, resourceHash),
232
+ attributes: this.extractAttributes(modelClass, resourceHash),
233
+ relationships: this.extractRelationships(modelClass, resourceHash)
234
+ };
235
+ if (resourceHash.lid) {
236
+ data.lid = resourceHash.lid;
237
+ }
238
+ this.applyTransforms(modelClass, data.attributes);
239
+ return {
240
+ data
241
+ };
242
+ },
243
+ /**
244
+ `keyForAttribute` can be used to define rules for how to convert an
245
+ attribute name in your model to a key in your JSON.
246
+ By default `JSONAPISerializer` follows the format used on the examples of
247
+ http://jsonapi.org/format and uses dashes as the word separator in the JSON
248
+ attribute keys.
249
+ This behaviour can be easily customized by extending this method.
250
+ Example
251
+ ```app/serializers/application.js
252
+ import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';
253
+ import { dasherize } from '<app-name>/utils/string-utils';
254
+ export default class ApplicationSerializer extends JSONAPISerializer {
255
+ keyForAttribute(attr, method) {
256
+ return dasherize(attr).toUpperCase();
257
+ }
258
+ }
259
+ ```
260
+ @method keyForAttribute
261
+ @public
262
+ @param {String} key
263
+ @param {String} method
264
+ @return {String} normalized key
265
+ */
266
+ keyForAttribute(key, method) {
267
+ return dasherize(key);
268
+ },
269
+ /**
270
+ `keyForRelationship` can be used to define a custom key when
271
+ serializing and deserializing relationship properties.
272
+ By default `JSONAPISerializer` follows the format used on the examples of
273
+ http://jsonapi.org/format and uses dashes as word separators in
274
+ relationship properties.
275
+ This behaviour can be easily customized by extending this method.
276
+ Example
277
+ ```app/serializers/post.js
278
+ import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';
279
+ import { underscore } from '<app-name>/utils/string-utils';
280
+ export default class ApplicationSerializer extends JSONAPISerializer {
281
+ keyForRelationship(key, relationship, method) {
282
+ return underscore(key);
283
+ }
284
+ }
285
+ ```
286
+ @method keyForRelationship
287
+ @public
288
+ @param {String} key
289
+ @param {String} typeClass
290
+ @param {String} method
291
+ @return {String} normalized key
292
+ */
293
+ keyForRelationship(key, typeClass, method) {
294
+ return dasherize(key);
295
+ },
296
+ /**
297
+ Called when a record is saved in order to convert the
298
+ record into JSON.
299
+ For example, consider this model:
300
+ ```app/models/comment.js
301
+ import Model, { attr, belongsTo } from '@ember-data-mirror/model';
302
+ export default class CommentModel extends Model {
303
+ @attr title;
304
+ @attr body;
305
+ @belongsTo('user', { async: false, inverse: null })
306
+ author;
307
+ }
308
+ ```
309
+ The default serialization would create a JSON-API resource object like:
310
+ ```javascript
311
+ {
312
+ "data": {
313
+ "type": "comments",
314
+ "attributes": {
315
+ "title": "Rails is unagi",
316
+ "body": "Rails? Omakase? O_O",
317
+ },
318
+ "relationships": {
319
+ "author": {
320
+ "data": {
321
+ "id": "12",
322
+ "type": "users"
323
+ }
324
+ }
325
+ }
326
+ }
327
+ }
328
+ ```
329
+ By default, attributes are passed through as-is, unless
330
+ you specified an attribute type (`attr('date')`). If
331
+ you specify a transform, the JavaScript value will be
332
+ serialized when inserted into the attributes hash.
333
+ Belongs-to relationships are converted into JSON-API
334
+ resource identifier objects.
335
+ ## IDs
336
+ `serialize` takes an options hash with a single option:
337
+ `includeId`. If this option is `true`, `serialize` will,
338
+ by default include the ID in the JSON object it builds.
339
+ The JSONAPIAdapter passes in `includeId: true` when serializing a record
340
+ for `createRecord` or `updateRecord`.
341
+ ## Customization
342
+ Your server may expect data in a different format than the
343
+ built-in serialization format.
344
+ In that case, you can implement `serialize` yourself and
345
+ return data formatted to match your API's expectations, or override
346
+ the invoked adapter method and do the serialization in the adapter directly
347
+ by using the provided snapshot.
348
+ If your API's format differs greatly from the JSON:API spec, you should
349
+ consider authoring your own adapter and serializer instead of extending
350
+ this class.
351
+ ```app/serializers/post.js
352
+ import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';
353
+ export default class PostSerializer extends JSONAPISerializer {
354
+ serialize(snapshot, options) {
355
+ let json = {
356
+ POST_TTL: snapshot.attr('title'),
357
+ POST_BDY: snapshot.attr('body'),
358
+ POST_CMS: snapshot.hasMany('comments', { ids: true })
359
+ };
360
+ if (options.includeId) {
361
+ json.POST_ID_ = snapshot.id;
362
+ }
363
+ return json;
364
+ }
365
+ }
366
+ ```
367
+ ## Customizing an App-Wide Serializer
368
+ If you want to define a serializer for your entire
369
+ application, you'll probably want to use `eachAttribute`
370
+ and `eachRelationship` on the record.
371
+ ```app/serializers/application.js
372
+ import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';
373
+ import { underscore, singularize } from '<app-name>/utils/string-utils';
374
+ export default class ApplicationSerializer extends JSONAPISerializer {
375
+ serialize(snapshot, options) {
376
+ let json = {};
377
+ snapshot.eachAttribute((name) => {
378
+ json[serverAttributeName(name)] = snapshot.attr(name);
379
+ });
380
+ snapshot.eachRelationship((name, relationship) => {
381
+ if (relationship.kind === 'hasMany') {
382
+ json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });
383
+ }
384
+ });
385
+ if (options.includeId) {
386
+ json.ID_ = snapshot.id;
387
+ }
388
+ return json;
389
+ }
390
+ }
391
+ function serverAttributeName(attribute) {
392
+ return underscore(attribute).toUpperCase();
393
+ }
394
+ function serverHasManyName(name) {
395
+ return serverAttributeName(singularize(name)) + '_IDS';
396
+ }
397
+ ```
398
+ This serializer will generate JSON that looks like this:
399
+ ```javascript
400
+ {
401
+ "TITLE": "Rails is omakase",
402
+ "BODY": "Yep. Omakase.",
403
+ "COMMENT_IDS": [ "1", "2", "3" ]
404
+ }
405
+ ```
406
+ ## Tweaking the Default Formatting
407
+ If you just want to do some small tweaks on the default JSON:API formatted response,
408
+ you can call `super.serialize` first and make the tweaks
409
+ on the returned object.
410
+ ```app/serializers/post.js
411
+ import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';
412
+ export default class PostSerializer extends JSONAPISerializer {
413
+ serialize(snapshot, options) {
414
+ let json = super.serialize(...arguments);
415
+ json.data.attributes.subject = json.data.attributes.title;
416
+ delete json.data.attributes.title;
417
+ return json;
418
+ }
419
+ }
420
+ ```
421
+ @method serialize
422
+ @public
423
+ @param {Snapshot} snapshot
424
+ @param {Object} options
425
+ @return {Object} json
426
+ */
427
+ serialize(snapshot, options) {
428
+ const data = this._super(...arguments);
429
+ data.type = this.payloadKeyFromModelName(snapshot.modelName);
430
+ return {
431
+ data
432
+ };
433
+ },
434
+ serializeAttribute(snapshot, json, key, attribute) {
435
+ const type = attribute.type;
436
+ if (this._canSerialize(key)) {
437
+ json.attributes = json.attributes || {};
438
+ let value = snapshot.attr(key);
439
+ if (type) {
440
+ const transform = this.transformFor(type);
441
+ value = transform.serialize(value, attribute.options);
442
+ }
443
+ const schema = this.store.modelFor(snapshot.modelName);
444
+ let payloadKey = this._getMappedKey(key, schema);
445
+ if (payloadKey === key) {
446
+ payloadKey = this.keyForAttribute(key, 'serialize');
447
+ }
448
+ json.attributes[payloadKey] = value;
449
+ }
450
+ },
451
+ serializeBelongsTo(snapshot, json, relationship) {
452
+ const name = relationship.name;
453
+ if (this._canSerialize(name)) {
454
+ const belongsTo = snapshot.belongsTo(name);
455
+ const belongsToIsNotNew = belongsTo && !belongsTo.isNew;
456
+ if (belongsTo === null || belongsToIsNotNew) {
457
+ json.relationships = json.relationships || {};
458
+ const schema = this.store.modelFor(snapshot.modelName);
459
+ let payloadKey = this._getMappedKey(name, schema);
460
+ if (payloadKey === name) {
461
+ payloadKey = this.keyForRelationship(name, 'belongsTo', 'serialize');
462
+ }
463
+ let data = null;
464
+ if (belongsTo) {
465
+ const payloadType = this.payloadKeyFromModelName(belongsTo.modelName);
466
+ data = {
467
+ type: payloadType,
468
+ id: belongsTo.id
469
+ };
470
+ }
471
+ json.relationships[payloadKey] = {
472
+ data
473
+ };
474
+ }
475
+ }
476
+ },
477
+ serializeHasMany(snapshot, json, relationship) {
478
+ const name = relationship.name;
479
+ if (this.shouldSerializeHasMany(snapshot, name, relationship)) {
480
+ const hasMany = snapshot.hasMany(name);
481
+ if (hasMany !== undefined) {
482
+ json.relationships = json.relationships || {};
483
+ const schema = this.store.modelFor(snapshot.modelName);
484
+ let payloadKey = this._getMappedKey(name, schema);
485
+ if (payloadKey === name && this.keyForRelationship) {
486
+ payloadKey = this.keyForRelationship(name, 'hasMany', 'serialize');
487
+ }
488
+
489
+ // only serialize has many relationships that are not new
490
+ const nonNewHasMany = hasMany.filter(item => !item.isNew);
491
+ const data = new Array(nonNewHasMany.length);
492
+ for (let i = 0; i < nonNewHasMany.length; i++) {
493
+ const item = hasMany[i];
494
+ const payloadType = this.payloadKeyFromModelName(item.modelName);
495
+ data[i] = {
496
+ type: payloadType,
497
+ id: item.id
498
+ };
499
+ }
500
+ json.relationships[payloadKey] = {
501
+ data
502
+ };
503
+ }
504
+ }
505
+ }
506
+ });
507
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
508
+ JSONAPISerializer.reopen({
509
+ init(...args) {
510
+ this._super(...args);
511
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
512
+ if (!test) {
513
+ throw new Error(`You've used the EmbeddedRecordsMixin in ${this.toString()} which is not fully compatible with the JSON:API specification. Please confirm that this works for your specific API and add \`this.isEmbeddedRecordsMixinCompatible = true\` to your serializer.`);
514
+ }
515
+ })(!this.isEmbeddedRecordsMixin || this.isEmbeddedRecordsMixinCompatible === true) : {};
516
+ const constructor = this.constructor;
517
+ warn(`You've defined 'extractMeta' in ${constructor.toString()} which is not used for serializers extending JSONAPISerializer. Read more at https://api.emberjs.com/ember-data/release/classes/JSONAPISerializer on how to customize meta when using JSON API.`, this.extractMeta === JSONSerializer.prototype.extractMeta, {
518
+ id: 'ds.serializer.json-api.extractMeta'
519
+ });
520
+ },
521
+ warnMessageForUndefinedType() {
522
+ return 'Encountered a resource object with an undefined type (resolved resource using ' + this.constructor.toString() + ')';
523
+ },
524
+ warnMessageNoModelForType(modelName, originalType, usedLookup) {
525
+ return `Encountered a resource object with type "${originalType}", but no model was found for model name "${modelName}" (resolved model name using '${this.constructor.toString()}.${usedLookup}("${originalType}")').`;
526
+ }
527
+ });
528
+ }
529
+ export { JSONAPISerializer as default };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-api.js","sources":["../src/json-api.js"],"sourcesContent":["/**\n * @module @ember-data-mirror/serializer/json-api\n */\nimport { warn } from '@ember/debug';\n\nimport { dasherize, pluralize, singularize } from '@ember-data-mirror/request-utils/string';\nimport { DEBUG } from '@warp-drive-mirror/build-config/env';\nimport { assert } from '@warp-drive-mirror/build-config/macros';\n\nimport JSONSerializer from './json';\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 `JSONAPISerializer` supports the http://jsonapi.org/ spec and is the\n serializer recommended by Ember Data.\n\n This serializer normalizes a JSON API payload that looks like:\n\n ```app/models/player.js\n import Model, { attr, belongsTo } from '@ember-data-mirror/model';\n\n export default class Player extends Model {\n @attr('string') name;\n @attr('string') skill;\n @attr('number') gamesPlayed;\n @belongsTo('club') club;\n }\n ```\n\n ```app/models/club.js\n import Model, { attr, hasMany } from '@ember-data-mirror/model';\n\n export default class Club extends Model {\n @attr('string') name;\n @attr('string') location;\n @hasMany('player') players;\n }\n ```\n\n ```js\n {\n \"data\": [\n {\n \"attributes\": {\n \"name\": \"Benfica\",\n \"location\": \"Portugal\"\n },\n \"id\": \"1\",\n \"relationships\": {\n \"players\": {\n \"data\": [\n {\n \"id\": \"3\",\n \"type\": \"players\"\n }\n ]\n }\n },\n \"type\": \"clubs\"\n }\n ],\n \"included\": [\n {\n \"attributes\": {\n \"name\": \"Eusebio Silva Ferreira\",\n \"skill\": \"Rocket shot\",\n \"games-played\": 431\n },\n \"id\": \"3\",\n \"relationships\": {\n \"club\": {\n \"data\": {\n \"id\": \"1\",\n \"type\": \"clubs\"\n }\n }\n },\n \"type\": \"players\"\n }\n ]\n }\n ```\n\n to the format that the Ember Data store expects.\n\n ### Customizing meta\n\n Since a JSON API Document can have meta defined in multiple locations you can\n use the specific serializer hooks if you need to customize the meta.\n\n One scenario would be to camelCase the meta keys of your payload. The example\n below shows how this could be done using `normalizeArrayResponse` and\n `extractRelationship`.\n\n ```app/serializers/application.js\n import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n let normalizedDocument = super.normalizeArrayResponse(...arguments);\n\n // Customize document meta\n normalizedDocument.meta = camelCaseKeys(normalizedDocument.meta);\n\n return normalizedDocument;\n }\n\n extractRelationship(relationshipHash) {\n let normalizedRelationship = super.extractRelationship(...arguments);\n\n // Customize relationship meta\n normalizedRelationship.meta = camelCaseKeys(normalizedRelationship.meta);\n\n return normalizedRelationship;\n }\n }\n ```\n\n @main @ember-data-mirror/serializer/json-api\n @since 1.13.0\n @class JSONAPISerializer\n @public\n @extends JSONSerializer\n*/\nconst JSONAPISerializer = JSONSerializer.extend({\n /**\n @method _normalizeDocumentHelper\n @param {Object} documentHash\n @return {Object}\n @private\n */\n _normalizeDocumentHelper(documentHash) {\n if (Array.isArray(documentHash.data)) {\n const ret = new Array(documentHash.data.length);\n\n for (let i = 0; i < documentHash.data.length; i++) {\n const data = documentHash.data[i];\n ret[i] = this._normalizeResourceHelper(data);\n }\n\n documentHash.data = ret;\n } else if (documentHash.data && typeof documentHash.data === 'object') {\n documentHash.data = this._normalizeResourceHelper(documentHash.data);\n }\n\n if (Array.isArray(documentHash.included)) {\n const ret = new Array();\n for (let i = 0; i < documentHash.included.length; i++) {\n const included = documentHash.included[i];\n const normalized = this._normalizeResourceHelper(included);\n if (normalized !== null) {\n // can be null when unknown type is encountered\n ret.push(normalized);\n }\n }\n\n documentHash.included = ret;\n }\n\n return documentHash;\n },\n\n /**\n @method _normalizeRelationshipDataHelper\n @param {Object} relationshipDataHash\n @return {Object}\n @private\n */\n _normalizeRelationshipDataHelper(relationshipDataHash) {\n relationshipDataHash.type = this.modelNameFromPayloadKey(relationshipDataHash.type);\n\n return relationshipDataHash;\n },\n\n /**\n @method _normalizeResourceHelper\n @param {Object} resourceHash\n @return {Object}\n @private\n */\n _normalizeResourceHelper(resourceHash) {\n assert(this.warnMessageForUndefinedType(), resourceHash.type);\n\n const type = this.modelNameFromPayloadKey(resourceHash.type);\n\n if (!this.store.schema.hasResource({ type })) {\n warn(this.warnMessageNoModelForType(type, resourceHash.type, 'modelNameFromPayloadKey'), false, {\n id: 'ds.serializer.model-for-type-missing',\n });\n return null;\n }\n\n const modelClass = this.store.modelFor(type);\n const serializer = this.store.serializerFor(type);\n const { data } = serializer.normalize(modelClass, resourceHash);\n return data;\n },\n\n /**\n Normalize some data and push it into the store.\n\n @method pushPayload\n @public\n @param {Store} store\n @param {Object} payload\n */\n pushPayload(store, payload) {\n const normalizedPayload = this._normalizeDocumentHelper(payload);\n store.push(normalizedPayload);\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 normalizedPayload = this._normalizeDocumentHelper(payload);\n return normalizedPayload;\n },\n\n normalizeQueryRecordResponse() {\n const normalized = this._super(...arguments);\n\n assert(\n 'Expected the primary data returned by the serializer for a `queryRecord` response to be a single object but instead it was an array.',\n !Array.isArray(normalized.data)\n );\n\n return normalized;\n },\n\n extractAttributes(modelClass, resourceHash) {\n const attributes = {};\n\n if (resourceHash.attributes) {\n modelClass.eachAttribute((key) => {\n const attributeKey = this.keyForAttribute(key, 'deserialize');\n if (resourceHash.attributes[attributeKey] !== undefined) {\n attributes[key] = resourceHash.attributes[attributeKey];\n }\n if (DEBUG) {\n if (resourceHash.attributes[attributeKey] === undefined && resourceHash.attributes[key] !== undefined) {\n assert(\n `Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${attributeKey}'. This is most likely because Ember Data's JSON API serializer dasherizes attribute keys by default. You should subclass JSONAPISerializer and implement 'keyForAttribute(key) { return key; }' to prevent Ember Data from customizing your attribute keys.`,\n false\n );\n }\n }\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} relationshipHash\n @return {Object}\n */\n extractRelationship(relationshipHash) {\n if (Array.isArray(relationshipHash.data)) {\n const ret = new Array(relationshipHash.data.length);\n\n for (let i = 0; i < relationshipHash.data.length; i++) {\n const data = relationshipHash.data[i];\n ret[i] = this._normalizeRelationshipDataHelper(data);\n }\n\n relationshipHash.data = ret;\n } else if (relationshipHash.data && typeof relationshipHash.data === 'object') {\n relationshipHash.data = this._normalizeRelationshipDataHelper(relationshipHash.data);\n }\n\n return 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 if (resourceHash.relationships) {\n modelClass.eachRelationship((key, relationshipMeta) => {\n const relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');\n if (resourceHash.relationships[relationshipKey] !== undefined) {\n const relationshipHash = resourceHash.relationships[relationshipKey];\n relationships[key] = this.extractRelationship(relationshipHash);\n }\n if (DEBUG) {\n if (\n resourceHash.relationships[relationshipKey] === undefined &&\n resourceHash.relationships[key] !== undefined\n ) {\n assert(\n `Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${relationshipKey}'. This is most likely because Ember Data's JSON API serializer dasherizes relationship keys by default. You should subclass JSONAPISerializer and implement 'keyForRelationship(key) { return key; }' to prevent Ember Data from customizing your relationship keys.`,\n false\n );\n }\n }\n });\n }\n\n return relationships;\n },\n\n /**\n @method _extractType\n @param {Model} modelClass\n @param {Object} resourceHash\n @return {String}\n @private\n */\n _extractType(modelClass, resourceHash) {\n return this.modelNameFromPayloadKey(resourceHash.type);\n },\n\n /**\n Dasherizes and singularizes the model name in the payload to match\n the format Ember Data uses internally for the model name.\n\n For example the key `posts` would be converted to `post` and the\n key `studentAssesments` would be converted to `student-assesment`.\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 Converts the model name to a pluralized version of the model name.\n\n For example `post` would be converted to `posts` and\n `student-assesment` would be converted to `student-assesments`.\n\n @method payloadKeyFromModelName\n @public\n @param {String} modelName\n @return {String}\n */\n payloadKeyFromModelName(modelName) {\n return pluralize(modelName);\n },\n\n normalize(modelClass, resourceHash) {\n if (resourceHash.attributes) {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash.attributes);\n }\n\n if (resourceHash.relationships) {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash.relationships);\n }\n\n const data = {\n id: this.extractId(modelClass, resourceHash),\n type: this._extractType(modelClass, resourceHash),\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 return { data };\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 By default `JSONAPISerializer` follows the format used on the examples of\n http://jsonapi.org/format and uses dashes as the word separator in the JSON\n attribute keys.\n\n This behaviour can be easily customized by extending this method.\n\n Example\n\n ```app/serializers/application.js\n import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';\n import { dasherize } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n keyForAttribute(attr, method) {\n return dasherize(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 dasherize(key);\n },\n\n /**\n `keyForRelationship` can be used to define a custom key when\n serializing and deserializing relationship properties.\n By default `JSONAPISerializer` follows the format used on the examples of\n http://jsonapi.org/format and uses dashes as word separators in\n relationship properties.\n\n This behaviour can be easily customized by extending this method.\n\n Example\n\n ```app/serializers/post.js\n import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n keyForRelationship(key, relationship, method) {\n return underscore(key);\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 dasherize(key);\n },\n\n /**\n Called when a record is saved in order to convert the\n record into JSON.\n\n For example, consider this model:\n\n ```app/models/comment.js\n import Model, { attr, belongsTo } from '@ember-data-mirror/model';\n\n export default class CommentModel extends Model {\n @attr title;\n @attr body;\n\n @belongsTo('user', { async: false, inverse: null })\n author;\n }\n ```\n\n The default serialization would create a JSON-API resource object like:\n\n ```javascript\n {\n \"data\": {\n \"type\": \"comments\",\n \"attributes\": {\n \"title\": \"Rails is unagi\",\n \"body\": \"Rails? Omakase? O_O\",\n },\n \"relationships\": {\n \"author\": {\n \"data\": {\n \"id\": \"12\",\n \"type\": \"users\"\n }\n }\n }\n }\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 attributes hash.\n\n Belongs-to relationships are converted into JSON-API\n resource identifier objects.\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 JSONAPIAdapter passes in `includeId: true` when serializing a record\n for `createRecord` or `updateRecord`.\n\n ## Customization\n\n Your server may expect data in a different format than the\n built-in serialization format.\n\n In that case, you can implement `serialize` yourself and\n return data formatted to match your API's expectations, or override\n the invoked adapter method and do the serialization in the adapter directly\n by using the provided snapshot.\n\n If your API's format differs greatly from the JSON:API spec, you should\n consider authoring your own adapter and serializer instead of extending\n this class.\n\n ```app/serializers/post.js\n import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';\n\n export default class PostSerializer extends JSONAPISerializer {\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 JSONAPISerializer from '@ember-data-mirror/serializer/json-api';\n import { underscore, singularize } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\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 underscore(attribute).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 Formatting\n\n If you just want to do some small tweaks on the default JSON:API formatted response,\n you can call `super.serialize` first and make the tweaks\n on the returned object.\n\n ```app/serializers/post.js\n import JSONAPISerializer from '@ember-data-mirror/serializer/json-api';\n\n export default class PostSerializer extends JSONAPISerializer {\n serialize(snapshot, options) {\n let json = super.serialize(...arguments);\n\n json.data.attributes.subject = json.data.attributes.title;\n delete json.data.attributes.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 data = this._super(...arguments);\n data.type = this.payloadKeyFromModelName(snapshot.modelName);\n\n return { data };\n },\n\n serializeAttribute(snapshot, json, key, attribute) {\n const type = attribute.type;\n\n if (this._canSerialize(key)) {\n json.attributes = json.attributes || {};\n\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 const schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(key, schema);\n\n if (payloadKey === key) {\n payloadKey = this.keyForAttribute(key, 'serialize');\n }\n\n json.attributes[payloadKey] = value;\n }\n },\n\n serializeBelongsTo(snapshot, json, relationship) {\n const name = relationship.name;\n\n if (this._canSerialize(name)) {\n const belongsTo = snapshot.belongsTo(name);\n const belongsToIsNotNew = belongsTo && !belongsTo.isNew;\n\n if (belongsTo === null || belongsToIsNotNew) {\n json.relationships = json.relationships || {};\n\n const schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(name, schema);\n if (payloadKey === name) {\n payloadKey = this.keyForRelationship(name, 'belongsTo', 'serialize');\n }\n\n let data = null;\n if (belongsTo) {\n const payloadType = this.payloadKeyFromModelName(belongsTo.modelName);\n\n data = {\n type: payloadType,\n id: belongsTo.id,\n };\n }\n\n json.relationships[payloadKey] = { data };\n }\n }\n },\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);\n if (hasMany !== undefined) {\n json.relationships = json.relationships || {};\n\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 // only serialize has many relationships that are not new\n const nonNewHasMany = hasMany.filter((item) => !item.isNew);\n const data = new Array(nonNewHasMany.length);\n\n for (let i = 0; i < nonNewHasMany.length; i++) {\n const item = hasMany[i];\n const payloadType = this.payloadKeyFromModelName(item.modelName);\n\n data[i] = {\n type: payloadType,\n id: item.id,\n };\n }\n\n json.relationships[payloadKey] = { data };\n }\n }\n },\n});\n\nif (DEBUG) {\n JSONAPISerializer.reopen({\n init(...args) {\n this._super(...args);\n\n assert(\n `You've used the EmbeddedRecordsMixin in ${this.toString()} which is not fully compatible with the JSON:API specification. Please confirm that this works for your specific API and add \\`this.isEmbeddedRecordsMixinCompatible = true\\` to your serializer.`,\n !this.isEmbeddedRecordsMixin || this.isEmbeddedRecordsMixinCompatible === true\n );\n\n const constructor = this.constructor;\n warn(\n `You've defined 'extractMeta' in ${constructor.toString()} which is not used for serializers extending JSONAPISerializer. Read more at https://api.emberjs.com/ember-data/release/classes/JSONAPISerializer on how to customize meta when using JSON API.`,\n this.extractMeta === JSONSerializer.prototype.extractMeta,\n {\n id: 'ds.serializer.json-api.extractMeta',\n }\n );\n },\n warnMessageForUndefinedType() {\n return (\n 'Encountered a resource object with an undefined type (resolved resource using ' +\n this.constructor.toString() +\n ')'\n );\n },\n warnMessageNoModelForType(modelName, originalType, usedLookup) {\n return `Encountered a resource object with type \"${originalType}\", but no model was found for model name \"${modelName}\" (resolved model name using '${this.constructor.toString()}.${usedLookup}(\"${originalType}\")').`;\n },\n });\n}\n\nexport default JSONAPISerializer;\n"],"names":["JSONAPISerializer","JSONSerializer","extend","_normalizeDocumentHelper","documentHash","Array","isArray","data","ret","length","i","_normalizeResourceHelper","included","normalized","push","_normalizeRelationshipDataHelper","relationshipDataHash","type","modelNameFromPayloadKey","resourceHash","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","warnMessageForUndefinedType","store","schema","hasResource","warn","warnMessageNoModelForType","id","modelClass","modelFor","serializer","serializerFor","normalize","pushPayload","payload","normalizedPayload","_normalizeResponse","primaryModelClass","requestType","isSingle","normalizeQueryRecordResponse","_super","arguments","extractAttributes","attributes","eachAttribute","key","attributeKey","keyForAttribute","undefined","modelName","extractRelationship","relationshipHash","extractRelationships","relationships","eachRelationship","relationshipMeta","relationshipKey","keyForRelationship","kind","_extractType","dasherize","singularize","payloadKeyFromModelName","pluralize","normalizeUsingDeclaredMapping","extractId","lid","applyTransforms","method","typeClass","serialize","snapshot","options","serializeAttribute","json","attribute","_canSerialize","value","attr","transform","transformFor","payloadKey","_getMappedKey","serializeBelongsTo","relationship","name","belongsTo","belongsToIsNotNew","isNew","payloadType","serializeHasMany","shouldSerializeHasMany","hasMany","nonNewHasMany","filter","item","reopen","init","args","toString","isEmbeddedRecordsMixin","isEmbeddedRecordsMixinCompatible","constructor","extractMeta","prototype","originalType","usedLookup"],"mappings":";;;;;AAAA;AACA;AACA;AAsIA,MAAMA,iBAAiB,GAAGC,cAAc,CAACC,MAAM,CAAC;AAC9C;AACF;AACA;AACA;AACA;AACA;EACEC,wBAAwBA,CAACC,YAAY,EAAE;IACrC,IAAIC,KAAK,CAACC,OAAO,CAACF,YAAY,CAACG,IAAI,CAAC,EAAE;MACpC,MAAMC,GAAG,GAAG,IAAIH,KAAK,CAACD,YAAY,CAACG,IAAI,CAACE,MAAM,CAAC;AAE/C,MAAA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGN,YAAY,CAACG,IAAI,CAACE,MAAM,EAAEC,CAAC,EAAE,EAAE;AACjD,QAAA,MAAMH,IAAI,GAAGH,YAAY,CAACG,IAAI,CAACG,CAAC,CAAC;QACjCF,GAAG,CAACE,CAAC,CAAC,GAAG,IAAI,CAACC,wBAAwB,CAACJ,IAAI,CAAC;AAC9C;MAEAH,YAAY,CAACG,IAAI,GAAGC,GAAG;AACzB,KAAC,MAAM,IAAIJ,YAAY,CAACG,IAAI,IAAI,OAAOH,YAAY,CAACG,IAAI,KAAK,QAAQ,EAAE;MACrEH,YAAY,CAACG,IAAI,GAAG,IAAI,CAACI,wBAAwB,CAACP,YAAY,CAACG,IAAI,CAAC;AACtE;IAEA,IAAIF,KAAK,CAACC,OAAO,CAACF,YAAY,CAACQ,QAAQ,CAAC,EAAE;AACxC,MAAA,MAAMJ,GAAG,GAAG,IAAIH,KAAK,EAAE;AACvB,MAAA,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGN,YAAY,CAACQ,QAAQ,CAACH,MAAM,EAAEC,CAAC,EA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AAEf,YAAY,CAACyC,aAAa,CAAC;AAC5E;AAEA,IAAA,MAAMrD,IAAI,GAAG;MACX0B,EAAE,EAAE,IAAI,CAACuC,SAAS,CAACtC,UAAU,EAAEf,YAAY,CAAC;MAC5CF,IAAI,EAAE,IAAI,CAACiD,YAAY,CAAChC,UAAU,EAAEf,YAAY,CAAC;MACjD+B,UAAU,EAAE,IAAI,CAACD,iBAAiB,CAACf,UAAU,EAAEf,YAAY,CAAC;AAC5DyC,MAAAA,aAAa,EAAE,IAAI,CAACD,oBAAoB,CAACzB,UAAU,EAAEf,YAAY;KAClE;IAED,IAAIA,YAAY,CAACsD,GAAG,EAAE;AACpBlE,MAAAA,IAAI,CAACkE,GAAG,GAAGtD,YAAY,CAACsD,GAAG;AAC7B;IAEA,IAAI,CAACC,eAAe,CAACxC,UAAU,EAAE3B,IAAI,CAAC2C,UAAU,CAAC;IAEjD,OAAO;AAAE3C,MAAAA;KAAM;GAChB;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAME+C,EAAAA,eAAeA,CAACF,GAAG,EAAEuB,MAAM,EAAE;IAC3B,OAAOR,SAAS,CAACf,GAAG,CAAC;GACtB;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKEY,EAAAA,kBAAkBA,CAACZ,GAAG,EAAEwB,SAAS,EAAED,MAAM,EAAE;IACzC,OAAOR,SAAS,CAACf,GAAG,CAAC;GACtB;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAuCEyB,EAAAA,SAASA,CAACC,QAAQ,EAAEC,OAAO,EAAE;IAC3B,MAAMxE,IAAI,GAAG,IAAI,CAACwC,MAAM,CAAC,GAAGC,SAAS,CAAC;IACtCzC,IAAI,CAACU,IAAI,GAAG,IAAI,CAACoD,uBAAuB,CAACS,QAAQ,CAACtB,SAAS,CAAC;IAE5D,OAAO;AAAEjD,MAAAA;KAAM;GAChB;EAEDyE,kBAAkBA,CAACF,QAAQ,EAAEG,IAAI,EAAE7B,GAAG,EAAE8B,SAAS,EAAE;AACjD,IAAA,MAAMjE,IAAI,GAAGiE,SAAS,CAACjE,IAAI;AAE3B,IAAA,IAAI,IAAI,CAACkE,aAAa,CAAC/B,GAAG,CAAC,EAAE;MAC3B6B,IAAI,CAAC/B,UAAU,GAAG+B,IAAI,CAAC/B,UAAU,IAAI,EAAE;AAEvC,MAAA,IAAIkC,KAAK,GAAGN,QAAQ,CAACO,IAAI,CAACjC,GAAG,CAAC;AAC9B,MAAA,IAAInC,IAAI,EAAE;AACR,QAAA,MAAMqE,SAAS,GAAG,IAAI,CAACC,YAAY,CAACtE,IAAI,CAAC;QACzCmE,KAAK,GAAGE,SAAS,CAACT,SAAS,CAACO,KAAK,EAAEF,SAAS,CAACH,OAAO,CAAC;AACvD;MAEA,MAAMlD,MAAM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AACDN,IAAAA,2BAA2BA,GAAG;MAC5B,OACE,gFAAgF,GAChF,IAAI,CAACkF,WAAW,CAACH,QAAQ,EAAE,GAC3B,GAAG;KAEN;AACD1E,IAAAA,yBAAyBA,CAACwB,SAAS,EAAEwD,YAAY,EAAEC,UAAU,EAAE;AAC7D,MAAA,OAAO,4CAA4CD,YAAY,CAAA,0CAAA,EAA6CxD,SAAS,CAAA,8BAAA,EAAiC,IAAI,CAACqD,WAAW,CAACH,QAAQ,EAAE,CAAA,CAAA,EAAIO,UAAU,CAAA,EAAA,EAAKD,YAAY,CAAO,KAAA,CAAA;AACzN;AACF,GAAC,CAAC;AACJ;;;;"}
package/dist/json.js ADDED
@@ -0,0 +1,6 @@
1
+ import '@ember/application';
2
+ import '@ember/debug';
3
+ import '@ember-data-mirror/request-utils/string';
4
+ import "./index.js";
5
+ export { J as default } from "./json-BwMH6O_R.js";
6
+ import '@embroider/macros';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}