@relyio/sdk 0.11.0 → 0.13.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/CHANGELOG.md +172 -0
- package/dist/chunk-3NPPMGB6.js +1092 -0
- package/dist/{chunk-7GLDVHIH.js → chunk-6NGJXLOR.js} +65 -67
- package/dist/{chunk-4HTIU5YE.cjs → chunk-DEDIJKHY.cjs} +65 -67
- package/dist/{chunk-2TIJLV2X.js → chunk-EW23SZPX.js} +43 -65
- package/dist/{chunk-PO7CUR5U.cjs → chunk-FOSM4LMM.cjs} +42 -65
- package/dist/chunk-Z6GLWSSD.cjs +1106 -0
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.js +1 -1
- package/dist/{define-schema-CVi8nwc7.d.ts → define-schema-UHViXKiv.d.ts} +33 -435
- package/dist/{define-schema-DqpipEHv.d.cts → define-schema-sWJ8Zn7C.d.cts} +33 -435
- package/dist/{define-content-type-ENAod5Ve.d.cts → include-paths-Bs5FhNw2.d.cts} +3505 -483
- package/dist/{define-content-type-ENAod5Ve.d.ts → include-paths-Cb7iPCW2.d.ts} +3505 -483
- package/dist/index--_u1nPHv.d.cts +507 -0
- package/dist/index-8DozAWsA.d.ts +507 -0
- package/dist/{index-MLAFUuco.d.cts → index-BT0L8xJj.d.cts} +139 -90
- package/dist/{index-BKEAYvvz.d.ts → index-CPjJ25R4.d.ts} +139 -90
- package/dist/index.cjs +134 -110
- package/dist/index.d.cts +44 -71
- package/dist/index.d.ts +44 -71
- package/dist/index.js +5 -28
- package/dist/markdown/index.cjs +13750 -0
- package/dist/markdown/index.d.cts +111 -0
- package/dist/markdown/index.d.ts +111 -0
- package/dist/markdown/index.js +13742 -0
- package/dist/rich-text/index.cjs +49 -0
- package/dist/rich-text/index.d.cts +3 -0
- package/dist/rich-text/index.d.ts +3 -0
- package/dist/rich-text/index.js +4 -0
- package/dist/rich-text.d-BWc-5gX1.d.cts +326 -0
- package/dist/rich-text.d-BWc-5gX1.d.ts +326 -0
- package/dist/schema/index.cjs +34 -38
- package/dist/schema/index.d.cts +15 -137
- package/dist/schema/index.d.ts +15 -137
- package/dist/schema/index.js +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +19 -2
- package/dist/.tsbuildinfo +0 -1
- package/dist/index-BM42r4yg.d.cts +0 -860
- package/dist/index-C73cK2Tt.d.ts +0 -860
|
@@ -95,7 +95,6 @@ function defineSchema(config) {
|
|
|
95
95
|
_tag: "schema",
|
|
96
96
|
...config.locales !== void 0 && { locales: config.locales },
|
|
97
97
|
contentTypes: config.contentTypes,
|
|
98
|
-
components: config.components ?? {},
|
|
99
98
|
singletonContentTypes: config.singletonContentTypes ?? {},
|
|
100
99
|
queries: config.queries ?? {},
|
|
101
100
|
settingsGroups: config.settingsGroups,
|
|
@@ -109,30 +108,30 @@ __name(defineSchema, "defineSchema");
|
|
|
109
108
|
|
|
110
109
|
// src/schema/define-locale.ts
|
|
111
110
|
var BCP47_PATTERN = /^[a-z]{2}(-[A-Z]{2})?$/;
|
|
112
|
-
function defineLocale(
|
|
113
|
-
if (!BCP47_PATTERN.test(
|
|
111
|
+
function defineLocale(code2, options) {
|
|
112
|
+
if (!BCP47_PATTERN.test(code2)) {
|
|
114
113
|
throw new Error(
|
|
115
|
-
`Invalid locale code '${
|
|
114
|
+
`Invalid locale code '${code2}'. Expected BCP 47 format: 'xx' or 'xx-XX' (e.g., 'en', 'en-US', 'fr-FR')`
|
|
116
115
|
);
|
|
117
116
|
}
|
|
118
117
|
if (!options.displayName || options.displayName.trim().length === 0) {
|
|
119
|
-
throw new Error(`Locale '${
|
|
118
|
+
throw new Error(`Locale '${code2}' requires a displayName`);
|
|
120
119
|
}
|
|
121
120
|
if (options.fallback) {
|
|
122
121
|
for (const fallbackCode of options.fallback) {
|
|
123
122
|
if (typeof fallbackCode !== "string" || !BCP47_PATTERN.test(fallbackCode)) {
|
|
124
123
|
throw new Error(
|
|
125
|
-
`Invalid fallback locale code '${fallbackCode}' in locale '${
|
|
124
|
+
`Invalid fallback locale code '${fallbackCode}' in locale '${code2}'. Expected BCP 47 format.`
|
|
126
125
|
);
|
|
127
126
|
}
|
|
128
|
-
if (fallbackCode ===
|
|
129
|
-
throw new Error(`Locale '${
|
|
127
|
+
if (fallbackCode === code2) {
|
|
128
|
+
throw new Error(`Locale '${code2}' cannot reference itself in fallback chain`);
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
132
|
return {
|
|
134
133
|
_tag: "locale",
|
|
135
|
-
code,
|
|
134
|
+
code: code2,
|
|
136
135
|
displayName: options.displayName,
|
|
137
136
|
...options.default !== void 0 && { default: options.default },
|
|
138
137
|
...options.fallback !== void 0 && { fallback: options.fallback },
|
|
@@ -161,11 +160,11 @@ function buildFallbackChain(localeCode, locales, maxDepth = 10) {
|
|
|
161
160
|
const localeMap = new Map(locales.map((l) => [l.code, l]));
|
|
162
161
|
const chain = [];
|
|
163
162
|
const visited = /* @__PURE__ */ new Set();
|
|
164
|
-
function addFallbacks(
|
|
165
|
-
if (depth > maxDepth || visited.has(
|
|
166
|
-
const locale = localeMap.get(
|
|
163
|
+
function addFallbacks(code2, depth) {
|
|
164
|
+
if (depth > maxDepth || visited.has(code2)) return;
|
|
165
|
+
const locale = localeMap.get(code2);
|
|
167
166
|
if (!locale?.fallback) return;
|
|
168
|
-
visited.add(
|
|
167
|
+
visited.add(code2);
|
|
169
168
|
for (const fallbackCode of locale.fallback) {
|
|
170
169
|
if (!chain.includes(fallbackCode) && fallbackCode !== localeCode) {
|
|
171
170
|
chain.push(fallbackCode);
|
|
@@ -194,7 +193,7 @@ function fieldset(id, config) {
|
|
|
194
193
|
}
|
|
195
194
|
__name(fieldset, "fieldset");
|
|
196
195
|
function defineContentType(name, config) {
|
|
197
|
-
|
|
196
|
+
return {
|
|
198
197
|
_tag: "contentType",
|
|
199
198
|
name,
|
|
200
199
|
displayName: config.displayName,
|
|
@@ -206,21 +205,15 @@ function defineContentType(name, config) {
|
|
|
206
205
|
// definition from YAML and another from TypeScript, with a different schemaHash (REL-1458)
|
|
207
206
|
...config.hierarchical !== void 0 && { hierarchical: config.hierarchical },
|
|
208
207
|
...config.accessTags !== void 0 && { accessTags: config.accessTags },
|
|
209
|
-
...config.workflow !== void 0 && { workflow: config.workflow }
|
|
208
|
+
...config.workflow !== void 0 && { workflow: config.workflow },
|
|
209
|
+
fields: config.fields
|
|
210
210
|
};
|
|
211
|
-
if ("fields" in config && config.fields) {
|
|
212
|
-
return { ...base, fields: config.fields };
|
|
213
|
-
}
|
|
214
|
-
if ("fieldsets" in config && config.fieldsets) {
|
|
215
|
-
return { ...base, fieldsets: config.fieldsets };
|
|
216
|
-
}
|
|
217
|
-
throw new Error("Content type must have either fields or fieldsets");
|
|
218
211
|
}
|
|
219
212
|
__name(defineContentType, "defineContentType");
|
|
220
213
|
|
|
221
214
|
// src/schema/define-singleton.ts
|
|
222
215
|
function defineSingletonContentType(name, config) {
|
|
223
|
-
|
|
216
|
+
return {
|
|
224
217
|
_tag: "singletonContentType",
|
|
225
218
|
name,
|
|
226
219
|
displayName: config.displayName,
|
|
@@ -232,36 +225,13 @@ function defineSingletonContentType(name, config) {
|
|
|
232
225
|
...config.hierarchical !== void 0 && { hierarchical: config.hierarchical },
|
|
233
226
|
...config.accessTags !== void 0 && { accessTags: config.accessTags },
|
|
234
227
|
// Its config type took `workflow` and this dropped it, so a singleton's workflow never deployed
|
|
235
|
-
...config.workflow !== void 0 && { workflow: config.workflow }
|
|
228
|
+
...config.workflow !== void 0 && { workflow: config.workflow },
|
|
229
|
+
fields: config.fields
|
|
236
230
|
};
|
|
237
|
-
if ("fields" in config && config.fields) {
|
|
238
|
-
return { ...base, fields: config.fields };
|
|
239
|
-
}
|
|
240
|
-
if ("fieldsets" in config && config.fieldsets) {
|
|
241
|
-
return { ...base, fieldsets: config.fieldsets };
|
|
242
|
-
}
|
|
243
|
-
throw new Error("Singleton content type must have either fields or fieldsets");
|
|
244
231
|
}
|
|
245
232
|
__name(defineSingletonContentType, "defineSingletonContentType");
|
|
246
233
|
var defineSingleton = defineSingletonContentType;
|
|
247
234
|
|
|
248
|
-
// src/schema/define-component.ts
|
|
249
|
-
function defineComponent(name, config) {
|
|
250
|
-
return {
|
|
251
|
-
_tag: "component",
|
|
252
|
-
name,
|
|
253
|
-
displayName: config.displayName,
|
|
254
|
-
description: config.description,
|
|
255
|
-
ai: config.ai,
|
|
256
|
-
// Written only when given: `false` whenever not made a YAML and a TypeScript component two
|
|
257
|
-
// definitions (REL-1458)
|
|
258
|
-
...config.deprecated !== void 0 && { deprecated: config.deprecated },
|
|
259
|
-
fields: config.fields,
|
|
260
|
-
metadata: config.metadata
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
__name(defineComponent, "defineComponent");
|
|
264
|
-
|
|
265
235
|
// src/schema/define-settings-group.ts
|
|
266
236
|
function defineSettingsGroup(name, config) {
|
|
267
237
|
return {
|
|
@@ -287,7 +257,7 @@ function defineAssetType(name, config) {
|
|
|
287
257
|
`Asset type '${name}' declares multiple kind keys (${kindKeys.join(", ")}); exactly one is allowed`
|
|
288
258
|
);
|
|
289
259
|
}
|
|
290
|
-
|
|
260
|
+
return {
|
|
291
261
|
_tag: "assetType",
|
|
292
262
|
name,
|
|
293
263
|
displayName: config.displayName,
|
|
@@ -300,15 +270,9 @@ function defineAssetType(name, config) {
|
|
|
300
270
|
...config.workflow !== void 0 && { workflow: config.workflow },
|
|
301
271
|
...config.image !== void 0 && { image: config.image },
|
|
302
272
|
...config.video !== void 0 && { video: config.video },
|
|
303
|
-
...config.file !== void 0 && { file: config.file }
|
|
273
|
+
...config.file !== void 0 && { file: config.file },
|
|
274
|
+
...config.fields !== void 0 && { fields: config.fields }
|
|
304
275
|
};
|
|
305
|
-
if ("fields" in config && config.fields) {
|
|
306
|
-
return { ...base, fields: config.fields };
|
|
307
|
-
}
|
|
308
|
-
if ("fieldsets" in config && config.fieldsets) {
|
|
309
|
-
return { ...base, fieldsets: config.fieldsets };
|
|
310
|
-
}
|
|
311
|
-
return base;
|
|
312
276
|
}
|
|
313
277
|
__name(defineAssetType, "defineAssetType");
|
|
314
278
|
|
|
@@ -587,19 +551,22 @@ __name(defineQuery, "defineQuery");
|
|
|
587
551
|
var fields_exports = {};
|
|
588
552
|
__export(fields_exports, {
|
|
589
553
|
boolean: () => boolean,
|
|
590
|
-
|
|
554
|
+
code: () => code,
|
|
591
555
|
date: () => date,
|
|
592
556
|
dateTime: () => dateTime,
|
|
593
557
|
decimal: () => decimal,
|
|
594
558
|
email: () => email,
|
|
595
559
|
enum: () => enumField,
|
|
596
560
|
integer: () => integer,
|
|
561
|
+
json: () => json,
|
|
597
562
|
list: () => list,
|
|
598
563
|
longText: () => longText,
|
|
564
|
+
object: () => object,
|
|
599
565
|
reference: () => reference,
|
|
600
566
|
richText: () => richText,
|
|
601
567
|
shortText: () => shortText,
|
|
602
568
|
slug: () => slug,
|
|
569
|
+
table: () => table,
|
|
603
570
|
tags: () => tags,
|
|
604
571
|
url: () => url
|
|
605
572
|
});
|
|
@@ -632,6 +599,14 @@ function richText(id, options = {}) {
|
|
|
632
599
|
return createField(id, "richText", options);
|
|
633
600
|
}
|
|
634
601
|
__name(richText, "richText");
|
|
602
|
+
function table(id, options = {}) {
|
|
603
|
+
return createField(id, "table", options);
|
|
604
|
+
}
|
|
605
|
+
__name(table, "table");
|
|
606
|
+
function code(id, options = {}) {
|
|
607
|
+
return createField(id, "code", options);
|
|
608
|
+
}
|
|
609
|
+
__name(code, "code");
|
|
635
610
|
function slug(id, options = {}) {
|
|
636
611
|
return createField(id, "slug", options);
|
|
637
612
|
}
|
|
@@ -680,15 +655,18 @@ function list(id, options = {}) {
|
|
|
680
655
|
return createField(id, "list", options);
|
|
681
656
|
}
|
|
682
657
|
__name(list, "list");
|
|
683
|
-
function
|
|
684
|
-
|
|
685
|
-
|
|
658
|
+
function object(id, options) {
|
|
659
|
+
return createField(id, "object", options);
|
|
660
|
+
}
|
|
661
|
+
__name(object, "object");
|
|
662
|
+
function json(id, options = {}) {
|
|
663
|
+
return createField(id, "json", options);
|
|
686
664
|
}
|
|
687
|
-
__name(
|
|
665
|
+
__name(json, "json");
|
|
688
666
|
|
|
689
667
|
// src/schema/index.ts
|
|
690
668
|
var fields = fields_exports;
|
|
691
669
|
|
|
692
|
-
export { BUILT_IN_ROLES, BUILT_IN_ROLE_ACTIONS, ROLE_ACTIONS, buildFallbackChain, defineAssetType,
|
|
693
|
-
//# sourceMappingURL=chunk-
|
|
694
|
-
//# sourceMappingURL=chunk-
|
|
670
|
+
export { BUILT_IN_ROLES, BUILT_IN_ROLE_ACTIONS, ROLE_ACTIONS, buildFallbackChain, defineAssetType, defineContentType, defineContentTypeWorkflow, defineLocale, defineQuery, defineRole, defineSchema, defineSettingsGroup, defineSingleton, defineSingletonContentType, defineView, defineWorkflow, defineWorkflowStage, fields, fieldset, findDefaultLocale, findWorkflowStage, getActiveLocales, getBuiltInRoleActions, getFirstWorkflowStage, getLocaleCodes, getNextWorkflowStage, getWorkflowStageIds, isBuiltInRole, isFinalWorkflowStage, isLocaleDefinition, isRoleDefinition, isWorkflowDefinition, isWorkflowStageDefinition };
|
|
671
|
+
//# sourceMappingURL=chunk-EW23SZPX.js.map
|
|
672
|
+
//# sourceMappingURL=chunk-EW23SZPX.js.map
|
|
@@ -97,7 +97,6 @@ function defineSchema(config) {
|
|
|
97
97
|
_tag: "schema",
|
|
98
98
|
...config.locales !== void 0 && { locales: config.locales },
|
|
99
99
|
contentTypes: config.contentTypes,
|
|
100
|
-
components: config.components ?? {},
|
|
101
100
|
singletonContentTypes: config.singletonContentTypes ?? {},
|
|
102
101
|
queries: config.queries ?? {},
|
|
103
102
|
settingsGroups: config.settingsGroups,
|
|
@@ -111,30 +110,30 @@ chunkMWMSFIWN_cjs.__name(defineSchema, "defineSchema");
|
|
|
111
110
|
|
|
112
111
|
// src/schema/define-locale.ts
|
|
113
112
|
var BCP47_PATTERN = /^[a-z]{2}(-[A-Z]{2})?$/;
|
|
114
|
-
function defineLocale(
|
|
115
|
-
if (!BCP47_PATTERN.test(
|
|
113
|
+
function defineLocale(code2, options) {
|
|
114
|
+
if (!BCP47_PATTERN.test(code2)) {
|
|
116
115
|
throw new Error(
|
|
117
|
-
`Invalid locale code '${
|
|
116
|
+
`Invalid locale code '${code2}'. Expected BCP 47 format: 'xx' or 'xx-XX' (e.g., 'en', 'en-US', 'fr-FR')`
|
|
118
117
|
);
|
|
119
118
|
}
|
|
120
119
|
if (!options.displayName || options.displayName.trim().length === 0) {
|
|
121
|
-
throw new Error(`Locale '${
|
|
120
|
+
throw new Error(`Locale '${code2}' requires a displayName`);
|
|
122
121
|
}
|
|
123
122
|
if (options.fallback) {
|
|
124
123
|
for (const fallbackCode of options.fallback) {
|
|
125
124
|
if (typeof fallbackCode !== "string" || !BCP47_PATTERN.test(fallbackCode)) {
|
|
126
125
|
throw new Error(
|
|
127
|
-
`Invalid fallback locale code '${fallbackCode}' in locale '${
|
|
126
|
+
`Invalid fallback locale code '${fallbackCode}' in locale '${code2}'. Expected BCP 47 format.`
|
|
128
127
|
);
|
|
129
128
|
}
|
|
130
|
-
if (fallbackCode ===
|
|
131
|
-
throw new Error(`Locale '${
|
|
129
|
+
if (fallbackCode === code2) {
|
|
130
|
+
throw new Error(`Locale '${code2}' cannot reference itself in fallback chain`);
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
134
|
return {
|
|
136
135
|
_tag: "locale",
|
|
137
|
-
code,
|
|
136
|
+
code: code2,
|
|
138
137
|
displayName: options.displayName,
|
|
139
138
|
...options.default !== void 0 && { default: options.default },
|
|
140
139
|
...options.fallback !== void 0 && { fallback: options.fallback },
|
|
@@ -163,11 +162,11 @@ function buildFallbackChain(localeCode, locales, maxDepth = 10) {
|
|
|
163
162
|
const localeMap = new Map(locales.map((l) => [l.code, l]));
|
|
164
163
|
const chain = [];
|
|
165
164
|
const visited = /* @__PURE__ */ new Set();
|
|
166
|
-
function addFallbacks(
|
|
167
|
-
if (depth > maxDepth || visited.has(
|
|
168
|
-
const locale = localeMap.get(
|
|
165
|
+
function addFallbacks(code2, depth) {
|
|
166
|
+
if (depth > maxDepth || visited.has(code2)) return;
|
|
167
|
+
const locale = localeMap.get(code2);
|
|
169
168
|
if (!locale?.fallback) return;
|
|
170
|
-
visited.add(
|
|
169
|
+
visited.add(code2);
|
|
171
170
|
for (const fallbackCode of locale.fallback) {
|
|
172
171
|
if (!chain.includes(fallbackCode) && fallbackCode !== localeCode) {
|
|
173
172
|
chain.push(fallbackCode);
|
|
@@ -196,7 +195,7 @@ function fieldset(id, config) {
|
|
|
196
195
|
}
|
|
197
196
|
chunkMWMSFIWN_cjs.__name(fieldset, "fieldset");
|
|
198
197
|
function defineContentType(name, config) {
|
|
199
|
-
|
|
198
|
+
return {
|
|
200
199
|
_tag: "contentType",
|
|
201
200
|
name,
|
|
202
201
|
displayName: config.displayName,
|
|
@@ -208,21 +207,15 @@ function defineContentType(name, config) {
|
|
|
208
207
|
// definition from YAML and another from TypeScript, with a different schemaHash (REL-1458)
|
|
209
208
|
...config.hierarchical !== void 0 && { hierarchical: config.hierarchical },
|
|
210
209
|
...config.accessTags !== void 0 && { accessTags: config.accessTags },
|
|
211
|
-
...config.workflow !== void 0 && { workflow: config.workflow }
|
|
210
|
+
...config.workflow !== void 0 && { workflow: config.workflow },
|
|
211
|
+
fields: config.fields
|
|
212
212
|
};
|
|
213
|
-
if ("fields" in config && config.fields) {
|
|
214
|
-
return { ...base, fields: config.fields };
|
|
215
|
-
}
|
|
216
|
-
if ("fieldsets" in config && config.fieldsets) {
|
|
217
|
-
return { ...base, fieldsets: config.fieldsets };
|
|
218
|
-
}
|
|
219
|
-
throw new Error("Content type must have either fields or fieldsets");
|
|
220
213
|
}
|
|
221
214
|
chunkMWMSFIWN_cjs.__name(defineContentType, "defineContentType");
|
|
222
215
|
|
|
223
216
|
// src/schema/define-singleton.ts
|
|
224
217
|
function defineSingletonContentType(name, config) {
|
|
225
|
-
|
|
218
|
+
return {
|
|
226
219
|
_tag: "singletonContentType",
|
|
227
220
|
name,
|
|
228
221
|
displayName: config.displayName,
|
|
@@ -234,36 +227,13 @@ function defineSingletonContentType(name, config) {
|
|
|
234
227
|
...config.hierarchical !== void 0 && { hierarchical: config.hierarchical },
|
|
235
228
|
...config.accessTags !== void 0 && { accessTags: config.accessTags },
|
|
236
229
|
// Its config type took `workflow` and this dropped it, so a singleton's workflow never deployed
|
|
237
|
-
...config.workflow !== void 0 && { workflow: config.workflow }
|
|
230
|
+
...config.workflow !== void 0 && { workflow: config.workflow },
|
|
231
|
+
fields: config.fields
|
|
238
232
|
};
|
|
239
|
-
if ("fields" in config && config.fields) {
|
|
240
|
-
return { ...base, fields: config.fields };
|
|
241
|
-
}
|
|
242
|
-
if ("fieldsets" in config && config.fieldsets) {
|
|
243
|
-
return { ...base, fieldsets: config.fieldsets };
|
|
244
|
-
}
|
|
245
|
-
throw new Error("Singleton content type must have either fields or fieldsets");
|
|
246
233
|
}
|
|
247
234
|
chunkMWMSFIWN_cjs.__name(defineSingletonContentType, "defineSingletonContentType");
|
|
248
235
|
var defineSingleton = defineSingletonContentType;
|
|
249
236
|
|
|
250
|
-
// src/schema/define-component.ts
|
|
251
|
-
function defineComponent(name, config) {
|
|
252
|
-
return {
|
|
253
|
-
_tag: "component",
|
|
254
|
-
name,
|
|
255
|
-
displayName: config.displayName,
|
|
256
|
-
description: config.description,
|
|
257
|
-
ai: config.ai,
|
|
258
|
-
// Written only when given: `false` whenever not made a YAML and a TypeScript component two
|
|
259
|
-
// definitions (REL-1458)
|
|
260
|
-
...config.deprecated !== void 0 && { deprecated: config.deprecated },
|
|
261
|
-
fields: config.fields,
|
|
262
|
-
metadata: config.metadata
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
chunkMWMSFIWN_cjs.__name(defineComponent, "defineComponent");
|
|
266
|
-
|
|
267
237
|
// src/schema/define-settings-group.ts
|
|
268
238
|
function defineSettingsGroup(name, config) {
|
|
269
239
|
return {
|
|
@@ -289,7 +259,7 @@ function defineAssetType(name, config) {
|
|
|
289
259
|
`Asset type '${name}' declares multiple kind keys (${kindKeys.join(", ")}); exactly one is allowed`
|
|
290
260
|
);
|
|
291
261
|
}
|
|
292
|
-
|
|
262
|
+
return {
|
|
293
263
|
_tag: "assetType",
|
|
294
264
|
name,
|
|
295
265
|
displayName: config.displayName,
|
|
@@ -302,15 +272,9 @@ function defineAssetType(name, config) {
|
|
|
302
272
|
...config.workflow !== void 0 && { workflow: config.workflow },
|
|
303
273
|
...config.image !== void 0 && { image: config.image },
|
|
304
274
|
...config.video !== void 0 && { video: config.video },
|
|
305
|
-
...config.file !== void 0 && { file: config.file }
|
|
275
|
+
...config.file !== void 0 && { file: config.file },
|
|
276
|
+
...config.fields !== void 0 && { fields: config.fields }
|
|
306
277
|
};
|
|
307
|
-
if ("fields" in config && config.fields) {
|
|
308
|
-
return { ...base, fields: config.fields };
|
|
309
|
-
}
|
|
310
|
-
if ("fieldsets" in config && config.fieldsets) {
|
|
311
|
-
return { ...base, fieldsets: config.fieldsets };
|
|
312
|
-
}
|
|
313
|
-
return base;
|
|
314
278
|
}
|
|
315
279
|
chunkMWMSFIWN_cjs.__name(defineAssetType, "defineAssetType");
|
|
316
280
|
|
|
@@ -589,19 +553,22 @@ chunkMWMSFIWN_cjs.__name(defineQuery, "defineQuery");
|
|
|
589
553
|
var fields_exports = {};
|
|
590
554
|
chunkMWMSFIWN_cjs.__export(fields_exports, {
|
|
591
555
|
boolean: () => boolean,
|
|
592
|
-
|
|
556
|
+
code: () => code,
|
|
593
557
|
date: () => date,
|
|
594
558
|
dateTime: () => dateTime,
|
|
595
559
|
decimal: () => decimal,
|
|
596
560
|
email: () => email,
|
|
597
561
|
enum: () => enumField,
|
|
598
562
|
integer: () => integer,
|
|
563
|
+
json: () => json,
|
|
599
564
|
list: () => list,
|
|
600
565
|
longText: () => longText,
|
|
566
|
+
object: () => object,
|
|
601
567
|
reference: () => reference,
|
|
602
568
|
richText: () => richText,
|
|
603
569
|
shortText: () => shortText,
|
|
604
570
|
slug: () => slug,
|
|
571
|
+
table: () => table,
|
|
605
572
|
tags: () => tags,
|
|
606
573
|
url: () => url
|
|
607
574
|
});
|
|
@@ -634,6 +601,14 @@ function richText(id, options = {}) {
|
|
|
634
601
|
return createField(id, "richText", options);
|
|
635
602
|
}
|
|
636
603
|
chunkMWMSFIWN_cjs.__name(richText, "richText");
|
|
604
|
+
function table(id, options = {}) {
|
|
605
|
+
return createField(id, "table", options);
|
|
606
|
+
}
|
|
607
|
+
chunkMWMSFIWN_cjs.__name(table, "table");
|
|
608
|
+
function code(id, options = {}) {
|
|
609
|
+
return createField(id, "code", options);
|
|
610
|
+
}
|
|
611
|
+
chunkMWMSFIWN_cjs.__name(code, "code");
|
|
637
612
|
function slug(id, options = {}) {
|
|
638
613
|
return createField(id, "slug", options);
|
|
639
614
|
}
|
|
@@ -682,11 +657,14 @@ function list(id, options = {}) {
|
|
|
682
657
|
return createField(id, "list", options);
|
|
683
658
|
}
|
|
684
659
|
chunkMWMSFIWN_cjs.__name(list, "list");
|
|
685
|
-
function
|
|
686
|
-
|
|
687
|
-
|
|
660
|
+
function object(id, options) {
|
|
661
|
+
return createField(id, "object", options);
|
|
662
|
+
}
|
|
663
|
+
chunkMWMSFIWN_cjs.__name(object, "object");
|
|
664
|
+
function json(id, options = {}) {
|
|
665
|
+
return createField(id, "json", options);
|
|
688
666
|
}
|
|
689
|
-
chunkMWMSFIWN_cjs.__name(
|
|
667
|
+
chunkMWMSFIWN_cjs.__name(json, "json");
|
|
690
668
|
|
|
691
669
|
// src/schema/index.ts
|
|
692
670
|
var fields = fields_exports;
|
|
@@ -696,7 +674,6 @@ exports.BUILT_IN_ROLE_ACTIONS = BUILT_IN_ROLE_ACTIONS;
|
|
|
696
674
|
exports.ROLE_ACTIONS = ROLE_ACTIONS;
|
|
697
675
|
exports.buildFallbackChain = buildFallbackChain;
|
|
698
676
|
exports.defineAssetType = defineAssetType;
|
|
699
|
-
exports.defineComponent = defineComponent;
|
|
700
677
|
exports.defineContentType = defineContentType;
|
|
701
678
|
exports.defineContentTypeWorkflow = defineContentTypeWorkflow;
|
|
702
679
|
exports.defineLocale = defineLocale;
|
|
@@ -725,5 +702,5 @@ exports.isLocaleDefinition = isLocaleDefinition;
|
|
|
725
702
|
exports.isRoleDefinition = isRoleDefinition;
|
|
726
703
|
exports.isWorkflowDefinition = isWorkflowDefinition;
|
|
727
704
|
exports.isWorkflowStageDefinition = isWorkflowStageDefinition;
|
|
728
|
-
//# sourceMappingURL=chunk-
|
|
729
|
-
//# sourceMappingURL=chunk-
|
|
705
|
+
//# sourceMappingURL=chunk-FOSM4LMM.cjs.map
|
|
706
|
+
//# sourceMappingURL=chunk-FOSM4LMM.cjs.map
|