@cms0/cms0 0.0.12 → 0.1.0
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 +79 -5
- package/dist/esm/index.js +79 -5
- package/dist/types/custom-types/index.d.ts +1 -0
- package/dist/types/custom-types/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +14 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/responsive-break.css +1 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,6 +5,64 @@ exports.cms0 = cms0;
|
|
|
5
5
|
const schema_descriptors_1 = require("@cms0/cms0/schema-descriptors");
|
|
6
6
|
const shared_1 = require("@cms0/shared");
|
|
7
7
|
const COLLECTION_SHAPE_ERROR = "Invalid collection response. Expected array or { items, total }.";
|
|
8
|
+
function normalizeUploadsPath(uploadsPath) {
|
|
9
|
+
const raw = uploadsPath?.trim() || "/uploads";
|
|
10
|
+
const withLeadingSlash = raw.startsWith("/") ? raw : `/${raw}`;
|
|
11
|
+
const normalized = withLeadingSlash.replace(/\/+$/, "");
|
|
12
|
+
return normalized || "/uploads";
|
|
13
|
+
}
|
|
14
|
+
function normalizeAssetBaseUrl(baseUrl) {
|
|
15
|
+
const trimmed = baseUrl?.trim() ?? "";
|
|
16
|
+
return trimmed.replace(/\/+$/, "");
|
|
17
|
+
}
|
|
18
|
+
function encodeFilenameForUrl(filename) {
|
|
19
|
+
const normalized = filename.replace(/\\/g, "/").replace(/^\/+/, "").trim();
|
|
20
|
+
if (!normalized)
|
|
21
|
+
return "";
|
|
22
|
+
return normalized
|
|
23
|
+
.split("/")
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.map((segment) => encodeURIComponent(segment))
|
|
26
|
+
.join("/");
|
|
27
|
+
}
|
|
28
|
+
function buildAssetUrlBuilder(apiBaseUrl, assetOptions) {
|
|
29
|
+
const uploadsPath = normalizeUploadsPath(assetOptions?.uploadsPath);
|
|
30
|
+
const explicitBaseUrl = normalizeAssetBaseUrl(assetOptions?.baseUrl);
|
|
31
|
+
if (explicitBaseUrl) {
|
|
32
|
+
return (filename) => `${explicitBaseUrl}${uploadsPath}/${encodeFilenameForUrl(filename)}`;
|
|
33
|
+
}
|
|
34
|
+
let inferredBaseUrl = "";
|
|
35
|
+
try {
|
|
36
|
+
inferredBaseUrl = new URL(apiBaseUrl).origin;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
inferredBaseUrl = "";
|
|
40
|
+
}
|
|
41
|
+
return (filename) => `${inferredBaseUrl}${uploadsPath}/${encodeFilenameForUrl(filename)}`;
|
|
42
|
+
}
|
|
43
|
+
function maybeAttachAssetUrl(value, assetUrlBuilder) {
|
|
44
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
45
|
+
return value;
|
|
46
|
+
const source = value;
|
|
47
|
+
const filename = typeof source.filename === "string" ? source.filename.trim() : "";
|
|
48
|
+
if (!filename)
|
|
49
|
+
return value;
|
|
50
|
+
const isAssetShape = typeof source.mimeType === "string" ||
|
|
51
|
+
typeof source.extension === "string" ||
|
|
52
|
+
typeof source.size === "number" ||
|
|
53
|
+
typeof source.width === "number" ||
|
|
54
|
+
typeof source.height === "number" ||
|
|
55
|
+
typeof source.length === "number";
|
|
56
|
+
if (!isAssetShape)
|
|
57
|
+
return value;
|
|
58
|
+
const existingUrl = typeof source.url === "string" && source.url.trim().length > 0
|
|
59
|
+
? source.url
|
|
60
|
+
: null;
|
|
61
|
+
return {
|
|
62
|
+
...source,
|
|
63
|
+
url: existingUrl ?? assetUrlBuilder(filename),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
8
66
|
function toPlainText(value) {
|
|
9
67
|
if (typeof value === "string")
|
|
10
68
|
return value;
|
|
@@ -99,6 +157,9 @@ function coerceCustomTypeValue(descriptor, value, options) {
|
|
|
99
157
|
return value;
|
|
100
158
|
if (customType === "RichText")
|
|
101
159
|
return coerceRichTextValue(value);
|
|
160
|
+
if (customType === "File" || customType === "Image" || customType === "Video") {
|
|
161
|
+
return maybeAttachAssetUrl(value, options?.assetUrlBuilder ?? ((filename) => filename));
|
|
162
|
+
}
|
|
102
163
|
if (customType === "LocalizedString") {
|
|
103
164
|
return coerceLocalizedStringValue(value, options?.locale, options?.defaultLocale);
|
|
104
165
|
}
|
|
@@ -332,6 +393,7 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
332
393
|
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName], {
|
|
333
394
|
locale: context.options.locale,
|
|
334
395
|
defaultLocale: context.options.defaultLocale,
|
|
396
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
335
397
|
});
|
|
336
398
|
continue;
|
|
337
399
|
}
|
|
@@ -355,6 +417,7 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
355
417
|
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
|
|
356
418
|
locale: context.options.locale,
|
|
357
419
|
defaultLocale: context.options.defaultLocale,
|
|
420
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
358
421
|
});
|
|
359
422
|
continue;
|
|
360
423
|
}
|
|
@@ -370,6 +433,7 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
370
433
|
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
|
|
371
434
|
locale: context.options.locale,
|
|
372
435
|
defaultLocale: context.options.defaultLocale,
|
|
436
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
373
437
|
});
|
|
374
438
|
}
|
|
375
439
|
}
|
|
@@ -378,7 +442,12 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
378
442
|
if (rowId)
|
|
379
443
|
output.id = rowId;
|
|
380
444
|
}
|
|
381
|
-
|
|
445
|
+
if (typeof source.url === "string" &&
|
|
446
|
+
source.url.trim().length > 0 &&
|
|
447
|
+
typeof output.filename === "string") {
|
|
448
|
+
output.url = source.url;
|
|
449
|
+
}
|
|
450
|
+
return maybeAttachAssetUrl(output, context.options.assetUrlBuilder);
|
|
382
451
|
}
|
|
383
452
|
async function normalizeArrayField(descriptor, path, raw, context, trail) {
|
|
384
453
|
const envelope = ensureCollectionEnvelope(raw, path);
|
|
@@ -423,6 +492,7 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
423
492
|
return coerceCustomTypeValue(descriptor, value, {
|
|
424
493
|
locale: context.options.locale,
|
|
425
494
|
defaultLocale: context.options.defaultLocale,
|
|
495
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
426
496
|
});
|
|
427
497
|
}
|
|
428
498
|
if (isModelRefDescriptor(descriptor)) {
|
|
@@ -434,6 +504,7 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
434
504
|
return coerceCustomTypeValue(descriptor, normalized, {
|
|
435
505
|
locale: context.options.locale,
|
|
436
506
|
defaultLocale: context.options.defaultLocale,
|
|
507
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
437
508
|
});
|
|
438
509
|
}
|
|
439
510
|
if (isObjectDescriptor(descriptor)) {
|
|
@@ -441,6 +512,7 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
441
512
|
return coerceCustomTypeValue(descriptor, normalized, {
|
|
442
513
|
locale: context.options.locale,
|
|
443
514
|
defaultLocale: context.options.defaultLocale,
|
|
515
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
444
516
|
});
|
|
445
517
|
}
|
|
446
518
|
return raw;
|
|
@@ -528,7 +600,7 @@ function validateResult(resource, result, descriptor, includeIdMode, zodSchemas,
|
|
|
528
600
|
throw new Error(formatValidationError(modelName, parsed.error));
|
|
529
601
|
}
|
|
530
602
|
}
|
|
531
|
-
async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale, zodSchemas, modelZodSchemas, options, byId) {
|
|
603
|
+
async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale, assetUrlBuilder, zodSchemas, modelZodSchemas, options, byId) {
|
|
532
604
|
const responseMode = options?.response ?? "normalized";
|
|
533
605
|
const includeIdMode = resolveIncludeIdMode(options?.includeId);
|
|
534
606
|
const resolveModelRefs = options?.resolveModelRefs !== false;
|
|
@@ -572,6 +644,7 @@ async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale,
|
|
|
572
644
|
resolveModelRefs,
|
|
573
645
|
locale,
|
|
574
646
|
defaultLocale,
|
|
647
|
+
assetUrlBuilder,
|
|
575
648
|
},
|
|
576
649
|
};
|
|
577
650
|
if (resource.isCollection && !byId) {
|
|
@@ -602,13 +675,14 @@ async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale,
|
|
|
602
675
|
function createCmsClient(descriptor, config) {
|
|
603
676
|
const baseUrl = normalizeBaseUrl(config.apiConfig?.baseUrl);
|
|
604
677
|
const apiKey = config.apiConfig?.key;
|
|
678
|
+
const assetUrlBuilder = buildAssetUrlBuilder(baseUrl, config.assets);
|
|
605
679
|
const registry = createResourceRegistry(descriptor);
|
|
606
680
|
const rootKeys = Array.from(registry.roots.keys());
|
|
607
681
|
const modelKeys = Array.from(registry.models.keys());
|
|
608
682
|
const { zodSchemas, modelZodSchemas } = (0, shared_1.buildZodSchemasFromDescriptor)(descriptor);
|
|
609
683
|
const buildModelAccessor = (entry) => {
|
|
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);
|
|
684
|
+
const accessor = (async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, assetUrlBuilder, zodSchemas, modelZodSchemas, options));
|
|
685
|
+
accessor.byId = async (id, options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, assetUrlBuilder, zodSchemas, modelZodSchemas, options, id);
|
|
612
686
|
return accessor;
|
|
613
687
|
};
|
|
614
688
|
const modelsProxy = new Proxy({}, {
|
|
@@ -638,7 +712,7 @@ function createCmsClient(descriptor, config) {
|
|
|
638
712
|
if (!entry) {
|
|
639
713
|
unknownKeyError(property, rootKeys, []);
|
|
640
714
|
}
|
|
641
|
-
return async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options);
|
|
715
|
+
return async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, assetUrlBuilder, zodSchemas, modelZodSchemas, options);
|
|
642
716
|
},
|
|
643
717
|
});
|
|
644
718
|
return rootProxy;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
import { schemaDescriptor } from "@cms0/cms0/schema-descriptors";
|
|
2
2
|
import { buildZodSchemasFromDescriptor, } from "@cms0/shared";
|
|
3
3
|
const COLLECTION_SHAPE_ERROR = "Invalid collection response. Expected array or { items, total }.";
|
|
4
|
+
function normalizeUploadsPath(uploadsPath) {
|
|
5
|
+
const raw = uploadsPath?.trim() || "/uploads";
|
|
6
|
+
const withLeadingSlash = raw.startsWith("/") ? raw : `/${raw}`;
|
|
7
|
+
const normalized = withLeadingSlash.replace(/\/+$/, "");
|
|
8
|
+
return normalized || "/uploads";
|
|
9
|
+
}
|
|
10
|
+
function normalizeAssetBaseUrl(baseUrl) {
|
|
11
|
+
const trimmed = baseUrl?.trim() ?? "";
|
|
12
|
+
return trimmed.replace(/\/+$/, "");
|
|
13
|
+
}
|
|
14
|
+
function encodeFilenameForUrl(filename) {
|
|
15
|
+
const normalized = filename.replace(/\\/g, "/").replace(/^\/+/, "").trim();
|
|
16
|
+
if (!normalized)
|
|
17
|
+
return "";
|
|
18
|
+
return normalized
|
|
19
|
+
.split("/")
|
|
20
|
+
.filter(Boolean)
|
|
21
|
+
.map((segment) => encodeURIComponent(segment))
|
|
22
|
+
.join("/");
|
|
23
|
+
}
|
|
24
|
+
function buildAssetUrlBuilder(apiBaseUrl, assetOptions) {
|
|
25
|
+
const uploadsPath = normalizeUploadsPath(assetOptions?.uploadsPath);
|
|
26
|
+
const explicitBaseUrl = normalizeAssetBaseUrl(assetOptions?.baseUrl);
|
|
27
|
+
if (explicitBaseUrl) {
|
|
28
|
+
return (filename) => `${explicitBaseUrl}${uploadsPath}/${encodeFilenameForUrl(filename)}`;
|
|
29
|
+
}
|
|
30
|
+
let inferredBaseUrl = "";
|
|
31
|
+
try {
|
|
32
|
+
inferredBaseUrl = new URL(apiBaseUrl).origin;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
inferredBaseUrl = "";
|
|
36
|
+
}
|
|
37
|
+
return (filename) => `${inferredBaseUrl}${uploadsPath}/${encodeFilenameForUrl(filename)}`;
|
|
38
|
+
}
|
|
39
|
+
function maybeAttachAssetUrl(value, assetUrlBuilder) {
|
|
40
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
41
|
+
return value;
|
|
42
|
+
const source = value;
|
|
43
|
+
const filename = typeof source.filename === "string" ? source.filename.trim() : "";
|
|
44
|
+
if (!filename)
|
|
45
|
+
return value;
|
|
46
|
+
const isAssetShape = typeof source.mimeType === "string" ||
|
|
47
|
+
typeof source.extension === "string" ||
|
|
48
|
+
typeof source.size === "number" ||
|
|
49
|
+
typeof source.width === "number" ||
|
|
50
|
+
typeof source.height === "number" ||
|
|
51
|
+
typeof source.length === "number";
|
|
52
|
+
if (!isAssetShape)
|
|
53
|
+
return value;
|
|
54
|
+
const existingUrl = typeof source.url === "string" && source.url.trim().length > 0
|
|
55
|
+
? source.url
|
|
56
|
+
: null;
|
|
57
|
+
return {
|
|
58
|
+
...source,
|
|
59
|
+
url: existingUrl ?? assetUrlBuilder(filename),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
4
62
|
function toPlainText(value) {
|
|
5
63
|
if (typeof value === "string")
|
|
6
64
|
return value;
|
|
@@ -95,6 +153,9 @@ function coerceCustomTypeValue(descriptor, value, options) {
|
|
|
95
153
|
return value;
|
|
96
154
|
if (customType === "RichText")
|
|
97
155
|
return coerceRichTextValue(value);
|
|
156
|
+
if (customType === "File" || customType === "Image" || customType === "Video") {
|
|
157
|
+
return maybeAttachAssetUrl(value, options?.assetUrlBuilder ?? ((filename) => filename));
|
|
158
|
+
}
|
|
98
159
|
if (customType === "LocalizedString") {
|
|
99
160
|
return coerceLocalizedStringValue(value, options?.locale, options?.defaultLocale);
|
|
100
161
|
}
|
|
@@ -328,6 +389,7 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
328
389
|
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, source[propertyName], {
|
|
329
390
|
locale: context.options.locale,
|
|
330
391
|
defaultLocale: context.options.defaultLocale,
|
|
392
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
331
393
|
});
|
|
332
394
|
continue;
|
|
333
395
|
}
|
|
@@ -351,6 +413,7 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
351
413
|
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
|
|
352
414
|
locale: context.options.locale,
|
|
353
415
|
defaultLocale: context.options.defaultLocale,
|
|
416
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
354
417
|
});
|
|
355
418
|
continue;
|
|
356
419
|
}
|
|
@@ -366,6 +429,7 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
366
429
|
output[propertyName] = coerceCustomTypeValue(propertyDescriptor, normalizedChild, {
|
|
367
430
|
locale: context.options.locale,
|
|
368
431
|
defaultLocale: context.options.defaultLocale,
|
|
432
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
369
433
|
});
|
|
370
434
|
}
|
|
371
435
|
}
|
|
@@ -374,7 +438,12 @@ async function normalizeObjectField(descriptor, path, raw, context, trail, isCol
|
|
|
374
438
|
if (rowId)
|
|
375
439
|
output.id = rowId;
|
|
376
440
|
}
|
|
377
|
-
|
|
441
|
+
if (typeof source.url === "string" &&
|
|
442
|
+
source.url.trim().length > 0 &&
|
|
443
|
+
typeof output.filename === "string") {
|
|
444
|
+
output.url = source.url;
|
|
445
|
+
}
|
|
446
|
+
return maybeAttachAssetUrl(output, context.options.assetUrlBuilder);
|
|
378
447
|
}
|
|
379
448
|
async function normalizeArrayField(descriptor, path, raw, context, trail) {
|
|
380
449
|
const envelope = ensureCollectionEnvelope(raw, path);
|
|
@@ -419,6 +488,7 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
419
488
|
return coerceCustomTypeValue(descriptor, value, {
|
|
420
489
|
locale: context.options.locale,
|
|
421
490
|
defaultLocale: context.options.defaultLocale,
|
|
491
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
422
492
|
});
|
|
423
493
|
}
|
|
424
494
|
if (isModelRefDescriptor(descriptor)) {
|
|
@@ -430,6 +500,7 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
430
500
|
return coerceCustomTypeValue(descriptor, normalized, {
|
|
431
501
|
locale: context.options.locale,
|
|
432
502
|
defaultLocale: context.options.defaultLocale,
|
|
503
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
433
504
|
});
|
|
434
505
|
}
|
|
435
506
|
if (isObjectDescriptor(descriptor)) {
|
|
@@ -437,6 +508,7 @@ async function normalizeField(descriptor, path, raw, context, trail, isCollectio
|
|
|
437
508
|
return coerceCustomTypeValue(descriptor, normalized, {
|
|
438
509
|
locale: context.options.locale,
|
|
439
510
|
defaultLocale: context.options.defaultLocale,
|
|
511
|
+
assetUrlBuilder: context.options.assetUrlBuilder,
|
|
440
512
|
});
|
|
441
513
|
}
|
|
442
514
|
return raw;
|
|
@@ -524,7 +596,7 @@ function validateResult(resource, result, descriptor, includeIdMode, zodSchemas,
|
|
|
524
596
|
throw new Error(formatValidationError(modelName, parsed.error));
|
|
525
597
|
}
|
|
526
598
|
}
|
|
527
|
-
async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale, zodSchemas, modelZodSchemas, options, byId) {
|
|
599
|
+
async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale, assetUrlBuilder, zodSchemas, modelZodSchemas, options, byId) {
|
|
528
600
|
const responseMode = options?.response ?? "normalized";
|
|
529
601
|
const includeIdMode = resolveIncludeIdMode(options?.includeId);
|
|
530
602
|
const resolveModelRefs = options?.resolveModelRefs !== false;
|
|
@@ -568,6 +640,7 @@ async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale,
|
|
|
568
640
|
resolveModelRefs,
|
|
569
641
|
locale,
|
|
570
642
|
defaultLocale,
|
|
643
|
+
assetUrlBuilder,
|
|
571
644
|
},
|
|
572
645
|
};
|
|
573
646
|
if (resource.isCollection && !byId) {
|
|
@@ -598,13 +671,14 @@ async function runResource(resource, descriptor, baseUrl, apiKey, defaultLocale,
|
|
|
598
671
|
export function createCmsClient(descriptor, config) {
|
|
599
672
|
const baseUrl = normalizeBaseUrl(config.apiConfig?.baseUrl);
|
|
600
673
|
const apiKey = config.apiConfig?.key;
|
|
674
|
+
const assetUrlBuilder = buildAssetUrlBuilder(baseUrl, config.assets);
|
|
601
675
|
const registry = createResourceRegistry(descriptor);
|
|
602
676
|
const rootKeys = Array.from(registry.roots.keys());
|
|
603
677
|
const modelKeys = Array.from(registry.models.keys());
|
|
604
678
|
const { zodSchemas, modelZodSchemas } = buildZodSchemasFromDescriptor(descriptor);
|
|
605
679
|
const buildModelAccessor = (entry) => {
|
|
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);
|
|
680
|
+
const accessor = (async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, assetUrlBuilder, zodSchemas, modelZodSchemas, options));
|
|
681
|
+
accessor.byId = async (id, options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, assetUrlBuilder, zodSchemas, modelZodSchemas, options, id);
|
|
608
682
|
return accessor;
|
|
609
683
|
};
|
|
610
684
|
const modelsProxy = new Proxy({}, {
|
|
@@ -634,7 +708,7 @@ export function createCmsClient(descriptor, config) {
|
|
|
634
708
|
if (!entry) {
|
|
635
709
|
unknownKeyError(property, rootKeys, []);
|
|
636
710
|
}
|
|
637
|
-
return async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, zodSchemas, modelZodSchemas, options);
|
|
711
|
+
return async (options) => runResource(entry, descriptor, baseUrl, apiKey, config.defaultLocale, assetUrlBuilder, zodSchemas, modelZodSchemas, options);
|
|
638
712
|
},
|
|
639
713
|
});
|
|
640
714
|
return rootProxy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC;AAE5B,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,EAA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,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ type QueryValue = string | number | boolean | null | undefined;
|
|
|
5
5
|
type QueryParam = QueryValue | QueryValue[];
|
|
6
6
|
export type CmsQuery = Record<string, QueryParam>;
|
|
7
7
|
export type CmsResponseMode = "normalized" | "envelope" | "raw";
|
|
8
|
+
export interface CmsAssetOptions {
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
uploadsPath?: string;
|
|
11
|
+
}
|
|
8
12
|
export interface CmsAccessorOptions {
|
|
9
13
|
query?: CmsQuery;
|
|
10
14
|
response?: CmsResponseMode;
|
|
@@ -64,6 +68,7 @@ export interface Cms0Options {
|
|
|
64
68
|
apiConfig: Cms0APIConfig;
|
|
65
69
|
locales?: string[];
|
|
66
70
|
defaultLocale?: string;
|
|
71
|
+
assets?: CmsAssetOptions;
|
|
67
72
|
}
|
|
68
73
|
type PrimitiveValueFromDescriptor<TypeName extends string> = TypeName extends "string" ? string : TypeName extends "number" ? number : TypeName extends "boolean" ? boolean : any;
|
|
69
74
|
type ApplyDescriptorFlags<Descriptor, Value> = Descriptor extends {
|
|
@@ -95,8 +100,16 @@ type InferDescriptorField<Descriptor, ModelMap extends Record<string, any>> = Ap
|
|
|
95
100
|
type InferDescriptorModels<Models extends Record<string, any>> = {
|
|
96
101
|
[ModelName in keyof Models]: Models[ModelName] extends {
|
|
97
102
|
properties: infer Properties extends Record<string, any>;
|
|
98
|
-
} ? InferDescriptorObject<Properties, InferDescriptorModels<Models
|
|
103
|
+
} ? WithInferredAssetUrl<InferDescriptorObject<Properties, InferDescriptorModels<Models>>, Properties> : any;
|
|
99
104
|
};
|
|
105
|
+
type WithInferredAssetUrl<Shape, Properties extends Record<string, any>> = Properties extends {
|
|
106
|
+
filename: any;
|
|
107
|
+
extension: any;
|
|
108
|
+
mimeType: any;
|
|
109
|
+
size: any;
|
|
110
|
+
} ? Shape & {
|
|
111
|
+
url: string;
|
|
112
|
+
} : Shape;
|
|
100
113
|
type InferDescriptorRoots<Roots extends Record<string, any>, Models extends Record<string, any>> = {
|
|
101
114
|
[RootKey in keyof Roots]: InferDescriptorField<Roots[RootKey], Models>;
|
|
102
115
|
};
|
|
@@ -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,MAA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B,CACxC,OAAO,gBAAgB,CAAC,KAAK,EAC7B,eAAe,CAChB,CAAC;AAw+BF,wBAAgB,eAAe,CAC7B,KAAK,EACL,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAE1D,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,WAAW,GAClB,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAyF5B;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAClB,KAAK,GAAG,cAAc,EACtB,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,EACpD,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAKjD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cms0/cms0",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
@@ -42,10 +42,12 @@
|
|
|
42
42
|
"types": "./dist/types/generated/schema-descriptor.d.ts",
|
|
43
43
|
"import": "./dist/esm/generated/schema-descriptor.js",
|
|
44
44
|
"require": "./dist/cjs/generated/schema-descriptor.cjs"
|
|
45
|
-
}
|
|
45
|
+
},
|
|
46
|
+
"./responsive-break.css": "./src/responsive-break.css"
|
|
46
47
|
},
|
|
47
48
|
"files": [
|
|
48
|
-
"dist"
|
|
49
|
+
"dist",
|
|
50
|
+
"src/responsive-break.css"
|
|
49
51
|
],
|
|
50
52
|
"keywords": [],
|
|
51
53
|
"author": "",
|
|
@@ -57,7 +59,7 @@
|
|
|
57
59
|
"ts-node": "^10.9.2",
|
|
58
60
|
"typescript": "^5.9.3",
|
|
59
61
|
"zod": "^4.1.12",
|
|
60
|
-
"@cms0/shared": "0.0
|
|
62
|
+
"@cms0/shared": "0.1.0"
|
|
61
63
|
},
|
|
62
64
|
"devDependencies": {
|
|
63
65
|
"@types/lodash": "^4.17.21",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@cms0/shared/responsive-break.css";
|