@ember-data/serializer 5.4.0-alpha.7 → 5.4.0-alpha.71

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 (61) hide show
  1. package/README.md +11 -1
  2. package/addon-main.cjs +5 -0
  3. package/blueprints/serializer/index.js +71 -5
  4. package/blueprints/serializer-test/index.js +13 -7
  5. package/blueprints/serializer-test/qunit-files/__root__/__path__/__test__.js +8 -9
  6. package/blueprints/transform/index.js +14 -4
  7. package/blueprints/transform-test/index.js +13 -7
  8. package/blueprints/transform-test/qunit-files/__root__/__path__/__test__.js +3 -4
  9. package/dist/index.js +373 -0
  10. package/dist/index.js.map +1 -0
  11. package/{addon/json.js → dist/json-CsNumir-.js} +80 -59
  12. package/dist/json-CsNumir-.js.map +1 -0
  13. package/{addon → dist}/json-api.js +85 -184
  14. package/dist/json-api.js.map +1 -0
  15. package/dist/json.js +7 -0
  16. package/dist/json.js.map +1 -0
  17. package/dist/rest.js +1271 -0
  18. package/dist/rest.js.map +1 -0
  19. package/{addon/string-22572f80.js → dist/transform.js} +144 -20
  20. package/dist/transform.js.map +1 -0
  21. package/package.json +63 -36
  22. package/unstable-preview-types/-private/embedded-records-mixin.d.ts +103 -0
  23. package/unstable-preview-types/-private/embedded-records-mixin.d.ts.map +1 -0
  24. package/unstable-preview-types/-private/transforms/boolean.d.ts +52 -0
  25. package/unstable-preview-types/-private/transforms/boolean.d.ts.map +1 -0
  26. package/unstable-preview-types/-private/transforms/date.d.ts +33 -0
  27. package/unstable-preview-types/-private/transforms/date.d.ts.map +1 -0
  28. package/unstable-preview-types/-private/transforms/number.d.ts +34 -0
  29. package/unstable-preview-types/-private/transforms/number.d.ts.map +1 -0
  30. package/unstable-preview-types/-private/transforms/string.d.ts +34 -0
  31. package/unstable-preview-types/-private/transforms/string.d.ts.map +1 -0
  32. package/unstable-preview-types/-private/transforms/transform.d.ts +127 -0
  33. package/unstable-preview-types/-private/transforms/transform.d.ts.map +1 -0
  34. package/unstable-preview-types/-private/utils.d.ts +6 -0
  35. package/unstable-preview-types/-private/utils.d.ts.map +1 -0
  36. package/unstable-preview-types/index.d.ts +277 -0
  37. package/unstable-preview-types/index.d.ts.map +1 -0
  38. package/unstable-preview-types/json-api.d.ts +515 -0
  39. package/unstable-preview-types/json-api.d.ts.map +1 -0
  40. package/unstable-preview-types/json.d.ts +1094 -0
  41. package/unstable-preview-types/json.d.ts.map +1 -0
  42. package/unstable-preview-types/rest.d.ts +571 -0
  43. package/unstable-preview-types/rest.d.ts.map +1 -0
  44. package/unstable-preview-types/transform.d.ts +11 -0
  45. package/unstable-preview-types/transform.d.ts.map +1 -0
  46. package/addon/-private.js +0 -4
  47. package/addon/-private.js.map +0 -1
  48. package/addon/embedded-records-mixin-d75385ff.js +0 -575
  49. package/addon/embedded-records-mixin-d75385ff.js.map +0 -1
  50. package/addon/index.js +0 -180
  51. package/addon/index.js.map +0 -1
  52. package/addon/json-api.js.map +0 -1
  53. package/addon/json.js.map +0 -1
  54. package/addon/rest.js +0 -680
  55. package/addon/rest.js.map +0 -1
  56. package/addon/string-22572f80.js.map +0 -1
  57. package/addon/transform.js +0 -2
  58. package/addon/transform.js.map +0 -1
  59. package/addon/utils-075c5b79.js +0 -12
  60. package/addon/utils-075c5b79.js.map +0 -1
  61. package/addon-main.js +0 -93
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/decorator-transforms@2.0.0_@babel+core@7.24.5/node_modules/decorator-transforms/dist/chunk-3SQBS3Y5.js","../src/index.ts"],"sourcesContent":["import {\n __export\n} from \"./chunk-CSAU5B4Q.js\";\n\n// src/runtime.ts\nvar runtime_exports = {};\n__export(runtime_exports, {\n c: () => decorateClass,\n f: () => decorateFieldV1,\n g: () => decorateFieldV2,\n i: () => initializeDeferredDecorator,\n m: () => decorateMethodV1,\n n: () => decorateMethodV2,\n p: () => decoratePOJO\n});\nvar deferred = /* @__PURE__ */ new WeakMap();\nfunction deferDecorator(proto, prop, desc) {\n let map = deferred.get(proto);\n if (!map) {\n map = /* @__PURE__ */ new Map();\n deferred.set(proto, map);\n }\n map.set(prop, desc);\n}\nfunction findDeferredDecorator(target, prop) {\n let cursor = target.prototype;\n while (cursor) {\n let desc = deferred.get(cursor)?.get(prop);\n if (desc) {\n return desc;\n }\n cursor = cursor.prototype;\n }\n}\nfunction decorateFieldV1(target, prop, decorators, initializer) {\n return decorateFieldV2(target.prototype, prop, decorators, initializer);\n}\nfunction decorateFieldV2(prototype, prop, decorators, initializer) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n };\n if (initializer) {\n desc.initializer = initializer;\n }\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(prototype, prop, desc);\n } else {\n deferDecorator(prototype, prop, desc);\n }\n}\nfunction decorateMethodV1({ prototype }, prop, decorators) {\n return decorateMethodV2(prototype, prop, decorators);\n}\nfunction decorateMethodV2(prototype, prop, decorators) {\n const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);\n let desc = { ...origDesc };\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;\n desc.initializer = void 0;\n }\n Object.defineProperty(prototype, prop, desc);\n}\nfunction initializeDeferredDecorator(target, prop) {\n let desc = findDeferredDecorator(target.constructor, prop);\n if (desc) {\n Object.defineProperty(target, prop, {\n enumerable: desc.enumerable,\n configurable: desc.configurable,\n writable: desc.writable,\n value: desc.initializer ? desc.initializer.call(target) : void 0\n });\n }\n}\nfunction decorateClass(target, decorators) {\n return decorators.reduce(\n (accum, decorator) => decorator(accum) || accum,\n target\n );\n}\nfunction decoratePOJO(pojo, decorated) {\n for (let [type, prop, decorators] of decorated) {\n if (type === \"field\") {\n decoratePojoField(pojo, prop, decorators);\n } else {\n decorateMethodV2(pojo, prop, decorators);\n }\n }\n return pojo;\n}\nfunction decoratePojoField(pojo, prop, decorators) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: () => Object.getOwnPropertyDescriptor(pojo, prop)?.value\n };\n for (let decorator of decorators) {\n desc = decorator(pojo, prop, desc) || desc;\n }\n if (desc.initializer) {\n desc.value = desc.initializer.call(pojo);\n delete desc.initializer;\n }\n Object.defineProperty(pojo, prop, desc);\n}\n\nexport {\n decorateFieldV1,\n decorateFieldV2,\n decorateMethodV1,\n decorateMethodV2,\n initializeDeferredDecorator,\n decorateClass,\n decoratePOJO,\n runtime_exports\n};\n//# sourceMappingURL=chunk-3SQBS3Y5.js.map","/**\n ## Overview\n\n <blockquote style=\"margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;\">\n <p>\n ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new serializer, consider writing a\n <a href=\"/ember-data/release/classes/%3CInterface%3E%20Handler\">Handler</a> instead to be used with the <a href=\"https://github.com/emberjs/data/tree/main/packages/request#readme\">RequestManager</a>\n </p>\n </blockquote>\n\n In order to properly manage and present your data, EmberData\n needs to understand the structure of data it receives.\n\n `Serializers` convert data between the server's API format and\n the format EmberData understands.\n\n Data received from an API response is **normalized** into\n [JSON:API](https://jsonapi.org/) (the format used internally\n by EmberData), while data sent to an API is **serialized**\n into the format the API expects.\n\n ### Implementing a Serializer\n\n There are only two required serializer methods, one for\n normalizing data from the server API format into JSON:API, and\n another for serializing records via `Snapshots` into the expected\n server API format.\n\n To implement a serializer, export a class that conforms to the structure\n described by [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)\n from the `app/serializers/` directory. An example is below.\n\n ```ts\n import EmberObject from '@ember/object';\n\n export default class ApplicationSerializer extends EmberObject {\n normalizeResponse(store, schema, rawPayload) {\n return rawPayload;\n }\n\n serialize(snapshot, options) {\n const serializedResource = {\n id: snapshot.id,\n type: snapshot.modelName,\n attributes: snapshot.attributes()\n };\n\n return serializedResource;\n }\n }\n ```\n\n\n ### Serializer Resolution\n\n `store.serializerFor(name)` will lookup serializers defined in\n `app/serializers/` and return an instance. If no serializer is found, an\n error will be thrown.\n\n `serializerFor` first attempts to find a serializer with an exact match on `name`,\n then falls back to checking for the presence of a serializer named `application`.\n\n ```ts\n store.serializerFor('author');\n\n // lookup paths (in order) =>\n // app/serializers/author.js\n // app/serializers/application.js\n ```\n\n Most requests in EmberData are made with respect to a particular `type` (or `modelName`)\n (e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\n refer to this as the **primary** resource `type`.\n\n Typically `serializerFor` will be used to find a serializer with a name matching that of the primary\n resource `type` for the request, falling back to the `application` serializer for those types that\n do not have a defined serializer. This is often described as a `per-model` or `per-type` strategy\n for defining serializers. However, because APIs rarely format payloads per-type but rather\n per-API-version, this may not be a desired strategy.\n\n It is recommended that applications define only a single `application` adapter and serializer\n where possible.\n\n If you have multiple API formats and the per-type strategy is not viable, one strategy is to\n write an `application` adapter and serializer that make use of `options` to specify the desired\n format when making a request.\n\n ### Using a Serializer\n\n Any serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.\n\n ### Default Serializers\n\n For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**\n format the `@ember-data/serializer` package contains implementations these applications can\n extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.\n\n Many applications will find writing their own serializer to be more performant and less\n complex than extending these classes even when their API format is very close to that expected\n by these serializers.\n\n It is recommended that apps write their own serializer to best suit the needs of their API and\n application.\n\n @module @ember-data/serializer\n @main @ember-data/serializer\n*/\n\nimport EmberObject from '@ember/object';\nimport { inject as service } from '@ember/service';\n\nimport type Store from '@ember-data/store';\nimport type { ModelSchema } from '@ember-data/store/types';\nimport type { EmptyResourceDocument, SingleResourceDocument } from '@warp-drive/core-types/spec/json-api-raw';\n\n/**\n > ⚠️ CAUTION you likely want the docs for [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)\n > as extending this abstract class is unnecessary.\n\n `Serializer` is an abstract base class that you may override in your\n application to customize it for your backend. The minimum set of methods\n that you should implement is:\n\n * `normalizeResponse()`\n * `serialize()`\n\n And you can optionally override the following methods:\n\n * `normalize()`\n\n For an example implementation, see\n [JSONSerializer](JSONSerializer), the included JSON serializer.\n\n @class Serializer\n @public\n @extends Ember.EmberObject\n*/\n\nexport default class extends EmberObject {\n @service declare store: Store;\n /**\n The `store` property is the application's `store` that contains\n all records. It can be used to look up serializers for other model\n types that may be nested inside the payload response.\n\n Example:\n\n ```js\n Serializer.extend({\n extractRelationship(relationshipModelName, relationshipHash) {\n let modelClass = this.store.modelFor(relationshipModelName);\n let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n return relationshipSerializer.normalize(modelClass, relationshipHash);\n }\n });\n ```\n\n @property store\n @type {Store}\n @public\n */\n\n /**\n The `normalizeResponse` method is used to normalize a payload from the\n server to a JSON-API Document.\n\n http://jsonapi.org/format/#document-structure\n\n Example:\n\n ```js\n Serializer.extend({\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n if (requestType === 'findRecord') {\n return this.normalize(primaryModelClass, payload);\n } else {\n return payload.reduce(function(documentHash, item) {\n let { data, included } = this.normalize(primaryModelClass, item);\n documentHash.included.push(...included);\n documentHash.data.push(data);\n return documentHash;\n }, { data: [], included: [] })\n }\n }\n });\n ```\n\n @since 1.13.0\n @method normalizeResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n\n /**\n The `serialize` method is used when a record is saved in order to convert\n the record into the form that your external data source expects.\n\n `serialize` takes an optional `options` hash with a single option:\n\n - `includeId`: If this is `true`, `serialize` should include the ID\n in the serialized object it builds.\n\n Example:\n\n ```js\n Serializer.extend({\n serialize(snapshot, options) {\n let json = {\n id: snapshot.id\n };\n\n snapshot.eachAttribute((key, attribute) => {\n json[key] = snapshot.attr(key);\n });\n\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n json[key] = snapshot.belongsTo(key, { id: true });\n } else if (relationship.kind === 'hasMany') {\n json[key] = snapshot.hasMany(key, { ids: true });\n }\n });\n\n return json;\n },\n });\n ```\n\n @method serialize\n @public\n @param {Snapshot} snapshot\n @param {Object} [options]\n @return {Object}\n */\n\n /**\n The `normalize` method is used to convert a payload received from your\n external data source into the normalized form `store.push()` expects. You\n should override this method, munge the hash and return the normalized\n payload.\n\n Example:\n\n ```js\n Serializer.extend({\n normalize(modelClass, resourceHash) {\n let data = {\n id: resourceHash.id,\n type: modelClass.modelName,\n attributes: resourceHash\n };\n return { data: data };\n }\n })\n ```\n\n @method normalize\n @public\n @param {Model} typeClass\n @param {Object} hash\n @return {Object}\n */\n normalize(_typeClass: ModelSchema, hash: Record<string, unknown>): SingleResourceDocument | EmptyResourceDocument {\n return hash as unknown as SingleResourceDocument;\n }\n}\n"],"names":["runtime_exports","__export","c","decorateClass","f","decorateFieldV1","g","decorateFieldV2","i","initializeDeferredDecorator","m","decorateMethodV1","n","decorateMethodV2","p","decoratePOJO","deferred","WeakMap","deferDecorator","proto","prop","desc","map","get","Map","set","findDeferredDecorator","target","cursor","prototype","decorators","initializer","configurable","enumerable","writable","decorator","Object","defineProperty","origDesc","getOwnPropertyDescriptor","value","call","constructor","reduce","accum","pojo","decorated","type","decoratePojoField","EmberObject","service","void 0","normalize","_typeClass","hash"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAA,EAAA,CAAA;AAAAC,QAAA,CAAAD,eAAA,EAAA;EAAAE,CAAA,EAAAA,MAAAC,aAAA;EAAAC,CAAA,EAAAA,MAAAC,eAAA;EAAAC,CAAA,EAAAA,MAAAC,eAAA;EAAAC,CAAA,EAAAA,MAAAC,2BAAA;EAAAC,CAAA,EAAAA,MAAAC,gBAAA;EAAAC,CAAA,EAAAA,MAAAC,gBAAA;EAAAC,CAAA,EAAAA,MAA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AiBgC,IAAA,EAAMzB,IAAA,EAAMU,UAAU,CAAA,CAAA;AACzC,KAAA;AACF,GAAA;AACA,EAAA,OAAOe,IAAA,CAAA;AACT,CAAA;AACA,SAASG,kBACPH,IAAA,EACAzB,IAAA,EACAU,UAAA,EACA;AACA,EAAA,IAAIT,IAAA,GAAmB;AACrBW,IAAAA,YAAA,EAAc,IAAA;AACdC,IAAAA,UAAA,EAAY,IAAA;AACZC,IAAAA,QAAA,EAAU,IAAA;IACVH,WAAA,EAAaA,MAAMK,MAAA,CAAOG,wBAAA,CAAyBM,IAAA,EAAMzB,IAAI,CAAGoB,EAAAA,KAAAA;AAClE,GAAA,CAAA;EACA,KAASL,IAAAA,SAAA,IAAaL,UAAA,EAAY;IAChCT,IAAA,GAAOc,SAAA,CAAUU,IAAA,EAAMzB,IAAA,EAAMC,IAAI,CAAA,IAAKA,IAAA,CAAA;AACxC,GAAA;EACA,IAAIA,IAAA,CAAKU,WAAA,EAAa;IACpBV,IAAA,CAAKmB,KAAA,GAAQnB,IAAA,CAAKU,WAAA,CAAYU,IAAA,CAAKI,IAAI,CAAA,CAAA;IACvC,OAAOxB,IAAA,CAAKU,WAAA,CAAA;AACd,GAAA;AACAK,EAAAA,MAAA,CAAOC,cAAA,CAAeQ,IAAA,EAAMzB,IAAA,EAAMC,IAAI,CAAA,CAAA;AACxC;;AC3KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe,gBAAA,SAAc4B,WAAW,CAAC;AAAA,EAAA;IAAA3C,eAAA,CAAA,IAAA,CAAAuB,SAAA,EAAA,OAAA,EAAA,CACtCqB,MAAO,CAAA,CAAA,CAAA;AAAA,GAAA;AAAA,EAAA,MAAA,IAAA1C,2BAAA,CAAA,IAAA,EAAA,OAAA,CAAA,EAAA2C,KAAA,CAAA,EAAA;AACR;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAME;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIEC,EAAAA,SAASA,CAACC,UAAuB,EAAEC,IAA6B,EAAkD;AAChH,IAAA,OAAOA,IAAI,CAAA;AACb,GAAA;AACF;;;;","x_google_ignoreList":[0]}
@@ -1,9 +1,20 @@
1
1
  import { getOwner } from '@ember/application';
2
- import { assert, warn } from '@ember/debug';
2
+ import { warn } from '@ember/debug';
3
3
  import { dasherize } from '@ember/string';
4
4
  import { singularize } from 'ember-inflector';
5
- import _class from "./index";
6
- import { c as coerceId } from "./utils-075c5b79";
5
+ import Serializer from "./index";
6
+ import { macroCondition, getGlobalConfig } from '@embroider/macros';
7
+ function coerceId(id) {
8
+ if (id === null || id === undefined || id === '') {
9
+ return null;
10
+ } else if (typeof id === 'string') {
11
+ return id;
12
+ } else if (typeof id === 'symbol') {
13
+ return id.toString();
14
+ } else {
15
+ return String(id);
16
+ }
17
+ }
7
18
 
8
19
  /**
9
20
  * @module @ember-data/serializer/json
@@ -89,7 +100,7 @@ const PRIMARY_ATTRIBUTE_KEY = 'base';
89
100
  @public
90
101
  @extends Serializer
91
102
  */
92
- const JSONSerializer = _class.extend({
103
+ const JSONSerializer = Serializer.extend({
93
104
  /**
94
105
  The `primaryKey` is used when serializing and deserializing
95
106
  data. Ember Data always uses the `id` property to store the id of
@@ -177,13 +188,13 @@ const JSONSerializer = _class.extend({
177
188
  @return {Object} data The transformed data object
178
189
  */
179
190
  applyTransforms(typeClass, data) {
180
- let attributes = typeClass.attributes;
191
+ const attributes = typeClass.attributes;
181
192
  typeClass.eachTransformedAttribute((key, typeClass) => {
182
193
  if (data[key] === undefined) {
183
194
  return;
184
195
  }
185
- let transform = this.transformFor(typeClass);
186
- let transformMeta = attributes.get(key);
196
+ const transform = this.transformFor(typeClass);
197
+ const transformMeta = attributes.get(key);
187
198
  data[key] = transform.deserialize(data[key], transformMeta.options);
188
199
  });
189
200
  return data;
@@ -461,17 +472,21 @@ const JSONSerializer = _class.extend({
461
472
  @private
462
473
  */
463
474
  _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {
464
- let documentHash = {
475
+ const documentHash = {
465
476
  data: null,
466
477
  included: []
467
478
  };
468
- let meta = this.extractMeta(store, primaryModelClass, payload);
479
+ const meta = this.extractMeta(store, primaryModelClass, payload);
469
480
  if (meta) {
470
- assert('The `meta` returned from `extractMeta` has to be an object, not "' + typeof meta + '".', typeof meta === 'object');
481
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
482
+ if (!test) {
483
+ throw new Error('The `meta` returned from `extractMeta` has to be an object, not "' + typeof meta + '".');
484
+ }
485
+ })(typeof meta === 'object') : {};
471
486
  documentHash.meta = meta;
472
487
  }
473
488
  if (isSingle) {
474
- let {
489
+ const {
475
490
  data,
476
491
  included
477
492
  } = this.normalize(primaryModelClass, payload);
@@ -480,10 +495,10 @@ const JSONSerializer = _class.extend({
480
495
  documentHash.included = included;
481
496
  }
482
497
  } else {
483
- let ret = new Array(payload.length);
498
+ const ret = new Array(payload.length);
484
499
  for (let i = 0, l = payload.length; i < l; i++) {
485
- let item = payload[i];
486
- let {
500
+ const item = payload[i];
501
+ const {
487
502
  data,
488
503
  included
489
504
  } = this.normalize(primaryModelClass, item);
@@ -542,6 +557,9 @@ const JSONSerializer = _class.extend({
542
557
  attributes: this.extractAttributes(modelClass, resourceHash),
543
558
  relationships: this.extractRelationships(modelClass, resourceHash)
544
559
  };
560
+ if (resourceHash.lid) {
561
+ data.lid = resourceHash.lid;
562
+ }
545
563
  this.applyTransforms(modelClass, data.attributes);
546
564
  }
547
565
  return {
@@ -557,8 +575,8 @@ const JSONSerializer = _class.extend({
557
575
  @return {String}
558
576
  */
559
577
  extractId(modelClass, resourceHash) {
560
- let primaryKey = this.primaryKey;
561
- let id = resourceHash[primaryKey];
578
+ const primaryKey = this.primaryKey;
579
+ const id = resourceHash[primaryKey];
562
580
  return coerceId(id);
563
581
  },
564
582
  /**
@@ -572,7 +590,7 @@ const JSONSerializer = _class.extend({
572
590
  */
573
591
  extractAttributes(modelClass, resourceHash) {
574
592
  let attributeKey;
575
- let attributes = {};
593
+ const attributes = {};
576
594
  modelClass.eachAttribute(key => {
577
595
  attributeKey = this.keyForAttribute(key, 'deserialize');
578
596
  if (resourceHash[attributeKey] !== undefined) {
@@ -603,7 +621,7 @@ const JSONSerializer = _class.extend({
603
621
  if (relationshipHash.id) {
604
622
  relationshipHash.id = coerceId(relationshipHash.id);
605
623
  }
606
- let modelClass = this.store.modelFor(relationshipModelName);
624
+ const modelClass = this.store.modelFor(relationshipModelName);
607
625
  if (relationshipHash.type && !modelClass.fields.has('type')) {
608
626
  relationshipHash.type = this.modelNameFromPayloadKey(relationshipHash.type);
609
627
  }
@@ -644,13 +662,13 @@ const JSONSerializer = _class.extend({
644
662
  @return {Object}
645
663
  */
646
664
  extractRelationships(modelClass, resourceHash) {
647
- let relationships = {};
665
+ const relationships = {};
648
666
  modelClass.eachRelationship((key, relationshipMeta) => {
649
667
  let relationship = null;
650
- let relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');
668
+ const relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');
651
669
  if (resourceHash[relationshipKey] !== undefined) {
652
670
  let data = null;
653
- let relationshipHash = resourceHash[relationshipKey];
671
+ const relationshipHash = resourceHash[relationshipKey];
654
672
  if (relationshipMeta.kind === 'belongsTo') {
655
673
  if (relationshipMeta.options.polymorphic) {
656
674
  // extracting a polymorphic belongsTo may need more information
@@ -670,7 +688,7 @@ const JSONSerializer = _class.extend({
670
688
  data = new Array(relationshipHash.length);
671
689
  if (relationshipMeta.options.polymorphic) {
672
690
  for (let i = 0, l = relationshipHash.length; i < l; i++) {
673
- let item = relationshipHash[i];
691
+ const item = relationshipHash[i];
674
692
  data[i] = this.extractPolymorphicRelationship(relationshipMeta.type, item, {
675
693
  key,
676
694
  resourceHash,
@@ -679,7 +697,7 @@ const JSONSerializer = _class.extend({
679
697
  }
680
698
  } else {
681
699
  for (let i = 0, l = relationshipHash.length; i < l; i++) {
682
- let item = relationshipHash[i];
700
+ const item = relationshipHash[i];
683
701
  data[i] = this.extractRelationship(relationshipMeta.type, item);
684
702
  }
685
703
  }
@@ -689,9 +707,9 @@ const JSONSerializer = _class.extend({
689
707
  data
690
708
  };
691
709
  }
692
- let linkKey = this.keyForLink(key, relationshipMeta.kind);
710
+ const linkKey = this.keyForLink(key, relationshipMeta.kind);
693
711
  if (resourceHash.links && resourceHash.links[linkKey] !== undefined) {
694
- let related = resourceHash.links[linkKey];
712
+ const related = resourceHash.links[linkKey];
695
713
  relationship = relationship || {};
696
714
  relationship.links = {
697
715
  related
@@ -738,11 +756,11 @@ const JSONSerializer = _class.extend({
738
756
  @private
739
757
  */
740
758
  normalizeUsingDeclaredMapping(modelClass, hash) {
741
- let attrs = this.attrs;
759
+ const attrs = this.attrs;
742
760
  let normalizedKey;
743
761
  let payloadKey;
744
762
  if (attrs) {
745
- for (let key in attrs) {
763
+ for (const key in attrs) {
746
764
  normalizedKey = payloadKey = this._getMappedKey(key, modelClass);
747
765
  if (hash[payloadKey] === undefined) {
748
766
  continue;
@@ -772,7 +790,7 @@ const JSONSerializer = _class.extend({
772
790
  warn('There is no attribute or relationship with the name `' + key + '` on `' + modelClass.modelName + '`. Check your serializers attrs hash.', modelClass.attributes.has(key) || modelClass.relationshipsByName.has(key), {
773
791
  id: 'ds.serializer.no-mapped-attrs-key'
774
792
  });
775
- let attrs = this.attrs;
793
+ const attrs = this.attrs;
776
794
  let mappedKey;
777
795
  if (attrs && attrs[key]) {
778
796
  mappedKey = attrs[key];
@@ -796,7 +814,7 @@ const JSONSerializer = _class.extend({
796
814
  @return {boolean} true if the key can be serialized
797
815
  */
798
816
  _canSerialize(key) {
799
- let attrs = this.attrs;
817
+ const attrs = this.attrs;
800
818
  return !attrs || !attrs[key] || attrs[key].serialize !== false;
801
819
  },
802
820
  /**
@@ -809,7 +827,7 @@ const JSONSerializer = _class.extend({
809
827
  @return {boolean} true if the key must be serialized
810
828
  */
811
829
  _mustSerialize(key) {
812
- let attrs = this.attrs;
830
+ const attrs = this.attrs;
813
831
  return attrs && attrs[key] && attrs[key].serialize === true;
814
832
  },
815
833
  /**
@@ -825,7 +843,7 @@ const JSONSerializer = _class.extend({
825
843
  */
826
844
  shouldSerializeHasMany(snapshot, key, relationship) {
827
845
  const schema = this.store.modelFor(snapshot.modelName);
828
- let relationshipType = schema.determineRelationshipType(relationship, this.store);
846
+ const relationshipType = schema.determineRelationshipType(relationship, this.store);
829
847
  if (this._mustSerialize(key)) {
830
848
  return true;
831
849
  }
@@ -948,7 +966,7 @@ const JSONSerializer = _class.extend({
948
966
  @return {Object} json
949
967
  */
950
968
  serialize(snapshot, options) {
951
- let json = {};
969
+ const json = {};
952
970
  if (options && options.includeId) {
953
971
  const id = snapshot.id;
954
972
  if (id) {
@@ -1019,16 +1037,16 @@ const JSONSerializer = _class.extend({
1019
1037
  */
1020
1038
  serializeAttribute(snapshot, json, key, attribute) {
1021
1039
  if (this._canSerialize(key)) {
1022
- let type = attribute.type;
1040
+ const type = attribute.type;
1023
1041
  let value = snapshot.attr(key);
1024
1042
  if (type) {
1025
- let transform = this.transformFor(type);
1043
+ const transform = this.transformFor(type);
1026
1044
  value = transform.serialize(value, attribute.options);
1027
1045
  }
1028
1046
 
1029
1047
  // if provided, use the mapping provided by `attrs` in
1030
1048
  // the serializer
1031
- let schema = this.store.modelFor(snapshot.modelName);
1049
+ const schema = this.store.modelFor(snapshot.modelName);
1032
1050
  let payloadKey = this._getMappedKey(key, schema);
1033
1051
  if (payloadKey === key && this.keyForAttribute) {
1034
1052
  payloadKey = this.keyForAttribute(key, 'serialize');
@@ -1044,7 +1062,7 @@ const JSONSerializer = _class.extend({
1044
1062
  import JSONSerializer from '@ember-data/serializer/json';
1045
1063
  export default class PostSerializer extends JSONSerializer {
1046
1064
  serializeBelongsTo(snapshot, json, relationship) {
1047
- let key = relationship.key;
1065
+ let key = relationship.name;
1048
1066
  let belongsTo = snapshot.belongsTo(key);
1049
1067
  key = this.keyForRelationship ? this.keyForRelationship(key, "belongsTo", "serialize") : key;
1050
1068
  json[key] = !belongsTo ? null : belongsTo.record.toJSON();
@@ -1058,18 +1076,18 @@ const JSONSerializer = _class.extend({
1058
1076
  @param {Object} relationship
1059
1077
  */
1060
1078
  serializeBelongsTo(snapshot, json, relationship) {
1061
- let key = relationship.key;
1062
- if (this._canSerialize(key)) {
1063
- let belongsToId = snapshot.belongsTo(key, {
1079
+ const name = relationship.name;
1080
+ if (this._canSerialize(name)) {
1081
+ const belongsToId = snapshot.belongsTo(name, {
1064
1082
  id: true
1065
1083
  });
1066
1084
 
1067
1085
  // if provided, use the mapping provided by `attrs` in
1068
1086
  // the serializer
1069
- let schema = this.store.modelFor(snapshot.modelName);
1070
- let payloadKey = this._getMappedKey(key, schema);
1071
- if (payloadKey === key && this.keyForRelationship) {
1072
- payloadKey = this.keyForRelationship(key, 'belongsTo', 'serialize');
1087
+ const schema = this.store.modelFor(snapshot.modelName);
1088
+ let payloadKey = this._getMappedKey(name, schema);
1089
+ if (payloadKey === name && this.keyForRelationship) {
1090
+ payloadKey = this.keyForRelationship(name, 'belongsTo', 'serialize');
1073
1091
  }
1074
1092
 
1075
1093
  //Need to check whether the id is there for new&async records
@@ -1091,7 +1109,7 @@ const JSONSerializer = _class.extend({
1091
1109
  import JSONSerializer from '@ember-data/serializer/json';
1092
1110
  export default class PostSerializer extends JSONSerializer {
1093
1111
  serializeHasMany(snapshot, json, relationship) {
1094
- let key = relationship.key;
1112
+ let key = relationship.name;
1095
1113
  if (key === 'comments') {
1096
1114
  return;
1097
1115
  } else {
@@ -1107,25 +1125,24 @@ const JSONSerializer = _class.extend({
1107
1125
  @param {Object} relationship
1108
1126
  */
1109
1127
  serializeHasMany(snapshot, json, relationship) {
1110
- let key = relationship.key;
1111
- if (this.shouldSerializeHasMany(snapshot, key, relationship)) {
1112
- let hasMany = snapshot.hasMany(key, {
1128
+ const name = relationship.name;
1129
+ if (this.shouldSerializeHasMany(snapshot, name, relationship)) {
1130
+ const hasMany = snapshot.hasMany(name, {
1113
1131
  ids: true
1114
1132
  });
1115
1133
  if (hasMany !== undefined) {
1116
1134
  // if provided, use the mapping provided by `attrs` in
1117
1135
  // the serializer
1118
- let schema = this.store.modelFor(snapshot.modelName);
1119
- let payloadKey = this._getMappedKey(key, schema);
1120
- if (payloadKey === key && this.keyForRelationship) {
1121
- payloadKey = this.keyForRelationship(key, 'hasMany', 'serialize');
1136
+ const schema = this.store.modelFor(snapshot.modelName);
1137
+ let payloadKey = this._getMappedKey(name, schema);
1138
+ if (payloadKey === name && this.keyForRelationship) {
1139
+ payloadKey = this.keyForRelationship(name, 'hasMany', 'serialize');
1122
1140
  }
1123
1141
  json[payloadKey] = hasMany;
1124
1142
  // TODO support for polymorphic manyToNone and manyToMany relationships
1125
1143
  }
1126
1144
  }
1127
1145
  },
1128
-
1129
1146
  /**
1130
1147
  You can use this method to customize how polymorphic objects are
1131
1148
  serialized. Objects are considered to be polymorphic if
@@ -1136,7 +1153,7 @@ const JSONSerializer = _class.extend({
1136
1153
  import JSONSerializer from '@ember-data/serializer/json';
1137
1154
  export default class CommentSerializer extends JSONSerializer {
1138
1155
  serializePolymorphicType(snapshot, json, relationship) {
1139
- let key = relationship.key;
1156
+ let key = relationship.name;
1140
1157
  let belongsTo = snapshot.belongsTo(key);
1141
1158
  key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;
1142
1159
  if (!belongsTo) {
@@ -1179,7 +1196,7 @@ const JSONSerializer = _class.extend({
1179
1196
  */
1180
1197
  extractMeta(store, modelClass, payload) {
1181
1198
  if (payload && payload['meta'] !== undefined) {
1182
- let meta = payload.meta;
1199
+ const meta = payload.meta;
1183
1200
  delete payload.meta;
1184
1201
  return meta;
1185
1202
  }
@@ -1283,14 +1300,14 @@ const JSONSerializer = _class.extend({
1283
1300
  // for each attr and relationship, make sure that we use
1284
1301
  // the normalized key
1285
1302
  typeClass.eachAttribute(name => {
1286
- let key = this.keyForAttribute(name, 'deserialize');
1303
+ const key = this.keyForAttribute(name, 'deserialize');
1287
1304
  if (key !== name && extracted[key] !== undefined) {
1288
1305
  extracted[name] = extracted[key];
1289
1306
  delete extracted[key];
1290
1307
  }
1291
1308
  });
1292
1309
  typeClass.eachRelationship(name => {
1293
- let key = this.keyForRelationship(name, 'deserialize');
1310
+ const key = this.keyForRelationship(name, 'deserialize');
1294
1311
  if (key !== name && extracted[key] !== undefined) {
1295
1312
  extracted[name] = extracted[key];
1296
1313
  delete extracted[key];
@@ -1368,9 +1385,13 @@ const JSONSerializer = _class.extend({
1368
1385
  @return {Transform} transform
1369
1386
  */
1370
1387
  transformFor(attributeType, skipAssertion) {
1371
- let transform = getOwner(this).lookup('transform:' + attributeType);
1372
- assert(`Unable to find the transform for \`attr('${attributeType}')\``, skipAssertion || !!transform);
1388
+ const transform = getOwner(this).lookup('transform:' + attributeType);
1389
+ macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
1390
+ if (!test) {
1391
+ throw new Error(`Unable to find the transform for \`attr('${attributeType}')\``);
1392
+ }
1393
+ })(skipAssertion || !!transform) : {};
1373
1394
  return transform;
1374
1395
  }
1375
1396
  });
1376
- export { JSONSerializer as default };
1397
+ export { JSONSerializer as J, coerceId as c };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-CsNumir-.js","sources":["../src/-private/utils.ts","../src/json.js"],"sourcesContent":["type Coercable = string | number | boolean | null | undefined | symbol;\n\nexport function coerceId(id: Coercable): string | null {\n if (id === null || id === undefined || id === '') {\n return null;\n } else if (typeof id === 'string') {\n return id;\n } else if (typeof id === 'symbol') {\n return id.toString();\n } else {\n return String(id);\n }\n}\n","/**\n * @module @ember-data/serializer/json\n */\nimport { getOwner } from '@ember/application';\nimport { warn } from '@ember/debug';\nimport { dasherize } from '@ember/string';\n\nimport { singularize } from 'ember-inflector';\n\nimport { assert } from '@warp-drive/build-config/macros';\n\nimport Serializer from '.';\nimport { coerceId } from './-private/utils';\n\nconst SOURCE_POINTER_REGEXP = /^\\/?data\\/(attributes|relationships)\\/(.*)/;\nconst SOURCE_POINTER_PRIMARY_REGEXP = /^\\/?data/;\nconst PRIMARY_ATTRIBUTE_KEY = 'base';\n\n/**\n * <blockquote style=\"margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;\">\n <p>\n ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n <a href=\"/ember-data/release/classes/%3CInterface%3E%20Handler\">Handler</a> instead to be used with the <a href=\"https://github.com/emberjs/data/tree/main/packages/request#readme\">RequestManager</a>\n </p>\n </blockquote>\n\n In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.\n\n By default, EmberData uses and recommends the `JSONAPISerializer`.\n\n `JSONSerializer` is useful for simpler or legacy backends that may\n not support the http://jsonapi.org/ spec.\n\n For example, given the following `User` model and JSON payload:\n\n ```app/models/user.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @hasMany('user') friends;\n @belongsTo('location') house;\n\n @attr('string') name;\n }\n ```\n\n ```js\n {\n id: 1,\n name: 'Sebastian',\n friends: [3, 4],\n links: {\n house: '/houses/lefkada'\n }\n }\n ```\n\n `JSONSerializer` will normalize the JSON payload to the JSON API format that the\n Ember Data store expects.\n\n You can customize how JSONSerializer processes its payload by passing options in\n the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks:\n\n - To customize how a single record is normalized, use the `normalize` hook.\n - To customize how `JSONSerializer` normalizes the whole server response, use the\n `normalizeResponse` hook.\n - To customize how `JSONSerializer` normalizes a specific response from the server,\n use one of the many specific `normalizeResponse` hooks.\n - To customize how `JSONSerializer` normalizes your id, attributes or relationships,\n use the `extractId`, `extractAttributes` and `extractRelationships` hooks.\n\n The `JSONSerializer` normalization process follows these steps:\n\n 1. `normalizeResponse`\n - entry method to the serializer.\n 2. `normalizeCreateRecordResponse`\n - a `normalizeResponse` for a specific operation is called.\n 3. `normalizeSingleResponse`|`normalizeArrayResponse`\n - for methods like `createRecord` we expect a single record back, while for methods like `findAll` we expect multiple records back.\n 4. `normalize`\n - `normalizeArrayResponse` iterates and calls `normalize` for each of its records while `normalizeSingle`\n calls it once. This is the method you most likely want to subclass.\n 5. `extractId` | `extractAttributes` | `extractRelationships`\n - `normalize` delegates to these methods to\n turn the record payload into the JSON API format.\n\n @main @ember-data/serializer/json\n @class JSONSerializer\n @public\n @extends Serializer\n*/\nconst JSONSerializer = Serializer.extend({\n /**\n The `primaryKey` is used when serializing and deserializing\n data. Ember Data always uses the `id` property to store the id of\n the record. The external source may not always follow this\n convention. In these cases it is useful to override the\n `primaryKey` property to match the `primaryKey` of your external\n store.\n\n Example\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class ApplicationSerializer extends JSONSerializer {\n primaryKey = '_id'\n }\n ```\n\n @property primaryKey\n @type {String}\n @public\n @default 'id'\n */\n primaryKey: 'id',\n\n /**\n The `attrs` object can be used to declare a simple mapping between\n property names on `Model` records and payload keys in the\n serialized JSON object representing the record. An object with the\n property `key` can also be used to designate the attribute's key on\n the response payload.\n\n Example\n\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('string') occupation;\n @attr('boolean') admin;\n }\n ```\n\n ```app/serializers/person.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PersonSerializer extends JSONSerializer {\n attrs = {\n admin: 'is_admin',\n occupation: { key: 'career' }\n }\n }\n ```\n\n You can also remove attributes and relationships by setting the `serialize`\n key to `false` in your mapping object.\n\n Example\n\n ```app/serializers/person.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n attrs = {\n admin: { serialize: false },\n occupation: { key: 'career' }\n }\n }\n ```\n\n When serialized:\n\n ```javascript\n {\n \"firstName\": \"Harry\",\n \"lastName\": \"Houdini\",\n \"career\": \"magician\"\n }\n ```\n\n Note that the `admin` is now not included in the payload.\n\n Setting `serialize` to `true` enforces serialization for hasMany\n relationships even if it's neither a many-to-many nor many-to-none\n relationship.\n\n @property attrs\n @public\n @type {Object}\n */\n mergedProperties: ['attrs'],\n\n /**\n Given a subclass of `Model` and a JSON object this method will\n iterate through each attribute of the `Model` and invoke the\n `Transform#deserialize` method on the matching property of the\n JSON object. This method is typically called after the\n serializer's `normalize` method.\n\n @method applyTransforms\n @private\n @param {Model} typeClass\n @param {Object} data The data to transform\n @return {Object} data The transformed data object\n */\n applyTransforms(typeClass, data) {\n const attributes = typeClass.attributes;\n\n typeClass.eachTransformedAttribute((key, typeClass) => {\n if (data[key] === undefined) {\n return;\n }\n\n const transform = this.transformFor(typeClass);\n const transformMeta = attributes.get(key);\n data[key] = transform.deserialize(data[key], transformMeta.options);\n });\n\n return data;\n },\n\n /**\n The `normalizeResponse` method is used to normalize a payload from the\n server to a JSON-API Document.\n\n http://jsonapi.org/format/#document-structure\n\n This method delegates to a more specific normalize method based on\n the `requestType`.\n\n To override this method with a custom one, make sure to call\n `return super.normalizeResponse(store, primaryModelClass, payload, id, requestType)` with your\n pre-processed data.\n\n Here's an example of using `normalizeResponse` manually:\n\n ```javascript\n socket.on('message', function(message) {\n let data = message.data;\n let modelClass = store.modelFor(data.modelName);\n let serializer = store.serializerFor(data.modelName);\n let normalized = serializer.normalizeSingleResponse(store, modelClass, data, data.id);\n\n store.push(normalized);\n });\n ```\n\n @since 1.13.0\n @method normalizeResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n switch (requestType) {\n case 'findRecord':\n return this.normalizeFindRecordResponse(...arguments);\n case 'queryRecord':\n return this.normalizeQueryRecordResponse(...arguments);\n case 'findAll':\n return this.normalizeFindAllResponse(...arguments);\n case 'findBelongsTo':\n return this.normalizeFindBelongsToResponse(...arguments);\n case 'findHasMany':\n return this.normalizeFindHasManyResponse(...arguments);\n case 'findMany':\n return this.normalizeFindManyResponse(...arguments);\n case 'query':\n return this.normalizeQueryResponse(...arguments);\n case 'createRecord':\n return this.normalizeCreateRecordResponse(...arguments);\n case 'deleteRecord':\n return this.normalizeDeleteRecordResponse(...arguments);\n case 'updateRecord':\n return this.normalizeUpdateRecordResponse(...arguments);\n }\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findRecord`\n\n @since 1.13.0\n @method normalizeFindRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `queryRecord`\n\n @since 1.13.0\n @method normalizeQueryRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeQueryRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findAll`\n\n @since 1.13.0\n @method normalizeFindAllResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindAllResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findBelongsTo`\n\n @since 1.13.0\n @method normalizeFindBelongsToResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindBelongsToResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findHasMany`\n\n @since 1.13.0\n @method normalizeFindHasManyResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindHasManyResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findMany`\n\n @since 1.13.0\n @method normalizeFindManyResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindManyResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `query`\n\n @since 1.13.0\n @method normalizeQueryResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeQueryResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `createRecord`\n\n @since 1.13.0\n @method normalizeCreateRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeCreateRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSaveResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `deleteRecord`\n\n @since 1.13.0\n @method normalizeDeleteRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeDeleteRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSaveResponse(...arguments);\n },\n\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `updateRecord`\n\n @since 1.13.0\n @method normalizeUpdateRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeUpdateRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSaveResponse(...arguments);\n },\n\n /**\n normalizeUpdateRecordResponse, normalizeCreateRecordResponse and\n normalizeDeleteRecordResponse delegate to this method by default.\n\n @since 1.13.0\n @method normalizeSaveResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeSaveResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n\n /**\n normalizeQueryResponse and normalizeFindRecordResponse delegate to this\n method by default.\n\n @since 1.13.0\n @method normalizeSingleResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeSingleResponse(store, primaryModelClass, payload, id, requestType) {\n return this._normalizeResponse(store, primaryModelClass, payload, id, requestType, true);\n },\n\n /**\n normalizeQueryResponse, normalizeFindManyResponse, and normalizeFindHasManyResponse delegate\n to this method by default.\n\n @since 1.13.0\n @method normalizeArrayResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n return this._normalizeResponse(store, primaryModelClass, payload, id, requestType, false);\n },\n\n /**\n @method _normalizeResponse\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @param {Boolean} isSingle\n @return {Object} JSON-API Document\n @private\n */\n _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {\n const documentHash = {\n data: null,\n included: [],\n };\n\n const meta = this.extractMeta(store, primaryModelClass, payload);\n if (meta) {\n assert(\n 'The `meta` returned from `extractMeta` has to be an object, not \"' + typeof meta + '\".',\n typeof meta === 'object'\n );\n documentHash.meta = meta;\n }\n\n if (isSingle) {\n const { data, included } = this.normalize(primaryModelClass, payload);\n documentHash.data = data;\n if (included) {\n documentHash.included = included;\n }\n } else {\n const ret = new Array(payload.length);\n for (let i = 0, l = payload.length; i < l; i++) {\n const item = payload[i];\n const { data, included } = this.normalize(primaryModelClass, item);\n if (included) {\n documentHash.included = documentHash.included.concat(included);\n }\n ret[i] = data;\n }\n\n documentHash.data = ret;\n }\n\n return documentHash;\n },\n\n /**\n Normalizes a part of the JSON payload returned by\n the server. You should override this method, munge the hash\n and call super if you have generic normalization to do.\n\n It takes the type of the record that is being normalized\n (as a Model class), the property where the hash was\n originally found, and the hash to normalize.\n\n You can use this method, for example, to normalize underscored keys to camelized\n or other general-purpose normalizations.\n\n Example\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '<app-name>/utils/string-utils';\n import { get } from '@ember/object';\n\n export default class ApplicationSerializer extends JSONSerializer {\n normalize(typeClass, hash) {\n let fields = typeClass.fields;\n\n fields.forEach(function(type, field) {\n let payloadField = underscore(field);\n if (field === payloadField) { return; }\n\n hash[field] = hash[payloadField];\n delete hash[payloadField];\n });\n\n return super.normalize(...arguments);\n }\n }\n ```\n\n @method normalize\n @public\n @param {Model} typeClass\n @param {Object} hash\n @return {Object}\n */\n normalize(modelClass, resourceHash) {\n let data = null;\n\n if (resourceHash) {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash);\n if (typeof resourceHash.links === 'object') {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash.links);\n }\n\n data = {\n id: this.extractId(modelClass, resourceHash),\n type: modelClass.modelName,\n attributes: this.extractAttributes(modelClass, resourceHash),\n relationships: this.extractRelationships(modelClass, resourceHash),\n };\n\n if (resourceHash.lid) {\n data.lid = resourceHash.lid;\n }\n\n this.applyTransforms(modelClass, data.attributes);\n }\n\n return { data };\n },\n\n /**\n Returns the resource's ID.\n\n @method extractId\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {String}\n */\n extractId(modelClass, resourceHash) {\n const primaryKey = this.primaryKey;\n const id = resourceHash[primaryKey];\n return coerceId(id);\n },\n\n /**\n Returns the resource's attributes formatted as a JSON-API \"attributes object\".\n\n http://jsonapi.org/format/#document-resource-object-attributes\n\n @method extractAttributes\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {Object}\n */\n extractAttributes(modelClass, resourceHash) {\n let attributeKey;\n const attributes = {};\n\n modelClass.eachAttribute((key) => {\n attributeKey = this.keyForAttribute(key, 'deserialize');\n if (resourceHash[attributeKey] !== undefined) {\n attributes[key] = resourceHash[attributeKey];\n }\n });\n\n return attributes;\n },\n\n /**\n Returns a relationship formatted as a JSON-API \"relationship object\".\n\n http://jsonapi.org/format/#document-resource-object-relationships\n\n @method extractRelationship\n @public\n @param {Object} relationshipModelName\n @param {Object} relationshipHash\n @return {Object}\n */\n extractRelationship(relationshipModelName, relationshipHash) {\n if (!relationshipHash) {\n return null;\n }\n /*\n When `relationshipHash` is an object it usually means that the relationship\n is polymorphic. It could however also be embedded resources that the\n EmbeddedRecordsMixin has be able to process.\n */\n if (relationshipHash && typeof relationshipHash === 'object' && !Array.isArray(relationshipHash)) {\n if (relationshipHash.id) {\n relationshipHash.id = coerceId(relationshipHash.id);\n }\n\n const modelClass = this.store.modelFor(relationshipModelName);\n if (relationshipHash.type && !modelClass.fields.has('type')) {\n relationshipHash.type = this.modelNameFromPayloadKey(relationshipHash.type);\n }\n\n return relationshipHash;\n }\n return { id: coerceId(relationshipHash), type: dasherize(singularize(relationshipModelName)) };\n },\n\n /**\n Returns a polymorphic relationship formatted as a JSON-API \"relationship object\".\n\n http://jsonapi.org/format/#document-resource-object-relationships\n\n `relationshipOptions` is a hash which contains more information about the\n polymorphic relationship which should be extracted:\n - `resourceHash` complete hash of the resource the relationship should be\n extracted from\n - `relationshipKey` key under which the value for the relationship is\n extracted from the resourceHash\n - `relationshipMeta` meta information about the relationship\n\n @method extractPolymorphicRelationship\n @public\n @param {Object} relationshipModelName\n @param {Object} relationshipHash\n @param {Object} relationshipOptions\n @return {Object}\n */\n extractPolymorphicRelationship(relationshipModelName, relationshipHash, relationshipOptions) {\n return this.extractRelationship(relationshipModelName, relationshipHash);\n },\n\n /**\n Returns the resource's relationships formatted as a JSON-API \"relationships object\".\n\n http://jsonapi.org/format/#document-resource-object-relationships\n\n @method extractRelationships\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {Object}\n */\n extractRelationships(modelClass, resourceHash) {\n const relationships = {};\n\n modelClass.eachRelationship((key, relationshipMeta) => {\n let relationship = null;\n const relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');\n if (resourceHash[relationshipKey] !== undefined) {\n let data = null;\n const relationshipHash = resourceHash[relationshipKey];\n if (relationshipMeta.kind === 'belongsTo') {\n if (relationshipMeta.options.polymorphic) {\n // extracting a polymorphic belongsTo may need more information\n // than the type and the hash (which might only be an id) for the\n // relationship, hence we pass the key, resource and\n // relationshipMeta too\n data = this.extractPolymorphicRelationship(relationshipMeta.type, relationshipHash, {\n key,\n resourceHash,\n relationshipMeta,\n });\n } else {\n data = this.extractRelationship(relationshipMeta.type, relationshipHash);\n }\n } else if (relationshipMeta.kind === 'hasMany') {\n if (relationshipHash) {\n data = new Array(relationshipHash.length);\n if (relationshipMeta.options.polymorphic) {\n for (let i = 0, l = relationshipHash.length; i < l; i++) {\n const item = relationshipHash[i];\n data[i] = this.extractPolymorphicRelationship(relationshipMeta.type, item, {\n key,\n resourceHash,\n relationshipMeta,\n });\n }\n } else {\n for (let i = 0, l = relationshipHash.length; i < l; i++) {\n const item = relationshipHash[i];\n data[i] = this.extractRelationship(relationshipMeta.type, item);\n }\n }\n }\n }\n relationship = { data };\n }\n\n const linkKey = this.keyForLink(key, relationshipMeta.kind);\n if (resourceHash.links && resourceHash.links[linkKey] !== undefined) {\n const related = resourceHash.links[linkKey];\n relationship = relationship || {};\n relationship.links = { related };\n }\n\n if (relationship) {\n relationships[key] = relationship;\n }\n });\n\n return relationships;\n },\n\n /**\n Dasherizes the model name in the payload\n\n @method modelNameFromPayloadKey\n @public\n @param {String} key\n @return {String} the model's modelName\n */\n modelNameFromPayloadKey(key) {\n return dasherize(singularize(key));\n },\n\n /**\n @method normalizeRelationships\n @private\n */\n normalizeRelationships(typeClass, hash) {\n let payloadKey;\n\n if (this.keyForRelationship) {\n typeClass.eachRelationship((key, relationship) => {\n payloadKey = this.keyForRelationship(key, relationship.kind, 'deserialize');\n if (key === payloadKey) {\n return;\n }\n if (hash[payloadKey] === undefined) {\n return;\n }\n\n hash[key] = hash[payloadKey];\n delete hash[payloadKey];\n });\n }\n },\n\n /**\n @method normalizeUsingDeclaredMapping\n @private\n */\n normalizeUsingDeclaredMapping(modelClass, hash) {\n const attrs = this.attrs;\n let normalizedKey;\n let payloadKey;\n\n if (attrs) {\n for (const key in attrs) {\n normalizedKey = payloadKey = this._getMappedKey(key, modelClass);\n\n if (hash[payloadKey] === undefined) {\n continue;\n }\n\n if (modelClass.attributes.has(key)) {\n normalizedKey = this.keyForAttribute(key, 'deserialize');\n }\n\n if (modelClass.relationshipsByName.has(key)) {\n normalizedKey = this.keyForRelationship(key, modelClass, 'deserialize');\n }\n\n if (payloadKey !== normalizedKey) {\n hash[normalizedKey] = hash[payloadKey];\n delete hash[payloadKey];\n }\n }\n }\n },\n\n /**\n Looks up the property key that was set by the custom `attr` mapping\n passed to the serializer.\n\n @method _getMappedKey\n @private\n @param {String} key\n @return {String} key\n */\n _getMappedKey(key, modelClass) {\n warn(\n 'There is no attribute or relationship with the name `' +\n key +\n '` on `' +\n modelClass.modelName +\n '`. Check your serializers attrs hash.',\n modelClass.attributes.has(key) || modelClass.relationshipsByName.has(key),\n {\n id: 'ds.serializer.no-mapped-attrs-key',\n }\n );\n\n const attrs = this.attrs;\n let mappedKey;\n if (attrs && attrs[key]) {\n mappedKey = attrs[key];\n //We need to account for both the { title: 'post_title' } and\n //{ title: { key: 'post_title' }} forms\n if (mappedKey.key) {\n mappedKey = mappedKey.key;\n }\n if (typeof mappedKey === 'string') {\n key = mappedKey;\n }\n }\n\n return key;\n },\n\n /**\n Check attrs.key.serialize property to inform if the `key`\n can be serialized\n\n @method _canSerialize\n @private\n @param {String} key\n @return {boolean} true if the key can be serialized\n */\n _canSerialize(key) {\n const attrs = this.attrs;\n\n return !attrs || !attrs[key] || attrs[key].serialize !== false;\n },\n\n /**\n When attrs.key.serialize is set to true then\n it takes priority over the other checks and the related\n attribute/relationship will be serialized\n\n @method _mustSerialize\n @private\n @param {String} key\n @return {boolean} true if the key must be serialized\n */\n _mustSerialize(key) {\n const attrs = this.attrs;\n\n return attrs && attrs[key] && attrs[key].serialize === true;\n },\n\n /**\n Check if the given hasMany relationship should be serialized\n\n By default only many-to-many and many-to-none relationships are serialized.\n This could be configured per relationship by Serializer's `attrs` object.\n\n @method shouldSerializeHasMany\n @public\n @param {Snapshot} snapshot\n @param {String} key\n @param {RelationshipSchema} relationship\n @return {boolean} true if the hasMany relationship should be serialized\n */\n shouldSerializeHasMany(snapshot, key, relationship) {\n const schema = this.store.modelFor(snapshot.modelName);\n const relationshipType = schema.determineRelationshipType(relationship, this.store);\n if (this._mustSerialize(key)) {\n return true;\n }\n return this._canSerialize(key) && (relationshipType === 'manyToNone' || relationshipType === 'manyToMany');\n },\n\n // SERIALIZE\n /**\n Called when a record is saved in order to convert the\n record into JSON.\n\n By default, it creates a JSON object with a key for\n each attribute and belongsTo relationship.\n\n For example, consider this model:\n\n ```app/models/comment.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @attr title;\n @attr body;\n\n @belongsTo('user') author;\n }\n ```\n\n The default serialization would create a JSON object like:\n\n ```javascript\n {\n \"title\": \"Rails is unagi\",\n \"body\": \"Rails? Omakase? O_O\",\n \"author\": 12\n }\n ```\n\n By default, attributes are passed through as-is, unless\n you specified an attribute type (`attr('date')`). If\n you specify a transform, the JavaScript value will be\n serialized when inserted into the JSON hash.\n\n By default, belongs-to relationships are converted into\n IDs when inserted into the JSON hash.\n\n ## IDs\n\n `serialize` takes an options hash with a single option:\n `includeId`. If this option is `true`, `serialize` will,\n by default include the ID in the JSON object it builds.\n\n The adapter passes in `includeId: true` when serializing\n a record for `createRecord`, but not for `updateRecord`.\n\n ## Customization\n\n Your server may expect a different JSON format than the\n built-in serialization format.\n\n In that case, you can implement `serialize` yourself and\n return a JSON hash of your choosing.\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = {\n POST_TTL: snapshot.attr('title'),\n POST_BDY: snapshot.attr('body'),\n POST_CMS: snapshot.hasMany('comments', { ids: true })\n };\n\n if (options.includeId) {\n json.POST_ID_ = snapshot.id;\n }\n\n return json;\n }\n }\n ```\n\n ## Customizing an App-Wide Serializer\n\n If you want to define a serializer for your entire\n application, you'll probably want to use `eachAttribute`\n and `eachRelationship` on the record.\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { singularize } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = {};\n\n snapshot.eachAttribute((name) => {\n json[serverAttributeName(name)] = snapshot.attr(name);\n });\n\n snapshot.eachRelationship((name, relationship) => {\n if (relationship.kind === 'hasMany') {\n json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n }\n });\n\n if (options.includeId) {\n json.ID_ = snapshot.id;\n }\n\n return json;\n }\n }\n\n function serverAttributeName(attribute) {\n return attribute.underscore().toUpperCase();\n }\n\n function serverHasManyName(name) {\n return serverAttributeName(singularize(name)) + \"_IDS\";\n }\n ```\n\n This serializer will generate JSON that looks like this:\n\n ```javascript\n {\n \"TITLE\": \"Rails is omakase\",\n \"BODY\": \"Yep. Omakase.\",\n \"COMMENT_IDS\": [ \"1\", \"2\", \"3\" ]\n }\n ```\n\n ## Tweaking the Default JSON\n\n If you just want to do some small tweaks on the default JSON,\n you can call `super.serialize` first and make the tweaks on\n the returned JSON.\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = super.serialize(...arguments);\n\n json.subject = json.title;\n delete json.title;\n\n return json;\n }\n }\n ```\n\n @method serialize\n @public\n @param {Snapshot} snapshot\n @param {Object} options\n @return {Object} json\n */\n serialize(snapshot, options) {\n const json = {};\n\n if (options && options.includeId) {\n const id = snapshot.id;\n if (id) {\n json[this.primaryKey] = id;\n }\n }\n\n snapshot.eachAttribute((key, attribute) => {\n this.serializeAttribute(snapshot, json, key, attribute);\n });\n\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n this.serializeBelongsTo(snapshot, json, relationship);\n } else if (relationship.kind === 'hasMany') {\n this.serializeHasMany(snapshot, json, relationship);\n }\n });\n\n return json;\n },\n\n /**\n You can use this method to customize how a serialized record is added to the complete\n JSON hash to be sent to the server. By default the JSON Serializer does not namespace\n the payload and just sends the raw serialized JSON object.\n If your server expects namespaced keys, you should consider using the RESTSerializer.\n Otherwise you can override this method to customize how the record is added to the hash.\n The hash property should be modified by reference.\n\n For example, your server may expect underscored root objects.\n\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n import { decamelize } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends RESTSerializer {\n serializeIntoHash(data, type, snapshot, options) {\n let root = decamelize(type.modelName);\n data[root] = this.serialize(snapshot, options);\n }\n }\n ```\n\n @method serializeIntoHash\n @public\n @param {Object} hash\n @param {Model} typeClass\n @param {Snapshot} snapshot\n @param {Object} options\n */\n serializeIntoHash(hash, typeClass, snapshot, options) {\n Object.assign(hash, this.serialize(snapshot, options));\n },\n\n /**\n `serializeAttribute` can be used to customize how `attr`\n properties are serialized\n\n For example if you wanted to ensure all your attributes were always\n serialized as properties on an `attributes` object you could\n write:\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class ApplicationSerializer extends JSONSerializer {\n serializeAttribute(snapshot, json, key, attributes) {\n json.attributes = json.attributes || {};\n super.serializeAttribute(snapshot, json.attributes, key, attributes);\n }\n }\n ```\n\n @method serializeAttribute\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {String} key\n @param {Object} attribute\n */\n serializeAttribute(snapshot, json, key, attribute) {\n if (this._canSerialize(key)) {\n const type = attribute.type;\n let value = snapshot.attr(key);\n if (type) {\n const transform = this.transformFor(type);\n value = transform.serialize(value, attribute.options);\n }\n\n // if provided, use the mapping provided by `attrs` in\n // the serializer\n const schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(key, schema);\n\n if (payloadKey === key && this.keyForAttribute) {\n payloadKey = this.keyForAttribute(key, 'serialize');\n }\n\n json[payloadKey] = value;\n }\n },\n\n /**\n `serializeBelongsTo` can be used to customize how `belongsTo`\n properties are serialized.\n\n Example\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n serializeBelongsTo(snapshot, json, relationship) {\n let key = relationship.name;\n let belongsTo = snapshot.belongsTo(key);\n\n key = this.keyForRelationship ? this.keyForRelationship(key, \"belongsTo\", \"serialize\") : key;\n\n json[key] = !belongsTo ? null : belongsTo.record.toJSON();\n }\n }\n ```\n\n @method serializeBelongsTo\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializeBelongsTo(snapshot, json, relationship) {\n const name = relationship.name;\n\n if (this._canSerialize(name)) {\n const belongsToId = snapshot.belongsTo(name, { id: true });\n\n // if provided, use the mapping provided by `attrs` in\n // the serializer\n const schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(name, schema);\n if (payloadKey === name && this.keyForRelationship) {\n payloadKey = this.keyForRelationship(name, 'belongsTo', 'serialize');\n }\n\n //Need to check whether the id is there for new&async records\n if (!belongsToId) {\n json[payloadKey] = null;\n } else {\n json[payloadKey] = belongsToId;\n }\n\n if (relationship.options.polymorphic) {\n this.serializePolymorphicType(snapshot, json, relationship);\n }\n }\n },\n\n /**\n `serializeHasMany` can be used to customize how `hasMany`\n properties are serialized.\n\n Example\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n serializeHasMany(snapshot, json, relationship) {\n let key = relationship.name;\n if (key === 'comments') {\n return;\n } else {\n super.serializeHasMany(...arguments);\n }\n }\n }\n ```\n\n @method serializeHasMany\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializeHasMany(snapshot, json, relationship) {\n const name = relationship.name;\n\n if (this.shouldSerializeHasMany(snapshot, name, relationship)) {\n const hasMany = snapshot.hasMany(name, { ids: true });\n if (hasMany !== undefined) {\n // if provided, use the mapping provided by `attrs` in\n // the serializer\n const schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(name, schema);\n if (payloadKey === name && this.keyForRelationship) {\n payloadKey = this.keyForRelationship(name, 'hasMany', 'serialize');\n }\n\n json[payloadKey] = hasMany;\n // TODO support for polymorphic manyToNone and manyToMany relationships\n }\n }\n },\n\n /**\n You can use this method to customize how polymorphic objects are\n serialized. Objects are considered to be polymorphic if\n `{ polymorphic: true }` is pass as the second argument to the\n `belongsTo` function.\n\n Example\n\n ```app/serializers/comment.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class CommentSerializer extends JSONSerializer {\n serializePolymorphicType(snapshot, json, relationship) {\n let key = relationship.name;\n let belongsTo = snapshot.belongsTo(key);\n\n key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;\n\n if (!belongsTo) {\n json[key + '_type'] = null;\n } else {\n json[key + '_type'] = belongsTo.modelName;\n }\n }\n }\n ```\n\n @method serializePolymorphicType\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializePolymorphicType() {},\n\n /**\n `extractMeta` is used to deserialize any meta information in the\n adapter payload. By default Ember Data expects meta information to\n be located on the `meta` property of the payload object.\n\n Example\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n extractMeta(store, typeClass, payload) {\n if (payload && payload.hasOwnProperty('_pagination')) {\n let meta = payload._pagination;\n delete payload._pagination;\n return meta;\n }\n }\n }\n ```\n\n @method extractMeta\n @public\n @param {Store} store\n @param {Model} modelClass\n @param {Object} payload\n */\n extractMeta(store, modelClass, payload) {\n if (payload && payload['meta'] !== undefined) {\n const meta = payload.meta;\n delete payload.meta;\n return meta;\n }\n },\n\n /**\n `extractErrors` is used to extract model errors when a call\n to `Model#save` fails with an `InvalidError`. By default\n Ember Data expects error information to be located on the `errors`\n property of the payload object.\n\n This serializer expects this `errors` object to be an Array similar\n to the following, compliant with the https://jsonapi.org/format/#errors specification:\n\n ```js\n {\n \"errors\": [\n {\n \"detail\": \"This username is already taken!\",\n \"source\": {\n \"pointer\": \"data/attributes/username\"\n }\n }, {\n \"detail\": \"Doesn't look like a valid email.\",\n \"source\": {\n \"pointer\": \"data/attributes/email\"\n }\n }\n ]\n }\n ```\n\n The key `detail` provides a textual description of the problem.\n Alternatively, the key `title` can be used for the same purpose.\n\n The nested keys `source.pointer` detail which specific element\n of the request data was invalid.\n\n Note that JSON-API also allows for object-level errors to be placed\n in an object with pointer `data`, signifying that the problem\n cannot be traced to a specific attribute:\n\n ```javascript\n {\n \"errors\": [\n {\n \"detail\": \"Some generic non property error message\",\n \"source\": {\n \"pointer\": \"data\"\n }\n }\n ]\n }\n ```\n\n When turn into a `Errors` object, you can read these errors\n through the property `base`:\n\n ```handlebars\n {{#each @model.errors.base as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n ```\n\n Example of alternative implementation, overriding the default\n behavior to deal with a different format of errors:\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class PostSerializer extends JSONSerializer {\n extractErrors(store, typeClass, payload, id) {\n if (payload && typeof payload === 'object' && payload._problems) {\n payload = payload._problems;\n this.normalizeErrors(typeClass, payload);\n }\n return payload;\n }\n }\n ```\n\n @method extractErrors\n @public\n @param {Store} store\n @param {Model} typeClass\n @param {Object} payload\n @param {(String|Number)} id\n @return {Object} json The deserialized errors\n */\n extractErrors(store, typeClass, payload, id) {\n if (payload && typeof payload === 'object' && payload.errors) {\n // the default assumption is that errors is already in JSON:API format\n const extracted = {};\n\n payload.errors.forEach((error) => {\n if (error.source && error.source.pointer) {\n let key = error.source.pointer.match(SOURCE_POINTER_REGEXP);\n\n if (key) {\n key = key[2];\n } else if (error.source.pointer.search(SOURCE_POINTER_PRIMARY_REGEXP) !== -1) {\n key = PRIMARY_ATTRIBUTE_KEY;\n }\n\n if (key) {\n extracted[key] = extracted[key] || [];\n extracted[key].push(error.detail || error.title);\n }\n }\n });\n\n // if the user has an attrs hash, convert keys using it\n this.normalizeUsingDeclaredMapping(typeClass, extracted);\n\n // for each attr and relationship, make sure that we use\n // the normalized key\n typeClass.eachAttribute((name) => {\n const key = this.keyForAttribute(name, 'deserialize');\n if (key !== name && extracted[key] !== undefined) {\n extracted[name] = extracted[key];\n delete extracted[key];\n }\n });\n\n typeClass.eachRelationship((name) => {\n const key = this.keyForRelationship(name, 'deserialize');\n if (key !== name && extracted[key] !== undefined) {\n extracted[name] = extracted[key];\n delete extracted[key];\n }\n });\n\n return extracted;\n }\n\n return payload;\n },\n\n /**\n `keyForAttribute` can be used to define rules for how to convert an\n attribute name in your model to a key in your JSON.\n\n Example\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends JSONSerializer {\n keyForAttribute(attr, method) {\n return underscore(attr).toUpperCase();\n }\n }\n ```\n\n @method keyForAttribute\n @public\n @param {String} key\n @param {String} method\n @return {String} normalized key\n */\n keyForAttribute(key, method) {\n return key;\n },\n\n /**\n `keyForRelationship` can be used to define a custom key when\n serializing and deserializing relationship properties. By default\n `JSONSerializer` does not provide an implementation of this method.\n\n Example\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default class PostSerializer extends JSONSerializer {\n keyForRelationship(key, relationship, method) {\n return `rel_${underscore(key)}`;\n }\n }\n ```\n\n @method keyForRelationship\n @public\n @param {String} key\n @param {String} typeClass\n @param {String} method\n @return {String} normalized key\n */\n keyForRelationship(key, typeClass, method) {\n return key;\n },\n\n /**\n `keyForLink` can be used to define a custom key when deserializing link\n properties.\n\n @method keyForLink\n @public\n @param {String} key\n @param {String} kind `belongsTo` or `hasMany`\n @return {String} normalized key\n */\n keyForLink(key, kind) {\n return key;\n },\n\n // HELPERS\n\n /**\n @method transformFor\n @private\n @param {String} attributeType\n @param {Boolean} skipAssertion\n @return {Transform} transform\n */\n transformFor(attributeType, skipAssertion) {\n const transform = getOwner(this).lookup('transform:' + attributeType);\n\n assert(`Unable to find the transform for \\`attr('${attributeType}')\\``, skipAssertion || !!transform);\n\n return transform;\n },\n});\n\nexport default JSONSerializer;\n"],"names":["coerceId","id","undefined","toString","String","SOURCE_POINTER_REGEXP","SOURCE_POINTER_PRIMARY_REGEXP","PRIMARY_ATTRIBUTE_KEY","JSONSerializer","Serializer","extend","primaryKey","mergedProperties","applyTransforms","typeClass","data","attributes","eachTransformedAttribute","key","transform","transformFor","transformMeta","get","deserialize","options","normalizeResponse","store","primaryModelClass","payload","requestType","normalizeFindRecordResponse","arguments","normalizeQueryRecordResponse","normalizeFindAllResponse","normalizeFindBelongsToResponse","normalizeFindHasManyResponse","normalizeFindManyResponse","normalizeQueryResponse","normalizeCreateRecordResponse","normalizeDeleteRecordResponse","normalizeUpdateRecordResponse","normalizeSingleResponse","normalizeArrayResponse","normalizeSaveResponse","_normalizeResponse","isSingle","documentHash","included","meta","extractMeta","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","normalize","ret","Array","length","i","l","item","concat","modelClass","resourceHash","normalizeUsingDeclaredMapping","links","extractId","type","modelName","extractAttributes","relationships","extractRelationships","lid","attributeKey","eachAttribute","keyForAttribute","extractRelationship","relationshipModelName","relationshipHash","isArray","modelFor","fields","has","modelNameFromPayloadKey","dasherize","singularize","extractPolymorphicRelationship","relationshipOptions","eachRelationship","relationshipMeta","relationship","relationshipKey","keyForRelationship","kind","polymorphic","linkKey","keyForLink","related","normalizeRelationships","hash","payloadKey","attrs","normalizedKey","_getMappedKey","relationshipsByName","warn","mappedKey","_canSerialize","serialize","_mustSerialize","shouldSerializeHasMany","snapshot","schema","relationshipType","determineRelationshipType","json","includeId","attribute","serializeAttribute","serializeBelongsTo","serializeHasMany","serializeIntoHash","Object","assign","value","attr","name","belongsToId","belongsTo","serializePolymorphicType","hasMany","ids","extractErrors","errors","extracted","forEach","error","source","pointer","match","search","push","detail","title","method","attributeType","skipAssertion","getOwner","lookup"],"mappings":";;;;;;;AAEO,SAASA,QAAQA,CAACC,EAAa,EAAiB;EACrD,IAAIA,EAAE,KAAK,IAAI,IAAIA,EAAE,KAAKC,SAAS,IAAID,EAAE,KAAK,EAAE,EAAE;AAChD,IAAA,OAAO,IAAI,CAAA;AACb,GAAC,MAAM,IAAI,OAAOA,EAAE,KAAK,QAAQ,EAAE;AACjC,IAAA,OAAOA,EAAE,CAAA;AACX,GAAC,MAAM,IAAI,OAAOA,EAAE,KAAK,QAAQ,EAAE;AACjC,IAAA,OAAOA,EAAE,CAACE,QAAQ,EAAE,CAAA;AACtB,GAAC,MAAM;IACL,OAAOC,MAAM,CAACH,EAAE,CAAC,CAAA;AACnB,GAAA;AACF;;ACZA;AACA;AACA;AAYA,MAAMI,qBAAqB,GAAG,4CAA4C,CAAA;AAC1E,MAAMC,6BAA6B,GAAG,UAAU,CAAA;AAChD,MAAMC,qBAAqB,GAAG,MAAM,CAAA;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGC,UAAU,CAACC,MAAM,CAAC;AACvC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKEC,EAAAA,UAAU,EAAE,IAAI;AAEhB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAeEC,gBAAgB,EAAE,CAAC,OAAO,CAAC;AAE3B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEEC,EAAAA,eAAeA,CAACC,SAAS,EAAEC,IAAI,EAAE;AAC/B,IAAA,MAAMC,UAAU,GAAGF,SAAS,CAACE,UAAU,CAAA;AAEvCF,IAAAA,SAAS,CAACG,wBAAwB,CAAC,CAACC,GAAG,EAAEJ,SAAS,KAAK;AACrD,MAAA,IAAIC,IAAI,CAACG,GAAG,CAAC,KAAKhB,SAAS,EAAE;AAC3B,QAAA,OAAA;AACF,OAAA;AAEA,MAAA,MAAMiB,SAAS,GAAG,IAAI,CAACC,YAAY,CAACN,SAAS,CAAC,CAAA;AAC9C,MAAA,MAAMO,aAAa,GAAGL,UAAU,CAACM,GAAG,CAACJ,GAAG,CAAC,CAAA;AACzCH,MAAAA,IAAI,CAACG,GAAG,CAAC,GAAGC,SAAS,CAACI,WAAW,CAACR,IA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OED,wBAAwBA,GAAG,EAAE;AAE7B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKEnF,EAAAA,WAAWA,CAACvB,KAAK,EAAEuC,UAAU,EAAErC,OAAO,EAAE;IACtC,IAAIA,OAAO,IAAIA,OAAO,CAAC,MAAM,CAAC,KAAK1B,SAAS,EAAE;AAC5C,MAAA,MAAM8C,IAAI,GAAGpB,OAAO,CAACoB,IAAI,CAAA;MACzB,OAAOpB,OAAO,CAACoB,IAAI,CAAA;AACnB,MAAA,OAAOA,IAAI,CAAA;AACb,KAAA;GACD;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;EAaEuF,aAAaA,CAAC7G,KAAK,EAAEZ,SAAS,EAAEc,OAAO,EAAE3B,EAAE,EAAE;IAC3C,IAAI2B,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,IAAIA,OAAO,CAAC4G,MAAM,EAAE;AAC5D;MACA,MAAMC,SAAS,GAAG,EAAE,CAAA;AAEpB7G,MAAAA,OAAO,CAAC4G,MAAM,CAACE,OAAO,CAAEC,KAAK,IAAK;QAChC,IAAIA,KAAK,CAACC,MAAM,IAAID,KAAK,CAACC,MAAM,CAACC,OAAO,EAAE;UACxC,IAAI3H,GAAG,GAAGyH,KAAK,CAACC,MAAM,CAACC,OAAO,CAACC,KAAK,CAACzI,qBAAqB,CAAC,CAAA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