@cms0/cms0 0.0.10 → 0.0.12

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.
@@ -42,9 +42,22 @@ function coerceRichTextValue(value) {
42
42
  html,
43
43
  };
44
44
  }
45
- function coerceLocalizedStringValue(value) {
45
+ function shouldKeepLocalizedEntry(source, locale, defaultLocale) {
46
+ if (locale === "all")
47
+ return true;
48
+ const rowLocale = typeof source.locale === "string" ? source.locale : "";
49
+ if (locale) {
50
+ return rowLocale === locale;
51
+ }
52
+ if (defaultLocale) {
53
+ return rowLocale === defaultLocale;
54
+ }
55
+ return true;
56
+ }
57
+ function coerceLocalizedStringValue(value, locale, defaultLocale) {
46
58
  const rows = Array.isArray(value) ? value : [];
47
- return rows.map((row) => {
59
+ return rows
60
+ .map((row) => {
48
61
  const source = row && typeof row === "object" ? row : {};
49
62
  return {
50
63
  ...source,
@@ -52,11 +65,13 @@ function coerceLocalizedStringValue(value) {
52
65
  isDefault: source.isDefault === true,
53
66
  value: toPlainText(source.value),
54
67
  };
55
- });
68
+ })
69
+ .filter((row) => shouldKeepLocalizedEntry(row, locale, defaultLocale));
56
70
  }
57
- function coerceLocalizedRichTextValue(value) {
71
+ function coerceLocalizedRichTextValue(value, locale, defaultLocale) {
58
72
  const rows = Array.isArray(value) ? value : [];
59
- return rows.map((row) => {
73
+ return rows
74
+ .map((row) => {
60
75
  const source = row && typeof row === "object" ? row : {};
61
76
  const rawValue = source.value;
62
77
  const nested = rawValue && typeof rawValue === "object" ? rawValue : null;
@@ -75,18 +90,21 @@ function coerceLocalizedRichTextValue(value) {
75
90
  value: normalizedValue ?? {},
76
91
  html,
77
92
  };
78
- });
93
+ })
94
+ .filter((row) => shouldKeepLocalizedEntry(row, locale, defaultLocale));
79
95
  }
80
- function coerceCustomTypeValue(descriptor, value) {
96
+ function coerceCustomTypeValue(descriptor, value, options) {
81
97
  const customType = descriptor.customType;
82
98
  if (!customType)
83
99
  return value;
84
100
  if (customType === "RichText")
85
101
  return coerceRichTextValue(value);
86
- if (customType === "LocalizedString")
87
- return coerceLocalizedStringValue(value);
88
- if (customType === "LocalizedRichText")
89
- return coerceLocalizedRichTextValue(value);
102
+ if (customType === "LocalizedString") {
103
+ return coerceLocalizedStringValue(value, options?.locale, options?.defaultLocale);
104
+ }
105
+ if (customType === "LocalizedRichText") {
106
+ return coerceLocalizedRichTextValue(value, options?.locale, options?.defaultLocale);
107
+ }
90
108
  return value;
91
109
  }
92
110
  function isPrimitiveDescriptor(desc) {
@@ -210,9 +228,16 @@ function extractModelRefId(raw, modelName, options) {
210
228
  if (found)
211
229
  return found;
212
230
  }
213
- const byId = extractId(object);
214
- if (byId)
215
- return byId;
231
+ const allowObjectIdFallback = options?.allowObjectIdFallback ?? true;
232
+ if (allowObjectIdFallback) {
233
+ const keys = Object.keys(object);
234
+ const hasOnlyId = keys.length === 1 && keys[0] === "id";
235
+ if (hasOnlyId) {
236
+ const byId = extractId(object);
237
+ if (byId)
238
+ return byId;
239
+ }
240
+ }
216
241
  return null;
217
242
  }
218
243
  function formatValidationError(name, error) {
@@ -304,12 +329,16 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
304
329
  const output = {};
305
330
  for (const [propertyName, propertyDescriptor] of Object.entries(descriptor.properties)) {
306
331
  if (isPrimitiveDescriptor(propertyDescriptor)) {
307
- output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName]);
332
+ output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName], {
333
+ locale: context.options.locale,
334
+ defaultLocale: context.options.defaultLocale,
335
+ });
308
336
  continue;
309
337
  }
310
338
  if (isModelRefDescriptor(propertyDescriptor)) {
311
339
  const refId = extractModelRefId(source, propertyDescriptor.model, {
312
340
  propertyName,
341
+ allowObjectIdFallback: false,
313
342
  });
314
343
  output[propertyName] = await normalizeModelRef(propertyDescriptor.model, refId, context, trail, false);
315
344
  continue;
@@ -323,7 +352,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
323
352
  },
324
353
  });
325
354
  const normalizedChild = await normalizeArrayField(propertyDescriptor, childPath, childRaw, context, trail);
326
- output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild);
355
+ output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
356
+ locale: context.options.locale,
357
+ defaultLocale: context.options.defaultLocale,
358
+ });
327
359
  continue;
328
360
  }
329
361
  if (isObjectDescriptor(propertyDescriptor)) {
@@ -335,7 +367,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
335
367
  },
336
368
  });
337
369
  const normalizedChild = await normalizeObjectField(propertyDescriptor, childPath, childRaw, context, trail, false);
338
- output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild);
370
+ output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
371
+ locale: context.options.locale,
372
+ defaultLocale: context.options.defaultLocale,
373
+ });
339
374
  }
340
375
  }
341
376
  if (shouldIncludeObjectId(context.options.includeIdMode, isCollectionItem)) {
@@ -362,7 +397,9 @@ async function normalizeArrayField(descriptor, path, raw, context, trail) {
362
397
  }
363
398
  if (isModelRefDescriptor(itemDescriptor)) {
364
399
  const resolved = await Promise.all(envelope.items.map(async (row) => {
365
- const refId = extractModelRefId(row, itemDescriptor.model);
400
+ const refId = extractModelRefId(row, itemDescriptor.model, {
401
+ allowObjectIdFallback: false,
402
+ });
366
403
  return normalizeModelRef(itemDescriptor.model, refId, context, trail, true);
367
404
  }));
368
405
  return resolved;
@@ -383,7 +420,10 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
383
420
  const value = raw && typeof raw === "object" && "value" in raw
384
421
  ? raw.value
385
422
  : raw;
386
- return coerceCustomTypeValue(descriptor, value);
423
+ return coerceCustomTypeValue(descriptor, value, {
424
+ locale: context.options.locale,
425
+ defaultLocale: context.options.defaultLocale,
426
+ });
387
427
  }
388
428
  if (isModelRefDescriptor(descriptor)) {
389
429
  const refId = extractModelRefId(raw, descriptor.model);
@@ -391,11 +431,17 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
391
431
  }
392
432
  if (isArrayDescriptor(descriptor)) {
393
433
  const normalized = await normalizeArrayField(descriptor, path, raw, context, trail);
394
- return coerceCustomTypeValue(descriptor, normalized);
434
+ return coerceCustomTypeValue(descriptor, normalized, {
435
+ locale: context.options.locale,
436
+ defaultLocale: context.options.defaultLocale,
437
+ });
395
438
  }
396
439
  if (isObjectDescriptor(descriptor)) {
397
440
  const normalized = await normalizeObjectField(descriptor, path, raw, context, trail, isCollectionItem);
398
- return coerceCustomTypeValue(descriptor, normalized);
441
+ return coerceCustomTypeValue(descriptor, normalized, {
442
+ locale: context.options.locale,
443
+ defaultLocale: context.options.defaultLocale,
444
+ });
399
445
  }
400
446
  return raw;
401
447
  }
@@ -482,14 +528,14 @@ function validateResult(resource, result, descriptor, includeIdMode, zodSchemas,
482
528
  throw new Error(formatValidationError(modelName, parsed.error));
483
529
  }
484
530
  }
485
- async function runResource(resource, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options, byId) {
531
+ async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale, zodSchemas, modelZodSchemas, options, byId) {
486
532
  const responseMode = options?.response ?? "normalized";
487
533
  const includeIdMode = resolveIncludeIdMode(options?.includeId);
488
534
  const resolveModelRefs = options?.resolveModelRefs !== false;
489
535
  const locale = options?.locale ??
490
536
  (typeof options?.query?.locale === "string"
491
537
  ? options.query.locale
492
- : undefined);
538
+ : defaultLocale);
493
539
  const query = {
494
540
  ...(options?.query ?? {}),
495
541
  };
@@ -525,6 +571,7 @@ async function runResource(resource, descriptor, baseUrl, apiKey, zodSchemas, mo
525
571
  includeIdMode,
526
572
  resolveModelRefs,
527
573
  locale,
574
+ defaultLocale,
528
575
  },
529
576
  };
530
577
  if (resource.isCollection && !byId) {
@@ -560,8 +607,8 @@ function createCmsClient(descriptor, config) {
560
607
  const modelKeys = Array.from(registry.models.keys());
561
608
  const { zodSchemas, modelZodSchemas } = (0, shared_1.buildZodSchemasFromDescriptor)(descriptor);
562
609
  const buildModelAccessor = (entry) => {
563
- const accessor = (async (options) => runResource(entry, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options));
564
- accessor.byId = async (id, options) => runResource(entry, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options, id);
610
+ const accessor = (async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options));
611
+ accessor.byId = async (id, options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options, id);
565
612
  return accessor;
566
613
  };
567
614
  const modelsProxy = new Proxy({}, {
@@ -591,7 +638,7 @@ function createCmsClient(descriptor, config) {
591
638
  if (!entry) {
592
639
  unknownKeyError(property, rootKeys, []);
593
640
  }
594
- return async (options) => runResource(entry, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options);
641
+ return async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options);
595
642
  },
596
643
  });
597
644
  return rootProxy;
package/dist/esm/index.js CHANGED
@@ -38,9 +38,22 @@ function coerceRichTextValue(value) {
38
38
  html,
39
39
  };
40
40
  }
41
- function coerceLocalizedStringValue(value) {
41
+ function shouldKeepLocalizedEntry(source, locale, defaultLocale) {
42
+ if (locale === "all")
43
+ return true;
44
+ const rowLocale = typeof source.locale === "string" ? source.locale : "";
45
+ if (locale) {
46
+ return rowLocale === locale;
47
+ }
48
+ if (defaultLocale) {
49
+ return rowLocale === defaultLocale;
50
+ }
51
+ return true;
52
+ }
53
+ function coerceLocalizedStringValue(value, locale, defaultLocale) {
42
54
  const rows = Array.isArray(value) ? value : [];
43
- return rows.map((row) => {
55
+ return rows
56
+ .map((row) => {
44
57
  const source = row && typeof row === "object" ? row : {};
45
58
  return {
46
59
  ...source,
@@ -48,11 +61,13 @@ function coerceLocalizedStringValue(value) {
48
61
  isDefault: source.isDefault === true,
49
62
  value: toPlainText(source.value),
50
63
  };
51
- });
64
+ })
65
+ .filter((row) => shouldKeepLocalizedEntry(row, locale, defaultLocale));
52
66
  }
53
- function coerceLocalizedRichTextValue(value) {
67
+ function coerceLocalizedRichTextValue(value, locale, defaultLocale) {
54
68
  const rows = Array.isArray(value) ? value : [];
55
- return rows.map((row) => {
69
+ return rows
70
+ .map((row) => {
56
71
  const source = row && typeof row === "object" ? row : {};
57
72
  const rawValue = source.value;
58
73
  const nested = rawValue && typeof rawValue === "object" ? rawValue : null;
@@ -71,18 +86,21 @@ function coerceLocalizedRichTextValue(value) {
71
86
  value: normalizedValue ?? {},
72
87
  html,
73
88
  };
74
- });
89
+ })
90
+ .filter((row) => shouldKeepLocalizedEntry(row, locale, defaultLocale));
75
91
  }
76
- function coerceCustomTypeValue(descriptor, value) {
92
+ function coerceCustomTypeValue(descriptor, value, options) {
77
93
  const customType = descriptor.customType;
78
94
  if (!customType)
79
95
  return value;
80
96
  if (customType === "RichText")
81
97
  return coerceRichTextValue(value);
82
- if (customType === "LocalizedString")
83
- return coerceLocalizedStringValue(value);
84
- if (customType === "LocalizedRichText")
85
- return coerceLocalizedRichTextValue(value);
98
+ if (customType === "LocalizedString") {
99
+ return coerceLocalizedStringValue(value, options?.locale, options?.defaultLocale);
100
+ }
101
+ if (customType === "LocalizedRichText") {
102
+ return coerceLocalizedRichTextValue(value, options?.locale, options?.defaultLocale);
103
+ }
86
104
  return value;
87
105
  }
88
106
  function isPrimitiveDescriptor(desc) {
@@ -206,9 +224,16 @@ function extractModelRefId(raw, modelName, options) {
206
224
  if (found)
207
225
  return found;
208
226
  }
209
- const byId = extractId(object);
210
- if (byId)
211
- return byId;
227
+ const allowObjectIdFallback = options?.allowObjectIdFallback ?? true;
228
+ if (allowObjectIdFallback) {
229
+ const keys = Object.keys(object);
230
+ const hasOnlyId = keys.length === 1 && keys[0] === "id";
231
+ if (hasOnlyId) {
232
+ const byId = extractId(object);
233
+ if (byId)
234
+ return byId;
235
+ }
236
+ }
212
237
  return null;
213
238
  }
214
239
  function formatValidationError(name, error) {
@@ -300,12 +325,16 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
300
325
  const output = {};
301
326
  for (const [propertyName, propertyDescriptor] of Object.entries(descriptor.properties)) {
302
327
  if (isPrimitiveDescriptor(propertyDescriptor)) {
303
- output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName]);
328
+ output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName], {
329
+ locale: context.options.locale,
330
+ defaultLocale: context.options.defaultLocale,
331
+ });
304
332
  continue;
305
333
  }
306
334
  if (isModelRefDescriptor(propertyDescriptor)) {
307
335
  const refId = extractModelRefId(source, propertyDescriptor.model, {
308
336
  propertyName,
337
+ allowObjectIdFallback: false,
309
338
  });
310
339
  output[propertyName] = await normalizeModelRef(propertyDescriptor.model, refId, context, trail, false);
311
340
  continue;
@@ -319,7 +348,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
319
348
  },
320
349
  });
321
350
  const normalizedChild = await normalizeArrayField(propertyDescriptor, childPath, childRaw, context, trail);
322
- output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild);
351
+ output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
352
+ locale: context.options.locale,
353
+ defaultLocale: context.options.defaultLocale,
354
+ });
323
355
  continue;
324
356
  }
325
357
  if (isObjectDescriptor(propertyDescriptor)) {
@@ -331,7 +363,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
331
363
  },
332
364
  });
333
365
  const normalizedChild = await normalizeObjectField(propertyDescriptor, childPath, childRaw, context, trail, false);
334
- output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild);
366
+ output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
367
+ locale: context.options.locale,
368
+ defaultLocale: context.options.defaultLocale,
369
+ });
335
370
  }
336
371
  }
337
372
  if (shouldIncludeObjectId(context.options.includeIdMode, isCollectionItem)) {
@@ -358,7 +393,9 @@ async function normalizeArrayField(descriptor, path, raw, context, trail) {
358
393
  }
359
394
  if (isModelRefDescriptor(itemDescriptor)) {
360
395
  const resolved = await Promise.all(envelope.items.map(async (row) => {
361
- const refId = extractModelRefId(row, itemDescriptor.model);
396
+ const refId = extractModelRefId(row, itemDescriptor.model, {
397
+ allowObjectIdFallback: false,
398
+ });
362
399
  return normalizeModelRef(itemDescriptor.model, refId, context, trail, true);
363
400
  }));
364
401
  return resolved;
@@ -379,7 +416,10 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
379
416
  const value = raw && typeof raw === "object" && "value" in raw
380
417
  ? raw.value
381
418
  : raw;
382
- return coerceCustomTypeValue(descriptor, value);
419
+ return coerceCustomTypeValue(descriptor, value, {
420
+ locale: context.options.locale,
421
+ defaultLocale: context.options.defaultLocale,
422
+ });
383
423
  }
384
424
  if (isModelRefDescriptor(descriptor)) {
385
425
  const refId = extractModelRefId(raw, descriptor.model);
@@ -387,11 +427,17 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
387
427
  }
388
428
  if (isArrayDescriptor(descriptor)) {
389
429
  const normalized = await normalizeArrayField(descriptor, path, raw, context, trail);
390
- return coerceCustomTypeValue(descriptor, normalized);
430
+ return coerceCustomTypeValue(descriptor, normalized, {
431
+ locale: context.options.locale,
432
+ defaultLocale: context.options.defaultLocale,
433
+ });
391
434
  }
392
435
  if (isObjectDescriptor(descriptor)) {
393
436
  const normalized = await normalizeObjectField(descriptor, path, raw, context, trail, isCollectionItem);
394
- return coerceCustomTypeValue(descriptor, normalized);
437
+ return coerceCustomTypeValue(descriptor, normalized, {
438
+ locale: context.options.locale,
439
+ defaultLocale: context.options.defaultLocale,
440
+ });
395
441
  }
396
442
  return raw;
397
443
  }
@@ -478,14 +524,14 @@ function validateResult(resource, result, descriptor, includeIdMode, zodSchemas,
478
524
  throw new Error(formatValidationError(modelName, parsed.error));
479
525
  }
480
526
  }
481
- async function runResource(resource, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options, byId) {
527
+ async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale, zodSchemas, modelZodSchemas, options, byId) {
482
528
  const responseMode = options?.response ?? "normalized";
483
529
  const includeIdMode = resolveIncludeIdMode(options?.includeId);
484
530
  const resolveModelRefs = options?.resolveModelRefs !== false;
485
531
  const locale = options?.locale ??
486
532
  (typeof options?.query?.locale === "string"
487
533
  ? options.query.locale
488
- : undefined);
534
+ : defaultLocale);
489
535
  const query = {
490
536
  ...(options?.query ?? {}),
491
537
  };
@@ -521,6 +567,7 @@ async function runResource(resource, descriptor, baseUrl, apiKey, zodSchemas, mo
521
567
  includeIdMode,
522
568
  resolveModelRefs,
523
569
  locale,
570
+ defaultLocale,
524
571
  },
525
572
  };
526
573
  if (resource.isCollection && !byId) {
@@ -556,8 +603,8 @@ export function createCmsClient(descriptor, config) {
556
603
  const modelKeys = Array.from(registry.models.keys());
557
604
  const { zodSchemas, modelZodSchemas } = buildZodSchemasFromDescriptor(descriptor);
558
605
  const buildModelAccessor = (entry) => {
559
- const accessor = (async (options) => runResource(entry, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options));
560
- accessor.byId = async (id, options) => runResource(entry, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options, id);
606
+ const accessor = (async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options));
607
+ accessor.byId = async (id, options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options, id);
561
608
  return accessor;
562
609
  };
563
610
  const modelsProxy = new Proxy({}, {
@@ -587,7 +634,7 @@ export function createCmsClient(descriptor, config) {
587
634
  if (!entry) {
588
635
  unknownKeyError(property, rootKeys, []);
589
636
  }
590
- return async (options) => runResource(entry, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options);
637
+ return async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options);
591
638
  },
592
639
  });
593
640
  return rootProxy;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAGL,cAAc,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAC/D,KAAK,UAAU,GAAG,UAAU,GAAG,UAAU,EAAE,CAAC;AAC5C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,UAAU,GAAG,KAAK,CAAC;AAEhE,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI;IACrC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;AAEpE,KAAK,2BAA2B,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,IAAI,CAAC,GAC7D,KAAK,CAAC,IAAI,SAAS,MAAM,GAAG,2BAA2B,CAAC,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA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@
1
1
  {
2
2
  "name": "@cms0/cms0",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "restricted"