@prismicio/client 7.21.0-alpha.2 → 7.21.0-pr.414.3336f00
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Client.cjs +1271 -0
- package/dist/Client.cjs.map +1 -0
- package/dist/Client.d.ts +981 -0
- package/dist/Client.js +1271 -0
- package/dist/Client.js.map +1 -0
- package/dist/Migration.cjs +297 -0
- package/dist/Migration.cjs.map +1 -0
- package/dist/Migration.d.ts +213 -0
- package/dist/Migration.js +297 -0
- package/dist/Migration.js.map +1 -0
- package/dist/WriteClient.cjs +575 -0
- package/dist/WriteClient.cjs.map +1 -0
- package/dist/WriteClient.d.ts +281 -0
- package/dist/WriteClient.js +575 -0
- package/dist/WriteClient.js.map +1 -0
- package/dist/buildQueryURL.cjs +69 -0
- package/dist/buildQueryURL.cjs.map +1 -0
- package/dist/buildQueryURL.d.ts +217 -0
- package/dist/buildQueryURL.js +69 -0
- package/dist/buildQueryURL.js.map +1 -0
- package/dist/cookie.cjs +5 -0
- package/dist/cookie.cjs.map +1 -0
- package/dist/cookie.d.ts +5 -0
- package/dist/cookie.js +5 -0
- package/dist/cookie.js.map +1 -0
- package/dist/createClient.cjs +6 -0
- package/dist/createClient.cjs.map +1 -0
- package/dist/createClient.d.ts +35 -0
- package/dist/createClient.js +6 -0
- package/dist/createClient.js.map +1 -0
- package/dist/createMigration.cjs +6 -0
- package/dist/createMigration.cjs.map +1 -0
- package/dist/createMigration.d.ts +24 -0
- package/dist/createMigration.js +6 -0
- package/dist/createMigration.js.map +1 -0
- package/dist/createWriteClient.cjs +6 -0
- package/dist/createWriteClient.cjs.map +1 -0
- package/dist/createWriteClient.d.ts +32 -0
- package/dist/createWriteClient.js +6 -0
- package/dist/createWriteClient.js.map +1 -0
- package/dist/errors/ForbiddenError.cjs +7 -0
- package/dist/errors/ForbiddenError.cjs.map +1 -0
- package/dist/errors/ForbiddenError.d.ts +11 -0
- package/dist/errors/ForbiddenError.js +7 -0
- package/dist/errors/ForbiddenError.js.map +1 -0
- package/dist/errors/InvalidDataError.cjs +7 -0
- package/dist/errors/InvalidDataError.cjs.map +1 -0
- package/dist/errors/InvalidDataError.d.ts +3 -0
- package/dist/errors/InvalidDataError.js +7 -0
- package/dist/errors/InvalidDataError.js.map +1 -0
- package/dist/errors/NotFoundError.cjs +7 -0
- package/dist/errors/NotFoundError.cjs.map +1 -0
- package/dist/errors/NotFoundError.d.ts +3 -0
- package/dist/errors/NotFoundError.js +7 -0
- package/dist/errors/NotFoundError.js.map +1 -0
- package/dist/errors/ParsingError.cjs +7 -0
- package/dist/errors/ParsingError.cjs.map +1 -0
- package/dist/errors/ParsingError.d.ts +14 -0
- package/dist/errors/ParsingError.js +7 -0
- package/dist/errors/ParsingError.js.map +1 -0
- package/dist/errors/PreviewTokenExpired.cjs +7 -0
- package/dist/errors/PreviewTokenExpired.cjs.map +1 -0
- package/dist/errors/PreviewTokenExpired.d.ts +8 -0
- package/dist/errors/PreviewTokenExpired.js +7 -0
- package/dist/errors/PreviewTokenExpired.js.map +1 -0
- package/dist/errors/PrismicError.cjs +13 -0
- package/dist/errors/PrismicError.cjs.map +1 -0
- package/dist/errors/PrismicError.d.ts +5 -0
- package/dist/errors/PrismicError.js +13 -0
- package/dist/errors/PrismicError.js.map +1 -0
- package/dist/errors/RefExpiredError.cjs +7 -0
- package/dist/errors/RefExpiredError.cjs.map +1 -0
- package/dist/errors/RefExpiredError.d.ts +8 -0
- package/dist/errors/RefExpiredError.js +7 -0
- package/dist/errors/RefExpiredError.js.map +1 -0
- package/dist/errors/RefNotFoundError.cjs +7 -0
- package/dist/errors/RefNotFoundError.cjs.map +1 -0
- package/dist/errors/RefNotFoundError.d.ts +8 -0
- package/dist/errors/RefNotFoundError.js +7 -0
- package/dist/errors/RefNotFoundError.js.map +1 -0
- package/dist/errors/RepositoryNotFoundError.cjs +7 -0
- package/dist/errors/RepositoryNotFoundError.cjs.map +1 -0
- package/dist/errors/RepositoryNotFoundError.d.ts +3 -0
- package/dist/errors/RepositoryNotFoundError.js +7 -0
- package/dist/errors/RepositoryNotFoundError.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 +13 -0
- package/dist/getGraphQLEndpoint.cjs.map +1 -0
- package/dist/getGraphQLEndpoint.d.ts +10 -0
- package/dist/getGraphQLEndpoint.js +13 -0
- package/dist/getGraphQLEndpoint.js.map +1 -0
- package/dist/getRepositoryEndpoint.cjs +13 -0
- package/dist/getRepositoryEndpoint.cjs.map +1 -0
- package/dist/getRepositoryEndpoint.d.ts +19 -0
- package/dist/getRepositoryEndpoint.js +13 -0
- package/dist/getRepositoryEndpoint.js.map +1 -0
- package/dist/getRepositoryName.cjs +17 -0
- package/dist/getRepositoryName.cjs.map +1 -0
- package/dist/getRepositoryName.d.ts +12 -0
- package/dist/getRepositoryName.js +17 -0
- package/dist/getRepositoryName.js.map +1 -0
- 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 +24 -0
- package/dist/helpers/asDate.js +14 -0
- package/dist/helpers/asDate.js.map +1 -0
- package/dist/helpers/asHTML.cjs +86 -0
- package/dist/helpers/asHTML.cjs.map +1 -0
- package/dist/helpers/asHTML.d.ts +149 -0
- package/dist/helpers/asHTML.js +86 -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 +54 -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 +29 -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 +62 -0
- package/dist/helpers/asImageWidthSrcSet.js +45 -0
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -0
- package/dist/helpers/asLink.cjs +47 -0
- package/dist/helpers/asLink.cjs.map +1 -0
- package/dist/helpers/asLink.d.ts +78 -0
- package/dist/helpers/asLink.js +47 -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 +47 -0
- package/dist/helpers/asLinkAttrs.js +28 -0
- package/dist/helpers/asLinkAttrs.js.map +1 -0
- package/dist/helpers/asText.cjs +21 -0
- package/dist/helpers/asText.cjs.map +1 -0
- package/dist/helpers/asText.d.ts +57 -0
- package/dist/helpers/asText.js +21 -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 +17 -0
- package/dist/helpers/documentToLinkField.js +26 -0
- package/dist/helpers/documentToLinkField.js.map +1 -0
- package/dist/helpers/isFilled.cjs +77 -0
- package/dist/helpers/isFilled.cjs.map +1 -0
- package/dist/helpers/isFilled.d.ts +191 -0
- package/dist/helpers/isFilled.js +77 -0
- package/dist/helpers/isFilled.js.map +1 -0
- package/dist/helpers/mapSliceZone.cjs +42 -0
- package/dist/helpers/mapSliceZone.cjs.map +1 -0
- package/dist/helpers/mapSliceZone.d.ts +136 -0
- package/dist/helpers/mapSliceZone.js +42 -0
- package/dist/helpers/mapSliceZone.js.map +1 -0
- package/dist/index.cjs +94 -3880
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +129 -4349
- package/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/dist/isRepositoryEndpoint.cjs +12 -0
- package/dist/isRepositoryEndpoint.cjs.map +1 -0
- package/dist/isRepositoryEndpoint.d.ts +10 -0
- package/dist/isRepositoryEndpoint.js +12 -0
- package/dist/isRepositoryEndpoint.js.map +1 -0
- package/dist/isRepositoryName.cjs +7 -0
- package/dist/isRepositoryName.cjs.map +1 -0
- package/dist/isRepositoryName.d.ts +9 -0
- package/dist/isRepositoryName.js +7 -0
- package/dist/isRepositoryName.js.map +1 -0
- 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 +7 -0
- package/dist/lib/castArray.cjs.map +1 -0
- package/dist/lib/castArray.d.ts +12 -0
- package/dist/lib/castArray.js +7 -0
- package/dist/lib/castArray.js.map +1 -0
- package/dist/lib/castThunk.cjs +7 -0
- package/dist/lib/castThunk.cjs.map +1 -0
- package/dist/lib/castThunk.d.ts +11 -0
- package/dist/lib/castThunk.js +7 -0
- package/dist/lib/castThunk.js.map +1 -0
- 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 +8 -0
- package/dist/lib/findMasterRef.cjs.map +1 -0
- package/dist/lib/findMasterRef.d.ts +11 -0
- package/dist/lib/findMasterRef.js +8 -0
- package/dist/lib/findMasterRef.js.map +1 -0
- package/dist/lib/findRef.cjs +12 -0
- package/dist/lib/findRef.cjs.map +1 -0
- package/dist/lib/findRef.d.ts +14 -0
- package/dist/lib/findRef.js +12 -0
- package/dist/lib/findRef.js.map +1 -0
- package/dist/lib/findRefByID.cjs +8 -0
- package/dist/lib/findRefByID.cjs.map +1 -0
- package/dist/lib/findRefByID.d.ts +12 -0
- package/dist/lib/findRefByID.js +8 -0
- package/dist/lib/findRefByID.js.map +1 -0
- package/dist/lib/findRefByLabel.cjs +8 -0
- package/dist/lib/findRefByLabel.cjs.map +1 -0
- package/dist/lib/findRefByLabel.d.ts +12 -0
- package/dist/lib/findRefByLabel.js +8 -0
- package/dist/lib/findRefByLabel.js.map +1 -0
- package/dist/lib/getOptionalLinkProperties.cjs +14 -0
- package/dist/lib/getOptionalLinkProperties.cjs.map +1 -0
- package/dist/lib/getOptionalLinkProperties.d.ts +12 -0
- package/dist/lib/getOptionalLinkProperties.js +14 -0
- package/dist/lib/getOptionalLinkProperties.js.map +1 -0
- package/dist/lib/getPreviewCookie.cjs +21 -0
- package/dist/lib/getPreviewCookie.cjs.map +1 -0
- package/dist/lib/getPreviewCookie.d.ts +9 -0
- package/dist/lib/getPreviewCookie.js +21 -0
- package/dist/lib/getPreviewCookie.js.map +1 -0
- 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/isMigrationValue.cjs +24 -0
- package/dist/lib/isMigrationValue.cjs.map +1 -0
- package/dist/lib/isMigrationValue.d.ts +71 -0
- package/dist/lib/isMigrationValue.js +24 -0
- package/dist/lib/isMigrationValue.js.map +1 -0
- package/dist/lib/isValue.cjs +53 -0
- package/dist/lib/isValue.cjs.map +1 -0
- package/dist/lib/isValue.d.ts +78 -0
- package/dist/lib/isValue.js +53 -0
- package/dist/lib/isValue.js.map +1 -0
- package/dist/lib/minifyGraphQLQuery.cjs +7 -0
- package/dist/lib/minifyGraphQLQuery.cjs.map +1 -0
- package/dist/lib/minifyGraphQLQuery.d.ts +8 -0
- package/dist/lib/minifyGraphQLQuery.js +7 -0
- package/dist/lib/minifyGraphQLQuery.js.map +1 -0
- package/dist/lib/pLimit.cjs +48 -0
- package/dist/lib/pLimit.cjs.map +1 -0
- package/dist/lib/pLimit.d.ts +22 -0
- package/dist/lib/pLimit.js +48 -0
- package/dist/lib/pLimit.js.map +1 -0
- package/dist/lib/request.cjs +41 -0
- package/dist/lib/request.cjs.map +1 -0
- package/dist/lib/request.d.ts +73 -0
- package/dist/lib/request.js +41 -0
- package/dist/lib/request.js.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.cjs +132 -0
- package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.d.ts +54 -0
- package/dist/lib/resolveMigrationDocumentData.js +132 -0
- package/dist/lib/resolveMigrationDocumentData.js.map +1 -0
- package/dist/lib/serializerHelpers.cjs +113 -0
- package/dist/lib/serializerHelpers.cjs.map +1 -0
- package/dist/lib/serializerHelpers.d.ts +9 -0
- package/dist/lib/serializerHelpers.js +113 -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/throttledLog.cjs +17 -0
- package/dist/lib/throttledLog.cjs.map +1 -0
- package/dist/lib/throttledLog.d.ts +15 -0
- package/dist/lib/throttledLog.js +17 -0
- package/dist/lib/throttledLog.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/lib/validateAssetMetadata.cjs +28 -0
- package/dist/lib/validateAssetMetadata.cjs.map +1 -0
- package/dist/lib/validateAssetMetadata.d.ts +10 -0
- package/dist/lib/validateAssetMetadata.js +28 -0
- package/dist/lib/validateAssetMetadata.js.map +1 -0
- package/dist/package.json.cjs +7 -0
- package/dist/package.json.cjs.map +1 -0
- package/dist/package.json.js +7 -0
- package/dist/package.json.js.map +1 -0
- package/dist/richtext/asText.cjs +13 -0
- package/dist/richtext/asText.cjs.map +1 -0
- package/dist/richtext/asText.d.ts +12 -0
- package/dist/richtext/asText.js +13 -0
- package/dist/richtext/asText.js.map +1 -0
- package/dist/richtext/asTree.cjs +123 -0
- package/dist/richtext/asTree.cjs.map +1 -0
- package/dist/richtext/asTree.d.ts +14 -0
- package/dist/richtext/asTree.js +123 -0
- package/dist/richtext/asTree.js.map +1 -0
- package/dist/richtext/composeSerializers.cjs +17 -0
- package/dist/richtext/composeSerializers.cjs.map +1 -0
- package/dist/richtext/composeSerializers.d.ts +16 -0
- package/dist/richtext/composeSerializers.js +17 -0
- package/dist/richtext/composeSerializers.js.map +1 -0
- package/dist/richtext/index.d.ts +7 -78
- package/dist/richtext/serialize.cjs +19 -0
- package/dist/richtext/serialize.cjs.map +1 -0
- package/dist/richtext/serialize.d.ts +19 -0
- package/dist/richtext/serialize.js +19 -0
- package/dist/richtext/serialize.js.map +1 -0
- package/dist/richtext/types.cjs +11 -0
- package/dist/richtext/types.cjs.map +1 -0
- package/dist/richtext/types.d.ts +71 -0
- package/dist/richtext/types.js +11 -0
- package/dist/richtext/types.js.map +1 -0
- package/dist/richtext/wrapMapSerializer.cjs +24 -0
- package/dist/richtext/wrapMapSerializer.cjs.map +1 -0
- package/dist/richtext/wrapMapSerializer.d.ts +15 -0
- package/dist/richtext/wrapMapSerializer.js +24 -0
- package/dist/richtext/wrapMapSerializer.js.map +1 -0
- package/dist/richtext.cjs +15 -0
- package/dist/richtext.cjs.map +1 -0
- package/dist/richtext.js +15 -0
- package/dist/richtext.js.map +1 -0
- package/dist/types/api/asset/asset.d.ts +177 -0
- package/dist/types/api/asset/tag.d.ts +53 -0
- package/dist/types/api/integration.d.ts +28 -0
- package/dist/types/api/migration/document.d.ts +60 -0
- package/dist/types/api/query.d.ts +43 -0
- package/dist/types/api/ref.d.ts +32 -0
- package/dist/types/api/release.d.ts +11 -0
- package/dist/types/api/repository.d.ts +109 -0
- package/dist/types/api/tags.d.ts +9 -0
- package/dist/types/migration/Asset.cjs +30 -0
- package/dist/types/migration/Asset.cjs.map +1 -0
- package/dist/types/migration/Asset.d.ts +108 -0
- package/dist/types/migration/Asset.js +30 -0
- package/dist/types/migration/Asset.js.map +1 -0
- package/dist/types/migration/ContentRelationship.d.ts +16 -0
- package/dist/types/migration/Document.cjs +44 -0
- package/dist/types/migration/Document.cjs.map +1 -0
- package/dist/types/migration/Document.d.ts +94 -0
- package/dist/types/migration/Document.js +44 -0
- package/dist/types/migration/Document.js.map +1 -0
- package/dist/types/migration/Link.d.ts +19 -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 +53 -0
- package/dist/types/model/customType.d.ts +48 -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 +23 -0
- package/dist/types/model/image.d.ts +31 -0
- package/dist/types/model/integration.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 +28 -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 +17 -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 +37 -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/table.d.ts +12 -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 +39 -0
- package/dist/types/model/types.cjs.map +1 -0
- package/dist/types/model/types.d.ts +76 -0
- package/dist/types/model/types.js +39 -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 +9 -0
- package/dist/types/value/contentRelationship.d.ts +31 -0
- package/dist/types/value/date.d.ts +9 -0
- package/dist/types/value/document.d.ts +114 -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 +168 -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 +12 -0
- package/dist/types/value/group.d.ts +13 -0
- package/dist/types/value/image.d.ts +47 -0
- package/dist/types/value/integration.d.ts +16 -0
- package/dist/types/value/keyText.d.ts +9 -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 +68 -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 +28 -0
- package/dist/types/value/number.d.ts +9 -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 +215 -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 +10 -0
- package/dist/types/value/sharedSlice.d.ts +11 -0
- package/dist/types/value/sharedSliceVariation.d.ts +10 -0
- package/dist/types/value/slice.d.ts +13 -0
- package/dist/types/value/sliceZone.d.ts +12 -0
- package/dist/types/value/table.d.ts +91 -0
- package/dist/types/value/timestamp.d.ts +7 -0
- package/dist/types/value/title.d.ts +12 -0
- package/dist/types/value/types.d.ts +58 -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 +40 -27
- package/src/Client.ts +25 -8
- package/src/WriteClient.ts +22 -33
- package/src/buildQueryURL.ts +4 -1
- package/src/createClient.ts +1 -1
- package/src/index.ts +1 -0
- package/src/types/model/contentRelationship.ts +1 -0
- package/src/types/value/date.ts +1 -1
- package/src/types/value/timestamp.ts +1 -5
- package/dist/index.d.cts +0 -4424
- package/dist/index.d.mts +0 -4424
- package/dist/index.mjs +0 -3837
- package/dist/index.mjs.map +0 -1
- package/dist/richtext/index.cjs +0 -244
- package/dist/richtext/index.cjs.map +0 -1
- package/dist/richtext/index.d.cts +0 -78
- package/dist/richtext/index.d.mts +0 -78
- package/dist/richtext/index.mjs +0 -237
- package/dist/richtext/index.mjs.map +0 -1
- package/dist/shared/client.TSGr56lO.d.cts +0 -899
- package/dist/shared/client.TSGr56lO.d.mts +0 -899
- package/dist/shared/client.TSGr56lO.d.ts +0 -899
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { CustomTypeModelBooleanField } from "./boolean.js";
|
|
2
|
+
import type { CustomTypeModelColorField } from "./color.js";
|
|
3
|
+
import type { CustomTypeModelContentRelationshipField } from "./contentRelationship.js";
|
|
4
|
+
import type { CustomTypeModelDateField } from "./date.js";
|
|
5
|
+
import type { CustomTypeModelEmbedField } from "./embed.js";
|
|
6
|
+
import type { CustomTypeModelGeoPointField } from "./geoPoint.js";
|
|
7
|
+
import type { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./group.js";
|
|
8
|
+
import type { CustomTypeModelImageField } from "./image.js";
|
|
9
|
+
import type { CustomTypeModelIntegrationField } from "./integration.js";
|
|
10
|
+
import type { CustomTypeModelKeyTextField } from "./keyText.js";
|
|
11
|
+
import type { CustomTypeModelLinkField } from "./link.js";
|
|
12
|
+
import type { CustomTypeModelLinkToMediaField } from "./linkToMedia.js";
|
|
13
|
+
import type { CustomTypeModelNumberField } from "./number.js";
|
|
14
|
+
import type { CustomTypeModelRangeField } from "./range.js";
|
|
15
|
+
import type { CustomTypeModelRichTextField } from "./richText.js";
|
|
16
|
+
import type { CustomTypeModelSelectField } from "./select.js";
|
|
17
|
+
import type { CustomTypeModelSeparatorField } from "./separator.js";
|
|
18
|
+
import type { CustomTypeModelSliceZoneField } from "./sliceZone.js";
|
|
19
|
+
import type { CustomTypeModelTableField } from "./table.js";
|
|
20
|
+
import type { CustomTypeModelTimestampField } from "./timestamp.js";
|
|
21
|
+
import type { CustomTypeModelTitleField } from "./title.js";
|
|
22
|
+
import type { CustomTypeModelUIDField } from "./uid.js";
|
|
23
|
+
/**
|
|
24
|
+
* Type identifier for a custom type field.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CustomTypeModelFieldType: {
|
|
27
|
+
readonly Boolean: "Boolean";
|
|
28
|
+
readonly Color: "Color";
|
|
29
|
+
readonly Date: "Date";
|
|
30
|
+
readonly Embed: "Embed";
|
|
31
|
+
readonly GeoPoint: "GeoPoint";
|
|
32
|
+
readonly Group: "Group";
|
|
33
|
+
readonly Image: "Image";
|
|
34
|
+
readonly Integration: "IntegrationFields";
|
|
35
|
+
readonly Link: "Link";
|
|
36
|
+
readonly Number: "Number";
|
|
37
|
+
readonly Select: "Select";
|
|
38
|
+
readonly Slices: "Slices";
|
|
39
|
+
readonly StructuredText: "StructuredText";
|
|
40
|
+
readonly Table: "Table";
|
|
41
|
+
readonly Text: "Text";
|
|
42
|
+
readonly Timestamp: "Timestamp";
|
|
43
|
+
readonly UID: "UID";
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated - Renamed to `Integration`.
|
|
46
|
+
*/
|
|
47
|
+
readonly IntegrationFields: "IntegrationFields";
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated - Legacy field type. Use `Number` instead.
|
|
50
|
+
*/
|
|
51
|
+
readonly Range: "Range";
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated - Legacy field type. Do not use.
|
|
54
|
+
*/
|
|
55
|
+
readonly Separator: "Separator";
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated - Legacy field type. Use `Slices` instead.
|
|
58
|
+
*/
|
|
59
|
+
readonly LegacySlices: "Choice";
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* A custom type field.
|
|
63
|
+
*/
|
|
64
|
+
export type CustomTypeModelField = CustomTypeModelUIDField | CustomTypeModelGroupField | CustomTypeModelSliceZoneField | CustomTypeModelFieldForNestedGroup;
|
|
65
|
+
/**
|
|
66
|
+
* Any custom type field that is valid for a slice's primary section.
|
|
67
|
+
*/
|
|
68
|
+
export type CustomTypeModelFieldForSlicePrimary = CustomTypeModelGroupField | CustomTypeModelFieldForNestedGroup;
|
|
69
|
+
/**
|
|
70
|
+
* Any custom type field that is valid for a group field.
|
|
71
|
+
*/
|
|
72
|
+
export type CustomTypeModelFieldForGroup = CustomTypeModelNestedGroupField | CustomTypeModelFieldForNestedGroup;
|
|
73
|
+
/**
|
|
74
|
+
* Any custom type field that is valid for a nested group field.
|
|
75
|
+
*/
|
|
76
|
+
export type CustomTypeModelFieldForNestedGroup = CustomTypeModelBooleanField | CustomTypeModelColorField | CustomTypeModelDateField | CustomTypeModelEmbedField | CustomTypeModelGeoPointField | CustomTypeModelImageField | CustomTypeModelIntegrationField | CustomTypeModelContentRelationshipField | CustomTypeModelLinkField | CustomTypeModelLinkToMediaField | CustomTypeModelNumberField | CustomTypeModelRangeField | CustomTypeModelSelectField | CustomTypeModelRichTextField | CustomTypeModelTableField | CustomTypeModelTitleField | CustomTypeModelKeyTextField | CustomTypeModelTimestampField | CustomTypeModelSeparatorField;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const CustomTypeModelFieldType = {
|
|
2
|
+
Boolean: "Boolean",
|
|
3
|
+
Color: "Color",
|
|
4
|
+
Date: "Date",
|
|
5
|
+
Embed: "Embed",
|
|
6
|
+
GeoPoint: "GeoPoint",
|
|
7
|
+
Group: "Group",
|
|
8
|
+
Image: "Image",
|
|
9
|
+
Integration: "IntegrationFields",
|
|
10
|
+
Link: "Link",
|
|
11
|
+
Number: "Number",
|
|
12
|
+
Select: "Select",
|
|
13
|
+
Slices: "Slices",
|
|
14
|
+
StructuredText: "StructuredText",
|
|
15
|
+
Table: "Table",
|
|
16
|
+
Text: "Text",
|
|
17
|
+
Timestamp: "Timestamp",
|
|
18
|
+
UID: "UID",
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated - Renamed to `Integration`.
|
|
21
|
+
*/
|
|
22
|
+
IntegrationFields: "IntegrationFields",
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated - Legacy field type. Use `Number` instead.
|
|
25
|
+
*/
|
|
26
|
+
Range: "Range",
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated - Legacy field type. Do not use.
|
|
29
|
+
*/
|
|
30
|
+
Separator: "Separator",
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated - Legacy field type. Use `Slices` instead.
|
|
33
|
+
*/
|
|
34
|
+
LegacySlices: "Choice"
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
CustomTypeModelFieldType
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/types/model/types.ts"],"sourcesContent":["import type { CustomTypeModelBooleanField } from \"./boolean\"\nimport type { CustomTypeModelColorField } from \"./color\"\nimport type { CustomTypeModelContentRelationshipField } from \"./contentRelationship\"\nimport type { CustomTypeModelDateField } from \"./date\"\nimport type { CustomTypeModelEmbedField } from \"./embed\"\nimport type { CustomTypeModelGeoPointField } from \"./geoPoint\"\nimport type {\n\tCustomTypeModelGroupField,\n\tCustomTypeModelNestedGroupField,\n} from \"./group\"\nimport type { CustomTypeModelImageField } from \"./image\"\nimport type { CustomTypeModelIntegrationField } from \"./integration\"\nimport type { CustomTypeModelKeyTextField } from \"./keyText\"\nimport type { CustomTypeModelLinkField } from \"./link\"\nimport type { CustomTypeModelLinkToMediaField } from \"./linkToMedia\"\nimport type { CustomTypeModelNumberField } from \"./number\"\nimport type { CustomTypeModelRangeField } from \"./range\"\nimport type { CustomTypeModelRichTextField } from \"./richText\"\nimport type { CustomTypeModelSelectField } from \"./select\"\nimport type { CustomTypeModelSeparatorField } from \"./separator\"\nimport type { CustomTypeModelSliceZoneField } from \"./sliceZone\"\nimport type { CustomTypeModelTableField } from \"./table\"\nimport type { CustomTypeModelTimestampField } from \"./timestamp\"\nimport type { CustomTypeModelTitleField } from \"./title\"\nimport type { CustomTypeModelUIDField } from \"./uid\"\n\n/**\n * Type identifier for a custom type field.\n */\nexport const CustomTypeModelFieldType = {\n\tBoolean: \"Boolean\",\n\tColor: \"Color\",\n\tDate: \"Date\",\n\tEmbed: \"Embed\",\n\tGeoPoint: \"GeoPoint\",\n\tGroup: \"Group\",\n\tImage: \"Image\",\n\tIntegration: \"IntegrationFields\",\n\tLink: \"Link\",\n\tNumber: \"Number\",\n\tSelect: \"Select\",\n\tSlices: \"Slices\",\n\tStructuredText: \"StructuredText\",\n\tTable: \"Table\",\n\tText: \"Text\",\n\tTimestamp: \"Timestamp\",\n\tUID: \"UID\",\n\t/**\n\t * @deprecated - Renamed to `Integration`.\n\t */\n\tIntegrationFields: \"IntegrationFields\",\n\t/**\n\t * @deprecated - Legacy field type. Use `Number` instead.\n\t */\n\tRange: \"Range\",\n\t/**\n\t * @deprecated - Legacy field type. Do not use.\n\t */\n\tSeparator: \"Separator\",\n\t/**\n\t * @deprecated - Legacy field type. Use `Slices` instead.\n\t */\n\tLegacySlices: \"Choice\",\n} as const\n\n/**\n * A custom type field.\n */\nexport type CustomTypeModelField =\n\t| CustomTypeModelUIDField\n\t| CustomTypeModelGroupField\n\t| CustomTypeModelSliceZoneField\n\t| CustomTypeModelFieldForNestedGroup\n\n/**\n * Any custom type field that is valid for a slice's primary section.\n */\nexport type CustomTypeModelFieldForSlicePrimary =\n\t| CustomTypeModelGroupField\n\t| CustomTypeModelFieldForNestedGroup\n\n/**\n * Any custom type field that is valid for a group field.\n */\nexport type CustomTypeModelFieldForGroup =\n\t| CustomTypeModelNestedGroupField\n\t| CustomTypeModelFieldForNestedGroup\n\n/**\n * Any custom type field that is valid for a nested group field.\n */\nexport type CustomTypeModelFieldForNestedGroup =\n\t| CustomTypeModelBooleanField\n\t| CustomTypeModelColorField\n\t| CustomTypeModelDateField\n\t| CustomTypeModelEmbedField\n\t| CustomTypeModelGeoPointField\n\t| CustomTypeModelImageField\n\t| CustomTypeModelIntegrationField\n\t| CustomTypeModelContentRelationshipField\n\t| CustomTypeModelLinkField\n\t| CustomTypeModelLinkToMediaField\n\t| CustomTypeModelNumberField\n\t| CustomTypeModelRangeField\n\t| CustomTypeModelSelectField\n\t| CustomTypeModelRichTextField\n\t| CustomTypeModelTableField\n\t| CustomTypeModelTitleField\n\t| CustomTypeModelKeyTextField\n\t| CustomTypeModelTimestampField\n\t| CustomTypeModelSeparatorField\n"],"names":[],"mappings":"AA6BO,MAAM,2BAA2B;AAAA,EACvC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,KAAK;AAAA;AAAA;AAAA;AAAA,EAIL,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAInB,OAAO;AAAA;AAAA;AAAA;AAAA,EAIP,WAAW;AAAA;AAAA;AAAA;AAAA,EAIX,cAAc;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldType } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A UID custom type field.
|
|
4
|
+
*
|
|
5
|
+
* More details: {@link https://prismic.io/docs/uid}
|
|
6
|
+
*/
|
|
7
|
+
export interface CustomTypeModelUIDField {
|
|
8
|
+
type: typeof CustomTypeModelFieldType.UID;
|
|
9
|
+
config?: {
|
|
10
|
+
label?: string | null;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FieldState } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A color field.
|
|
4
|
+
*
|
|
5
|
+
* @typeParam State - State of the field which determines its shape.
|
|
6
|
+
*
|
|
7
|
+
* @see More details: {@link https://prismic.io/docs/color}
|
|
8
|
+
*/
|
|
9
|
+
export type ColorField<State extends FieldState = FieldState> = State extends "empty" ? null : `#${string}`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AnyRegularField, FieldState } from "./types.js";
|
|
2
|
+
import type { GroupField } from "./group.js";
|
|
3
|
+
import type { SliceZone } from "./sliceZone.js";
|
|
4
|
+
/**
|
|
5
|
+
* Field for related documents
|
|
6
|
+
*
|
|
7
|
+
* @typeParam TypeEnum - Type API ID of the document.
|
|
8
|
+
* @typeParam LangEnum - Language API ID of the document.
|
|
9
|
+
* @typeParam DataInterface - Data fields for the document (filled in via
|
|
10
|
+
* GraphQuery of `fetchLinks`).
|
|
11
|
+
* @typeParam State - State of the field which determines its shape.
|
|
12
|
+
*/
|
|
13
|
+
export type ContentRelationshipField<TypeEnum = string, LangEnum = string, DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown = unknown, State extends FieldState = FieldState> = State extends "empty" ? EmptyContentRelationshipField : FilledContentRelationshipField<TypeEnum, LangEnum, DataInterface>;
|
|
14
|
+
export type EmptyContentRelationshipField = {
|
|
15
|
+
link_type: "Any";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Links that refer to documents
|
|
19
|
+
*/
|
|
20
|
+
export interface FilledContentRelationshipField<TypeEnum = string, LangEnum = string, DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown = unknown> {
|
|
21
|
+
link_type: "Document";
|
|
22
|
+
id: string;
|
|
23
|
+
uid?: string;
|
|
24
|
+
type: TypeEnum;
|
|
25
|
+
tags: string[];
|
|
26
|
+
lang: LangEnum;
|
|
27
|
+
url?: string;
|
|
28
|
+
slug?: string;
|
|
29
|
+
isBroken?: boolean;
|
|
30
|
+
data?: DataInterface;
|
|
31
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FieldState } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A date field.
|
|
4
|
+
*
|
|
5
|
+
* @typeParam State - State of the field which determines its shape.
|
|
6
|
+
*
|
|
7
|
+
* @see More details: {@link https://prismic.io/docs/date}
|
|
8
|
+
*/
|
|
9
|
+
export type DateField<State extends FieldState = FieldState> = State extends "empty" ? null : string;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { AnyRegularField } from "./types.js";
|
|
2
|
+
import type { GroupField } from "./group.js";
|
|
3
|
+
import type { SliceZone } from "./sliceZone.js";
|
|
4
|
+
import type { TimestampField } from "./timestamp.js";
|
|
5
|
+
/**
|
|
6
|
+
* Document metadata for a translation of a Prismic document.
|
|
7
|
+
*/
|
|
8
|
+
export interface AlternateLanguage<TypeEnum = string, LangEnum = string> {
|
|
9
|
+
id: string;
|
|
10
|
+
uid?: string;
|
|
11
|
+
type: TypeEnum;
|
|
12
|
+
lang: LangEnum;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Metadata for Prismic document
|
|
16
|
+
*/
|
|
17
|
+
export interface PrismicDocumentHeader<TypeEnum = string, LangEnum = string> {
|
|
18
|
+
/**
|
|
19
|
+
* The unique identifier for the document. Guaranteed to be unique among all
|
|
20
|
+
* documents in the Prismic repository.
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* The unique identifier for the document. Guaranteed to be unique among all
|
|
25
|
+
* Prismic documents of the same type.
|
|
26
|
+
*/
|
|
27
|
+
uid: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Url that refers to document.
|
|
30
|
+
*/
|
|
31
|
+
url: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Type of the document.
|
|
34
|
+
*/
|
|
35
|
+
type: TypeEnum;
|
|
36
|
+
/**
|
|
37
|
+
* Href for document.
|
|
38
|
+
*/
|
|
39
|
+
href: string;
|
|
40
|
+
/**
|
|
41
|
+
* Tags associated with document.
|
|
42
|
+
*/
|
|
43
|
+
tags: string[];
|
|
44
|
+
/**
|
|
45
|
+
* The timestamp at which the document was first published.
|
|
46
|
+
*/
|
|
47
|
+
first_publication_date: TimestampField<"filled">;
|
|
48
|
+
/**
|
|
49
|
+
* The timestamp at which the document was last published.
|
|
50
|
+
*/
|
|
51
|
+
last_publication_date: TimestampField<"filled">;
|
|
52
|
+
/**
|
|
53
|
+
* Slugs associated with document.
|
|
54
|
+
*
|
|
55
|
+
* @deprecated Slugs are a deprecated feature used before the UID field was
|
|
56
|
+
* introduced. Migrate to the UID field. For more details, see
|
|
57
|
+
* https://community.prismic.io/t/what-are-slugs/6493
|
|
58
|
+
*/
|
|
59
|
+
slugs: string[];
|
|
60
|
+
/**
|
|
61
|
+
* Documents that are related to this document.
|
|
62
|
+
*/
|
|
63
|
+
linked_documents: unknown[];
|
|
64
|
+
/**
|
|
65
|
+
* Language of document.
|
|
66
|
+
*/
|
|
67
|
+
lang: LangEnum;
|
|
68
|
+
/**
|
|
69
|
+
* Array to access alternate language versions for document.
|
|
70
|
+
*/
|
|
71
|
+
alternate_languages: AlternateLanguage<TypeEnum, LangEnum>[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A Prismic document served through REST API v2.
|
|
75
|
+
*
|
|
76
|
+
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
77
|
+
*/
|
|
78
|
+
export interface PrismicDocument<DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> = Record<string, any>, TypeEnum = string, LangEnum = string> extends PrismicDocumentHeader<TypeEnum, LangEnum> {
|
|
79
|
+
/**
|
|
80
|
+
* Data contained in the document.
|
|
81
|
+
*/
|
|
82
|
+
data: DataInterface;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A Prismic document served through REST API v2. Does not contain a UID (a
|
|
86
|
+
* unique identifier).
|
|
87
|
+
*
|
|
88
|
+
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
89
|
+
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
90
|
+
*/
|
|
91
|
+
export interface PrismicDocumentWithoutUID<DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> = Record<string, any>, TypeEnum = string, LangEnum = string> extends PrismicDocument<DataInterface, TypeEnum, LangEnum> {
|
|
92
|
+
/**
|
|
93
|
+
* This document does not have a UID field. This property will always be
|
|
94
|
+
* `null`.
|
|
95
|
+
*
|
|
96
|
+
* The unique identifier for the document. Guaranteed to be unique among all
|
|
97
|
+
* Prismic documents of the same type.
|
|
98
|
+
*/
|
|
99
|
+
uid: null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A Prismic document served through REST API v2. Contains a UID (a unique
|
|
103
|
+
* identifier).
|
|
104
|
+
*
|
|
105
|
+
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
106
|
+
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
107
|
+
*/
|
|
108
|
+
export interface PrismicDocumentWithUID<DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> = Record<string, any>, TypeEnum = string, LangEnum = string> extends PrismicDocument<DataInterface, TypeEnum, LangEnum> {
|
|
109
|
+
/**
|
|
110
|
+
* The unique identifier for the document. Guaranteed to be unique among all
|
|
111
|
+
* Prismic documents of the same type.
|
|
112
|
+
*/
|
|
113
|
+
uid: string;
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.cjs","sources":["../../../../src/types/value/embed.ts"],"sourcesContent":["import type { EmptyObjectField, FieldState } from \"./types\"\n\n/**\n * oEmbed 1.0 possible types.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport const OEmbedType = {\n\tPhoto: \"photo\",\n\tVideo: \"video\",\n\tLink: \"link\",\n\tRich: \"rich\",\n} as const\n\n/**\n * oEmbed response base fields. Those are every mandatory fields an oEmbed\n * response must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\ntype OEmbedBase<TType extends (typeof OEmbedType)[keyof typeof OEmbedType]> = {\n\t/**\n\t * oEmbed resource type.\n\t */\n\ttype: TType\n\n\t/**\n\t * oEmbed version number, this must be \"1.0\".\n\t */\n\tversion: string\n}\n\n/**\n * oEmbed response extra fields. Those are every non-mandatory and unknown\n * fields an oEmbed response can feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type OEmbedExtra = {\n\t/**\n\t * oEmbed text title, describing the resource.\n\t */\n\ttitle?: string | null\n\n\t/**\n\t * oEmbed resource author/owner name.\n\t */\n\tauthor_name?: string | null\n\n\t/**\n\t * oEmbed resource author/owner URL.\n\t */\n\tauthor_url?: string | null\n\n\t/**\n\t * oEmbed resource provider name.\n\t */\n\tprovider_name?: string | null\n\n\t/**\n\t * oEmbed resource provider URL.\n\t */\n\tprovider_url?: string | null\n\n\t/**\n\t * oEmbed suggested cache lifetime for the resource, in seconds.\n\t */\n\tcache_age?: number | null\n\n\t/**\n\t * oEmbed resource thumbnail URL.\n\t */\n\tthumbnail_url?: string | null\n\n\t/**\n\t * oEmbed resource thumbnail width.\n\t */\n\tthumbnail_width?: number | null\n\n\t/**\n\t * oEmbed resource thumbnail height.\n\t */\n\tthumbnail_height?: number | null\n\n\t/**\n\t * Providers may optionally include any parameters not specified in this\n\t * document (so long as they use the same key-value format) and consumers may\n\t * choose to ignore these. Consumers must ignore parameters they do not\n\t * understand.\n\t *\n\t * @see oEmbed specification: {@link https://oembed.com}\n\t */\n\t[key: string]: unknown | null\n}\n\n/**\n * oEmbed photo type. Those are every mandatory fields an oEmbed photo response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type PhotoOEmbed = OEmbedBase<typeof OEmbedType.Photo> & {\n\t/**\n\t * oEmbed source URL of the image.\n\t */\n\turl: string\n\n\t/**\n\t * oEmbed width in pixels of the image.\n\t */\n\twidth: number\n\n\t/**\n\t * oEmbed height in pixels of the image.\n\t */\n\theight: number\n}\n\n/**\n * oEmbed video type. Those are every mandatory fields an oEmbed video response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type VideoOEmbed = OEmbedBase<typeof OEmbedType.Video> & {\n\t/**\n\t * oEmbed HTML required to embed a video player.\n\t */\n\thtml: string\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number\n}\n\n/**\n * oEmbed link type. Those are every mandatory fields an oEmbed link response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type LinkOEmbed = OEmbedBase<typeof OEmbedType.Link>\n\n/**\n * oEmbed rich type. Those are every mandatory fields an oEmbed rich response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {\n\t/**\n\t * oEmbed HTML required to display the resource.\n\t */\n\thtml: string\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number\n}\n\n/**\n * Any of the possible types of oEmbed response. Those contains only mandatory\n * fields their respective oEmbed response type must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed\n\n/**\n * An embed field.\n *\n * @typeParam Data - Data provided by the URL's oEmbed provider.\n * @typeParam State - State of the field which determines its shape.\n *\n * @see More details: {@link https://prismic.io/docs/embed}\n */\nexport type EmbedField<\n\tData extends AnyOEmbed = AnyOEmbed & OEmbedExtra,\n\tState extends FieldState = FieldState,\n> = State extends \"empty\"\n\t? EmptyObjectField\n\t: Data & {\n\t\t\tembed_url: string\n\t\t\thtml: string | null\n\t\t}\n"],"names":[],"mappings":";;AAOO,MAAM,aAAa;AAAA,EACzB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;;;"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { EmptyObjectField, FieldState } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* oEmbed 1.0 possible types.
|
|
4
|
+
*
|
|
5
|
+
* @see oEmbed specification: {@link https://oembed.com}
|
|
6
|
+
*/
|
|
7
|
+
export declare const OEmbedType: {
|
|
8
|
+
readonly Photo: "photo";
|
|
9
|
+
readonly Video: "video";
|
|
10
|
+
readonly Link: "link";
|
|
11
|
+
readonly Rich: "rich";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* oEmbed response base fields. Those are every mandatory fields an oEmbed
|
|
15
|
+
* response must feature.
|
|
16
|
+
*
|
|
17
|
+
* @see oEmbed specification: {@link https://oembed.com}
|
|
18
|
+
*/
|
|
19
|
+
type OEmbedBase<TType extends (typeof OEmbedType)[keyof typeof OEmbedType]> = {
|
|
20
|
+
/**
|
|
21
|
+
* oEmbed resource type.
|
|
22
|
+
*/
|
|
23
|
+
type: TType;
|
|
24
|
+
/**
|
|
25
|
+
* oEmbed version number, this must be "1.0".
|
|
26
|
+
*/
|
|
27
|
+
version: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* oEmbed response extra fields. Those are every non-mandatory and unknown
|
|
31
|
+
* fields an oEmbed response can feature.
|
|
32
|
+
*
|
|
33
|
+
* @see oEmbed specification: {@link https://oembed.com}
|
|
34
|
+
*/
|
|
35
|
+
export type OEmbedExtra = {
|
|
36
|
+
/**
|
|
37
|
+
* oEmbed text title, describing the resource.
|
|
38
|
+
*/
|
|
39
|
+
title?: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* oEmbed resource author/owner name.
|
|
42
|
+
*/
|
|
43
|
+
author_name?: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* oEmbed resource author/owner URL.
|
|
46
|
+
*/
|
|
47
|
+
author_url?: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* oEmbed resource provider name.
|
|
50
|
+
*/
|
|
51
|
+
provider_name?: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* oEmbed resource provider URL.
|
|
54
|
+
*/
|
|
55
|
+
provider_url?: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* oEmbed suggested cache lifetime for the resource, in seconds.
|
|
58
|
+
*/
|
|
59
|
+
cache_age?: number | null;
|
|
60
|
+
/**
|
|
61
|
+
* oEmbed resource thumbnail URL.
|
|
62
|
+
*/
|
|
63
|
+
thumbnail_url?: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* oEmbed resource thumbnail width.
|
|
66
|
+
*/
|
|
67
|
+
thumbnail_width?: number | null;
|
|
68
|
+
/**
|
|
69
|
+
* oEmbed resource thumbnail height.
|
|
70
|
+
*/
|
|
71
|
+
thumbnail_height?: number | null;
|
|
72
|
+
/**
|
|
73
|
+
* Providers may optionally include any parameters not specified in this
|
|
74
|
+
* document (so long as they use the same key-value format) and consumers may
|
|
75
|
+
* choose to ignore these. Consumers must ignore parameters they do not
|
|
76
|
+
* understand.
|
|
77
|
+
*
|
|
78
|
+
* @see oEmbed specification: {@link https://oembed.com}
|
|
79
|
+
*/
|
|
80
|
+
[key: string]: unknown | null;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* oEmbed photo type. Those are every mandatory fields an oEmbed photo response
|
|
84
|
+
* must feature.
|
|
85
|
+
*
|
|
86
|
+
* @see oEmbed specification: {@link https://oembed.com}
|
|
87
|
+
*/
|
|
88
|
+
export type PhotoOEmbed = OEmbedBase<typeof OEmbedType.Photo> & {
|
|
89
|
+
/**
|
|
90
|
+
* oEmbed source URL of the image.
|
|
91
|
+
*/
|
|
92
|
+
url: string;
|
|
93
|
+
/**
|
|
94
|
+
* oEmbed width in pixels of the image.
|
|
95
|
+
*/
|
|
96
|
+
width: number;
|
|
97
|
+
/**
|
|
98
|
+
* oEmbed height in pixels of the image.
|
|
99
|
+
*/
|
|
100
|
+
height: number;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* oEmbed video type. Those are every mandatory fields an oEmbed video response
|
|
104
|
+
* must feature.
|
|
105
|
+
*
|
|
106
|
+
* @see oEmbed specification: {@link https://oembed.com}
|
|
107
|
+
*/
|
|
108
|
+
export type VideoOEmbed = OEmbedBase<typeof OEmbedType.Video> & {
|
|
109
|
+
/**
|
|
110
|
+
* oEmbed HTML required to embed a video player.
|
|
111
|
+
*/
|
|
112
|
+
html: string;
|
|
113
|
+
/**
|
|
114
|
+
* oEmbed width in pixels required to display the HTML.
|
|
115
|
+
*/
|
|
116
|
+
width: number;
|
|
117
|
+
/**
|
|
118
|
+
* oEmbed height in pixels required to display the HTML.
|
|
119
|
+
*/
|
|
120
|
+
height: number;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* oEmbed link type. Those are every mandatory fields an oEmbed link response
|
|
124
|
+
* must feature.
|
|
125
|
+
*
|
|
126
|
+
* @see oEmbed specification: {@link https://oembed.com}
|
|
127
|
+
*/
|
|
128
|
+
export type LinkOEmbed = OEmbedBase<typeof OEmbedType.Link>;
|
|
129
|
+
/**
|
|
130
|
+
* oEmbed rich type. Those are every mandatory fields an oEmbed rich response
|
|
131
|
+
* must feature.
|
|
132
|
+
*
|
|
133
|
+
* @see oEmbed specification: {@link https://oembed.com}
|
|
134
|
+
*/
|
|
135
|
+
export type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {
|
|
136
|
+
/**
|
|
137
|
+
* oEmbed HTML required to display the resource.
|
|
138
|
+
*/
|
|
139
|
+
html: string;
|
|
140
|
+
/**
|
|
141
|
+
* oEmbed width in pixels required to display the HTML.
|
|
142
|
+
*/
|
|
143
|
+
width: number;
|
|
144
|
+
/**
|
|
145
|
+
* oEmbed height in pixels required to display the HTML.
|
|
146
|
+
*/
|
|
147
|
+
height: number;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Any of the possible types of oEmbed response. Those contains only mandatory
|
|
151
|
+
* fields their respective oEmbed response type must feature.
|
|
152
|
+
*
|
|
153
|
+
* @see oEmbed specification: {@link https://oembed.com}
|
|
154
|
+
*/
|
|
155
|
+
export type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed;
|
|
156
|
+
/**
|
|
157
|
+
* An embed field.
|
|
158
|
+
*
|
|
159
|
+
* @typeParam Data - Data provided by the URL's oEmbed provider.
|
|
160
|
+
* @typeParam State - State of the field which determines its shape.
|
|
161
|
+
*
|
|
162
|
+
* @see More details: {@link https://prismic.io/docs/embed}
|
|
163
|
+
*/
|
|
164
|
+
export type EmbedField<Data extends AnyOEmbed = AnyOEmbed & OEmbedExtra, State extends FieldState = FieldState> = State extends "empty" ? EmptyObjectField : Data & {
|
|
165
|
+
embed_url: string;
|
|
166
|
+
html: string | null;
|
|
167
|
+
};
|
|
168
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.js","sources":["../../../../src/types/value/embed.ts"],"sourcesContent":["import type { EmptyObjectField, FieldState } from \"./types\"\n\n/**\n * oEmbed 1.0 possible types.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport const OEmbedType = {\n\tPhoto: \"photo\",\n\tVideo: \"video\",\n\tLink: \"link\",\n\tRich: \"rich\",\n} as const\n\n/**\n * oEmbed response base fields. Those are every mandatory fields an oEmbed\n * response must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\ntype OEmbedBase<TType extends (typeof OEmbedType)[keyof typeof OEmbedType]> = {\n\t/**\n\t * oEmbed resource type.\n\t */\n\ttype: TType\n\n\t/**\n\t * oEmbed version number, this must be \"1.0\".\n\t */\n\tversion: string\n}\n\n/**\n * oEmbed response extra fields. Those are every non-mandatory and unknown\n * fields an oEmbed response can feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type OEmbedExtra = {\n\t/**\n\t * oEmbed text title, describing the resource.\n\t */\n\ttitle?: string | null\n\n\t/**\n\t * oEmbed resource author/owner name.\n\t */\n\tauthor_name?: string | null\n\n\t/**\n\t * oEmbed resource author/owner URL.\n\t */\n\tauthor_url?: string | null\n\n\t/**\n\t * oEmbed resource provider name.\n\t */\n\tprovider_name?: string | null\n\n\t/**\n\t * oEmbed resource provider URL.\n\t */\n\tprovider_url?: string | null\n\n\t/**\n\t * oEmbed suggested cache lifetime for the resource, in seconds.\n\t */\n\tcache_age?: number | null\n\n\t/**\n\t * oEmbed resource thumbnail URL.\n\t */\n\tthumbnail_url?: string | null\n\n\t/**\n\t * oEmbed resource thumbnail width.\n\t */\n\tthumbnail_width?: number | null\n\n\t/**\n\t * oEmbed resource thumbnail height.\n\t */\n\tthumbnail_height?: number | null\n\n\t/**\n\t * Providers may optionally include any parameters not specified in this\n\t * document (so long as they use the same key-value format) and consumers may\n\t * choose to ignore these. Consumers must ignore parameters they do not\n\t * understand.\n\t *\n\t * @see oEmbed specification: {@link https://oembed.com}\n\t */\n\t[key: string]: unknown | null\n}\n\n/**\n * oEmbed photo type. Those are every mandatory fields an oEmbed photo response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type PhotoOEmbed = OEmbedBase<typeof OEmbedType.Photo> & {\n\t/**\n\t * oEmbed source URL of the image.\n\t */\n\turl: string\n\n\t/**\n\t * oEmbed width in pixels of the image.\n\t */\n\twidth: number\n\n\t/**\n\t * oEmbed height in pixels of the image.\n\t */\n\theight: number\n}\n\n/**\n * oEmbed video type. Those are every mandatory fields an oEmbed video response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type VideoOEmbed = OEmbedBase<typeof OEmbedType.Video> & {\n\t/**\n\t * oEmbed HTML required to embed a video player.\n\t */\n\thtml: string\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number\n}\n\n/**\n * oEmbed link type. Those are every mandatory fields an oEmbed link response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type LinkOEmbed = OEmbedBase<typeof OEmbedType.Link>\n\n/**\n * oEmbed rich type. Those are every mandatory fields an oEmbed rich response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {\n\t/**\n\t * oEmbed HTML required to display the resource.\n\t */\n\thtml: string\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number\n}\n\n/**\n * Any of the possible types of oEmbed response. Those contains only mandatory\n * fields their respective oEmbed response type must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed\n\n/**\n * An embed field.\n *\n * @typeParam Data - Data provided by the URL's oEmbed provider.\n * @typeParam State - State of the field which determines its shape.\n *\n * @see More details: {@link https://prismic.io/docs/embed}\n */\nexport type EmbedField<\n\tData extends AnyOEmbed = AnyOEmbed & OEmbedExtra,\n\tState extends FieldState = FieldState,\n> = State extends \"empty\"\n\t? EmptyObjectField\n\t: Data & {\n\t\t\tembed_url: string\n\t\t\thtml: string | null\n\t\t}\n"],"names":[],"mappings":"AAOO,MAAM,aAAa;AAAA,EACzB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EmptyObjectField, FieldState } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A geopoint field.
|
|
4
|
+
*
|
|
5
|
+
* @typeParam State - State of the field which determines its shape.
|
|
6
|
+
*
|
|
7
|
+
* @see More details: {@link https://prismic.io/docs/geopoint}
|
|
8
|
+
*/
|
|
9
|
+
export type GeoPointField<State extends FieldState = FieldState> = State extends "empty" ? EmptyObjectField : {
|
|
10
|
+
latitude: number;
|
|
11
|
+
longitude: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AnyRegularField, FieldState } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A group field.
|
|
4
|
+
*
|
|
5
|
+
* More details: {@link https://prismic.io/docs/group}
|
|
6
|
+
*/
|
|
7
|
+
export type GroupField<Fields extends Record<string, AnyRegularField | NestedGroupField> = Record<string, AnyRegularField | NestedGroupField>, State extends FieldState = FieldState> = State extends "empty" ? [] : [Fields, ...Fields[]];
|
|
8
|
+
/**
|
|
9
|
+
* A nested group field.
|
|
10
|
+
*
|
|
11
|
+
* More details: {@link https://prismic.io/docs/group}
|
|
12
|
+
*/
|
|
13
|
+
export type NestedGroupField<Fields extends Record<string, AnyRegularField> = Record<string, AnyRegularField>, State extends FieldState = FieldState> = GroupField<Fields, State>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { FieldState, Simplify } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* An individual image within an image field. The base image and each thumbnail
|
|
4
|
+
* uses this type.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam State - State of the field which determines its shape.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link ImageField} for a full image field type.
|
|
9
|
+
*/
|
|
10
|
+
export type ImageFieldImage<State extends FieldState = FieldState> = State extends "empty" ? EmptyImageFieldImage : FilledImageFieldImage;
|
|
11
|
+
export interface FilledImageFieldImage {
|
|
12
|
+
id: string;
|
|
13
|
+
url: string;
|
|
14
|
+
dimensions: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
edit: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
zoom: number;
|
|
22
|
+
background: string;
|
|
23
|
+
};
|
|
24
|
+
alt: string | null;
|
|
25
|
+
copyright: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface EmptyImageFieldImage {
|
|
28
|
+
id?: null;
|
|
29
|
+
url?: null;
|
|
30
|
+
dimensions?: null;
|
|
31
|
+
edit?: null;
|
|
32
|
+
alt?: null;
|
|
33
|
+
copyright?: null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* An image field.
|
|
37
|
+
*
|
|
38
|
+
* **Note**: Passing `null` to the `ThumbnailNames` parameter is deprecated and
|
|
39
|
+
* will be removed in a future version. Use `never` instead.
|
|
40
|
+
*
|
|
41
|
+
* @typeParam ThumbnailNames - Names of thumbnails. If the field does not
|
|
42
|
+
* contain thumbnails, `never` can be used to "disable" thumbnail fields.
|
|
43
|
+
* @typeParam State - State of the field which determines its shape.
|
|
44
|
+
*
|
|
45
|
+
* @see Image field documentation: {@link https://prismic.io/docs/image}
|
|
46
|
+
*/
|
|
47
|
+
export type ImageField<ThumbnailNames extends string | null = never, State extends FieldState = FieldState> = Simplify<State extends "filled" ? ImageFieldImage<State> & Record<Extract<ThumbnailNames, string>, ImageFieldImage<State>> : ImageFieldImage<State> & Record<Extract<ThumbnailNames, string>, ImageFieldImage<State>>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FieldState } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* An integration field.
|
|
4
|
+
*
|
|
5
|
+
* @typeParam Data - Data from the integrated API.
|
|
6
|
+
* @typeParam State - State of the field which determines its shape.
|
|
7
|
+
*
|
|
8
|
+
* @see More details: {@link https://prismic.io/docs/fields/integration}
|
|
9
|
+
*/
|
|
10
|
+
export type IntegrationField<Data extends IntegrationFieldData = IntegrationFieldData, State extends FieldState = FieldState> = State extends "empty" ? null : Data;
|
|
11
|
+
/**
|
|
12
|
+
* Data from an integration field.
|
|
13
|
+
*
|
|
14
|
+
* @see More details: {@link https://prismic.io/docs/fields/integration}
|
|
15
|
+
*/
|
|
16
|
+
export type IntegrationFieldData = Record<string | number, unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FieldState } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A key text field
|
|
4
|
+
*
|
|
5
|
+
* @typeParam State - State of the field which determines its shape.
|
|
6
|
+
*
|
|
7
|
+
* @see More details: {@link https://prismic.io/docs/key-text}
|
|
8
|
+
*/
|
|
9
|
+
export type KeyTextField<State extends FieldState = FieldState> = State extends "empty" ? null | "" : string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.cjs","sources":["../../../../src/types/value/link.ts"],"sourcesContent":["import type { AnyRegularField, FieldState } from \"./types\"\n\nimport type { FilledContentRelationshipField } from \"./contentRelationship\"\nimport type { GroupField } from \"./group\"\nimport type { FilledLinkToMediaField } from \"./linkToMedia\"\nimport type { SliceZone } from \"./sliceZone\"\n\n/**\n * Link types\n */\nexport const LinkType = {\n\tAny: \"Any\",\n\tDocument: \"Document\",\n\tMedia: \"Media\",\n\tWeb: \"Web\",\n} as const\n\n/**\n * A link field.\n *\n * @typeParam TypeEnum - Type API ID of the document.\n * @typeParam LangEnum - Language API ID of the document.\n * @typeParam DataInterface - Data fields for the document (filled via the\n * `fetchLinks` or `graphQuery` query parameter).\n * @typeParam State - State of the field which determines its shape.\n * @typeParam Variant - Variants of the link.\n */\nexport type LinkField<\n\tTypeEnum = string,\n\tLangEnum = string,\n\tDataInterface extends\n\t\t| Record<string, AnyRegularField | GroupField | SliceZone>\n\t\t| unknown = unknown,\n\tState extends FieldState = FieldState,\n\tVariant = string,\n> = State extends \"empty\"\n\t? EmptyLinkField<typeof LinkType.Any, Variant>\n\t: FilledLinkField<TypeEnum, LangEnum, DataInterface, Variant>\n\n/**\n * A link field that is filled.\n *\n * @typeParam TypeEnum - Type API ID of the document.\n * @typeParam LangEnum - Language API ID of the document.\n * @typeParam DataInterface - Data fields for the document (filled via the\n * `fetchLinks` or `graphQuery` query parameter).\n * @typeParam Variant - Variants of the link.\n */\nexport type FilledLinkField<\n\tTypeEnum = string,\n\tLangEnum = string,\n\tDataInterface extends\n\t\t| Record<string, AnyRegularField | GroupField | SliceZone>\n\t\t| unknown = unknown,\n\tVariant = string,\n> =\n\t| (FilledContentRelationshipField<TypeEnum, LangEnum, DataInterface> &\n\t\t\tOptionalLinkProperties<Variant>)\n\t| FilledLinkToMediaField<Variant>\n\t| FilledLinkToWebField<Variant>\n\n/**\n * A link field that is not filled.\n *\n * @typeParam _Unused - THIS PARAMETER IS NOT USED. If you are passing a type,\n * **please remove it**.\n * @typeParam Variant - Variants of the link.\n */\nexport type EmptyLinkField<\n\t_Unused extends\n\t\t(typeof LinkType)[keyof typeof LinkType] = typeof LinkType.Any,\n\tVariant = string,\n> = {\n\tlink_type: \"Any\"\n} & OptionalLinkProperties<Variant>\n\n/**\n * A link field pointing to a relative or absolute URL.\n *\n * @typeParam Variant - Variants of the link.\n */\nexport type FilledLinkToWebField<Variant = string> = {\n\tlink_type: \"Web\"\n\turl: string\n\ttarget?: string\n} & OptionalLinkProperties<Variant>\n\n/**\n * Optional properties available to link fields. It is used to augment existing\n * link-like fields (like content relationship fields) with field-specific\n * properties.\n *\n * @typeParam Variant - Variants of the link.\n *\n * @internal\n */\n// Remember to update the `getOptionalLinkProperties()` function when updating\n// this type. The function should check for every property.\nexport type OptionalLinkProperties<Variant = string> = {\n\ttext?: string\n\tvariant?: Variant\n}\n"],"names":[],"mappings":";;AAUO,MAAM,WAAW;AAAA,EACvB,KAAK;AAAA,EACL,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;;;"}
|