@prismicio/client 6.7.3 → 7.0.0-alpha.1
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 +4 -4
- package/dist/buildQueryURL.cjs +25 -6
- package/dist/buildQueryURL.cjs.map +1 -1
- package/dist/buildQueryURL.d.ts +207 -130
- package/dist/buildQueryURL.js +25 -6
- package/dist/buildQueryURL.js.map +1 -1
- package/dist/cookie.d.ts +5 -5
- package/dist/createClient.cjs +1142 -0
- package/dist/createClient.cjs.map +1 -0
- package/dist/{client.d.ts → createClient.d.ts} +980 -929
- package/dist/createClient.js +1142 -0
- package/dist/createClient.js.map +1 -0
- package/dist/errors/ForbiddenError.cjs.map +1 -0
- package/dist/{ForbiddenError.d.ts → errors/ForbiddenError.d.ts} +11 -11
- package/dist/errors/ForbiddenError.js.map +1 -0
- package/dist/errors/NotFoundError.cjs.map +1 -0
- package/dist/{NotFoundError.d.ts → errors/NotFoundError.d.ts} +3 -3
- package/dist/errors/NotFoundError.js.map +1 -0
- package/dist/errors/ParsingError.cjs.map +1 -0
- package/dist/{ParsingError.d.ts → errors/ParsingError.d.ts} +12 -12
- package/dist/errors/ParsingError.js.map +1 -0
- package/dist/errors/PrismicError.cjs.map +1 -0
- package/dist/{PrismicError.d.ts → errors/PrismicError.d.ts} +5 -5
- package/dist/errors/PrismicError.js.map +1 -0
- package/dist/filter.cjs +247 -0
- package/dist/filter.cjs.map +1 -0
- package/dist/filter.d.ts +209 -0
- package/dist/filter.js +247 -0
- package/dist/filter.js.map +1 -0
- package/dist/getGraphQLEndpoint.cjs +1 -1
- package/dist/getGraphQLEndpoint.cjs.map +1 -1
- package/dist/getGraphQLEndpoint.d.ts +9 -9
- package/dist/getGraphQLEndpoint.js +1 -1
- package/dist/getGraphQLEndpoint.js.map +1 -1
- package/dist/getRepositoryEndpoint.cjs +1 -1
- package/dist/getRepositoryEndpoint.cjs.map +1 -1
- package/dist/getRepositoryEndpoint.d.ts +10 -10
- package/dist/getRepositoryEndpoint.js +1 -1
- package/dist/getRepositoryEndpoint.js.map +1 -1
- package/dist/getRepositoryName.cjs +1 -1
- package/dist/getRepositoryName.cjs.map +1 -1
- package/dist/getRepositoryName.d.ts +13 -13
- package/dist/getRepositoryName.js +1 -1
- package/dist/getRepositoryName.js.map +1 -1
- package/dist/getToolbarSrc.cjs +13 -0
- package/dist/getToolbarSrc.cjs.map +1 -0
- package/dist/getToolbarSrc.d.ts +34 -0
- package/dist/getToolbarSrc.js +13 -0
- package/dist/getToolbarSrc.js.map +1 -0
- package/dist/helpers/asDate.cjs +14 -0
- package/dist/helpers/asDate.cjs.map +1 -0
- package/dist/helpers/asDate.d.ts +16 -0
- package/dist/helpers/asDate.js +14 -0
- package/dist/helpers/asDate.js.map +1 -0
- package/dist/helpers/asHTML.cjs +80 -0
- package/dist/helpers/asHTML.cjs.map +1 -0
- package/dist/helpers/asHTML.d.ts +77 -0
- package/dist/helpers/asHTML.js +80 -0
- package/dist/helpers/asHTML.js.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +21 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +52 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js +21 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -0
- package/dist/helpers/asImageSrc.cjs +13 -0
- package/dist/helpers/asImageSrc.cjs.map +1 -0
- package/dist/helpers/asImageSrc.d.ts +27 -0
- package/dist/helpers/asImageSrc.js +13 -0
- package/dist/helpers/asImageSrc.js.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.cjs +45 -0
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.d.ts +60 -0
- package/dist/helpers/asImageWidthSrcSet.js +45 -0
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -0
- package/dist/helpers/asLink.cjs +38 -0
- package/dist/helpers/asLink.cjs.map +1 -0
- package/dist/helpers/asLink.d.ts +34 -0
- package/dist/helpers/asLink.js +38 -0
- package/dist/helpers/asLink.js.map +1 -0
- package/dist/helpers/asLinkAttrs.cjs +28 -0
- package/dist/helpers/asLinkAttrs.cjs.map +1 -0
- package/dist/helpers/asLinkAttrs.d.ts +63 -0
- package/dist/helpers/asLinkAttrs.js +28 -0
- package/dist/helpers/asLinkAttrs.js.map +1 -0
- package/dist/helpers/asText.cjs +12 -0
- package/dist/helpers/asText.cjs.map +1 -0
- package/dist/helpers/asText.d.ts +16 -0
- package/dist/helpers/asText.js +12 -0
- package/dist/helpers/asText.js.map +1 -0
- package/dist/helpers/documentToLinkField.cjs +26 -0
- package/dist/helpers/documentToLinkField.cjs.map +1 -0
- package/dist/helpers/documentToLinkField.d.ts +15 -0
- package/dist/helpers/documentToLinkField.js +26 -0
- package/dist/helpers/documentToLinkField.js.map +1 -0
- package/dist/helpers/isFilled.cjs +67 -0
- package/dist/helpers/isFilled.cjs.map +1 -0
- package/dist/helpers/isFilled.d.ts +172 -0
- package/dist/helpers/isFilled.js +67 -0
- package/dist/helpers/isFilled.js.map +1 -0
- package/dist/index.cjs +56 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +138 -88
- package/dist/index.js +50 -16
- package/dist/index.js.map +1 -1
- package/dist/isRepositoryEndpoint.d.ts +10 -10
- package/dist/isRepositoryName.d.ts +9 -9
- package/dist/lib/appendFilters.cjs +11 -0
- package/dist/lib/appendFilters.cjs.map +1 -0
- package/dist/lib/appendFilters.d.ts +18 -0
- package/dist/lib/appendFilters.js +11 -0
- package/dist/lib/appendFilters.js.map +1 -0
- package/dist/lib/castArray.cjs +3 -1
- package/dist/lib/castArray.cjs.map +1 -1
- package/dist/lib/castArray.d.ts +11 -11
- package/dist/lib/castArray.js +3 -1
- package/dist/lib/castArray.js.map +1 -1
- package/dist/lib/castThunk.cjs +3 -1
- package/dist/lib/castThunk.cjs.map +1 -1
- package/dist/lib/castThunk.d.ts +10 -10
- package/dist/lib/castThunk.js +3 -1
- package/dist/lib/castThunk.js.map +1 -1
- package/dist/lib/devMsg.cjs +8 -0
- package/dist/lib/devMsg.cjs.map +1 -0
- package/dist/lib/devMsg.d.ts +16 -0
- package/dist/lib/devMsg.js +8 -0
- package/dist/lib/devMsg.js.map +1 -0
- package/dist/lib/escapeHTML.cjs +43 -0
- package/dist/lib/escapeHTML.cjs.map +1 -0
- package/dist/lib/escapeHTML.d.ts +1 -0
- package/dist/lib/escapeHTML.js +43 -0
- package/dist/lib/escapeHTML.js.map +1 -0
- package/dist/lib/everyTagFilter.cjs +9 -0
- package/dist/lib/everyTagFilter.cjs.map +1 -0
- package/dist/lib/everyTagFilter.d.ts +9 -0
- package/dist/lib/everyTagFilter.js +9 -0
- package/dist/lib/everyTagFilter.js.map +1 -0
- package/dist/lib/findMasterRef.cjs.map +1 -1
- package/dist/lib/findMasterRef.d.ts +10 -10
- package/dist/lib/findMasterRef.js.map +1 -1
- package/dist/lib/findRef.cjs +3 -3
- package/dist/lib/findRef.cjs.map +1 -1
- package/dist/lib/findRef.d.ts +13 -13
- package/dist/lib/findRef.js +3 -3
- package/dist/lib/findRef.js.map +1 -1
- package/dist/lib/findRefByID.cjs.map +1 -1
- package/dist/lib/findRefByID.d.ts +11 -11
- package/dist/lib/findRefByID.js.map +1 -1
- package/dist/lib/findRefByLabel.cjs.map +1 -1
- package/dist/lib/findRefByLabel.d.ts +11 -11
- package/dist/lib/findRefByLabel.js.map +1 -1
- package/dist/lib/getPreviewCookie.cjs +1 -1
- package/dist/lib/getPreviewCookie.cjs.map +1 -1
- package/dist/lib/getPreviewCookie.d.ts +9 -9
- package/dist/lib/getPreviewCookie.js +1 -1
- package/dist/lib/getPreviewCookie.js.map +1 -1
- package/dist/lib/isInternalURL.cjs +9 -0
- package/dist/lib/isInternalURL.cjs.map +1 -0
- package/dist/lib/isInternalURL.d.ts +8 -0
- package/dist/lib/isInternalURL.js +9 -0
- package/dist/lib/isInternalURL.js.map +1 -0
- package/dist/lib/minifyGraphQLQuery.d.ts +8 -8
- package/dist/lib/serializerHelpers.cjs +54 -0
- package/dist/lib/serializerHelpers.cjs.map +1 -0
- package/dist/lib/serializerHelpers.d.ts +9 -0
- package/dist/lib/serializerHelpers.js +54 -0
- package/dist/lib/serializerHelpers.js.map +1 -0
- package/dist/lib/someTagsFilter.cjs +9 -0
- package/dist/lib/someTagsFilter.cjs.map +1 -0
- package/dist/lib/someTagsFilter.d.ts +9 -0
- package/dist/lib/someTagsFilter.js +9 -0
- package/dist/lib/someTagsFilter.js.map +1 -0
- package/dist/lib/typeFilter.cjs +8 -0
- package/dist/lib/typeFilter.cjs.map +1 -0
- package/dist/lib/typeFilter.d.ts +8 -0
- package/dist/lib/typeFilter.js +8 -0
- package/dist/lib/typeFilter.js.map +1 -0
- package/dist/package.json.cjs +5 -0
- package/dist/package.json.cjs.map +1 -0
- package/dist/package.json.js +5 -0
- package/dist/package.json.js.map +1 -0
- package/dist/types/api/query.d.ts +42 -0
- package/dist/types/api/ref.d.ts +32 -0
- package/dist/types/api/release.d.ts +10 -0
- package/dist/types/api/repository.d.ts +100 -0
- package/dist/types/api/tags.d.ts +8 -0
- package/dist/types/model/boolean.d.ts +15 -0
- package/dist/types/model/color.d.ts +13 -0
- package/dist/types/model/contentRelationship.d.ts +18 -0
- package/dist/types/model/customType.d.ts +42 -0
- package/dist/types/model/date.d.ts +14 -0
- package/dist/types/model/embed.d.ts +13 -0
- package/dist/types/model/geoPoint.d.ts +12 -0
- package/dist/types/model/group.d.ts +15 -0
- package/dist/types/model/image.d.ts +31 -0
- package/dist/types/model/integrationFields.d.ts +14 -0
- package/dist/types/model/keyText.d.ts +13 -0
- package/dist/types/model/link.cjs +9 -0
- package/dist/types/model/link.cjs.map +1 -0
- package/dist/types/model/link.d.ts +27 -0
- package/dist/types/model/link.js +9 -0
- package/dist/types/model/link.js.map +1 -0
- package/dist/types/model/linkToMedia.d.ts +16 -0
- package/dist/types/model/number.d.ts +15 -0
- package/dist/types/model/range.d.ts +14 -0
- package/dist/types/model/richText.d.ts +35 -0
- package/dist/types/model/select.d.ts +18 -0
- package/dist/types/model/separator.d.ts +10 -0
- package/dist/types/model/sharedSlice.d.ts +16 -0
- package/dist/types/model/sharedSliceVariation.d.ts +19 -0
- package/dist/types/model/slice.cjs +8 -0
- package/dist/types/model/slice.cjs.map +1 -0
- package/dist/types/model/slice.d.ts +33 -0
- package/dist/types/model/slice.js +8 -0
- package/dist/types/model/slice.js.map +1 -0
- package/dist/types/model/sliceZone.cjs +8 -0
- package/dist/types/model/sliceZone.cjs.map +1 -0
- package/dist/types/model/sliceZone.d.ts +41 -0
- package/dist/types/model/sliceZone.js +8 -0
- package/dist/types/model/sliceZone.js.map +1 -0
- package/dist/types/model/timestamp.d.ts +14 -0
- package/dist/types/model/title.d.ts +7 -0
- package/dist/types/model/types.cjs +34 -0
- package/dist/types/model/types.cjs.map +1 -0
- package/dist/types/model/types.d.ts +62 -0
- package/dist/types/model/types.js +34 -0
- package/dist/types/model/types.js.map +1 -0
- package/dist/types/model/uid.d.ts +13 -0
- package/dist/types/value/boolean.d.ts +6 -0
- package/dist/types/value/color.d.ts +8 -0
- package/dist/types/value/contentRelationship.d.ts +29 -0
- package/dist/types/value/date.d.ts +8 -0
- package/dist/types/value/document.d.ts +113 -0
- package/dist/types/value/embed.cjs +10 -0
- package/dist/types/value/embed.cjs.map +1 -0
- package/dist/types/value/embed.d.ts +167 -0
- package/dist/types/value/embed.js +10 -0
- package/dist/types/value/embed.js.map +1 -0
- package/dist/types/value/geoPoint.d.ts +11 -0
- package/dist/types/value/group.d.ts +7 -0
- package/dist/types/value/image.d.ts +36 -0
- package/dist/types/value/integrationFields.d.ts +9 -0
- package/dist/types/value/keyText.d.ts +8 -0
- package/dist/types/value/link.cjs +10 -0
- package/dist/types/value/link.cjs.map +1 -0
- package/dist/types/value/link.d.ts +40 -0
- package/dist/types/value/link.js +10 -0
- package/dist/types/value/link.js.map +1 -0
- package/dist/types/value/linkToMedia.d.ts +20 -0
- package/dist/types/value/number.d.ts +8 -0
- package/dist/types/value/richText.cjs +25 -0
- package/dist/types/value/richText.cjs.map +1 -0
- package/dist/types/value/richText.d.ts +203 -0
- package/dist/types/value/richText.js +25 -0
- package/dist/types/value/richText.js.map +1 -0
- package/dist/types/value/select.d.ts +9 -0
- package/dist/types/value/sharedSlice.d.ts +11 -0
- package/dist/types/value/sharedSliceVariation.d.ts +7 -0
- package/dist/types/value/slice.d.ts +13 -0
- package/dist/types/value/sliceZone.d.ts +12 -0
- package/dist/types/value/timestamp.d.ts +8 -0
- package/dist/types/value/title.d.ts +12 -0
- package/dist/types/value/types.d.ts +40 -0
- package/dist/types/webhook/apiUpdate.d.ts +52 -0
- package/dist/types/webhook/testTrigger.d.ts +9 -0
- package/dist/types/webhook/types.cjs +8 -0
- package/dist/types/webhook/types.cjs.map +1 -0
- package/dist/types/webhook/types.d.ts +18 -0
- package/dist/types/webhook/types.js +8 -0
- package/dist/types/webhook/types.js.map +1 -0
- package/package.json +42 -36
- package/src/buildQueryURL.ts +179 -32
- package/src/{client.ts → createClient.ts} +248 -186
- package/src/filter.ts +356 -0
- package/src/getGraphQLEndpoint.ts +2 -1
- package/src/getRepositoryEndpoint.ts +2 -1
- package/src/getRepositoryName.ts +1 -1
- package/src/getToolbarSrc.ts +50 -0
- package/src/helpers/asDate.ts +48 -0
- package/src/helpers/asHTML.ts +249 -0
- package/src/helpers/asImagePixelDensitySrcSet.ts +96 -0
- package/src/helpers/asImageSrc.ts +41 -0
- package/src/helpers/asImageWidthSrcSet.ts +139 -0
- package/src/helpers/asLink.ts +118 -0
- package/src/helpers/asLinkAttrs.ts +127 -0
- package/src/helpers/asText.ts +29 -0
- package/src/helpers/documentToLinkField.ts +47 -0
- package/src/helpers/isFilled.ts +288 -0
- package/src/index.ts +277 -31
- package/src/lib/appendFilters.ts +26 -0
- package/src/lib/castArray.ts +3 -1
- package/src/lib/castThunk.ts +3 -2
- package/src/lib/devMsg.ts +20 -0
- package/src/lib/escapeHTML.ts +51 -0
- package/src/lib/everyTagFilter.ts +15 -0
- package/src/lib/findMasterRef.ts +2 -2
- package/src/lib/findRef.ts +6 -9
- package/src/lib/findRefByID.ts +2 -2
- package/src/lib/findRefByLabel.ts +2 -5
- package/src/lib/getPreviewCookie.ts +1 -1
- package/src/lib/isInternalURL.ts +14 -0
- package/src/lib/serializerHelpers.ts +101 -0
- package/src/lib/someTagsFilter.ts +15 -0
- package/src/lib/typeFilter.ts +12 -0
- package/src/types/api/query.ts +50 -0
- package/src/types/api/ref.ts +36 -0
- package/src/types/api/release.ts +11 -0
- package/src/types/api/repository.ts +117 -0
- package/src/types/api/tags.ts +8 -0
- package/src/types/model/boolean.ts +16 -0
- package/src/types/model/color.ts +14 -0
- package/src/types/model/contentRelationship.ts +23 -0
- package/src/types/model/customType.ts +61 -0
- package/src/types/model/date.ts +15 -0
- package/src/types/model/embed.ts +14 -0
- package/src/types/model/geoPoint.ts +13 -0
- package/src/types/model/group.ts +24 -0
- package/src/types/model/image.ts +37 -0
- package/src/types/model/integrationFields.ts +15 -0
- package/src/types/model/keyText.ts +14 -0
- package/src/types/model/link.ts +31 -0
- package/src/types/model/linkToMedia.ts +18 -0
- package/src/types/model/number.ts +16 -0
- package/src/types/model/range.ts +15 -0
- package/src/types/model/richText.ts +40 -0
- package/src/types/model/select.ts +22 -0
- package/src/types/model/separator.ts +11 -0
- package/src/types/model/sharedSlice.ts +20 -0
- package/src/types/model/sharedSliceVariation.ts +30 -0
- package/src/types/model/slice.ts +50 -0
- package/src/types/model/sliceZone.ts +60 -0
- package/src/types/model/timestamp.ts +15 -0
- package/src/types/model/title.ts +8 -0
- package/src/types/model/types.ts +87 -0
- package/src/types/model/uid.ts +14 -0
- package/src/types/value/boolean.ts +6 -0
- package/src/types/value/color.ts +10 -0
- package/src/types/value/contentRelationship.ts +47 -0
- package/src/types/value/date.ts +10 -0
- package/src/types/value/document.ts +143 -0
- package/src/types/value/embed.ts +196 -0
- package/src/types/value/geoPoint.ts +15 -0
- package/src/types/value/group.ts +14 -0
- package/src/types/value/image.ts +67 -0
- package/src/types/value/integrationFields.ts +13 -0
- package/src/types/value/keyText.ts +10 -0
- package/src/types/value/link.ts +59 -0
- package/src/types/value/linkToMedia.ts +26 -0
- package/src/types/value/number.ts +10 -0
- package/src/types/value/richText.ts +287 -0
- package/src/types/value/select.ts +13 -0
- package/src/types/value/sharedSlice.ts +15 -0
- package/src/types/value/sharedSliceVariation.ts +18 -0
- package/src/types/value/slice.ts +24 -0
- package/src/types/value/sliceZone.ts +17 -0
- package/src/types/value/timestamp.ts +13 -0
- package/src/types/value/title.ts +32 -0
- package/src/types/value/types.ts +58 -0
- package/src/types/webhook/apiUpdate.ts +56 -0
- package/src/types/webhook/testTrigger.ts +10 -0
- package/src/types/webhook/types.ts +21 -0
- package/dist/ForbiddenError.cjs.map +0 -1
- package/dist/ForbiddenError.js.map +0 -1
- package/dist/NotFoundError.cjs.map +0 -1
- package/dist/NotFoundError.js.map +0 -1
- package/dist/ParsingError.cjs.map +0 -1
- package/dist/ParsingError.js.map +0 -1
- package/dist/PrismicError.cjs.map +0 -1
- package/dist/PrismicError.js.map +0 -1
- package/dist/client.cjs +0 -436
- package/dist/client.cjs.map +0 -1
- package/dist/client.js +0 -419
- package/dist/client.js.map +0 -1
- package/dist/lib/appendPredicates.cjs +0 -14
- package/dist/lib/appendPredicates.cjs.map +0 -1
- package/dist/lib/appendPredicates.d.ts +0 -18
- package/dist/lib/appendPredicates.js +0 -14
- package/dist/lib/appendPredicates.js.map +0 -1
- package/dist/lib/orElseThrow.d.ts +0 -11
- package/dist/predicate.cjs +0 -68
- package/dist/predicate.cjs.map +0 -1
- package/dist/predicate.d.ts +0 -209
- package/dist/predicate.js +0 -68
- package/dist/predicate.js.map +0 -1
- package/dist/types.d.ts +0 -156
- package/src/lib/appendPredicates.ts +0 -29
- package/src/lib/orElseThrow.ts +0 -17
- package/src/predicate.ts +0 -359
- package/src/types.ts +0 -191
- /package/dist/{ForbiddenError.cjs → errors/ForbiddenError.cjs} +0 -0
- /package/dist/{ForbiddenError.js → errors/ForbiddenError.js} +0 -0
- /package/dist/{NotFoundError.cjs → errors/NotFoundError.cjs} +0 -0
- /package/dist/{NotFoundError.js → errors/NotFoundError.js} +0 -0
- /package/dist/{ParsingError.cjs → errors/ParsingError.cjs} +0 -0
- /package/dist/{ParsingError.js → errors/ParsingError.js} +0 -0
- /package/dist/{PrismicError.cjs → errors/PrismicError.cjs} +0 -0
- /package/dist/{PrismicError.js → errors/PrismicError.js} +0 -0
- /package/src/{ForbiddenError.ts → errors/ForbiddenError.ts} +0 -0
- /package/src/{NotFoundError.ts → errors/NotFoundError.ts} +0 -0
- /package/src/{ParsingError.ts → errors/ParsingError.ts} +0 -0
- /package/src/{PrismicError.ts → errors/PrismicError.ts} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { filter } from "../filter";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a filter to filter content by document type.
|
|
5
|
+
*
|
|
6
|
+
* @param documentType - The document type to filter queried content.
|
|
7
|
+
*
|
|
8
|
+
* @returns A filter that can be used in a Prismic REST API V2 request.
|
|
9
|
+
*/
|
|
10
|
+
export const typeFilter = (documentType: string): string => {
|
|
11
|
+
return filter.at("document.type", documentType);
|
|
12
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PrismicDocument } from "../value/document";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A query response from the Prismic REST API V2. The response contains
|
|
5
|
+
* paginated metadata and a list of matching results for the query.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam Document - The type(s) of Prismic document that can be returned.
|
|
8
|
+
* @see More details on querying: {@link https://prismic.io/docs/api}
|
|
9
|
+
*/
|
|
10
|
+
export interface Query<Document extends PrismicDocument = PrismicDocument> {
|
|
11
|
+
/**
|
|
12
|
+
* The page number for this page of results.
|
|
13
|
+
*/
|
|
14
|
+
page: number;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Maximum number of results per page.
|
|
18
|
+
*/
|
|
19
|
+
results_per_page: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Number of results in this page.
|
|
23
|
+
*/
|
|
24
|
+
results_size: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Total number of results within all pages.
|
|
28
|
+
*/
|
|
29
|
+
total_results_size: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Total number of pages.
|
|
33
|
+
*/
|
|
34
|
+
total_pages: number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The Prismic REST API V2 URL to the next page, if one exists.
|
|
38
|
+
*/
|
|
39
|
+
next_page: string | null;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The Prismic REST API V2 URL to the previous page, if one exists.
|
|
43
|
+
*/
|
|
44
|
+
prev_page: string | null;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A paginated list of documents matching the query.
|
|
48
|
+
*/
|
|
49
|
+
results: Document[];
|
|
50
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata for a reference to a version of a repository's content.
|
|
3
|
+
*
|
|
4
|
+
* @see More details on refs: {@link https://prismic.io/docs/api#refs-and-the-entry-api}
|
|
5
|
+
*/
|
|
6
|
+
export interface Ref {
|
|
7
|
+
/**
|
|
8
|
+
* The unique identifier for the ref.
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The identifier that should be provided to the API to select a content
|
|
14
|
+
* version.
|
|
15
|
+
*/
|
|
16
|
+
ref: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A human-readable name for the ref. The master ref is always named "Master".
|
|
20
|
+
*/
|
|
21
|
+
label: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Determines if the ref is the master ref. The master ref contains the latest
|
|
25
|
+
* published content.
|
|
26
|
+
*/
|
|
27
|
+
isMasterRef: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* If the ref is associated with a Release, this field contains the timestamp
|
|
31
|
+
* at which the Release will be automatically published, if set.
|
|
32
|
+
*
|
|
33
|
+
* @see More details on Releases: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
|
|
34
|
+
*/
|
|
35
|
+
scheduledAt?: string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Ref } from "./ref";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Metadata for a Release.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This is an alias for `Ref`.
|
|
8
|
+
* @see {@link Ref}
|
|
9
|
+
* @see More details on Releases: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
|
|
10
|
+
*/
|
|
11
|
+
export type Release = Ref;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Ref } from "./ref";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Repository metadata returned from the Prismic REST API V2. This data can be
|
|
5
|
+
* fetched by sending a `GET` a request to a repository's `/api/v2` endpoint.
|
|
6
|
+
*
|
|
7
|
+
* @see More details on the `/api/v2` endpoint: {@link https://prismic.io/docs/api#refs-and-the-entry-api}
|
|
8
|
+
*/
|
|
9
|
+
export interface Repository {
|
|
10
|
+
/**
|
|
11
|
+
* A list of refs for the repository.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link Ref}
|
|
14
|
+
*/
|
|
15
|
+
refs: Ref[];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An identifier used to query content with the latest Integration Fields
|
|
19
|
+
* data.
|
|
20
|
+
*/
|
|
21
|
+
integrationFieldsRef: string | null;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A list of languages for the repository.
|
|
25
|
+
*
|
|
26
|
+
* @see {@link Language}
|
|
27
|
+
*/
|
|
28
|
+
languages: Language[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A list of the repository's Custom Type API IDs mapped to their
|
|
32
|
+
* human-readable name.
|
|
33
|
+
*/
|
|
34
|
+
types: Record<string, string>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A list of tags for the repository.
|
|
38
|
+
*/
|
|
39
|
+
tags: string[];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* An internally-used list of REST API features for the repository.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
forms: Record<string, Form>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The URL used to begin the OAuth process for the repository.
|
|
50
|
+
*/
|
|
51
|
+
oauth_initiate: string;
|
|
52
|
+
|
|
53
|
+
// TODO: Describe this field
|
|
54
|
+
oauth_token: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The version of the API.
|
|
58
|
+
*/
|
|
59
|
+
version: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Licensing information for the repository content.
|
|
63
|
+
*/
|
|
64
|
+
license: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Experiments are no longer part of Prismic.
|
|
68
|
+
*/
|
|
69
|
+
experiments: unknown;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated Bookmarks are not longer part of Prismic.
|
|
73
|
+
*/
|
|
74
|
+
bookmarks: Record<string, string>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Metadata for a language that has been configured for a repository.
|
|
79
|
+
*/
|
|
80
|
+
export interface Language {
|
|
81
|
+
/**
|
|
82
|
+
* A unique identifier for the language.
|
|
83
|
+
*/
|
|
84
|
+
id: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The name of the language.
|
|
88
|
+
*/
|
|
89
|
+
name: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A Prismic REST API V2 feature supported by the repository. It contains
|
|
94
|
+
* metadata about the feature and how to interact with it via the API.
|
|
95
|
+
*
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
export interface Form {
|
|
99
|
+
method: "GET";
|
|
100
|
+
enctype: string;
|
|
101
|
+
action: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
rel?: string;
|
|
104
|
+
fields: Record<string, FormField>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* A field for a feature of the Prismic REST API V2. It contains metadata about
|
|
109
|
+
* the feature's field and how to interact with it via the API.
|
|
110
|
+
*
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
export interface FormField {
|
|
114
|
+
type: "String" | "Integer";
|
|
115
|
+
multiple: boolean;
|
|
116
|
+
default?: string;
|
|
117
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List of tags returned from the Prismic Tags API. This data can be fetched by
|
|
3
|
+
* sending a `GET` request to a repository's `/api/tags` endpoint.
|
|
4
|
+
*
|
|
5
|
+
* @typeParam Tag - Tags that are returned by the Tags API.
|
|
6
|
+
* @see More details on the Tags API: {@link https://prismic.io/docs/tags-api-technical-reference}
|
|
7
|
+
*/
|
|
8
|
+
export type Tags<Tag extends string = string> = Tag[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Boolean Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/boolean}
|
|
7
|
+
*/
|
|
8
|
+
export interface CustomTypeModelBooleanField {
|
|
9
|
+
type: typeof CustomTypeModelFieldType.Boolean;
|
|
10
|
+
config?: {
|
|
11
|
+
label?: string | null;
|
|
12
|
+
default_value?: boolean;
|
|
13
|
+
placeholder_true?: string;
|
|
14
|
+
placeholder_false?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Color Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/color}
|
|
7
|
+
*/
|
|
8
|
+
export interface CustomTypeModelColorField {
|
|
9
|
+
type: typeof CustomTypeModelFieldType.Color;
|
|
10
|
+
config?: {
|
|
11
|
+
label?: string | null;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
import type { CustomTypeModelLinkSelectType } from "./link";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A Content Relationship Custom Type field.
|
|
7
|
+
*
|
|
8
|
+
* More details:
|
|
9
|
+
* {@link https://prismic.io/docs/content-relationship}
|
|
10
|
+
*/
|
|
11
|
+
export interface CustomTypeModelContentRelationshipField<
|
|
12
|
+
CustomTypeIDs extends string = string,
|
|
13
|
+
Tags extends string = string,
|
|
14
|
+
> {
|
|
15
|
+
type: typeof CustomTypeModelFieldType.Link;
|
|
16
|
+
config?: {
|
|
17
|
+
label?: string | null;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
select: typeof CustomTypeModelLinkSelectType.Document;
|
|
20
|
+
customtypes?: readonly CustomTypeIDs[];
|
|
21
|
+
tags?: readonly Tags[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CustomTypeModelField } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Prismic Custom Type model.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam ID - API ID of the Custom Type.
|
|
7
|
+
* @typeParam Definition - The Custom Type's tabs and their fields.
|
|
8
|
+
*/
|
|
9
|
+
export interface CustomTypeModel<
|
|
10
|
+
ID extends string = string,
|
|
11
|
+
Definition extends CustomTypeModelDefinition = CustomTypeModelDefinition,
|
|
12
|
+
> {
|
|
13
|
+
/**
|
|
14
|
+
* The ID of the Custom Type model.
|
|
15
|
+
*/
|
|
16
|
+
id: ID;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The human readable name of the Custom Type Model.
|
|
20
|
+
*/
|
|
21
|
+
// TODO: Revert to `label?: string | null` if `label` can be partial in: https://github.com/prismicio/prismic-types-internal/blob/HEAD/src/customtypes/CustomType.ts#L39
|
|
22
|
+
label: string | null | undefined;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Determines if more than one document for the Custom Type can be created.
|
|
26
|
+
*/
|
|
27
|
+
repeatable: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The Custom Type model definition.
|
|
31
|
+
*/
|
|
32
|
+
json: Definition;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Determines if new documents for the Custom Type can be created.
|
|
36
|
+
*/
|
|
37
|
+
status: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A Prismic Custom Type's tabs and their fields.
|
|
42
|
+
*
|
|
43
|
+
* @typeParam TabName - Names of Custom Type tabs.
|
|
44
|
+
*/
|
|
45
|
+
export type CustomTypeModelDefinition<TabName extends string = string> = Record<
|
|
46
|
+
TabName,
|
|
47
|
+
CustomTypeModelTab
|
|
48
|
+
>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A Custom Type's tab. Each tab can contain any number of fields but is limited
|
|
52
|
+
* to one Slice Zone.
|
|
53
|
+
*
|
|
54
|
+
* @typeParam FieldName - API IDs of the fields.
|
|
55
|
+
*/
|
|
56
|
+
export type CustomTypeModelTab<
|
|
57
|
+
Fields extends Record<string, CustomTypeModelField> = Record<
|
|
58
|
+
string,
|
|
59
|
+
CustomTypeModelField
|
|
60
|
+
>,
|
|
61
|
+
> = Fields;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Date Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/date}
|
|
7
|
+
*/
|
|
8
|
+
export interface CustomTypeModelDateField {
|
|
9
|
+
type: typeof CustomTypeModelFieldType.Date;
|
|
10
|
+
config?: {
|
|
11
|
+
label?: string | null;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
default?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An Embed Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/embed}
|
|
7
|
+
*/
|
|
8
|
+
export interface CustomTypeModelEmbedField {
|
|
9
|
+
type: typeof CustomTypeModelFieldType.Embed;
|
|
10
|
+
config?: {
|
|
11
|
+
label?: string | null;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A GeoPoint Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/geopoint}
|
|
7
|
+
*/
|
|
8
|
+
export interface CustomTypeModelGeoPointField {
|
|
9
|
+
type: typeof CustomTypeModelFieldType.GeoPoint;
|
|
10
|
+
config?: {
|
|
11
|
+
label?: string | null;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CustomTypeModelFieldForGroup,
|
|
3
|
+
CustomTypeModelFieldType,
|
|
4
|
+
} from "./types";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A Group Custom Type field.
|
|
8
|
+
*
|
|
9
|
+
* More details: {@link https://prismic.io/docs/group}
|
|
10
|
+
*
|
|
11
|
+
* @typeParam Fields - A record of fields that can be repeated.
|
|
12
|
+
*/
|
|
13
|
+
export interface CustomTypeModelGroupField<
|
|
14
|
+
Fields extends Record<string, CustomTypeModelFieldForGroup> = Record<
|
|
15
|
+
string,
|
|
16
|
+
CustomTypeModelFieldForGroup
|
|
17
|
+
>,
|
|
18
|
+
> {
|
|
19
|
+
type: typeof CustomTypeModelFieldType.Group;
|
|
20
|
+
config?: {
|
|
21
|
+
label?: string | null;
|
|
22
|
+
fields?: Fields;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Dimension constraints for an Image Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/image}
|
|
7
|
+
*/
|
|
8
|
+
export interface CustomTypeModelImageConstraint {
|
|
9
|
+
width?: number | null;
|
|
10
|
+
height?: number | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A thumbnail for an Image Custom Type field.
|
|
15
|
+
*
|
|
16
|
+
* More details: {@link https://prismic.io/docs/image}
|
|
17
|
+
*/
|
|
18
|
+
export interface CustomTypeModelImageThumbnail<Name extends string = string>
|
|
19
|
+
extends CustomTypeModelImageConstraint {
|
|
20
|
+
name: Name;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An Image Custom Type field.
|
|
25
|
+
*
|
|
26
|
+
* More details: {@link https://prismic.io/docs/image}
|
|
27
|
+
*/
|
|
28
|
+
export interface CustomTypeModelImageField<
|
|
29
|
+
ThumbnailNames extends string = string,
|
|
30
|
+
> {
|
|
31
|
+
type: typeof CustomTypeModelFieldType.Image;
|
|
32
|
+
config?: {
|
|
33
|
+
label?: string | null;
|
|
34
|
+
constraint?: CustomTypeModelImageConstraint;
|
|
35
|
+
thumbnails?: readonly CustomTypeModelImageThumbnail<ThumbnailNames>[];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An Integration Fields Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/integration-fields}
|
|
7
|
+
*/
|
|
8
|
+
export interface CustomTypeModelIntegrationFieldsField {
|
|
9
|
+
type: typeof CustomTypeModelFieldType.IntegrationFields;
|
|
10
|
+
config?: {
|
|
11
|
+
label?: string | null;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
catalog?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Key Text Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/key-text}
|
|
7
|
+
*/
|
|
8
|
+
export interface CustomTypeModelKeyTextField {
|
|
9
|
+
type: typeof CustomTypeModelFieldType.Text;
|
|
10
|
+
config?: {
|
|
11
|
+
label?: string | null;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Link Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details:
|
|
7
|
+
* {@link https://prismic.io/docs/link}
|
|
8
|
+
*/
|
|
9
|
+
export interface CustomTypeModelLinkField {
|
|
10
|
+
type: typeof CustomTypeModelFieldType.Link;
|
|
11
|
+
config?: {
|
|
12
|
+
label?: string | null;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
select?:
|
|
15
|
+
| null
|
|
16
|
+
| (typeof CustomTypeModelLinkSelectType)[keyof typeof CustomTypeModelLinkSelectType];
|
|
17
|
+
allowTargetBlank?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Type of a Link Custom Type field.
|
|
23
|
+
*
|
|
24
|
+
* More details:
|
|
25
|
+
* {@link https://prismic.io/docs/link}
|
|
26
|
+
*/
|
|
27
|
+
export const CustomTypeModelLinkSelectType = {
|
|
28
|
+
Document: "document",
|
|
29
|
+
Media: "media",
|
|
30
|
+
Web: "web",
|
|
31
|
+
} as const;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
import type { CustomTypeModelLinkSelectType } from "./link";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A Link to Media Custom Type field.
|
|
7
|
+
*
|
|
8
|
+
* More details:
|
|
9
|
+
* {@link https://prismic.io/docs/media}
|
|
10
|
+
*/
|
|
11
|
+
export interface CustomTypeModelLinkToMediaField {
|
|
12
|
+
type: typeof CustomTypeModelFieldType.Link;
|
|
13
|
+
config?: {
|
|
14
|
+
label?: string | null;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
select: typeof CustomTypeModelLinkSelectType.Media;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Number Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/number}
|
|
7
|
+
*/
|
|
8
|
+
export interface CustomTypeModelNumberField {
|
|
9
|
+
type: typeof CustomTypeModelFieldType.Number;
|
|
10
|
+
config?: {
|
|
11
|
+
label?: string | null;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
min?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated - Legacy field. Use `CustomTypeModelNumberField` instead.
|
|
5
|
+
*/
|
|
6
|
+
export interface CustomTypeModelRangeField {
|
|
7
|
+
type: typeof CustomTypeModelFieldType.Range;
|
|
8
|
+
config?: {
|
|
9
|
+
label?: string | null;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
step?: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Rich Text Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/rich-text-title}
|
|
7
|
+
*/
|
|
8
|
+
export type CustomTypeModelRichTextField =
|
|
9
|
+
| CustomTypeModelRichTextMultiField
|
|
10
|
+
| CustomTypeModelRichTextSingleField;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A Rich Text Custom Type field which supports multiple blocks of content.
|
|
14
|
+
*
|
|
15
|
+
* More details: {@link https://prismic.io/docs/rich-text-title}
|
|
16
|
+
*/
|
|
17
|
+
export interface CustomTypeModelRichTextMultiField {
|
|
18
|
+
type: typeof CustomTypeModelFieldType.StructuredText;
|
|
19
|
+
config?: {
|
|
20
|
+
label?: string | null;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
allowTargetBlank?: boolean;
|
|
23
|
+
multi?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A Rich Text Custom Type field which supports one block of content.
|
|
29
|
+
*
|
|
30
|
+
* More details: {@link https://prismic.io/docs/rich-text-title}
|
|
31
|
+
*/
|
|
32
|
+
export interface CustomTypeModelRichTextSingleField {
|
|
33
|
+
type: typeof CustomTypeModelFieldType.StructuredText;
|
|
34
|
+
config?: {
|
|
35
|
+
label?: string | null;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
allowTargetBlank?: boolean;
|
|
38
|
+
single?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Select Custom Type field.
|
|
5
|
+
*
|
|
6
|
+
* More details: {@link https://prismic.io/docs/select}
|
|
7
|
+
*
|
|
8
|
+
* @typeParam Options - Options for the field.
|
|
9
|
+
* @typeParam DefaultValue - Default value for the field.
|
|
10
|
+
*/
|
|
11
|
+
export interface CustomTypeModelSelectField<
|
|
12
|
+
Option extends string = string,
|
|
13
|
+
DefaultValue extends Option = Option,
|
|
14
|
+
> {
|
|
15
|
+
type: typeof CustomTypeModelFieldType.Select;
|
|
16
|
+
config?: {
|
|
17
|
+
label?: string | null;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
options?: readonly Option[];
|
|
20
|
+
default_value?: DefaultValue;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated - Legacy field. Do not use.
|
|
5
|
+
*/
|
|
6
|
+
export interface CustomTypeModelSeparatorField {
|
|
7
|
+
type: typeof CustomTypeModelFieldType.Separator;
|
|
8
|
+
config?: {
|
|
9
|
+
label?: string | null;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SharedSliceModelVariation } from "./sharedSliceVariation";
|
|
2
|
+
import type { CustomTypeModelSliceType } from "./sliceZone";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A Prismic Shared Slice model.
|
|
6
|
+
*
|
|
7
|
+
* More details: {@link https://prismic.io/docs/slice}
|
|
8
|
+
*
|
|
9
|
+
* @typeParam Variation - A variation for the Shared Slice.
|
|
10
|
+
*/
|
|
11
|
+
export interface SharedSliceModel<
|
|
12
|
+
ID extends string = string,
|
|
13
|
+
Variation extends SharedSliceModelVariation = SharedSliceModelVariation,
|
|
14
|
+
> {
|
|
15
|
+
type: typeof CustomTypeModelSliceType.SharedSlice;
|
|
16
|
+
id: ID;
|
|
17
|
+
name: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
variations: readonly Variation[];
|
|
20
|
+
}
|