@prismicio/client 7.21.2 → 7.21.3-pr.431.23cc5c6
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/iac/customType.cjs +54 -0
- package/dist/iac/customType.cjs.map +1 -0
- package/dist/iac/customType.d.cts +43 -0
- package/dist/iac/customType.d.cts.map +1 -0
- package/dist/iac/customType.d.ts +43 -0
- package/dist/iac/customType.d.ts.map +1 -0
- package/dist/iac/customType.js +53 -0
- package/dist/iac/customType.js.map +1 -0
- package/dist/iac/fields/boolean.cjs +38 -0
- package/dist/iac/fields/boolean.cjs.map +1 -0
- package/dist/iac/fields/boolean.d.cts +22 -0
- package/dist/iac/fields/boolean.d.cts.map +1 -0
- package/dist/iac/fields/boolean.d.ts +22 -0
- package/dist/iac/fields/boolean.d.ts.map +1 -0
- package/dist/iac/fields/boolean.js +38 -0
- package/dist/iac/fields/boolean.js.map +1 -0
- package/dist/iac/fields/color.cjs +29 -0
- package/dist/iac/fields/color.cjs.map +1 -0
- package/dist/iac/fields/color.d.cts +11 -0
- package/dist/iac/fields/color.d.cts.map +1 -0
- package/dist/iac/fields/color.d.ts +11 -0
- package/dist/iac/fields/color.d.ts.map +1 -0
- package/dist/iac/fields/color.js +29 -0
- package/dist/iac/fields/color.js.map +1 -0
- package/dist/iac/fields/contentRelationship.cjs +50 -0
- package/dist/iac/fields/contentRelationship.cjs.map +1 -0
- package/dist/iac/fields/contentRelationship.d.cts +23 -0
- package/dist/iac/fields/contentRelationship.d.cts.map +1 -0
- package/dist/iac/fields/contentRelationship.d.ts +23 -0
- package/dist/iac/fields/contentRelationship.d.ts.map +1 -0
- package/dist/iac/fields/contentRelationship.js +50 -0
- package/dist/iac/fields/contentRelationship.js.map +1 -0
- package/dist/iac/fields/date.cjs +29 -0
- package/dist/iac/fields/date.cjs.map +1 -0
- package/dist/iac/fields/date.d.cts +11 -0
- package/dist/iac/fields/date.d.cts.map +1 -0
- package/dist/iac/fields/date.d.ts +11 -0
- package/dist/iac/fields/date.d.ts.map +1 -0
- package/dist/iac/fields/date.js +29 -0
- package/dist/iac/fields/date.js.map +1 -0
- package/dist/iac/fields/embed.cjs +29 -0
- package/dist/iac/fields/embed.cjs.map +1 -0
- package/dist/iac/fields/embed.d.cts +11 -0
- package/dist/iac/fields/embed.d.cts.map +1 -0
- package/dist/iac/fields/embed.d.ts +11 -0
- package/dist/iac/fields/embed.d.ts.map +1 -0
- package/dist/iac/fields/embed.js +29 -0
- package/dist/iac/fields/embed.js.map +1 -0
- package/dist/iac/fields/geoPoint.cjs +26 -0
- package/dist/iac/fields/geoPoint.cjs.map +1 -0
- package/dist/iac/fields/geoPoint.d.cts +10 -0
- package/dist/iac/fields/geoPoint.d.cts.map +1 -0
- package/dist/iac/fields/geoPoint.d.ts +10 -0
- package/dist/iac/fields/geoPoint.d.ts.map +1 -0
- package/dist/iac/fields/geoPoint.js +26 -0
- package/dist/iac/fields/geoPoint.js.map +1 -0
- package/dist/iac/fields/group.cjs +38 -0
- package/dist/iac/fields/group.cjs.map +1 -0
- package/dist/iac/fields/group.d.cts +17 -0
- package/dist/iac/fields/group.d.cts.map +1 -0
- package/dist/iac/fields/group.d.ts +17 -0
- package/dist/iac/fields/group.d.ts.map +1 -0
- package/dist/iac/fields/group.js +38 -0
- package/dist/iac/fields/group.js.map +1 -0
- package/dist/iac/fields/image.cjs +48 -0
- package/dist/iac/fields/image.cjs.map +1 -0
- package/dist/iac/fields/image.d.cts +21 -0
- package/dist/iac/fields/image.d.cts.map +1 -0
- package/dist/iac/fields/image.d.ts +21 -0
- package/dist/iac/fields/image.d.ts.map +1 -0
- package/dist/iac/fields/image.js +48 -0
- package/dist/iac/fields/image.js.map +1 -0
- package/dist/iac/fields/integration.cjs +33 -0
- package/dist/iac/fields/integration.cjs.map +1 -0
- package/dist/iac/fields/integration.d.cts +15 -0
- package/dist/iac/fields/integration.d.cts.map +1 -0
- package/dist/iac/fields/integration.d.ts +15 -0
- package/dist/iac/fields/integration.d.ts.map +1 -0
- package/dist/iac/fields/integration.js +33 -0
- package/dist/iac/fields/integration.js.map +1 -0
- package/dist/iac/fields/link.cjs +45 -0
- package/dist/iac/fields/link.cjs.map +1 -0
- package/dist/iac/fields/link.d.cts +39 -0
- package/dist/iac/fields/link.d.cts.map +1 -0
- package/dist/iac/fields/link.d.ts +39 -0
- package/dist/iac/fields/link.d.ts.map +1 -0
- package/dist/iac/fields/link.js +45 -0
- package/dist/iac/fields/link.js.map +1 -0
- package/dist/iac/fields/linkToMedia.cjs +31 -0
- package/dist/iac/fields/linkToMedia.cjs.map +1 -0
- package/dist/iac/fields/linkToMedia.d.cts +11 -0
- package/dist/iac/fields/linkToMedia.d.cts.map +1 -0
- package/dist/iac/fields/linkToMedia.d.ts +11 -0
- package/dist/iac/fields/linkToMedia.d.ts.map +1 -0
- package/dist/iac/fields/linkToMedia.js +31 -0
- package/dist/iac/fields/linkToMedia.js.map +1 -0
- package/dist/iac/fields/number.cjs +29 -0
- package/dist/iac/fields/number.cjs.map +1 -0
- package/dist/iac/fields/number.d.cts +11 -0
- package/dist/iac/fields/number.d.cts.map +1 -0
- package/dist/iac/fields/number.d.ts +11 -0
- package/dist/iac/fields/number.d.ts.map +1 -0
- package/dist/iac/fields/number.js +29 -0
- package/dist/iac/fields/number.js.map +1 -0
- package/dist/iac/fields/richText.cjs +49 -0
- package/dist/iac/fields/richText.cjs.map +1 -0
- package/dist/iac/fields/richText.d.cts +33 -0
- package/dist/iac/fields/richText.d.cts.map +1 -0
- package/dist/iac/fields/richText.d.ts +33 -0
- package/dist/iac/fields/richText.d.ts.map +1 -0
- package/dist/iac/fields/richText.js +49 -0
- package/dist/iac/fields/richText.js.map +1 -0
- package/dist/iac/fields/select.cjs +46 -0
- package/dist/iac/fields/select.cjs.map +1 -0
- package/dist/iac/fields/select.d.cts +15 -0
- package/dist/iac/fields/select.d.cts.map +1 -0
- package/dist/iac/fields/select.d.ts +15 -0
- package/dist/iac/fields/select.d.ts.map +1 -0
- package/dist/iac/fields/select.js +46 -0
- package/dist/iac/fields/select.js.map +1 -0
- package/dist/iac/fields/sliceZone.cjs +37 -0
- package/dist/iac/fields/sliceZone.cjs.map +1 -0
- package/dist/iac/fields/sliceZone.d.cts +30 -0
- package/dist/iac/fields/sliceZone.d.cts.map +1 -0
- package/dist/iac/fields/sliceZone.d.ts +30 -0
- package/dist/iac/fields/sliceZone.d.ts.map +1 -0
- package/dist/iac/fields/sliceZone.js +37 -0
- package/dist/iac/fields/sliceZone.js.map +1 -0
- package/dist/iac/fields/table.cjs +26 -0
- package/dist/iac/fields/table.cjs.map +1 -0
- package/dist/iac/fields/table.d.cts +10 -0
- package/dist/iac/fields/table.d.cts.map +1 -0
- package/dist/iac/fields/table.d.ts +10 -0
- package/dist/iac/fields/table.d.ts.map +1 -0
- package/dist/iac/fields/table.js +26 -0
- package/dist/iac/fields/table.js.map +1 -0
- package/dist/iac/fields/text.cjs +29 -0
- package/dist/iac/fields/text.cjs.map +1 -0
- package/dist/iac/fields/text.d.cts +11 -0
- package/dist/iac/fields/text.d.cts.map +1 -0
- package/dist/iac/fields/text.d.ts +11 -0
- package/dist/iac/fields/text.d.ts.map +1 -0
- package/dist/iac/fields/text.js +29 -0
- package/dist/iac/fields/text.js.map +1 -0
- package/dist/iac/fields/timestamp.cjs +29 -0
- package/dist/iac/fields/timestamp.cjs.map +1 -0
- package/dist/iac/fields/timestamp.d.cts +11 -0
- package/dist/iac/fields/timestamp.d.cts.map +1 -0
- package/dist/iac/fields/timestamp.d.ts +11 -0
- package/dist/iac/fields/timestamp.d.ts.map +1 -0
- package/dist/iac/fields/timestamp.js +29 -0
- package/dist/iac/fields/timestamp.js.map +1 -0
- package/dist/iac/fields/uid.cjs +29 -0
- package/dist/iac/fields/uid.cjs.map +1 -0
- package/dist/iac/fields/uid.d.cts +11 -0
- package/dist/iac/fields/uid.d.cts.map +1 -0
- package/dist/iac/fields/uid.d.ts +11 -0
- package/dist/iac/fields/uid.d.ts.map +1 -0
- package/dist/iac/fields/uid.js +29 -0
- package/dist/iac/fields/uid.js.map +1 -0
- package/dist/iac/sharedSlice.cjs +54 -0
- package/dist/iac/sharedSlice.cjs.map +1 -0
- package/dist/iac/sharedSlice.d.cts +28 -0
- package/dist/iac/sharedSlice.d.cts.map +1 -0
- package/dist/iac/sharedSlice.d.ts +28 -0
- package/dist/iac/sharedSlice.d.ts.map +1 -0
- package/dist/iac/sharedSlice.js +54 -0
- package/dist/iac/sharedSlice.js.map +1 -0
- package/dist/iac/variation.cjs +45 -0
- package/dist/iac/variation.cjs.map +1 -0
- package/dist/iac/variation.d.cts +46 -0
- package/dist/iac/variation.d.cts.map +1 -0
- package/dist/iac/variation.d.ts +46 -0
- package/dist/iac/variation.d.ts.map +1 -0
- package/dist/iac/variation.js +44 -0
- package/dist/iac/variation.js.map +1 -0
- package/dist/iac.cjs +86 -0
- package/dist/iac.cjs.map +1 -0
- package/dist/iac.d.cts +109 -0
- package/dist/iac.d.cts.map +1 -0
- package/dist/iac.d.ts +110 -0
- package/dist/iac.d.ts.map +1 -0
- package/dist/iac.js +86 -0
- package/dist/iac.js.map +1 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/types/model/types.d.cts +2 -2
- package/dist/types/model/types.d.ts +2 -2
- package/package.json +9 -2
- package/src/iac/customType.ts +98 -0
- package/src/iac/fields/boolean.ts +55 -0
- package/src/iac/fields/color.ts +33 -0
- package/src/iac/fields/contentRelationship.ts +74 -0
- package/src/iac/fields/date.ts +33 -0
- package/src/iac/fields/embed.ts +33 -0
- package/src/iac/fields/geoPoint.ts +33 -0
- package/src/iac/fields/group.ts +58 -0
- package/src/iac/fields/image.ts +65 -0
- package/src/iac/fields/index.ts +62 -0
- package/src/iac/fields/integration.ts +43 -0
- package/src/iac/fields/link.ts +79 -0
- package/src/iac/fields/linkToMedia.ts +37 -0
- package/src/iac/fields/number.ts +35 -0
- package/src/iac/fields/richText.ts +84 -0
- package/src/iac/fields/select.ts +63 -0
- package/src/iac/fields/sliceZone.ts +82 -0
- package/src/iac/fields/table.ts +31 -0
- package/src/iac/fields/text.ts +33 -0
- package/src/iac/fields/timestamp.ts +35 -0
- package/src/iac/fields/uid.ts +33 -0
- package/src/iac/index.ts +122 -0
- package/src/iac/sharedSlice.ts +81 -0
- package/src/iac/variation.ts +107 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/date.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a date field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.date({ label: "Publication Date" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns A date field model.
|
|
16
|
+
*/
|
|
17
|
+
const date = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: require_types.CustomTypeModelFieldType.Date,
|
|
20
|
+
config: {
|
|
21
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
22
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.date = date;
|
|
29
|
+
//# sourceMappingURL=date.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/date.ts"],"sourcesContent":["import type { CustomTypeModelDateField } from \"../../types/model/date\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a date field.\n */\nexport interface DateFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n}\n\n/**\n * Creates a date field model.\n *\n * @example\n *\n * ```ts\n * model.date({ label: \"Publication Date\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A date field model.\n */\nexport const date = (config?: DateFieldConfig): CustomTypeModelDateField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Date,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,QAAQ,WAAuD;AAC3E,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;EACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.cts","names":[],"sources":["../../../src/iac/fields/date.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,eAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","names":[],"sources":["../../../src/iac/fields/date.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,eAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/date.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a date field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.date({ label: "Publication Date" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns A date field model.
|
|
16
|
+
*/
|
|
17
|
+
const date = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: CustomTypeModelFieldType.Date,
|
|
20
|
+
config: {
|
|
21
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
22
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { date };
|
|
29
|
+
//# sourceMappingURL=date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.js","names":[],"sources":["../../../src/iac/fields/date.ts"],"sourcesContent":["import type { CustomTypeModelDateField } from \"../../types/model/date\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a date field.\n */\nexport interface DateFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n}\n\n/**\n * Creates a date field model.\n *\n * @example\n *\n * ```ts\n * model.date({ label: \"Publication Date\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A date field model.\n */\nexport const date = (config?: DateFieldConfig): CustomTypeModelDateField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Date,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,QAAQ,WAAuD;AAC3E,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;EACD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/embed.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates an embed field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.embed({ label: "Video" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns An embed field model.
|
|
16
|
+
*/
|
|
17
|
+
const embed = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: require_types.CustomTypeModelFieldType.Embed,
|
|
20
|
+
config: {
|
|
21
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
22
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.embed = embed;
|
|
29
|
+
//# sourceMappingURL=embed.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/embed.ts"],"sourcesContent":["import type { CustomTypeModelEmbedField } from \"../../types/model/embed\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for an embed field.\n */\nexport interface EmbedFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n}\n\n/**\n * Creates an embed field model.\n *\n * @example\n *\n * ```ts\n * model.embed({ label: \"Video\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns An embed field model.\n */\nexport const embed = (config?: EmbedFieldConfig): CustomTypeModelEmbedField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Embed,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,SAAS,WAAyD;AAC9E,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;EACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.d.cts","names":[],"sources":["../../../src/iac/fields/embed.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,gBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.d.ts","names":[],"sources":["../../../src/iac/fields/embed.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,gBAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/embed.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates an embed field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.embed({ label: "Video" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns An embed field model.
|
|
16
|
+
*/
|
|
17
|
+
const embed = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: CustomTypeModelFieldType.Embed,
|
|
20
|
+
config: {
|
|
21
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
22
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { embed };
|
|
29
|
+
//# sourceMappingURL=embed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.js","names":[],"sources":["../../../src/iac/fields/embed.ts"],"sourcesContent":["import type { CustomTypeModelEmbedField } from \"../../types/model/embed\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for an embed field.\n */\nexport interface EmbedFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n}\n\n/**\n * Creates an embed field model.\n *\n * @example\n *\n * ```ts\n * model.embed({ label: \"Video\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns An embed field model.\n */\nexport const embed = (config?: EmbedFieldConfig): CustomTypeModelEmbedField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Embed,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,SAAS,WAAyD;AAC9E,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;EACD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/geoPoint.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a geo point field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.geoPoint({ label: "Location" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns A geo point field model.
|
|
16
|
+
*/
|
|
17
|
+
const geoPoint = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: require_types.CustomTypeModelFieldType.GeoPoint,
|
|
20
|
+
config: { label: (config === null || config === void 0 ? void 0 : config.label) ?? null }
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.geoPoint = geoPoint;
|
|
26
|
+
//# sourceMappingURL=geoPoint.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geoPoint.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/geoPoint.ts"],"sourcesContent":["import type { CustomTypeModelGeoPointField } from \"../../types/model/geoPoint\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a geo point field.\n */\nexport interface GeoPointFieldConfig {\n\tlabel?: string | null\n}\n\n/**\n * Creates a geo point field model.\n *\n * @example\n *\n * ```ts\n * model.geoPoint({ label: \"Location\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A geo point field model.\n */\nexport const geoPoint = (\n\tconfig?: GeoPointFieldConfig,\n): CustomTypeModelGeoPointField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.GeoPoint,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,MAAa,YACZ,WACkC;AAClC,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ,EACP,wDAAO,OAAQ,UAAS,MACxB;EACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geoPoint.d.cts","names":[],"sources":["../../../src/iac/fields/geoPoint.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,mBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geoPoint.d.ts","names":[],"sources":["../../../src/iac/fields/geoPoint.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,mBAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/geoPoint.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a geo point field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.geoPoint({ label: "Location" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns A geo point field model.
|
|
16
|
+
*/
|
|
17
|
+
const geoPoint = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: CustomTypeModelFieldType.GeoPoint,
|
|
20
|
+
config: { label: (config === null || config === void 0 ? void 0 : config.label) ?? null }
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { geoPoint };
|
|
26
|
+
//# sourceMappingURL=geoPoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geoPoint.js","names":[],"sources":["../../../src/iac/fields/geoPoint.ts"],"sourcesContent":["import type { CustomTypeModelGeoPointField } from \"../../types/model/geoPoint\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a geo point field.\n */\nexport interface GeoPointFieldConfig {\n\tlabel?: string | null\n}\n\n/**\n * Creates a geo point field model.\n *\n * @example\n *\n * ```ts\n * model.geoPoint({ label: \"Location\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A geo point field model.\n */\nexport const geoPoint = (\n\tconfig?: GeoPointFieldConfig,\n): CustomTypeModelGeoPointField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.GeoPoint,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,MAAa,YACZ,WACkC;AAClC,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ,EACP,wDAAO,OAAQ,UAAS,MACxB;EACD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/group.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a group field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.group({
|
|
11
|
+
* label: "Items",
|
|
12
|
+
* fields: {
|
|
13
|
+
* title: model.text({ label: "Title" }),
|
|
14
|
+
* image: model.image({ label: "Image" }),
|
|
15
|
+
* link: model.link({ label: "Link" })
|
|
16
|
+
* }
|
|
17
|
+
* })
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @typeParam Fields - Field definitions for type inference.
|
|
21
|
+
*
|
|
22
|
+
* @param config - Configuration for the field.
|
|
23
|
+
*
|
|
24
|
+
* @returns A group field model.
|
|
25
|
+
*/
|
|
26
|
+
const group = (config) => {
|
|
27
|
+
return {
|
|
28
|
+
type: require_types.CustomTypeModelFieldType.Group,
|
|
29
|
+
config: {
|
|
30
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
31
|
+
fields: config === null || config === void 0 ? void 0 : config.fields
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
exports.group = group;
|
|
38
|
+
//# sourceMappingURL=group.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/group.ts"],"sourcesContent":["import type { CustomTypeModelGroupField } from \"../../types/model/group\"\nimport type { CustomTypeModelFieldForGroup } from \"../../types/model/types\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a group field.\n */\nexport interface GroupFieldConfig<\n\tFields extends Record<string, CustomTypeModelFieldForGroup> = Record<\n\t\tstring,\n\t\tCustomTypeModelFieldForGroup\n\t>,\n> {\n\tlabel?: string | null\n\t/**\n\t * Fields within the group.\n\t */\n\tfields?: Fields\n}\n\n/**\n * Creates a group field model.\n *\n * @example\n *\n * ```ts\n * model.group({\n * label: \"Items\",\n * fields: {\n * title: model.text({ label: \"Title\" }),\n * image: model.image({ label: \"Image\" }),\n * link: model.link({ label: \"Link\" })\n * }\n * })\n * ```\n *\n * @typeParam Fields - Field definitions for type inference.\n *\n * @param config - Configuration for the field.\n *\n * @returns A group field model.\n */\nexport const group = <\n\tFields extends Record<string, CustomTypeModelFieldForGroup> = Record<\n\t\tstring,\n\t\tCustomTypeModelFieldForGroup\n\t>,\n>(\n\tconfig?: GroupFieldConfig<Fields>,\n): CustomTypeModelGroupField<Fields> => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Group,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tfields: config?.fields,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,SAMZ,WACuC;AACvC,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,wDAAQ,OAAQ;GAChB;EACD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CustomTypeModelFieldForGroup } from "../../types/model/types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/group.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for a group field.
|
|
7
|
+
*/
|
|
8
|
+
interface GroupFieldConfig<Fields extends Record<string, CustomTypeModelFieldForGroup> = Record<string, CustomTypeModelFieldForGroup>> {
|
|
9
|
+
label?: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Fields within the group.
|
|
12
|
+
*/
|
|
13
|
+
fields?: Fields;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { GroupFieldConfig };
|
|
17
|
+
//# sourceMappingURL=group.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.d.cts","names":[],"sources":["../../../src/iac/fields/group.ts"],"sourcesContent":[],"mappings":";;;;;AAOA;;AACgB,UADC,gBACD,CAAA,eAAA,MAAA,CAAA,MAAA,EAAe,4BAAf,CAAA,GAA+C,MAA/C,CAAA,MAAA,EAEd,4BAFc,CAAA,CAAA,CAAA;EAEd,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EAF6D;;;WASrD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CustomTypeModelFieldForGroup } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/group.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for a group field.
|
|
7
|
+
*/
|
|
8
|
+
interface GroupFieldConfig<Fields extends Record<string, CustomTypeModelFieldForGroup> = Record<string, CustomTypeModelFieldForGroup>> {
|
|
9
|
+
label?: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Fields within the group.
|
|
12
|
+
*/
|
|
13
|
+
fields?: Fields;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { GroupFieldConfig };
|
|
17
|
+
//# sourceMappingURL=group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.d.ts","names":[],"sources":["../../../src/iac/fields/group.ts"],"sourcesContent":[],"mappings":";;;;;AAOA;;AACgB,UADC,gBACD,CAAA,eAAA,MAAA,CAAA,MAAA,EAAe,4BAAf,CAAA,GAA+C,MAA/C,CAAA,MAAA,EAEd,4BAFc,CAAA,CAAA,CAAA;EAEd,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EAF6D;;;WASrD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/group.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a group field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.group({
|
|
11
|
+
* label: "Items",
|
|
12
|
+
* fields: {
|
|
13
|
+
* title: model.text({ label: "Title" }),
|
|
14
|
+
* image: model.image({ label: "Image" }),
|
|
15
|
+
* link: model.link({ label: "Link" })
|
|
16
|
+
* }
|
|
17
|
+
* })
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @typeParam Fields - Field definitions for type inference.
|
|
21
|
+
*
|
|
22
|
+
* @param config - Configuration for the field.
|
|
23
|
+
*
|
|
24
|
+
* @returns A group field model.
|
|
25
|
+
*/
|
|
26
|
+
const group = (config) => {
|
|
27
|
+
return {
|
|
28
|
+
type: CustomTypeModelFieldType.Group,
|
|
29
|
+
config: {
|
|
30
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
31
|
+
fields: config === null || config === void 0 ? void 0 : config.fields
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { group };
|
|
38
|
+
//# sourceMappingURL=group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.js","names":[],"sources":["../../../src/iac/fields/group.ts"],"sourcesContent":["import type { CustomTypeModelGroupField } from \"../../types/model/group\"\nimport type { CustomTypeModelFieldForGroup } from \"../../types/model/types\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a group field.\n */\nexport interface GroupFieldConfig<\n\tFields extends Record<string, CustomTypeModelFieldForGroup> = Record<\n\t\tstring,\n\t\tCustomTypeModelFieldForGroup\n\t>,\n> {\n\tlabel?: string | null\n\t/**\n\t * Fields within the group.\n\t */\n\tfields?: Fields\n}\n\n/**\n * Creates a group field model.\n *\n * @example\n *\n * ```ts\n * model.group({\n * label: \"Items\",\n * fields: {\n * title: model.text({ label: \"Title\" }),\n * image: model.image({ label: \"Image\" }),\n * link: model.link({ label: \"Link\" })\n * }\n * })\n * ```\n *\n * @typeParam Fields - Field definitions for type inference.\n *\n * @param config - Configuration for the field.\n *\n * @returns A group field model.\n */\nexport const group = <\n\tFields extends Record<string, CustomTypeModelFieldForGroup> = Record<\n\t\tstring,\n\t\tCustomTypeModelFieldForGroup\n\t>,\n>(\n\tconfig?: GroupFieldConfig<Fields>,\n): CustomTypeModelGroupField<Fields> => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Group,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tfields: config?.fields,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,SAMZ,WACuC;AACvC,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,wDAAQ,OAAQ;GAChB;EACD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/image.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates an image field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Simple image
|
|
11
|
+
* model.image({ label: "Hero Image" })
|
|
12
|
+
*
|
|
13
|
+
* // With constraints
|
|
14
|
+
* model.image({
|
|
15
|
+
* label: "Banner",
|
|
16
|
+
* constraint: { width: 1920, height: 1080 }
|
|
17
|
+
* })
|
|
18
|
+
*
|
|
19
|
+
* // With thumbnails (type-safe names)
|
|
20
|
+
* model.image({
|
|
21
|
+
* label: "Photo",
|
|
22
|
+
* thumbnails: [
|
|
23
|
+
* { name: "mobile", width: 640, height: 360 },
|
|
24
|
+
* { name: "tablet", width: 1024, height: 576 }
|
|
25
|
+
* ] as const
|
|
26
|
+
* })
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @typeParam ThumbnailNames - Thumbnail name literals for type inference.
|
|
30
|
+
*
|
|
31
|
+
* @param config - Configuration for the field.
|
|
32
|
+
*
|
|
33
|
+
* @returns An image field model.
|
|
34
|
+
*/
|
|
35
|
+
const image = (config) => {
|
|
36
|
+
return {
|
|
37
|
+
type: require_types.CustomTypeModelFieldType.Image,
|
|
38
|
+
config: {
|
|
39
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
40
|
+
constraint: config === null || config === void 0 ? void 0 : config.constraint,
|
|
41
|
+
thumbnails: config === null || config === void 0 ? void 0 : config.thumbnails
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
exports.image = image;
|
|
48
|
+
//# sourceMappingURL=image.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/image.ts"],"sourcesContent":["import type {\n\tCustomTypeModelImageConstraint,\n\tCustomTypeModelImageField,\n\tCustomTypeModelImageThumbnail,\n} from \"../../types/model/image\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for an image field.\n */\nexport interface ImageFieldConfig<ThumbnailNames extends string = string> {\n\tlabel?: string | null\n\t/**\n\t * Dimension constraints for the image.\n\t */\n\tconstraint?: CustomTypeModelImageConstraint\n\t/**\n\t * Thumbnails (responsive views) for the image.\n\t */\n\tthumbnails?: readonly CustomTypeModelImageThumbnail<ThumbnailNames>[]\n}\n\n/**\n * Creates an image field model.\n *\n * @example\n *\n * ```ts\n * // Simple image\n * model.image({ label: \"Hero Image\" })\n *\n * // With constraints\n * model.image({\n * label: \"Banner\",\n * constraint: { width: 1920, height: 1080 }\n * })\n *\n * // With thumbnails (type-safe names)\n * model.image({\n * label: \"Photo\",\n * thumbnails: [\n * { name: \"mobile\", width: 640, height: 360 },\n * { name: \"tablet\", width: 1024, height: 576 }\n * ] as const\n * })\n * ```\n *\n * @typeParam ThumbnailNames - Thumbnail name literals for type inference.\n *\n * @param config - Configuration for the field.\n *\n * @returns An image field model.\n */\nexport const image = <ThumbnailNames extends string = string>(\n\tconfig?: ImageFieldConfig<ThumbnailNames>,\n): CustomTypeModelImageField<ThumbnailNames> => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Image,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tconstraint: config?.constraint,\n\t\t\tthumbnails: config?.thumbnails,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAa,SACZ,WAC+C;AAC/C,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,4DAAY,OAAQ;GACpB,4DAAY,OAAQ;GACpB;EACD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CustomTypeModelImageConstraint, CustomTypeModelImageThumbnail } from "../../types/model/image.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/image.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for an image field.
|
|
7
|
+
*/
|
|
8
|
+
interface ImageFieldConfig<ThumbnailNames extends string = string> {
|
|
9
|
+
label?: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Dimension constraints for the image.
|
|
12
|
+
*/
|
|
13
|
+
constraint?: CustomTypeModelImageConstraint;
|
|
14
|
+
/**
|
|
15
|
+
* Thumbnails (responsive views) for the image.
|
|
16
|
+
*/
|
|
17
|
+
thumbnails?: readonly CustomTypeModelImageThumbnail<ThumbnailNames>[];
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ImageFieldConfig };
|
|
21
|
+
//# sourceMappingURL=image.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.cts","names":[],"sources":["../../../src/iac/fields/image.ts"],"sourcesContent":[],"mappings":";;;;;;AAUA;AAKc,UALG,gBAKH,CAAA,uBAAA,MAAA,GAAA,MAAA,CAAA,CAAA;EAIuC,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EAA9B;;;eAJT;;;;wBAIS,8BAA8B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CustomTypeModelImageConstraint, CustomTypeModelImageThumbnail } from "../../types/model/image.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/image.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for an image field.
|
|
7
|
+
*/
|
|
8
|
+
interface ImageFieldConfig<ThumbnailNames extends string = string> {
|
|
9
|
+
label?: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Dimension constraints for the image.
|
|
12
|
+
*/
|
|
13
|
+
constraint?: CustomTypeModelImageConstraint;
|
|
14
|
+
/**
|
|
15
|
+
* Thumbnails (responsive views) for the image.
|
|
16
|
+
*/
|
|
17
|
+
thumbnails?: readonly CustomTypeModelImageThumbnail<ThumbnailNames>[];
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ImageFieldConfig };
|
|
21
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","names":[],"sources":["../../../src/iac/fields/image.ts"],"sourcesContent":[],"mappings":";;;;;;AAUA;AAKc,UALG,gBAKH,CAAA,uBAAA,MAAA,GAAA,MAAA,CAAA,CAAA;EAIuC,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EAA9B;;;eAJT;;;;wBAIS,8BAA8B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/image.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates an image field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Simple image
|
|
11
|
+
* model.image({ label: "Hero Image" })
|
|
12
|
+
*
|
|
13
|
+
* // With constraints
|
|
14
|
+
* model.image({
|
|
15
|
+
* label: "Banner",
|
|
16
|
+
* constraint: { width: 1920, height: 1080 }
|
|
17
|
+
* })
|
|
18
|
+
*
|
|
19
|
+
* // With thumbnails (type-safe names)
|
|
20
|
+
* model.image({
|
|
21
|
+
* label: "Photo",
|
|
22
|
+
* thumbnails: [
|
|
23
|
+
* { name: "mobile", width: 640, height: 360 },
|
|
24
|
+
* { name: "tablet", width: 1024, height: 576 }
|
|
25
|
+
* ] as const
|
|
26
|
+
* })
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @typeParam ThumbnailNames - Thumbnail name literals for type inference.
|
|
30
|
+
*
|
|
31
|
+
* @param config - Configuration for the field.
|
|
32
|
+
*
|
|
33
|
+
* @returns An image field model.
|
|
34
|
+
*/
|
|
35
|
+
const image = (config) => {
|
|
36
|
+
return {
|
|
37
|
+
type: CustomTypeModelFieldType.Image,
|
|
38
|
+
config: {
|
|
39
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
40
|
+
constraint: config === null || config === void 0 ? void 0 : config.constraint,
|
|
41
|
+
thumbnails: config === null || config === void 0 ? void 0 : config.thumbnails
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { image };
|
|
48
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","names":[],"sources":["../../../src/iac/fields/image.ts"],"sourcesContent":["import type {\n\tCustomTypeModelImageConstraint,\n\tCustomTypeModelImageField,\n\tCustomTypeModelImageThumbnail,\n} from \"../../types/model/image\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for an image field.\n */\nexport interface ImageFieldConfig<ThumbnailNames extends string = string> {\n\tlabel?: string | null\n\t/**\n\t * Dimension constraints for the image.\n\t */\n\tconstraint?: CustomTypeModelImageConstraint\n\t/**\n\t * Thumbnails (responsive views) for the image.\n\t */\n\tthumbnails?: readonly CustomTypeModelImageThumbnail<ThumbnailNames>[]\n}\n\n/**\n * Creates an image field model.\n *\n * @example\n *\n * ```ts\n * // Simple image\n * model.image({ label: \"Hero Image\" })\n *\n * // With constraints\n * model.image({\n * label: \"Banner\",\n * constraint: { width: 1920, height: 1080 }\n * })\n *\n * // With thumbnails (type-safe names)\n * model.image({\n * label: \"Photo\",\n * thumbnails: [\n * { name: \"mobile\", width: 640, height: 360 },\n * { name: \"tablet\", width: 1024, height: 576 }\n * ] as const\n * })\n * ```\n *\n * @typeParam ThumbnailNames - Thumbnail name literals for type inference.\n *\n * @param config - Configuration for the field.\n *\n * @returns An image field model.\n */\nexport const image = <ThumbnailNames extends string = string>(\n\tconfig?: ImageFieldConfig<ThumbnailNames>,\n): CustomTypeModelImageField<ThumbnailNames> => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Image,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tconstraint: config?.constraint,\n\t\t\tthumbnails: config?.thumbnails,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAa,SACZ,WAC+C;AAC/C,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,4DAAY,OAAQ;GACpB,4DAAY,OAAQ;GACpB;EACD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/integration.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates an integration field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.integration({
|
|
11
|
+
* label: "Product",
|
|
12
|
+
* catalog: "my-catalog-id"
|
|
13
|
+
* })
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param config - Configuration for the field.
|
|
17
|
+
*
|
|
18
|
+
* @returns An integration field model.
|
|
19
|
+
*/
|
|
20
|
+
const integration = (config) => {
|
|
21
|
+
return {
|
|
22
|
+
type: require_types.CustomTypeModelFieldType.Integration,
|
|
23
|
+
config: {
|
|
24
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
25
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder,
|
|
26
|
+
catalog: config === null || config === void 0 ? void 0 : config.catalog
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.integration = integration;
|
|
33
|
+
//# sourceMappingURL=integration.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/integration.ts"],"sourcesContent":["import type { CustomTypeModelIntegrationField } from \"../../types/model/integration\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for an integration field.\n */\nexport interface IntegrationFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n\t/**\n\t * The catalog ID for the integration.\n\t */\n\tcatalog?: string\n}\n\n/**\n * Creates an integration field model.\n *\n * @example\n *\n * ```ts\n * model.integration({\n * label: \"Product\",\n * catalog: \"my-catalog-id\"\n * })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns An integration field model.\n */\nexport const integration = (\n\tconfig?: IntegrationFieldConfig,\n): CustomTypeModelIntegrationField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Integration,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t\tcatalog: config?.catalog,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,MAAa,eACZ,WACqC;AACrC,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB,yDAAS,OAAQ;GACjB;EACD"}
|