@ember-data/serializer 5.5.0-alpha.9 → 5.5.0-beta.0

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 (78) hide show
  1. package/LICENSE.md +19 -7
  2. package/README.md +16 -10
  3. package/addon-main.cjs +5 -0
  4. package/blueprints/serializer/index.js +71 -5
  5. package/blueprints/serializer-test/index.js +13 -7
  6. package/blueprints/serializer-test/qunit-files/__root__/__path__/__test__.js +8 -9
  7. package/blueprints/transform/index.js +14 -4
  8. package/blueprints/transform-test/index.js +13 -7
  9. package/blueprints/transform-test/qunit-files/__root__/__path__/__test__.js +3 -4
  10. package/dist/index.js +306 -0
  11. package/dist/index.js.map +1 -0
  12. package/{addon/json.js → dist/json-CVTR4xWv.js} +86 -66
  13. package/dist/json-CVTR4xWv.js.map +1 -0
  14. package/{addon → dist}/json-api.js +88 -64
  15. package/dist/json-api.js.map +1 -0
  16. package/dist/json.js +6 -0
  17. package/dist/json.js.map +1 -0
  18. package/dist/rest.js +1274 -0
  19. package/dist/rest.js.map +1 -0
  20. package/{addon/string-22572f80.js → dist/transform.js} +143 -20
  21. package/dist/transform.js.map +1 -0
  22. package/logos/NCC-1701-a-blue.svg +4 -0
  23. package/logos/NCC-1701-a-gold.svg +4 -0
  24. package/logos/NCC-1701-a-gold_100.svg +1 -0
  25. package/logos/NCC-1701-a-gold_base-64.txt +1 -0
  26. package/logos/NCC-1701-a.svg +4 -0
  27. package/logos/README.md +4 -0
  28. package/logos/docs-badge.svg +2 -0
  29. package/logos/github-header.svg +444 -0
  30. package/logos/social1.png +0 -0
  31. package/logos/social2.png +0 -0
  32. package/logos/warp-drive-logo-dark.svg +4 -0
  33. package/logos/warp-drive-logo-gold.svg +4 -0
  34. package/package.json +60 -45
  35. package/unstable-preview-types/-private/embedded-records-mixin.d.ts +102 -0
  36. package/unstable-preview-types/-private/embedded-records-mixin.d.ts.map +1 -0
  37. package/unstable-preview-types/-private/transforms/boolean.d.ts +52 -0
  38. package/unstable-preview-types/-private/transforms/boolean.d.ts.map +1 -0
  39. package/unstable-preview-types/-private/transforms/boolean.type-test.d.ts +4 -0
  40. package/unstable-preview-types/-private/transforms/boolean.type-test.d.ts.map +1 -0
  41. package/unstable-preview-types/-private/transforms/date.d.ts +33 -0
  42. package/unstable-preview-types/-private/transforms/date.d.ts.map +1 -0
  43. package/unstable-preview-types/-private/transforms/number.d.ts +34 -0
  44. package/unstable-preview-types/-private/transforms/number.d.ts.map +1 -0
  45. package/unstable-preview-types/-private/transforms/string.d.ts +34 -0
  46. package/unstable-preview-types/-private/transforms/string.d.ts.map +1 -0
  47. package/unstable-preview-types/-private/transforms/transform.d.ts +126 -0
  48. package/unstable-preview-types/-private/transforms/transform.d.ts.map +1 -0
  49. package/unstable-preview-types/-private/utils.d.ts +6 -0
  50. package/unstable-preview-types/-private/utils.d.ts.map +1 -0
  51. package/unstable-preview-types/index.d.ts +277 -0
  52. package/unstable-preview-types/index.d.ts.map +1 -0
  53. package/unstable-preview-types/json-api.d.ts +514 -0
  54. package/unstable-preview-types/json-api.d.ts.map +1 -0
  55. package/unstable-preview-types/json.d.ts +1093 -0
  56. package/unstable-preview-types/json.d.ts.map +1 -0
  57. package/unstable-preview-types/rest.d.ts +570 -0
  58. package/unstable-preview-types/rest.d.ts.map +1 -0
  59. package/unstable-preview-types/transform.d.ts +11 -0
  60. package/unstable-preview-types/transform.d.ts.map +1 -0
  61. package/addon/-private.js +0 -4
  62. package/addon/-private.js.map +0 -1
  63. package/addon/embedded-records-mixin-d75385ff.js +0 -575
  64. package/addon/embedded-records-mixin-d75385ff.js.map +0 -1
  65. package/addon/index.js +0 -180
  66. package/addon/index.js.map +0 -1
  67. package/addon/json-api.js.map +0 -1
  68. package/addon/json.js.map +0 -1
  69. package/addon/rest.js +0 -684
  70. package/addon/rest.js.map +0 -1
  71. package/addon/string-22572f80.js.map +0 -1
  72. package/addon/transform.js +0 -2
  73. package/addon/transform.js.map +0 -1
  74. package/addon/utils-075c5b79.js +0 -12
  75. package/addon/utils-075c5b79.js.map +0 -1
  76. package/addon-main.js +0 -93
  77. /package/{ember-data-logo-dark.svg → logos/ember-data-logo-dark.svg} +0 -0
  78. /package/{ember-data-logo-light.svg → logos/ember-data-logo-light.svg} +0 -0
@@ -1,8 +1,7 @@
1
- import { assert, warn } from '@ember/debug';
2
- import { dasherize } from '@ember/string';
3
- import { singularize, pluralize } from 'ember-inflector';
4
- import JSONSerializer from "./json";
5
- import { macroCondition, getOwnConfig } from '@embroider/macros';
1
+ import { warn } from '@ember/debug';
2
+ import { dasherize, pluralize, singularize } from '@ember-data/request-utils/string';
3
+ import { J as JSONSerializer } from "./json-CVTR4xWv.js";
4
+ import { macroCondition, getGlobalConfig } from '@embroider/macros';
6
5
 
7
6
  /**
8
7
  * @module @ember-data/serializer/json-api
@@ -16,9 +15,9 @@ const JSONAPISerializer = JSONSerializer.extend({
16
15
  */
17
16
  _normalizeDocumentHelper(documentHash) {
18
17
  if (Array.isArray(documentHash.data)) {
19
- let ret = new Array(documentHash.data.length);
18
+ const ret = new Array(documentHash.data.length);
20
19
  for (let i = 0; i < documentHash.data.length; i++) {
21
- let data = documentHash.data[i];
20
+ const data = documentHash.data[i];
22
21
  ret[i] = this._normalizeResourceHelper(data);
23
22
  }
24
23
  documentHash.data = ret;
@@ -26,10 +25,10 @@ const JSONAPISerializer = JSONSerializer.extend({
26
25
  documentHash.data = this._normalizeResourceHelper(documentHash.data);
27
26
  }
28
27
  if (Array.isArray(documentHash.included)) {
29
- let ret = new Array();
28
+ const ret = new Array();
30
29
  for (let i = 0; i < documentHash.included.length; i++) {
31
- let included = documentHash.included[i];
32
- let normalized = this._normalizeResourceHelper(included);
30
+ const included = documentHash.included[i];
31
+ const normalized = this._normalizeResourceHelper(included);
33
32
  if (normalized !== null) {
34
33
  // can be null when unknown type is encountered
35
34
  ret.push(normalized);
@@ -56,19 +55,25 @@ const JSONAPISerializer = JSONSerializer.extend({
56
55
  @private
57
56
  */
58
57
  _normalizeResourceHelper(resourceHash) {
59
- assert(this.warnMessageForUndefinedType(), resourceHash.type);
60
- let modelName, usedLookup;
61
- modelName = this.modelNameFromPayloadKey(resourceHash.type);
62
- usedLookup = 'modelNameFromPayloadKey';
63
- if (!this.store.getSchemaDefinitionService().doesTypeExist(modelName)) {
64
- warn(this.warnMessageNoModelForType(modelName, resourceHash.type, usedLookup), false, {
65
- id: 'ds.serializer.model-for-type-missing'
66
- });
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
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
68
+ warn(this.warnMessageNoModelForType(type, resourceHash.type, 'modelNameFromPayloadKey'), false, {
69
+ id: 'ds.serializer.model-for-type-missing'
70
+ });
71
+ }
67
72
  return null;
68
73
  }
69
- let modelClass = this.store.modelFor(modelName);
70
- let serializer = this.store.serializerFor(modelName);
71
- let {
74
+ const modelClass = this.store.modelFor(type);
75
+ const serializer = this.store.serializerFor(type);
76
+ const {
72
77
  data
73
78
  } = serializer.normalize(modelClass, resourceHash);
74
79
  return data;
@@ -81,7 +86,7 @@ const JSONAPISerializer = JSONSerializer.extend({
81
86
  @param {Object} payload
82
87
  */
83
88
  pushPayload(store, payload) {
84
- let normalizedPayload = this._normalizeDocumentHelper(payload);
89
+ const normalizedPayload = this._normalizeDocumentHelper(payload);
85
90
  store.push(normalizedPayload);
86
91
  },
87
92
  /**
@@ -96,25 +101,33 @@ const JSONAPISerializer = JSONSerializer.extend({
96
101
  @private
97
102
  */
98
103
  _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {
99
- let normalizedPayload = this._normalizeDocumentHelper(payload);
104
+ const normalizedPayload = this._normalizeDocumentHelper(payload);
100
105
  return normalizedPayload;
101
106
  },
102
107
  normalizeQueryRecordResponse() {
103
- let normalized = this._super(...arguments);
104
- assert('Expected the primary data returned by the serializer for a `queryRecord` response to be a single object but instead it was an array.', !Array.isArray(normalized.data));
108
+ const normalized = this._super(...arguments);
109
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
110
+ if (!test) {
111
+ 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.');
112
+ }
113
+ })(!Array.isArray(normalized.data)) : {};
105
114
  return normalized;
106
115
  },
107
116
  extractAttributes(modelClass, resourceHash) {
108
- let attributes = {};
117
+ const attributes = {};
109
118
  if (resourceHash.attributes) {
110
119
  modelClass.eachAttribute(key => {
111
- let attributeKey = this.keyForAttribute(key, 'deserialize');
120
+ const attributeKey = this.keyForAttribute(key, 'deserialize');
112
121
  if (resourceHash.attributes[attributeKey] !== undefined) {
113
122
  attributes[key] = resourceHash.attributes[attributeKey];
114
123
  }
115
- if (macroCondition(getOwnConfig().env.DEBUG)) {
124
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
116
125
  if (resourceHash.attributes[attributeKey] === undefined && resourceHash.attributes[key] !== undefined) {
117
- assert(`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.`, false);
126
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
127
+ {
128
+ 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.`);
129
+ }
130
+ })() : {};
118
131
  }
119
132
  }
120
133
  });
@@ -131,9 +144,9 @@ const JSONAPISerializer = JSONSerializer.extend({
131
144
  */
132
145
  extractRelationship(relationshipHash) {
133
146
  if (Array.isArray(relationshipHash.data)) {
134
- let ret = new Array(relationshipHash.data.length);
147
+ const ret = new Array(relationshipHash.data.length);
135
148
  for (let i = 0; i < relationshipHash.data.length; i++) {
136
- let data = relationshipHash.data[i];
149
+ const data = relationshipHash.data[i];
137
150
  ret[i] = this._normalizeRelationshipDataHelper(data);
138
151
  }
139
152
  relationshipHash.data = ret;
@@ -152,17 +165,21 @@ const JSONAPISerializer = JSONSerializer.extend({
152
165
  @return {Object}
153
166
  */
154
167
  extractRelationships(modelClass, resourceHash) {
155
- let relationships = {};
168
+ const relationships = {};
156
169
  if (resourceHash.relationships) {
157
170
  modelClass.eachRelationship((key, relationshipMeta) => {
158
- let relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');
171
+ const relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');
159
172
  if (resourceHash.relationships[relationshipKey] !== undefined) {
160
- let relationshipHash = resourceHash.relationships[relationshipKey];
173
+ const relationshipHash = resourceHash.relationships[relationshipKey];
161
174
  relationships[key] = this.extractRelationship(relationshipHash);
162
175
  }
163
- if (macroCondition(getOwnConfig().env.DEBUG)) {
176
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
164
177
  if (resourceHash.relationships[relationshipKey] === undefined && resourceHash.relationships[key] !== undefined) {
165
- assert(`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.`, false);
178
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
179
+ {
180
+ 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.`);
181
+ }
182
+ })() : {};
166
183
  }
167
184
  }
168
185
  });
@@ -211,12 +228,15 @@ const JSONAPISerializer = JSONSerializer.extend({
211
228
  if (resourceHash.relationships) {
212
229
  this.normalizeUsingDeclaredMapping(modelClass, resourceHash.relationships);
213
230
  }
214
- let data = {
231
+ const data = {
215
232
  id: this.extractId(modelClass, resourceHash),
216
233
  type: this._extractType(modelClass, resourceHash),
217
234
  attributes: this.extractAttributes(modelClass, resourceHash),
218
235
  relationships: this.extractRelationships(modelClass, resourceHash)
219
236
  };
237
+ if (resourceHash.lid) {
238
+ data.lid = resourceHash.lid;
239
+ }
220
240
  this.applyTransforms(modelClass, data.attributes);
221
241
  return {
222
242
  data
@@ -407,22 +427,22 @@ const JSONAPISerializer = JSONSerializer.extend({
407
427
  @return {Object} json
408
428
  */
409
429
  serialize(snapshot, options) {
410
- let data = this._super(...arguments);
430
+ const data = this._super(...arguments);
411
431
  data.type = this.payloadKeyFromModelName(snapshot.modelName);
412
432
  return {
413
433
  data
414
434
  };
415
435
  },
416
436
  serializeAttribute(snapshot, json, key, attribute) {
417
- let type = attribute.type;
437
+ const type = attribute.type;
418
438
  if (this._canSerialize(key)) {
419
439
  json.attributes = json.attributes || {};
420
440
  let value = snapshot.attr(key);
421
441
  if (type) {
422
- let transform = this.transformFor(type);
442
+ const transform = this.transformFor(type);
423
443
  value = transform.serialize(value, attribute.options);
424
444
  }
425
- let schema = this.store.modelFor(snapshot.modelName);
445
+ const schema = this.store.modelFor(snapshot.modelName);
426
446
  let payloadKey = this._getMappedKey(key, schema);
427
447
  if (payloadKey === key) {
428
448
  payloadKey = this.keyForAttribute(key, 'serialize');
@@ -431,20 +451,20 @@ const JSONAPISerializer = JSONSerializer.extend({
431
451
  }
432
452
  },
433
453
  serializeBelongsTo(snapshot, json, relationship) {
434
- let key = relationship.key;
435
- if (this._canSerialize(key)) {
436
- let belongsTo = snapshot.belongsTo(key);
437
- let belongsToIsNotNew = belongsTo && !belongsTo.isNew;
454
+ const name = relationship.name;
455
+ if (this._canSerialize(name)) {
456
+ const belongsTo = snapshot.belongsTo(name);
457
+ const belongsToIsNotNew = belongsTo && !belongsTo.isNew;
438
458
  if (belongsTo === null || belongsToIsNotNew) {
439
459
  json.relationships = json.relationships || {};
440
- let schema = this.store.modelFor(snapshot.modelName);
441
- let payloadKey = this._getMappedKey(key, schema);
442
- if (payloadKey === key) {
443
- payloadKey = this.keyForRelationship(key, 'belongsTo', 'serialize');
460
+ const schema = this.store.modelFor(snapshot.modelName);
461
+ let payloadKey = this._getMappedKey(name, schema);
462
+ if (payloadKey === name) {
463
+ payloadKey = this.keyForRelationship(name, 'belongsTo', 'serialize');
444
464
  }
445
465
  let data = null;
446
466
  if (belongsTo) {
447
- let payloadType = this.payloadKeyFromModelName(belongsTo.modelName);
467
+ const payloadType = this.payloadKeyFromModelName(belongsTo.modelName);
448
468
  data = {
449
469
  type: payloadType,
450
470
  id: belongsTo.id
@@ -457,23 +477,23 @@ const JSONAPISerializer = JSONSerializer.extend({
457
477
  }
458
478
  },
459
479
  serializeHasMany(snapshot, json, relationship) {
460
- let key = relationship.key;
461
- if (this.shouldSerializeHasMany(snapshot, key, relationship)) {
462
- let hasMany = snapshot.hasMany(key);
480
+ const name = relationship.name;
481
+ if (this.shouldSerializeHasMany(snapshot, name, relationship)) {
482
+ const hasMany = snapshot.hasMany(name);
463
483
  if (hasMany !== undefined) {
464
484
  json.relationships = json.relationships || {};
465
- let schema = this.store.modelFor(snapshot.modelName);
466
- let payloadKey = this._getMappedKey(key, schema);
467
- if (payloadKey === key && this.keyForRelationship) {
468
- payloadKey = this.keyForRelationship(key, 'hasMany', 'serialize');
485
+ const schema = this.store.modelFor(snapshot.modelName);
486
+ let payloadKey = this._getMappedKey(name, schema);
487
+ if (payloadKey === name && this.keyForRelationship) {
488
+ payloadKey = this.keyForRelationship(name, 'hasMany', 'serialize');
469
489
  }
470
490
 
471
491
  // only serialize has many relationships that are not new
472
- let nonNewHasMany = hasMany.filter(item => !item.isNew);
473
- let data = new Array(nonNewHasMany.length);
492
+ const nonNewHasMany = hasMany.filter(item => !item.isNew);
493
+ const data = new Array(nonNewHasMany.length);
474
494
  for (let i = 0; i < nonNewHasMany.length; i++) {
475
- let item = hasMany[i];
476
- let payloadType = this.payloadKeyFromModelName(item.modelName);
495
+ const item = hasMany[i];
496
+ const payloadType = this.payloadKeyFromModelName(item.modelName);
477
497
  data[i] = {
478
498
  type: payloadType,
479
499
  id: item.id
@@ -486,12 +506,16 @@ const JSONAPISerializer = JSONSerializer.extend({
486
506
  }
487
507
  }
488
508
  });
489
- if (macroCondition(getOwnConfig().env.DEBUG)) {
509
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
490
510
  JSONAPISerializer.reopen({
491
511
  init(...args) {
492
512
  this._super(...args);
493
- assert(`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.`, !this.isEmbeddedRecordsMixin || this.isEmbeddedRecordsMixinCompatible === true);
494
- let constructor = this.constructor;
513
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
514
+ if (!test) {
515
+ 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.`);
516
+ }
517
+ })(!this.isEmbeddedRecordsMixin || this.isEmbeddedRecordsMixinCompatible === true) : {};
518
+ const constructor = this.constructor;
495
519
  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, {
496
520
  id: 'ds.serializer.json-api.extractMeta'
497
521
  });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-api.js","sources":["../src/json-api.js"],"sourcesContent":["/**\n * @module @ember-data/serializer/json-api\n */\nimport { warn } from '@ember/debug';\n\nimport { dasherize, pluralize, singularize } from '@ember-data/request-utils/string';\nimport { DEBUG } from '@warp-drive/build-config/env';\nimport { assert } from '@warp-drive/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/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/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/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/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 if (DEBUG) {\n warn(this.warnMessageNoModelForType(type, resourceHash.type, 'modelNameFromPayloadKey'), false, {\n id: 'ds.serializer.model-for-type-missing',\n });\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/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/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/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/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/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/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,I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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,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AAC,IAAA,IAAA;AAAA,QAAA,IAAA,CAAAA,IAAA,EAAA;UAAA,MAAAC,IAAAA,KAAA,CACE,CAA2C,wCAAA,EAAA,IAAI,CAACgF,QAAQ,EAAE,CAAmM,iMAAA,CAAA,CAAA;AAAA;OAC7P,EAAA,CAAC,IAAI,CAACC,sBAAsB,IAAI,IAAI,CAACC,gCAAgC,KAAK,IAAI,CAAA,GAAA,EAAA;AAGhF,MAAA,MAAMC,WAAW,GAAG,IAAI,CAACA,WAAW;AACpC9E,MAAAA,IAAI,CACF,CAAmC8E,gCAAAA,EAAAA,WAAW,CAACH,QAAQ,EAAE,CAAiM,+LAAA,CAAA,EAC1P,IAAI,CAACI,WAAW,KAAK7G,cAAc,CAAC8G,SAAS,CAACD,WAAW,EACzD;AACE7E,QAAAA,EAAE,EAAE;AACN,OACF,CAAC;KACF;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/request-utils/string';
4
+ import "./index.js";
5
+ export { J as default } from "./json-CVTR4xWv.js";
6
+ import '@embroider/macros';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}