@prismicio/types-internal 4.0.0-pr.6.7b0b0be → 4.0.0-pr.6.bbcafda
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/content/codec/link.js +8 -8
- package/dist/content/codec/link.js.map +1 -1
- package/dist/content/codec/richText.js +2 -2
- package/dist/content/codec/richText.js.map +1 -1
- package/dist/content/document.d.ts +2 -3019
- package/dist/content/document.d.ts.map +1 -1
- package/dist/content/field.d.ts +1 -30
- package/dist/content/field.d.ts.map +1 -1
- package/dist/content/field.js.map +1 -1
- package/dist/content/group.d.ts +2 -1
- package/dist/content/group.d.ts.map +1 -1
- package/dist/content/group.js.map +1 -1
- package/dist/content/legacy/boolean.d.ts +1 -0
- package/dist/content/legacy/embed.d.ts +1 -0
- package/dist/content/legacy/empty.d.ts +1 -0
- package/dist/content/legacy/field.d.ts +1 -0
- package/dist/content/legacy/geopoint.d.ts +1 -0
- package/dist/content/legacy/group.d.ts +9 -0
- package/dist/content/legacy/group.d.ts.map +1 -0
- package/dist/content/legacy/group.js.map +1 -1
- package/dist/content/legacy/integrationField.d.ts +1 -0
- package/dist/content/legacy/link.d.ts +41 -0
- package/dist/content/legacy/link.d.ts.map +1 -0
- package/dist/content/legacy/link.js.map +1 -1
- package/dist/content/legacy/nestable.d.ts +1 -0
- package/dist/content/legacy/nestable.js.map +1 -1
- package/dist/content/legacy/repeatable.d.ts +1 -0
- package/dist/content/legacy/richText.d.ts +109 -0
- package/dist/content/legacy/richText.d.ts.map +1 -0
- package/dist/content/legacy/richText.js +3 -3
- package/dist/content/legacy/richText.js.map +1 -1
- package/dist/content/legacy/separator.d.ts +1 -0
- package/dist/content/legacy/slice.js.map +1 -1
- package/dist/content/legacy/table.d.ts +1 -0
- package/dist/content/link.d.ts +74 -99
- package/dist/content/link.d.ts.map +1 -1
- package/dist/content/link.js +2 -2
- package/dist/content/link.js.map +1 -1
- package/dist/content/nestable.d.ts +13 -749
- package/dist/content/nestable.d.ts.map +1 -1
- package/dist/content/nestable.js.map +1 -1
- package/dist/content/repeatable.d.ts +3 -98
- package/dist/content/repeatable.d.ts.map +1 -1
- package/dist/content/richText.d.ts +81 -131
- package/dist/content/richText.d.ts.map +1 -1
- package/dist/content/richText.js +5 -4
- package/dist/content/richText.js.map +1 -1
- package/dist/content/slice.d.ts +6 -4509
- package/dist/content/slice.d.ts.map +1 -1
- package/dist/content/slice.js.map +1 -1
- package/dist/content/slices.d.ts +8 -6765
- package/dist/content/slices.d.ts.map +1 -1
- package/dist/content/table.d.ts +2 -134
- package/dist/content/table.d.ts.map +1 -1
- package/dist/content/widget.d.ts +5 -3020
- package/dist/content/widget.d.ts.map +1 -1
- package/dist/content/widget.js.map +1 -1
- package/dist/helpers/customTypeModel.d.ts +1 -1
- package/dist/helpers/documentContent.d.ts +3 -9
- package/dist/helpers/documentContent.d.ts.map +1 -1
- package/dist/helpers/documentContent.js +3 -3
- package/dist/helpers/documentContent.js.map +1 -1
- package/dist/helpers/traverseContent.d.ts +10 -11
- package/dist/helpers/traverseContent.d.ts.map +1 -1
- package/dist/helpers/traverseContent.js.map +1 -1
- package/dist/helpers/traverseContentWithModel.d.ts +10 -11
- package/dist/helpers/traverseContentWithModel.d.ts.map +1 -1
- package/dist/helpers/traverseContentWithModel.js.map +1 -1
- package/dist/index.d.ts +25 -25
- package/dist/io-ts.d.ts +3380 -70926
- package/dist/io-ts.d.ts.map +1 -1
- package/dist/io-ts.js +125 -122
- package/dist/io-ts.js.map +1 -1
- package/dist/model/customType.d.ts +3 -3329
- package/dist/model/customType.d.ts.map +1 -1
- package/dist/model/group.d.ts +391 -392
- package/dist/model/group.d.ts.map +1 -1
- package/dist/model/group.js.map +1 -1
- package/dist/model/image.d.ts +4 -4
- package/dist/model/image.js.map +1 -1
- package/dist/model/link.d.ts +18 -18
- package/dist/model/link.d.ts.map +1 -1
- package/dist/model/link.js +7 -7
- package/dist/model/link.js.map +1 -1
- package/dist/model/nestable.d.ts +17 -178
- package/dist/model/nestable.d.ts.map +1 -1
- package/dist/model/nestable.js.map +1 -1
- package/dist/model/richText.d.ts +3 -7
- package/dist/model/richText.d.ts.map +1 -1
- package/dist/model/richText.js.map +1 -1
- package/dist/model/section.d.ts +3 -3329
- package/dist/model/section.d.ts.map +1 -1
- package/dist/model/select.d.ts +1 -1
- package/dist/model/select.js +1 -1
- package/dist/model/select.js.map +1 -1
- package/dist/model/slice.d.ts +861 -3800
- package/dist/model/slice.d.ts.map +1 -1
- package/dist/model/slice.js +7 -2
- package/dist/model/slice.js.map +1 -1
- package/dist/model/slices.d.ts +3 -2195
- package/dist/model/slices.d.ts.map +1 -1
- package/dist/model/widget.d.ts +6 -3331
- package/dist/model/widget.d.ts.map +1 -1
- package/dist/model/widget.js.map +1 -1
- package/dist/zod4.d.ts +1345 -34797
- package/dist/zod4.d.ts.map +1 -1
- package/dist/zod4.js +125 -122
- package/dist/zod4.js.map +1 -1
- package/package.json +3 -2
- package/src/content/codec/link.ts +8 -8
- package/src/content/codec/richText.ts +10 -6
- package/src/content/field.ts +9 -2
- package/src/content/group.ts +5 -2
- package/src/content/legacy/group.ts +10 -4
- package/src/content/legacy/link.ts +32 -9
- package/src/content/legacy/nestable.ts +26 -2
- package/src/content/legacy/richText.ts +40 -7
- package/src/content/legacy/slice.ts +2 -2
- package/src/content/legacy/widget.ts +6 -2
- package/src/content/link.ts +32 -9
- package/src/content/nestable.ts +40 -2
- package/src/content/richText.ts +31 -9
- package/src/content/slice.ts +2 -2
- package/src/content/widget.ts +6 -2
- package/src/helpers/documentContent.ts +12 -15
- package/src/helpers/traverseContent.ts +12 -19
- package/src/helpers/traverseContentWithModel.ts +10 -16
- package/src/index.ts +3 -2
- package/src/io-ts.ts +166 -140
- package/src/model/group.ts +4 -1
- package/src/model/image.ts +1 -1
- package/src/model/link.ts +39 -45
- package/src/model/nestable.ts +33 -1
- package/src/model/richText.ts +2 -2
- package/src/model/select.ts +2 -2
- package/src/model/slice.ts +36 -9
- package/src/model/widget.ts +8 -4
- package/src/zod4.ts +166 -140
package/src/model/nestable.ts
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
import { z } from "zod/mini"
|
|
2
2
|
|
|
3
|
+
import type { BooleanModel } from "./boolean"
|
|
3
4
|
import { BooleanModelSchema } from "./boolean"
|
|
5
|
+
import type { ColorModel } from "./color"
|
|
4
6
|
import { ColorModelSchema } from "./color"
|
|
7
|
+
import type { DateModel } from "./date"
|
|
5
8
|
import { DateModelSchema } from "./date"
|
|
9
|
+
import type { EmbedModel } from "./embed"
|
|
6
10
|
import { EmbedModelSchema } from "./embed"
|
|
11
|
+
import type { GeoPointModel } from "./geopoint"
|
|
7
12
|
import { GeoPointModelSchema } from "./geopoint"
|
|
13
|
+
import type { ImageModel } from "./image"
|
|
8
14
|
import { ImageModelSchema } from "./image"
|
|
15
|
+
import type { IntegrationFieldModel } from "./integrationField"
|
|
9
16
|
import { IntegrationFieldModelSchema } from "./integrationField"
|
|
17
|
+
import type { LinkModel } from "./link"
|
|
10
18
|
import { LinkModelSchema } from "./link"
|
|
19
|
+
import type { NumberModel } from "./number"
|
|
11
20
|
import { NumberModelSchema } from "./number"
|
|
21
|
+
import type { RangeModel } from "./range"
|
|
12
22
|
import { RangeModelSchema } from "./range"
|
|
23
|
+
import type { RichTextModel } from "./richText"
|
|
13
24
|
import { RichTextModelSchema } from "./richText"
|
|
25
|
+
import type { SelectModel } from "./select"
|
|
14
26
|
import { SelectModelSchema } from "./select"
|
|
27
|
+
import type { SeparatorModel } from "./separator"
|
|
15
28
|
import { SeparatorModelSchema } from "./separator"
|
|
29
|
+
import type { TableModel } from "./table"
|
|
16
30
|
import { TableModelSchema } from "./table"
|
|
31
|
+
import type { TextModel } from "./text"
|
|
17
32
|
import { TextModelSchema } from "./text"
|
|
33
|
+
import type { TimestampModel } from "./timestamp"
|
|
18
34
|
import { TimestampModelSchema } from "./timestamp"
|
|
19
35
|
|
|
20
36
|
export const NestableModelSchema = z.union([
|
|
@@ -36,4 +52,20 @@ export const NestableModelSchema = z.union([
|
|
|
36
52
|
TimestampModelSchema,
|
|
37
53
|
])
|
|
38
54
|
|
|
39
|
-
export type NestableModel =
|
|
55
|
+
export type NestableModel =
|
|
56
|
+
| BooleanModel
|
|
57
|
+
| ColorModel
|
|
58
|
+
| DateModel
|
|
59
|
+
| EmbedModel
|
|
60
|
+
| GeoPointModel
|
|
61
|
+
| ImageModel
|
|
62
|
+
| IntegrationFieldModel
|
|
63
|
+
| LinkModel
|
|
64
|
+
| NumberModel
|
|
65
|
+
| RangeModel
|
|
66
|
+
| RichTextModel
|
|
67
|
+
| SelectModel
|
|
68
|
+
| SeparatorModel
|
|
69
|
+
| TableModel
|
|
70
|
+
| TextModel
|
|
71
|
+
| TimestampModel
|
package/src/model/richText.ts
CHANGED
|
@@ -52,7 +52,7 @@ const RichTextOptionsSchema = z.pipe(
|
|
|
52
52
|
*/
|
|
53
53
|
const LegacyLabelsFormat = z.record(z.string(), z.array(z.object({ name: z.string() })))
|
|
54
54
|
|
|
55
|
-
const RichTextLabelsSchema = z.pipe(
|
|
55
|
+
const RichTextLabelsSchema: z.ZodMiniType<string[]> = z.pipe(
|
|
56
56
|
z.union([
|
|
57
57
|
z.pipe(
|
|
58
58
|
z.null(),
|
|
@@ -83,7 +83,7 @@ const RichTextLabelsSchema = z.pipe(
|
|
|
83
83
|
}),
|
|
84
84
|
),
|
|
85
85
|
]),
|
|
86
|
-
z.transform((result: string[]) => result as
|
|
86
|
+
z.transform((result: string[]) => result as string[]),
|
|
87
87
|
)
|
|
88
88
|
|
|
89
89
|
const RichTextConfigSchema = z.object({
|
package/src/model/select.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod/mini"
|
|
|
2
2
|
|
|
3
3
|
// Options can be string, number, or boolean - all coerced to string
|
|
4
4
|
// Matches io-ts behavior: t.union([t.string, StringFromNumber, StringFromBoolean])
|
|
5
|
-
const SelectOptionSchema = z.union([
|
|
5
|
+
const SelectOptionSchema: z.ZodMiniType<string> = z.union([
|
|
6
6
|
z.string(),
|
|
7
7
|
z.pipe(
|
|
8
8
|
z.number(),
|
|
@@ -18,7 +18,7 @@ const SelectConfigSchema = z.object({
|
|
|
18
18
|
label: z.nullish(z.string()),
|
|
19
19
|
placeholder: z.optional(z.string()),
|
|
20
20
|
default_value: z.optional(z.string()),
|
|
21
|
-
options: z.optional(z.
|
|
21
|
+
options: z.optional(z.array(SelectOptionSchema)),
|
|
22
22
|
})
|
|
23
23
|
|
|
24
24
|
export const SelectModelSchema = z.object({
|
package/src/model/slice.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { z } from "zod/mini"
|
|
2
2
|
|
|
3
3
|
import { WidgetKeySchema } from "../common/widgetKey"
|
|
4
|
+
import type { NestedGroupModel } from "./group"
|
|
4
5
|
import { GroupModelSchema, NestedGroupModelSchema } from "./group"
|
|
6
|
+
import type { NestableModel } from "./nestable"
|
|
5
7
|
import { NestableModelSchema } from "./nestable"
|
|
6
8
|
|
|
7
9
|
// Simple (before 2020)
|
|
8
|
-
export const LegacySliceModelSchema = z.union([
|
|
10
|
+
export const LegacySliceModelSchema: z.ZodMiniType<LegacySliceModel> = z.union([
|
|
11
|
+
NestableModelSchema,
|
|
12
|
+
NestedGroupModelSchema,
|
|
13
|
+
])
|
|
9
14
|
|
|
10
|
-
export type LegacySliceModel =
|
|
15
|
+
export type LegacySliceModel = NestableModel | NestedGroupModel
|
|
11
16
|
|
|
12
17
|
// Composite (2020 to 2021)
|
|
13
18
|
export const CompositeSliceType = "Slice" as const
|
|
@@ -43,7 +48,14 @@ export const SharedSliceVariationSchema = z.object({
|
|
|
43
48
|
docURL: z.string(),
|
|
44
49
|
version: z.string(),
|
|
45
50
|
display: z.optional(z.string()),
|
|
46
|
-
primary: z.optional(
|
|
51
|
+
primary: z.optional(
|
|
52
|
+
z.record(
|
|
53
|
+
z.string(),
|
|
54
|
+
z.union([NestableModelSchema, GroupModelSchema]) as z.ZodMiniType<
|
|
55
|
+
NestableModel | NestedGroupModel
|
|
56
|
+
>,
|
|
57
|
+
),
|
|
58
|
+
),
|
|
47
59
|
items: z.optional(z.record(z.string(), NestableModelSchema)),
|
|
48
60
|
})
|
|
49
61
|
|
|
@@ -68,34 +80,49 @@ export type SharedSliceRefModel = z.infer<typeof SharedSliceRefModelSchema>
|
|
|
68
80
|
|
|
69
81
|
// Used to represent a shared slice content which can only be
|
|
70
82
|
// of a given shared slice variation type.
|
|
71
|
-
export const
|
|
83
|
+
export const SharedSliceVariationContentModelSchema = z.object({
|
|
72
84
|
type: z.literal(SharedSliceType),
|
|
73
85
|
sliceName: z.string(),
|
|
74
86
|
variationID: z.string(),
|
|
75
87
|
fields: z.pick(SharedSliceVariationSchema, { primary: true, items: true }),
|
|
76
88
|
})
|
|
77
89
|
|
|
78
|
-
export type
|
|
90
|
+
export type SharedSliceVariationContentModel = z.infer<
|
|
91
|
+
typeof SharedSliceVariationContentModelSchema
|
|
92
|
+
>
|
|
79
93
|
|
|
80
94
|
// All
|
|
81
95
|
|
|
82
96
|
// Used when slices reference SharedSlice by ref (not full definition)
|
|
83
|
-
export const DynamicSliceModelSchema = z.union([
|
|
97
|
+
export const DynamicSliceModelSchema: z.ZodMiniType<DynamicSliceModel> = z.union([
|
|
84
98
|
CompositeSliceModelSchema,
|
|
85
99
|
LegacySliceModelSchema,
|
|
86
100
|
SharedSliceRefModelSchema,
|
|
87
101
|
])
|
|
88
102
|
|
|
89
|
-
export type DynamicSliceModel =
|
|
103
|
+
export type DynamicSliceModel = CompositeSliceModel | LegacySliceModel | SharedSliceRefModel
|
|
90
104
|
|
|
91
105
|
// Used when slices include full SharedSlice definition
|
|
92
|
-
export const StaticSliceModelSchema = z.union([
|
|
106
|
+
export const StaticSliceModelSchema: z.ZodMiniType<StaticSliceModel> = z.union([
|
|
93
107
|
CompositeSliceModelSchema,
|
|
94
108
|
LegacySliceModelSchema,
|
|
95
109
|
SharedSliceModelSchema,
|
|
96
110
|
])
|
|
97
111
|
|
|
98
|
-
export type StaticSliceModel =
|
|
112
|
+
export type StaticSliceModel = CompositeSliceModel | LegacySliceModel | SharedSliceModel
|
|
113
|
+
|
|
114
|
+
// Used to represent a slice content model as shared slice variations
|
|
115
|
+
// can only be of a given shared slice variation type.
|
|
116
|
+
export const SliceContentModelSchema: z.ZodMiniType<SliceContentModel> = z.union([
|
|
117
|
+
CompositeSliceModelSchema,
|
|
118
|
+
LegacySliceModelSchema,
|
|
119
|
+
SharedSliceVariationContentModelSchema,
|
|
120
|
+
])
|
|
121
|
+
|
|
122
|
+
export type SliceContentModel =
|
|
123
|
+
| CompositeSliceModel
|
|
124
|
+
| LegacySliceModel
|
|
125
|
+
| SharedSliceVariationContentModel
|
|
99
126
|
|
|
100
127
|
// Model types
|
|
101
128
|
export const SliceModelTypeSchema = z.union([
|
package/src/model/widget.ts
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { z } from "zod/mini"
|
|
2
2
|
|
|
3
|
+
import type { GroupModel } from "./group"
|
|
3
4
|
import { GroupModelSchema } from "./group"
|
|
5
|
+
import type { NestableModel } from "./nestable"
|
|
4
6
|
import { NestableModelSchema } from "./nestable"
|
|
5
7
|
import { SliceModelTypeSchema } from "./slice"
|
|
8
|
+
import type { DynamicSlicesModel, StaticSlicesModel } from "./slices"
|
|
6
9
|
import { DynamicSlicesModelSchema, StaticSlicesModelSchema } from "./slices"
|
|
10
|
+
import type { UIDModel } from "./uid"
|
|
7
11
|
import { UIDModelSchema } from "./uid"
|
|
8
12
|
|
|
9
13
|
// StaticWidget = UID | Nestable | Group | StaticSlices
|
|
10
|
-
export const StaticWidgetModelSchema = z.union([
|
|
14
|
+
export const StaticWidgetModelSchema: z.ZodMiniType<StaticWidgetModel> = z.union([
|
|
11
15
|
UIDModelSchema,
|
|
12
16
|
NestableModelSchema,
|
|
13
17
|
GroupModelSchema,
|
|
14
18
|
StaticSlicesModelSchema,
|
|
15
19
|
])
|
|
16
20
|
|
|
17
|
-
export type StaticWidgetModel =
|
|
21
|
+
export type StaticWidgetModel = UIDModel | NestableModel | GroupModel | StaticSlicesModel
|
|
18
22
|
|
|
19
23
|
// DynamicWidget = UID | Nestable | Group | DynamicSlices
|
|
20
|
-
export const DynamicWidgetModelSchema = z.union([
|
|
24
|
+
export const DynamicWidgetModelSchema: z.ZodMiniType<DynamicWidgetModel> = z.union([
|
|
21
25
|
UIDModelSchema,
|
|
22
26
|
NestableModelSchema,
|
|
23
27
|
GroupModelSchema,
|
|
24
28
|
DynamicSlicesModelSchema,
|
|
25
29
|
])
|
|
26
30
|
|
|
27
|
-
export type DynamicWidgetModel =
|
|
31
|
+
export type DynamicWidgetModel = UIDModel | NestableModel | GroupModel | DynamicSlicesModel
|
|
28
32
|
|
|
29
33
|
// FieldModelType - all possible field type strings
|
|
30
34
|
export const FieldModelTypeSchema = z.enum([
|
package/src/zod4.ts
CHANGED
|
@@ -1,160 +1,186 @@
|
|
|
1
1
|
// Common
|
|
2
|
-
import { AssetSchema } from "./common/asset"
|
|
3
|
-
import { EmbedSchema } from "./common/embed"
|
|
4
|
-
import { HexaColorCodeSchema } from "./common/hexaColorCode"
|
|
5
|
-
import { NonEmptyStringSchema } from "./common/nonEmptyString"
|
|
6
|
-
import { WidgetKeySchema } from "./common/widgetKey"
|
|
2
|
+
import { AssetSchema as rawAssetSchema } from "./common/asset"
|
|
3
|
+
import { EmbedSchema as rawEmbedSchema } from "./common/embed"
|
|
4
|
+
import { HexaColorCodeSchema as rawHexaColorCodeSchema } from "./common/hexaColorCode"
|
|
5
|
+
import { NonEmptyStringSchema as rawNonEmptyStringSchema } from "./common/nonEmptyString"
|
|
6
|
+
import { WidgetKeySchema as rawWidgetKeySchema } from "./common/widgetKey"
|
|
7
7
|
// Content
|
|
8
|
-
import { BooleanContentSchema } from "./content/boolean"
|
|
9
|
-
import { DocumentContentSchema } from "./content/document"
|
|
10
|
-
import { EmbedContentSchema } from "./content/embed"
|
|
11
|
-
import { EmptyContentSchema } from "./content/empty"
|
|
8
|
+
import { BooleanContentSchema as rawBooleanContentSchema } from "./content/boolean"
|
|
9
|
+
import { DocumentContentSchema as rawDocumentContentSchema } from "./content/document"
|
|
10
|
+
import { EmbedContentSchema as rawEmbedContentSchema } from "./content/embed"
|
|
11
|
+
import { EmptyContentSchema as rawEmptyContentSchema } from "./content/empty"
|
|
12
12
|
import {
|
|
13
|
-
ColorContentSchema,
|
|
14
|
-
DateContentSchema,
|
|
15
|
-
NumberContentSchema,
|
|
16
|
-
RangeContentSchema,
|
|
17
|
-
SelectContentSchema,
|
|
18
|
-
TextContentSchema,
|
|
19
|
-
TimestampContentSchema,
|
|
20
|
-
FieldContentSchema,
|
|
13
|
+
ColorContentSchema as rawColorContentSchema,
|
|
14
|
+
DateContentSchema as rawDateContentSchema,
|
|
15
|
+
NumberContentSchema as rawNumberContentSchema,
|
|
16
|
+
RangeContentSchema as rawRangeContentSchema,
|
|
17
|
+
SelectContentSchema as rawSelectContentSchema,
|
|
18
|
+
TextContentSchema as rawTextContentSchema,
|
|
19
|
+
TimestampContentSchema as rawTimestampContentSchema,
|
|
20
|
+
FieldContentSchema as rawFieldContentSchema,
|
|
21
21
|
} from "./content/field"
|
|
22
|
-
import { GeoPointContentSchema } from "./content/geopoint"
|
|
23
|
-
import { GroupContentSchema, GroupItemContentSchema } from "./content/group"
|
|
24
|
-
import { ImageContentSchema } from "./content/image"
|
|
25
|
-
import { IntegrationFieldContentSchema } from "./content/integrationField"
|
|
26
|
-
import { LinkContentSchema } from "./content/link"
|
|
27
|
-
import { NestableContentSchema } from "./content/nestable"
|
|
28
|
-
import { RepeatableContentSchema } from "./content/repeatable"
|
|
29
|
-
import { RichTextContentSchema } from "./content/richText"
|
|
30
|
-
import { SeparatorContentSchema } from "./content/separator"
|
|
22
|
+
import { GeoPointContentSchema as rawGeoPointContentSchema } from "./content/geopoint"
|
|
31
23
|
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
GroupContentSchema as rawGroupContentSchema,
|
|
25
|
+
GroupItemContentSchema as rawGroupItemContentSchema,
|
|
26
|
+
} from "./content/group"
|
|
27
|
+
import { ImageContentSchema as rawImageContentSchema } from "./content/image"
|
|
28
|
+
import { IntegrationFieldContentSchema as rawIntegrationFieldContentSchema } from "./content/integrationField"
|
|
29
|
+
import { LinkContentSchema as rawLinkContentSchema } from "./content/link"
|
|
30
|
+
import { NestableContentSchema as rawNestableContentSchema } from "./content/nestable"
|
|
31
|
+
import { RepeatableContentSchema as rawRepeatableContentSchema } from "./content/repeatable"
|
|
32
|
+
import {
|
|
33
|
+
RichTextContentSchema as rawRichTextContentSchema,
|
|
34
|
+
RichTextContentBlockSchema as rawRichTextContentBlockSchema,
|
|
35
|
+
RichTextContentSpanSchema as rawRichTextContentSpanSchema,
|
|
36
|
+
} from "./content/richText"
|
|
37
|
+
import { SeparatorContentSchema as rawSeparatorContentSchema } from "./content/separator"
|
|
38
|
+
import {
|
|
39
|
+
CompositeSliceContentSchema as rawCompositeSliceContentSchema,
|
|
40
|
+
LegacySliceContentSchema as rawLegacySliceContentSchema,
|
|
41
|
+
SharedSliceContentSchema as rawSharedSliceContentSchema,
|
|
42
|
+
SliceContentSchema as rawSliceContentSchema,
|
|
36
43
|
} from "./content/slice"
|
|
37
44
|
import {
|
|
38
|
-
LegacySliceItemContentSchema,
|
|
39
|
-
CompositeSliceItemContentSchema,
|
|
40
|
-
SharedSliceItemContentSchema,
|
|
41
|
-
SliceItemContentSchema,
|
|
42
|
-
SlicesContentSchema,
|
|
45
|
+
LegacySliceItemContentSchema as rawLegacySliceItemContentSchema,
|
|
46
|
+
CompositeSliceItemContentSchema as rawCompositeSliceItemContentSchema,
|
|
47
|
+
SharedSliceItemContentSchema as rawSharedSliceItemContentSchema,
|
|
48
|
+
SliceItemContentSchema as rawSliceItemContentSchema,
|
|
49
|
+
SlicesContentSchema as rawSlicesContentSchema,
|
|
43
50
|
} from "./content/slices"
|
|
44
|
-
import { TableContentSchema } from "./content/table"
|
|
45
|
-
import { UIDContentSchema } from "./content/uid"
|
|
46
|
-
import { WidgetContentSchema } from "./content/widget"
|
|
51
|
+
import { TableContentSchema as rawTableContentSchema } from "./content/table"
|
|
52
|
+
import { UIDContentSchema as rawUIDContentSchema } from "./content/uid"
|
|
53
|
+
import { WidgetContentSchema as rawWidgetContentSchema } from "./content/widget"
|
|
47
54
|
// Model
|
|
48
|
-
import { BooleanModelSchema } from "./model/boolean"
|
|
49
|
-
import { ColorModelSchema } from "./model/color"
|
|
50
|
-
import {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
55
|
+
import { BooleanModelSchema as rawBooleanModelSchema } from "./model/boolean"
|
|
56
|
+
import { ColorModelSchema as rawColorModelSchema } from "./model/color"
|
|
57
|
+
import {
|
|
58
|
+
StaticCustomTypeModelSchema as rawStaticCustomTypeModelSchema,
|
|
59
|
+
CustomTypeModelSchema as rawCustomTypeModelSchema,
|
|
60
|
+
} from "./model/customType"
|
|
61
|
+
import { DateModelSchema as rawDateModelSchema } from "./model/date"
|
|
62
|
+
import { EmbedModelSchema as rawEmbedModelSchema } from "./model/embed"
|
|
63
|
+
import { GeoPointModelSchema as rawGeoPointModelSchema } from "./model/geopoint"
|
|
64
|
+
import {
|
|
65
|
+
GroupModelSchema as rawGroupModelSchema,
|
|
66
|
+
NestedGroupModelSchema as rawNestedGroupModelSchema,
|
|
67
|
+
} from "./model/group"
|
|
68
|
+
import { ImageModelSchema as rawImageModelSchema } from "./model/image"
|
|
69
|
+
import { IntegrationFieldModelSchema as rawIntegrationFieldModelSchema } from "./model/integrationField"
|
|
70
|
+
import { LinkModelSchema as rawLinkModelSchema } from "./model/link"
|
|
71
|
+
import { NestableModelSchema as rawNestableModelSchema } from "./model/nestable"
|
|
72
|
+
import { NumberModelSchema as rawNumberModelSchema } from "./model/number"
|
|
73
|
+
import { RangeModelSchema as rawRangeModelSchema } from "./model/range"
|
|
74
|
+
import { RichTextModelSchema as rawRichTextModelSchema } from "./model/richText"
|
|
65
75
|
import {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
StaticSectionModelSchema as rawStaticSectionModelSchema,
|
|
77
|
+
DynamicSectionModelSchema as rawDynamicSectionModelSchema,
|
|
78
|
+
} from "./model/section"
|
|
79
|
+
import { SelectModelSchema as rawSelectModelSchema } from "./model/select"
|
|
80
|
+
import { SeparatorModelSchema as rawSeparatorModelSchema } from "./model/separator"
|
|
81
|
+
import {
|
|
82
|
+
LegacySliceModelSchema as rawLegacySliceModelSchema,
|
|
83
|
+
CompositeSliceModelSchema as rawCompositeSliceModelSchema,
|
|
84
|
+
SharedSliceModelSchema as rawSharedSliceModelSchema,
|
|
85
|
+
SharedSliceRefModelSchema as rawSharedSliceRefModelSchema,
|
|
86
|
+
StaticSliceModelSchema as rawStaticSliceModelSchema,
|
|
87
|
+
DynamicSliceModelSchema as rawDynamicSliceModelSchema,
|
|
88
|
+
SliceContentModelSchema as rawSliceContentModelSchema,
|
|
72
89
|
} from "./model/slice"
|
|
73
|
-
import {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
90
|
+
import {
|
|
91
|
+
DynamicSlicesModelSchema as rawDynamicSlicesModelSchema,
|
|
92
|
+
StaticSlicesModelSchema as rawStaticSlicesModelSchema,
|
|
93
|
+
} from "./model/slices"
|
|
94
|
+
import { TableModelSchema as rawTableModelSchema } from "./model/table"
|
|
95
|
+
import { TextModelSchema as rawTextModelSchema } from "./model/text"
|
|
96
|
+
import { TimestampModelSchema as rawTimestampModelSchema } from "./model/timestamp"
|
|
97
|
+
import { UIDModelSchema as rawUIDModelSchema } from "./model/uid"
|
|
98
|
+
import {
|
|
99
|
+
StaticWidgetModelSchema as rawStaticWidgetModelSchema,
|
|
100
|
+
DynamicWidgetModelSchema as rawDynamicWidgetModelSchema,
|
|
101
|
+
} from "./model/widget"
|
|
79
102
|
|
|
80
103
|
// Common
|
|
81
|
-
export const
|
|
82
|
-
export const
|
|
83
|
-
export const
|
|
84
|
-
export const
|
|
85
|
-
export const
|
|
104
|
+
export const AssetSchema = toZod4(rawAssetSchema)
|
|
105
|
+
export const EmbedSchema = toZod4(rawEmbedSchema)
|
|
106
|
+
export const HexaColorCodeSchema = toZod4(rawHexaColorCodeSchema)
|
|
107
|
+
export const NonEmptyStringSchema = toZod4(rawNonEmptyStringSchema)
|
|
108
|
+
export const WidgetKeySchema = toZod4(rawWidgetKeySchema)
|
|
86
109
|
|
|
87
110
|
// Content
|
|
88
|
-
export const
|
|
89
|
-
export const
|
|
90
|
-
export const
|
|
91
|
-
export const
|
|
92
|
-
export const
|
|
93
|
-
export const
|
|
94
|
-
export const
|
|
95
|
-
export const
|
|
96
|
-
export const
|
|
97
|
-
export const
|
|
98
|
-
export const
|
|
99
|
-
export const
|
|
100
|
-
export const
|
|
101
|
-
export const
|
|
102
|
-
export const
|
|
103
|
-
export const
|
|
104
|
-
export const
|
|
105
|
-
export const
|
|
106
|
-
export const
|
|
107
|
-
export const
|
|
108
|
-
export const
|
|
109
|
-
export const
|
|
110
|
-
export const
|
|
111
|
-
export const
|
|
112
|
-
export const
|
|
113
|
-
export const
|
|
114
|
-
export const
|
|
115
|
-
export const
|
|
116
|
-
export const
|
|
117
|
-
export const
|
|
118
|
-
export const
|
|
119
|
-
export const
|
|
120
|
-
export const
|
|
121
|
-
export const
|
|
111
|
+
export const BooleanContentSchema = toZod4(rawBooleanContentSchema)
|
|
112
|
+
export const ColorContentSchema = toZod4(rawColorContentSchema)
|
|
113
|
+
export const DateContentSchema = toZod4(rawDateContentSchema)
|
|
114
|
+
export const EmptyContentSchema = toZod4(rawEmptyContentSchema)
|
|
115
|
+
export const GeoPointContentSchema = toZod4(rawGeoPointContentSchema)
|
|
116
|
+
export const LinkContentSchema = toZod4(rawLinkContentSchema)
|
|
117
|
+
export const NumberContentSchema = toZod4(rawNumberContentSchema)
|
|
118
|
+
export const RangeContentSchema = toZod4(rawRangeContentSchema)
|
|
119
|
+
export const SelectContentSchema = toZod4(rawSelectContentSchema)
|
|
120
|
+
export const SeparatorContentSchema = toZod4(rawSeparatorContentSchema)
|
|
121
|
+
export const SharedSliceContentSchema = toZod4(rawSharedSliceContentSchema)
|
|
122
|
+
export const TextContentSchema = toZod4(rawTextContentSchema)
|
|
123
|
+
export const TimestampContentSchema = toZod4(rawTimestampContentSchema)
|
|
124
|
+
export const FieldContentSchema = toZod4(rawFieldContentSchema)
|
|
125
|
+
export const UIDContentSchema = toZod4(rawUIDContentSchema)
|
|
126
|
+
export const IntegrationFieldContentSchema = toZod4(rawIntegrationFieldContentSchema)
|
|
127
|
+
export const EmbedContentSchema = toZod4(rawEmbedContentSchema)
|
|
128
|
+
export const ImageContentSchema = toZod4(rawImageContentSchema)
|
|
129
|
+
export const RichTextContentSchema = toZod4(rawRichTextContentSchema)
|
|
130
|
+
export const RichTextContentBlockSchema = toZod4(rawRichTextContentBlockSchema)
|
|
131
|
+
export const RichTextContentSpanSchema = toZod4(rawRichTextContentSpanSchema)
|
|
132
|
+
export const TableContentSchema = toZod4(rawTableContentSchema)
|
|
133
|
+
export const RepeatableContentSchema = toZod4(rawRepeatableContentSchema)
|
|
134
|
+
export const NestableContentSchema = toZod4(rawNestableContentSchema)
|
|
135
|
+
export const GroupContentSchema = toZod4(rawGroupContentSchema)
|
|
136
|
+
export const GroupItemContentSchema = toZod4(rawGroupItemContentSchema)
|
|
137
|
+
export const CompositeSliceContentSchema = toZod4(rawCompositeSliceContentSchema)
|
|
138
|
+
export const LegacySliceContentSchema = toZod4(rawLegacySliceContentSchema)
|
|
139
|
+
export const SliceContentSchema = toZod4(rawSliceContentSchema)
|
|
140
|
+
export const LegacySliceItemContentSchema = toZod4(rawLegacySliceItemContentSchema)
|
|
141
|
+
export const CompositeSliceItemContentSchema = toZod4(rawCompositeSliceItemContentSchema)
|
|
142
|
+
export const SharedSliceItemContentSchema = toZod4(rawSharedSliceItemContentSchema)
|
|
143
|
+
export const SliceItemContentSchema = toZod4(rawSliceItemContentSchema)
|
|
144
|
+
export const SlicesContentSchema = toZod4(rawSlicesContentSchema)
|
|
145
|
+
export const WidgetContentSchema = toZod4(rawWidgetContentSchema)
|
|
146
|
+
export const DocumentContentSchema = toZod4(rawDocumentContentSchema)
|
|
122
147
|
|
|
123
148
|
// Model
|
|
124
|
-
export const
|
|
125
|
-
export const
|
|
126
|
-
export const
|
|
127
|
-
export const
|
|
128
|
-
export const
|
|
129
|
-
export const
|
|
130
|
-
export const
|
|
131
|
-
export const
|
|
132
|
-
export const
|
|
133
|
-
export const
|
|
134
|
-
export const
|
|
135
|
-
export const
|
|
136
|
-
export const
|
|
137
|
-
export const
|
|
138
|
-
export const
|
|
139
|
-
export const
|
|
140
|
-
export const
|
|
141
|
-
export const
|
|
142
|
-
export const
|
|
143
|
-
export const
|
|
144
|
-
export const
|
|
145
|
-
export const
|
|
146
|
-
export const
|
|
147
|
-
export const
|
|
148
|
-
export const
|
|
149
|
-
export const
|
|
150
|
-
export const
|
|
151
|
-
export const
|
|
152
|
-
export const
|
|
153
|
-
export const
|
|
154
|
-
export const
|
|
155
|
-
export const
|
|
156
|
-
export const
|
|
157
|
-
export const
|
|
149
|
+
export const BooleanModelSchema = toZod4(rawBooleanModelSchema)
|
|
150
|
+
export const ColorModelSchema = toZod4(rawColorModelSchema)
|
|
151
|
+
export const DateModelSchema = toZod4(rawDateModelSchema)
|
|
152
|
+
export const EmbedModelSchema = toZod4(rawEmbedModelSchema)
|
|
153
|
+
export const GeoPointModelSchema = toZod4(rawGeoPointModelSchema)
|
|
154
|
+
export const ImageModelSchema = toZod4(rawImageModelSchema)
|
|
155
|
+
export const IntegrationFieldModelSchema = toZod4(rawIntegrationFieldModelSchema)
|
|
156
|
+
export const LinkModelSchema = toZod4(rawLinkModelSchema)
|
|
157
|
+
export const NestableModelSchema = toZod4(rawNestableModelSchema)
|
|
158
|
+
export const NumberModelSchema = toZod4(rawNumberModelSchema)
|
|
159
|
+
export const RangeModelSchema = toZod4(rawRangeModelSchema)
|
|
160
|
+
export const RichTextModelSchema = toZod4(rawRichTextModelSchema)
|
|
161
|
+
export const SelectModelSchema = toZod4(rawSelectModelSchema)
|
|
162
|
+
export const SeparatorModelSchema = toZod4(rawSeparatorModelSchema)
|
|
163
|
+
export const SharedSliceModelSchema = toZod4(rawSharedSliceModelSchema)
|
|
164
|
+
export const TableModelSchema = toZod4(rawTableModelSchema)
|
|
165
|
+
export const TextModelSchema = toZod4(rawTextModelSchema)
|
|
166
|
+
export const TimestampModelSchema = toZod4(rawTimestampModelSchema)
|
|
167
|
+
export const UIDModelSchema = toZod4(rawUIDModelSchema)
|
|
168
|
+
export const GroupModelSchema = toZod4(rawGroupModelSchema)
|
|
169
|
+
export const NestedGroupModelSchema = toZod4(rawNestedGroupModelSchema)
|
|
170
|
+
export const SharedSliceRefModelSchema = toZod4(rawSharedSliceRefModelSchema)
|
|
171
|
+
export const CompositeSliceModelSchema = toZod4(rawCompositeSliceModelSchema)
|
|
172
|
+
export const LegacySliceModelSchema = toZod4(rawLegacySliceModelSchema)
|
|
173
|
+
export const DynamicSliceModelSchema = toZod4(rawDynamicSliceModelSchema)
|
|
174
|
+
export const StaticSliceModelSchema = toZod4(rawStaticSliceModelSchema)
|
|
175
|
+
export const SliceContentModelSchema = toZod4(rawSliceContentModelSchema)
|
|
176
|
+
export const DynamicSlicesModelSchema = toZod4(rawDynamicSlicesModelSchema)
|
|
177
|
+
export const StaticSlicesModelSchema = toZod4(rawStaticSlicesModelSchema)
|
|
178
|
+
export const StaticWidgetModelSchema = toZod4(rawStaticWidgetModelSchema)
|
|
179
|
+
export const DynamicWidgetModelSchema = toZod4(rawDynamicWidgetModelSchema)
|
|
180
|
+
export const StaticSectionModelSchema = toZod4(rawStaticSectionModelSchema)
|
|
181
|
+
export const DynamicSectionModelSchema = toZod4(rawDynamicSectionModelSchema)
|
|
182
|
+
export const StaticCustomTypeModelSchema = toZod4(rawStaticCustomTypeModelSchema)
|
|
183
|
+
export const CustomTypeModelSchema = toZod4(rawCustomTypeModelSchema)
|
|
158
184
|
|
|
159
185
|
function toZod4<T>(type: T): T {
|
|
160
186
|
return type
|