@prismicio/client 7.21.0-alpha.2 → 7.21.0-canary.333cd77
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 +1040 -0
- package/dist/Client.cjs.map +1 -0
- package/dist/Client.d.cts +797 -0
- package/dist/Client.d.cts.map +1 -0
- package/dist/Client.d.ts +797 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +1040 -0
- package/dist/Client.js.map +1 -0
- package/dist/Migration.cjs +284 -0
- package/dist/Migration.cjs.map +1 -0
- package/dist/Migration.d.cts +216 -0
- package/dist/Migration.d.cts.map +1 -0
- package/dist/Migration.d.ts +216 -0
- package/dist/Migration.d.ts.map +1 -0
- package/dist/Migration.js +284 -0
- package/dist/Migration.js.map +1 -0
- package/dist/WriteClient.cjs +488 -0
- package/dist/WriteClient.cjs.map +1 -0
- package/dist/WriteClient.d.cts +262 -0
- package/dist/WriteClient.d.cts.map +1 -0
- package/dist/WriteClient.d.ts +262 -0
- package/dist/WriteClient.d.ts.map +1 -0
- package/dist/WriteClient.js +488 -0
- package/dist/WriteClient.js.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +14 -0
- package/dist/_virtual/rolldown_runtime.js +13 -0
- package/dist/buildQueryURL.cjs +96 -0
- package/dist/buildQueryURL.cjs.map +1 -0
- package/dist/buildQueryURL.d.cts +220 -0
- package/dist/buildQueryURL.d.cts.map +1 -0
- package/dist/buildQueryURL.d.ts +220 -0
- package/dist/buildQueryURL.d.ts.map +1 -0
- package/dist/buildQueryURL.js +96 -0
- package/dist/buildQueryURL.js.map +1 -0
- package/dist/cookie.cjs +19 -0
- package/dist/cookie.cjs.map +1 -0
- package/dist/cookie.d.cts +11 -0
- package/dist/cookie.d.cts.map +1 -0
- package/dist/cookie.d.ts +11 -0
- package/dist/cookie.d.ts.map +1 -0
- package/dist/cookie.js +13 -0
- package/dist/cookie.js.map +1 -0
- package/dist/createClient.cjs +33 -0
- package/dist/createClient.cjs.map +1 -0
- package/dist/createClient.d.cts +41 -0
- package/dist/createClient.d.cts.map +1 -0
- package/dist/createClient.d.ts +41 -0
- package/dist/createClient.d.ts.map +1 -0
- package/dist/createClient.js +33 -0
- package/dist/createClient.js.map +1 -0
- package/dist/createMigration.cjs +22 -0
- package/dist/createMigration.cjs.map +1 -0
- package/dist/createMigration.d.cts +30 -0
- package/dist/createMigration.d.cts.map +1 -0
- package/dist/createMigration.d.ts +30 -0
- package/dist/createMigration.d.ts.map +1 -0
- package/dist/createMigration.js +22 -0
- package/dist/createMigration.js.map +1 -0
- package/dist/createWriteClient.cjs +30 -0
- package/dist/createWriteClient.cjs.map +1 -0
- package/dist/createWriteClient.d.cts +38 -0
- package/dist/createWriteClient.d.cts.map +1 -0
- package/dist/createWriteClient.d.ts +38 -0
- package/dist/createWriteClient.d.ts.map +1 -0
- package/dist/createWriteClient.js +30 -0
- package/dist/createWriteClient.js.map +1 -0
- package/dist/errors/ForbiddenError.cjs +8 -0
- package/dist/errors/ForbiddenError.cjs.map +1 -0
- package/dist/errors/ForbiddenError.d.cts +14 -0
- package/dist/errors/ForbiddenError.d.cts.map +1 -0
- package/dist/errors/ForbiddenError.d.ts +14 -0
- package/dist/errors/ForbiddenError.d.ts.map +1 -0
- package/dist/errors/ForbiddenError.js +8 -0
- package/dist/errors/ForbiddenError.js.map +1 -0
- package/dist/errors/InvalidDataError.cjs +8 -0
- package/dist/errors/InvalidDataError.cjs.map +1 -0
- package/dist/errors/InvalidDataError.d.cts +7 -0
- package/dist/errors/InvalidDataError.d.cts.map +1 -0
- package/dist/errors/InvalidDataError.d.ts +7 -0
- package/dist/errors/InvalidDataError.d.ts.map +1 -0
- package/dist/errors/InvalidDataError.js +8 -0
- package/dist/errors/InvalidDataError.js.map +1 -0
- package/dist/errors/NotFoundError.cjs +8 -0
- package/dist/errors/NotFoundError.cjs.map +1 -0
- package/dist/errors/NotFoundError.d.cts +7 -0
- package/dist/errors/NotFoundError.d.cts.map +1 -0
- package/dist/errors/NotFoundError.d.ts +7 -0
- package/dist/errors/NotFoundError.d.ts.map +1 -0
- package/dist/errors/NotFoundError.js +8 -0
- package/dist/errors/NotFoundError.js.map +1 -0
- package/dist/errors/ParsingError.cjs +8 -0
- package/dist/errors/ParsingError.cjs.map +1 -0
- package/dist/errors/ParsingError.d.cts +17 -0
- package/dist/errors/ParsingError.d.cts.map +1 -0
- package/dist/errors/ParsingError.d.ts +17 -0
- package/dist/errors/ParsingError.d.ts.map +1 -0
- package/dist/errors/ParsingError.js +8 -0
- package/dist/errors/ParsingError.js.map +1 -0
- package/dist/errors/PreviewTokenExpired.cjs +8 -0
- package/dist/errors/PreviewTokenExpired.cjs.map +1 -0
- package/dist/errors/PreviewTokenExpired.d.cts +11 -0
- package/dist/errors/PreviewTokenExpired.d.cts.map +1 -0
- package/dist/errors/PreviewTokenExpired.d.ts +11 -0
- package/dist/errors/PreviewTokenExpired.d.ts.map +1 -0
- package/dist/errors/PreviewTokenExpired.js +8 -0
- package/dist/errors/PreviewTokenExpired.js.map +1 -0
- package/dist/errors/PrismicError.cjs +15 -0
- package/dist/errors/PrismicError.cjs.map +1 -0
- package/dist/errors/PrismicError.d.cts +9 -0
- package/dist/errors/PrismicError.d.cts.map +1 -0
- package/dist/errors/PrismicError.d.ts +9 -0
- package/dist/errors/PrismicError.d.ts.map +1 -0
- package/dist/errors/PrismicError.js +14 -0
- package/dist/errors/PrismicError.js.map +1 -0
- package/dist/errors/RefExpiredError.cjs +8 -0
- package/dist/errors/RefExpiredError.cjs.map +1 -0
- package/dist/errors/RefExpiredError.d.cts +11 -0
- package/dist/errors/RefExpiredError.d.cts.map +1 -0
- package/dist/errors/RefExpiredError.d.ts +11 -0
- package/dist/errors/RefExpiredError.d.ts.map +1 -0
- package/dist/errors/RefExpiredError.js +8 -0
- package/dist/errors/RefExpiredError.js.map +1 -0
- package/dist/errors/RefNotFoundError.cjs +8 -0
- package/dist/errors/RefNotFoundError.cjs.map +1 -0
- package/dist/errors/RefNotFoundError.d.cts +11 -0
- package/dist/errors/RefNotFoundError.d.cts.map +1 -0
- package/dist/errors/RefNotFoundError.d.ts +11 -0
- package/dist/errors/RefNotFoundError.d.ts.map +1 -0
- package/dist/errors/RefNotFoundError.js +8 -0
- package/dist/errors/RefNotFoundError.js.map +1 -0
- package/dist/errors/RepositoryNotFoundError.cjs +8 -0
- package/dist/errors/RepositoryNotFoundError.cjs.map +1 -0
- package/dist/errors/RepositoryNotFoundError.d.cts +7 -0
- package/dist/errors/RepositoryNotFoundError.d.cts.map +1 -0
- package/dist/errors/RepositoryNotFoundError.d.ts +7 -0
- package/dist/errors/RepositoryNotFoundError.d.ts.map +1 -0
- package/dist/errors/RepositoryNotFoundError.js +8 -0
- package/dist/errors/RepositoryNotFoundError.js.map +1 -0
- package/dist/filter.cjs +104 -0
- package/dist/filter.cjs.map +1 -0
- package/dist/filter.d.cts +213 -0
- package/dist/filter.d.cts.map +1 -0
- package/dist/filter.d.ts +213 -0
- package/dist/filter.d.ts.map +1 -0
- package/dist/filter.js +103 -0
- package/dist/filter.js.map +1 -0
- package/dist/getGraphQLEndpoint.cjs +21 -0
- package/dist/getGraphQLEndpoint.cjs.map +1 -0
- package/dist/getGraphQLEndpoint.d.cts +14 -0
- package/dist/getGraphQLEndpoint.d.cts.map +1 -0
- package/dist/getGraphQLEndpoint.d.ts +14 -0
- package/dist/getGraphQLEndpoint.d.ts.map +1 -0
- package/dist/getGraphQLEndpoint.js +21 -0
- package/dist/getGraphQLEndpoint.js.map +1 -0
- package/dist/getRepositoryEndpoint.cjs +30 -0
- package/dist/getRepositoryEndpoint.cjs.map +1 -0
- package/dist/getRepositoryEndpoint.d.cts +23 -0
- package/dist/getRepositoryEndpoint.d.cts.map +1 -0
- package/dist/getRepositoryEndpoint.d.ts +23 -0
- package/dist/getRepositoryEndpoint.d.ts.map +1 -0
- package/dist/getRepositoryEndpoint.js +30 -0
- package/dist/getRepositoryEndpoint.js.map +1 -0
- package/dist/getRepositoryName.cjs +25 -0
- package/dist/getRepositoryName.cjs.map +1 -0
- package/dist/getRepositoryName.d.cts +16 -0
- package/dist/getRepositoryName.d.cts.map +1 -0
- package/dist/getRepositoryName.d.ts +16 -0
- package/dist/getRepositoryName.d.ts.map +1 -0
- package/dist/getRepositoryName.js +25 -0
- package/dist/getRepositoryName.js.map +1 -0
- package/dist/getToolbarSrc.cjs +45 -0
- package/dist/getToolbarSrc.cjs.map +1 -0
- package/dist/getToolbarSrc.d.cts +38 -0
- package/dist/getToolbarSrc.d.cts.map +1 -0
- package/dist/getToolbarSrc.d.ts +38 -0
- package/dist/getToolbarSrc.d.ts.map +1 -0
- package/dist/getToolbarSrc.js +45 -0
- package/dist/getToolbarSrc.js.map +1 -0
- package/dist/helpers/asDate.cjs +39 -0
- package/dist/helpers/asDate.cjs.map +1 -0
- package/dist/helpers/asDate.d.cts +29 -0
- package/dist/helpers/asDate.d.cts.map +1 -0
- package/dist/helpers/asDate.d.ts +29 -0
- package/dist/helpers/asDate.d.ts.map +1 -0
- package/dist/helpers/asDate.js +38 -0
- package/dist/helpers/asDate.js.map +1 -0
- package/dist/helpers/asHTML.cjs +83 -0
- package/dist/helpers/asHTML.cjs.map +1 -0
- package/dist/helpers/asHTML.d.cts +147 -0
- package/dist/helpers/asHTML.d.cts.map +1 -0
- package/dist/helpers/asHTML.d.ts +147 -0
- package/dist/helpers/asHTML.d.ts.map +1 -0
- package/dist/helpers/asHTML.js +83 -0
- package/dist/helpers/asHTML.js.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +60 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts +59 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +59 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js +60 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -0
- package/dist/helpers/asImageSrc.cjs +33 -0
- package/dist/helpers/asImageSrc.cjs.map +1 -0
- package/dist/helpers/asImageSrc.d.cts +34 -0
- package/dist/helpers/asImageSrc.d.cts.map +1 -0
- package/dist/helpers/asImageSrc.d.ts +34 -0
- package/dist/helpers/asImageSrc.d.ts.map +1 -0
- package/dist/helpers/asImageSrc.js +33 -0
- package/dist/helpers/asImageSrc.js.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.cjs +79 -0
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.d.cts +67 -0
- package/dist/helpers/asImageWidthSrcSet.d.cts.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.d.ts +67 -0
- package/dist/helpers/asImageWidthSrcSet.d.ts.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.js +79 -0
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -0
- package/dist/helpers/asLink.cjs +29 -0
- package/dist/helpers/asLink.cjs.map +1 -0
- package/dist/helpers/asLink.d.cts +83 -0
- package/dist/helpers/asLink.d.cts.map +1 -0
- package/dist/helpers/asLink.d.ts +83 -0
- package/dist/helpers/asLink.d.ts.map +1 -0
- package/dist/helpers/asLink.js +29 -0
- package/dist/helpers/asLink.js.map +1 -0
- package/dist/helpers/asLinkAttrs.cjs +47 -0
- package/dist/helpers/asLinkAttrs.cjs.map +1 -0
- package/dist/helpers/asLinkAttrs.d.cts +51 -0
- package/dist/helpers/asLinkAttrs.d.cts.map +1 -0
- package/dist/helpers/asLinkAttrs.d.ts +51 -0
- package/dist/helpers/asLinkAttrs.d.ts.map +1 -0
- package/dist/helpers/asLinkAttrs.js +47 -0
- package/dist/helpers/asLinkAttrs.js.map +1 -0
- package/dist/helpers/asText.cjs +16 -0
- package/dist/helpers/asText.cjs.map +1 -0
- package/dist/helpers/asText.d.cts +62 -0
- package/dist/helpers/asText.d.cts.map +1 -0
- package/dist/helpers/asText.d.ts +62 -0
- package/dist/helpers/asText.d.ts.map +1 -0
- package/dist/helpers/asText.js +16 -0
- package/dist/helpers/asText.js.map +1 -0
- package/dist/helpers/documentToLinkField.cjs +33 -0
- package/dist/helpers/documentToLinkField.cjs.map +1 -0
- package/dist/helpers/documentToLinkField.d.cts +21 -0
- package/dist/helpers/documentToLinkField.d.cts.map +1 -0
- package/dist/helpers/documentToLinkField.d.ts +21 -0
- package/dist/helpers/documentToLinkField.d.ts.map +1 -0
- package/dist/helpers/documentToLinkField.js +33 -0
- package/dist/helpers/documentToLinkField.js.map +1 -0
- package/dist/helpers/isFilled.cjs +250 -0
- package/dist/helpers/isFilled.cjs.map +1 -0
- package/dist/helpers/isFilled.d.cts +199 -0
- package/dist/helpers/isFilled.d.cts.map +1 -0
- package/dist/helpers/isFilled.d.ts +199 -0
- package/dist/helpers/isFilled.d.ts.map +1 -0
- package/dist/helpers/isFilled.js +243 -0
- package/dist/helpers/isFilled.js.map +1 -0
- package/dist/helpers/mapSliceZone.cjs +53 -0
- package/dist/helpers/mapSliceZone.cjs.map +1 -0
- package/dist/helpers/mapSliceZone.d.cts +139 -0
- package/dist/helpers/mapSliceZone.d.cts.map +1 -0
- package/dist/helpers/mapSliceZone.d.ts +139 -0
- package/dist/helpers/mapSliceZone.d.ts.map +1 -0
- package/dist/helpers/mapSliceZone.js +52 -0
- package/dist/helpers/mapSliceZone.js.map +1 -0
- package/dist/index.cjs +117 -3882
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +151 -4394
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +151 -4394
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/isRepositoryEndpoint.cjs +23 -0
- package/dist/isRepositoryEndpoint.cjs.map +1 -0
- package/dist/isRepositoryEndpoint.d.cts +14 -0
- package/dist/isRepositoryEndpoint.d.cts.map +1 -0
- package/dist/isRepositoryEndpoint.d.ts +14 -0
- package/dist/isRepositoryEndpoint.d.ts.map +1 -0
- package/dist/isRepositoryEndpoint.js +22 -0
- package/dist/isRepositoryEndpoint.js.map +1 -0
- package/dist/isRepositoryName.cjs +17 -0
- package/dist/isRepositoryName.cjs.map +1 -0
- package/dist/isRepositoryName.d.cts +13 -0
- package/dist/isRepositoryName.d.cts.map +1 -0
- package/dist/isRepositoryName.d.ts +13 -0
- package/dist/isRepositoryName.d.ts.map +1 -0
- package/dist/isRepositoryName.js +16 -0
- package/dist/isRepositoryName.js.map +1 -0
- package/dist/lib/appendFilters.cjs +24 -0
- package/dist/lib/appendFilters.cjs.map +1 -0
- package/dist/lib/appendFilters.js +24 -0
- package/dist/lib/appendFilters.js.map +1 -0
- package/dist/lib/castArray.cjs +20 -0
- package/dist/lib/castArray.cjs.map +1 -0
- package/dist/lib/castArray.js +19 -0
- package/dist/lib/castArray.js.map +1 -0
- package/dist/lib/castThunk.cjs +19 -0
- package/dist/lib/castThunk.cjs.map +1 -0
- package/dist/lib/castThunk.js +18 -0
- package/dist/lib/castThunk.js.map +1 -0
- package/dist/lib/devMsg.cjs +25 -0
- package/dist/lib/devMsg.cjs.map +1 -0
- package/dist/lib/devMsg.js +25 -0
- package/dist/lib/devMsg.js.map +1 -0
- package/dist/lib/escapeHTML.cjs +40 -0
- package/dist/lib/escapeHTML.cjs.map +1 -0
- package/dist/lib/escapeHTML.js +39 -0
- package/dist/lib/escapeHTML.js.map +1 -0
- package/dist/lib/everyTagFilter.cjs +19 -0
- package/dist/lib/everyTagFilter.cjs.map +1 -0
- package/dist/lib/everyTagFilter.js +19 -0
- package/dist/lib/everyTagFilter.js.map +1 -0
- package/dist/lib/findMasterRef.cjs +19 -0
- package/dist/lib/findMasterRef.cjs.map +1 -0
- package/dist/lib/findMasterRef.js +19 -0
- package/dist/lib/findMasterRef.js.map +1 -0
- package/dist/lib/findRef.cjs +24 -0
- package/dist/lib/findRef.cjs.map +1 -0
- package/dist/lib/findRef.js +24 -0
- package/dist/lib/findRef.js.map +1 -0
- package/dist/lib/findRefByID.cjs +20 -0
- package/dist/lib/findRefByID.cjs.map +1 -0
- package/dist/lib/findRefByID.js +20 -0
- package/dist/lib/findRefByID.js.map +1 -0
- package/dist/lib/findRefByLabel.cjs +20 -0
- package/dist/lib/findRefByLabel.cjs.map +1 -0
- package/dist/lib/findRefByLabel.js +20 -0
- package/dist/lib/findRefByLabel.js.map +1 -0
- package/dist/lib/getOptionalLinkProperties.cjs +22 -0
- package/dist/lib/getOptionalLinkProperties.cjs.map +1 -0
- package/dist/lib/getOptionalLinkProperties.js +21 -0
- package/dist/lib/getOptionalLinkProperties.js.map +1 -0
- package/dist/lib/getPreviewCookie.cjs +30 -0
- package/dist/lib/getPreviewCookie.cjs.map +1 -0
- package/dist/lib/getPreviewCookie.js +30 -0
- package/dist/lib/getPreviewCookie.js.map +1 -0
- package/dist/lib/isInternalURL.cjs +18 -0
- package/dist/lib/isInternalURL.cjs.map +1 -0
- package/dist/lib/isInternalURL.js +17 -0
- package/dist/lib/isInternalURL.js.map +1 -0
- package/dist/lib/isMigrationValue.cjs +77 -0
- package/dist/lib/isMigrationValue.cjs.map +1 -0
- package/dist/lib/isMigrationValue.js +74 -0
- package/dist/lib/isMigrationValue.js.map +1 -0
- package/dist/lib/isValue.cjs +110 -0
- package/dist/lib/isValue.cjs.map +1 -0
- package/dist/lib/isValue.js +106 -0
- package/dist/lib/isValue.js.map +1 -0
- package/dist/lib/minifyGraphQLQuery.cjs +16 -0
- package/dist/lib/minifyGraphQLQuery.cjs.map +1 -0
- package/dist/lib/minifyGraphQLQuery.js +15 -0
- package/dist/lib/minifyGraphQLQuery.js.map +1 -0
- package/dist/lib/pLimit.cjs +55 -0
- package/dist/lib/pLimit.cjs.map +1 -0
- package/dist/lib/pLimit.js +54 -0
- package/dist/lib/pLimit.js.map +1 -0
- package/dist/lib/request.cjs +60 -0
- package/dist/lib/request.cjs.map +1 -0
- package/dist/lib/request.d.cts +61 -0
- package/dist/lib/request.d.cts.map +1 -0
- package/dist/lib/request.d.ts +61 -0
- package/dist/lib/request.d.ts.map +1 -0
- package/dist/lib/request.js +60 -0
- package/dist/lib/request.js.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.cjs +156 -0
- package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.js +155 -0
- package/dist/lib/resolveMigrationDocumentData.js.map +1 -0
- package/dist/lib/serializerHelpers.cjs +95 -0
- package/dist/lib/serializerHelpers.cjs.map +1 -0
- package/dist/lib/serializerHelpers.js +90 -0
- package/dist/lib/serializerHelpers.js.map +1 -0
- package/dist/lib/someTagsFilter.cjs +19 -0
- package/dist/lib/someTagsFilter.cjs.map +1 -0
- package/dist/lib/someTagsFilter.js +19 -0
- package/dist/lib/someTagsFilter.js.map +1 -0
- package/dist/lib/throttledLog.cjs +28 -0
- package/dist/lib/throttledLog.cjs.map +1 -0
- package/dist/lib/throttledLog.js +27 -0
- package/dist/lib/throttledLog.js.map +1 -0
- package/dist/lib/typeFilter.cjs +17 -0
- package/dist/lib/typeFilter.cjs.map +1 -0
- package/dist/lib/typeFilter.js +17 -0
- package/dist/lib/typeFilter.js.map +1 -0
- package/dist/lib/validateAssetMetadata.cjs +48 -0
- package/dist/lib/validateAssetMetadata.cjs.map +1 -0
- package/dist/lib/validateAssetMetadata.js +48 -0
- package/dist/lib/validateAssetMetadata.js.map +1 -0
- package/dist/package.cjs +19 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/richtext/asText.cjs +21 -0
- package/dist/richtext/asText.cjs.map +1 -0
- package/dist/richtext/asText.d.cts +18 -0
- package/dist/richtext/asText.d.cts.map +1 -0
- package/dist/richtext/asText.d.ts +18 -0
- package/dist/richtext/asText.d.ts.map +1 -0
- package/dist/richtext/asText.js +20 -0
- package/dist/richtext/asText.js.map +1 -0
- package/dist/richtext/asTree.cjs +122 -0
- package/dist/richtext/asTree.cjs.map +1 -0
- package/dist/richtext/asTree.d.cts +20 -0
- package/dist/richtext/asTree.d.cts.map +1 -0
- package/dist/richtext/asTree.d.ts +20 -0
- package/dist/richtext/asTree.d.ts.map +1 -0
- package/dist/richtext/asTree.js +122 -0
- package/dist/richtext/asTree.js.map +1 -0
- package/dist/richtext/composeSerializers.cjs +31 -0
- package/dist/richtext/composeSerializers.cjs.map +1 -0
- package/dist/richtext/composeSerializers.d.cts +22 -0
- package/dist/richtext/composeSerializers.d.cts.map +1 -0
- package/dist/richtext/composeSerializers.d.ts +22 -0
- package/dist/richtext/composeSerializers.d.ts.map +1 -0
- package/dist/richtext/composeSerializers.js +30 -0
- package/dist/richtext/composeSerializers.js.map +1 -0
- package/dist/richtext/serialize.cjs +35 -0
- package/dist/richtext/serialize.cjs.map +1 -0
- package/dist/richtext/serialize.d.cts +25 -0
- package/dist/richtext/serialize.d.cts.map +1 -0
- package/dist/richtext/serialize.d.ts +25 -0
- package/dist/richtext/serialize.d.ts.map +1 -0
- package/dist/richtext/serialize.js +35 -0
- package/dist/richtext/serialize.js.map +1 -0
- package/dist/richtext/types.cjs +13 -0
- package/dist/richtext/types.cjs.map +1 -0
- package/dist/richtext/types.d.cts +71 -0
- package/dist/richtext/types.d.cts.map +1 -0
- package/dist/richtext/types.d.ts +71 -0
- package/dist/richtext/types.d.ts.map +1 -0
- package/dist/richtext/types.js +13 -0
- package/dist/richtext/types.js.map +1 -0
- package/dist/richtext/wrapMapSerializer.cjs +32 -0
- package/dist/richtext/wrapMapSerializer.cjs.map +1 -0
- package/dist/richtext/wrapMapSerializer.d.cts +21 -0
- package/dist/richtext/wrapMapSerializer.d.cts.map +1 -0
- package/dist/richtext/wrapMapSerializer.d.ts +21 -0
- package/dist/richtext/wrapMapSerializer.d.ts.map +1 -0
- package/dist/richtext/wrapMapSerializer.js +32 -0
- package/dist/richtext/wrapMapSerializer.js.map +1 -0
- package/dist/richtext.cjs +13 -0
- package/dist/richtext.d.cts +8 -0
- package/dist/richtext.d.ts +8 -0
- package/dist/richtext.js +8 -0
- package/dist/types/api/asset/asset.d.cts +97 -0
- package/dist/types/api/asset/asset.d.cts.map +1 -0
- package/dist/types/api/asset/asset.d.ts +97 -0
- package/dist/types/api/asset/asset.d.ts.map +1 -0
- package/dist/types/api/asset/tag.d.cts +35 -0
- package/dist/types/api/asset/tag.d.cts.map +1 -0
- package/dist/types/api/asset/tag.d.ts +35 -0
- package/dist/types/api/asset/tag.d.ts.map +1 -0
- package/dist/types/api/integration.d.cts +34 -0
- package/dist/types/api/integration.d.cts.map +1 -0
- package/dist/types/api/integration.d.ts +34 -0
- package/dist/types/api/integration.d.ts.map +1 -0
- package/dist/types/api/query.d.cts +49 -0
- package/dist/types/api/query.d.cts.map +1 -0
- package/dist/types/api/query.d.ts +49 -0
- package/dist/types/api/query.d.ts.map +1 -0
- package/dist/types/api/ref.d.cts +36 -0
- package/dist/types/api/ref.d.cts.map +1 -0
- package/dist/types/api/ref.d.ts +36 -0
- package/dist/types/api/ref.d.ts.map +1 -0
- package/dist/types/api/release.d.cts +17 -0
- package/dist/types/api/release.d.cts.map +1 -0
- package/dist/types/api/release.d.ts +17 -0
- package/dist/types/api/release.d.ts.map +1 -0
- package/dist/types/api/repository.d.cts +115 -0
- package/dist/types/api/repository.d.cts.map +1 -0
- package/dist/types/api/repository.d.ts +115 -0
- package/dist/types/api/repository.d.ts.map +1 -0
- package/dist/types/api/tags.d.cts +13 -0
- package/dist/types/api/tags.d.cts.map +1 -0
- package/dist/types/api/tags.d.ts +13 -0
- package/dist/types/api/tags.d.ts.map +1 -0
- package/dist/types/migration/Asset.cjs +35 -0
- package/dist/types/migration/Asset.cjs.map +1 -0
- package/dist/types/migration/Asset.d.cts +109 -0
- package/dist/types/migration/Asset.d.cts.map +1 -0
- package/dist/types/migration/Asset.d.ts +109 -0
- package/dist/types/migration/Asset.d.ts.map +1 -0
- package/dist/types/migration/Asset.js +34 -0
- package/dist/types/migration/Asset.js.map +1 -0
- package/dist/types/migration/ContentRelationship.d.cts +15 -0
- package/dist/types/migration/ContentRelationship.d.cts.map +1 -0
- package/dist/types/migration/ContentRelationship.d.ts +15 -0
- package/dist/types/migration/ContentRelationship.d.ts.map +1 -0
- package/dist/types/migration/Document.cjs +51 -0
- package/dist/types/migration/Document.cjs.map +1 -0
- package/dist/types/migration/Document.d.cts +97 -0
- package/dist/types/migration/Document.d.cts.map +1 -0
- package/dist/types/migration/Document.d.ts +97 -0
- package/dist/types/migration/Document.d.ts.map +1 -0
- package/dist/types/migration/Document.js +50 -0
- package/dist/types/migration/Document.js.map +1 -0
- package/dist/types/model/boolean.d.cts +21 -0
- package/dist/types/model/boolean.d.cts.map +1 -0
- package/dist/types/model/boolean.d.ts +21 -0
- package/dist/types/model/boolean.d.ts.map +1 -0
- package/dist/types/model/color.d.cts +19 -0
- package/dist/types/model/color.d.cts.map +1 -0
- package/dist/types/model/color.d.ts +19 -0
- package/dist/types/model/color.d.ts.map +1 -0
- package/dist/types/model/contentRelationship.d.cts +59 -0
- package/dist/types/model/contentRelationship.d.cts.map +1 -0
- package/dist/types/model/contentRelationship.d.ts +59 -0
- package/dist/types/model/contentRelationship.d.ts.map +1 -0
- package/dist/types/model/customType.d.cts +54 -0
- package/dist/types/model/customType.d.cts.map +1 -0
- package/dist/types/model/customType.d.ts +54 -0
- package/dist/types/model/customType.d.ts.map +1 -0
- package/dist/types/model/date.d.cts +20 -0
- package/dist/types/model/date.d.cts.map +1 -0
- package/dist/types/model/date.d.ts +20 -0
- package/dist/types/model/date.d.ts.map +1 -0
- package/dist/types/model/embed.d.cts +19 -0
- package/dist/types/model/embed.d.cts.map +1 -0
- package/dist/types/model/embed.d.ts +19 -0
- package/dist/types/model/embed.d.ts.map +1 -0
- package/dist/types/model/geoPoint.d.cts +18 -0
- package/dist/types/model/geoPoint.d.cts.map +1 -0
- package/dist/types/model/geoPoint.d.ts +18 -0
- package/dist/types/model/geoPoint.d.ts.map +1 -0
- package/dist/types/model/group.d.cts +29 -0
- package/dist/types/model/group.d.cts.map +1 -0
- package/dist/types/model/group.d.ts +29 -0
- package/dist/types/model/group.d.ts.map +1 -0
- package/dist/types/model/image.d.cts +37 -0
- package/dist/types/model/image.d.cts.map +1 -0
- package/dist/types/model/image.d.ts +37 -0
- package/dist/types/model/image.d.ts.map +1 -0
- package/dist/types/model/integration.d.cts +20 -0
- package/dist/types/model/integration.d.cts.map +1 -0
- package/dist/types/model/integration.d.ts +20 -0
- package/dist/types/model/integration.d.ts.map +1 -0
- package/dist/types/model/keyText.d.cts +19 -0
- package/dist/types/model/keyText.d.cts.map +1 -0
- package/dist/types/model/keyText.d.ts +19 -0
- package/dist/types/model/keyText.d.ts.map +1 -0
- package/dist/types/model/link.cjs +16 -0
- package/dist/types/model/link.cjs.map +1 -0
- package/dist/types/model/link.d.cts +34 -0
- package/dist/types/model/link.d.cts.map +1 -0
- package/dist/types/model/link.d.ts +34 -0
- package/dist/types/model/link.d.ts.map +1 -0
- package/dist/types/model/link.js +15 -0
- package/dist/types/model/link.js.map +1 -0
- package/dist/types/model/linkToMedia.d.cts +23 -0
- package/dist/types/model/linkToMedia.d.cts.map +1 -0
- package/dist/types/model/linkToMedia.d.ts +23 -0
- package/dist/types/model/linkToMedia.d.ts.map +1 -0
- package/dist/types/model/number.d.cts +21 -0
- package/dist/types/model/number.d.cts.map +1 -0
- package/dist/types/model/number.d.ts +21 -0
- package/dist/types/model/number.d.ts.map +1 -0
- package/dist/types/model/range.d.cts +20 -0
- package/dist/types/model/range.d.cts.map +1 -0
- package/dist/types/model/range.d.ts +20 -0
- package/dist/types/model/range.d.ts.map +1 -0
- package/dist/types/model/richText.d.cts +43 -0
- package/dist/types/model/richText.d.cts.map +1 -0
- package/dist/types/model/richText.d.ts +43 -0
- package/dist/types/model/richText.d.ts.map +1 -0
- package/dist/types/model/select.d.cts +24 -0
- package/dist/types/model/select.d.cts.map +1 -0
- package/dist/types/model/select.d.ts +24 -0
- package/dist/types/model/select.d.ts.map +1 -0
- package/dist/types/model/separator.d.cts +16 -0
- package/dist/types/model/separator.d.cts.map +1 -0
- package/dist/types/model/separator.d.ts +16 -0
- package/dist/types/model/separator.d.ts.map +1 -0
- package/dist/types/model/sharedSlice.d.cts +22 -0
- package/dist/types/model/sharedSlice.d.cts.map +1 -0
- package/dist/types/model/sharedSlice.d.ts +22 -0
- package/dist/types/model/sharedSlice.d.ts.map +1 -0
- package/dist/types/model/sharedSliceVariation.d.cts +25 -0
- package/dist/types/model/sharedSliceVariation.d.cts.map +1 -0
- package/dist/types/model/sharedSliceVariation.d.ts +25 -0
- package/dist/types/model/sharedSliceVariation.d.ts.map +1 -0
- package/dist/types/model/slice.cjs +15 -0
- package/dist/types/model/slice.cjs.map +1 -0
- package/dist/types/model/slice.d.cts +39 -0
- package/dist/types/model/slice.d.cts.map +1 -0
- package/dist/types/model/slice.d.ts +39 -0
- package/dist/types/model/slice.d.ts.map +1 -0
- package/dist/types/model/slice.js +14 -0
- package/dist/types/model/slice.js.map +1 -0
- package/dist/types/model/sliceZone.cjs +15 -0
- package/dist/types/model/sliceZone.cjs.map +1 -0
- package/dist/types/model/sliceZone.d.cts +47 -0
- package/dist/types/model/sliceZone.d.cts.map +1 -0
- package/dist/types/model/sliceZone.d.ts +47 -0
- package/dist/types/model/sliceZone.d.ts.map +1 -0
- package/dist/types/model/sliceZone.js +14 -0
- package/dist/types/model/sliceZone.js.map +1 -0
- package/dist/types/model/table.d.cts +18 -0
- package/dist/types/model/table.d.cts.map +1 -0
- package/dist/types/model/table.d.ts +18 -0
- package/dist/types/model/table.d.ts.map +1 -0
- package/dist/types/model/timestamp.d.cts +20 -0
- package/dist/types/model/timestamp.d.cts.map +1 -0
- package/dist/types/model/timestamp.d.ts +20 -0
- package/dist/types/model/timestamp.d.ts.map +1 -0
- package/dist/types/model/title.d.cts +13 -0
- package/dist/types/model/title.d.cts.map +1 -0
- package/dist/types/model/title.d.ts +13 -0
- package/dist/types/model/title.d.ts.map +1 -0
- package/dist/types/model/types.cjs +32 -0
- package/dist/types/model/types.cjs.map +1 -0
- package/dist/types/model/types.d.cts +82 -0
- package/dist/types/model/types.d.cts.map +1 -0
- package/dist/types/model/types.d.ts +82 -0
- package/dist/types/model/types.d.ts.map +1 -0
- package/dist/types/model/types.js +31 -0
- package/dist/types/model/types.js.map +1 -0
- package/dist/types/model/uid.d.cts +19 -0
- package/dist/types/model/uid.d.cts.map +1 -0
- package/dist/types/model/uid.d.ts +19 -0
- package/dist/types/model/uid.d.ts.map +1 -0
- package/dist/types/value/boolean.d.cts +10 -0
- package/dist/types/value/boolean.d.cts.map +1 -0
- package/dist/types/value/boolean.d.ts +10 -0
- package/dist/types/value/boolean.d.ts.map +1 -0
- package/dist/types/value/color.d.cts +15 -0
- package/dist/types/value/color.d.cts.map +1 -0
- package/dist/types/value/color.d.ts +15 -0
- package/dist/types/value/color.d.ts.map +1 -0
- package/dist/types/value/contentRelationship.d.cts +37 -0
- package/dist/types/value/contentRelationship.d.cts.map +1 -0
- package/dist/types/value/contentRelationship.d.ts +37 -0
- package/dist/types/value/contentRelationship.d.ts.map +1 -0
- package/dist/types/value/date.d.cts +15 -0
- package/dist/types/value/date.d.cts.map +1 -0
- package/dist/types/value/date.d.ts +15 -0
- package/dist/types/value/date.d.ts.map +1 -0
- package/dist/types/value/document.d.cts +120 -0
- package/dist/types/value/document.d.cts.map +1 -0
- package/dist/types/value/document.d.ts +120 -0
- package/dist/types/value/document.d.ts.map +1 -0
- package/dist/types/value/embed.cjs +17 -0
- package/dist/types/value/embed.cjs.map +1 -0
- package/dist/types/value/embed.d.cts +173 -0
- package/dist/types/value/embed.d.cts.map +1 -0
- package/dist/types/value/embed.d.ts +173 -0
- package/dist/types/value/embed.d.ts.map +1 -0
- package/dist/types/value/embed.js +16 -0
- package/dist/types/value/embed.js.map +1 -0
- package/dist/types/value/geoPoint.d.cts +18 -0
- package/dist/types/value/geoPoint.d.cts.map +1 -0
- package/dist/types/value/geoPoint.d.ts +18 -0
- package/dist/types/value/geoPoint.d.ts.map +1 -0
- package/dist/types/value/group.d.cts +19 -0
- package/dist/types/value/group.d.cts.map +1 -0
- package/dist/types/value/group.d.ts +19 -0
- package/dist/types/value/group.d.ts.map +1 -0
- package/dist/types/value/image.d.cts +53 -0
- package/dist/types/value/image.d.cts.map +1 -0
- package/dist/types/value/image.d.ts +53 -0
- package/dist/types/value/image.d.ts.map +1 -0
- package/dist/types/value/integration.d.cts +22 -0
- package/dist/types/value/integration.d.cts.map +1 -0
- package/dist/types/value/integration.d.ts +22 -0
- package/dist/types/value/integration.d.ts.map +1 -0
- package/dist/types/value/keyText.d.cts +15 -0
- package/dist/types/value/keyText.d.cts.map +1 -0
- package/dist/types/value/keyText.d.ts +15 -0
- package/dist/types/value/keyText.d.ts.map +1 -0
- package/dist/types/value/link.cjs +15 -0
- package/dist/types/value/link.cjs.map +1 -0
- package/dist/types/value/link.d.cts +74 -0
- package/dist/types/value/link.d.cts.map +1 -0
- package/dist/types/value/link.d.ts +74 -0
- package/dist/types/value/link.d.ts.map +1 -0
- package/dist/types/value/link.js +14 -0
- package/dist/types/value/link.js.map +1 -0
- package/dist/types/value/linkToMedia.d.cts +33 -0
- package/dist/types/value/linkToMedia.d.cts.map +1 -0
- package/dist/types/value/linkToMedia.d.ts +33 -0
- package/dist/types/value/linkToMedia.d.ts.map +1 -0
- package/dist/types/value/number.d.cts +15 -0
- package/dist/types/value/number.d.cts.map +1 -0
- package/dist/types/value/number.d.ts +15 -0
- package/dist/types/value/number.d.ts.map +1 -0
- package/dist/types/value/richText.cjs +32 -0
- package/dist/types/value/richText.cjs.map +1 -0
- package/dist/types/value/richText.d.cts +221 -0
- package/dist/types/value/richText.d.cts.map +1 -0
- package/dist/types/value/richText.d.ts +221 -0
- package/dist/types/value/richText.d.ts.map +1 -0
- package/dist/types/value/richText.js +31 -0
- package/dist/types/value/richText.js.map +1 -0
- package/dist/types/value/select.d.cts +16 -0
- package/dist/types/value/select.d.cts.map +1 -0
- package/dist/types/value/select.d.ts +16 -0
- package/dist/types/value/select.d.ts.map +1 -0
- package/dist/types/value/sharedSlice.d.cts +17 -0
- package/dist/types/value/sharedSlice.d.cts.map +1 -0
- package/dist/types/value/sharedSlice.d.ts +17 -0
- package/dist/types/value/sharedSlice.d.ts.map +1 -0
- package/dist/types/value/sharedSliceVariation.d.cts +16 -0
- package/dist/types/value/sharedSliceVariation.d.cts.map +1 -0
- package/dist/types/value/sharedSliceVariation.d.ts +16 -0
- package/dist/types/value/sharedSliceVariation.d.ts.map +1 -0
- package/dist/types/value/slice.d.cts +19 -0
- package/dist/types/value/slice.d.cts.map +1 -0
- package/dist/types/value/slice.d.ts +19 -0
- package/dist/types/value/slice.d.ts.map +1 -0
- package/dist/types/value/sliceZone.d.cts +18 -0
- package/dist/types/value/sliceZone.d.cts.map +1 -0
- package/dist/types/value/sliceZone.d.ts +18 -0
- package/dist/types/value/sliceZone.d.ts.map +1 -0
- package/dist/types/value/table.d.cts +97 -0
- package/dist/types/value/table.d.cts.map +1 -0
- package/dist/types/value/table.d.ts +97 -0
- package/dist/types/value/table.d.ts.map +1 -0
- package/dist/types/value/timestamp.d.cts +13 -0
- package/dist/types/value/timestamp.d.cts.map +1 -0
- package/dist/types/value/timestamp.d.ts +13 -0
- package/dist/types/value/timestamp.d.ts.map +1 -0
- package/dist/types/value/title.d.cts +16 -0
- package/dist/types/value/title.d.cts.map +1 -0
- package/dist/types/value/title.d.ts +16 -0
- package/dist/types/value/title.d.ts.map +1 -0
- package/dist/types/value/types.d.cts +61 -0
- package/dist/types/value/types.d.cts.map +1 -0
- package/dist/types/value/types.d.ts +61 -0
- package/dist/types/value/types.d.ts.map +1 -0
- package/dist/types/webhook/apiUpdate.d.cts +57 -0
- package/dist/types/webhook/apiUpdate.d.cts.map +1 -0
- package/dist/types/webhook/apiUpdate.d.ts +57 -0
- package/dist/types/webhook/apiUpdate.d.ts.map +1 -0
- package/dist/types/webhook/testTrigger.d.cts +15 -0
- package/dist/types/webhook/testTrigger.d.cts.map +1 -0
- package/dist/types/webhook/testTrigger.d.ts +15 -0
- package/dist/types/webhook/testTrigger.d.ts.map +1 -0
- package/dist/types/webhook/types.cjs +15 -0
- package/dist/types/webhook/types.cjs.map +1 -0
- package/dist/types/webhook/types.d.cts +23 -0
- package/dist/types/webhook/types.d.cts.map +1 -0
- package/dist/types/webhook/types.d.ts +23 -0
- package/dist/types/webhook/types.d.ts.map +1 -0
- package/dist/types/webhook/types.js +14 -0
- package/dist/types/webhook/types.js.map +1 -0
- package/package.json +29 -35
- package/src/Client.ts +223 -390
- package/src/WriteClient.ts +28 -36
- package/src/buildQueryURL.ts +4 -1
- package/src/createClient.ts +1 -1
- package/src/helpers/asHTML.ts +4 -4
- package/src/helpers/asImageWidthSrcSet.ts +1 -5
- package/src/helpers/asLink.ts +0 -3
- package/src/helpers/asLinkAttrs.ts +0 -4
- package/src/helpers/mapSliceZone.ts +5 -5
- package/src/index.ts +1 -0
- package/src/lib/isValue.ts +0 -6
- package/src/lib/pLimit.ts +1 -1
- package/src/lib/request.ts +3 -3
- package/src/lib/throttledLog.ts +0 -1
- package/src/types/migration/Document.ts +1 -1
- package/src/types/model/contentRelationship.ts +1 -0
- package/src/types/value/date.ts +1 -1
- package/src/types/value/document.ts +3 -3
- package/src/types/value/timestamp.ts +1 -5
- 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.d.ts +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,797 @@
|
|
|
1
|
+
import { PrismicDocument } from "./types/value/document.cjs";
|
|
2
|
+
import { LinkResolverFunction } from "./helpers/asLink.cjs";
|
|
3
|
+
import { AbortSignalLike, FetchLike, RequestInitLike } from "./lib/request.cjs";
|
|
4
|
+
import { Query } from "./types/api/query.cjs";
|
|
5
|
+
import { Ref } from "./types/api/ref.cjs";
|
|
6
|
+
import { Repository } from "./types/api/repository.cjs";
|
|
7
|
+
import { BuildQueryURLArgs } from "./buildQueryURL.cjs";
|
|
8
|
+
|
|
9
|
+
//#region src/Client.d.ts
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Extracts one or more Prismic document types that match a given Prismic
|
|
13
|
+
* document type. If no matches are found, no extraction is performed and the
|
|
14
|
+
* union of all provided Prismic document types are returned.
|
|
15
|
+
*
|
|
16
|
+
* @typeParam TDocuments - Prismic document types from which to extract.
|
|
17
|
+
* @typeParam TDocumentType - Type(s) to match `TDocuments` against.
|
|
18
|
+
*/
|
|
19
|
+
type ExtractDocumentType<TDocuments extends PrismicDocument, TDocumentType extends TDocuments["type"]> = Extract<TDocuments, {
|
|
20
|
+
type: TDocumentType;
|
|
21
|
+
}> extends never ? TDocuments : Extract<TDocuments, {
|
|
22
|
+
type: TDocumentType;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* The minimum required properties to treat as an HTTP Request for automatic
|
|
26
|
+
* Prismic preview support.
|
|
27
|
+
*/
|
|
28
|
+
type HttpRequestLike =
|
|
29
|
+
/**
|
|
30
|
+
* Web API Request
|
|
31
|
+
*
|
|
32
|
+
* @see http://developer.mozilla.org/en-US/docs/Web/API/Request
|
|
33
|
+
*/
|
|
34
|
+
{
|
|
35
|
+
headers?: {
|
|
36
|
+
get(name: string): string | null;
|
|
37
|
+
};
|
|
38
|
+
url?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Express-style Request
|
|
42
|
+
*/ | {
|
|
43
|
+
headers?: {
|
|
44
|
+
cookie?: string;
|
|
45
|
+
};
|
|
46
|
+
query?: Record<string, unknown>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* A ref or a function that returns a ref. If a static ref is known, one can be
|
|
50
|
+
* given. If the ref must be fetched on-demand, a function can be provided. This
|
|
51
|
+
* function can optionally be asynchronous.
|
|
52
|
+
*/
|
|
53
|
+
type RefStringOrThunk = string | (() => string | undefined | Promise<string | undefined>);
|
|
54
|
+
/**
|
|
55
|
+
* Parameters for any client method that use `fetch()`.
|
|
56
|
+
*/
|
|
57
|
+
type FetchParams = {
|
|
58
|
+
/**
|
|
59
|
+
* Options provided to the client's `fetch()` on all network requests. These
|
|
60
|
+
* options will be merged with internally required options. They can also be
|
|
61
|
+
* overriden on a per-query basis using the query's `fetchOptions` parameter.
|
|
62
|
+
*/
|
|
63
|
+
fetchOptions?: RequestInitLike;
|
|
64
|
+
/**
|
|
65
|
+
* An `AbortSignal` provided by an `AbortController`. This allows the network
|
|
66
|
+
* request to be cancelled if necessary.
|
|
67
|
+
*
|
|
68
|
+
* @deprecated Move the `signal` parameter into `fetchOptions.signal`:
|
|
69
|
+
*
|
|
70
|
+
* @see \<https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal\>
|
|
71
|
+
*/
|
|
72
|
+
signal?: AbortSignalLike;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Configuration for clients that determine how content is queried.
|
|
76
|
+
*/
|
|
77
|
+
type ClientConfig = {
|
|
78
|
+
/**
|
|
79
|
+
* The full Rest API V2 endpoint for the repository. This is only helpful if
|
|
80
|
+
* you're using Prismic behind a proxy which we do not recommend.
|
|
81
|
+
*
|
|
82
|
+
* @defaultValue `getRepositoryEndpoint(repositoryNameOrEndpoint)`
|
|
83
|
+
*/
|
|
84
|
+
documentAPIEndpoint?: string;
|
|
85
|
+
/**
|
|
86
|
+
* The secure token for accessing the Prismic repository. This is only
|
|
87
|
+
* required if the repository is set to private.
|
|
88
|
+
*/
|
|
89
|
+
accessToken?: string;
|
|
90
|
+
/**
|
|
91
|
+
* A string representing a version of the Prismic repository's content. This
|
|
92
|
+
* may point to the latest version (called the "master ref"), or a preview
|
|
93
|
+
* with draft content.
|
|
94
|
+
*/
|
|
95
|
+
ref?: RefStringOrThunk;
|
|
96
|
+
/**
|
|
97
|
+
* A list of route resolver objects that define how a document's `url`
|
|
98
|
+
* property is resolved.
|
|
99
|
+
*
|
|
100
|
+
* {@link https://prismic.io/docs/route-resolver}
|
|
101
|
+
*/
|
|
102
|
+
routes?: NonNullable<BuildQueryURLArgs["routes"]>;
|
|
103
|
+
/**
|
|
104
|
+
* The `brokenRoute` option allows you to define the route populated in the
|
|
105
|
+
* `url` property for broken link or content relationship fields. A broken
|
|
106
|
+
* link is a link or content relationship field whose linked document has been
|
|
107
|
+
* unpublished or deleted.
|
|
108
|
+
*
|
|
109
|
+
* {@link https://prismic.io/docs/route-resolver}
|
|
110
|
+
*/
|
|
111
|
+
brokenRoute?: NonNullable<BuildQueryURLArgs["brokenRoute"]>;
|
|
112
|
+
/**
|
|
113
|
+
* Default parameters that will be sent with each query. These parameters can
|
|
114
|
+
* be overridden on each query if needed.
|
|
115
|
+
*/
|
|
116
|
+
defaultParams?: Omit<BuildQueryURLArgs, "ref" | "integrationFieldsRef" | "accessToken" | "routes" | "brokenRoute">;
|
|
117
|
+
/**
|
|
118
|
+
* The function used to make network requests to the Prismic REST API. In
|
|
119
|
+
* environments where a global `fetch` function does not exist, such as
|
|
120
|
+
* Node.js, this function must be provided.
|
|
121
|
+
*/
|
|
122
|
+
fetch?: FetchLike;
|
|
123
|
+
/**
|
|
124
|
+
* Options provided to the client's `fetch()` on all network requests. These
|
|
125
|
+
* options will be merged with internally required options. They can also be
|
|
126
|
+
* overriden on a per-query basis using the query's `fetchOptions` parameter.
|
|
127
|
+
*/
|
|
128
|
+
fetchOptions?: RequestInitLike;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Parameters specific to client methods that fetch all documents. These methods
|
|
132
|
+
* start with `getAll` (for example, `getAllByType`).
|
|
133
|
+
*/
|
|
134
|
+
type GetAllParams = {
|
|
135
|
+
/**
|
|
136
|
+
* Limit the number of documents queried. If a number is not provided, there
|
|
137
|
+
* will be no limit and all matching documents will be returned.
|
|
138
|
+
*/
|
|
139
|
+
limit?: number;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Arguments to determine how the URL for a preview session is resolved.
|
|
143
|
+
*/
|
|
144
|
+
type ResolvePreviewArgs<LinkResolverReturnType> = {
|
|
145
|
+
/**
|
|
146
|
+
* A function that maps a Prismic document to a URL within your app.
|
|
147
|
+
*/
|
|
148
|
+
linkResolver?: LinkResolverFunction<LinkResolverReturnType>;
|
|
149
|
+
/**
|
|
150
|
+
* A fallback URL if the link resolver does not return a value.
|
|
151
|
+
*/
|
|
152
|
+
defaultURL: string;
|
|
153
|
+
/**
|
|
154
|
+
* The preview token (also known as a ref) that will be used to query preview
|
|
155
|
+
* content from the Prismic repository.
|
|
156
|
+
*/
|
|
157
|
+
previewToken?: string;
|
|
158
|
+
/**
|
|
159
|
+
* The previewed document that will be used to determine the destination URL.
|
|
160
|
+
*/
|
|
161
|
+
documentID?: string;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* A client that allows querying content from a Prismic repository.
|
|
165
|
+
*
|
|
166
|
+
* If used in an environment where a global `fetch` function is unavailable,
|
|
167
|
+
* such as Node.js, the `fetch` option must be provided as part of the `options`
|
|
168
|
+
* parameter.
|
|
169
|
+
*
|
|
170
|
+
* @typeParam TDocuments - Document types that are registered for the Prismic
|
|
171
|
+
* repository. Query methods will automatically be typed based on this type.
|
|
172
|
+
*/
|
|
173
|
+
declare class Client<TDocuments extends PrismicDocument = PrismicDocument> {
|
|
174
|
+
#private;
|
|
175
|
+
/**
|
|
176
|
+
* The function used to make network requests to the Prismic REST API. In
|
|
177
|
+
* environments where a global `fetch` function does not exist, such as
|
|
178
|
+
* Node.js, this function must be provided.
|
|
179
|
+
*/
|
|
180
|
+
fetchFn: FetchLike;
|
|
181
|
+
fetchOptions?: RequestInitLike;
|
|
182
|
+
/**
|
|
183
|
+
* The Prismic repository's name.
|
|
184
|
+
*/
|
|
185
|
+
set repositoryName(value: string);
|
|
186
|
+
/**
|
|
187
|
+
* The Prismic repository's name.
|
|
188
|
+
*/
|
|
189
|
+
get repositoryName(): string;
|
|
190
|
+
/**
|
|
191
|
+
* The Prismic REST API V2 endpoint for the repository (use
|
|
192
|
+
* `prismic.getRepositoryEndpoint` for the default endpoint).
|
|
193
|
+
*/
|
|
194
|
+
documentAPIEndpoint: string;
|
|
195
|
+
/**
|
|
196
|
+
* The Prismic REST API V2 endpoint for the repository (use
|
|
197
|
+
* `prismic.getRepositoryEndpoint` for the default endpoint).
|
|
198
|
+
*
|
|
199
|
+
* @deprecated Use `documentAPIEndpoint` instead.
|
|
200
|
+
*/
|
|
201
|
+
set endpoint(value: string);
|
|
202
|
+
/**
|
|
203
|
+
* The Prismic REST API V2 endpoint for the repository (use
|
|
204
|
+
* `prismic.getRepositoryEndpoint` for the default endpoint).
|
|
205
|
+
*
|
|
206
|
+
* @deprecated Use `documentAPIEndpoint` instead.
|
|
207
|
+
*/
|
|
208
|
+
get endpoint(): string;
|
|
209
|
+
/**
|
|
210
|
+
* The secure token for accessing the API (only needed if your repository is
|
|
211
|
+
* set to private).
|
|
212
|
+
*
|
|
213
|
+
* {@link https://user-guides.prismic.io/en/articles/1036153-generating-an-access-token}
|
|
214
|
+
*/
|
|
215
|
+
accessToken?: string;
|
|
216
|
+
/**
|
|
217
|
+
* A list of route resolver objects that define how a document's `url` field
|
|
218
|
+
* is resolved.
|
|
219
|
+
*
|
|
220
|
+
* {@link https://prismic.io/docs/route-resolver}
|
|
221
|
+
*/
|
|
222
|
+
routes?: NonNullable<BuildQueryURLArgs["routes"]>;
|
|
223
|
+
/**
|
|
224
|
+
* The `brokenRoute` option allows you to define the route populated in the
|
|
225
|
+
* `url` property for broken link or content relationship fields. A broken
|
|
226
|
+
* link is a link or content relationship field whose linked document has been
|
|
227
|
+
* unpublished or deleted.
|
|
228
|
+
*
|
|
229
|
+
* {@link https://prismic.io/docs/route-resolver}
|
|
230
|
+
*/
|
|
231
|
+
brokenRoute?: NonNullable<BuildQueryURLArgs["brokenRoute"]>;
|
|
232
|
+
/**
|
|
233
|
+
* Default parameters that will be sent with each query. These parameters can
|
|
234
|
+
* be overridden on each query if needed.
|
|
235
|
+
*/
|
|
236
|
+
defaultParams?: Omit<BuildQueryURLArgs, "ref" | "integrationFieldsRef" | "accessToken" | "routes">;
|
|
237
|
+
/**
|
|
238
|
+
* The client's ref mode state. This determines which ref is used during
|
|
239
|
+
* queries.
|
|
240
|
+
*/
|
|
241
|
+
private refState;
|
|
242
|
+
/**
|
|
243
|
+
* Creates a Prismic client that can be used to query a repository.
|
|
244
|
+
*
|
|
245
|
+
* If used in an environment where a global `fetch` function is unavailable,
|
|
246
|
+
* such as in some Node.js versions, the `fetch` option must be provided as
|
|
247
|
+
* part of the `options` parameter.
|
|
248
|
+
*
|
|
249
|
+
* @param repositoryNameOrEndpoint - The Prismic repository name or full Rest
|
|
250
|
+
* API V2 endpoint for the repository.
|
|
251
|
+
* @param options - Configuration that determines how content will be queried
|
|
252
|
+
* from the Prismic repository.
|
|
253
|
+
*
|
|
254
|
+
* @returns A client that can query content from the repository.
|
|
255
|
+
*/
|
|
256
|
+
constructor(repositoryNameOrEndpoint: string, options?: ClientConfig);
|
|
257
|
+
/**
|
|
258
|
+
* Enables the client to automatically query content from a preview session.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
*
|
|
262
|
+
* ```ts
|
|
263
|
+
* client.enableAutoPreviews()
|
|
264
|
+
* ```
|
|
265
|
+
*
|
|
266
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviews}
|
|
267
|
+
*/
|
|
268
|
+
enableAutoPreviews(): void;
|
|
269
|
+
/**
|
|
270
|
+
* Enables the client to automatically query content from a preview session
|
|
271
|
+
* using an HTTP request object.
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
*
|
|
275
|
+
* ```ts
|
|
276
|
+
* client.enableAutoPreviewsFromReq(req)
|
|
277
|
+
* ```
|
|
278
|
+
*
|
|
279
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviewsfromreq}
|
|
280
|
+
*/
|
|
281
|
+
enableAutoPreviewsFromReq<R extends HttpRequestLike>(req: R): void;
|
|
282
|
+
/**
|
|
283
|
+
* Disables the client from automatically querying content from a preview
|
|
284
|
+
* session.
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
*
|
|
288
|
+
* ```ts
|
|
289
|
+
* client.disableAutoPreviews()
|
|
290
|
+
* ```
|
|
291
|
+
*
|
|
292
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#disableautopreviews}
|
|
293
|
+
*/
|
|
294
|
+
disableAutoPreviews(): void;
|
|
295
|
+
/**
|
|
296
|
+
* Fetches pages based on the `params` argument. Results are paginated.
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
*
|
|
300
|
+
* ```ts
|
|
301
|
+
* const response = await client.get({ pageSize: 10 })
|
|
302
|
+
* ```
|
|
303
|
+
*
|
|
304
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#get}
|
|
305
|
+
*/
|
|
306
|
+
get<TDocument extends TDocuments>(params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
307
|
+
/**
|
|
308
|
+
* Fetches the first page returned based on the `params` argument.
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
*
|
|
312
|
+
* ```ts
|
|
313
|
+
* const page = await client.getFirst()
|
|
314
|
+
* ```
|
|
315
|
+
*
|
|
316
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getfirst}
|
|
317
|
+
*/
|
|
318
|
+
getFirst<TDocument extends TDocuments>(params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<TDocument>;
|
|
319
|
+
/**
|
|
320
|
+
* Fetches all pages based on the `params` argument. This method may make
|
|
321
|
+
* multiple network requests to fetch all matching pages.
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
*
|
|
325
|
+
* ```ts
|
|
326
|
+
* const pages = await client.dangerouslyGetAll()
|
|
327
|
+
* ```
|
|
328
|
+
*
|
|
329
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#dangerouslygetall}
|
|
330
|
+
*/
|
|
331
|
+
dangerouslyGetAll<TDocument extends TDocuments>(params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
332
|
+
/**
|
|
333
|
+
* Fetches a page with a specific ID.
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
*
|
|
337
|
+
* ```ts
|
|
338
|
+
* const page = await client.getByID("WW4bKScAAMAqmluX")
|
|
339
|
+
* ```
|
|
340
|
+
*
|
|
341
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyid}
|
|
342
|
+
*/
|
|
343
|
+
getByID<TDocument extends TDocuments>(id: string, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<TDocument>;
|
|
344
|
+
/**
|
|
345
|
+
* Fetches pages with specific IDs. Results are paginated.
|
|
346
|
+
*
|
|
347
|
+
* @example
|
|
348
|
+
*
|
|
349
|
+
* ```ts
|
|
350
|
+
* const response = await client.getByIDs([
|
|
351
|
+
* "WW4bKScAAMAqmluX",
|
|
352
|
+
* "U1kTRgEAAC8A5ldS",
|
|
353
|
+
* ])
|
|
354
|
+
* ```
|
|
355
|
+
*
|
|
356
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyids}
|
|
357
|
+
*/
|
|
358
|
+
getByIDs<TDocument extends TDocuments>(ids: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
359
|
+
/**
|
|
360
|
+
* Fetches pages with specific IDs. This method may make multiple network
|
|
361
|
+
* requests to fetch all matching pages.
|
|
362
|
+
*
|
|
363
|
+
* @example
|
|
364
|
+
*
|
|
365
|
+
* ```ts
|
|
366
|
+
* const pages = await client.getAllByIDs([
|
|
367
|
+
* "WW4bKScAAMAqmluX",
|
|
368
|
+
* "U1kTRgEAAC8A5ldS",
|
|
369
|
+
* ])
|
|
370
|
+
* ```
|
|
371
|
+
*
|
|
372
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyids}
|
|
373
|
+
*/
|
|
374
|
+
getAllByIDs<TDocument extends TDocuments>(ids: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
375
|
+
/**
|
|
376
|
+
* Fetches a page with a specific UID and type.
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
*
|
|
380
|
+
* ```ts
|
|
381
|
+
* const page = await client.getByUID("blog_post", "my-first-post")
|
|
382
|
+
* ```
|
|
383
|
+
*
|
|
384
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuid}
|
|
385
|
+
*/
|
|
386
|
+
getByUID<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, uid: string, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>>;
|
|
387
|
+
/**
|
|
388
|
+
* Fetches pages with specific UIDs and a specific type. Results are
|
|
389
|
+
* paginated.
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
*
|
|
393
|
+
* ```ts
|
|
394
|
+
* const response = await client.getByUIDs("blog_post", [
|
|
395
|
+
* "my-first-post",
|
|
396
|
+
* "my-second-post",
|
|
397
|
+
* ])
|
|
398
|
+
* ```
|
|
399
|
+
*
|
|
400
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuids}
|
|
401
|
+
*/
|
|
402
|
+
getByUIDs<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, uids: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>>;
|
|
403
|
+
/**
|
|
404
|
+
* Fetches pages with specific UIDs and a specific type. This method may make
|
|
405
|
+
* multiple network requests to fetch all matching pages.
|
|
406
|
+
*
|
|
407
|
+
* @example
|
|
408
|
+
*
|
|
409
|
+
* ```ts
|
|
410
|
+
* const pages = await client.getAllByUIDs("blog_post", [
|
|
411
|
+
* "my-first-post",
|
|
412
|
+
* "my-second-post",
|
|
413
|
+
* ])
|
|
414
|
+
* ```
|
|
415
|
+
*
|
|
416
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyuids}
|
|
417
|
+
*/
|
|
418
|
+
getAllByUIDs<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, uids: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>[]>;
|
|
419
|
+
/**
|
|
420
|
+
* Fetches a specific single type page.
|
|
421
|
+
*
|
|
422
|
+
* @example
|
|
423
|
+
*
|
|
424
|
+
* ```ts
|
|
425
|
+
* const page = await client.getSingle("settings")
|
|
426
|
+
* ```
|
|
427
|
+
*
|
|
428
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getsingle}
|
|
429
|
+
*/
|
|
430
|
+
getSingle<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>>;
|
|
431
|
+
/**
|
|
432
|
+
* Fetches pages with a specific type. Results are paginated.
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
*
|
|
436
|
+
* ```ts
|
|
437
|
+
* const response = await client.getByType("blog_post")
|
|
438
|
+
* ```
|
|
439
|
+
*
|
|
440
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytype}
|
|
441
|
+
*/
|
|
442
|
+
getByType<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>>;
|
|
443
|
+
/**
|
|
444
|
+
* Fetches pages with a specific type. This method may make multiple network
|
|
445
|
+
* requests to fetch all matching documents.
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
*
|
|
449
|
+
* ```ts
|
|
450
|
+
* const pages = await client.getAllByType("blog_post")
|
|
451
|
+
* ```
|
|
452
|
+
*
|
|
453
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytype}
|
|
454
|
+
*/
|
|
455
|
+
getAllByType<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>[]>;
|
|
456
|
+
/**
|
|
457
|
+
* Fetches pages with a specific tag. Results are paginated.
|
|
458
|
+
*
|
|
459
|
+
* @example
|
|
460
|
+
*
|
|
461
|
+
* ```ts
|
|
462
|
+
* const response = await client.getByTag("featured")
|
|
463
|
+
* ```
|
|
464
|
+
*
|
|
465
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytag}
|
|
466
|
+
*/
|
|
467
|
+
getByTag<TDocument extends TDocuments>(tag: string, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
468
|
+
/**
|
|
469
|
+
* Fetches pages with a specific tag. This method may make multiple network
|
|
470
|
+
* requests to fetch all matching documents.
|
|
471
|
+
*
|
|
472
|
+
* @example
|
|
473
|
+
*
|
|
474
|
+
* ```ts
|
|
475
|
+
* const pages = await client.getAllByTag("featured")
|
|
476
|
+
* ```
|
|
477
|
+
*
|
|
478
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytag}
|
|
479
|
+
*/
|
|
480
|
+
getAllByTag<TDocument extends TDocuments>(tag: string, params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
481
|
+
/**
|
|
482
|
+
* Fetches pages with every tag from a list of tags. Results are paginated.
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
*
|
|
486
|
+
* ```ts
|
|
487
|
+
* const response = await client.getByEveryTag(["featured", "homepage"])
|
|
488
|
+
* ```
|
|
489
|
+
*
|
|
490
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyeverytag}
|
|
491
|
+
*/
|
|
492
|
+
getByEveryTag<TDocument extends TDocuments>(tags: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
493
|
+
/**
|
|
494
|
+
* Fetches pages with every tag from a list of tags. This method may make
|
|
495
|
+
* multiple network requests to fetch all matching pages.
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
*
|
|
499
|
+
* ```ts
|
|
500
|
+
* const pages = await client.getAllByEveryTag(["featured", "homepage"])
|
|
501
|
+
* ```
|
|
502
|
+
*
|
|
503
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyeverytag}
|
|
504
|
+
*/
|
|
505
|
+
getAllByEveryTag<TDocument extends TDocuments>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
506
|
+
/**
|
|
507
|
+
* Fetches pages with at least one tag from a list of tags. Results are
|
|
508
|
+
* paginated.
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
*
|
|
512
|
+
* ```ts
|
|
513
|
+
* const response = await client.getBySomeTags(["featured", "homepage"])
|
|
514
|
+
* ```
|
|
515
|
+
*
|
|
516
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbysometags}
|
|
517
|
+
*/
|
|
518
|
+
getBySomeTags<TDocument extends TDocuments>(tags: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
519
|
+
/**
|
|
520
|
+
* Fetches pages with at least one tag from a list of tags. This method may
|
|
521
|
+
* make multiple network requests to fetch all matching documents.
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
*
|
|
525
|
+
* ```ts
|
|
526
|
+
* const pages = await client.getAllBySomeTags(["featured", "homepage"])
|
|
527
|
+
* ```
|
|
528
|
+
*
|
|
529
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbysometags}
|
|
530
|
+
*/
|
|
531
|
+
getAllBySomeTags<TDocument extends TDocuments>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
532
|
+
/**
|
|
533
|
+
* Fetches metadata about the client's Prismic repository.
|
|
534
|
+
*
|
|
535
|
+
* @example
|
|
536
|
+
*
|
|
537
|
+
* ```ts
|
|
538
|
+
* const repository = await client.getRepository()
|
|
539
|
+
* ```
|
|
540
|
+
*
|
|
541
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrepository}
|
|
542
|
+
*/
|
|
543
|
+
getRepository(params?: Pick<BuildQueryURLArgs, "accessToken"> & FetchParams): Promise<Repository>;
|
|
544
|
+
/**
|
|
545
|
+
* Fetches the repository's active refs.
|
|
546
|
+
*
|
|
547
|
+
* @example
|
|
548
|
+
*
|
|
549
|
+
* ```ts
|
|
550
|
+
* const refs = await client.getRefs()
|
|
551
|
+
* ```
|
|
552
|
+
*
|
|
553
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefs}
|
|
554
|
+
*/
|
|
555
|
+
getRefs(params?: FetchParams): Promise<Ref[]>;
|
|
556
|
+
/**
|
|
557
|
+
* Fetches a ref by its ID.
|
|
558
|
+
*
|
|
559
|
+
* @example
|
|
560
|
+
*
|
|
561
|
+
* ```ts
|
|
562
|
+
* const ref = await client.getRefByID("YhE3YhEAACIA4321")
|
|
563
|
+
* ```
|
|
564
|
+
*
|
|
565
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbyid}
|
|
566
|
+
*/
|
|
567
|
+
getRefByID(id: string, params?: FetchParams): Promise<Ref>;
|
|
568
|
+
/**
|
|
569
|
+
* Fetches a ref by its label. A release ref's label is its name shown in the
|
|
570
|
+
* Page Builder.
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
*
|
|
574
|
+
* ```ts
|
|
575
|
+
* const ref = await client.getRefByLabel("My Release")
|
|
576
|
+
* ```
|
|
577
|
+
*
|
|
578
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbylabel}
|
|
579
|
+
*/
|
|
580
|
+
getRefByLabel(label: string, params?: FetchParams): Promise<Ref>;
|
|
581
|
+
/**
|
|
582
|
+
* Fetches the repository's master ref.
|
|
583
|
+
*
|
|
584
|
+
* @example
|
|
585
|
+
*
|
|
586
|
+
* ```ts
|
|
587
|
+
* const masterRef = await client.getMasterRef()
|
|
588
|
+
* ```
|
|
589
|
+
*
|
|
590
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getmasterref}
|
|
591
|
+
*/
|
|
592
|
+
getMasterRef(params?: FetchParams): Promise<Ref>;
|
|
593
|
+
/**
|
|
594
|
+
* Fetches the repository's active releases.
|
|
595
|
+
*
|
|
596
|
+
* @example
|
|
597
|
+
*
|
|
598
|
+
* ```ts
|
|
599
|
+
* const releases = await client.getReleases()
|
|
600
|
+
* ```
|
|
601
|
+
*
|
|
602
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleases}
|
|
603
|
+
*/
|
|
604
|
+
getReleases(params?: FetchParams): Promise<Ref[]>;
|
|
605
|
+
/**
|
|
606
|
+
* Fetches a release with a specific ID.
|
|
607
|
+
*
|
|
608
|
+
* @example
|
|
609
|
+
*
|
|
610
|
+
* ```ts
|
|
611
|
+
* const release = await client.getReleaseByID("YhE3YhEAACIA4321")
|
|
612
|
+
* ```
|
|
613
|
+
*
|
|
614
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebyid}
|
|
615
|
+
*/
|
|
616
|
+
getReleaseByID(id: string, params?: FetchParams): Promise<Ref>;
|
|
617
|
+
/**
|
|
618
|
+
* Fetches a release by its label. A release ref's label is its name shown in
|
|
619
|
+
* the Page Builder.
|
|
620
|
+
*
|
|
621
|
+
* @example
|
|
622
|
+
*
|
|
623
|
+
* ```ts
|
|
624
|
+
* const release = await client.getReleaseByLabel("My Release")
|
|
625
|
+
* ```
|
|
626
|
+
*
|
|
627
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebylabel}
|
|
628
|
+
*/
|
|
629
|
+
getReleaseByLabel(label: string, params?: FetchParams): Promise<Ref>;
|
|
630
|
+
/**
|
|
631
|
+
* Fetches the repository's page tags.
|
|
632
|
+
*
|
|
633
|
+
* @example
|
|
634
|
+
*
|
|
635
|
+
* ```ts
|
|
636
|
+
* const tags = await client.getTags()
|
|
637
|
+
* ```
|
|
638
|
+
*
|
|
639
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#gettags}
|
|
640
|
+
*/
|
|
641
|
+
getTags(params?: FetchParams): Promise<string[]>;
|
|
642
|
+
/**
|
|
643
|
+
* Builds a Content API query URL with a set of parameters.
|
|
644
|
+
*
|
|
645
|
+
* @example
|
|
646
|
+
*
|
|
647
|
+
* ```ts
|
|
648
|
+
* const url = await client.buildQueryURL({
|
|
649
|
+
* filters: [filter.at("document.type", "blog_post")],
|
|
650
|
+
* })
|
|
651
|
+
* ```
|
|
652
|
+
*
|
|
653
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#buildqueryurl}
|
|
654
|
+
*/
|
|
655
|
+
buildQueryURL({
|
|
656
|
+
signal,
|
|
657
|
+
fetchOptions,
|
|
658
|
+
...params
|
|
659
|
+
}?: Partial<BuildQueryURLArgs> & FetchParams): Promise<string>;
|
|
660
|
+
/**
|
|
661
|
+
* Fetches a previewed page's URL using a preview token and page ID.
|
|
662
|
+
*
|
|
663
|
+
* @example
|
|
664
|
+
*
|
|
665
|
+
* ```ts
|
|
666
|
+
* const url = await client.resolvePreviewURL({
|
|
667
|
+
* linkResolver,
|
|
668
|
+
* defaultURL: "/",
|
|
669
|
+
* })
|
|
670
|
+
* ```
|
|
671
|
+
*
|
|
672
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#resolvepreviewurl}
|
|
673
|
+
*/
|
|
674
|
+
resolvePreviewURL<LinkResolverReturnType>(args: ResolvePreviewArgs<LinkResolverReturnType> & FetchParams): Promise<string>;
|
|
675
|
+
/**
|
|
676
|
+
* Configures the client to query the latest published content. This is the
|
|
677
|
+
* client's default mode.
|
|
678
|
+
*
|
|
679
|
+
* @example
|
|
680
|
+
*
|
|
681
|
+
* ```ts
|
|
682
|
+
* client.queryLatestContent()
|
|
683
|
+
* ```
|
|
684
|
+
*
|
|
685
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querylatestcontent}
|
|
686
|
+
*/
|
|
687
|
+
queryLatestContent(): void;
|
|
688
|
+
/**
|
|
689
|
+
* Configures the client to query content from a release with a specific ID.
|
|
690
|
+
*
|
|
691
|
+
* @example
|
|
692
|
+
*
|
|
693
|
+
* ```ts
|
|
694
|
+
* client.queryContentFromReleaseByID("YhE3YhEAACIA4321")
|
|
695
|
+
* ```
|
|
696
|
+
*
|
|
697
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebyid}
|
|
698
|
+
*/
|
|
699
|
+
queryContentFromReleaseByID(releaseID: string): void;
|
|
700
|
+
/**
|
|
701
|
+
* Configures the client to query content from a release with a specific
|
|
702
|
+
* label.
|
|
703
|
+
*
|
|
704
|
+
* @example
|
|
705
|
+
*
|
|
706
|
+
* ```ts
|
|
707
|
+
* client.queryContentFromReleaseByLabel("My Release")
|
|
708
|
+
* ```
|
|
709
|
+
*
|
|
710
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebylabel}
|
|
711
|
+
*/
|
|
712
|
+
queryContentFromReleaseByLabel(releaseLabel: string): void;
|
|
713
|
+
/**
|
|
714
|
+
* Configures the client to query content from a specific ref.
|
|
715
|
+
*
|
|
716
|
+
* @example
|
|
717
|
+
*
|
|
718
|
+
* ```ts
|
|
719
|
+
* client.queryContentFromRef("my-ref")
|
|
720
|
+
* ```
|
|
721
|
+
*
|
|
722
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromref}
|
|
723
|
+
*/
|
|
724
|
+
queryContentFromRef(ref: RefStringOrThunk): void;
|
|
725
|
+
/**
|
|
726
|
+
* A preconfigured `fetch()` function for Prismic's GraphQL API that can be
|
|
727
|
+
* provided to GraphQL clients.
|
|
728
|
+
*
|
|
729
|
+
* @example
|
|
730
|
+
*
|
|
731
|
+
* ```ts
|
|
732
|
+
* import { createClient, getGraphQLEndpoint } from "@prismicio/client"
|
|
733
|
+
*
|
|
734
|
+
* const client = createClient("example-prismic-repo")
|
|
735
|
+
* const graphQLClient = new ApolloClient({
|
|
736
|
+
* link: new HttpLink({
|
|
737
|
+
* uri: getGraphQLEndpoint(client.repositoryName),
|
|
738
|
+
* // Provide `client.graphQLFetch` as the fetch implementation.
|
|
739
|
+
* fetch: client.graphQLFetch,
|
|
740
|
+
* // Using GET is required.
|
|
741
|
+
* useGETForQueries: true,
|
|
742
|
+
* }),
|
|
743
|
+
* cache: new InMemoryCache(),
|
|
744
|
+
* })
|
|
745
|
+
* ```
|
|
746
|
+
*
|
|
747
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#graphqlfetch}
|
|
748
|
+
*/
|
|
749
|
+
graphQLFetch(input: RequestInfo, init?: Omit<RequestInit, "signal"> & {
|
|
750
|
+
signal?: AbortSignalLike;
|
|
751
|
+
}): Promise<Response>;
|
|
752
|
+
/**
|
|
753
|
+
* Returns the ref needed to query based on the client's current state. This
|
|
754
|
+
* method may make a network request to fetch a ref or resolve the user's ref
|
|
755
|
+
* thunk.
|
|
756
|
+
*
|
|
757
|
+
* If auto previews are enabled, the preview ref takes priority if available.
|
|
758
|
+
*
|
|
759
|
+
* The following strategies are used depending on the client's state:
|
|
760
|
+
*
|
|
761
|
+
* - If the user called `queryLatestContent`: Use the repository's master ref.
|
|
762
|
+
* The ref is cached for 5 seconds. After 5 seconds, a new master ref is
|
|
763
|
+
* fetched.
|
|
764
|
+
* - If the user called `queryContentFromReleaseByID`: Use the release's ref.
|
|
765
|
+
* The ref is cached for 5 seconds. After 5 seconds, a new ref for the
|
|
766
|
+
* release is fetched.
|
|
767
|
+
* - If the user called `queryContentFromReleaseByLabel`: Use the release's ref.
|
|
768
|
+
* The ref is cached for 5 seconds. After 5 seconds, a new ref for the
|
|
769
|
+
* release is fetched.
|
|
770
|
+
* - If the user called `queryContentFromRef`: Use the provided ref. Fall back
|
|
771
|
+
* to the master ref if the ref is not a string.
|
|
772
|
+
*
|
|
773
|
+
* @returns The ref to use during a query.
|
|
774
|
+
*/
|
|
775
|
+
private getResolvedRefString;
|
|
776
|
+
/**
|
|
777
|
+
* The private implementation of `this.get`. It returns the API response and
|
|
778
|
+
* the URL used to make the request. The URL is sometimes used in the public
|
|
779
|
+
* method to include in thrown errors.
|
|
780
|
+
*
|
|
781
|
+
* This method retries requests that throw `RefNotFoundError` or
|
|
782
|
+
* `RefExpiredError`. It contains special logic to retry with the latest
|
|
783
|
+
* master ref, provided in the API's error message.
|
|
784
|
+
*
|
|
785
|
+
* @typeParam TDocument - Type of Prismic documents returned.
|
|
786
|
+
*
|
|
787
|
+
* @param params - Parameters to filter, sort, and paginate results.
|
|
788
|
+
*
|
|
789
|
+
* @returns An object containing the paginated response containing the result
|
|
790
|
+
* of the query and the URL used to make the API request.
|
|
791
|
+
*/
|
|
792
|
+
private _get;
|
|
793
|
+
protected _buildRequestInit(params?: FetchParams): RequestInitLike;
|
|
794
|
+
}
|
|
795
|
+
//#endregion
|
|
796
|
+
export { Client, ClientConfig, FetchParams, HttpRequestLike };
|
|
797
|
+
//# sourceMappingURL=Client.d.cts.map
|