@prismicio/types-internal 3.17.0 → 4.0.0-canary.3fe5f1e
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/README.md +36 -20
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/common/asset.d.ts +22 -0
- package/dist/common/asset.d.ts.map +1 -0
- package/dist/common/asset.js +21 -0
- package/dist/common/asset.js.map +1 -0
- package/dist/common/embed.d.ts +21 -0
- package/dist/common/embed.d.ts.map +1 -0
- package/dist/common/embed.js +20 -0
- package/dist/common/embed.js.map +1 -0
- package/dist/common/hexaColorCode.d.ts +8 -0
- package/dist/common/hexaColorCode.d.ts.map +1 -0
- package/dist/common/hexaColorCode.js +8 -0
- package/dist/common/hexaColorCode.js.map +1 -0
- package/dist/common/nonEmptyString.d.ts +8 -0
- package/dist/common/nonEmptyString.d.ts.map +1 -0
- package/dist/common/nonEmptyString.js +7 -0
- package/dist/common/nonEmptyString.js.map +1 -0
- package/dist/common/widgetKey.d.ts +8 -0
- package/dist/common/widgetKey.d.ts.map +1 -0
- package/dist/common/widgetKey.js +8 -0
- package/dist/common/widgetKey.js.map +1 -0
- package/dist/content/boolean.d.ts +11 -0
- package/dist/content/boolean.d.ts.map +1 -0
- package/dist/content/boolean.js +11 -0
- package/dist/content/boolean.js.map +1 -0
- package/dist/content/codec/boolean.js +31 -0
- package/dist/content/codec/boolean.js.map +1 -0
- package/dist/content/codec/document.js +49 -0
- package/dist/content/codec/document.js.map +1 -0
- package/dist/content/codec/embed.js +42 -0
- package/dist/content/codec/embed.js.map +1 -0
- package/dist/content/codec/empty.js +35 -0
- package/dist/content/codec/empty.js.map +1 -0
- package/dist/content/codec/field.js +41 -0
- package/dist/content/codec/field.js.map +1 -0
- package/dist/content/codec/geopoint.js +32 -0
- package/dist/content/codec/geopoint.js.map +1 -0
- package/dist/content/codec/group.js +127 -0
- package/dist/content/codec/group.js.map +1 -0
- package/dist/content/codec/image.js +44 -0
- package/dist/content/codec/image.js.map +1 -0
- package/dist/content/codec/integrationField.js +31 -0
- package/dist/content/codec/integrationField.js.map +1 -0
- package/dist/content/codec/legacyContentCtx.d.ts +50 -0
- package/dist/content/codec/legacyContentCtx.d.ts.map +1 -0
- package/dist/content/codec/legacyContentCtx.js +68 -0
- package/dist/content/codec/legacyContentCtx.js.map +1 -0
- package/dist/content/codec/link.js +93 -0
- package/dist/content/codec/link.js.map +1 -0
- package/dist/content/codec/nestable.js +91 -0
- package/dist/content/codec/nestable.js.map +1 -0
- package/dist/content/codec/repeatable.js +56 -0
- package/dist/content/codec/repeatable.js.map +1 -0
- package/dist/content/codec/richText.js +87 -0
- package/dist/content/codec/richText.js.map +1 -0
- package/dist/content/codec/separator.js +26 -0
- package/dist/content/codec/separator.js.map +1 -0
- package/dist/content/codec/slice.js +220 -0
- package/dist/content/codec/slice.js.map +1 -0
- package/dist/content/codec/slices.js +106 -0
- package/dist/content/codec/slices.js.map +1 -0
- package/dist/content/codec/table.js +56 -0
- package/dist/content/codec/table.js.map +1 -0
- package/dist/content/codec/uid.js +31 -0
- package/dist/content/codec/uid.js.map +1 -0
- package/dist/content/codec/widget.js +39 -0
- package/dist/content/codec/widget.js.map +1 -0
- package/dist/content/document.d.ts +9 -0
- package/dist/content/document.d.ts.map +1 -0
- package/dist/content/document.js +9 -0
- package/dist/content/document.js.map +1 -0
- package/dist/content/embed.d.ts +24 -0
- package/dist/content/embed.d.ts.map +1 -0
- package/dist/content/embed.js +12 -0
- package/dist/content/embed.js.map +1 -0
- package/dist/content/empty.d.ts +11 -0
- package/dist/content/empty.d.ts.map +1 -0
- package/dist/content/empty.js +11 -0
- package/dist/content/empty.js.map +1 -0
- package/dist/content/field.d.ts +49 -0
- package/dist/content/field.d.ts.map +1 -0
- package/dist/content/field.js +52 -0
- package/dist/content/field.js.map +1 -0
- package/dist/content/geopoint.d.ts +14 -0
- package/dist/content/geopoint.d.ts.map +1 -0
- package/dist/content/geopoint.js +9 -0
- package/dist/content/geopoint.js.map +1 -0
- package/dist/content/group.d.ts +19 -0
- package/dist/content/group.d.ts.map +1 -0
- package/dist/content/group.js +19 -0
- package/dist/content/group.js.map +1 -0
- package/dist/content/image.d.ts +52 -0
- package/dist/content/image.d.ts.map +1 -0
- package/dist/content/image.js +10 -0
- package/dist/content/image.js.map +1 -0
- package/dist/content/integrationField.d.ts +11 -0
- package/dist/content/integrationField.d.ts.map +1 -0
- package/dist/content/integrationField.js +11 -0
- package/dist/content/integrationField.js.map +1 -0
- package/dist/content/legacy/boolean.d.ts +1 -0
- package/dist/content/legacy/boolean.js +7 -0
- package/dist/content/legacy/boolean.js.map +1 -0
- package/dist/content/legacy/document.d.ts +8 -0
- package/dist/content/legacy/document.d.ts.map +1 -0
- package/dist/content/legacy/document.js +15 -0
- package/dist/content/legacy/document.js.map +1 -0
- package/dist/content/legacy/embed.d.ts +1 -0
- package/dist/content/legacy/embed.js +23 -0
- package/dist/content/legacy/embed.js.map +1 -0
- package/dist/content/legacy/empty.d.ts +1 -0
- package/dist/content/legacy/empty.js +7 -0
- package/dist/content/legacy/empty.js.map +1 -0
- package/dist/content/legacy/field.d.ts +1 -0
- package/dist/content/legacy/field.js +7 -0
- package/dist/content/legacy/field.js.map +1 -0
- package/dist/content/legacy/geopoint.d.ts +1 -0
- package/dist/content/legacy/geopoint.js +10 -0
- package/dist/content/legacy/geopoint.js.map +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 +10 -0
- package/dist/content/legacy/group.js.map +1 -0
- package/dist/content/legacy/image.d.ts +1 -0
- package/dist/content/legacy/image.js +33 -0
- package/dist/content/legacy/image.js.map +1 -0
- package/dist/content/legacy/integrationField.d.ts +1 -0
- package/dist/content/legacy/integrationField.js +7 -0
- package/dist/content/legacy/integrationField.js.map +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 +88 -0
- package/dist/content/legacy/link.js.map +1 -0
- package/dist/content/legacy/nestable.d.ts +1 -0
- package/dist/content/legacy/nestable.js +32 -0
- package/dist/content/legacy/nestable.js.map +1 -0
- package/dist/content/legacy/repeatable.d.ts +1 -0
- package/dist/content/legacy/repeatable.js +7 -0
- package/dist/content/legacy/repeatable.js.map +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 +100 -0
- package/dist/content/legacy/richText.js.map +1 -0
- package/dist/content/legacy/separator.d.ts +1 -0
- package/dist/content/legacy/separator.js +7 -0
- package/dist/content/legacy/separator.js.map +1 -0
- package/dist/content/legacy/slice.js +22 -0
- package/dist/content/legacy/slice.js.map +1 -0
- package/dist/content/legacy/slices.js +13 -0
- package/dist/content/legacy/slices.js.map +1 -0
- package/dist/content/legacy/table.d.ts +1 -0
- package/dist/content/legacy/table.js +19 -0
- package/dist/content/legacy/table.js.map +1 -0
- package/dist/content/legacy/uid.js +7 -0
- package/dist/content/legacy/uid.js.map +1 -0
- package/dist/content/link.d.ts +163 -0
- package/dist/content/link.d.ts.map +1 -0
- package/dist/content/link.js +50 -0
- package/dist/content/link.js.map +1 -0
- package/dist/content/nestable.d.ts +19 -0
- package/dist/content/nestable.d.ts.map +1 -0
- package/dist/content/nestable.js +56 -0
- package/dist/content/nestable.js.map +1 -0
- package/dist/content/repeatable.d.ts +97 -0
- package/dist/content/repeatable.d.ts.map +1 -0
- package/dist/content/repeatable.js +17 -0
- package/dist/content/repeatable.js.map +1 -0
- package/dist/content/richText.d.ts +91 -0
- package/dist/content/richText.d.ts.map +1 -0
- package/dist/content/richText.js +24 -0
- package/dist/content/richText.js.map +1 -0
- package/dist/content/separator.d.ts +10 -0
- package/dist/content/separator.d.ts.map +1 -0
- package/dist/content/separator.js +8 -0
- package/dist/content/separator.js.map +1 -0
- package/dist/content/slice.d.ts +24 -0
- package/dist/content/slice.d.ts.map +1 -0
- package/dist/content/slice.js +27 -0
- package/dist/content/slice.js.map +1 -0
- package/dist/content/slices.d.ts +56 -0
- package/dist/content/slices.d.ts.map +1 -0
- package/dist/content/slices.js +24 -0
- package/dist/content/slices.js.map +1 -0
- package/dist/content/table.d.ts +21 -0
- package/dist/content/table.d.ts.map +1 -0
- package/dist/content/table.js +13 -0
- package/dist/content/table.js.map +1 -0
- package/dist/content/uid.d.ts +11 -0
- package/dist/content/uid.d.ts.map +1 -0
- package/dist/content/uid.js +11 -0
- package/dist/content/uid.js.map +1 -0
- package/dist/content/widget.d.ts +11 -0
- package/dist/content/widget.d.ts.map +1 -0
- package/dist/content/widget.js +16 -0
- package/dist/content/widget.js.map +1 -0
- package/dist/helpers/contentPath.d.ts +15 -0
- package/dist/helpers/contentPath.d.ts.map +1 -0
- package/dist/helpers/contentPath.js +30 -0
- package/dist/helpers/contentPath.js.map +1 -0
- package/dist/helpers/customTypeModel.d.ts +15 -0
- package/dist/helpers/customTypeModel.d.ts.map +1 -0
- package/dist/helpers/customTypeModel.js +85 -0
- package/dist/helpers/customTypeModel.js.map +1 -0
- package/dist/helpers/documentContent.d.ts +20 -0
- package/dist/helpers/documentContent.d.ts.map +1 -0
- package/dist/helpers/documentContent.js +64 -0
- package/dist/helpers/documentContent.js.map +1 -0
- package/dist/helpers/sliceContent.d.ts +12 -0
- package/dist/helpers/sliceContent.d.ts.map +1 -0
- package/dist/helpers/sliceContent.js +60 -0
- package/dist/helpers/sliceContent.js.map +1 -0
- package/dist/helpers/traverseContent.d.ts +84 -0
- package/dist/helpers/traverseContent.d.ts.map +1 -0
- package/dist/helpers/traverseContent.js +374 -0
- package/dist/helpers/traverseContent.js.map +1 -0
- package/dist/helpers/traverseContentWithModel.d.ts +84 -0
- package/dist/helpers/traverseContentWithModel.d.ts.map +1 -0
- package/dist/helpers/traverseContentWithModel.js +388 -0
- package/dist/helpers/traverseContentWithModel.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +9 -0
- package/dist/io-ts.d.ts +4363 -0
- package/dist/io-ts.d.ts.map +1 -0
- package/dist/io-ts.js +220 -0
- package/dist/io-ts.js.map +1 -0
- package/dist/model/boolean.d.ts +16 -0
- package/dist/model/boolean.d.ts.map +1 -0
- package/dist/model/boolean.js +16 -0
- package/dist/model/boolean.js.map +1 -0
- package/dist/model/color.d.ts +15 -0
- package/dist/model/color.d.ts.map +1 -0
- package/dist/model/color.js +15 -0
- package/dist/model/color.js.map +1 -0
- package/dist/model/customType.d.ts +31 -0
- package/dist/model/customType.d.ts.map +1 -0
- package/dist/model/customType.js +18 -0
- package/dist/model/customType.js.map +1 -0
- package/dist/model/date.d.ts +16 -0
- package/dist/model/date.d.ts.map +1 -0
- package/dist/model/date.js +16 -0
- package/dist/model/date.js.map +1 -0
- package/dist/model/embed.d.ts +16 -0
- package/dist/model/embed.d.ts.map +1 -0
- package/dist/model/embed.js +16 -0
- package/dist/model/embed.js.map +1 -0
- package/dist/model/geopoint.d.ts +14 -0
- package/dist/model/geopoint.d.ts.map +1 -0
- package/dist/model/geopoint.js +12 -0
- package/dist/model/geopoint.js.map +1 -0
- package/dist/model/group.d.ts +567 -0
- package/dist/model/group.d.ts.map +1 -0
- package/dist/model/group.js +23 -0
- package/dist/model/group.js.map +1 -0
- package/dist/model/image.d.ts +24 -0
- package/dist/model/image.d.ts.map +1 -0
- package/dist/model/image.js +41 -0
- package/dist/model/image.js.map +1 -0
- package/dist/model/integrationField.d.ts +16 -0
- package/dist/model/integrationField.d.ts.map +1 -0
- package/dist/model/integrationField.js +16 -0
- package/dist/model/integrationField.js.map +1 -0
- package/dist/model/link.d.ts +48 -0
- package/dist/model/link.d.ts.map +1 -0
- package/dist/model/link.js +94 -0
- package/dist/model/link.js.map +1 -0
- package/dist/model/nestable.d.ts +23 -0
- package/dist/model/nestable.d.ts.map +1 -0
- package/dist/model/nestable.js +40 -0
- package/dist/model/nestable.js.map +1 -0
- package/dist/model/number.d.ts +18 -0
- package/dist/model/number.d.ts.map +1 -0
- package/dist/model/number.js +19 -0
- package/dist/model/number.js.map +1 -0
- package/dist/model/range.d.ts +18 -0
- package/dist/model/range.d.ts.map +1 -0
- package/dist/model/range.js +19 -0
- package/dist/model/range.js.map +1 -0
- package/dist/model/richText.d.ts +24 -0
- package/dist/model/richText.d.ts.map +1 -0
- package/dist/model/richText.js +73 -0
- package/dist/model/richText.js.map +1 -0
- package/dist/model/section.d.ts +11 -0
- package/dist/model/section.d.ts.map +1 -0
- package/dist/model/section.js +10 -0
- package/dist/model/section.js.map +1 -0
- package/dist/model/select.d.ts +17 -0
- package/dist/model/select.d.ts.map +1 -0
- package/dist/model/select.js +22 -0
- package/dist/model/select.js.map +1 -0
- package/dist/model/separator.d.ts +13 -0
- package/dist/model/separator.d.ts.map +1 -0
- package/dist/model/separator.js +11 -0
- package/dist/model/separator.js.map +1 -0
- package/dist/model/slice.d.ts +1476 -0
- package/dist/model/slice.d.ts.map +1 -0
- package/dist/model/slice.js +68 -0
- package/dist/model/slice.js.map +1 -0
- package/dist/model/slices.d.ts +33 -0
- package/dist/model/slices.d.ts.map +1 -0
- package/dist/model/slices.js +29 -0
- package/dist/model/slices.js.map +1 -0
- package/dist/model/table.d.ts +14 -0
- package/dist/model/table.d.ts.map +1 -0
- package/dist/model/table.js +22 -0
- package/dist/model/table.js.map +1 -0
- package/dist/model/text.d.ts +16 -0
- package/dist/model/text.d.ts.map +1 -0
- package/dist/model/text.js +16 -0
- package/dist/model/text.js.map +1 -0
- package/dist/model/timestamp.d.ts +16 -0
- package/dist/model/timestamp.d.ts.map +1 -0
- package/dist/model/timestamp.js +16 -0
- package/dist/model/timestamp.js.map +1 -0
- package/dist/model/uid.d.ts +16 -0
- package/dist/model/uid.d.ts.map +1 -0
- package/dist/model/uid.js +16 -0
- package/dist/model/uid.js.map +1 -0
- package/dist/model/widget.d.ts +60 -0
- package/dist/model/widget.d.ts.map +1 -0
- package/dist/model/widget.js +47 -0
- package/dist/model/widget.js.map +1 -0
- package/dist/zod4.d.ts +2321 -0
- package/dist/zod4.d.ts.map +1 -0
- package/dist/zod4.js +132 -0
- package/dist/zod4.js.map +1 -0
- package/package.json +55 -58
- package/src/common/asset.ts +29 -0
- package/src/common/embed.ts +27 -0
- package/src/common/hexaColorCode.ts +11 -0
- package/src/common/nonEmptyString.ts +9 -0
- package/src/common/widgetKey.ts +11 -0
- package/src/content/boolean.ts +23 -0
- package/src/content/codec/boolean.ts +38 -0
- package/src/content/codec/document.ts +60 -0
- package/src/content/codec/embed.ts +55 -0
- package/src/content/codec/empty.ts +49 -0
- package/src/content/codec/field.ts +96 -0
- package/src/content/codec/geopoint.ts +40 -0
- package/src/content/codec/group.ts +163 -0
- package/src/content/codec/image.ts +50 -0
- package/src/content/codec/integrationField.ts +38 -0
- package/src/content/{LegacyContentCtx.ts → codec/legacyContentCtx.ts} +17 -17
- package/src/content/codec/link.ts +103 -0
- package/src/content/codec/nestable.ts +146 -0
- package/src/content/codec/repeatable.ts +68 -0
- package/src/content/codec/richText.ts +117 -0
- package/src/content/codec/separator.ts +33 -0
- package/src/content/codec/slice.ts +276 -0
- package/src/content/codec/slices.ts +130 -0
- package/src/content/codec/table.ts +65 -0
- package/src/content/codec/uid.ts +36 -0
- package/src/content/codec/widget.ts +58 -0
- package/src/content/document.ts +8 -0
- package/src/content/embed.ts +12 -0
- package/src/content/empty.ts +10 -0
- package/src/content/field.ts +94 -0
- package/src/content/geopoint.ts +11 -0
- package/src/content/group.ts +99 -0
- package/src/content/image.ts +103 -0
- package/src/content/integrationField.ts +10 -0
- package/src/content/legacy/boolean.ts +5 -0
- package/src/content/legacy/document.ts +25 -0
- package/src/content/legacy/embed.ts +23 -0
- package/src/content/legacy/empty.ts +10 -0
- package/src/content/legacy/field.ts +8 -0
- package/src/content/legacy/geopoint.ts +10 -0
- package/src/content/legacy/group.ts +23 -0
- package/src/content/legacy/image.ts +43 -0
- package/src/content/legacy/integrationField.ts +5 -0
- package/src/content/legacy/link.ts +194 -0
- package/src/content/legacy/nestable.ts +55 -0
- package/src/content/legacy/repeatable.ts +7 -0
- package/src/content/legacy/richText.ts +198 -0
- package/src/content/legacy/separator.ts +6 -0
- package/src/content/legacy/slice.ts +38 -0
- package/src/content/legacy/slices.ts +17 -0
- package/src/content/legacy/table.ts +39 -0
- package/src/content/legacy/uid.ts +6 -0
- package/src/content/legacy/widget.ts +19 -0
- package/src/content/link.ts +154 -0
- package/src/content/nestable.ts +126 -0
- package/src/content/repeatable.ts +21 -0
- package/src/content/richText.ts +54 -0
- package/src/content/separator.ts +9 -0
- package/src/content/slice.ts +41 -0
- package/src/content/slices.ts +57 -0
- package/src/content/table.ts +14 -0
- package/src/content/uid.ts +10 -0
- package/src/content/widget.ts +21 -0
- package/src/content/{fields/withDefaultValues.ts → withDefaultValues.ts} +34 -39
- package/src/helpers/contentPath.ts +35 -0
- package/src/helpers/customTypeModel.ts +113 -0
- package/src/helpers/documentContent.ts +108 -0
- package/src/helpers/sliceContent.ts +86 -0
- package/src/helpers/traverseContent.ts +594 -0
- package/src/helpers/traverseContentWithModel.ts +616 -0
- package/src/index.ts +123 -0
- package/src/io-ts.ts +351 -0
- package/src/model/boolean.ts +15 -0
- package/src/model/color.ts +14 -0
- package/src/model/customType.ts +26 -0
- package/src/model/date.ts +15 -0
- package/src/model/diff/index.ts +4 -0
- package/src/{customtypes/diff/SharedSlice.ts → model/diff/sharedSlice.ts} +16 -18
- package/src/model/diff/utils.ts +45 -0
- package/src/model/diff/variation.ts +155 -0
- package/src/model/diff/widgets.ts +15 -0
- package/src/model/embed.ts +15 -0
- package/src/model/geopoint.ts +13 -0
- package/src/model/group.ts +39 -0
- package/src/model/image.ts +54 -0
- package/src/model/integrationField.ts +15 -0
- package/src/model/link.ts +141 -0
- package/src/model/nestable.ts +71 -0
- package/src/model/number.ts +26 -0
- package/src/model/range.ts +26 -0
- package/src/model/richText.ts +106 -0
- package/src/model/section.ts +12 -0
- package/src/model/select.ts +30 -0
- package/src/model/separator.ts +12 -0
- package/src/model/slice.ts +133 -0
- package/src/model/slices.ts +54 -0
- package/src/model/table.ts +29 -0
- package/src/model/text.ts +15 -0
- package/src/model/timestamp.ts +15 -0
- package/src/model/uid.ts +15 -0
- package/src/model/widget.ts +63 -0
- package/src/zod4.ts +187 -0
- package/lib/common/Asset.d.ts +0 -16
- package/lib/common/Asset.js +0 -11
- package/lib/common/Embed.d.ts +0 -15
- package/lib/common/Embed.js +0 -10
- package/lib/common/HexaColorCode.d.ts +0 -4
- package/lib/common/HexaColorCode.js +0 -7
- package/lib/common/UUID.d.ts +0 -6
- package/lib/common/UUID.js +0 -8
- package/lib/common/WidgetKey.d.ts +0 -3
- package/lib/common/WidgetKey.js +0 -8
- package/lib/common/index.d.ts +0 -3
- package/lib/common/index.js +0 -6
- package/lib/content/Document.d.ts +0 -11813
- package/lib/content/Document.js +0 -364
- package/lib/content/LegacyContentCtx.d.ts +0 -64
- package/lib/content/LegacyContentCtx.js +0 -130
- package/lib/content/fields/EmptyContent.d.ts +0 -16
- package/lib/content/fields/EmptyContent.js +0 -30
- package/lib/content/fields/GroupContent.d.ts +0 -53
- package/lib/content/fields/GroupContent.js +0 -307
- package/lib/content/fields/UIDContent.d.ts +0 -16
- package/lib/content/fields/UIDContent.js +0 -25
- package/lib/content/fields/WidgetContent.d.ts +0 -11749
- package/lib/content/fields/WidgetContent.js +0 -57
- package/lib/content/fields/index.d.ts +0 -6
- package/lib/content/fields/index.js +0 -9
- package/lib/content/fields/nestable/BooleanContent.d.ts +0 -18
- package/lib/content/fields/nestable/BooleanContent.js +0 -35
- package/lib/content/fields/nestable/EmbedContent.d.ts +0 -78
- package/lib/content/fields/nestable/EmbedContent.js +0 -56
- package/lib/content/fields/nestable/FieldContent/ColorContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/ColorContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/DateContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/DateContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/NumberContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/NumberContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/RangeContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/RangeContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/SelectContent.d.ts +0 -20
- package/lib/content/fields/nestable/FieldContent/SelectContent.js +0 -46
- package/lib/content/fields/nestable/FieldContent/TextContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/TextContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/TimestampContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/TimestampContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/common.d.ts +0 -1
- package/lib/content/fields/nestable/FieldContent/common.js +0 -4
- package/lib/content/fields/nestable/FieldContent/index.d.ts +0 -49
- package/lib/content/fields/nestable/FieldContent/index.js +0 -38
- package/lib/content/fields/nestable/GeoPointContent.d.ts +0 -33
- package/lib/content/fields/nestable/GeoPointContent.js +0 -31
- package/lib/content/fields/nestable/ImageContent.d.ts +0 -252
- package/lib/content/fields/nestable/ImageContent.js +0 -122
- package/lib/content/fields/nestable/IntegrationFieldContent.d.ts +0 -16
- package/lib/content/fields/nestable/IntegrationFieldContent.js +0 -28
- package/lib/content/fields/nestable/LinkContent.d.ts +0 -919
- package/lib/content/fields/nestable/LinkContent.js +0 -399
- package/lib/content/fields/nestable/NestableContent.d.ts +0 -1953
- package/lib/content/fields/nestable/NestableContent.js +0 -167
- package/lib/content/fields/nestable/RepeatableContent.d.ts +0 -182
- package/lib/content/fields/nestable/RepeatableContent.js +0 -146
- package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +0 -1261
- package/lib/content/fields/nestable/RichTextContent/Blocks.js +0 -170
- package/lib/content/fields/nestable/RichTextContent/index.d.ts +0 -1004
- package/lib/content/fields/nestable/RichTextContent/index.js +0 -28
- package/lib/content/fields/nestable/SeparatorContent.d.ts +0 -13
- package/lib/content/fields/nestable/SeparatorContent.js +0 -22
- package/lib/content/fields/nestable/TableContent.d.ts +0 -776
- package/lib/content/fields/nestable/TableContent.js +0 -167
- package/lib/content/fields/nestable/index.d.ts +0 -12
- package/lib/content/fields/nestable/index.js +0 -15
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +0 -3934
- package/lib/content/fields/slices/Slice/CompositeSliceContent.js +0 -195
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +0 -774
- package/lib/content/fields/slices/Slice/RepeatableContent.js +0 -21
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +0 -3937
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +0 -215
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +0 -1962
- package/lib/content/fields/slices/Slice/SimpleSliceContent.js +0 -130
- package/lib/content/fields/slices/Slice/SlicePrimaryContent.d.ts +0 -1952
- package/lib/content/fields/slices/Slice/SlicePrimaryContent.js +0 -30
- package/lib/content/fields/slices/Slice/index.d.ts +0 -6810
- package/lib/content/fields/slices/Slice/index.js +0 -45
- package/lib/content/fields/slices/SliceItem.d.ts +0 -6846
- package/lib/content/fields/slices/SliceItem.js +0 -116
- package/lib/content/fields/slices/SlicesContent.d.ts +0 -9827
- package/lib/content/fields/slices/SlicesContent.js +0 -465
- package/lib/content/fields/slices/index.d.ts +0 -3
- package/lib/content/fields/slices/index.js +0 -6
- package/lib/content/fields/withDefaultValues.d.ts +0 -9
- package/lib/content/fields/withDefaultValues.js +0 -79
- package/lib/content/helpers.d.ts +0 -9
- package/lib/content/helpers.js +0 -22
- package/lib/content/index.d.ts +0 -4
- package/lib/content/index.js +0 -7
- package/lib/content/utils.d.ts +0 -50
- package/lib/content/utils.js +0 -35
- package/lib/customtypes/CustomType.d.ts +0 -3680
- package/lib/customtypes/CustomType.js +0 -184
- package/lib/customtypes/Section.d.ts +0 -3635
- package/lib/customtypes/Section.js +0 -66
- package/lib/customtypes/diff/Changes.d.ts +0 -17
- package/lib/customtypes/diff/Changes.js +0 -9
- package/lib/customtypes/diff/SharedSlice.d.ts +0 -1624
- package/lib/customtypes/diff/SharedSlice.js +0 -55
- package/lib/customtypes/diff/Variation.d.ts +0 -1605
- package/lib/customtypes/diff/Variation.js +0 -113
- package/lib/customtypes/diff/Widgets.d.ts +0 -11
- package/lib/customtypes/diff/Widgets.js +0 -2
- package/lib/customtypes/diff/index.d.ts +0 -4
- package/lib/customtypes/diff/index.js +0 -7
- package/lib/customtypes/index.d.ts +0 -4
- package/lib/customtypes/index.js +0 -7
- package/lib/customtypes/widgets/Group.d.ts +0 -1352
- package/lib/customtypes/widgets/Group.js +0 -92
- package/lib/customtypes/widgets/UID.d.ts +0 -19
- package/lib/customtypes/widgets/UID.js +0 -21
- package/lib/customtypes/widgets/Widget.d.ts +0 -4457
- package/lib/customtypes/widgets/Widget.js +0 -49
- package/lib/customtypes/widgets/index.d.ts +0 -6
- package/lib/customtypes/widgets/index.js +0 -9
- package/lib/customtypes/widgets/nestable/BooleanField.d.ts +0 -20
- package/lib/customtypes/widgets/nestable/BooleanField.js +0 -21
- package/lib/customtypes/widgets/nestable/Color.d.ts +0 -17
- package/lib/customtypes/widgets/nestable/Color.js +0 -20
- package/lib/customtypes/widgets/nestable/Date.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/Date.js +0 -21
- package/lib/customtypes/widgets/nestable/Embed.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/Embed.js +0 -21
- package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +0 -15
- package/lib/customtypes/widgets/nestable/GeoPoint.js +0 -19
- package/lib/customtypes/widgets/nestable/Image.d.ts +0 -44
- package/lib/customtypes/widgets/nestable/Image.js +0 -29
- package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/IntegrationField.js +0 -21
- package/lib/customtypes/widgets/nestable/Link.d.ts +0 -196
- package/lib/customtypes/widgets/nestable/Link.js +0 -167
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +0 -217
- package/lib/customtypes/widgets/nestable/NestableWidget.js +0 -39
- package/lib/customtypes/widgets/nestable/Number.d.ts +0 -23
- package/lib/customtypes/widgets/nestable/Number.js +0 -24
- package/lib/customtypes/widgets/nestable/Range.d.ts +0 -23
- package/lib/customtypes/widgets/nestable/Range.js +0 -24
- package/lib/customtypes/widgets/nestable/RichText.d.ts +0 -73
- package/lib/customtypes/widgets/nestable/RichText.js +0 -131
- package/lib/customtypes/widgets/nestable/Select.d.ts +0 -21
- package/lib/customtypes/widgets/nestable/Select.js +0 -22
- package/lib/customtypes/widgets/nestable/Separator.d.ts +0 -14
- package/lib/customtypes/widgets/nestable/Separator.js +0 -18
- package/lib/customtypes/widgets/nestable/Table.d.ts +0 -21
- package/lib/customtypes/widgets/nestable/Table.js +0 -30
- package/lib/customtypes/widgets/nestable/Text.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/Text.js +0 -21
- package/lib/customtypes/widgets/nestable/Timestamp.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/Timestamp.js +0 -21
- package/lib/customtypes/widgets/nestable/index.d.ts +0 -17
- package/lib/customtypes/widgets/nestable/index.js +0 -20
- package/lib/customtypes/widgets/shared/ImageConstraint.d.ts +0 -7
- package/lib/customtypes/widgets/shared/ImageConstraint.js +0 -31
- package/lib/customtypes/widgets/shared/index.d.ts +0 -1
- package/lib/customtypes/widgets/shared/index.js +0 -8
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +0 -455
- package/lib/customtypes/widgets/slices/CompositeSlice.js +0 -63
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +0 -442
- package/lib/customtypes/widgets/slices/LegacySlice.js +0 -12
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +0 -1807
- package/lib/customtypes/widgets/slices/SharedSlice.js +0 -118
- package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +0 -5
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +0 -9
- package/lib/customtypes/widgets/slices/Slice.d.ts +0 -6
- package/lib/customtypes/widgets/slices/Slice.js +0 -2
- package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +0 -1259
- package/lib/customtypes/widgets/slices/SlicePrimaryWidget.js +0 -10
- package/lib/customtypes/widgets/slices/Slices.d.ts +0 -5917
- package/lib/customtypes/widgets/slices/Slices.js +0 -146
- package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +0 -6
- package/lib/customtypes/widgets/slices/SlicesTypes.js +0 -11
- package/lib/customtypes/widgets/slices/index.d.ts +0 -8
- package/lib/customtypes/widgets/slices/index.js +0 -11
- package/lib/utils/Arrays.d.ts +0 -1
- package/lib/utils/Arrays.js +0 -13
- package/lib/utils/DocumentId.d.ts +0 -2
- package/lib/utils/DocumentId.js +0 -7
- package/lib/utils/Fields.d.ts +0 -6
- package/lib/utils/Fields.js +0 -2
- package/lib/utils/Objects.d.ts +0 -8
- package/lib/utils/Objects.js +0 -42
- package/lib/utils/index.d.ts +0 -4
- package/lib/utils/index.js +0 -8
- package/lib/validators/BasicTypes.d.ts +0 -10
- package/lib/validators/BasicTypes.js +0 -25
- package/lib/validators/DateFromString.d.ts +0 -3
- package/lib/validators/DateFromString.js +0 -11
- package/lib/validators/DateFromStringOrNumber.d.ts +0 -3
- package/lib/validators/DateFromStringOrNumber.js +0 -10
- package/lib/validators/DateFromTsMs.d.ts +0 -3
- package/lib/validators/DateFromTsMs.js +0 -10
- package/lib/validators/DefaultOrElse.d.ts +0 -5
- package/lib/validators/DefaultOrElse.js +0 -21
- package/lib/validators/IntFromNumber.d.ts +0 -5
- package/lib/validators/IntFromNumber.js +0 -14
- package/lib/validators/IntFromPixels.d.ts +0 -8
- package/lib/validators/IntFromPixels.js +0 -24
- package/lib/validators/NonEmptyString.d.ts +0 -3
- package/lib/validators/NonEmptyString.js +0 -6
- package/lib/validators/NonEmptyStringOrNull.d.ts +0 -3
- package/lib/validators/NonEmptyStringOrNull.js +0 -15
- package/lib/validators/NumberOrNull.d.ts +0 -3
- package/lib/validators/NumberOrNull.js +0 -6
- package/lib/validators/NumberRange.d.ts +0 -32
- package/lib/validators/NumberRange.js +0 -40
- package/lib/validators/StringFromBoolean.d.ts +0 -5
- package/lib/validators/StringFromBoolean.js +0 -10
- package/lib/validators/StringFromNumber.d.ts +0 -5
- package/lib/validators/StringFromNumber.js +0 -10
- package/lib/validators/StringOrNull.d.ts +0 -3
- package/lib/validators/StringOrNull.js +0 -6
- package/lib/validators/TrimmedString.d.ts +0 -5
- package/lib/validators/TrimmedString.js +0 -23
- package/lib/validators/function.d.ts +0 -34
- package/lib/validators/function.js +0 -100
- package/lib/validators/index.d.ts +0 -15
- package/lib/validators/index.js +0 -31
- package/src/common/Asset.ts +0 -25
- package/src/common/Embed.ts +0 -22
- package/src/common/HexaColorCode.ts +0 -11
- package/src/common/UUID.ts +0 -19
- package/src/common/WidgetKey.ts +0 -13
- package/src/common/index.ts +0 -3
- package/src/content/Document.ts +0 -539
- package/src/content/fields/EmptyContent.ts +0 -45
- package/src/content/fields/GroupContent.ts +0 -466
- package/src/content/fields/UIDContent.ts +0 -42
- package/src/content/fields/WidgetContent.ts +0 -76
- package/src/content/fields/index.ts +0 -6
- package/src/content/fields/nestable/BooleanContent.ts +0 -52
- package/src/content/fields/nestable/EmbedContent.ts +0 -74
- package/src/content/fields/nestable/FieldContent/ColorContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/DateContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/NumberContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/RangeContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/SelectContent.ts +0 -60
- package/src/content/fields/nestable/FieldContent/TextContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/TimestampContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/common.ts +0 -1
- package/src/content/fields/nestable/FieldContent/index.ts +0 -40
- package/src/content/fields/nestable/GeoPointContent.ts +0 -48
- package/src/content/fields/nestable/ImageContent.ts +0 -196
- package/src/content/fields/nestable/IntegrationFieldContent.ts +0 -51
- package/src/content/fields/nestable/LinkContent.ts +0 -651
- package/src/content/fields/nestable/NestableContent.ts +0 -241
- package/src/content/fields/nestable/RepeatableContent.ts +0 -224
- package/src/content/fields/nestable/RichTextContent/Blocks.ts +0 -238
- package/src/content/fields/nestable/RichTextContent/index.ts +0 -42
- package/src/content/fields/nestable/SeparatorContent.ts +0 -34
- package/src/content/fields/nestable/TableContent.ts +0 -234
- package/src/content/fields/nestable/index.ts +0 -12
- package/src/content/fields/slices/Slice/CompositeSliceContent.ts +0 -293
- package/src/content/fields/slices/Slice/RepeatableContent.ts +0 -29
- package/src/content/fields/slices/Slice/SharedSliceContent.ts +0 -305
- package/src/content/fields/slices/Slice/SimpleSliceContent.ts +0 -180
- package/src/content/fields/slices/Slice/SlicePrimaryContent.ts +0 -40
- package/src/content/fields/slices/Slice/index.ts +0 -52
- package/src/content/fields/slices/SliceItem.ts +0 -184
- package/src/content/fields/slices/SlicesContent.ts +0 -677
- package/src/content/fields/slices/index.ts +0 -3
- package/src/content/helpers.ts +0 -25
- package/src/content/index.ts +0 -4
- package/src/content/utils.ts +0 -145
- package/src/customtypes/CustomType.ts +0 -280
- package/src/customtypes/Section.ts +0 -98
- package/src/customtypes/diff/Variation.ts +0 -167
- package/src/customtypes/diff/Widgets.ts +0 -17
- package/src/customtypes/diff/index.ts +0 -4
- package/src/customtypes/index.ts +0 -4
- package/src/customtypes/widgets/Group.ts +0 -120
- package/src/customtypes/widgets/UID.ts +0 -27
- package/src/customtypes/widgets/Widget.ts +0 -83
- package/src/customtypes/widgets/index.ts +0 -6
- package/src/customtypes/widgets/nestable/BooleanField.ts +0 -29
- package/src/customtypes/widgets/nestable/Color.ts +0 -25
- package/src/customtypes/widgets/nestable/Date.ts +0 -27
- package/src/customtypes/widgets/nestable/Embed.ts +0 -27
- package/src/customtypes/widgets/nestable/GeoPoint.ts +0 -25
- package/src/customtypes/widgets/nestable/Image.ts +0 -39
- package/src/customtypes/widgets/nestable/IntegrationField.ts +0 -26
- package/src/customtypes/widgets/nestable/Link.ts +0 -313
- package/src/customtypes/widgets/nestable/NestableWidget.ts +0 -40
- package/src/customtypes/widgets/nestable/Number.ts +0 -30
- package/src/customtypes/widgets/nestable/Range.ts +0 -30
- package/src/customtypes/widgets/nestable/RichText.ts +0 -215
- package/src/customtypes/widgets/nestable/Select.ts +0 -34
- package/src/customtypes/widgets/nestable/Separator.ts +0 -24
- package/src/customtypes/widgets/nestable/Table.ts +0 -38
- package/src/customtypes/widgets/nestable/Text.ts +0 -27
- package/src/customtypes/widgets/nestable/Timestamp.ts +0 -27
- package/src/customtypes/widgets/nestable/index.ts +0 -17
- package/src/customtypes/widgets/shared/ImageConstraint.ts +0 -41
- package/src/customtypes/widgets/shared/index.ts +0 -1
- package/src/customtypes/widgets/slices/CompositeSlice.ts +0 -79
- package/src/customtypes/widgets/slices/LegacySlice.ts +0 -15
- package/src/customtypes/widgets/slices/SharedSlice.ts +0 -152
- package/src/customtypes/widgets/slices/SharedSliceRef.ts +0 -10
- package/src/customtypes/widgets/slices/Slice.ts +0 -7
- package/src/customtypes/widgets/slices/SlicePrimaryWidget.ts +0 -12
- package/src/customtypes/widgets/slices/Slices.ts +0 -184
- package/src/customtypes/widgets/slices/SlicesTypes.ts +0 -11
- package/src/customtypes/widgets/slices/index.ts +0 -8
- package/src/utils/Arrays.ts +0 -12
- package/src/utils/DocumentId.ts +0 -8
- package/src/utils/Fields.ts +0 -4
- package/src/utils/Objects.ts +0 -53
- package/src/utils/index.ts +0 -4
- package/src/validators/BasicTypes.ts +0 -55
- package/src/validators/DateFromString.ts +0 -19
- package/src/validators/DateFromStringOrNumber.ts +0 -17
- package/src/validators/DateFromTsMs.ts +0 -17
- package/src/validators/DefaultOrElse.ts +0 -24
- package/src/validators/IntFromNumber.ts +0 -22
- package/src/validators/IntFromPixels.ts +0 -32
- package/src/validators/NonEmptyString.ts +0 -8
- package/src/validators/NonEmptyStringOrNull.ts +0 -22
- package/src/validators/NumberOrNull.ts +0 -5
- package/src/validators/NumberRange.ts +0 -51
- package/src/validators/StringFromBoolean.ts +0 -19
- package/src/validators/StringFromNumber.ts +0 -19
- package/src/validators/StringOrNull.ts +0 -5
- package/src/validators/TrimmedString.ts +0 -33
- package/src/validators/function.ts +0 -115
- package/src/validators/index.ts +0 -15
- /package/src/{customtypes/diff/Changes.ts → model/diff/changes.ts} +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod/mini"
|
|
2
|
+
|
|
3
|
+
// Options can be string, number, or boolean - all coerced to string
|
|
4
|
+
// Matches io-ts behavior: t.union([t.string, StringFromNumber, StringFromBoolean])
|
|
5
|
+
const SelectOptionSchema: z.ZodMiniType<string> = z.union([
|
|
6
|
+
z.string(),
|
|
7
|
+
z.pipe(
|
|
8
|
+
z.number(),
|
|
9
|
+
z.transform((n) => n.toString()),
|
|
10
|
+
),
|
|
11
|
+
z.pipe(
|
|
12
|
+
z.boolean(),
|
|
13
|
+
z.transform((b) => b.toString()),
|
|
14
|
+
),
|
|
15
|
+
])
|
|
16
|
+
|
|
17
|
+
const SelectConfigSchema = z.object({
|
|
18
|
+
label: z.nullish(z.string()),
|
|
19
|
+
placeholder: z.optional(z.string()),
|
|
20
|
+
default_value: z.optional(z.string()),
|
|
21
|
+
options: z.optional(z.array(SelectOptionSchema)),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export const SelectModelSchema = z.object({
|
|
25
|
+
type: z.literal("Select"),
|
|
26
|
+
fieldset: z.nullish(z.string()),
|
|
27
|
+
config: z.optional(SelectConfigSchema),
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export type SelectModel = z.infer<typeof SelectModelSchema>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod/mini"
|
|
2
|
+
|
|
3
|
+
const SeparatorConfigSchema = z.object({
|
|
4
|
+
label: z.nullish(z.string()),
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
export const SeparatorModelSchema = z.object({
|
|
8
|
+
type: z.literal("Separator"),
|
|
9
|
+
config: z.optional(SeparatorConfigSchema),
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export type SeparatorModel = z.infer<typeof SeparatorModelSchema>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { z } from "zod/mini"
|
|
2
|
+
|
|
3
|
+
import { WidgetKeySchema } from "../common/widgetKey"
|
|
4
|
+
import type { NestedGroupModel } from "./group"
|
|
5
|
+
import { GroupModelSchema, NestedGroupModelSchema } from "./group"
|
|
6
|
+
import type { NestableModel } from "./nestable"
|
|
7
|
+
import { NestableModelSchema } from "./nestable"
|
|
8
|
+
|
|
9
|
+
// Simple (before 2020)
|
|
10
|
+
export const LegacySliceModelSchema: z.ZodMiniType<LegacySliceModel> = z.union([
|
|
11
|
+
NestableModelSchema,
|
|
12
|
+
NestedGroupModelSchema,
|
|
13
|
+
])
|
|
14
|
+
|
|
15
|
+
export type LegacySliceModel = NestableModel | NestedGroupModel
|
|
16
|
+
|
|
17
|
+
// Composite (2020 to 2021)
|
|
18
|
+
export const CompositeSliceType = "Slice" as const
|
|
19
|
+
|
|
20
|
+
const CompositeSliceConfigSchema = z.object({
|
|
21
|
+
label: z.nullish(z.string()),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export const CompositeSliceModelSchema = z.object({
|
|
25
|
+
type: z.literal(CompositeSliceType),
|
|
26
|
+
fieldset: z.nullish(z.string()),
|
|
27
|
+
description: z.optional(z.string()),
|
|
28
|
+
icon: z.optional(z.string()),
|
|
29
|
+
display: z.optional(z.string()),
|
|
30
|
+
"non-repeat": z.optional(z.record(WidgetKeySchema, NestableModelSchema)),
|
|
31
|
+
repeat: z.optional(z.record(WidgetKeySchema, NestableModelSchema)),
|
|
32
|
+
config: z.optional(CompositeSliceConfigSchema),
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
export type CompositeSliceModel = z.infer<typeof CompositeSliceModelSchema>
|
|
36
|
+
|
|
37
|
+
// Shared (2021 to present)
|
|
38
|
+
export const SharedSliceType = "SharedSlice" as const
|
|
39
|
+
|
|
40
|
+
const IMAGE_PLACEHOLDER_URL =
|
|
41
|
+
"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"
|
|
42
|
+
|
|
43
|
+
export const SharedSliceVariationSchema = z.object({
|
|
44
|
+
id: z.string(),
|
|
45
|
+
name: z.string(),
|
|
46
|
+
description: z.string(),
|
|
47
|
+
imageUrl: z._default(z.string(), IMAGE_PLACEHOLDER_URL),
|
|
48
|
+
docURL: z.string(),
|
|
49
|
+
version: z.string(),
|
|
50
|
+
display: z.optional(z.string()),
|
|
51
|
+
primary: z.optional(
|
|
52
|
+
z.record(
|
|
53
|
+
z.string(),
|
|
54
|
+
z.union([NestableModelSchema, GroupModelSchema]) as z.ZodMiniType<
|
|
55
|
+
NestableModel | NestedGroupModel
|
|
56
|
+
>,
|
|
57
|
+
),
|
|
58
|
+
),
|
|
59
|
+
items: z.optional(z.record(z.string(), NestableModelSchema)),
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
export type SharedSliceVariation = z.infer<typeof SharedSliceVariationSchema>
|
|
63
|
+
|
|
64
|
+
export const SharedSliceModelSchema = z.object({
|
|
65
|
+
id: z.string(),
|
|
66
|
+
type: z.literal(SharedSliceType),
|
|
67
|
+
name: z.string(),
|
|
68
|
+
variations: z.array(SharedSliceVariationSchema),
|
|
69
|
+
description: z.optional(z.string()),
|
|
70
|
+
legacyPaths: z.optional(z.record(z.string(), z.string())),
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
export type SharedSliceModel = z.infer<typeof SharedSliceModelSchema>
|
|
74
|
+
|
|
75
|
+
export const SharedSliceRefModelSchema = z.object({
|
|
76
|
+
type: z.literal(SharedSliceType),
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
export type SharedSliceRefModel = z.infer<typeof SharedSliceRefModelSchema>
|
|
80
|
+
|
|
81
|
+
// Used to represent a shared slice content which can only be
|
|
82
|
+
// of a given shared slice variation type.
|
|
83
|
+
export const SharedSliceVariationContentModelSchema = z.object({
|
|
84
|
+
type: z.literal(SharedSliceType),
|
|
85
|
+
sliceName: z.string(),
|
|
86
|
+
variationID: z.string(),
|
|
87
|
+
fields: z.pick(SharedSliceVariationSchema, { primary: true, items: true }),
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
export type SharedSliceVariationContentModel = z.infer<
|
|
91
|
+
typeof SharedSliceVariationContentModelSchema
|
|
92
|
+
>
|
|
93
|
+
|
|
94
|
+
// All
|
|
95
|
+
|
|
96
|
+
// Used when slices reference SharedSlice by ref (not full definition)
|
|
97
|
+
export const DynamicSliceModelSchema: z.ZodMiniType<DynamicSliceModel> = z.union([
|
|
98
|
+
CompositeSliceModelSchema,
|
|
99
|
+
LegacySliceModelSchema,
|
|
100
|
+
SharedSliceRefModelSchema,
|
|
101
|
+
])
|
|
102
|
+
|
|
103
|
+
export type DynamicSliceModel = CompositeSliceModel | LegacySliceModel | SharedSliceRefModel
|
|
104
|
+
|
|
105
|
+
// Used when slices include full SharedSlice definition
|
|
106
|
+
export const StaticSliceModelSchema: z.ZodMiniType<StaticSliceModel> = z.union([
|
|
107
|
+
CompositeSliceModelSchema,
|
|
108
|
+
LegacySliceModelSchema,
|
|
109
|
+
SharedSliceModelSchema,
|
|
110
|
+
])
|
|
111
|
+
|
|
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
|
|
126
|
+
|
|
127
|
+
// Model types
|
|
128
|
+
export const SliceModelTypeSchema = z.union([
|
|
129
|
+
z.literal(CompositeSliceType),
|
|
130
|
+
z.literal(SharedSliceType),
|
|
131
|
+
])
|
|
132
|
+
|
|
133
|
+
export type SliceModelType = z.infer<typeof SliceModelTypeSchema>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod/mini"
|
|
2
|
+
|
|
3
|
+
import { WidgetKeySchema } from "../common/widgetKey"
|
|
4
|
+
import { StaticSliceModelSchema, DynamicSliceModelSchema } from "./slice"
|
|
5
|
+
|
|
6
|
+
export const LegacySlicesFieldType = "Choice"
|
|
7
|
+
export const SlicesFieldType = "Slices"
|
|
8
|
+
|
|
9
|
+
// Label configuration for slices
|
|
10
|
+
const SlicesLabelSchema = z.object({
|
|
11
|
+
name: z.string(),
|
|
12
|
+
display: z.optional(z.string()),
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export const SlicesLabelsSchema = z.union([
|
|
16
|
+
z.record(z.string(), z.array(SlicesLabelSchema)),
|
|
17
|
+
z.null(),
|
|
18
|
+
])
|
|
19
|
+
|
|
20
|
+
// Config
|
|
21
|
+
const getSlicesConfigSchema = <
|
|
22
|
+
TSliceSchema extends typeof StaticSliceModelSchema | typeof DynamicSliceModelSchema,
|
|
23
|
+
>(
|
|
24
|
+
sliceSchema: TSliceSchema,
|
|
25
|
+
) =>
|
|
26
|
+
z.object({
|
|
27
|
+
label: z.nullish(z.string()),
|
|
28
|
+
labels: z.optional(SlicesLabelsSchema),
|
|
29
|
+
choices: z.optional(z.record(WidgetKeySchema, sliceSchema)),
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const StaticSlicesConfigSchema = getSlicesConfigSchema(StaticSliceModelSchema)
|
|
33
|
+
|
|
34
|
+
const DynamicSlicesConfigSchema = getSlicesConfigSchema(DynamicSliceModelSchema)
|
|
35
|
+
|
|
36
|
+
// Model
|
|
37
|
+
const getSlicesSchema = <
|
|
38
|
+
TConfig extends typeof StaticSlicesConfigSchema | typeof DynamicSlicesConfigSchema,
|
|
39
|
+
>(
|
|
40
|
+
configSchema: TConfig,
|
|
41
|
+
) =>
|
|
42
|
+
z.object({
|
|
43
|
+
type: z.union([z.literal(SlicesFieldType), z.literal(LegacySlicesFieldType)]),
|
|
44
|
+
fieldset: z.nullish(z.string()),
|
|
45
|
+
config: z.optional(configSchema),
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
export const StaticSlicesModelSchema = getSlicesSchema(StaticSlicesConfigSchema)
|
|
49
|
+
|
|
50
|
+
export type StaticSlicesModel = z.infer<typeof StaticSlicesModelSchema>
|
|
51
|
+
|
|
52
|
+
export const DynamicSlicesModelSchema = getSlicesSchema(DynamicSlicesConfigSchema)
|
|
53
|
+
|
|
54
|
+
export type DynamicSlicesModel = z.infer<typeof DynamicSlicesModelSchema>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod/mini"
|
|
2
|
+
|
|
3
|
+
import { RichTextNodeType, type RichTextModel } from "./richText"
|
|
4
|
+
|
|
5
|
+
const TableConfigSchema = z.object({
|
|
6
|
+
label: z.nullish(z.string()),
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export const TableModelSchema = z.object({
|
|
10
|
+
type: z.literal("Table"),
|
|
11
|
+
config: z.optional(TableConfigSchema),
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export type TableModel = z.infer<typeof TableModelSchema>
|
|
15
|
+
|
|
16
|
+
// TableCell configuration constant (used for cell rich text configuration)
|
|
17
|
+
export const TableCellModelNodeTypes = [
|
|
18
|
+
RichTextNodeType.paragraph,
|
|
19
|
+
RichTextNodeType.strong,
|
|
20
|
+
RichTextNodeType.em,
|
|
21
|
+
RichTextNodeType.hyperlink,
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
export const TableCellModel: RichTextModel = {
|
|
25
|
+
type: "StructuredText" as const,
|
|
26
|
+
config: {
|
|
27
|
+
multi: TableCellModelNodeTypes.join(","),
|
|
28
|
+
},
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod/mini"
|
|
2
|
+
|
|
3
|
+
const TextConfigSchema = z.object({
|
|
4
|
+
label: z.nullish(z.string()),
|
|
5
|
+
useAsTitle: z.optional(z.boolean()),
|
|
6
|
+
placeholder: z.optional(z.string()),
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export const TextModelSchema = z.object({
|
|
10
|
+
type: z.literal("Text"),
|
|
11
|
+
fieldset: z.nullish(z.string()),
|
|
12
|
+
config: z.optional(TextConfigSchema),
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export type TextModel = z.infer<typeof TextModelSchema>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod/mini"
|
|
2
|
+
|
|
3
|
+
const TimestampConfigSchema = z.object({
|
|
4
|
+
label: z.nullish(z.string()),
|
|
5
|
+
placeholder: z.optional(z.string()),
|
|
6
|
+
default: z.optional(z.string()),
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export const TimestampModelSchema = z.object({
|
|
10
|
+
type: z.literal("Timestamp"),
|
|
11
|
+
fieldset: z.nullish(z.string()),
|
|
12
|
+
config: z.optional(TimestampConfigSchema),
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export type TimestampModel = z.infer<typeof TimestampModelSchema>
|
package/src/model/uid.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod/mini"
|
|
2
|
+
|
|
3
|
+
const UIDConfigSchema = z.object({
|
|
4
|
+
label: z.nullish(z.string()),
|
|
5
|
+
useAsTitle: z.optional(z.boolean()),
|
|
6
|
+
placeholder: z.optional(z.string()),
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export const UIDModelSchema = z.object({
|
|
10
|
+
type: z.literal("UID"),
|
|
11
|
+
fieldset: z.nullish(z.string()),
|
|
12
|
+
config: z.optional(UIDConfigSchema),
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export type UIDModel = z.infer<typeof UIDModelSchema>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod/mini"
|
|
2
|
+
|
|
3
|
+
import type { GroupModel } from "./group"
|
|
4
|
+
import { GroupModelSchema } from "./group"
|
|
5
|
+
import type { NestableModel } from "./nestable"
|
|
6
|
+
import { NestableModelSchema } from "./nestable"
|
|
7
|
+
import { SliceModelTypeSchema } from "./slice"
|
|
8
|
+
import type { DynamicSlicesModel, StaticSlicesModel } from "./slices"
|
|
9
|
+
import { DynamicSlicesModelSchema, StaticSlicesModelSchema } from "./slices"
|
|
10
|
+
import type { UIDModel } from "./uid"
|
|
11
|
+
import { UIDModelSchema } from "./uid"
|
|
12
|
+
|
|
13
|
+
// StaticWidget = UID | Nestable | Group | StaticSlices
|
|
14
|
+
export const StaticWidgetModelSchema: z.ZodMiniType<StaticWidgetModel> = z.union([
|
|
15
|
+
UIDModelSchema,
|
|
16
|
+
NestableModelSchema,
|
|
17
|
+
GroupModelSchema,
|
|
18
|
+
StaticSlicesModelSchema,
|
|
19
|
+
])
|
|
20
|
+
|
|
21
|
+
export type StaticWidgetModel = UIDModel | NestableModel | GroupModel | StaticSlicesModel
|
|
22
|
+
|
|
23
|
+
// DynamicWidget = UID | Nestable | Group | DynamicSlices
|
|
24
|
+
export const DynamicWidgetModelSchema: z.ZodMiniType<DynamicWidgetModel> = z.union([
|
|
25
|
+
UIDModelSchema,
|
|
26
|
+
NestableModelSchema,
|
|
27
|
+
GroupModelSchema,
|
|
28
|
+
DynamicSlicesModelSchema,
|
|
29
|
+
])
|
|
30
|
+
|
|
31
|
+
export type DynamicWidgetModel = UIDModel | NestableModel | GroupModel | DynamicSlicesModel
|
|
32
|
+
|
|
33
|
+
// FieldModelType - all possible field type strings
|
|
34
|
+
export const FieldModelTypeSchema = z.enum([
|
|
35
|
+
"Color",
|
|
36
|
+
"Boolean",
|
|
37
|
+
"Number",
|
|
38
|
+
"Embed",
|
|
39
|
+
"GeoPoint",
|
|
40
|
+
"Date",
|
|
41
|
+
"Range",
|
|
42
|
+
"StructuredText",
|
|
43
|
+
"Select",
|
|
44
|
+
"Separator",
|
|
45
|
+
"Table",
|
|
46
|
+
"Text",
|
|
47
|
+
"Timestamp",
|
|
48
|
+
"Link",
|
|
49
|
+
"Repeatable.Link",
|
|
50
|
+
"Image",
|
|
51
|
+
"IntegrationFields",
|
|
52
|
+
"UID",
|
|
53
|
+
"Group",
|
|
54
|
+
"Slices",
|
|
55
|
+
"Choice",
|
|
56
|
+
])
|
|
57
|
+
|
|
58
|
+
export type FieldModelType = z.infer<typeof FieldModelTypeSchema>
|
|
59
|
+
|
|
60
|
+
// Field and slice types
|
|
61
|
+
export const FieldOrSliceTypeSchema = z.union([FieldModelTypeSchema, SliceModelTypeSchema])
|
|
62
|
+
|
|
63
|
+
export type FieldOrSliceType = z.infer<typeof FieldOrSliceTypeSchema>
|
package/src/zod4.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// Common
|
|
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
|
+
// Content
|
|
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
|
+
import {
|
|
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
|
+
} from "./content/field"
|
|
22
|
+
import { GeoPointContentSchema as rawGeoPointContentSchema } from "./content/geopoint"
|
|
23
|
+
import {
|
|
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,
|
|
43
|
+
} from "./content/slice"
|
|
44
|
+
import {
|
|
45
|
+
LegacySliceItemContentSchema as rawLegacySliceItemContentSchema,
|
|
46
|
+
CompositeSliceItemContentSchema as rawCompositeSliceItemContentSchema,
|
|
47
|
+
SharedSliceItemContentSchema as rawSharedSliceItemContentSchema,
|
|
48
|
+
SliceItemContentSchema as rawSliceItemContentSchema,
|
|
49
|
+
SlicesContentSchema as rawSlicesContentSchema,
|
|
50
|
+
} from "./content/slices"
|
|
51
|
+
import { TableContentSchema as rawTableContentSchema } from "./content/table"
|
|
52
|
+
import { UIDContentSchema as rawUIDContentSchema } from "./content/uid"
|
|
53
|
+
import { WidgetContentSchema as rawWidgetContentSchema } from "./content/widget"
|
|
54
|
+
// Model
|
|
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"
|
|
75
|
+
import {
|
|
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,
|
|
89
|
+
} from "./model/slice"
|
|
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"
|
|
102
|
+
|
|
103
|
+
// Common
|
|
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)
|
|
109
|
+
|
|
110
|
+
// Content
|
|
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)
|
|
147
|
+
|
|
148
|
+
// Model
|
|
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)
|
|
184
|
+
|
|
185
|
+
function toZod4<T>(type: T): T {
|
|
186
|
+
return type
|
|
187
|
+
}
|
package/lib/common/Asset.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare type Asset = {
|
|
2
|
-
id: string;
|
|
3
|
-
last_modified: string;
|
|
4
|
-
kind: "image" | "all";
|
|
5
|
-
filename?: string;
|
|
6
|
-
extension?: string;
|
|
7
|
-
size?: number;
|
|
8
|
-
origin_url: string;
|
|
9
|
-
url: string;
|
|
10
|
-
width?: number;
|
|
11
|
-
height?: number;
|
|
12
|
-
notes?: string;
|
|
13
|
-
credits?: string;
|
|
14
|
-
alt?: string;
|
|
15
|
-
};
|
|
16
|
-
export declare const getAssetOrThrow: (assets: Record<Asset["id"], Asset | undefined>) => (assetId: Asset["id"]) => Asset;
|
package/lib/common/Asset.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAssetOrThrow = void 0;
|
|
4
|
-
const getAssetOrThrow = (assets) => (assetId) => {
|
|
5
|
-
const asset = assets[assetId];
|
|
6
|
-
if (!asset) {
|
|
7
|
-
throw new Error(`Missing asset with id '${assetId}'!`);
|
|
8
|
-
}
|
|
9
|
-
return asset;
|
|
10
|
-
};
|
|
11
|
-
exports.getAssetOrThrow = getAssetOrThrow;
|
package/lib/common/Embed.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type Embed = {
|
|
2
|
-
type: string;
|
|
3
|
-
version?: string | null;
|
|
4
|
-
author_name?: string | null;
|
|
5
|
-
author_url?: string | null;
|
|
6
|
-
provider_name?: string | null;
|
|
7
|
-
provider_url?: string | null;
|
|
8
|
-
cache_age?: string | null;
|
|
9
|
-
thumbnail_url?: string | null;
|
|
10
|
-
thumbnail_width?: number | null;
|
|
11
|
-
thumbnail_height?: number | null;
|
|
12
|
-
html?: string | null;
|
|
13
|
-
title?: string | null;
|
|
14
|
-
};
|
|
15
|
-
export declare const getEmbedOrThrow: (embeds: Record<string, Embed | undefined>) => (embedUrl: string) => Embed;
|
package/lib/common/Embed.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEmbedOrThrow = void 0;
|
|
4
|
-
const getEmbedOrThrow = (embeds) => (embedUrl) => {
|
|
5
|
-
const embed = embeds[embedUrl];
|
|
6
|
-
if (!embed)
|
|
7
|
-
throw new Error(`Missing embed with url '${embedUrl}'`);
|
|
8
|
-
return embed;
|
|
9
|
-
};
|
|
10
|
-
exports.getEmbedOrThrow = getEmbedOrThrow;
|
package/lib/common/UUID.d.ts
DELETED
package/lib/common/UUID.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UUID = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const uuid_1 = require("uuid");
|
|
7
|
-
const function_1 = require("../validators/function");
|
|
8
|
-
exports.UUID = (0, function_1.withCustomError)(t.brand(t.string, (s) => (0, uuid_1.validate)(s), "UUID"), () => "The value must be a valid UUID");
|
package/lib/common/WidgetKey.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WidgetKey = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const function_1 = require("../validators/function");
|
|
7
|
-
const widgetKeyRegex = new RegExp("^[^<>]+$");
|
|
8
|
-
exports.WidgetKey = (0, function_1.refineType)(t.string, "WidgetKey", (s) => s.length === 0 || widgetKeyRegex.test(s));
|
package/lib/common/index.d.ts
DELETED