@cms0/cms0 0.0.10 → 0.0.11
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.
- package/dist/cjs/index.cjs +59 -22
- package/dist/esm/index.js +59 -22
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -42,9 +42,22 @@ function coerceRichTextValue(value) {
|
|
|
42
42
|
html,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
function
|
|
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
|
|
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
|
|
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
|
-
|
|
89
|
-
|
|
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) {
|
|
@@ -304,7 +322,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
304
322
|
const output = {};
|
|
305
323
|
for (const [propertyName, propertyDescriptor] of Object.entries(descriptor.properties)) {
|
|
306
324
|
if (isPrimitiveDescriptor(propertyDescriptor)) {
|
|
307
|
-
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName]
|
|
325
|
+
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName], {
|
|
326
|
+
locale: context.options.locale,
|
|
327
|
+
defaultLocale: context.options.defaultLocale,
|
|
328
|
+
});
|
|
308
329
|
continue;
|
|
309
330
|
}
|
|
310
331
|
if (isModelRefDescriptor(propertyDescriptor)) {
|
|
@@ -323,7 +344,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
323
344
|
},
|
|
324
345
|
});
|
|
325
346
|
const normalizedChild = await normalizeArrayField(propertyDescriptor, childPath, childRaw, context, trail);
|
|
326
|
-
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild
|
|
347
|
+
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
|
|
348
|
+
locale: context.options.locale,
|
|
349
|
+
defaultLocale: context.options.defaultLocale,
|
|
350
|
+
});
|
|
327
351
|
continue;
|
|
328
352
|
}
|
|
329
353
|
if (isObjectDescriptor(propertyDescriptor)) {
|
|
@@ -335,7 +359,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
335
359
|
},
|
|
336
360
|
});
|
|
337
361
|
const normalizedChild = await normalizeObjectField(propertyDescriptor, childPath, childRaw, context, trail, false);
|
|
338
|
-
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild
|
|
362
|
+
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
|
|
363
|
+
locale: context.options.locale,
|
|
364
|
+
defaultLocale: context.options.defaultLocale,
|
|
365
|
+
});
|
|
339
366
|
}
|
|
340
367
|
}
|
|
341
368
|
if (shouldIncludeObjectId(context.options.includeIdMode, isCollectionItem)) {
|
|
@@ -383,7 +410,10 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
383
410
|
const value = raw && typeof raw === "object" && "value" in raw
|
|
384
411
|
? raw.value
|
|
385
412
|
: raw;
|
|
386
|
-
return coerceCustomTypeValue(descriptor, value
|
|
413
|
+
return coerceCustomTypeValue(descriptor, value, {
|
|
414
|
+
locale: context.options.locale,
|
|
415
|
+
defaultLocale: context.options.defaultLocale,
|
|
416
|
+
});
|
|
387
417
|
}
|
|
388
418
|
if (isModelRefDescriptor(descriptor)) {
|
|
389
419
|
const refId = extractModelRefId(raw, descriptor.model);
|
|
@@ -391,11 +421,17 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
391
421
|
}
|
|
392
422
|
if (isArrayDescriptor(descriptor)) {
|
|
393
423
|
const normalized = await normalizeArrayField(descriptor, path, raw, context, trail);
|
|
394
|
-
return coerceCustomTypeValue(descriptor, normalized
|
|
424
|
+
return coerceCustomTypeValue(descriptor, normalized, {
|
|
425
|
+
locale: context.options.locale,
|
|
426
|
+
defaultLocale: context.options.defaultLocale,
|
|
427
|
+
});
|
|
395
428
|
}
|
|
396
429
|
if (isObjectDescriptor(descriptor)) {
|
|
397
430
|
const normalized = await normalizeObjectField(descriptor, path, raw, context, trail, isCollectionItem);
|
|
398
|
-
return coerceCustomTypeValue(descriptor, normalized
|
|
431
|
+
return coerceCustomTypeValue(descriptor, normalized, {
|
|
432
|
+
locale: context.options.locale,
|
|
433
|
+
defaultLocale: context.options.defaultLocale,
|
|
434
|
+
});
|
|
399
435
|
}
|
|
400
436
|
return raw;
|
|
401
437
|
}
|
|
@@ -482,14 +518,14 @@ function validateResult(resource, result, descriptor, includeIdMode, zodSchemas,
|
|
|
482
518
|
throw new Error(formatValidationError(modelName, parsed.error));
|
|
483
519
|
}
|
|
484
520
|
}
|
|
485
|
-
async function runResource(resource, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options, byId) {
|
|
521
|
+
async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale, zodSchemas, modelZodSchemas, options, byId) {
|
|
486
522
|
const responseMode = options?.response ?? "normalized";
|
|
487
523
|
const includeIdMode = resolveIncludeIdMode(options?.includeId);
|
|
488
524
|
const resolveModelRefs = options?.resolveModelRefs !== false;
|
|
489
525
|
const locale = options?.locale ??
|
|
490
526
|
(typeof options?.query?.locale === "string"
|
|
491
527
|
? options.query.locale
|
|
492
|
-
:
|
|
528
|
+
: defaultLocale);
|
|
493
529
|
const query = {
|
|
494
530
|
...(options?.query ?? {}),
|
|
495
531
|
};
|
|
@@ -525,6 +561,7 @@ async function runResource(resource, descriptor, baseUrl, apiKey, zodSchemas, mo
|
|
|
525
561
|
includeIdMode,
|
|
526
562
|
resolveModelRefs,
|
|
527
563
|
locale,
|
|
564
|
+
defaultLocale,
|
|
528
565
|
},
|
|
529
566
|
};
|
|
530
567
|
if (resource.isCollection && !byId) {
|
|
@@ -560,8 +597,8 @@ function createCmsClient(descriptor, config) {
|
|
|
560
597
|
const modelKeys = Array.from(registry.models.keys());
|
|
561
598
|
const { zodSchemas, modelZodSchemas } = (0, shared_1.buildZodSchemasFromDescriptor)(descriptor);
|
|
562
599
|
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);
|
|
600
|
+
const accessor = (async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options));
|
|
601
|
+
accessor.byId = async (id, options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options, id);
|
|
565
602
|
return accessor;
|
|
566
603
|
};
|
|
567
604
|
const modelsProxy = new Proxy({}, {
|
|
@@ -591,7 +628,7 @@ function createCmsClient(descriptor, config) {
|
|
|
591
628
|
if (!entry) {
|
|
592
629
|
unknownKeyError(property, rootKeys, []);
|
|
593
630
|
}
|
|
594
|
-
return async (options) => runResource(entry, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options);
|
|
631
|
+
return async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options);
|
|
595
632
|
},
|
|
596
633
|
});
|
|
597
634
|
return rootProxy;
|
package/dist/esm/index.js
CHANGED
|
@@ -38,9 +38,22 @@ function coerceRichTextValue(value) {
|
|
|
38
38
|
html,
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
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
|
|
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
|
|
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
|
-
|
|
85
|
-
|
|
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) {
|
|
@@ -300,7 +318,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
300
318
|
const output = {};
|
|
301
319
|
for (const [propertyName, propertyDescriptor] of Object.entries(descriptor.properties)) {
|
|
302
320
|
if (isPrimitiveDescriptor(propertyDescriptor)) {
|
|
303
|
-
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName]
|
|
321
|
+
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName], {
|
|
322
|
+
locale: context.options.locale,
|
|
323
|
+
defaultLocale: context.options.defaultLocale,
|
|
324
|
+
});
|
|
304
325
|
continue;
|
|
305
326
|
}
|
|
306
327
|
if (isModelRefDescriptor(propertyDescriptor)) {
|
|
@@ -319,7 +340,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
319
340
|
},
|
|
320
341
|
});
|
|
321
342
|
const normalizedChild = await normalizeArrayField(propertyDescriptor, childPath, childRaw, context, trail);
|
|
322
|
-
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild
|
|
343
|
+
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
|
|
344
|
+
locale: context.options.locale,
|
|
345
|
+
defaultLocale: context.options.defaultLocale,
|
|
346
|
+
});
|
|
323
347
|
continue;
|
|
324
348
|
}
|
|
325
349
|
if (isObjectDescriptor(propertyDescriptor)) {
|
|
@@ -331,7 +355,10 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
331
355
|
},
|
|
332
356
|
});
|
|
333
357
|
const normalizedChild = await normalizeObjectField(propertyDescriptor, childPath, childRaw, context, trail, false);
|
|
334
|
-
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild
|
|
358
|
+
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
|
|
359
|
+
locale: context.options.locale,
|
|
360
|
+
defaultLocale: context.options.defaultLocale,
|
|
361
|
+
});
|
|
335
362
|
}
|
|
336
363
|
}
|
|
337
364
|
if (shouldIncludeObjectId(context.options.includeIdMode, isCollectionItem)) {
|
|
@@ -379,7 +406,10 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
379
406
|
const value = raw && typeof raw === "object" && "value" in raw
|
|
380
407
|
? raw.value
|
|
381
408
|
: raw;
|
|
382
|
-
return coerceCustomTypeValue(descriptor, value
|
|
409
|
+
return coerceCustomTypeValue(descriptor, value, {
|
|
410
|
+
locale: context.options.locale,
|
|
411
|
+
defaultLocale: context.options.defaultLocale,
|
|
412
|
+
});
|
|
383
413
|
}
|
|
384
414
|
if (isModelRefDescriptor(descriptor)) {
|
|
385
415
|
const refId = extractModelRefId(raw, descriptor.model);
|
|
@@ -387,11 +417,17 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
387
417
|
}
|
|
388
418
|
if (isArrayDescriptor(descriptor)) {
|
|
389
419
|
const normalized = await normalizeArrayField(descriptor, path, raw, context, trail);
|
|
390
|
-
return coerceCustomTypeValue(descriptor, normalized
|
|
420
|
+
return coerceCustomTypeValue(descriptor, normalized, {
|
|
421
|
+
locale: context.options.locale,
|
|
422
|
+
defaultLocale: context.options.defaultLocale,
|
|
423
|
+
});
|
|
391
424
|
}
|
|
392
425
|
if (isObjectDescriptor(descriptor)) {
|
|
393
426
|
const normalized = await normalizeObjectField(descriptor, path, raw, context, trail, isCollectionItem);
|
|
394
|
-
return coerceCustomTypeValue(descriptor, normalized
|
|
427
|
+
return coerceCustomTypeValue(descriptor, normalized, {
|
|
428
|
+
locale: context.options.locale,
|
|
429
|
+
defaultLocale: context.options.defaultLocale,
|
|
430
|
+
});
|
|
395
431
|
}
|
|
396
432
|
return raw;
|
|
397
433
|
}
|
|
@@ -478,14 +514,14 @@ function validateResult(resource, result, descriptor, includeIdMode, zodSchemas,
|
|
|
478
514
|
throw new Error(formatValidationError(modelName, parsed.error));
|
|
479
515
|
}
|
|
480
516
|
}
|
|
481
|
-
async function runResource(resource, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options, byId) {
|
|
517
|
+
async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale, zodSchemas, modelZodSchemas, options, byId) {
|
|
482
518
|
const responseMode = options?.response ?? "normalized";
|
|
483
519
|
const includeIdMode = resolveIncludeIdMode(options?.includeId);
|
|
484
520
|
const resolveModelRefs = options?.resolveModelRefs !== false;
|
|
485
521
|
const locale = options?.locale ??
|
|
486
522
|
(typeof options?.query?.locale === "string"
|
|
487
523
|
? options.query.locale
|
|
488
|
-
:
|
|
524
|
+
: defaultLocale);
|
|
489
525
|
const query = {
|
|
490
526
|
...(options?.query ?? {}),
|
|
491
527
|
};
|
|
@@ -521,6 +557,7 @@ async function runResource(resource, descriptor, baseUrl, apiKey, zodSchemas, mo
|
|
|
521
557
|
includeIdMode,
|
|
522
558
|
resolveModelRefs,
|
|
523
559
|
locale,
|
|
560
|
+
defaultLocale,
|
|
524
561
|
},
|
|
525
562
|
};
|
|
526
563
|
if (resource.isCollection && !byId) {
|
|
@@ -556,8 +593,8 @@ export function createCmsClient(descriptor, config) {
|
|
|
556
593
|
const modelKeys = Array.from(registry.models.keys());
|
|
557
594
|
const { zodSchemas, modelZodSchemas } = buildZodSchemasFromDescriptor(descriptor);
|
|
558
595
|
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);
|
|
596
|
+
const accessor = (async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options));
|
|
597
|
+
accessor.byId = async (id, options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options, id);
|
|
561
598
|
return accessor;
|
|
562
599
|
};
|
|
563
600
|
const modelsProxy = new Proxy({}, {
|
|
@@ -587,7 +624,7 @@ export function createCmsClient(descriptor, config) {
|
|
|
587
624
|
if (!entry) {
|
|
588
625
|
unknownKeyError(property, rootKeys, []);
|
|
589
626
|
}
|
|
590
|
-
return async (options) => runResource(entry, descriptor, baseUrl, apiKey, zodSchemas, modelZodSchemas, options);
|
|
627
|
+
return async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options);
|
|
591
628
|
},
|
|
592
629
|
});
|
|
593
630
|
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,GA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