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