@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
package/dist/iac.d.cts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { CustomTypeModelColorField } from "./types/model/color.cjs";
|
|
2
|
+
import { CustomTypeModelLinkField } from "./types/model/link.cjs";
|
|
3
|
+
import { CustomTypeModelContentRelationshipField } from "./types/model/contentRelationship.cjs";
|
|
4
|
+
import { CustomTypeModelDateField } from "./types/model/date.cjs";
|
|
5
|
+
import { CustomTypeModelEmbedField } from "./types/model/embed.cjs";
|
|
6
|
+
import { CustomTypeModelGeoPointField } from "./types/model/geoPoint.cjs";
|
|
7
|
+
import { CustomTypeModelGroupField } from "./types/model/group.cjs";
|
|
8
|
+
import { CustomTypeModelImageField } from "./types/model/image.cjs";
|
|
9
|
+
import { CustomTypeModelIntegrationField } from "./types/model/integration.cjs";
|
|
10
|
+
import { CustomTypeModelKeyTextField } from "./types/model/keyText.cjs";
|
|
11
|
+
import { CustomTypeModelLinkToMediaField } from "./types/model/linkToMedia.cjs";
|
|
12
|
+
import { CustomTypeModelNumberField } from "./types/model/number.cjs";
|
|
13
|
+
import { CustomTypeModelRichTextField } from "./types/model/richText.cjs";
|
|
14
|
+
import { CustomTypeModelSelectField } from "./types/model/select.cjs";
|
|
15
|
+
import { CustomTypeModelLegacySlice, CustomTypeModelSlice } from "./types/model/slice.cjs";
|
|
16
|
+
import { CustomTypeModelSharedSlice, CustomTypeModelSliceZoneField } from "./types/model/sliceZone.cjs";
|
|
17
|
+
import { CustomTypeModelTableField } from "./types/model/table.cjs";
|
|
18
|
+
import { CustomTypeModelTimestampField } from "./types/model/timestamp.cjs";
|
|
19
|
+
import { CustomTypeModelUIDField } from "./types/model/uid.cjs";
|
|
20
|
+
import { CustomTypeModelFieldForGroup, CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldForSlicePrimary } from "./types/model/types.cjs";
|
|
21
|
+
import { CustomTypeModelBooleanField } from "./types/model/boolean.cjs";
|
|
22
|
+
import { BooleanFieldConfig } from "./iac/fields/boolean.cjs";
|
|
23
|
+
import { CustomTypeModel, CustomTypeModelDefinition } from "./types/model/customType.cjs";
|
|
24
|
+
import { SharedSliceModelVariation } from "./types/model/sharedSliceVariation.cjs";
|
|
25
|
+
import { SharedSliceModel } from "./types/model/sharedSlice.cjs";
|
|
26
|
+
import { ColorFieldConfig } from "./iac/fields/color.cjs";
|
|
27
|
+
import { DateFieldConfig } from "./iac/fields/date.cjs";
|
|
28
|
+
import { TimestampFieldConfig } from "./iac/fields/timestamp.cjs";
|
|
29
|
+
import { NumberFieldConfig } from "./iac/fields/number.cjs";
|
|
30
|
+
import { GeoPointFieldConfig } from "./iac/fields/geoPoint.cjs";
|
|
31
|
+
import { EmbedFieldConfig } from "./iac/fields/embed.cjs";
|
|
32
|
+
import { TableFieldConfig } from "./iac/fields/table.cjs";
|
|
33
|
+
import { TextFieldConfig } from "./iac/fields/text.cjs";
|
|
34
|
+
import { RichTextFieldConfig } from "./iac/fields/richText.cjs";
|
|
35
|
+
import { ImageFieldConfig } from "./iac/fields/image.cjs";
|
|
36
|
+
import { LinkToMediaFieldConfig } from "./iac/fields/linkToMedia.cjs";
|
|
37
|
+
import { LinkFieldConfig } from "./iac/fields/link.cjs";
|
|
38
|
+
import { ContentRelationshipFieldConfig } from "./iac/fields/contentRelationship.cjs";
|
|
39
|
+
import { SelectFieldConfig } from "./iac/fields/select.cjs";
|
|
40
|
+
import { UIDFieldConfig } from "./iac/fields/uid.cjs";
|
|
41
|
+
import { IntegrationFieldConfig } from "./iac/fields/integration.cjs";
|
|
42
|
+
import { GroupFieldConfig } from "./iac/fields/group.cjs";
|
|
43
|
+
import { SliceZoneFieldConfig } from "./iac/fields/sliceZone.cjs";
|
|
44
|
+
import { CustomTypeConfig } from "./iac/customType.cjs";
|
|
45
|
+
import { SharedSliceConfig } from "./iac/sharedSlice.cjs";
|
|
46
|
+
import { VariationConfig } from "./iac/variation.cjs";
|
|
47
|
+
|
|
48
|
+
//#region src/iac/index.d.ts
|
|
49
|
+
/**
|
|
50
|
+
* Infrastructure as Code (IaC) factories for Prismic models.
|
|
51
|
+
*
|
|
52
|
+
* Provides type-safe factory functions to programmatically create
|
|
53
|
+
* Custom Types and Shared Slices.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* import { model } from "@prismicio/client/iac"
|
|
59
|
+
*
|
|
60
|
+
* const blogPost = model.customType({
|
|
61
|
+
* id: "blog_post",
|
|
62
|
+
* label: "Blog Post",
|
|
63
|
+
* repeatable: true,
|
|
64
|
+
* json: {
|
|
65
|
+
* Main: {
|
|
66
|
+
* uid: model.uid({ label: "UID" }),
|
|
67
|
+
* title: model.richText({ label: "Title", single: "heading1" }),
|
|
68
|
+
* body: model.sliceZone({
|
|
69
|
+
* choices: {
|
|
70
|
+
* hero: { type: "SharedSlice" }
|
|
71
|
+
* }
|
|
72
|
+
* })
|
|
73
|
+
* }
|
|
74
|
+
* }
|
|
75
|
+
* })
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
/**
|
|
79
|
+
* Model factory namespace.
|
|
80
|
+
*
|
|
81
|
+
* Contains all factory functions for creating Prismic model definitions.
|
|
82
|
+
*/
|
|
83
|
+
declare const model: {
|
|
84
|
+
readonly boolean: (config?: BooleanFieldConfig) => CustomTypeModelBooleanField;
|
|
85
|
+
readonly color: (config?: ColorFieldConfig) => CustomTypeModelColorField;
|
|
86
|
+
readonly date: (config?: DateFieldConfig) => CustomTypeModelDateField;
|
|
87
|
+
readonly timestamp: (config?: TimestampFieldConfig) => CustomTypeModelTimestampField;
|
|
88
|
+
readonly number: (config?: NumberFieldConfig) => CustomTypeModelNumberField;
|
|
89
|
+
readonly geoPoint: (config?: GeoPointFieldConfig) => CustomTypeModelGeoPointField;
|
|
90
|
+
readonly embed: (config?: EmbedFieldConfig) => CustomTypeModelEmbedField;
|
|
91
|
+
readonly table: (config?: TableFieldConfig) => CustomTypeModelTableField;
|
|
92
|
+
readonly text: (config?: TextFieldConfig) => CustomTypeModelKeyTextField;
|
|
93
|
+
readonly richText: (config?: RichTextFieldConfig) => CustomTypeModelRichTextField;
|
|
94
|
+
readonly image: <ThumbnailNames extends string = string>(config?: ImageFieldConfig<ThumbnailNames>) => CustomTypeModelImageField<ThumbnailNames>;
|
|
95
|
+
readonly linkToMedia: (config?: LinkToMediaFieldConfig) => CustomTypeModelLinkToMediaField;
|
|
96
|
+
readonly link: (config?: LinkFieldConfig) => CustomTypeModelLinkField;
|
|
97
|
+
readonly contentRelationship: <CustomTypes extends string = string, Tags extends string = string>(config?: ContentRelationshipFieldConfig<CustomTypes, Tags>) => CustomTypeModelContentRelationshipField<CustomTypes, Tags>;
|
|
98
|
+
readonly select: <Option extends string, DefaultValue extends Option = Option>(options: readonly Option[], config?: SelectFieldConfig<Option, DefaultValue>) => CustomTypeModelSelectField<Option, DefaultValue>;
|
|
99
|
+
readonly uid: (config?: UIDFieldConfig) => CustomTypeModelUIDField;
|
|
100
|
+
readonly integration: (config?: IntegrationFieldConfig) => CustomTypeModelIntegrationField;
|
|
101
|
+
readonly group: <Fields extends Record<string, CustomTypeModelFieldForGroup> = Record<string, CustomTypeModelFieldForGroup>>(config?: GroupFieldConfig<Fields>) => CustomTypeModelGroupField<Fields>;
|
|
102
|
+
readonly sliceZone: <Slices extends Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice> = Record<string, CustomTypeModelSlice<Record<string, CustomTypeModelFieldForNestedGroup>, Record<string, CustomTypeModelFieldForNestedGroup>> | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice>>(config?: SliceZoneFieldConfig<Slices>) => CustomTypeModelSliceZoneField<Slices>;
|
|
103
|
+
readonly customType: <ID extends string, Definition extends CustomTypeModelDefinition>(config: CustomTypeConfig<ID, Definition>) => CustomTypeModel<ID, Definition>;
|
|
104
|
+
readonly sharedSlice: <ID extends string, Variation extends SharedSliceModelVariation>(config: SharedSliceConfig<ID, Variation>) => SharedSliceModel<ID, Variation>;
|
|
105
|
+
readonly variation: <ID extends string, PrimaryFields extends Record<string, CustomTypeModelFieldForSlicePrimary> = Record<string, CustomTypeModelFieldForSlicePrimary>, ItemFields extends Record<string, CustomTypeModelFieldForNestedGroup> = Record<string, CustomTypeModelFieldForNestedGroup>>(config: VariationConfig<ID, PrimaryFields, ItemFields>) => SharedSliceModelVariation<ID, PrimaryFields, ItemFields>;
|
|
106
|
+
};
|
|
107
|
+
//#endregion
|
|
108
|
+
export { type BooleanFieldConfig, type ColorFieldConfig, type ContentRelationshipFieldConfig, type CustomTypeConfig, type DateFieldConfig, type EmbedFieldConfig, type GeoPointFieldConfig, type GroupFieldConfig, type ImageFieldConfig, type IntegrationFieldConfig, type LinkFieldConfig, type LinkToMediaFieldConfig, type NumberFieldConfig, type RichTextFieldConfig, type SelectFieldConfig, type SharedSliceConfig, type SliceZoneFieldConfig, type TableFieldConfig, type TextFieldConfig, type TimestampFieldConfig, type UIDFieldConfig, type VariationConfig, model };
|
|
109
|
+
//# sourceMappingURL=iac.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iac.d.cts","names":[],"sources":["../src/iac/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6Da;8BAoCH;;;;;;;;;;;;;EApCG,SAoCH,mBAAA,EAAA,CAAA,oBAAA,MAAA,GAAA,MAAA,EAAA,aAAA,MAAA,GAAA,MAAA,CAAA,CAAA,MAAA,CAAA,gCAAA,YAAA,MAAA,CAAA,EAAA,0CAAA,YAAA,MAAA,CAAA;EAAA,SAAA,MAAA,EAAA,CAAA,eAAA,MAAA,EAAA,2BAAA,SAAA,CAAA,CAAA,OAAA,EAAA,eAAA,EAAA,EAAA,MAAA,CAAA,mBAAA,OAAA,cAAA,CAAA,EAAA,6BAAA,OAAA,cAAA,CAAA"}
|
package/dist/iac.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { CustomTypeModelColorField } from "./types/model/color.js";
|
|
2
|
+
import { CustomTypeModelLinkField } from "./types/model/link.js";
|
|
3
|
+
import { CustomTypeModelContentRelationshipField } from "./types/model/contentRelationship.js";
|
|
4
|
+
import { CustomTypeModelDateField } from "./types/model/date.js";
|
|
5
|
+
import { CustomTypeModelEmbedField } from "./types/model/embed.js";
|
|
6
|
+
import { CustomTypeModelGeoPointField } from "./types/model/geoPoint.js";
|
|
7
|
+
import { CustomTypeModelGroupField } from "./types/model/group.js";
|
|
8
|
+
import { CustomTypeModelImageField } from "./types/model/image.js";
|
|
9
|
+
import { CustomTypeModelIntegrationField } from "./types/model/integration.js";
|
|
10
|
+
import { CustomTypeModelKeyTextField } from "./types/model/keyText.js";
|
|
11
|
+
import { CustomTypeModelLinkToMediaField } from "./types/model/linkToMedia.js";
|
|
12
|
+
import { CustomTypeModelNumberField } from "./types/model/number.js";
|
|
13
|
+
import { CustomTypeModelRichTextField } from "./types/model/richText.js";
|
|
14
|
+
import { CustomTypeModelSelectField } from "./types/model/select.js";
|
|
15
|
+
import { CustomTypeModelLegacySlice, CustomTypeModelSlice } from "./types/model/slice.js";
|
|
16
|
+
import { CustomTypeModelSharedSlice, CustomTypeModelSliceZoneField } from "./types/model/sliceZone.js";
|
|
17
|
+
import { CustomTypeModelTableField } from "./types/model/table.js";
|
|
18
|
+
import { CustomTypeModelTimestampField } from "./types/model/timestamp.js";
|
|
19
|
+
import { CustomTypeModelUIDField } from "./types/model/uid.js";
|
|
20
|
+
import { CustomTypeModelFieldForGroup, CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldForSlicePrimary } from "./types/model/types.js";
|
|
21
|
+
import { CustomTypeModelBooleanField } from "./types/model/boolean.js";
|
|
22
|
+
import { BooleanFieldConfig } from "./iac/fields/boolean.js";
|
|
23
|
+
import { CustomTypeModel, CustomTypeModelDefinition } from "./types/model/customType.js";
|
|
24
|
+
import { SharedSliceModelVariation } from "./types/model/sharedSliceVariation.js";
|
|
25
|
+
import { SharedSliceModel } from "./types/model/sharedSlice.js";
|
|
26
|
+
import "./index.js";
|
|
27
|
+
import { ColorFieldConfig } from "./iac/fields/color.js";
|
|
28
|
+
import { DateFieldConfig } from "./iac/fields/date.js";
|
|
29
|
+
import { TimestampFieldConfig } from "./iac/fields/timestamp.js";
|
|
30
|
+
import { NumberFieldConfig } from "./iac/fields/number.js";
|
|
31
|
+
import { GeoPointFieldConfig } from "./iac/fields/geoPoint.js";
|
|
32
|
+
import { EmbedFieldConfig } from "./iac/fields/embed.js";
|
|
33
|
+
import { TableFieldConfig } from "./iac/fields/table.js";
|
|
34
|
+
import { TextFieldConfig } from "./iac/fields/text.js";
|
|
35
|
+
import { RichTextFieldConfig } from "./iac/fields/richText.js";
|
|
36
|
+
import { ImageFieldConfig } from "./iac/fields/image.js";
|
|
37
|
+
import { LinkToMediaFieldConfig } from "./iac/fields/linkToMedia.js";
|
|
38
|
+
import { LinkFieldConfig } from "./iac/fields/link.js";
|
|
39
|
+
import { ContentRelationshipFieldConfig } from "./iac/fields/contentRelationship.js";
|
|
40
|
+
import { SelectFieldConfig } from "./iac/fields/select.js";
|
|
41
|
+
import { UIDFieldConfig } from "./iac/fields/uid.js";
|
|
42
|
+
import { IntegrationFieldConfig } from "./iac/fields/integration.js";
|
|
43
|
+
import { GroupFieldConfig } from "./iac/fields/group.js";
|
|
44
|
+
import { SliceZoneFieldConfig } from "./iac/fields/sliceZone.js";
|
|
45
|
+
import { CustomTypeConfig } from "./iac/customType.js";
|
|
46
|
+
import { SharedSliceConfig } from "./iac/sharedSlice.js";
|
|
47
|
+
import { VariationConfig } from "./iac/variation.js";
|
|
48
|
+
|
|
49
|
+
//#region src/iac/index.d.ts
|
|
50
|
+
/**
|
|
51
|
+
* Infrastructure as Code (IaC) factories for Prismic models.
|
|
52
|
+
*
|
|
53
|
+
* Provides type-safe factory functions to programmatically create
|
|
54
|
+
* Custom Types and Shared Slices.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { model } from "@prismicio/client/iac"
|
|
60
|
+
*
|
|
61
|
+
* const blogPost = model.customType({
|
|
62
|
+
* id: "blog_post",
|
|
63
|
+
* label: "Blog Post",
|
|
64
|
+
* repeatable: true,
|
|
65
|
+
* json: {
|
|
66
|
+
* Main: {
|
|
67
|
+
* uid: model.uid({ label: "UID" }),
|
|
68
|
+
* title: model.richText({ label: "Title", single: "heading1" }),
|
|
69
|
+
* body: model.sliceZone({
|
|
70
|
+
* choices: {
|
|
71
|
+
* hero: { type: "SharedSlice" }
|
|
72
|
+
* }
|
|
73
|
+
* })
|
|
74
|
+
* }
|
|
75
|
+
* }
|
|
76
|
+
* })
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
/**
|
|
80
|
+
* Model factory namespace.
|
|
81
|
+
*
|
|
82
|
+
* Contains all factory functions for creating Prismic model definitions.
|
|
83
|
+
*/
|
|
84
|
+
declare const model: {
|
|
85
|
+
readonly boolean: (config?: BooleanFieldConfig) => CustomTypeModelBooleanField;
|
|
86
|
+
readonly color: (config?: ColorFieldConfig) => CustomTypeModelColorField;
|
|
87
|
+
readonly date: (config?: DateFieldConfig) => CustomTypeModelDateField;
|
|
88
|
+
readonly timestamp: (config?: TimestampFieldConfig) => CustomTypeModelTimestampField;
|
|
89
|
+
readonly number: (config?: NumberFieldConfig) => CustomTypeModelNumberField;
|
|
90
|
+
readonly geoPoint: (config?: GeoPointFieldConfig) => CustomTypeModelGeoPointField;
|
|
91
|
+
readonly embed: (config?: EmbedFieldConfig) => CustomTypeModelEmbedField;
|
|
92
|
+
readonly table: (config?: TableFieldConfig) => CustomTypeModelTableField;
|
|
93
|
+
readonly text: (config?: TextFieldConfig) => CustomTypeModelKeyTextField;
|
|
94
|
+
readonly richText: (config?: RichTextFieldConfig) => CustomTypeModelRichTextField;
|
|
95
|
+
readonly image: <ThumbnailNames extends string = string>(config?: ImageFieldConfig<ThumbnailNames>) => CustomTypeModelImageField<ThumbnailNames>;
|
|
96
|
+
readonly linkToMedia: (config?: LinkToMediaFieldConfig) => CustomTypeModelLinkToMediaField;
|
|
97
|
+
readonly link: (config?: LinkFieldConfig) => CustomTypeModelLinkField;
|
|
98
|
+
readonly contentRelationship: <CustomTypes extends string = string, Tags extends string = string>(config?: ContentRelationshipFieldConfig<CustomTypes, Tags>) => CustomTypeModelContentRelationshipField<CustomTypes, Tags>;
|
|
99
|
+
readonly select: <Option extends string, DefaultValue extends Option = Option>(options: readonly Option[], config?: SelectFieldConfig<Option, DefaultValue>) => CustomTypeModelSelectField<Option, DefaultValue>;
|
|
100
|
+
readonly uid: (config?: UIDFieldConfig) => CustomTypeModelUIDField;
|
|
101
|
+
readonly integration: (config?: IntegrationFieldConfig) => CustomTypeModelIntegrationField;
|
|
102
|
+
readonly group: <Fields extends Record<string, CustomTypeModelFieldForGroup> = Record<string, CustomTypeModelFieldForGroup>>(config?: GroupFieldConfig<Fields>) => CustomTypeModelGroupField<Fields>;
|
|
103
|
+
readonly sliceZone: <Slices extends Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice> = Record<string, CustomTypeModelSlice<Record<string, CustomTypeModelFieldForNestedGroup>, Record<string, CustomTypeModelFieldForNestedGroup>> | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice>>(config?: SliceZoneFieldConfig<Slices>) => CustomTypeModelSliceZoneField<Slices>;
|
|
104
|
+
readonly customType: <ID extends string, Definition extends CustomTypeModelDefinition>(config: CustomTypeConfig<ID, Definition>) => CustomTypeModel<ID, Definition>;
|
|
105
|
+
readonly sharedSlice: <ID extends string, Variation extends SharedSliceModelVariation>(config: SharedSliceConfig<ID, Variation>) => SharedSliceModel<ID, Variation>;
|
|
106
|
+
readonly variation: <ID extends string, PrimaryFields extends Record<string, CustomTypeModelFieldForSlicePrimary> = Record<string, CustomTypeModelFieldForSlicePrimary>, ItemFields extends Record<string, CustomTypeModelFieldForNestedGroup> = Record<string, CustomTypeModelFieldForNestedGroup>>(config: VariationConfig<ID, PrimaryFields, ItemFields>) => SharedSliceModelVariation<ID, PrimaryFields, ItemFields>;
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
export { type BooleanFieldConfig, type ColorFieldConfig, type ContentRelationshipFieldConfig, type CustomTypeConfig, type DateFieldConfig, type EmbedFieldConfig, type GeoPointFieldConfig, type GroupFieldConfig, type ImageFieldConfig, type IntegrationFieldConfig, type LinkFieldConfig, type LinkToMediaFieldConfig, type NumberFieldConfig, type RichTextFieldConfig, type SelectFieldConfig, type SharedSliceConfig, type SliceZoneFieldConfig, type TableFieldConfig, type TextFieldConfig, type TimestampFieldConfig, type UIDFieldConfig, type VariationConfig, model };
|
|
110
|
+
//# sourceMappingURL=iac.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iac.d.ts","names":[],"sources":["../src/iac/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6Da;8BAoCH;;;;;;;;;;;;;;EApCG,SAoCH,MAAA,EAAA,CAAA,eAAA,MAAA,EAAA,2BAAA,SAAA,CAAA,CAAA,OAAA,EAAA,eAAA,EAAA,EAAA,MAAA,CAAA,mBAAA,OAAA,cAAA,CAAA,EAAA,6BAAA,OAAA,cAAA,CAAA;EAAA,SAAA,GAAA,EAAA,CAAA,MAAA,CAAA,gBAAA,EAAA,0BAAA"}
|
package/dist/iac.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { boolean } from "./iac/fields/boolean.js";
|
|
2
|
+
import { color } from "./iac/fields/color.js";
|
|
3
|
+
import { date } from "./iac/fields/date.js";
|
|
4
|
+
import { timestamp } from "./iac/fields/timestamp.js";
|
|
5
|
+
import { number } from "./iac/fields/number.js";
|
|
6
|
+
import { geoPoint } from "./iac/fields/geoPoint.js";
|
|
7
|
+
import { embed } from "./iac/fields/embed.js";
|
|
8
|
+
import { table } from "./iac/fields/table.js";
|
|
9
|
+
import { text } from "./iac/fields/text.js";
|
|
10
|
+
import { richText } from "./iac/fields/richText.js";
|
|
11
|
+
import { image } from "./iac/fields/image.js";
|
|
12
|
+
import { linkToMedia } from "./iac/fields/linkToMedia.js";
|
|
13
|
+
import { link } from "./iac/fields/link.js";
|
|
14
|
+
import { contentRelationship } from "./iac/fields/contentRelationship.js";
|
|
15
|
+
import { select } from "./iac/fields/select.js";
|
|
16
|
+
import { uid } from "./iac/fields/uid.js";
|
|
17
|
+
import { integration } from "./iac/fields/integration.js";
|
|
18
|
+
import { group } from "./iac/fields/group.js";
|
|
19
|
+
import { sliceZone } from "./iac/fields/sliceZone.js";
|
|
20
|
+
import { customType } from "./iac/customType.js";
|
|
21
|
+
import { sharedSlice } from "./iac/sharedSlice.js";
|
|
22
|
+
import { variation } from "./iac/variation.js";
|
|
23
|
+
|
|
24
|
+
//#region src/iac/index.ts
|
|
25
|
+
/**
|
|
26
|
+
* Infrastructure as Code (IaC) factories for Prismic models.
|
|
27
|
+
*
|
|
28
|
+
* Provides type-safe factory functions to programmatically create
|
|
29
|
+
* Custom Types and Shared Slices.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { model } from "@prismicio/client/iac"
|
|
35
|
+
*
|
|
36
|
+
* const blogPost = model.customType({
|
|
37
|
+
* id: "blog_post",
|
|
38
|
+
* label: "Blog Post",
|
|
39
|
+
* repeatable: true,
|
|
40
|
+
* json: {
|
|
41
|
+
* Main: {
|
|
42
|
+
* uid: model.uid({ label: "UID" }),
|
|
43
|
+
* title: model.richText({ label: "Title", single: "heading1" }),
|
|
44
|
+
* body: model.sliceZone({
|
|
45
|
+
* choices: {
|
|
46
|
+
* hero: { type: "SharedSlice" }
|
|
47
|
+
* }
|
|
48
|
+
* })
|
|
49
|
+
* }
|
|
50
|
+
* }
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* Model factory namespace.
|
|
56
|
+
*
|
|
57
|
+
* Contains all factory functions for creating Prismic model definitions.
|
|
58
|
+
*/
|
|
59
|
+
const model = {
|
|
60
|
+
boolean,
|
|
61
|
+
color,
|
|
62
|
+
date,
|
|
63
|
+
timestamp,
|
|
64
|
+
number,
|
|
65
|
+
geoPoint,
|
|
66
|
+
embed,
|
|
67
|
+
table,
|
|
68
|
+
text,
|
|
69
|
+
richText,
|
|
70
|
+
image,
|
|
71
|
+
linkToMedia,
|
|
72
|
+
link,
|
|
73
|
+
contentRelationship,
|
|
74
|
+
select,
|
|
75
|
+
uid,
|
|
76
|
+
integration,
|
|
77
|
+
group,
|
|
78
|
+
sliceZone,
|
|
79
|
+
customType,
|
|
80
|
+
sharedSlice,
|
|
81
|
+
variation
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
export { model };
|
|
86
|
+
//# sourceMappingURL=iac.js.map
|
package/dist/iac.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iac.js","names":[],"sources":["../src/iac/index.ts"],"sourcesContent":["/**\n * Infrastructure as Code (IaC) factories for Prismic models.\n *\n * Provides type-safe factory functions to programmatically create\n * Custom Types and Shared Slices.\n *\n * @example\n *\n * ```ts\n * import { model } from \"@prismicio/client/iac\"\n *\n * const blogPost = model.customType({\n * id: \"blog_post\",\n * label: \"Blog Post\",\n * repeatable: true,\n * json: {\n * Main: {\n * uid: model.uid({ label: \"UID\" }),\n * title: model.richText({ label: \"Title\", single: \"heading1\" }),\n * body: model.sliceZone({\n * choices: {\n * hero: { type: \"SharedSlice\" }\n * }\n * })\n * }\n * }\n * })\n * ```\n */\n\n// Field factories\nimport { boolean } from \"./fields/boolean\"\nimport { color } from \"./fields/color\"\nimport { date } from \"./fields/date\"\nimport { timestamp } from \"./fields/timestamp\"\nimport { number } from \"./fields/number\"\nimport { geoPoint } from \"./fields/geoPoint\"\nimport { embed } from \"./fields/embed\"\nimport { table } from \"./fields/table\"\nimport { text } from \"./fields/text\"\nimport { richText } from \"./fields/richText\"\nimport { image } from \"./fields/image\"\nimport { linkToMedia } from \"./fields/linkToMedia\"\nimport { link } from \"./fields/link\"\nimport { contentRelationship } from \"./fields/contentRelationship\"\nimport { select } from \"./fields/select\"\nimport { uid } from \"./fields/uid\"\nimport { integration } from \"./fields/integration\"\nimport { group } from \"./fields/group\"\nimport { sliceZone } from \"./fields/sliceZone\"\n\n// Structure factories\nimport { customType } from \"./customType\"\nimport { sharedSlice } from \"./sharedSlice\"\nimport { variation } from \"./variation\"\n\n/**\n * Model factory namespace.\n *\n * Contains all factory functions for creating Prismic model definitions.\n */\nexport const model = {\n\t// Simple fields\n\tboolean,\n\tcolor,\n\tdate,\n\ttimestamp,\n\tnumber,\n\tgeoPoint,\n\tembed,\n\ttable,\n\n\t// Text fields\n\ttext,\n\trichText,\n\n\t// Media fields\n\timage,\n\tlinkToMedia,\n\n\t// Link fields\n\tlink,\n\tcontentRelationship,\n\n\t// Special fields\n\tselect,\n\tuid,\n\tintegration,\n\n\t// Structural fields\n\tgroup,\n\tsliceZone,\n\n\t// Structure factories\n\tcustomType,\n\tsharedSlice,\n\tvariation,\n} as const\n\n// Re-export types for convenience\nexport type { BooleanFieldConfig } from \"./fields/boolean\"\nexport type { ColorFieldConfig } from \"./fields/color\"\nexport type { DateFieldConfig } from \"./fields/date\"\nexport type { TimestampFieldConfig } from \"./fields/timestamp\"\nexport type { NumberFieldConfig } from \"./fields/number\"\nexport type { GeoPointFieldConfig } from \"./fields/geoPoint\"\nexport type { EmbedFieldConfig } from \"./fields/embed\"\nexport type { TableFieldConfig } from \"./fields/table\"\nexport type { TextFieldConfig } from \"./fields/text\"\nexport type { RichTextFieldConfig } from \"./fields/richText\"\nexport type { ImageFieldConfig } from \"./fields/image\"\nexport type { LinkToMediaFieldConfig } from \"./fields/linkToMedia\"\nexport type { LinkFieldConfig } from \"./fields/link\"\nexport type { ContentRelationshipFieldConfig } from \"./fields/contentRelationship\"\nexport type { SelectFieldConfig } from \"./fields/select\"\nexport type { UIDFieldConfig } from \"./fields/uid\"\nexport type { IntegrationFieldConfig } from \"./fields/integration\"\nexport type { GroupFieldConfig } from \"./fields/group\"\nexport type { SliceZoneFieldConfig } from \"./fields/sliceZone\"\nexport type { CustomTypeConfig } from \"./customType\"\nexport type { SharedSliceConfig } from \"./sharedSlice\"\nexport type { VariationConfig } from \"./variation\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAa,QAAQ;CAEpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;CAGA;CACA;CAGA;CACA;CACA;CAGA;CACA;CAGA;CACA;CACA;CACA"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CustomTypeModelBooleanField } from "./types/model/boolean.cjs";
|
|
2
1
|
import { CustomTypeModelColorField } from "./types/model/color.cjs";
|
|
3
2
|
import { CustomTypeModelLinkField, CustomTypeModelLinkSelectType } from "./types/model/link.cjs";
|
|
4
3
|
import { CustomTypeModelContentRelationshipField, CustomTypeModelFetchContentRelationshipLevel1, CustomTypeModelFetchCustomTypeLevel1, CustomTypeModelFetchCustomTypeLevel2, CustomTypeModelFetchGroupLevel1, CustomTypeModelFetchGroupLevel2 } from "./types/model/contentRelationship.cjs";
|
|
@@ -7,6 +6,7 @@ import { CustomTypeModelEmbedField } from "./types/model/embed.cjs";
|
|
|
7
6
|
import { CustomTypeModelGeoPointField } from "./types/model/geoPoint.cjs";
|
|
8
7
|
import { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./types/model/group.cjs";
|
|
9
8
|
import { CustomTypeModelImageConstraint, CustomTypeModelImageField, CustomTypeModelImageThumbnail } from "./types/model/image.cjs";
|
|
9
|
+
import { CustomTypeModelIntegrationField } from "./types/model/integration.cjs";
|
|
10
10
|
import { CustomTypeModelKeyTextField } from "./types/model/keyText.cjs";
|
|
11
11
|
import { CustomTypeModelLinkToMediaField } from "./types/model/linkToMedia.cjs";
|
|
12
12
|
import { CustomTypeModelNumberField } from "./types/model/number.cjs";
|
|
@@ -21,7 +21,7 @@ import { CustomTypeModelTimestampField } from "./types/model/timestamp.cjs";
|
|
|
21
21
|
import { CustomTypeModelTitleField } from "./types/model/title.cjs";
|
|
22
22
|
import { CustomTypeModelUIDField } from "./types/model/uid.cjs";
|
|
23
23
|
import { CustomTypeModelField, CustomTypeModelFieldForGroup, CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldForSlicePrimary, CustomTypeModelFieldType } from "./types/model/types.cjs";
|
|
24
|
-
import {
|
|
24
|
+
import { CustomTypeModelBooleanField } from "./types/model/boolean.cjs";
|
|
25
25
|
import { BooleanField } from "./types/value/boolean.cjs";
|
|
26
26
|
import { ColorField } from "./types/value/color.cjs";
|
|
27
27
|
import { GroupField, NestedGroupField } from "./types/value/group.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CustomTypeModelBooleanField } from "./types/model/boolean.js";
|
|
2
1
|
import { CustomTypeModelColorField } from "./types/model/color.js";
|
|
3
2
|
import { CustomTypeModelLinkField, CustomTypeModelLinkSelectType } from "./types/model/link.js";
|
|
4
3
|
import { CustomTypeModelContentRelationshipField, CustomTypeModelFetchContentRelationshipLevel1, CustomTypeModelFetchCustomTypeLevel1, CustomTypeModelFetchCustomTypeLevel2, CustomTypeModelFetchGroupLevel1, CustomTypeModelFetchGroupLevel2 } from "./types/model/contentRelationship.js";
|
|
@@ -7,6 +6,7 @@ import { CustomTypeModelEmbedField } from "./types/model/embed.js";
|
|
|
7
6
|
import { CustomTypeModelGeoPointField } from "./types/model/geoPoint.js";
|
|
8
7
|
import { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./types/model/group.js";
|
|
9
8
|
import { CustomTypeModelImageConstraint, CustomTypeModelImageField, CustomTypeModelImageThumbnail } from "./types/model/image.js";
|
|
9
|
+
import { CustomTypeModelIntegrationField } from "./types/model/integration.js";
|
|
10
10
|
import { CustomTypeModelKeyTextField } from "./types/model/keyText.js";
|
|
11
11
|
import { CustomTypeModelLinkToMediaField } from "./types/model/linkToMedia.js";
|
|
12
12
|
import { CustomTypeModelNumberField } from "./types/model/number.js";
|
|
@@ -21,7 +21,7 @@ import { CustomTypeModelTimestampField } from "./types/model/timestamp.js";
|
|
|
21
21
|
import { CustomTypeModelTitleField } from "./types/model/title.js";
|
|
22
22
|
import { CustomTypeModelUIDField } from "./types/model/uid.js";
|
|
23
23
|
import { CustomTypeModelField, CustomTypeModelFieldForGroup, CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldForSlicePrimary, CustomTypeModelFieldType } from "./types/model/types.js";
|
|
24
|
-
import {
|
|
24
|
+
import { CustomTypeModelBooleanField } from "./types/model/boolean.js";
|
|
25
25
|
import { BooleanField } from "./types/value/boolean.js";
|
|
26
26
|
import { ColorField } from "./types/value/color.js";
|
|
27
27
|
import { GroupField, NestedGroupField } from "./types/value/group.js";
|
package/dist/package.cjs
CHANGED
package/dist/package.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/client\",\n\t\"version\": \"7.21.
|
|
1
|
+
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/client\",\n\t\"version\": \"7.21.3-pr.431.23cc5c6\",\n\t\"description\": \"The official JavaScript + TypeScript client library for Prismic\",\n\t\"keywords\": [\n\t\t\"typescript\",\n\t\t\"client\",\n\t\t\"helpers\",\n\t\t\"types\",\n\t\t\"utils\",\n\t\t\"toolbox\",\n\t\t\"cms\",\n\t\t\"prismic\",\n\t\t\"prismic.io\"\n\t],\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"ssh://git@github.com/prismicio/prismic-client.git\"\n\t},\n\t\"license\": \"Apache-2.0\",\n\t\"author\": \"Prismic <contact@prismic.io> (https://prismic.io)\",\n\t\"sideEffects\": false,\n\t\"type\": \"module\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"import\": \"./dist/index.js\",\n\t\t\t\"require\": \"./dist/index.cjs\"\n\t\t},\n\t\t\"./iac\": {\n\t\t\t\"import\": \"./dist/iac.js\",\n\t\t\t\"require\": \"./dist/iac.cjs\"\n\t\t},\n\t\t\"./richtext\": {\n\t\t\t\"import\": \"./dist/richtext.js\",\n\t\t\t\"require\": \"./dist/richtext.cjs\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\"\n\t},\n\t\"main\": \"./dist/index.cjs\",\n\t\"module\": \"./dist/index.js\",\n\t\"react-native\": \"./dist/index.js\",\n\t\"types\": \"./dist/index.d.cts\",\n\t\"typesVersions\": {\n\t\t\"*\": {\n\t\t\t\"*\": [\n\t\t\t\t\"dist/index.d.ts\"\n\t\t\t],\n\t\t\t\"richtext\": [\n\t\t\t\t\"dist/richtext.d.ts\"\n\t\t\t],\n\t\t\t\"iac\": [\n\t\t\t\t\"dist/iac.d.ts\"\n\t\t\t]\n\t\t}\n\t},\n\t\"files\": [\n\t\t\"dist\",\n\t\t\"src\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"format\": \"prettier --write .\",\n\t\t\"prepare\": \"npm run build\",\n\t\t\"lint\": \"oxlint --deny-warnings\",\n\t\t\"types\": \"tsc --noEmit\",\n\t\t\"unit\": \"vitest run --coverage\",\n\t\t\"unit:watch\": \"vitest watch\",\n\t\t\"test\": \"npm run lint && npm run types && npm run unit && npm run build\"\n\t},\n\t\"dependencies\": {\n\t\t\"imgix-url-builder\": \"^0.0.6\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@prismicio/e2e-tests-utils\": \"^1.14.0\",\n\t\t\"@prismicio/types-internal\": \"^3.16.1\",\n\t\t\"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n\t\t\"@types/node\": \"^24.10.0\",\n\t\t\"@vitest/coverage-v8\": \"^4.0.6\",\n\t\t\"oxlint\": \"^1.26.0\",\n\t\t\"prettier\": \"^3.6.2\",\n\t\t\"prettier-plugin-jsdoc\": \"1.3.3\",\n\t\t\"tsdown\": \"^0.16.1\",\n\t\t\"typescript\": \"^5.9.3\",\n\t\t\"vitest\": \"^4.0.6\"\n\t},\n\t\"engines\": {\n\t\t\"node\": \">=14.15.0\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t}\n}\n"],"mappings":";;WACS;cACG"}
|
package/dist/package.js
CHANGED
package/dist/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/client\",\n\t\"version\": \"7.21.
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/client\",\n\t\"version\": \"7.21.3-pr.431.23cc5c6\",\n\t\"description\": \"The official JavaScript + TypeScript client library for Prismic\",\n\t\"keywords\": [\n\t\t\"typescript\",\n\t\t\"client\",\n\t\t\"helpers\",\n\t\t\"types\",\n\t\t\"utils\",\n\t\t\"toolbox\",\n\t\t\"cms\",\n\t\t\"prismic\",\n\t\t\"prismic.io\"\n\t],\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"ssh://git@github.com/prismicio/prismic-client.git\"\n\t},\n\t\"license\": \"Apache-2.0\",\n\t\"author\": \"Prismic <contact@prismic.io> (https://prismic.io)\",\n\t\"sideEffects\": false,\n\t\"type\": \"module\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"import\": \"./dist/index.js\",\n\t\t\t\"require\": \"./dist/index.cjs\"\n\t\t},\n\t\t\"./iac\": {\n\t\t\t\"import\": \"./dist/iac.js\",\n\t\t\t\"require\": \"./dist/iac.cjs\"\n\t\t},\n\t\t\"./richtext\": {\n\t\t\t\"import\": \"./dist/richtext.js\",\n\t\t\t\"require\": \"./dist/richtext.cjs\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\"\n\t},\n\t\"main\": \"./dist/index.cjs\",\n\t\"module\": \"./dist/index.js\",\n\t\"react-native\": \"./dist/index.js\",\n\t\"types\": \"./dist/index.d.cts\",\n\t\"typesVersions\": {\n\t\t\"*\": {\n\t\t\t\"*\": [\n\t\t\t\t\"dist/index.d.ts\"\n\t\t\t],\n\t\t\t\"richtext\": [\n\t\t\t\t\"dist/richtext.d.ts\"\n\t\t\t],\n\t\t\t\"iac\": [\n\t\t\t\t\"dist/iac.d.ts\"\n\t\t\t]\n\t\t}\n\t},\n\t\"files\": [\n\t\t\"dist\",\n\t\t\"src\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"format\": \"prettier --write .\",\n\t\t\"prepare\": \"npm run build\",\n\t\t\"lint\": \"oxlint --deny-warnings\",\n\t\t\"types\": \"tsc --noEmit\",\n\t\t\"unit\": \"vitest run --coverage\",\n\t\t\"unit:watch\": \"vitest watch\",\n\t\t\"test\": \"npm run lint && npm run types && npm run unit && npm run build\"\n\t},\n\t\"dependencies\": {\n\t\t\"imgix-url-builder\": \"^0.0.6\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@prismicio/e2e-tests-utils\": \"^1.14.0\",\n\t\t\"@prismicio/types-internal\": \"^3.16.1\",\n\t\t\"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n\t\t\"@types/node\": \"^24.10.0\",\n\t\t\"@vitest/coverage-v8\": \"^4.0.6\",\n\t\t\"oxlint\": \"^1.26.0\",\n\t\t\"prettier\": \"^3.6.2\",\n\t\t\"prettier-plugin-jsdoc\": \"1.3.3\",\n\t\t\"tsdown\": \"^0.16.1\",\n\t\t\"typescript\": \"^5.9.3\",\n\t\t\"vitest\": \"^4.0.6\"\n\t},\n\t\"engines\": {\n\t\t\"node\": \">=14.15.0\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t}\n}\n"],"mappings":";WACS;cACG"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CustomTypeModelBooleanField } from "./boolean.cjs";
|
|
2
1
|
import { CustomTypeModelColorField } from "./color.cjs";
|
|
3
2
|
import { CustomTypeModelLinkField } from "./link.cjs";
|
|
4
3
|
import { CustomTypeModelContentRelationshipField } from "./contentRelationship.cjs";
|
|
@@ -7,6 +6,7 @@ import { CustomTypeModelEmbedField } from "./embed.cjs";
|
|
|
7
6
|
import { CustomTypeModelGeoPointField } from "./geoPoint.cjs";
|
|
8
7
|
import { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./group.cjs";
|
|
9
8
|
import { CustomTypeModelImageField } from "./image.cjs";
|
|
9
|
+
import { CustomTypeModelIntegrationField } from "./integration.cjs";
|
|
10
10
|
import { CustomTypeModelKeyTextField } from "./keyText.cjs";
|
|
11
11
|
import { CustomTypeModelLinkToMediaField } from "./linkToMedia.cjs";
|
|
12
12
|
import { CustomTypeModelNumberField } from "./number.cjs";
|
|
@@ -19,7 +19,7 @@ import { CustomTypeModelTableField } from "./table.cjs";
|
|
|
19
19
|
import { CustomTypeModelTimestampField } from "./timestamp.cjs";
|
|
20
20
|
import { CustomTypeModelTitleField } from "./title.cjs";
|
|
21
21
|
import { CustomTypeModelUIDField } from "./uid.cjs";
|
|
22
|
-
import {
|
|
22
|
+
import { CustomTypeModelBooleanField } from "./boolean.cjs";
|
|
23
23
|
|
|
24
24
|
//#region src/types/model/types.d.ts
|
|
25
25
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CustomTypeModelBooleanField } from "./boolean.js";
|
|
2
1
|
import { CustomTypeModelColorField } from "./color.js";
|
|
3
2
|
import { CustomTypeModelLinkField } from "./link.js";
|
|
4
3
|
import { CustomTypeModelContentRelationshipField } from "./contentRelationship.js";
|
|
@@ -7,6 +6,7 @@ import { CustomTypeModelEmbedField } from "./embed.js";
|
|
|
7
6
|
import { CustomTypeModelGeoPointField } from "./geoPoint.js";
|
|
8
7
|
import { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./group.js";
|
|
9
8
|
import { CustomTypeModelImageField } from "./image.js";
|
|
9
|
+
import { CustomTypeModelIntegrationField } from "./integration.js";
|
|
10
10
|
import { CustomTypeModelKeyTextField } from "./keyText.js";
|
|
11
11
|
import { CustomTypeModelLinkToMediaField } from "./linkToMedia.js";
|
|
12
12
|
import { CustomTypeModelNumberField } from "./number.js";
|
|
@@ -19,7 +19,7 @@ import { CustomTypeModelTableField } from "./table.js";
|
|
|
19
19
|
import { CustomTypeModelTimestampField } from "./timestamp.js";
|
|
20
20
|
import { CustomTypeModelTitleField } from "./title.js";
|
|
21
21
|
import { CustomTypeModelUIDField } from "./uid.js";
|
|
22
|
-
import {
|
|
22
|
+
import { CustomTypeModelBooleanField } from "./boolean.js";
|
|
23
23
|
|
|
24
24
|
//#region src/types/model/types.d.ts
|
|
25
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/client",
|
|
3
|
-
"version": "7.21.
|
|
3
|
+
"version": "7.21.3-pr.431.23cc5c6",
|
|
4
4
|
"description": "The official JavaScript + TypeScript client library for Prismic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"import": "./dist/index.js",
|
|
27
27
|
"require": "./dist/index.cjs"
|
|
28
28
|
},
|
|
29
|
+
"./iac": {
|
|
30
|
+
"import": "./dist/iac.js",
|
|
31
|
+
"require": "./dist/iac.cjs"
|
|
32
|
+
},
|
|
29
33
|
"./richtext": {
|
|
30
34
|
"import": "./dist/richtext.js",
|
|
31
35
|
"require": "./dist/richtext.cjs"
|
|
@@ -42,7 +46,10 @@
|
|
|
42
46
|
"dist/index.d.ts"
|
|
43
47
|
],
|
|
44
48
|
"richtext": [
|
|
45
|
-
"dist/richtext
|
|
49
|
+
"dist/richtext.d.ts"
|
|
50
|
+
],
|
|
51
|
+
"iac": [
|
|
52
|
+
"dist/iac.d.ts"
|
|
46
53
|
]
|
|
47
54
|
}
|
|
48
55
|
},
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CustomTypeModel,
|
|
3
|
+
CustomTypeModelDefinition,
|
|
4
|
+
} from "../types/model/customType"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for a custom type.
|
|
8
|
+
*/
|
|
9
|
+
export interface CustomTypeConfig<
|
|
10
|
+
ID extends string = string,
|
|
11
|
+
Definition extends CustomTypeModelDefinition = CustomTypeModelDefinition,
|
|
12
|
+
> {
|
|
13
|
+
/**
|
|
14
|
+
* The API ID of the custom type.
|
|
15
|
+
*/
|
|
16
|
+
id: ID
|
|
17
|
+
/**
|
|
18
|
+
* The human-readable name of the custom type.
|
|
19
|
+
*/
|
|
20
|
+
label?: string | null
|
|
21
|
+
/**
|
|
22
|
+
* Whether multiple documents of this type can be created.
|
|
23
|
+
*/
|
|
24
|
+
repeatable: boolean
|
|
25
|
+
/**
|
|
26
|
+
* The format of the custom type.
|
|
27
|
+
*
|
|
28
|
+
* - `"page"` - A page type (has a URL).
|
|
29
|
+
* - `"custom"` - A custom type (no URL).
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue `"custom"`
|
|
32
|
+
*/
|
|
33
|
+
format?: "page" | "custom"
|
|
34
|
+
/**
|
|
35
|
+
* Whether new documents for this type can be created.
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue `true`
|
|
38
|
+
*/
|
|
39
|
+
status?: boolean
|
|
40
|
+
/**
|
|
41
|
+
* The tabs and fields definition for this custom type.
|
|
42
|
+
*/
|
|
43
|
+
json: Definition
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Creates a custom type model.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* const blogPost = model.customType({
|
|
53
|
+
* id: "blog_post",
|
|
54
|
+
* label: "Blog Post",
|
|
55
|
+
* repeatable: true,
|
|
56
|
+
* format: "page",
|
|
57
|
+
* json: {
|
|
58
|
+
* Main: {
|
|
59
|
+
* uid: model.uid({ label: "UID" }),
|
|
60
|
+
* title: model.richText({ label: "Title", single: "heading1" }),
|
|
61
|
+
* featured_image: model.image({ label: "Featured Image" }),
|
|
62
|
+
* body: model.sliceZone({
|
|
63
|
+
* choices: {
|
|
64
|
+
* hero: { type: "SharedSlice" },
|
|
65
|
+
* text_block: { type: "SharedSlice" }
|
|
66
|
+
* }
|
|
67
|
+
* })
|
|
68
|
+
* },
|
|
69
|
+
* SEO: {
|
|
70
|
+
* meta_title: model.text({ label: "Meta Title" }),
|
|
71
|
+
* meta_description: model.text({ label: "Meta Description" })
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
74
|
+
* })
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @typeParam ID - Custom type ID literal for type inference.
|
|
78
|
+
* @typeParam Definition - Tabs and fields definition for type inference.
|
|
79
|
+
*
|
|
80
|
+
* @param config - Configuration for the custom type.
|
|
81
|
+
*
|
|
82
|
+
* @returns A custom type model.
|
|
83
|
+
*/
|
|
84
|
+
export const customType = <
|
|
85
|
+
ID extends string,
|
|
86
|
+
Definition extends CustomTypeModelDefinition,
|
|
87
|
+
>(
|
|
88
|
+
config: CustomTypeConfig<ID, Definition>,
|
|
89
|
+
): CustomTypeModel<ID, Definition> => {
|
|
90
|
+
return {
|
|
91
|
+
id: config.id,
|
|
92
|
+
label: config.label ?? null,
|
|
93
|
+
repeatable: config.repeatable,
|
|
94
|
+
format: config.format,
|
|
95
|
+
status: config.status ?? true,
|
|
96
|
+
json: config.json,
|
|
97
|
+
}
|
|
98
|
+
}
|