@prismicio/client 7.21.0-alpha.2 → 7.21.0
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 +1262 -0
- package/dist/Client.cjs.map +1 -0
- package/dist/Client.d.ts +981 -0
- package/dist/Client.js +1262 -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 +66 -0
- package/dist/buildQueryURL.cjs.map +1 -0
- package/dist/buildQueryURL.d.ts +217 -0
- package/dist/buildQueryURL.js +66 -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 +8 -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 +34 -11
- package/src/WriteClient.ts +21 -32
- package/src/index.ts +1 -0
- package/src/types/model/contentRelationship.ts +1 -0
- 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,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const richText = require("../types/value/richText.cjs");
|
|
4
|
+
const RichTextReversedNodeType = {
|
|
5
|
+
[richText.RichTextNodeType.listItem]: "listItem",
|
|
6
|
+
[richText.RichTextNodeType.oListItem]: "oListItem",
|
|
7
|
+
[richText.RichTextNodeType.list]: "list",
|
|
8
|
+
[richText.RichTextNodeType.oList]: "oList"
|
|
9
|
+
};
|
|
10
|
+
exports.RichTextReversedNodeType = RichTextReversedNodeType;
|
|
11
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../src/richtext/types.ts"],"sourcesContent":["import type {\n\tRTAnyNode,\n\tRTEmNode,\n\tRTEmbedNode,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTImageNode,\n\tRTLabelNode,\n\tRTLinkNode,\n\tRTListItemNode,\n\tRTListNode,\n\tRTOListItemNode,\n\tRTOListNode,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTSpanNode,\n\tRTStrongNode,\n\tRichTextNodeTypes,\n} from \"../types/value/richText\"\nimport { RichTextNodeType } from \"../types/value/richText\"\n\n// Serializers\n\n/**\n * Serializes a node from a rich text or title field with a function\n *\n * @typeParam ReturnType - Return type of the function serializer.\n *\n * @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}\n */\nexport type RichTextFunctionSerializer<ReturnType> = (\n\ttype: RichTextNodeTypes,\n\tnode: RTAnyNode,\n\ttext: string | undefined,\n\tchildren: ReturnType[],\n\tkey: string,\n) => ReturnType | null | undefined\n\n/**\n * Map serializer's tag function serializer, can be helpful for typing those\n * handlers\n *\n * @typeParam ReturnType - Return type of the tag serializer\n */\nexport type RichTextMapSerializerFunction<\n\tReturnType,\n\tNode extends RTAnyNode = RTAnyNode,\n\tTextType = string | undefined,\n> = (payload: {\n\ttype: Node[\"type\"]\n\tnode: Node\n\ttext: TextType\n\tchildren: ReturnType[]\n\tkey: string\n}) => ReturnType | null | undefined\n\n/**\n * Serializes a node from a rich text field with a map.\n *\n * @remarks\n * This type of serializer needs to be processed through\n * {@link wrapMapSerializer} before being used with {@link serialize}.\n *\n * @typeParam ReturnType - Return type of the map serializer.\n *\n * @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}\n */\nexport type RichTextMapSerializer<ReturnType> = {\n\theading1?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading1Node,\n\t\tundefined\n\t>\n\theading2?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading2Node,\n\t\tundefined\n\t>\n\theading3?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading3Node,\n\t\tundefined\n\t>\n\theading4?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading4Node,\n\t\tundefined\n\t>\n\theading5?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading5Node,\n\t\tundefined\n\t>\n\theading6?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading6Node,\n\t\tundefined\n\t>\n\tparagraph?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTParagraphNode,\n\t\tundefined\n\t>\n\tpreformatted?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTPreformattedNode,\n\t\tundefined\n\t>\n\tstrong?: RichTextMapSerializerFunction<ReturnType, RTStrongNode, string>\n\tem?: RichTextMapSerializerFunction<ReturnType, RTEmNode, string>\n\tlistItem?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTListItemNode,\n\t\tundefined\n\t>\n\toListItem?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTOListItemNode,\n\t\tundefined\n\t>\n\tlist?: RichTextMapSerializerFunction<ReturnType, RTListNode, undefined>\n\toList?: RichTextMapSerializerFunction<ReturnType, RTOListNode, undefined>\n\timage?: RichTextMapSerializerFunction<ReturnType, RTImageNode, undefined>\n\tembed?: RichTextMapSerializerFunction<ReturnType, RTEmbedNode, undefined>\n\thyperlink?: RichTextMapSerializerFunction<ReturnType, RTLinkNode, string>\n\tlabel?: RichTextMapSerializerFunction<ReturnType, RTLabelNode, string>\n\tspan?: RichTextMapSerializerFunction<ReturnType, RTSpanNode, string>\n}\n\n// Tree\nexport interface Tree {\n\tkey: string\n\tchildren: TreeNode[]\n}\n\nexport interface TreeNode {\n\tkey: string\n\ttype: RichTextNodeTypes\n\ttext?: string\n\tnode: RTAnyNode\n\tchildren: TreeNode[]\n}\n\n// Helpers\nexport const RichTextReversedNodeType = {\n\t[RichTextNodeType.listItem]: \"listItem\",\n\t[RichTextNodeType.oListItem]: \"oListItem\",\n\t[RichTextNodeType.list]: \"list\",\n\t[RichTextNodeType.oList]: \"oList\",\n} as const\n"],"names":["RichTextNodeType"],"mappings":";;;AAoJO,MAAM,2BAA2B;AAAA,EACvC,CAACA,SAAAA,iBAAiB,QAAQ,GAAG;AAAA,EAC7B,CAACA,SAAAA,iBAAiB,SAAS,GAAG;AAAA,EAC9B,CAACA,SAAAA,iBAAiB,IAAI,GAAG;AAAA,EACzB,CAACA,SAAAA,iBAAiB,KAAK,GAAG;;;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { RTAnyNode, RTEmNode, RTEmbedNode, RTHeading1Node, RTHeading2Node, RTHeading3Node, RTHeading4Node, RTHeading5Node, RTHeading6Node, RTImageNode, RTLabelNode, RTLinkNode, RTListItemNode, RTListNode, RTOListItemNode, RTOListNode, RTParagraphNode, RTPreformattedNode, RTSpanNode, RTStrongNode, RichTextNodeTypes } from "../types/value/richText.js";
|
|
2
|
+
/**
|
|
3
|
+
* Serializes a node from a rich text or title field with a function
|
|
4
|
+
*
|
|
5
|
+
* @typeParam ReturnType - Return type of the function serializer.
|
|
6
|
+
*
|
|
7
|
+
* @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}
|
|
8
|
+
*/
|
|
9
|
+
export type RichTextFunctionSerializer<ReturnType> = (type: RichTextNodeTypes, node: RTAnyNode, text: string | undefined, children: ReturnType[], key: string) => ReturnType | null | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Map serializer's tag function serializer, can be helpful for typing those
|
|
12
|
+
* handlers
|
|
13
|
+
*
|
|
14
|
+
* @typeParam ReturnType - Return type of the tag serializer
|
|
15
|
+
*/
|
|
16
|
+
export type RichTextMapSerializerFunction<ReturnType, Node extends RTAnyNode = RTAnyNode, TextType = string | undefined> = (payload: {
|
|
17
|
+
type: Node["type"];
|
|
18
|
+
node: Node;
|
|
19
|
+
text: TextType;
|
|
20
|
+
children: ReturnType[];
|
|
21
|
+
key: string;
|
|
22
|
+
}) => ReturnType | null | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Serializes a node from a rich text field with a map.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* This type of serializer needs to be processed through
|
|
28
|
+
* {@link wrapMapSerializer} before being used with {@link serialize}.
|
|
29
|
+
*
|
|
30
|
+
* @typeParam ReturnType - Return type of the map serializer.
|
|
31
|
+
*
|
|
32
|
+
* @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}
|
|
33
|
+
*/
|
|
34
|
+
export type RichTextMapSerializer<ReturnType> = {
|
|
35
|
+
heading1?: RichTextMapSerializerFunction<ReturnType, RTHeading1Node, undefined>;
|
|
36
|
+
heading2?: RichTextMapSerializerFunction<ReturnType, RTHeading2Node, undefined>;
|
|
37
|
+
heading3?: RichTextMapSerializerFunction<ReturnType, RTHeading3Node, undefined>;
|
|
38
|
+
heading4?: RichTextMapSerializerFunction<ReturnType, RTHeading4Node, undefined>;
|
|
39
|
+
heading5?: RichTextMapSerializerFunction<ReturnType, RTHeading5Node, undefined>;
|
|
40
|
+
heading6?: RichTextMapSerializerFunction<ReturnType, RTHeading6Node, undefined>;
|
|
41
|
+
paragraph?: RichTextMapSerializerFunction<ReturnType, RTParagraphNode, undefined>;
|
|
42
|
+
preformatted?: RichTextMapSerializerFunction<ReturnType, RTPreformattedNode, undefined>;
|
|
43
|
+
strong?: RichTextMapSerializerFunction<ReturnType, RTStrongNode, string>;
|
|
44
|
+
em?: RichTextMapSerializerFunction<ReturnType, RTEmNode, string>;
|
|
45
|
+
listItem?: RichTextMapSerializerFunction<ReturnType, RTListItemNode, undefined>;
|
|
46
|
+
oListItem?: RichTextMapSerializerFunction<ReturnType, RTOListItemNode, undefined>;
|
|
47
|
+
list?: RichTextMapSerializerFunction<ReturnType, RTListNode, undefined>;
|
|
48
|
+
oList?: RichTextMapSerializerFunction<ReturnType, RTOListNode, undefined>;
|
|
49
|
+
image?: RichTextMapSerializerFunction<ReturnType, RTImageNode, undefined>;
|
|
50
|
+
embed?: RichTextMapSerializerFunction<ReturnType, RTEmbedNode, undefined>;
|
|
51
|
+
hyperlink?: RichTextMapSerializerFunction<ReturnType, RTLinkNode, string>;
|
|
52
|
+
label?: RichTextMapSerializerFunction<ReturnType, RTLabelNode, string>;
|
|
53
|
+
span?: RichTextMapSerializerFunction<ReturnType, RTSpanNode, string>;
|
|
54
|
+
};
|
|
55
|
+
export interface Tree {
|
|
56
|
+
key: string;
|
|
57
|
+
children: TreeNode[];
|
|
58
|
+
}
|
|
59
|
+
export interface TreeNode {
|
|
60
|
+
key: string;
|
|
61
|
+
type: RichTextNodeTypes;
|
|
62
|
+
text?: string;
|
|
63
|
+
node: RTAnyNode;
|
|
64
|
+
children: TreeNode[];
|
|
65
|
+
}
|
|
66
|
+
export declare const RichTextReversedNodeType: {
|
|
67
|
+
readonly "list-item": "listItem";
|
|
68
|
+
readonly "o-list-item": "oListItem";
|
|
69
|
+
readonly "group-list-item": "list";
|
|
70
|
+
readonly "group-o-list-item": "oList";
|
|
71
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RichTextNodeType } from "../types/value/richText.js";
|
|
2
|
+
const RichTextReversedNodeType = {
|
|
3
|
+
[RichTextNodeType.listItem]: "listItem",
|
|
4
|
+
[RichTextNodeType.oListItem]: "oListItem",
|
|
5
|
+
[RichTextNodeType.list]: "list",
|
|
6
|
+
[RichTextNodeType.oList]: "oList"
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
RichTextReversedNodeType
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/richtext/types.ts"],"sourcesContent":["import type {\n\tRTAnyNode,\n\tRTEmNode,\n\tRTEmbedNode,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTImageNode,\n\tRTLabelNode,\n\tRTLinkNode,\n\tRTListItemNode,\n\tRTListNode,\n\tRTOListItemNode,\n\tRTOListNode,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTSpanNode,\n\tRTStrongNode,\n\tRichTextNodeTypes,\n} from \"../types/value/richText\"\nimport { RichTextNodeType } from \"../types/value/richText\"\n\n// Serializers\n\n/**\n * Serializes a node from a rich text or title field with a function\n *\n * @typeParam ReturnType - Return type of the function serializer.\n *\n * @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}\n */\nexport type RichTextFunctionSerializer<ReturnType> = (\n\ttype: RichTextNodeTypes,\n\tnode: RTAnyNode,\n\ttext: string | undefined,\n\tchildren: ReturnType[],\n\tkey: string,\n) => ReturnType | null | undefined\n\n/**\n * Map serializer's tag function serializer, can be helpful for typing those\n * handlers\n *\n * @typeParam ReturnType - Return type of the tag serializer\n */\nexport type RichTextMapSerializerFunction<\n\tReturnType,\n\tNode extends RTAnyNode = RTAnyNode,\n\tTextType = string | undefined,\n> = (payload: {\n\ttype: Node[\"type\"]\n\tnode: Node\n\ttext: TextType\n\tchildren: ReturnType[]\n\tkey: string\n}) => ReturnType | null | undefined\n\n/**\n * Serializes a node from a rich text field with a map.\n *\n * @remarks\n * This type of serializer needs to be processed through\n * {@link wrapMapSerializer} before being used with {@link serialize}.\n *\n * @typeParam ReturnType - Return type of the map serializer.\n *\n * @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}\n */\nexport type RichTextMapSerializer<ReturnType> = {\n\theading1?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading1Node,\n\t\tundefined\n\t>\n\theading2?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading2Node,\n\t\tundefined\n\t>\n\theading3?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading3Node,\n\t\tundefined\n\t>\n\theading4?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading4Node,\n\t\tundefined\n\t>\n\theading5?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading5Node,\n\t\tundefined\n\t>\n\theading6?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading6Node,\n\t\tundefined\n\t>\n\tparagraph?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTParagraphNode,\n\t\tundefined\n\t>\n\tpreformatted?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTPreformattedNode,\n\t\tundefined\n\t>\n\tstrong?: RichTextMapSerializerFunction<ReturnType, RTStrongNode, string>\n\tem?: RichTextMapSerializerFunction<ReturnType, RTEmNode, string>\n\tlistItem?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTListItemNode,\n\t\tundefined\n\t>\n\toListItem?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTOListItemNode,\n\t\tundefined\n\t>\n\tlist?: RichTextMapSerializerFunction<ReturnType, RTListNode, undefined>\n\toList?: RichTextMapSerializerFunction<ReturnType, RTOListNode, undefined>\n\timage?: RichTextMapSerializerFunction<ReturnType, RTImageNode, undefined>\n\tembed?: RichTextMapSerializerFunction<ReturnType, RTEmbedNode, undefined>\n\thyperlink?: RichTextMapSerializerFunction<ReturnType, RTLinkNode, string>\n\tlabel?: RichTextMapSerializerFunction<ReturnType, RTLabelNode, string>\n\tspan?: RichTextMapSerializerFunction<ReturnType, RTSpanNode, string>\n}\n\n// Tree\nexport interface Tree {\n\tkey: string\n\tchildren: TreeNode[]\n}\n\nexport interface TreeNode {\n\tkey: string\n\ttype: RichTextNodeTypes\n\ttext?: string\n\tnode: RTAnyNode\n\tchildren: TreeNode[]\n}\n\n// Helpers\nexport const RichTextReversedNodeType = {\n\t[RichTextNodeType.listItem]: \"listItem\",\n\t[RichTextNodeType.oListItem]: \"oListItem\",\n\t[RichTextNodeType.list]: \"list\",\n\t[RichTextNodeType.oList]: \"oList\",\n} as const\n"],"names":[],"mappings":";AAoJO,MAAM,2BAA2B;AAAA,EACvC,CAAC,iBAAiB,QAAQ,GAAG;AAAA,EAC7B,CAAC,iBAAiB,SAAS,GAAG;AAAA,EAC9B,CAAC,iBAAiB,IAAI,GAAG;AAAA,EACzB,CAAC,iBAAiB,KAAK,GAAG;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const types = require("./types.cjs");
|
|
4
|
+
const wrapMapSerializer = (mapSerializer) => {
|
|
5
|
+
return (type, node, text, children, key) => {
|
|
6
|
+
const tagSerializer = mapSerializer[types.RichTextReversedNodeType[type] || type];
|
|
7
|
+
if (tagSerializer) {
|
|
8
|
+
return tagSerializer({
|
|
9
|
+
// @ts-expect-error cannot type check here
|
|
10
|
+
type,
|
|
11
|
+
// @ts-expect-error cannot type check here
|
|
12
|
+
node,
|
|
13
|
+
// @ts-expect-error cannot type check here
|
|
14
|
+
text,
|
|
15
|
+
// @ts-expect-error cannot type check here
|
|
16
|
+
children,
|
|
17
|
+
// @ts-expect-error cannot type check here
|
|
18
|
+
key
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
exports.wrapMapSerializer = wrapMapSerializer;
|
|
24
|
+
//# sourceMappingURL=wrapMapSerializer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapMapSerializer.cjs","sources":["../../../src/richtext/wrapMapSerializer.ts"],"sourcesContent":["import type { RichTextFunctionSerializer, RichTextMapSerializer } from \"./types\"\nimport { RichTextReversedNodeType } from \"./types\"\n\n/**\n * Wraps a map serializer into a regular function serializer\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages Most users aren't expected to this function directly\n *\n * @typeParam SerializerReturnType - Return type of the map serializer\n *\n * @param mapSerializer - Map serializer to wrap\n *\n * @returns A regular function serializer\n */\nexport const wrapMapSerializer = <SerializerReturnType>(\n\tmapSerializer: RichTextMapSerializer<SerializerReturnType>,\n): RichTextFunctionSerializer<SerializerReturnType> => {\n\treturn (type, node, text, children, key) => {\n\t\tconst tagSerializer: RichTextMapSerializer<SerializerReturnType>[keyof RichTextMapSerializer<SerializerReturnType>] =\n\t\t\tmapSerializer[\n\t\t\t\t(RichTextReversedNodeType[\n\t\t\t\t\ttype as keyof typeof RichTextReversedNodeType\n\t\t\t\t] || type) as keyof RichTextMapSerializer<SerializerReturnType>\n\t\t\t]\n\n\t\tif (tagSerializer) {\n\t\t\treturn tagSerializer({\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\ttype,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tnode,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\ttext,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tchildren,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tkey,\n\t\t\t})\n\t\t}\n\t}\n}\n"],"names":["RichTextReversedNodeType"],"mappings":";;;AAgBO,MAAM,oBAAoB,CAChC,kBACqD;AACrD,SAAO,CAAC,MAAM,MAAM,MAAM,UAAU,QAAO;AAC1C,UAAM,gBACL,cACEA,MAAAA,yBACA,IAA6C,KACzC,IAA0D;AAGjE,QAAI,eAAe;AAClB,aAAO,cAAc;AAAA;AAAA,QAEpB;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA,MAAA,CACA;AAAA,IACF;AAAA,EACD;AACD;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RichTextFunctionSerializer, RichTextMapSerializer } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a map serializer into a regular function serializer
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This is a low level helper mainly intended to be used by higher level
|
|
7
|
+
* packages Most users aren't expected to this function directly
|
|
8
|
+
*
|
|
9
|
+
* @typeParam SerializerReturnType - Return type of the map serializer
|
|
10
|
+
*
|
|
11
|
+
* @param mapSerializer - Map serializer to wrap
|
|
12
|
+
*
|
|
13
|
+
* @returns A regular function serializer
|
|
14
|
+
*/
|
|
15
|
+
export declare const wrapMapSerializer: <SerializerReturnType>(mapSerializer: RichTextMapSerializer<SerializerReturnType>) => RichTextFunctionSerializer<SerializerReturnType>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RichTextReversedNodeType } from "./types.js";
|
|
2
|
+
const wrapMapSerializer = (mapSerializer) => {
|
|
3
|
+
return (type, node, text, children, key) => {
|
|
4
|
+
const tagSerializer = mapSerializer[RichTextReversedNodeType[type] || type];
|
|
5
|
+
if (tagSerializer) {
|
|
6
|
+
return tagSerializer({
|
|
7
|
+
// @ts-expect-error cannot type check here
|
|
8
|
+
type,
|
|
9
|
+
// @ts-expect-error cannot type check here
|
|
10
|
+
node,
|
|
11
|
+
// @ts-expect-error cannot type check here
|
|
12
|
+
text,
|
|
13
|
+
// @ts-expect-error cannot type check here
|
|
14
|
+
children,
|
|
15
|
+
// @ts-expect-error cannot type check here
|
|
16
|
+
key
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
wrapMapSerializer
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=wrapMapSerializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapMapSerializer.js","sources":["../../../src/richtext/wrapMapSerializer.ts"],"sourcesContent":["import type { RichTextFunctionSerializer, RichTextMapSerializer } from \"./types\"\nimport { RichTextReversedNodeType } from \"./types\"\n\n/**\n * Wraps a map serializer into a regular function serializer\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages Most users aren't expected to this function directly\n *\n * @typeParam SerializerReturnType - Return type of the map serializer\n *\n * @param mapSerializer - Map serializer to wrap\n *\n * @returns A regular function serializer\n */\nexport const wrapMapSerializer = <SerializerReturnType>(\n\tmapSerializer: RichTextMapSerializer<SerializerReturnType>,\n): RichTextFunctionSerializer<SerializerReturnType> => {\n\treturn (type, node, text, children, key) => {\n\t\tconst tagSerializer: RichTextMapSerializer<SerializerReturnType>[keyof RichTextMapSerializer<SerializerReturnType>] =\n\t\t\tmapSerializer[\n\t\t\t\t(RichTextReversedNodeType[\n\t\t\t\t\ttype as keyof typeof RichTextReversedNodeType\n\t\t\t\t] || type) as keyof RichTextMapSerializer<SerializerReturnType>\n\t\t\t]\n\n\t\tif (tagSerializer) {\n\t\t\treturn tagSerializer({\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\ttype,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tnode,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\ttext,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tchildren,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tkey,\n\t\t\t})\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAgBO,MAAM,oBAAoB,CAChC,kBACqD;AACrD,SAAO,CAAC,MAAM,MAAM,MAAM,UAAU,QAAO;AAC1C,UAAM,gBACL,cACE,yBACA,IAA6C,KACzC,IAA0D;AAGjE,QAAI,eAAe;AAClB,aAAO,cAAc;AAAA;AAAA,QAEpB;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA,MAAA,CACA;AAAA,IACF;AAAA,EACD;AACD;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const asTree = require("./richtext/asTree.cjs");
|
|
4
|
+
const asText = require("./richtext/asText.cjs");
|
|
5
|
+
const serialize = require("./richtext/serialize.cjs");
|
|
6
|
+
const wrapMapSerializer = require("./richtext/wrapMapSerializer.cjs");
|
|
7
|
+
const composeSerializers = require("./richtext/composeSerializers.cjs");
|
|
8
|
+
const richText = require("./types/value/richText.cjs");
|
|
9
|
+
exports.asTree = asTree.asTree;
|
|
10
|
+
exports.asText = asText.asText;
|
|
11
|
+
exports.serialize = serialize.serialize;
|
|
12
|
+
exports.wrapMapSerializer = wrapMapSerializer.wrapMapSerializer;
|
|
13
|
+
exports.composeSerializers = composeSerializers.composeSerializers;
|
|
14
|
+
exports.Element = richText.RichTextNodeType;
|
|
15
|
+
//# sourceMappingURL=richtext.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"richtext.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
package/dist/richtext.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { asTree } from "./richtext/asTree.js";
|
|
2
|
+
import { asText } from "./richtext/asText.js";
|
|
3
|
+
import { serialize } from "./richtext/serialize.js";
|
|
4
|
+
import { wrapMapSerializer } from "./richtext/wrapMapSerializer.js";
|
|
5
|
+
import { composeSerializers } from "./richtext/composeSerializers.js";
|
|
6
|
+
import { RichTextNodeType } from "./types/value/richText.js";
|
|
7
|
+
export {
|
|
8
|
+
RichTextNodeType as Element,
|
|
9
|
+
asText,
|
|
10
|
+
asTree,
|
|
11
|
+
composeSerializers,
|
|
12
|
+
serialize,
|
|
13
|
+
wrapMapSerializer
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=richtext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"richtext.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { AssetTag } from "./tag.js";
|
|
2
|
+
/**
|
|
3
|
+
* Asset types.
|
|
4
|
+
*/
|
|
5
|
+
export declare const AssetType: {
|
|
6
|
+
readonly All: "all";
|
|
7
|
+
readonly Audio: "audio";
|
|
8
|
+
readonly Document: "document";
|
|
9
|
+
readonly Image: "image";
|
|
10
|
+
readonly Video: "video";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* An object representing an asset returned by the Asset API.
|
|
14
|
+
*
|
|
15
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
16
|
+
*/
|
|
17
|
+
export type Asset = {
|
|
18
|
+
/**
|
|
19
|
+
* Asset ID.
|
|
20
|
+
*/
|
|
21
|
+
id: string;
|
|
22
|
+
/**
|
|
23
|
+
* Asset URL.
|
|
24
|
+
*/
|
|
25
|
+
url: string;
|
|
26
|
+
/**
|
|
27
|
+
* Asset creation date.
|
|
28
|
+
*/
|
|
29
|
+
created_at: number;
|
|
30
|
+
/**
|
|
31
|
+
* Asset last modification date.
|
|
32
|
+
*/
|
|
33
|
+
last_modified: number;
|
|
34
|
+
/**
|
|
35
|
+
* Asset filename.
|
|
36
|
+
*/
|
|
37
|
+
filename: string;
|
|
38
|
+
/**
|
|
39
|
+
* Asset extension.
|
|
40
|
+
*/
|
|
41
|
+
extension: string;
|
|
42
|
+
/**
|
|
43
|
+
* Asset size in bytes.
|
|
44
|
+
*/
|
|
45
|
+
size: number;
|
|
46
|
+
/**
|
|
47
|
+
* Asset kind.
|
|
48
|
+
*/
|
|
49
|
+
kind: Exclude<(typeof AssetType)[keyof typeof AssetType], (typeof AssetType)["All"]>;
|
|
50
|
+
/**
|
|
51
|
+
* Asset width in pixels.
|
|
52
|
+
*/
|
|
53
|
+
width?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Asset height in pixels.
|
|
56
|
+
*/
|
|
57
|
+
height?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Asset notes.
|
|
60
|
+
*/
|
|
61
|
+
notes?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Asset credits.
|
|
64
|
+
*/
|
|
65
|
+
credits?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Asset alt text.
|
|
68
|
+
*/
|
|
69
|
+
alt?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Asset tags.
|
|
72
|
+
*/
|
|
73
|
+
tags?: AssetTag[];
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
origin_url?: string;
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
uploader_id?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
search_highlight?: {
|
|
86
|
+
filename?: string[];
|
|
87
|
+
notes?: string[];
|
|
88
|
+
credits?: string[];
|
|
89
|
+
alt?: string[];
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Available query parameters when querying assets from the Asset API.
|
|
94
|
+
*
|
|
95
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
96
|
+
*/
|
|
97
|
+
export type GetAssetsParams = {
|
|
98
|
+
/**
|
|
99
|
+
* Number of items to return.
|
|
100
|
+
*/
|
|
101
|
+
pageSize?: number;
|
|
102
|
+
/**
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
cursor?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Asset type to filter by.
|
|
108
|
+
*/
|
|
109
|
+
assetType?: (typeof AssetType)[keyof typeof AssetType];
|
|
110
|
+
/**
|
|
111
|
+
* Search query.
|
|
112
|
+
*/
|
|
113
|
+
keyword?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Asset IDs to filter by.
|
|
116
|
+
*/
|
|
117
|
+
ids?: string[];
|
|
118
|
+
/**
|
|
119
|
+
* Asset tags to filter by.
|
|
120
|
+
*/
|
|
121
|
+
tags?: string[];
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* An object representing the result of querying assets from the Asset API.
|
|
125
|
+
*
|
|
126
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
127
|
+
*/
|
|
128
|
+
export type GetAssetsResult = {
|
|
129
|
+
items: Asset[];
|
|
130
|
+
total: number;
|
|
131
|
+
cursor?: string;
|
|
132
|
+
missing_ids?: string[];
|
|
133
|
+
is_opensearch_result: boolean;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Parameters for uploading an asset to the Asset API.
|
|
137
|
+
*
|
|
138
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
139
|
+
*/
|
|
140
|
+
export type PostAssetParams = {
|
|
141
|
+
file: BlobPart;
|
|
142
|
+
notes?: string;
|
|
143
|
+
credits?: string;
|
|
144
|
+
alt?: string;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Result of uploading an asset to the Asset API.
|
|
148
|
+
*
|
|
149
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
150
|
+
*/
|
|
151
|
+
export type PostAssetResult = Asset;
|
|
152
|
+
/**
|
|
153
|
+
* Parameters for updating an asset in the Asset API.
|
|
154
|
+
*
|
|
155
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
156
|
+
*/
|
|
157
|
+
export type PatchAssetParams = {
|
|
158
|
+
notes?: string;
|
|
159
|
+
credits?: string;
|
|
160
|
+
alt?: string;
|
|
161
|
+
filename?: string;
|
|
162
|
+
tags?: string[];
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Result of updating an asset in the Asset API.
|
|
166
|
+
*
|
|
167
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
168
|
+
*/
|
|
169
|
+
export type PatchAssetResult = Asset;
|
|
170
|
+
/**
|
|
171
|
+
* Parameters for deleting an asset from the Asset API.
|
|
172
|
+
*
|
|
173
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
174
|
+
*/
|
|
175
|
+
export type BulkDeleteAssetsParams = {
|
|
176
|
+
ids: string[];
|
|
177
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object representing an tag used by the Asset API.
|
|
3
|
+
*
|
|
4
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
5
|
+
*/
|
|
6
|
+
export type AssetTag = {
|
|
7
|
+
/**
|
|
8
|
+
* Tag ID.
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Tag name.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Tag creation date.
|
|
17
|
+
*/
|
|
18
|
+
created_at: number;
|
|
19
|
+
/**
|
|
20
|
+
* Tag last modification date.
|
|
21
|
+
*/
|
|
22
|
+
last_modified: number;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
uploader_id?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Number of assets tagged with this tag.
|
|
29
|
+
*/
|
|
30
|
+
count?: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* An object representing the result of querying tags from the Asset API.
|
|
34
|
+
*
|
|
35
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
36
|
+
*/
|
|
37
|
+
export type GetAssetTagsResult = {
|
|
38
|
+
items: AssetTag[];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Parameters for creating a tag in the Asset API.
|
|
42
|
+
*
|
|
43
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
44
|
+
*/
|
|
45
|
+
export type PostAssetTagParams = {
|
|
46
|
+
name: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Result of creating a tag in the Asset API.
|
|
50
|
+
*
|
|
51
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
52
|
+
*/
|
|
53
|
+
export type PostAssetTagResult = AssetTag;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IntegrationFieldData } from "../value/integration.js";
|
|
2
|
+
/**
|
|
3
|
+
* A catalog item from an integration field.
|
|
4
|
+
*
|
|
5
|
+
* @typeParam TData - The data shape for the catalog item.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link https://prismic.io/docs/fields/integration#create-an-integration-catalog}
|
|
8
|
+
*/
|
|
9
|
+
export type IntegrationAPIItem<TData extends IntegrationFieldData = IntegrationFieldData> = {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
image_url?: string;
|
|
14
|
+
last_update?: number;
|
|
15
|
+
blob: TData;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Response payload from a custom integration catalog API. Contains an array of
|
|
19
|
+
* catalog items and the total count.
|
|
20
|
+
*
|
|
21
|
+
* @typeParam TData - The shape of each catalog item's data.
|
|
22
|
+
*
|
|
23
|
+
* @see {@link https://prismic.io/docs/fields/integration#create-an-integration-catalog}
|
|
24
|
+
*/
|
|
25
|
+
export type IntegrationAPIResults<TData extends IntegrationFieldData = IntegrationFieldData> = {
|
|
26
|
+
results_size: number;
|
|
27
|
+
results: IntegrationAPIItem<TData>[];
|
|
28
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { PrismicDocument, PrismicDocumentWithUID } from "../../value/document.js";
|
|
2
|
+
/**
|
|
3
|
+
* An object representing the parameters required when creating a document
|
|
4
|
+
* through the Migration API.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam TDocument - Type of the Prismic document to create.
|
|
7
|
+
*
|
|
8
|
+
* @see Prismic Migration API technical reference: {@link https://prismic.io/docs/migration-api-technical-reference}
|
|
9
|
+
*/
|
|
10
|
+
export type PostDocumentParams<TDocument extends PrismicDocument = PrismicDocument> = TDocument extends PrismicDocument<infer TData, infer TType, infer TLang> ? {
|
|
11
|
+
title: string;
|
|
12
|
+
type: TType;
|
|
13
|
+
lang: TLang;
|
|
14
|
+
alternate_language_id?: string;
|
|
15
|
+
tags?: string[];
|
|
16
|
+
data: TData | Record<string, never>;
|
|
17
|
+
} & (TDocument extends PrismicDocumentWithUID ? {
|
|
18
|
+
uid: TDocument["uid"];
|
|
19
|
+
} : {
|
|
20
|
+
uid?: TDocument["uid"];
|
|
21
|
+
}) : never;
|
|
22
|
+
/**
|
|
23
|
+
* Result of creating a document with the Migration API.
|
|
24
|
+
*
|
|
25
|
+
* @typeParam TDocument - Type of the created Prismic document.
|
|
26
|
+
*
|
|
27
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
28
|
+
*/
|
|
29
|
+
export type PostDocumentResult<TDocument extends PrismicDocument = PrismicDocument> = TDocument extends PrismicDocument<infer _TData, infer TType, infer TLang> ? {
|
|
30
|
+
title: string;
|
|
31
|
+
id: string;
|
|
32
|
+
type: TType;
|
|
33
|
+
lang: TLang;
|
|
34
|
+
} & (TDocument["uid"] extends string ? {
|
|
35
|
+
uid: TDocument["uid"];
|
|
36
|
+
} : {
|
|
37
|
+
uid?: TDocument["uid"];
|
|
38
|
+
}) : never;
|
|
39
|
+
/**
|
|
40
|
+
* An object representing the parameters required when updating a document
|
|
41
|
+
* through the Migration API.
|
|
42
|
+
*
|
|
43
|
+
* @typeParam TDocument - Type of the Prismic document to update.
|
|
44
|
+
*
|
|
45
|
+
* @see Prismic Migration API technical reference: {@link https://prismic.io/docs/migration-api-technical-reference}
|
|
46
|
+
*/
|
|
47
|
+
export type PutDocumentParams<TDocument extends PrismicDocument = PrismicDocument> = {
|
|
48
|
+
title?: string;
|
|
49
|
+
uid?: string;
|
|
50
|
+
tags?: string[];
|
|
51
|
+
data: TDocument["data"] | Record<string, never>;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Result of updating a document with the Migration API.
|
|
55
|
+
*
|
|
56
|
+
* @typeParam TDocument - Type of the updated Prismic document.
|
|
57
|
+
*
|
|
58
|
+
* @see Prismic Asset API technical reference: {@link https://prismic.io/docs/asset-api-technical-reference}
|
|
59
|
+
*/
|
|
60
|
+
export type PutDocumentResult<TDocument extends PrismicDocument = PrismicDocument> = PostDocumentResult<TDocument>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PrismicDocument } from "../value/document.js";
|
|
2
|
+
/**
|
|
3
|
+
* A query response from the Prismic REST API V2. The response contains
|
|
4
|
+
* paginated metadata and a list of matching results for the query.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam Document - The type(s) of Prismic document that can be returned.
|
|
7
|
+
*
|
|
8
|
+
* @see More details on querying: {@link https://prismic.io/docs/api}
|
|
9
|
+
*/
|
|
10
|
+
export interface Query<Document extends PrismicDocument = PrismicDocument> {
|
|
11
|
+
/**
|
|
12
|
+
* The page number for this page of results.
|
|
13
|
+
*/
|
|
14
|
+
page: number;
|
|
15
|
+
/**
|
|
16
|
+
* Maximum number of results per page.
|
|
17
|
+
*/
|
|
18
|
+
results_per_page: number;
|
|
19
|
+
/**
|
|
20
|
+
* Number of results in this page.
|
|
21
|
+
*/
|
|
22
|
+
results_size: number;
|
|
23
|
+
/**
|
|
24
|
+
* Total number of results within all pages.
|
|
25
|
+
*/
|
|
26
|
+
total_results_size: number;
|
|
27
|
+
/**
|
|
28
|
+
* Total number of pages.
|
|
29
|
+
*/
|
|
30
|
+
total_pages: number;
|
|
31
|
+
/**
|
|
32
|
+
* The Prismic REST API V2 URL to the next page, if one exists.
|
|
33
|
+
*/
|
|
34
|
+
next_page: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* The Prismic REST API V2 URL to the previous page, if one exists.
|
|
37
|
+
*/
|
|
38
|
+
prev_page: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* A paginated list of documents matching the query.
|
|
41
|
+
*/
|
|
42
|
+
results: Document[];
|
|
43
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata for a reference to a version of a repository's content.
|
|
3
|
+
*
|
|
4
|
+
* @see More details on refs: {@link https://prismic.io/docs/api#refs-and-the-entry-api}
|
|
5
|
+
*/
|
|
6
|
+
export interface Ref {
|
|
7
|
+
/**
|
|
8
|
+
* The unique identifier for the ref.
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* The identifier that should be provided to the API to select a content
|
|
13
|
+
* version.
|
|
14
|
+
*/
|
|
15
|
+
ref: string;
|
|
16
|
+
/**
|
|
17
|
+
* A human-readable name for the ref. The master ref is always named "Master".
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* Determines if the ref is the master ref. The master ref contains the latest
|
|
22
|
+
* published content.
|
|
23
|
+
*/
|
|
24
|
+
isMasterRef: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* If the ref is associated with a Release, this field contains the timestamp
|
|
27
|
+
* at which the Release will be automatically published, if set.
|
|
28
|
+
*
|
|
29
|
+
* @see More details on Releases: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
|
|
30
|
+
*/
|
|
31
|
+
scheduledAt?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Ref } from "./ref.js";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata for a Release.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This is an alias for `Ref`.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link Ref}
|
|
9
|
+
* @see More details on Releases: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
|
|
10
|
+
*/
|
|
11
|
+
export type Release = Ref;
|