@ember-data-mirror/serializer 5.4.0-beta.9 → 5.4.1-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 (46) hide show
  1. package/LICENSE.md +19 -7
  2. package/README.md +5 -9
  3. package/dist/index.js +7 -74
  4. package/dist/index.js.map +1 -1
  5. package/dist/json-BwMH6O_R.js +2 -2
  6. package/dist/json-BwMH6O_R.js.map +1 -1
  7. package/dist/json-api.js +14 -12
  8. package/dist/json-api.js.map +1 -1
  9. package/dist/rest.js +13 -9
  10. package/dist/rest.js.map +1 -1
  11. package/dist/transform.js +0 -1
  12. package/dist/transform.js.map +1 -1
  13. package/logos/NCC-1701-a-blue.svg +4 -0
  14. package/logos/NCC-1701-a-gold.svg +4 -0
  15. package/logos/NCC-1701-a-gold_100.svg +1 -0
  16. package/logos/NCC-1701-a-gold_base-64.txt +1 -0
  17. package/logos/NCC-1701-a.svg +4 -0
  18. package/logos/README.md +4 -0
  19. package/logos/docs-badge.svg +2 -0
  20. package/logos/ember-data-logo-dark.svg +12 -0
  21. package/logos/ember-data-logo-light.svg +12 -0
  22. package/logos/github-header.svg +444 -0
  23. package/logos/social1.png +0 -0
  24. package/logos/social2.png +0 -0
  25. package/logos/warp-drive-logo-dark.svg +4 -0
  26. package/logos/warp-drive-logo-gold.svg +4 -0
  27. package/package.json +44 -57
  28. package/unstable-preview-types/-private/embedded-records-mixin.d.ts +0 -1
  29. package/unstable-preview-types/-private/embedded-records-mixin.d.ts.map +1 -1
  30. package/unstable-preview-types/-private/transforms/boolean.d.ts +2 -2
  31. package/unstable-preview-types/-private/transforms/boolean.d.ts.map +1 -1
  32. package/unstable-preview-types/-private/transforms/boolean.type-test.d.ts +4 -0
  33. package/unstable-preview-types/-private/transforms/boolean.type-test.d.ts.map +1 -0
  34. package/unstable-preview-types/-private/transforms/date.d.ts.map +1 -1
  35. package/unstable-preview-types/-private/transforms/number.d.ts.map +1 -1
  36. package/unstable-preview-types/-private/transforms/string.d.ts.map +1 -1
  37. package/unstable-preview-types/-private/transforms/transform.d.ts +0 -1
  38. package/unstable-preview-types/-private/transforms/transform.d.ts.map +1 -1
  39. package/unstable-preview-types/index.d.ts +4 -4
  40. package/unstable-preview-types/index.d.ts.map +1 -1
  41. package/unstable-preview-types/json-api.d.ts +3 -4
  42. package/unstable-preview-types/json-api.d.ts.map +1 -1
  43. package/unstable-preview-types/json.d.ts +1 -2
  44. package/unstable-preview-types/json.d.ts.map +1 -1
  45. package/unstable-preview-types/rest.d.ts +3 -4
  46. package/unstable-preview-types/rest.d.ts.map +1 -1
package/LICENSE.md CHANGED
@@ -1,11 +1,23 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (C) 2017-2023 Ember.js contributors
4
- Portions Copyright (C) 2011-2017 Tilde, Inc. and contributors.
5
- Portions Copyright (C) 2011 LivingSocial Inc.
3
+ Copyright (c) 2017-2025 Ember.js and contributors
4
+ Copyright (c) 2011-2017 Tilde, Inc. and contributors
5
+ Copyright (c) 2011 LivingSocial Inc.
6
6
 
7
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
8
13
 
9
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
10
16
 
11
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  <p align="center">
2
2
  <img
3
3
  class="project-logo"
4
- src="./ember-data-logo-dark.svg#gh-dark-mode-only"
4
+ src="./logos/ember-data-logo-dark.svg#gh-dark-mode-only"
5
5
  alt="EmberData Serializer"
6
6
  width="240px"
7
7
  title="EmberData Serializer"
8
8
  />
9
9
  <img
10
10
  class="project-logo"
11
- src="./ember-data-logo-light.svg#gh-light-mode-only"
11
+ src="./logos/ember-data-logo-light.svg#gh-light-mode-only"
12
12
  alt="EmberData Serializer"
13
13
  width="240px"
14
14
  title="EmberData Serializer"
@@ -60,13 +60,9 @@ import RequestManager from '@ember-data-mirror/request';
60
60
  import { LegacyNetworkHandler } from '@ember-data-mirror/legacy-compat';
61
61
 
62
62
  export default class extends Store {
63
- requestManager = new RequestManager();
64
-
65
- constructor(args) {
66
- super(args);
67
- this.requestManager.use([LegacyNetworkHandler]);
68
- this.requestManager.useCache(CacheHandler);
69
- }
63
+ requestManager = new RequestManager()
64
+ .use([LegacyNetworkHandler])
65
+ .useCache(CacheHandler);
70
66
  }
71
67
  ```
72
68
 
package/dist/index.js CHANGED
@@ -1,25 +1,6 @@
1
1
  import EmberObject from '@ember/object';
2
- import { inject } from '@ember/service';
3
- var __defProp = Object.defineProperty;
4
- var __export = (target, all) => {
5
- for (var name in all) __defProp(target, name, {
6
- get: all[name],
7
- enumerable: true
8
- });
9
- };
10
-
11
- // src/runtime.ts
12
- var runtime_exports = {};
13
- __export(runtime_exports, {
14
- c: () => decorateClass,
15
- f: () => decorateFieldV1,
16
- g: () => decorateFieldV2,
17
- i: () => initializeDeferredDecorator,
18
- m: () => decorateMethodV1,
19
- n: () => decorateMethodV2,
20
- p: () => decoratePOJO
21
- });
22
- var deferred = /* @__PURE__ */new WeakMap();
2
+ import * as s from '@ember/service';
3
+ const deferred = /* @__PURE__ */new WeakMap();
23
4
  function deferDecorator(proto, prop, desc) {
24
5
  let map = deferred.get(proto);
25
6
  if (!map) {
@@ -29,18 +10,16 @@ function deferDecorator(proto, prop, desc) {
29
10
  map.set(prop, desc);
30
11
  }
31
12
  function findDeferredDecorator(target, prop) {
13
+ var _a;
32
14
  let cursor = target.prototype;
33
15
  while (cursor) {
34
- let desc = deferred.get(cursor)?.get(prop);
16
+ let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);
35
17
  if (desc) {
36
18
  return desc;
37
19
  }
38
20
  cursor = cursor.prototype;
39
21
  }
40
22
  }
41
- function decorateFieldV1(target, prop, decorators, initializer) {
42
- return decorateFieldV2(target.prototype, prop, decorators, initializer);
43
- }
44
23
  function decorateFieldV2(prototype, prop, decorators, initializer) {
45
24
  let desc = {
46
25
  configurable: true,
@@ -60,25 +39,6 @@ function decorateFieldV2(prototype, prop, decorators, initializer) {
60
39
  deferDecorator(prototype, prop, desc);
61
40
  }
62
41
  }
63
- function decorateMethodV1({
64
- prototype
65
- }, prop, decorators) {
66
- return decorateMethodV2(prototype, prop, decorators);
67
- }
68
- function decorateMethodV2(prototype, prop, decorators) {
69
- const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);
70
- let desc = {
71
- ...origDesc
72
- };
73
- for (let decorator of decorators) {
74
- desc = decorator(prototype, prop, desc) || desc;
75
- }
76
- if (desc.initializer !== void 0) {
77
- desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;
78
- desc.initializer = void 0;
79
- }
80
- Object.defineProperty(prototype, prop, desc);
81
- }
82
42
  function initializeDeferredDecorator(target, prop) {
83
43
  let desc = findDeferredDecorator(target.constructor, prop);
84
44
  if (desc) {
@@ -90,35 +50,6 @@ function initializeDeferredDecorator(target, prop) {
90
50
  });
91
51
  }
92
52
  }
93
- function decorateClass(target, decorators) {
94
- return decorators.reduce((accum, decorator) => decorator(accum) || accum, target);
95
- }
96
- function decoratePOJO(pojo, decorated) {
97
- for (let [type, prop, decorators] of decorated) {
98
- if (type === "field") {
99
- decoratePojoField(pojo, prop, decorators);
100
- } else {
101
- decorateMethodV2(pojo, prop, decorators);
102
- }
103
- }
104
- return pojo;
105
- }
106
- function decoratePojoField(pojo, prop, decorators) {
107
- let desc = {
108
- configurable: true,
109
- enumerable: true,
110
- writable: true,
111
- initializer: () => Object.getOwnPropertyDescriptor(pojo, prop)?.value
112
- };
113
- for (let decorator of decorators) {
114
- desc = decorator(pojo, prop, desc) || desc;
115
- }
116
- if (desc.initializer) {
117
- desc.value = desc.initializer.call(pojo);
118
- delete desc.initializer;
119
- }
120
- Object.defineProperty(pojo, prop, desc);
121
- }
122
53
 
123
54
  /**
124
55
  ## Overview
@@ -229,6 +160,8 @@ function decoratePojoField(pojo, prop, decorators) {
229
160
  @main @ember-data-mirror/serializer
230
161
  */
231
162
 
163
+ const service = s.service ?? s.inject;
164
+
232
165
  /**
233
166
  > ⚠️ CAUTION you likely want the docs for [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)
234
167
  > as extending this abstract class is unnecessary.
@@ -254,7 +187,7 @@ function decoratePojoField(pojo, prop, decorators) {
254
187
 
255
188
  class Serializer extends EmberObject {
256
189
  static {
257
- decorateFieldV2(this.prototype, "store", [inject]);
190
+ decorateFieldV2(this.prototype, "store", [service]);
258
191
  }
259
192
  #store = (initializeDeferredDecorator(this, "store"), void 0);
260
193
  /**
package/dist/index.js.map CHANGED
@@ -1 +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-mirror/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-mirror/serializer\n @main @ember-data-mirror/serializer\n*/\n\nimport EmberObject from '@ember/object';\nimport { inject as service } from '@ember/service';\n\nimport type Store from '@ember-data-mirror/store';\nimport type { ModelSchema } from '@ember-data-mirror/store/types';\nimport type { EmptyResourceDocument, SingleResourceDocument } from '@warp-drive-mirror/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,MAAAC,YAAAA;AAAA,CAAA,CAAA,CAAA;AAuBA,IAAMC,QAAA,kBAGEC,IAAAA,OAAA,EAAQ,CAAA;AAEhB,SAASC,eACPC,KAAA,EACAC,IAAA,EACAC,IAAA,EACM;AACN,EAAA,IAAIC,GAAA,GAAMN,QAAA,CAASO,GAAA,CAAIJ,KAAK,CAAA,CAAA;EAC5B,IAAI,CAACG,GAAA,EAAK;IACRA,GAAA,kBAAUE,IAAAA,GAAA,EAAI,CAAA;AACdR,IAAAA,QAAA,CAASS,GAAA,CAAIN,KAAA,EAAOG,GAAG,CAAA,CAAA;AACzB,GAAA;AACAA,EAAAA,GAAA,CAAIG,GAAA,CAAIL,IAAA,EAAMC,IAAI,CAAA,CAAA;AACpB,CAAA;AAEA,SAASK,qBACPC,CAAAA,MAAA,EACAP,IAAA,EACwB;AACxB,EAAA,IAAIQ,MAAA,GAAkBD,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A;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
+ {"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/decorat_bfe8edbefc8aced6f61ce140cd72ecf2/node_modules/decorator-transforms/dist/runtime-BPCpkOf1.js","../src/index.ts"],"sourcesContent":["const 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 var _a;\n let cursor = target.prototype;\n while (cursor) {\n let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.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: () => {\n var _a;\n return (_a = Object.getOwnPropertyDescriptor(pojo, prop)) == null ? void 0 : _a.value;\n }\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}\nconst runtime = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n c: decorateClass,\n f: decorateFieldV1,\n g: decorateFieldV2,\n i: initializeDeferredDecorator,\n m: decorateMethodV1,\n n: decorateMethodV2,\n p: decoratePOJO\n}, Symbol.toStringTag, { value: \"Module\" }));\nexport {\n decorateFieldV2 as a,\n decorateMethodV1 as b,\n decorateMethodV2 as c,\n decorateFieldV1 as d,\n decorateClass as e,\n decoratePOJO as f,\n initializeDeferredDecorator as i,\n runtime as r\n};\n//# sourceMappingURL=runtime-BPCpkOf1.js.map\n","/**\n ## Overview\n\n <blockquote style=\"margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;\">\n <p>\n ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new serializer, consider writing a\n <a href=\"/ember-data/release/classes/%3CInterface%3E%20Handler\">Handler</a> instead to be used with the <a href=\"https://github.com/emberjs/data/tree/main/packages/request#readme\">RequestManager</a>\n </p>\n </blockquote>\n\n In order to properly manage and present your data, EmberData\n needs to understand the structure of data it receives.\n\n `Serializers` convert data between the server's API format and\n the format EmberData understands.\n\n Data received from an API response is **normalized** into\n [JSON:API](https://jsonapi.org/) (the format used internally\n by EmberData), while data sent to an API is **serialized**\n into the format the API expects.\n\n ### Implementing a Serializer\n\n There are only two required serializer methods, one for\n normalizing data from the server API format into JSON:API, and\n another for serializing records via `Snapshots` into the expected\n server API format.\n\n To implement a serializer, export a class that conforms to the structure\n described by [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)\n from the `app/serializers/` directory. An example is below.\n\n ```ts\n import EmberObject from '@ember/object';\n\n export default class ApplicationSerializer extends EmberObject {\n normalizeResponse(store, schema, rawPayload) {\n return rawPayload;\n }\n\n serialize(snapshot, options) {\n const serializedResource = {\n id: snapshot.id,\n type: snapshot.modelName,\n attributes: snapshot.attributes()\n };\n\n return serializedResource;\n }\n }\n ```\n\n\n ### Serializer Resolution\n\n `store.serializerFor(name)` will lookup serializers defined in\n `app/serializers/` and return an instance. If no serializer is found, an\n error will be thrown.\n\n `serializerFor` first attempts to find a serializer with an exact match on `name`,\n then falls back to checking for the presence of a serializer named `application`.\n\n ```ts\n store.serializerFor('author');\n\n // lookup paths (in order) =>\n // app/serializers/author.js\n // app/serializers/application.js\n ```\n\n Most requests in EmberData are made with respect to a particular `type` (or `modelName`)\n (e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\n refer to this as the **primary** resource `type`.\n\n Typically `serializerFor` will be used to find a serializer with a name matching that of the primary\n resource `type` for the request, falling back to the `application` serializer for those types that\n do not have a defined serializer. This is often described as a `per-model` or `per-type` strategy\n for defining serializers. However, because APIs rarely format payloads per-type but rather\n per-API-version, this may not be a desired strategy.\n\n It is recommended that applications define only a single `application` adapter and serializer\n where possible.\n\n If you have multiple API formats and the per-type strategy is not viable, one strategy is to\n write an `application` adapter and serializer that make use of `options` to specify the desired\n format when making a request.\n\n ### Using a Serializer\n\n Any serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.\n\n ### Default Serializers\n\n For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**\n format the `@ember-data-mirror/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-mirror/serializer\n @main @ember-data-mirror/serializer\n*/\n\nimport EmberObject from '@ember/object';\nimport * as s from '@ember/service';\n\nimport type Store from '@ember-data-mirror/store';\nimport type { ModelSchema } from '@ember-data-mirror/store/types';\nimport type { EmptyResourceDocument, SingleResourceDocument } from '@warp-drive-mirror/core-types/spec/json-api-raw';\n\nconst service = s.service ?? s.inject;\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":["deferred","WeakMap","deferDecorator","proto","prop","desc","map","get","Map","set","findDeferredDecorator","target","_a","cursor","prototype","decorateFieldV2","decorators","initializer","configurable","enumerable","writable","decorator","Object","defineProperty","initializeDeferredDecorator","constructor","value","call","service","s","inject","EmberObject","g","i","void 0","normalize","_typeClass","hash"],"mappings":";;;AAuBA,MAAMA,QAAA,sBAGEC,OAAA,EAAA;AAER,SAASC,eACPC,KAAA,EACAC,IAAA,EACAC,IAAA,EACM;AACF,EAAA,IAAAC,GAAA,GAAMN,QAAA,CAASO,GAAA,CAAIJ,KAAK,CAAA;EAC5B,IAAI,CAACG,GAAA,EAAK;AACRA,IAAAA,GAAA,sBAAUE,GAAA,EAAA;AACDR,IAAAA,QAAA,CAAAS,GAAA,CAAIN,KAAA,EAAOG,GAAG,CAAA;AACzB;AACIA,EAAAA,GAAA,CAAAG,GAAA,CAAIL,IAAA,EAAMC,IAAI,CAAA;AACpB;AAEA,SAASK,qBACPC,CAAAA,MAAA,EACAP,IAAA,EACwB;AArB1B,EAAA,IAAAQ,EAAA;AAsBE,EAAA,IAAIC,MAAA,GAAkBF,MAAA,CAAeG,SAAA;AACrC,EAAA,OAAOD,MAAA,EAAQ;AACb,IAAA,IAAIR,IAAA,GAAA,CAAOO,EAAA,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,IAAA,CAAKe,QAAA;AACfM,MAAAA,KAAA,EAAOrB,IAAA,CAAKY,WAAA,GAAcZ,IAAA,CAAKY,WAAA,CAAYU,IAAA,CAAKhB,MAAM,CAAI,GAAA;KAC3D,CAAA;AACH;AACF;;AC/HA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AASA,MAAMiB,OAAO,GAAGC,CAAC,CAACD,OAAO,IAAIC,CAAC,CAACC,MAAM;;AAErC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEe,gBAAA,SAAcC,WAAW,CAAC;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAlB,SAAA,EAAA,OAAA,EAAA,CACtCc,OAAO,CAAA,CAAA;AAAA;AAAA,EAAA,MAAA,IAAAK,2BAAA,CAAA,IAAA,EAAA,OAAA,CAAA,EAAAC,MAAA;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;AACb;AACF;;;;","x_google_ignoreList":[0]}
@@ -477,7 +477,7 @@ const JSONSerializer = Serializer.extend({
477
477
  };
478
478
  const meta = this.extractMeta(store, primaryModelClass, payload);
479
479
  if (meta) {
480
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
480
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
481
481
  if (!test) {
482
482
  throw new Error('The `meta` returned from `extractMeta` has to be an object, not "' + typeof meta + '".');
483
483
  }
@@ -1385,7 +1385,7 @@ const JSONSerializer = Serializer.extend({
1385
1385
  */
1386
1386
  transformFor(attributeType, skipAssertion) {
1387
1387
  const transform = getOwner(this).lookup('transform:' + attributeType);
1388
- macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
1388
+ macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
1389
1389
  if (!test) {
1390
1390
  throw new Error(`Unable to find the transform for \`attr('${attributeType}')\``);
1391
1391
  }