@ember-data/serializer 5.4.0-beta.3 → 5.4.0-beta.5

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 +9 -0
  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-BwMH6O_R.js} +32 -11
  12. package/dist/json-BwMH6O_R.js.map +1 -0
  13. package/{addon → dist}/json-api.js +42 -18
  14. package/dist/json-api.js.map +1 -0
  15. package/dist/json.js +6 -0
  16. package/dist/json.js.map +1 -0
  17. package/dist/rest.js +1270 -0
  18. package/dist/rest.js.map +1 -0
  19. package/{addon/string-A02hFTMo.js → dist/transform.js} +6 -1
  20. package/dist/transform.js.map +1 -0
  21. package/package.json +49 -55
  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 -3
  47. package/addon/-private.js.map +0 -1
  48. package/addon/embedded-records-mixin-HTw8JJT1.js +0 -572
  49. package/addon/embedded-records-mixin-HTw8JJT1.js.map +0 -1
  50. package/addon/index.js +0 -181
  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 -684
  55. package/addon/rest.js.map +0 -1
  56. package/addon/string-A02hFTMo.js.map +0 -1
  57. package/addon/transform.js +0 -1
  58. package/addon/transform.js.map +0 -1
  59. package/addon/utils-N1ERF6HN.js +0 -12
  60. package/addon/utils-N1ERF6HN.js.map +0 -1
  61. package/addon-main.js +0 -93
@@ -0,0 +1,34 @@
1
+ declare module '@ember-data/serializer/-private/transforms/number' {
2
+ /**
3
+ @module @ember-data/serializer
4
+ */
5
+ import { TransformName } from '@warp-drive/core-types/symbols';
6
+ /**
7
+ The `NumberTransform` class is used to serialize and deserialize
8
+ numeric attributes on Ember Data record objects. This transform is
9
+ used when `number` is passed as the type parameter to the
10
+ [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.
11
+
12
+ Usage
13
+
14
+ ```app/models/score.js
15
+ import Model, { attr, belongsTo } from '@ember-data/model';
16
+
17
+ export default class ScoreModel extends Model {
18
+ @attr('number') value;
19
+ @belongsTo('player') player;
20
+ @attr('date') date;
21
+ }
22
+ ```
23
+
24
+ @class NumberTransform
25
+ @public
26
+ */
27
+ export class NumberTransform {
28
+ deserialize(serialized: string | number | null | undefined, _options?: Record<string, unknown>): number | null;
29
+ serialize(deserialized: string | number | null | undefined, _options?: Record<string, unknown>): number | null;
30
+ [TransformName]: "number";
31
+ static create(): NumberTransform;
32
+ }
33
+ }
34
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/-private/transforms/number.ts"],"names":[],"mappings":"AAAA;;EAEE;AAEF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAM/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAe;IAC1B,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAU9G,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAU9G,CAAC,aAAa,CAAC,WAAqB;IAEpC,MAAM,CAAC,MAAM;CAGd"}
@@ -0,0 +1,34 @@
1
+ declare module '@ember-data/serializer/-private/transforms/string' {
2
+ /**
3
+ @module @ember-data/serializer
4
+ */
5
+ import { TransformName } from '@warp-drive/core-types/symbols';
6
+ /**
7
+ The `StringTransform` class is used to serialize and deserialize
8
+ string attributes on Ember Data record objects. This transform is
9
+ used when `string` is passed as the type parameter to the
10
+ [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.
11
+
12
+ Usage
13
+
14
+ ```app/models/user.js
15
+ import Model, { attr, belongsTo } from '@ember-data/model';
16
+
17
+ export default class UserModel extends Model {
18
+ @attr('boolean') isAdmin;
19
+ @attr('string') name;
20
+ @attr('string') email;
21
+ }
22
+ ```
23
+
24
+ @class StringTransform
25
+ @public
26
+ */
27
+ export class StringTransform {
28
+ deserialize(serialized: unknown, _options?: Record<string, unknown>): string | null;
29
+ serialize(deserialized: unknown, _options?: Record<string, unknown>): string | null;
30
+ [TransformName]: "string";
31
+ static create(): StringTransform;
32
+ }
33
+ }
34
+ //# sourceMappingURL=string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/-private/transforms/string.ts"],"names":[],"mappings":"AAAA;;EAEE;AAEF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAe;IAC1B,WAAW,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAGnF,SAAS,CAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAInF,CAAC,aAAa,CAAC,WAAqB;IAEpC,MAAM,CAAC,MAAM;CAGd"}
@@ -0,0 +1,127 @@
1
+ declare module '@ember-data/serializer/-private/transforms/transform' {
2
+ /// <reference types="ember-source/types" />
3
+ /**
4
+ @module @ember-data/serializer
5
+ */
6
+ import EmberObject from '@ember/object';
7
+ import type { LegacyAttributeField } from '@warp-drive/core-types/schema/fields';
8
+ /**
9
+ The `Transform` class is used to serialize and deserialize model
10
+ attributes when they are saved or loaded from an
11
+ adapter. Subclassing `Transform` is useful for creating custom
12
+ attributes. All subclasses of `Transform` must implement a
13
+ `serialize` and a `deserialize` method.
14
+
15
+ Example
16
+
17
+ ```app/transforms/temperature.js
18
+
19
+ // Converts centigrade in the JSON to fahrenheit in the app
20
+ export default class TemperatureTransform {
21
+ deserialize(serialized, options) {
22
+ return (serialized * 1.8) + 32;
23
+ }
24
+
25
+ serialize(deserialized, options) {
26
+ return (deserialized - 32) / 1.8;
27
+ }
28
+
29
+ static create() {
30
+ return new this();
31
+ }
32
+ }
33
+ ```
34
+
35
+ Usage
36
+
37
+ ```app/models/requirement.js
38
+ import Model, { attr } from '@ember-data/model';
39
+
40
+ export default class RequirementModel extends Model {
41
+ @attr('string') name;
42
+ @attr('temperature') temperature;
43
+ }
44
+ ```
45
+
46
+ The options passed into the `attr` function when the attribute is
47
+ declared on the model is also available in the transform.
48
+
49
+ ```app/models/post.js
50
+ import Model, { attr } from '@ember-data/model';
51
+
52
+ export default class PostModel extends Model {
53
+ @attr('string') title;
54
+ @attr('markdown', {
55
+ markdown: {
56
+ gfm: false,
57
+ sanitize: true
58
+ }
59
+ })
60
+ markdown;
61
+ }
62
+ ```
63
+
64
+ ```app/transforms/markdown.js
65
+ export default class MarkdownTransform {
66
+ serialize(deserialized, options) {
67
+ return deserialized.raw;
68
+ }
69
+
70
+ deserialize(serialized, options) {
71
+ let markdownOptions = options.markdown || {};
72
+
73
+ return marked(serialized, markdownOptions);
74
+ }
75
+
76
+ static create() {
77
+ return new this();
78
+ }
79
+ }
80
+ ```
81
+
82
+ @class Transform
83
+ @public
84
+ */
85
+ /**
86
+ When given a deserialized value from a record attribute this
87
+ method must return the serialized value.
88
+
89
+ Example
90
+
91
+ ```javascript
92
+ serialize(deserialized, options) {
93
+ return deserialized ? null : Number(deserialized);
94
+ }
95
+ ```
96
+
97
+ @method serialize
98
+ @public
99
+ @param deserialized The deserialized value
100
+ @param options hash of options passed to `attr`
101
+ @return The serialized value
102
+ */
103
+ /**
104
+ When given a serialized value from a JSON object this method must
105
+ return the deserialized value for the record attribute.
106
+
107
+ Example
108
+
109
+ ```javascript
110
+ deserialize(serialized, options) {
111
+ return empty(serialized) ? null : Number(serialized);
112
+ }
113
+ ```
114
+
115
+ @method deserialize
116
+ @public
117
+ @param serialized The serialized value
118
+ @param options hash of options passed to `attr`
119
+ @return The deserialized value
120
+ */
121
+ export interface Transform {
122
+ serialize(value: unknown, options: LegacyAttributeField['options']): unknown;
123
+ deserialize(value: unknown, options: LegacyAttributeField['options']): unknown;
124
+ }
125
+ export const Transform: typeof EmberObject;
126
+ }
127
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/-private/transforms/transform.ts"],"names":[],"mappings":";AAAA;;EAEE;AACF,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH;;;;;;;;;;;;;;;;;EAiBE;AACF;;;;;;;;;;;;;;;;;EAiBE;AACF,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;IAC7E,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;CAChF;AACD,eAAO,MAAM,SAAS,oBAAc,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare module '@ember-data/serializer/-private/utils' {
2
+ type Coercable = string | number | boolean | null | undefined | symbol;
3
+ export function coerceId(id: Coercable): string | null;
4
+ export {};
5
+ }
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/-private/utils.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvE,wBAAgB,QAAQ,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAUrD"}
@@ -0,0 +1,277 @@
1
+ /// <reference path="./rest.d.ts" />
2
+ /// <reference path="./json.d.ts" />
3
+ /// <reference path="./transform.d.ts" />
4
+ /// <reference path="./json-api.d.ts" />
5
+ /// <reference path="./-private/utils.d.ts" />
6
+ /// <reference path="./-private/embedded-records-mixin.d.ts" />
7
+ /// <reference path="./-private/transforms/date.d.ts" />
8
+ /// <reference path="./-private/transforms/boolean.d.ts" />
9
+ /// <reference path="./-private/transforms/transform.d.ts" />
10
+ /// <reference path="./-private/transforms/number.d.ts" />
11
+ /// <reference path="./-private/transforms/string.d.ts" />
12
+ declare module '@ember-data/serializer' {
13
+ /**
14
+ ## Overview
15
+
16
+ <blockquote style="margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;">
17
+ <p>
18
+ ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
19
+ If starting a new app or thinking of implementing a new serializer, consider writing a
20
+ <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>
21
+ </p>
22
+ </blockquote>
23
+
24
+ In order to properly manage and present your data, EmberData
25
+ needs to understand the structure of data it receives.
26
+
27
+ `Serializers` convert data between the server's API format and
28
+ the format EmberData understands.
29
+
30
+ Data received from an API response is **normalized** into
31
+ [JSON:API](https://jsonapi.org/) (the format used internally
32
+ by EmberData), while data sent to an API is **serialized**
33
+ into the format the API expects.
34
+
35
+ ### Implementing a Serializer
36
+
37
+ There are only two required serializer methods, one for
38
+ normalizing data from the server API format into JSON:API, and
39
+ another for serializing records via `Snapshots` into the expected
40
+ server API format.
41
+
42
+ To implement a serializer, export a class that conforms to the structure
43
+ described by [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)
44
+ from the `app/serializers/` directory. An example is below.
45
+
46
+ ```ts
47
+ import EmberObject from '@ember/object';
48
+
49
+ export default class ApplicationSerializer extends EmberObject {
50
+ normalizeResponse(store, schema, rawPayload) {
51
+ return rawPayload;
52
+ }
53
+
54
+ serialize(snapshot, options) {
55
+ const serializedResource = {
56
+ id: snapshot.id,
57
+ type: snapshot.modelName,
58
+ attributes: snapshot.attributes()
59
+ };
60
+
61
+ return serializedResource;
62
+ }
63
+ }
64
+ ```
65
+
66
+
67
+ ### Serializer Resolution
68
+
69
+ `store.serializerFor(name)` will lookup serializers defined in
70
+ `app/serializers/` and return an instance. If no serializer is found, an
71
+ error will be thrown.
72
+
73
+ `serializerFor` first attempts to find a serializer with an exact match on `name`,
74
+ then falls back to checking for the presence of a serializer named `application`.
75
+
76
+ ```ts
77
+ store.serializerFor('author');
78
+
79
+ // lookup paths (in order) =>
80
+ // app/serializers/author.js
81
+ // app/serializers/application.js
82
+ ```
83
+
84
+ Most requests in EmberData are made with respect to a particular `type` (or `modelName`)
85
+ (e.g., "get me the full collection of **books**" or "get me the **employee** whose id is 37"). We
86
+ refer to this as the **primary** resource `type`.
87
+
88
+ Typically `serializerFor` will be used to find a serializer with a name matching that of the primary
89
+ resource `type` for the request, falling back to the `application` serializer for those types that
90
+ do not have a defined serializer. This is often described as a `per-model` or `per-type` strategy
91
+ for defining serializers. However, because APIs rarely format payloads per-type but rather
92
+ per-API-version, this may not be a desired strategy.
93
+
94
+ It is recommended that applications define only a single `application` adapter and serializer
95
+ where possible.
96
+
97
+ If you have multiple API formats and the per-type strategy is not viable, one strategy is to
98
+ write an `application` adapter and serializer that make use of `options` to specify the desired
99
+ format when making a request.
100
+
101
+ ### Using a Serializer
102
+
103
+ Any serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.
104
+
105
+ ### Default Serializers
106
+
107
+ For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**
108
+ format the `@ember-data/serializer` package contains implementations these applications can
109
+ extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.
110
+
111
+ Many applications will find writing their own serializer to be more performant and less
112
+ complex than extending these classes even when their API format is very close to that expected
113
+ by these serializers.
114
+
115
+ It is recommended that apps write their own serializer to best suit the needs of their API and
116
+ application.
117
+
118
+ @module @ember-data/serializer
119
+ @main @ember-data/serializer
120
+ */
121
+ /// <reference types="ember-source/types" />
122
+ import EmberObject from '@ember/object';
123
+ import type Store from '@ember-data/store';
124
+ import type { ModelSchema } from '@ember-data/store/types';
125
+ import type { EmptyResourceDocument, SingleResourceDocument } from '@warp-drive/core-types/spec/json-api-raw';
126
+ /**
127
+ > ⚠️ CAUTION you likely want the docs for [<Interface> Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)
128
+ > as extending this abstract class is unnecessary.
129
+
130
+ `Serializer` is an abstract base class that you may override in your
131
+ application to customize it for your backend. The minimum set of methods
132
+ that you should implement is:
133
+
134
+ * `normalizeResponse()`
135
+ * `serialize()`
136
+
137
+ And you can optionally override the following methods:
138
+
139
+ * `normalize()`
140
+
141
+ For an example implementation, see
142
+ [JSONSerializer](JSONSerializer), the included JSON serializer.
143
+
144
+ @class Serializer
145
+ @public
146
+ @extends Ember.EmberObject
147
+ */
148
+ export default class extends EmberObject {
149
+ store: Store;
150
+ /**
151
+ The `store` property is the application's `store` that contains
152
+ all records. It can be used to look up serializers for other model
153
+ types that may be nested inside the payload response.
154
+
155
+ Example:
156
+
157
+ ```js
158
+ Serializer.extend({
159
+ extractRelationship(relationshipModelName, relationshipHash) {
160
+ let modelClass = this.store.modelFor(relationshipModelName);
161
+ let relationshipSerializer = this.store.serializerFor(relationshipModelName);
162
+ return relationshipSerializer.normalize(modelClass, relationshipHash);
163
+ }
164
+ });
165
+ ```
166
+
167
+ @property store
168
+ @type {Store}
169
+ @public
170
+ */
171
+ /**
172
+ The `normalizeResponse` method is used to normalize a payload from the
173
+ server to a JSON-API Document.
174
+
175
+ http://jsonapi.org/format/#document-structure
176
+
177
+ Example:
178
+
179
+ ```js
180
+ Serializer.extend({
181
+ normalizeResponse(store, primaryModelClass, payload, id, requestType) {
182
+ if (requestType === 'findRecord') {
183
+ return this.normalize(primaryModelClass, payload);
184
+ } else {
185
+ return payload.reduce(function(documentHash, item) {
186
+ let { data, included } = this.normalize(primaryModelClass, item);
187
+ documentHash.included.push(...included);
188
+ documentHash.data.push(data);
189
+ return documentHash;
190
+ }, { data: [], included: [] })
191
+ }
192
+ }
193
+ });
194
+ ```
195
+
196
+ @since 1.13.0
197
+ @method normalizeResponse
198
+ @public
199
+ @param {Store} store
200
+ @param {Model} primaryModelClass
201
+ @param {Object} payload
202
+ @param {String|Number} id
203
+ @param {String} requestType
204
+ @return {Object} JSON-API Document
205
+ */
206
+ /**
207
+ The `serialize` method is used when a record is saved in order to convert
208
+ the record into the form that your external data source expects.
209
+
210
+ `serialize` takes an optional `options` hash with a single option:
211
+
212
+ - `includeId`: If this is `true`, `serialize` should include the ID
213
+ in the serialized object it builds.
214
+
215
+ Example:
216
+
217
+ ```js
218
+ Serializer.extend({
219
+ serialize(snapshot, options) {
220
+ let json = {
221
+ id: snapshot.id
222
+ };
223
+
224
+ snapshot.eachAttribute((key, attribute) => {
225
+ json[key] = snapshot.attr(key);
226
+ });
227
+
228
+ snapshot.eachRelationship((key, relationship) => {
229
+ if (relationship.kind === 'belongsTo') {
230
+ json[key] = snapshot.belongsTo(key, { id: true });
231
+ } else if (relationship.kind === 'hasMany') {
232
+ json[key] = snapshot.hasMany(key, { ids: true });
233
+ }
234
+ });
235
+
236
+ return json;
237
+ },
238
+ });
239
+ ```
240
+
241
+ @method serialize
242
+ @public
243
+ @param {Snapshot} snapshot
244
+ @param {Object} [options]
245
+ @return {Object}
246
+ */
247
+ /**
248
+ The `normalize` method is used to convert a payload received from your
249
+ external data source into the normalized form `store.push()` expects. You
250
+ should override this method, munge the hash and return the normalized
251
+ payload.
252
+
253
+ Example:
254
+
255
+ ```js
256
+ Serializer.extend({
257
+ normalize(modelClass, resourceHash) {
258
+ let data = {
259
+ id: resourceHash.id,
260
+ type: modelClass.modelName,
261
+ attributes: resourceHash
262
+ };
263
+ return { data: data };
264
+ }
265
+ })
266
+ ```
267
+
268
+ @method normalize
269
+ @public
270
+ @param {Model} typeClass
271
+ @param {Object} hash
272
+ @return {Object}
273
+ */
274
+ normalize(_typeClass: ModelSchema, hash: Record<string, unknown>): SingleResourceDocument | EmptyResourceDocument;
275
+ }
276
+ }
277
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2GE;;AAEF,OAAO,WAAW,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAE9G;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF,MAAM,CAAC,OAAO,MAAO,SAAQ,WAAW;IACrB,KAAK,EAAE,KAAK,CAAC;IAC9B;;;;;;;;;;;;;;;;;;;;MAoBE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkCE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwCE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;MA0BE;IACF,SAAS,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,sBAAsB,GAAG,qBAAqB;CAGlH"}