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