@prismicio/client 7.21.0-alpha.2 → 7.21.0-canary.147e3f2
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 +926 -0
- package/dist/Client.cjs.map +1 -0
- package/dist/Client.d.cts +704 -0
- package/dist/Client.d.cts.map +1 -0
- package/dist/Client.d.ts +704 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +926 -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 +212 -0
- package/dist/buildQueryURL.d.cts.map +1 -0
- package/dist/buildQueryURL.d.ts +212 -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.cjs +31 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +46 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.ts +46 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +22 -0
- package/dist/errors.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 +109 -3882
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +143 -4394
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +143 -4394
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -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/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/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/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/throttledWarn.cjs +27 -0
- package/dist/lib/throttledWarn.cjs.map +1 -0
- package/dist/lib/throttledWarn.js +26 -0
- package/dist/lib/throttledWarn.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 +682 -1028
- package/src/WriteClient.ts +44 -46
- package/src/buildQueryURL.ts +14 -20
- package/src/createClient.ts +1 -1
- package/src/errors.ts +94 -0
- package/src/getGraphQLEndpoint.ts +1 -1
- package/src/getRepositoryEndpoint.ts +1 -1
- package/src/getRepositoryName.ts +1 -1
- package/src/getToolbarSrc.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 +11 -8
- 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 → throttledWarn.ts} +3 -14
- package/src/lib/validateAssetMetadata.ts +1 -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
- package/src/errors/ForbiddenError.ts +0 -16
- package/src/errors/InvalidDataError.ts +0 -5
- package/src/errors/NotFoundError.ts +0 -5
- package/src/errors/ParsingError.ts +0 -16
- package/src/errors/PreviewTokenExpired.ts +0 -12
- package/src/errors/PrismicError.ts +0 -15
- package/src/errors/RefExpiredError.ts +0 -14
- package/src/errors/RefNotFoundError.ts +0 -14
- package/src/errors/RepositoryNotFoundError.ts +0 -5
- package/src/lib/appendFilters.ts +0 -26
- package/src/lib/castArray.ts +0 -14
- package/src/lib/castThunk.ts +0 -13
- package/src/lib/everyTagFilter.ts +0 -15
- package/src/lib/findMasterRef.ts +0 -16
- package/src/lib/findRef.ts +0 -25
- package/src/lib/findRefByID.ts +0 -17
- package/src/lib/findRefByLabel.ts +0 -17
- package/src/lib/minifyGraphQLQuery.ts +0 -13
- package/src/lib/someTagsFilter.ts +0 -15
- package/src/lib/typeFilter.ts +0 -12
|
@@ -0,0 +1,704 @@
|
|
|
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 a document type with a matching `type` property from a union of
|
|
13
|
+
* document types.
|
|
14
|
+
*/
|
|
15
|
+
type ExtractDocumentType<TDocuments extends PrismicDocument, TDocumentType extends TDocuments["type"]> = Extract<TDocuments, {
|
|
16
|
+
type: TDocumentType;
|
|
17
|
+
}> extends never ? TDocuments : Extract<TDocuments, {
|
|
18
|
+
type: TDocumentType;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* The minimum required properties to treat as an HTTP Request for automatic
|
|
22
|
+
* Prismic preview support.
|
|
23
|
+
*/
|
|
24
|
+
type HttpRequestLike =
|
|
25
|
+
// Web API Request
|
|
26
|
+
{
|
|
27
|
+
headers?: {
|
|
28
|
+
get(name: string): string | null;
|
|
29
|
+
};
|
|
30
|
+
url?: string;
|
|
31
|
+
} | {
|
|
32
|
+
headers?: {
|
|
33
|
+
cookie?: string;
|
|
34
|
+
};
|
|
35
|
+
query?: Record<string, unknown>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A function that returns a ref string. Used to configure which ref the client
|
|
39
|
+
* queries content from.
|
|
40
|
+
*/
|
|
41
|
+
type GetRef = (params?: Pick<BuildQueryURLArgs, "accessToken"> & FetchParams) => string | undefined | Promise<string | undefined>;
|
|
42
|
+
/** Parameters for client methods that use `fetch()`. */
|
|
43
|
+
type FetchParams = {
|
|
44
|
+
/**
|
|
45
|
+
* Options provided to the client's `fetch()` on all network requests. These
|
|
46
|
+
* options will be merged with internally required options. They can also be
|
|
47
|
+
* overriden on a per-query basis using the query's `fetchOptions` parameter.
|
|
48
|
+
*/
|
|
49
|
+
fetchOptions?: RequestInitLike;
|
|
50
|
+
/** @deprecated Move to `fetchOptions.signal`: */
|
|
51
|
+
signal?: AbortSignalLike;
|
|
52
|
+
};
|
|
53
|
+
/** Prismic client configuration. */
|
|
54
|
+
type ClientConfig = {
|
|
55
|
+
/**
|
|
56
|
+
* The client's Content API endpoint.
|
|
57
|
+
*
|
|
58
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
59
|
+
*/
|
|
60
|
+
documentAPIEndpoint?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The secure token used for the Content API.
|
|
63
|
+
*
|
|
64
|
+
* @see {@link https://prismic.io/docs/fetch-content#content-visibility}
|
|
65
|
+
*/
|
|
66
|
+
accessToken?: string;
|
|
67
|
+
/**
|
|
68
|
+
* The version of the repository's content. It can optionally be a function
|
|
69
|
+
* that returns a ref.
|
|
70
|
+
*
|
|
71
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
72
|
+
*/
|
|
73
|
+
ref?: string | GetRef;
|
|
74
|
+
/**
|
|
75
|
+
* A list of route resolver objects that define how a document's `url`
|
|
76
|
+
* property is resolved.
|
|
77
|
+
*
|
|
78
|
+
* @see {@link https://prismic.io/docs/routes}
|
|
79
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
80
|
+
*/
|
|
81
|
+
routes?: NonNullable<BuildQueryURLArgs["routes"]>;
|
|
82
|
+
/**
|
|
83
|
+
* The URL used for link or content relationship fields that point to an
|
|
84
|
+
* archived or deleted page.
|
|
85
|
+
*
|
|
86
|
+
* @see {@link https://prismic.io/docs/routes}
|
|
87
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
88
|
+
*/
|
|
89
|
+
brokenRoute?: NonNullable<BuildQueryURLArgs["brokenRoute"]>;
|
|
90
|
+
/**
|
|
91
|
+
* Default parameters sent with each Content API request. These parameters can
|
|
92
|
+
* be overridden on each method.
|
|
93
|
+
*
|
|
94
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
95
|
+
*/
|
|
96
|
+
defaultParams?: Omit<BuildQueryURLArgs, "ref" | "integrationFieldsRef" | "accessToken" | "routes" | "brokenRoute">;
|
|
97
|
+
/**
|
|
98
|
+
* The `fetch` function used to make network requests.
|
|
99
|
+
*
|
|
100
|
+
* @default The global `fetch` function.
|
|
101
|
+
*
|
|
102
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
103
|
+
*/
|
|
104
|
+
fetch?: FetchLike;
|
|
105
|
+
/**
|
|
106
|
+
* The default `fetch` options sent with each Content API request. These
|
|
107
|
+
* parameters can be overriden on each method.
|
|
108
|
+
*
|
|
109
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
110
|
+
*/
|
|
111
|
+
fetchOptions?: RequestInitLike;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Parameters specific to client methods that fetch all documents. These methods
|
|
115
|
+
* start with `getAll` (e.g. `getAllByType`).
|
|
116
|
+
*/
|
|
117
|
+
type GetAllParams = {
|
|
118
|
+
/**
|
|
119
|
+
* Limit the number of documents queried.
|
|
120
|
+
*
|
|
121
|
+
* @default No limit.
|
|
122
|
+
*/
|
|
123
|
+
limit?: number;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* A client for fetching content from a Prismic repository.
|
|
127
|
+
*
|
|
128
|
+
* @see {@link https://prismic.io/docs/fetch-content}
|
|
129
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client}
|
|
130
|
+
*/
|
|
131
|
+
declare class Client<TDocuments extends PrismicDocument = PrismicDocument> {
|
|
132
|
+
#private;
|
|
133
|
+
/**
|
|
134
|
+
* The client's Content API endpoint.
|
|
135
|
+
*
|
|
136
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
137
|
+
*/
|
|
138
|
+
documentAPIEndpoint: string;
|
|
139
|
+
/**
|
|
140
|
+
* The secure token used for the Content API.
|
|
141
|
+
*
|
|
142
|
+
* @see {@link https://prismic.io/docs/fetch-content#content-visibility}
|
|
143
|
+
*/
|
|
144
|
+
accessToken?: string;
|
|
145
|
+
/**
|
|
146
|
+
* A list of route resolver objects that define how a document's `url`
|
|
147
|
+
* property is resolved.
|
|
148
|
+
*
|
|
149
|
+
* @see {@link https://prismic.io/docs/routes}
|
|
150
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
151
|
+
*/
|
|
152
|
+
routes?: NonNullable<BuildQueryURLArgs["routes"]>;
|
|
153
|
+
/**
|
|
154
|
+
* The URL used for link or content relationship fields that point to an
|
|
155
|
+
* archived or deleted page.
|
|
156
|
+
*
|
|
157
|
+
* @see {@link https://prismic.io/docs/routes}
|
|
158
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
159
|
+
*/
|
|
160
|
+
brokenRoute?: NonNullable<BuildQueryURLArgs["brokenRoute"]>;
|
|
161
|
+
/**
|
|
162
|
+
* Default parameters sent with each Content API request. These parameters can
|
|
163
|
+
* be overridden on each method.
|
|
164
|
+
*
|
|
165
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
166
|
+
*/
|
|
167
|
+
defaultParams?: Omit<BuildQueryURLArgs, "ref" | "integrationFieldsRef" | "accessToken" | "routes">;
|
|
168
|
+
/**
|
|
169
|
+
* The `fetch` function used to make network requests.
|
|
170
|
+
*
|
|
171
|
+
* @default The global `fetch` function.
|
|
172
|
+
*
|
|
173
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
174
|
+
*/
|
|
175
|
+
fetchFn: FetchLike;
|
|
176
|
+
/**
|
|
177
|
+
* The default `fetch` options sent with each Content API request. These
|
|
178
|
+
* parameters can be overriden on each method.
|
|
179
|
+
*
|
|
180
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}
|
|
181
|
+
*/
|
|
182
|
+
fetchOptions: RequestInitLike;
|
|
183
|
+
/**
|
|
184
|
+
* @param repositoryNameOrEndpoint - The Prismic repository name or full
|
|
185
|
+
* Content API endpoint for the repository.
|
|
186
|
+
* @param config - Client configuration.
|
|
187
|
+
*/
|
|
188
|
+
constructor(repositoryNameOrEndpoint: string, config?: ClientConfig);
|
|
189
|
+
/** The Prismic repository's name. */
|
|
190
|
+
set repositoryName(value: string);
|
|
191
|
+
/** The Prismic repository's name. */
|
|
192
|
+
get repositoryName(): string;
|
|
193
|
+
/** @deprecated Replace with `documentAPIEndpoint`. */
|
|
194
|
+
set endpoint(value: string);
|
|
195
|
+
/** @deprecated Replace with `documentAPIEndpoint`. */
|
|
196
|
+
get endpoint(): string;
|
|
197
|
+
/**
|
|
198
|
+
* Enables the client to automatically query content from a preview session.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
*
|
|
202
|
+
* ```ts
|
|
203
|
+
* client.enableAutoPreviews()
|
|
204
|
+
* ```
|
|
205
|
+
*
|
|
206
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviews}
|
|
207
|
+
*/
|
|
208
|
+
enableAutoPreviews(): void;
|
|
209
|
+
/**
|
|
210
|
+
* Enables the client to automatically query content from a preview session
|
|
211
|
+
* using an HTTP request object.
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
*
|
|
215
|
+
* ```ts
|
|
216
|
+
* client.enableAutoPreviewsFromReq(req)
|
|
217
|
+
* ```
|
|
218
|
+
*
|
|
219
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviewsfromreq}
|
|
220
|
+
*/
|
|
221
|
+
enableAutoPreviewsFromReq(request: HttpRequestLike): void;
|
|
222
|
+
/**
|
|
223
|
+
* Disables the client from automatically querying content from a preview
|
|
224
|
+
* session.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
*
|
|
228
|
+
* ```ts
|
|
229
|
+
* client.disableAutoPreviews()
|
|
230
|
+
* ```
|
|
231
|
+
*
|
|
232
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#disableautopreviews}
|
|
233
|
+
*/
|
|
234
|
+
disableAutoPreviews(): void;
|
|
235
|
+
/**
|
|
236
|
+
* Fetches pages based on the `params` argument. Results are paginated.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
*
|
|
240
|
+
* ```ts
|
|
241
|
+
* const response = await client.get({ pageSize: 10 })
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#get}
|
|
245
|
+
*/
|
|
246
|
+
get<TDocument extends TDocuments>(params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
247
|
+
/**
|
|
248
|
+
* Fetches the first page returned based on the `params` argument.
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
*
|
|
252
|
+
* ```ts
|
|
253
|
+
* const page = await client.getFirst()
|
|
254
|
+
* ```
|
|
255
|
+
*
|
|
256
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getfirst}
|
|
257
|
+
*/
|
|
258
|
+
getFirst<TDocument extends TDocuments>(params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<TDocument>;
|
|
259
|
+
/**
|
|
260
|
+
* Fetches all pages based on the `params` argument. This method may make
|
|
261
|
+
* multiple network requests to fetch all matching pages.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
*
|
|
265
|
+
* ```ts
|
|
266
|
+
* const pages = await client.dangerouslyGetAll()
|
|
267
|
+
* ```
|
|
268
|
+
*
|
|
269
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#dangerouslygetall}
|
|
270
|
+
*/
|
|
271
|
+
dangerouslyGetAll<TDocument extends TDocuments>(params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
272
|
+
/**
|
|
273
|
+
* Fetches a page with a specific ID.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
*
|
|
277
|
+
* ```ts
|
|
278
|
+
* const page = await client.getByID("WW4bKScAAMAqmluX")
|
|
279
|
+
* ```
|
|
280
|
+
*
|
|
281
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyid}
|
|
282
|
+
*/
|
|
283
|
+
getByID<TDocument extends TDocuments>(id: string, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<TDocument>;
|
|
284
|
+
/**
|
|
285
|
+
* Fetches pages with specific IDs. Results are paginated.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
*
|
|
289
|
+
* ```ts
|
|
290
|
+
* const response = await client.getByIDs([
|
|
291
|
+
* "WW4bKScAAMAqmluX",
|
|
292
|
+
* "U1kTRgEAAC8A5ldS",
|
|
293
|
+
* ])
|
|
294
|
+
* ```
|
|
295
|
+
*
|
|
296
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyids}
|
|
297
|
+
*/
|
|
298
|
+
getByIDs<TDocument extends TDocuments>(ids: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
299
|
+
/**
|
|
300
|
+
* Fetches pages with specific IDs. This method may make multiple network
|
|
301
|
+
* requests to fetch all matching pages.
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
*
|
|
305
|
+
* ```ts
|
|
306
|
+
* const pages = await client.getAllByIDs([
|
|
307
|
+
* "WW4bKScAAMAqmluX",
|
|
308
|
+
* "U1kTRgEAAC8A5ldS",
|
|
309
|
+
* ])
|
|
310
|
+
* ```
|
|
311
|
+
*
|
|
312
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyids}
|
|
313
|
+
*/
|
|
314
|
+
getAllByIDs<TDocument extends TDocuments>(ids: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
315
|
+
/**
|
|
316
|
+
* Fetches a page with a specific UID and type.
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
*
|
|
320
|
+
* ```ts
|
|
321
|
+
* const page = await client.getByUID("blog_post", "my-first-post")
|
|
322
|
+
* ```
|
|
323
|
+
*
|
|
324
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuid}
|
|
325
|
+
*/
|
|
326
|
+
getByUID<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, uid: string, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>>;
|
|
327
|
+
/**
|
|
328
|
+
* Fetches pages with specific UIDs and a specific type. Results are
|
|
329
|
+
* paginated.
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
*
|
|
333
|
+
* ```ts
|
|
334
|
+
* const response = await client.getByUIDs("blog_post", [
|
|
335
|
+
* "my-first-post",
|
|
336
|
+
* "my-second-post",
|
|
337
|
+
* ])
|
|
338
|
+
* ```
|
|
339
|
+
*
|
|
340
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuids}
|
|
341
|
+
*/
|
|
342
|
+
getByUIDs<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, uids: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>>;
|
|
343
|
+
/**
|
|
344
|
+
* Fetches pages with specific UIDs and a specific type. This method may make
|
|
345
|
+
* multiple network requests to fetch all matching pages.
|
|
346
|
+
*
|
|
347
|
+
* @example
|
|
348
|
+
*
|
|
349
|
+
* ```ts
|
|
350
|
+
* const pages = await client.getAllByUIDs("blog_post", [
|
|
351
|
+
* "my-first-post",
|
|
352
|
+
* "my-second-post",
|
|
353
|
+
* ])
|
|
354
|
+
* ```
|
|
355
|
+
*
|
|
356
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyuids}
|
|
357
|
+
*/
|
|
358
|
+
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>[]>;
|
|
359
|
+
/**
|
|
360
|
+
* Fetches a specific single type page.
|
|
361
|
+
*
|
|
362
|
+
* @example
|
|
363
|
+
*
|
|
364
|
+
* ```ts
|
|
365
|
+
* const page = await client.getSingle("settings")
|
|
366
|
+
* ```
|
|
367
|
+
*
|
|
368
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getsingle}
|
|
369
|
+
*/
|
|
370
|
+
getSingle<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>>;
|
|
371
|
+
/**
|
|
372
|
+
* Fetches pages with a specific type. Results are paginated.
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
*
|
|
376
|
+
* ```ts
|
|
377
|
+
* const response = await client.getByType("blog_post")
|
|
378
|
+
* ```
|
|
379
|
+
*
|
|
380
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytype}
|
|
381
|
+
*/
|
|
382
|
+
getByType<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>>;
|
|
383
|
+
/**
|
|
384
|
+
* Fetches pages with a specific type. This method may make multiple network
|
|
385
|
+
* requests to fetch all matching documents.
|
|
386
|
+
*
|
|
387
|
+
* @example
|
|
388
|
+
*
|
|
389
|
+
* ```ts
|
|
390
|
+
* const pages = await client.getAllByType("blog_post")
|
|
391
|
+
* ```
|
|
392
|
+
*
|
|
393
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytype}
|
|
394
|
+
*/
|
|
395
|
+
getAllByType<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>[]>;
|
|
396
|
+
/**
|
|
397
|
+
* Fetches pages with a specific tag. Results are paginated.
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
*
|
|
401
|
+
* ```ts
|
|
402
|
+
* const response = await client.getByTag("featured")
|
|
403
|
+
* ```
|
|
404
|
+
*
|
|
405
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytag}
|
|
406
|
+
*/
|
|
407
|
+
getByTag<TDocument extends TDocuments>(tag: string, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
408
|
+
/**
|
|
409
|
+
* Fetches pages with a specific tag. This method may make multiple network
|
|
410
|
+
* requests to fetch all matching documents.
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
*
|
|
414
|
+
* ```ts
|
|
415
|
+
* const pages = await client.getAllByTag("featured")
|
|
416
|
+
* ```
|
|
417
|
+
*
|
|
418
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytag}
|
|
419
|
+
*/
|
|
420
|
+
getAllByTag<TDocument extends TDocuments>(tag: string, params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
421
|
+
/**
|
|
422
|
+
* Fetches pages with every tag from a list of tags. Results are paginated.
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
*
|
|
426
|
+
* ```ts
|
|
427
|
+
* const response = await client.getByEveryTag(["featured", "homepage"])
|
|
428
|
+
* ```
|
|
429
|
+
*
|
|
430
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyeverytag}
|
|
431
|
+
*/
|
|
432
|
+
getByEveryTag<TDocument extends TDocuments>(tags: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
433
|
+
/**
|
|
434
|
+
* Fetches pages with every tag from a list of tags. This method may make
|
|
435
|
+
* multiple network requests to fetch all matching pages.
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
*
|
|
439
|
+
* ```ts
|
|
440
|
+
* const pages = await client.getAllByEveryTag(["featured", "homepage"])
|
|
441
|
+
* ```
|
|
442
|
+
*
|
|
443
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyeverytag}
|
|
444
|
+
*/
|
|
445
|
+
getAllByEveryTag<TDocument extends TDocuments>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
446
|
+
/**
|
|
447
|
+
* Fetches pages with at least one tag from a list of tags. Results are
|
|
448
|
+
* paginated.
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
*
|
|
452
|
+
* ```ts
|
|
453
|
+
* const response = await client.getBySomeTags(["featured", "homepage"])
|
|
454
|
+
* ```
|
|
455
|
+
*
|
|
456
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbysometags}
|
|
457
|
+
*/
|
|
458
|
+
getBySomeTags<TDocument extends TDocuments>(tags: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<Query<TDocument>>;
|
|
459
|
+
/**
|
|
460
|
+
* Fetches pages with at least one tag from a list of tags. This method may
|
|
461
|
+
* make multiple network requests to fetch all matching documents.
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
*
|
|
465
|
+
* ```ts
|
|
466
|
+
* const pages = await client.getAllBySomeTags(["featured", "homepage"])
|
|
467
|
+
* ```
|
|
468
|
+
*
|
|
469
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbysometags}
|
|
470
|
+
*/
|
|
471
|
+
getAllBySomeTags<TDocument extends TDocuments>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
472
|
+
/**
|
|
473
|
+
* Fetches metadata about the client's Prismic repository.
|
|
474
|
+
*
|
|
475
|
+
* @example
|
|
476
|
+
*
|
|
477
|
+
* ```ts
|
|
478
|
+
* const repository = await client.getRepository()
|
|
479
|
+
* ```
|
|
480
|
+
*
|
|
481
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrepository}
|
|
482
|
+
*/
|
|
483
|
+
getRepository(params?: Pick<BuildQueryURLArgs, "accessToken"> & FetchParams): Promise<Repository>;
|
|
484
|
+
/**
|
|
485
|
+
* Fetches the repository's active refs.
|
|
486
|
+
*
|
|
487
|
+
* @example
|
|
488
|
+
*
|
|
489
|
+
* ```ts
|
|
490
|
+
* const refs = await client.getRefs()
|
|
491
|
+
* ```
|
|
492
|
+
*
|
|
493
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefs}
|
|
494
|
+
*/
|
|
495
|
+
getRefs(params?: FetchParams): Promise<Ref[]>;
|
|
496
|
+
/**
|
|
497
|
+
* Fetches a ref by its ID.
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
*
|
|
501
|
+
* ```ts
|
|
502
|
+
* const ref = await client.getRefByID("YhE3YhEAACIA4321")
|
|
503
|
+
* ```
|
|
504
|
+
*
|
|
505
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbyid}
|
|
506
|
+
*/
|
|
507
|
+
getRefByID(id: string, params?: FetchParams): Promise<Ref>;
|
|
508
|
+
/**
|
|
509
|
+
* Fetches a ref by its label. A release ref's label is its name shown in the
|
|
510
|
+
* Page Builder.
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
*
|
|
514
|
+
* ```ts
|
|
515
|
+
* const ref = await client.getRefByLabel("My Release")
|
|
516
|
+
* ```
|
|
517
|
+
*
|
|
518
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbylabel}
|
|
519
|
+
*/
|
|
520
|
+
getRefByLabel(label: string, params?: FetchParams): Promise<Ref>;
|
|
521
|
+
/**
|
|
522
|
+
* Fetches the repository's master ref.
|
|
523
|
+
*
|
|
524
|
+
* @example
|
|
525
|
+
*
|
|
526
|
+
* ```ts
|
|
527
|
+
* const masterRef = await client.getMasterRef()
|
|
528
|
+
* ```
|
|
529
|
+
*
|
|
530
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getmasterref}
|
|
531
|
+
*/
|
|
532
|
+
getMasterRef(params?: FetchParams): Promise<Ref>;
|
|
533
|
+
/**
|
|
534
|
+
* Fetches the repository's active releases.
|
|
535
|
+
*
|
|
536
|
+
* @example
|
|
537
|
+
*
|
|
538
|
+
* ```ts
|
|
539
|
+
* const releases = await client.getReleases()
|
|
540
|
+
* ```
|
|
541
|
+
*
|
|
542
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleases}
|
|
543
|
+
*/
|
|
544
|
+
getReleases(params?: FetchParams): Promise<Ref[]>;
|
|
545
|
+
/**
|
|
546
|
+
* Fetches a release with a specific ID.
|
|
547
|
+
*
|
|
548
|
+
* @example
|
|
549
|
+
*
|
|
550
|
+
* ```ts
|
|
551
|
+
* const release = await client.getReleaseByID("YhE3YhEAACIA4321")
|
|
552
|
+
* ```
|
|
553
|
+
*
|
|
554
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebyid}
|
|
555
|
+
*/
|
|
556
|
+
getReleaseByID(id: string, params?: FetchParams): Promise<Ref>;
|
|
557
|
+
/**
|
|
558
|
+
* Fetches a release by its label. A release ref's label is its name shown in
|
|
559
|
+
* the Page Builder.
|
|
560
|
+
*
|
|
561
|
+
* @example
|
|
562
|
+
*
|
|
563
|
+
* ```ts
|
|
564
|
+
* const release = await client.getReleaseByLabel("My Release")
|
|
565
|
+
* ```
|
|
566
|
+
*
|
|
567
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebylabel}
|
|
568
|
+
*/
|
|
569
|
+
getReleaseByLabel(label: string, params?: FetchParams): Promise<Ref>;
|
|
570
|
+
/**
|
|
571
|
+
* Fetches the repository's page tags.
|
|
572
|
+
*
|
|
573
|
+
* @example
|
|
574
|
+
*
|
|
575
|
+
* ```ts
|
|
576
|
+
* const tags = await client.getTags()
|
|
577
|
+
* ```
|
|
578
|
+
*
|
|
579
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#gettags}
|
|
580
|
+
*/
|
|
581
|
+
getTags(params?: FetchParams): Promise<string[]>;
|
|
582
|
+
/**
|
|
583
|
+
* Builds a Content API query URL with a set of parameters.
|
|
584
|
+
*
|
|
585
|
+
* @example
|
|
586
|
+
*
|
|
587
|
+
* ```ts
|
|
588
|
+
* const url = await client.buildQueryURL({
|
|
589
|
+
* filters: [filter.at("document.type", "blog_post")],
|
|
590
|
+
* })
|
|
591
|
+
* ```
|
|
592
|
+
*
|
|
593
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#buildqueryurl}
|
|
594
|
+
*/
|
|
595
|
+
buildQueryURL({
|
|
596
|
+
signal,
|
|
597
|
+
fetchOptions,
|
|
598
|
+
...params
|
|
599
|
+
}?: Partial<BuildQueryURLArgs> & FetchParams): Promise<string>;
|
|
600
|
+
/**
|
|
601
|
+
* Fetches a previewed page's URL using a preview token and page ID.
|
|
602
|
+
*
|
|
603
|
+
* @example
|
|
604
|
+
*
|
|
605
|
+
* ```ts
|
|
606
|
+
* const url = await client.resolvePreviewURL({
|
|
607
|
+
* linkResolver,
|
|
608
|
+
* defaultURL: "/",
|
|
609
|
+
* })
|
|
610
|
+
* ```
|
|
611
|
+
*
|
|
612
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#resolvepreviewurl}
|
|
613
|
+
*/
|
|
614
|
+
resolvePreviewURL<LinkResolverReturnType>(args: {
|
|
615
|
+
/** A function converts a document to a URL in your website. */
|
|
616
|
+
linkResolver?: LinkResolverFunction<LinkResolverReturnType>;
|
|
617
|
+
/** A fallback URL used when the document does not have a URL. */
|
|
618
|
+
defaultURL: string;
|
|
619
|
+
/** The preview token for the preview session. */
|
|
620
|
+
previewToken?: string;
|
|
621
|
+
/** The previewed document's ID. */
|
|
622
|
+
documentID?: string;
|
|
623
|
+
} & FetchParams): Promise<string>;
|
|
624
|
+
/**
|
|
625
|
+
* Configures the client to query the latest published content. This is the
|
|
626
|
+
* client's default mode.
|
|
627
|
+
*
|
|
628
|
+
* @example
|
|
629
|
+
*
|
|
630
|
+
* ```ts
|
|
631
|
+
* client.queryLatestContent()
|
|
632
|
+
* ```
|
|
633
|
+
*
|
|
634
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querylatestcontent}
|
|
635
|
+
*/
|
|
636
|
+
queryLatestContent(): void;
|
|
637
|
+
/**
|
|
638
|
+
* Configures the client to query content from a release with a specific ID.
|
|
639
|
+
*
|
|
640
|
+
* @example
|
|
641
|
+
*
|
|
642
|
+
* ```ts
|
|
643
|
+
* client.queryContentFromReleaseByID("YhE3YhEAACIA4321")
|
|
644
|
+
* ```
|
|
645
|
+
*
|
|
646
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebyid}
|
|
647
|
+
*/
|
|
648
|
+
queryContentFromReleaseByID(id: string): void;
|
|
649
|
+
/**
|
|
650
|
+
* Configures the client to query content from a release with a specific
|
|
651
|
+
* label.
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
*
|
|
655
|
+
* ```ts
|
|
656
|
+
* client.queryContentFromReleaseByLabel("My Release")
|
|
657
|
+
* ```
|
|
658
|
+
*
|
|
659
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebylabel}
|
|
660
|
+
*/
|
|
661
|
+
queryContentFromReleaseByLabel(label: string): void;
|
|
662
|
+
/**
|
|
663
|
+
* Configures the client to query content from a specific ref.
|
|
664
|
+
*
|
|
665
|
+
* @example
|
|
666
|
+
*
|
|
667
|
+
* ```ts
|
|
668
|
+
* client.queryContentFromRef("my-ref")
|
|
669
|
+
* ```
|
|
670
|
+
*
|
|
671
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromref}
|
|
672
|
+
*/
|
|
673
|
+
queryContentFromRef(ref: string | GetRef): void;
|
|
674
|
+
/**
|
|
675
|
+
* A preconfigured `fetch()` function for Prismic's GraphQL API that can be
|
|
676
|
+
* provided to GraphQL clients.
|
|
677
|
+
*
|
|
678
|
+
* @example
|
|
679
|
+
*
|
|
680
|
+
* ```ts
|
|
681
|
+
* import { createClient, getGraphQLEndpoint } from "@prismicio/client"
|
|
682
|
+
*
|
|
683
|
+
* const client = createClient("example-prismic-repo")
|
|
684
|
+
* const graphQLClient = new ApolloClient({
|
|
685
|
+
* link: new HttpLink({
|
|
686
|
+
* uri: getGraphQLEndpoint(client.repositoryName),
|
|
687
|
+
* // Provide `client.graphQLFetch` as the fetch implementation.
|
|
688
|
+
* fetch: client.graphQLFetch,
|
|
689
|
+
* // Using GET is required.
|
|
690
|
+
* useGETForQueries: true,
|
|
691
|
+
* }),
|
|
692
|
+
* cache: new InMemoryCache(),
|
|
693
|
+
* })
|
|
694
|
+
* ```
|
|
695
|
+
*
|
|
696
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#graphqlfetch}
|
|
697
|
+
*/
|
|
698
|
+
graphQLFetch(input: RequestInfo, init?: Omit<RequestInit, "signal"> & {
|
|
699
|
+
signal?: AbortSignalLike;
|
|
700
|
+
}): Promise<Response>;
|
|
701
|
+
}
|
|
702
|
+
//#endregion
|
|
703
|
+
export { Client, ClientConfig, FetchParams, HttpRequestLike };
|
|
704
|
+
//# sourceMappingURL=Client.d.cts.map
|