@ember-data-mirror/serializer 5.4.0-alpha.49

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