@prismicio/client 7.0.0-alpha.0 → 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 +26 -8
- package/dist/buildQueryURL.cjs.map +1 -1
- package/dist/buildQueryURL.d.ts +207 -130
- package/dist/buildQueryURL.js +25 -7
- package/dist/buildQueryURL.js.map +1 -1
- package/dist/cookie.cjs +1 -1
- package/dist/cookie.cjs.map +1 -1
- package/dist/cookie.d.ts +5 -5
- package/dist/cookie.js.map +1 -1
- package/dist/createClient.cjs +1142 -0
- package/dist/createClient.cjs.map +1 -0
- package/dist/{client.d.ts → createClient.d.ts} +980 -908
- package/dist/createClient.js +1142 -0
- package/dist/createClient.js.map +1 -0
- package/dist/{ForbiddenError.cjs → errors/ForbiddenError.cjs} +1 -1
- 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/{NotFoundError.cjs → errors/NotFoundError.cjs} +1 -1
- 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/{ParsingError.cjs → errors/ParsingError.cjs} +1 -1
- 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/{PrismicError.cjs → errors/PrismicError.cjs} +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +1 -1
- package/dist/helpers/asDate.cjs.map +1 -1
- package/dist/helpers/asDate.d.ts +16 -16
- package/dist/helpers/asDate.js.map +1 -1
- package/dist/helpers/asHTML.cjs +7 -6
- package/dist/helpers/asHTML.cjs.map +1 -1
- package/dist/helpers/asHTML.d.ts +77 -20
- package/dist/helpers/asHTML.js +6 -5
- package/dist/helpers/asHTML.js.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +52 -52
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
- package/dist/helpers/asImageSrc.cjs +1 -1
- package/dist/helpers/asImageSrc.cjs.map +1 -1
- package/dist/helpers/asImageSrc.d.ts +27 -27
- package/dist/helpers/asImageSrc.js.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.cjs +19 -14
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.ts +60 -60
- package/dist/helpers/asImageWidthSrcSet.js +18 -13
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
- package/dist/helpers/asLink.cjs +8 -2
- package/dist/helpers/asLink.cjs.map +1 -1
- package/dist/helpers/asLink.d.ts +34 -24
- package/dist/helpers/asLink.js +7 -1
- package/dist/helpers/asLink.js.map +1 -1
- 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 +1 -1
- package/dist/helpers/asText.cjs.map +1 -1
- package/dist/helpers/asText.d.ts +16 -16
- package/dist/helpers/asText.js.map +1 -1
- package/dist/helpers/documentToLinkField.cjs +12 -5
- package/dist/helpers/documentToLinkField.cjs.map +1 -1
- package/dist/helpers/documentToLinkField.d.ts +15 -15
- package/dist/helpers/documentToLinkField.js +11 -4
- package/dist/helpers/documentToLinkField.js.map +1 -1
- package/dist/helpers/isFilled.cjs +1 -1
- package/dist/helpers/isFilled.cjs.map +1 -1
- package/dist/helpers/isFilled.d.ts +172 -175
- package/dist/helpers/isFilled.js.map +1 -1
- package/dist/index.cjs +20 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +138 -92
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/dist/isRepositoryEndpoint.cjs +1 -1
- package/dist/isRepositoryEndpoint.cjs.map +1 -1
- package/dist/isRepositoryEndpoint.d.ts +10 -10
- package/dist/isRepositoryEndpoint.js.map +1 -1
- package/dist/isRepositoryName.cjs +1 -1
- package/dist/isRepositoryName.cjs.map +1 -1
- package/dist/isRepositoryName.d.ts +9 -9
- package/dist/isRepositoryName.js.map +1 -1
- 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 +4 -2
- 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 +4 -2
- 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 +1 -1
- 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 +4 -4
- 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 +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 +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.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.cjs +1 -1
- package/dist/lib/minifyGraphQLQuery.cjs.map +1 -1
- package/dist/lib/minifyGraphQLQuery.d.ts +8 -8
- package/dist/lib/minifyGraphQLQuery.js.map +1 -1
- package/dist/lib/serializerHelpers.cjs +7 -9
- package/dist/lib/serializerHelpers.cjs.map +1 -1
- package/dist/lib/serializerHelpers.d.ts +9 -9
- package/dist/lib/serializerHelpers.js +6 -6
- package/dist/lib/serializerHelpers.js.map +1 -1
- 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 -42
- package/dist/types/api/ref.d.ts +32 -32
- package/dist/types/api/release.d.ts +10 -10
- package/dist/types/api/repository.d.ts +100 -100
- package/dist/types/api/tags.d.ts +8 -8
- package/dist/types/model/boolean.d.ts +15 -15
- package/dist/types/model/color.d.ts +13 -13
- package/dist/types/model/contentRelationship.d.ts +18 -18
- package/dist/types/model/customType.d.ts +42 -42
- package/dist/types/model/date.d.ts +14 -14
- package/dist/types/model/embed.d.ts +13 -13
- package/dist/types/model/geoPoint.d.ts +12 -12
- package/dist/types/model/group.d.ts +15 -15
- package/dist/types/model/image.d.ts +31 -31
- package/dist/types/model/integrationFields.d.ts +14 -14
- package/dist/types/model/keyText.d.ts +13 -13
- package/dist/types/model/link.cjs +1 -1
- package/dist/types/model/link.cjs.map +1 -1
- package/dist/types/model/link.d.ts +27 -27
- package/dist/types/model/link.js.map +1 -1
- package/dist/types/model/linkToMedia.d.ts +16 -16
- package/dist/types/model/number.d.ts +15 -15
- package/dist/types/model/range.d.ts +14 -14
- package/dist/types/model/richText.d.ts +35 -35
- package/dist/types/model/select.d.ts +18 -18
- package/dist/types/model/separator.d.ts +10 -10
- package/dist/types/model/sharedSlice.d.ts +16 -19
- package/dist/types/model/sharedSliceVariation.d.ts +19 -22
- package/dist/types/model/slice.cjs +1 -1
- package/dist/types/model/slice.cjs.map +1 -1
- package/dist/types/model/slice.d.ts +33 -33
- package/dist/types/model/slice.js.map +1 -1
- package/dist/types/model/sliceZone.cjs +1 -1
- package/dist/types/model/sliceZone.cjs.map +1 -1
- package/dist/types/model/sliceZone.d.ts +41 -44
- package/dist/types/model/sliceZone.js.map +1 -1
- package/dist/types/model/timestamp.d.ts +14 -14
- package/dist/types/model/title.d.ts +7 -7
- package/dist/types/model/types.cjs +10 -1
- package/dist/types/model/types.cjs.map +1 -1
- package/dist/types/model/types.d.ts +62 -62
- package/dist/types/model/types.js +9 -0
- package/dist/types/model/types.js.map +1 -1
- package/dist/types/model/uid.d.ts +13 -13
- package/dist/types/value/boolean.d.ts +6 -6
- package/dist/types/value/color.d.ts +8 -8
- package/dist/types/value/contentRelationship.d.ts +29 -29
- package/dist/types/value/date.d.ts +8 -8
- package/dist/types/value/document.d.ts +113 -113
- package/dist/types/value/embed.cjs +1 -1
- package/dist/types/value/embed.cjs.map +1 -1
- package/dist/types/value/embed.d.ts +167 -167
- package/dist/types/value/embed.js.map +1 -1
- package/dist/types/value/geoPoint.d.ts +11 -11
- package/dist/types/value/group.d.ts +7 -7
- package/dist/types/value/image.d.ts +36 -36
- package/dist/types/value/integrationFields.d.ts +9 -9
- package/dist/types/value/keyText.d.ts +8 -8
- package/dist/types/value/link.cjs +1 -1
- package/dist/types/value/link.cjs.map +1 -1
- package/dist/types/value/link.d.ts +40 -40
- package/dist/types/value/link.js.map +1 -1
- package/dist/types/value/linkToMedia.d.ts +20 -20
- package/dist/types/value/number.d.ts +8 -8
- package/dist/types/value/richText.cjs +1 -1
- package/dist/types/value/richText.cjs.map +1 -1
- package/dist/types/value/richText.d.ts +203 -203
- package/dist/types/value/richText.js.map +1 -1
- package/dist/types/value/select.d.ts +9 -9
- package/dist/types/value/sharedSlice.d.ts +11 -11
- package/dist/types/value/sharedSliceVariation.d.ts +7 -7
- package/dist/types/value/slice.d.ts +13 -13
- package/dist/types/value/sliceZone.d.ts +12 -12
- package/dist/types/value/timestamp.d.ts +8 -8
- package/dist/types/value/title.d.ts +12 -12
- package/dist/types/value/types.d.ts +40 -40
- package/dist/types/webhook/apiUpdate.d.ts +52 -52
- package/dist/types/webhook/testTrigger.d.ts +9 -9
- package/dist/types/webhook/types.cjs +1 -1
- package/dist/types/webhook/types.cjs.map +1 -1
- package/dist/types/webhook/types.d.ts +18 -18
- package/dist/types/webhook/types.js.map +1 -1
- package/package.json +23 -24
- package/src/buildQueryURL.ts +179 -33
- package/src/{client.ts → createClient.ts} +214 -110
- 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 +3 -3
- package/src/helpers/asHTML.ts +122 -27
- package/src/helpers/asImagePixelDensitySrcSet.ts +1 -1
- package/src/helpers/asImageSrc.ts +1 -1
- package/src/helpers/asImageWidthSrcSet.ts +1 -1
- package/src/helpers/asLink.ts +37 -18
- package/src/helpers/asLinkAttrs.ts +127 -0
- package/src/helpers/asText.ts +4 -4
- package/src/helpers/documentToLinkField.ts +3 -3
- package/src/helpers/isFilled.ts +9 -11
- package/src/index.ts +59 -29
- 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/findRef.ts +5 -5
- package/src/lib/isInternalURL.ts +14 -0
- package/src/lib/serializerHelpers.ts +20 -15
- package/src/lib/someTagsFilter.ts +15 -0
- package/src/lib/typeFilter.ts +12 -0
- package/src/types/api/query.ts +1 -1
- package/src/types/api/ref.ts +2 -2
- package/src/types/api/release.ts +1 -1
- package/src/types/api/repository.ts +1 -1
- package/src/types/api/tags.ts +1 -1
- package/src/types/model/boolean.ts +1 -1
- package/src/types/model/color.ts +1 -1
- package/src/types/model/contentRelationship.ts +2 -1
- package/src/types/model/date.ts +1 -1
- package/src/types/model/embed.ts +1 -1
- package/src/types/model/geoPoint.ts +1 -1
- package/src/types/model/group.ts +2 -2
- package/src/types/model/image.ts +3 -3
- package/src/types/model/integrationFields.ts +1 -1
- package/src/types/model/keyText.ts +1 -1
- package/src/types/model/link.ts +3 -3
- package/src/types/model/linkToMedia.ts +2 -1
- package/src/types/model/number.ts +1 -1
- package/src/types/model/richText.ts +3 -3
- package/src/types/model/select.ts +1 -1
- package/src/types/model/sharedSlice.ts +2 -5
- package/src/types/model/sharedSliceVariation.ts +1 -4
- package/src/types/model/slice.ts +5 -4
- package/src/types/model/sliceZone.ts +5 -7
- package/src/types/model/timestamp.ts +1 -1
- package/src/types/model/title.ts +1 -1
- package/src/types/model/types.ts +12 -16
- package/src/types/model/uid.ts +1 -1
- package/src/types/value/boolean.ts +1 -1
- package/src/types/value/color.ts +1 -1
- package/src/types/value/contentRelationship.ts +8 -9
- package/src/types/value/date.ts +1 -1
- package/src/types/value/document.ts +6 -5
- package/src/types/value/embed.ts +2 -2
- package/src/types/value/geoPoint.ts +1 -1
- package/src/types/value/group.ts +2 -2
- package/src/types/value/image.ts +1 -1
- package/src/types/value/integrationFields.ts +1 -1
- package/src/types/value/keyText.ts +1 -1
- package/src/types/value/link.ts +8 -8
- package/src/types/value/linkToMedia.ts +2 -1
- package/src/types/value/number.ts +1 -1
- package/src/types/value/richText.ts +6 -5
- package/src/types/value/select.ts +1 -1
- package/src/types/value/sharedSlice.ts +1 -1
- package/src/types/value/slice.ts +1 -1
- package/src/types/value/sliceZone.ts +2 -1
- package/src/types/value/timestamp.ts +1 -0
- package/src/types/value/title.ts +2 -1
- package/src/types/value/types.ts +9 -11
- package/src/types/webhook/apiUpdate.ts +4 -4
- package/src/types/webhook/testTrigger.ts +1 -1
- package/src/types/webhook/types.ts +2 -2
- 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 -414
- package/dist/client.cjs.map +0 -1
- package/dist/client.js +0 -414
- 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/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/client.d.ts +0 -128
- package/dist/types/helpers.d.ts +0 -63
- package/dist/types/utils.d.ts +0 -28
- package/src/lib/appendPredicates.ts +0 -29
- package/src/predicate.ts +0 -359
- package/src/types/client.ts +0 -157
- package/src/types/helpers.ts +0 -103
- package/src/types/utils.ts +0 -34
- /package/dist/{ForbiddenError.js → errors/ForbiddenError.js} +0 -0
- /package/dist/{NotFoundError.js → errors/NotFoundError.js} +0 -0
- /package/dist/{ParsingError.js → errors/ParsingError.js} +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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnyRegularField } from "./types";
|
|
2
|
+
|
|
2
3
|
import { GroupField } from "./group";
|
|
3
4
|
import { SliceZone } from "./sliceZone";
|
|
4
5
|
|
|
@@ -75,7 +76,7 @@ export interface PrismicDocumentHeader<TypeEnum = string, LangEnum = string> {
|
|
|
75
76
|
/**
|
|
76
77
|
* A Prismic document served through REST API v2.
|
|
77
78
|
*
|
|
78
|
-
* @see More details on Custom Types: {@link https://prismic.io/docs/
|
|
79
|
+
* @see More details on Custom Types: {@link https://prismic.io/docs/custom-types}
|
|
79
80
|
*/
|
|
80
81
|
export interface PrismicDocument<
|
|
81
82
|
DataInterface extends Record<
|
|
@@ -96,8 +97,8 @@ export interface PrismicDocument<
|
|
|
96
97
|
* A Prismic document served through REST API v2. Does not contain a UID (a
|
|
97
98
|
* unique identifier).
|
|
98
99
|
*
|
|
99
|
-
* @see More details on Custom Types: {@link https://prismic.io/docs/
|
|
100
|
-
* @see More details on the UID field: {@link https://prismic.io/docs/
|
|
100
|
+
* @see More details on Custom Types: {@link https://prismic.io/docs/custom-types}
|
|
101
|
+
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
101
102
|
*/
|
|
102
103
|
export interface PrismicDocumentWithoutUID<
|
|
103
104
|
DataInterface extends Record<
|
|
@@ -122,8 +123,8 @@ export interface PrismicDocumentWithoutUID<
|
|
|
122
123
|
* A Prismic document served through REST API v2. Contains a UID (a unique
|
|
123
124
|
* identifier).
|
|
124
125
|
*
|
|
125
|
-
* @see More details on Custom Types: {@link https://prismic.io/docs/
|
|
126
|
-
* @see More details on the UID field: {@link https://prismic.io/docs/
|
|
126
|
+
* @see More details on Custom Types: {@link https://prismic.io/docs/custom-types}
|
|
127
|
+
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
127
128
|
*/
|
|
128
129
|
export interface PrismicDocumentWithUID<
|
|
129
130
|
DataInterface extends Record<
|
package/src/types/value/embed.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const OEmbedType = {
|
|
|
18
18
|
*
|
|
19
19
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
20
20
|
*/
|
|
21
|
-
type OEmbedBase<TType extends typeof OEmbedType[keyof typeof OEmbedType]> = {
|
|
21
|
+
type OEmbedBase<TType extends (typeof OEmbedType)[keyof typeof OEmbedType]> = {
|
|
22
22
|
/**
|
|
23
23
|
* oEmbed resource type.
|
|
24
24
|
*/
|
|
@@ -183,7 +183,7 @@ export type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed;
|
|
|
183
183
|
*
|
|
184
184
|
* @typeParam Data - Data provided by the URL's oEmbed provider.
|
|
185
185
|
* @typeParam State - State of the field which determines its shape.
|
|
186
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
186
|
+
* @see More details: {@link https://prismic.io/docs/embed}
|
|
187
187
|
*/
|
|
188
188
|
export type EmbedField<
|
|
189
189
|
Data extends AnyOEmbed = AnyOEmbed & OEmbedExtra,
|
|
@@ -4,7 +4,7 @@ import type { EmptyObjectField, FieldState } from "./types";
|
|
|
4
4
|
* A Geopoint field.
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
7
|
+
* @see More details: {@link https://prismic.io/docs/geopoint}
|
|
8
8
|
*/
|
|
9
9
|
export type GeoPointField<State extends FieldState = FieldState> =
|
|
10
10
|
State extends "empty"
|
package/src/types/value/group.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnyRegularField, FieldState } from "./types";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A Group field.
|
|
5
5
|
*
|
|
6
|
-
* More details: {@link https://prismic.io/docs/
|
|
6
|
+
* More details: {@link https://prismic.io/docs/group}
|
|
7
7
|
*/
|
|
8
8
|
export type GroupField<
|
|
9
9
|
Fields extends Record<string, AnyRegularField> = Record<
|
package/src/types/value/image.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface EmptyImageFieldImage {
|
|
|
36
36
|
* @typeParam ThumbnailNames - Names of thumbnails. If the field does not
|
|
37
37
|
* contain thumbnails, `never` can be used to "disable" thumbnail fields.
|
|
38
38
|
* @typeParam State - State of the field which determines its shape.
|
|
39
|
-
* @see Image field documentation: {@link https://prismic.io/docs/
|
|
39
|
+
* @see Image field documentation: {@link https://prismic.io/docs/image}
|
|
40
40
|
*/
|
|
41
41
|
export type ImageField<
|
|
42
42
|
// `null` is included for backwards compatibility with older versions of
|
|
@@ -5,7 +5,7 @@ import type { FieldState } from "./types";
|
|
|
5
5
|
*
|
|
6
6
|
* @typeParam Data - Data from the integrated API.
|
|
7
7
|
* @typeParam State - State of the field which determines its shape.
|
|
8
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
8
|
+
* @see More details: {@link https://prismic.io/docs/integration-fields}
|
|
9
9
|
*/
|
|
10
10
|
export type IntegrationFields<
|
|
11
11
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
@@ -4,7 +4,7 @@ import type { FieldState } from "./types";
|
|
|
4
4
|
* A Key text field
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
7
|
+
* @see More details: {@link https://prismic.io/docs/key-text}
|
|
8
8
|
*/
|
|
9
9
|
export type KeyTextField<State extends FieldState = FieldState> =
|
|
10
10
|
State extends "empty" ? null | "" : string;
|
package/src/types/value/link.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
import type { SliceZone } from "./sliceZone";
|
|
1
|
+
import type { AnyRegularField, FieldState } from "./types";
|
|
2
|
+
|
|
4
3
|
import type { ContentRelationshipField } from "./contentRelationship";
|
|
4
|
+
import type { GroupField } from "./group";
|
|
5
5
|
import type { LinkToMediaField } from "./linkToMedia";
|
|
6
|
+
import type { SliceZone } from "./sliceZone";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Link Types
|
|
@@ -20,7 +21,7 @@ export const LinkType = {
|
|
|
20
21
|
* @typeParam Type - The type of link.
|
|
21
22
|
*/
|
|
22
23
|
export type EmptyLinkField<
|
|
23
|
-
Type extends typeof LinkType[keyof typeof LinkType] = typeof LinkType.Any,
|
|
24
|
+
Type extends (typeof LinkType)[keyof typeof LinkType] = typeof LinkType.Any,
|
|
24
25
|
> = {
|
|
25
26
|
link_type: Type | string;
|
|
26
27
|
};
|
|
@@ -46,10 +47,9 @@ export interface FilledLinkToWebField {
|
|
|
46
47
|
export type LinkField<
|
|
47
48
|
TypeEnum = string,
|
|
48
49
|
LangEnum = string,
|
|
49
|
-
DataInterface extends
|
|
50
|
-
string,
|
|
51
|
-
|
|
52
|
-
> = never,
|
|
50
|
+
DataInterface extends
|
|
51
|
+
| Record<string, AnyRegularField | GroupField | SliceZone>
|
|
52
|
+
| unknown = unknown,
|
|
53
53
|
State extends FieldState = FieldState,
|
|
54
54
|
> = State extends "empty"
|
|
55
55
|
? EmptyLinkField<typeof LinkType.Any>
|
|
@@ -4,7 +4,7 @@ import type { FieldState } from "./types";
|
|
|
4
4
|
* A Number field
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
7
|
+
* @see More details: {@link https://prismic.io/docs/number}
|
|
8
8
|
*/
|
|
9
9
|
export type NumberField<State extends FieldState = FieldState> =
|
|
10
10
|
State extends "empty" ? null : number;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { EmbedField } from "./embed";
|
|
2
1
|
import type { FieldState } from "./types";
|
|
2
|
+
|
|
3
3
|
import type { FilledContentRelationshipField } from "./contentRelationship";
|
|
4
|
-
import type {
|
|
4
|
+
import type { EmbedField } from "./embed";
|
|
5
5
|
import type { FilledLinkToWebField } from "./link";
|
|
6
|
+
import type { FilledLinkToMediaField } from "./linkToMedia";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Types for RichTextNodes
|
|
9
10
|
*
|
|
10
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
11
|
+
* @see More details: {@link https://prismic.io/docs/rich-text-title}
|
|
11
12
|
*/
|
|
12
13
|
export const RichTextNodeType = {
|
|
13
14
|
heading1: "heading1",
|
|
@@ -178,7 +179,7 @@ export type RTEmbedNode = {
|
|
|
178
179
|
/**
|
|
179
180
|
* Rich Text `a` node
|
|
180
181
|
*
|
|
181
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
182
|
+
* @see More details: {@link https://prismic.io/docs/rich-text-title#elements-and-styles}
|
|
182
183
|
*/
|
|
183
184
|
export interface RTLinkNode extends RTSpanNodeBase {
|
|
184
185
|
type: typeof RichTextNodeType.hyperlink;
|
|
@@ -280,7 +281,7 @@ export type RTAnyNode = RTBlockNode | RTInlineNode | RTSpanNode;
|
|
|
280
281
|
/**
|
|
281
282
|
* Rich Text Field
|
|
282
283
|
*
|
|
283
|
-
* @see Rich Text field documentation: {@link https://prismic.io/docs/
|
|
284
|
+
* @see Rich Text field documentation: {@link https://prismic.io/docs/rich-text-title}
|
|
284
285
|
*/
|
|
285
286
|
export type RichTextField<State extends FieldState = FieldState> =
|
|
286
287
|
State extends "empty" ? [] : [RTNode, ...RTNode[]];
|
|
@@ -5,7 +5,7 @@ import type { FieldState } from "./types";
|
|
|
5
5
|
*
|
|
6
6
|
* @typeParam Enum - Selectable options for the field.
|
|
7
7
|
* @typeParam State - State of the field which determines its shape.
|
|
8
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
8
|
+
* @see More details: {@link https://prismic.io/docs/select}
|
|
9
9
|
*/
|
|
10
10
|
export type SelectField<
|
|
11
11
|
Enum extends string = string,
|
|
@@ -3,7 +3,7 @@ import type { SharedSliceVariation } from "./sharedSliceVariation";
|
|
|
3
3
|
/**
|
|
4
4
|
* Shared Slice
|
|
5
5
|
*
|
|
6
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
6
|
+
* @see More details: {@link https://prismic.io/docs/slice}
|
|
7
7
|
*/
|
|
8
8
|
export type SharedSlice<
|
|
9
9
|
SliceType = string,
|
package/src/types/value/slice.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { AnyRegularField } from "./types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Slice - Sections of your website
|
|
5
5
|
*
|
|
6
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
6
|
+
* @see More details: {@link https://prismic.io/docs/slice}
|
|
7
7
|
*/
|
|
8
8
|
export interface Slice<
|
|
9
9
|
SliceType = string,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FieldState } from "./types";
|
|
2
|
+
|
|
2
3
|
import type { SharedSlice } from "./sharedSlice";
|
|
3
4
|
import type { Slice } from "./slice";
|
|
4
5
|
|
|
@@ -8,7 +9,7 @@ import type { Slice } from "./slice";
|
|
|
8
9
|
* Slices to compose dynamic layouts for any page design, such as blog posts,
|
|
9
10
|
* landing pages, case studies, and tutorials.
|
|
10
11
|
*
|
|
11
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
12
|
+
* @see More details: {@link https://prismic.io/docs/slice}
|
|
12
13
|
*/
|
|
13
14
|
export type SliceZone<
|
|
14
15
|
Slices extends Slice | SharedSlice = Slice | SharedSlice,
|
package/src/types/value/title.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FieldState } from "./types";
|
|
2
|
+
|
|
2
3
|
import type {
|
|
3
4
|
RTHeading1Node,
|
|
4
5
|
RTHeading2Node,
|
|
@@ -11,7 +12,7 @@ import type {
|
|
|
11
12
|
/**
|
|
12
13
|
* Title Field
|
|
13
14
|
*
|
|
14
|
-
* @see Title field documentation: {@link https://prismic.io/docs/
|
|
15
|
+
* @see Title field documentation: {@link https://prismic.io/docs/rich-text-title}
|
|
15
16
|
*/
|
|
16
17
|
export type TitleField<State extends FieldState = FieldState> =
|
|
17
18
|
State extends "empty"
|
package/src/types/value/types.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import type { RichTextField } from "./richText";
|
|
2
|
-
import type { TitleField } from "./title";
|
|
3
|
-
import type { ImageField } from "./image";
|
|
4
|
-
import type { ContentRelationshipField } from "./contentRelationship";
|
|
5
|
-
import type { LinkField } from "./link";
|
|
6
|
-
import type { LinkToMediaField } from "./linkToMedia";
|
|
7
|
-
import type { EmbedField } from "./embed";
|
|
8
|
-
|
|
9
1
|
import type { BooleanField } from "./boolean";
|
|
10
2
|
import type { ColorField } from "./color";
|
|
3
|
+
import type { ContentRelationshipField } from "./contentRelationship";
|
|
11
4
|
import type { DateField } from "./date";
|
|
5
|
+
import type { EmbedField } from "./embed";
|
|
6
|
+
import type { GeoPointField } from "./geoPoint";
|
|
7
|
+
import type { ImageField } from "./image";
|
|
8
|
+
import type { IntegrationFields } from "./integrationFields";
|
|
12
9
|
import type { KeyTextField } from "./keyText";
|
|
10
|
+
import type { LinkField } from "./link";
|
|
11
|
+
import type { LinkToMediaField } from "./linkToMedia";
|
|
13
12
|
import type { NumberField } from "./number";
|
|
13
|
+
import type { RichTextField } from "./richText";
|
|
14
14
|
import type { SelectField } from "./select";
|
|
15
15
|
import type { TimestampField } from "./timestamp";
|
|
16
|
-
import type {
|
|
17
|
-
|
|
18
|
-
import type { IntegrationFields } from "./integrationFields";
|
|
16
|
+
import type { TitleField } from "./title";
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
19
|
* Empty state for object-shaped fields.
|
|
@@ -3,7 +3,7 @@ import { WebhookBodyBase, WebhookType } from "./types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Webhook payload sent when a Prismic repository content is updated.
|
|
5
5
|
*
|
|
6
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
6
|
+
* @see More details: {@link https://prismic.io/docs/webhooks}
|
|
7
7
|
*/
|
|
8
8
|
export interface WebhookBodyAPIUpdate extends WebhookBodyBase {
|
|
9
9
|
type: typeof WebhookType.APIUpdate;
|
|
@@ -27,7 +27,7 @@ interface WebhookBodyAPIUpdateOperations<T> {
|
|
|
27
27
|
/**
|
|
28
28
|
* Metadata representing a mask (also called a Custom Type).
|
|
29
29
|
*
|
|
30
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
30
|
+
* @see More details: {@link https://prismic.io/docs/custom-types}
|
|
31
31
|
*/
|
|
32
32
|
interface WebhookBodyAPIUpdateMask {
|
|
33
33
|
id: string;
|
|
@@ -37,7 +37,7 @@ interface WebhookBodyAPIUpdateMask {
|
|
|
37
37
|
/**
|
|
38
38
|
* Metadata representing a tag.
|
|
39
39
|
*
|
|
40
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
40
|
+
* @see More details: {@link https://prismic.io/docs/guides/document-tags}
|
|
41
41
|
*/
|
|
42
42
|
interface WebhookBodyAPIUpdateTag {
|
|
43
43
|
id: string;
|
|
@@ -46,7 +46,7 @@ interface WebhookBodyAPIUpdateTag {
|
|
|
46
46
|
/**
|
|
47
47
|
* Metadata representing a Release.
|
|
48
48
|
*
|
|
49
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
49
|
+
* @see More details: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
|
|
50
50
|
*/
|
|
51
51
|
interface WebhookBodyAPIUpdateRelease {
|
|
52
52
|
id: string;
|
|
@@ -3,7 +3,7 @@ import { WebhookBodyBase, WebhookType } from "./types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Webhook payload sent when a test webhook action is triggered.
|
|
5
5
|
*
|
|
6
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
6
|
+
* @see More details: {@link https://prismic.io/docs/webhooks}
|
|
7
7
|
*/
|
|
8
8
|
export interface WebhookBodyTestTrigger extends WebhookBodyBase {
|
|
9
9
|
type: typeof WebhookType.TestTrigger;
|
|
@@ -6,7 +6,7 @@ export type WebhookBody = WebhookBodyAPIUpdate | WebhookBodyTestTrigger;
|
|
|
6
6
|
/**
|
|
7
7
|
* Types of Prismic Webhooks.
|
|
8
8
|
*
|
|
9
|
-
* @see More details: {@link https://prismic.io/docs/
|
|
9
|
+
* @see More details: {@link https://prismic.io/docs/webhooks}
|
|
10
10
|
*/
|
|
11
11
|
export const WebhookType = {
|
|
12
12
|
APIUpdate: "api-update",
|
|
@@ -14,7 +14,7 @@ export const WebhookType = {
|
|
|
14
14
|
} as const;
|
|
15
15
|
|
|
16
16
|
export interface WebhookBodyBase {
|
|
17
|
-
type: typeof WebhookType[keyof typeof WebhookType];
|
|
17
|
+
type: (typeof WebhookType)[keyof typeof WebhookType];
|
|
18
18
|
domain: string;
|
|
19
19
|
apiUrl: string;
|
|
20
20
|
secret: string | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ForbiddenError.cjs","sources":["../src/ForbiddenError.ts"],"sourcesContent":["import { PrismicError } from \"./PrismicError\";\n\ntype ForbiddenErrorRepositoryAPIResponse = {\n\ttype: string;\n\tmessage: string;\n};\n\ntype ForbiddenErrorQueryAPIResponse = {\n\terror: string;\n};\n\nexport class ForbiddenError extends PrismicError<\n\tForbiddenErrorRepositoryAPIResponse | ForbiddenErrorQueryAPIResponse\n> {}\n"],"names":["PrismicError"],"mappings":";;;AAWM,MAAO,uBAAuBA,aAAAA,aAEnC;AAAG;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ForbiddenError.js","sources":["../src/ForbiddenError.ts"],"sourcesContent":["import { PrismicError } from \"./PrismicError\";\n\ntype ForbiddenErrorRepositoryAPIResponse = {\n\ttype: string;\n\tmessage: string;\n};\n\ntype ForbiddenErrorQueryAPIResponse = {\n\terror: string;\n};\n\nexport class ForbiddenError extends PrismicError<\n\tForbiddenErrorRepositoryAPIResponse | ForbiddenErrorQueryAPIResponse\n> {}\n"],"names":[],"mappings":";AAWM,MAAO,uBAAuB,aAEnC;AAAG;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotFoundError.cjs","sources":["../src/NotFoundError.ts"],"sourcesContent":["import { PrismicError } from \"./PrismicError\";\n\nexport class NotFoundError extends PrismicError<undefined> {}\n"],"names":["PrismicError"],"mappings":";;;AAEM,MAAO,sBAAsBA,aAAAA,aAAuB;AAAG;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotFoundError.js","sources":["../src/NotFoundError.ts"],"sourcesContent":["import { PrismicError } from \"./PrismicError\";\n\nexport class NotFoundError extends PrismicError<undefined> {}\n"],"names":[],"mappings":";AAEM,MAAO,sBAAsB,aAAuB;AAAG;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ParsingError.cjs","sources":["../src/ParsingError.ts"],"sourcesContent":["import { PrismicError } from \"./PrismicError\";\n\ntype ParsingErrorAPIResponse = {\n\ttype: \"parsing-error\";\n\tmessage: string;\n\tline: number;\n\tcolumn: number;\n\tid: number;\n\tlocation: string;\n};\n\nexport class ParsingError extends PrismicError<ParsingErrorAPIResponse> {}\n"],"names":["PrismicError"],"mappings":";;;AAWM,MAAO,qBAAqBA,aAAAA,aAAqC;AAAG;;"}
|
package/dist/ParsingError.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ParsingError.js","sources":["../src/ParsingError.ts"],"sourcesContent":["import { PrismicError } from \"./PrismicError\";\n\ntype ParsingErrorAPIResponse = {\n\ttype: \"parsing-error\";\n\tmessage: string;\n\tline: number;\n\tcolumn: number;\n\tid: number;\n\tlocation: string;\n};\n\nexport class ParsingError extends PrismicError<ParsingErrorAPIResponse> {}\n"],"names":[],"mappings":";AAWM,MAAO,qBAAqB,aAAqC;AAAG;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicError.cjs","sources":["../src/PrismicError.ts"],"sourcesContent":["export class PrismicError<Response> extends Error {\n\turl?: string;\n\tresponse: Response;\n\n\tconstructor(\n\t\tmessage = \"An invalid API response was returned\",\n\t\turl: string | undefined,\n\t\tresponse: Response,\n\t) {\n\t\tsuper(message);\n\n\t\tthis.url = url;\n\t\tthis.response = response;\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAAM,MAAO,qBAA+B,MAAK;AAAA,EAIhD,YACC,UAAU,wCACV,KACA,UAAkB;AAElB,UAAM,OAAO;AARd;AACA;AASC,SAAK,MAAM;AACX,SAAK,WAAW;AAAA,EACjB;AACA;;"}
|
package/dist/PrismicError.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicError.js","sources":["../src/PrismicError.ts"],"sourcesContent":["export class PrismicError<Response> extends Error {\n\turl?: string;\n\tresponse: Response;\n\n\tconstructor(\n\t\tmessage = \"An invalid API response was returned\",\n\t\turl: string | undefined,\n\t\tresponse: Response,\n\t) {\n\t\tsuper(message);\n\n\t\tthis.url = url;\n\t\tthis.response = response;\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAAM,MAAO,qBAA+B,MAAK;AAAA,EAIhD,YACC,UAAU,wCACV,KACA,UAAkB;AAElB,UAAM,OAAO;AARd;AACA;AASC,SAAK,MAAM;AACX,SAAK,WAAW;AAAA,EACjB;AACA;"}
|