@ember-data-mirror/serializer 5.6.0-beta.0 → 5.6.0-beta.1

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