@prismicio/client 7.21.7 → 7.21.8
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 +39 -77
- package/dist/WriteClient.cjs.map +1 -1
- package/dist/WriteClient.d.cts +24 -63
- package/dist/WriteClient.d.cts.map +1 -1
- package/dist/WriteClient.d.ts +24 -63
- package/dist/WriteClient.d.ts.map +1 -1
- package/dist/WriteClient.js +39 -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 +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 +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/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 +64 -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 +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 +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/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/src/types/value/image.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { FieldState, Simplify } from "./types"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* An individual image within an image field. The base image and each thumbnail
|
|
5
|
-
* uses this type.
|
|
4
|
+
* An individual image within an image field. The base image and each thumbnail uses this type.
|
|
6
5
|
*
|
|
7
6
|
* @typeParam State - State of the field which determines its shape.
|
|
8
|
-
*
|
|
9
7
|
* @see {@link ImageField} for a full image field type.
|
|
10
8
|
*/
|
|
11
|
-
export type ImageFieldImage<State extends FieldState = FieldState> =
|
|
12
|
-
|
|
9
|
+
export type ImageFieldImage<State extends FieldState = FieldState> = State extends "empty"
|
|
10
|
+
? EmptyImageFieldImage
|
|
11
|
+
: FilledImageFieldImage
|
|
13
12
|
|
|
14
13
|
export interface FilledImageFieldImage {
|
|
15
14
|
id: string
|
|
@@ -40,13 +39,12 @@ export interface EmptyImageFieldImage {
|
|
|
40
39
|
/**
|
|
41
40
|
* An image field.
|
|
42
41
|
*
|
|
43
|
-
* **Note**: Passing `null` to the `ThumbnailNames` parameter is deprecated and
|
|
44
|
-
*
|
|
42
|
+
* **Note**: Passing `null` to the `ThumbnailNames` parameter is deprecated and will be removed in a
|
|
43
|
+
* future version. Use `never` instead.
|
|
45
44
|
*
|
|
46
|
-
* @typeParam ThumbnailNames - Names of thumbnails. If the field does not
|
|
47
|
-
*
|
|
45
|
+
* @typeParam ThumbnailNames - Names of thumbnails. If the field does not contain thumbnails,
|
|
46
|
+
* `never` can be used to "disable" thumbnail fields.
|
|
48
47
|
* @typeParam State - State of the field which determines its shape.
|
|
49
|
-
*
|
|
50
48
|
* @see Image field documentation: {@link https://prismic.io/docs/image}
|
|
51
49
|
*/
|
|
52
50
|
export type ImageField<
|
|
@@ -71,8 +69,6 @@ export type ImageField<
|
|
|
71
69
|
// version written below. This version leads to a better code
|
|
72
70
|
// editor experience.
|
|
73
71
|
State extends "filled"
|
|
74
|
-
? ImageFieldImage<State> &
|
|
75
|
-
|
|
76
|
-
: ImageFieldImage<State> &
|
|
77
|
-
Record<Extract<ThumbnailNames, string>, ImageFieldImage<State>>
|
|
72
|
+
? ImageFieldImage<State> & Record<Extract<ThumbnailNames, string>, ImageFieldImage<State>>
|
|
73
|
+
: ImageFieldImage<State> & Record<Extract<ThumbnailNames, string>, ImageFieldImage<State>>
|
|
78
74
|
>
|
|
@@ -5,7 +5,6 @@ import type { FieldState } from "./types"
|
|
|
5
5
|
*
|
|
6
6
|
* @typeParam Data - Data from the integrated API.
|
|
7
7
|
* @typeParam State - State of the field which determines its shape.
|
|
8
|
-
*
|
|
9
8
|
* @see More details: {@link https://prismic.io/docs/fields/integration}
|
|
10
9
|
*/
|
|
11
10
|
export type IntegrationField<
|
|
@@ -4,8 +4,8 @@ import type { FieldState } from "./types"
|
|
|
4
4
|
* A key text field
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
-
*
|
|
8
7
|
* @see More details: {@link https://prismic.io/docs/key-text}
|
|
9
8
|
*/
|
|
10
|
-
export type KeyTextField<State extends FieldState = FieldState> =
|
|
11
|
-
|
|
9
|
+
export type KeyTextField<State extends FieldState = FieldState> = State extends "empty"
|
|
10
|
+
? null | ""
|
|
11
|
+
: string
|
package/src/types/value/link.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type { AnyRegularField, FieldState } from "./types"
|
|
2
|
-
|
|
3
1
|
import type { FilledContentRelationshipField } from "./contentRelationship"
|
|
4
2
|
import type { GroupField } from "./group"
|
|
5
3
|
import type { FilledLinkToMediaField } from "./linkToMedia"
|
|
6
4
|
import type { SliceZone } from "./sliceZone"
|
|
5
|
+
import type { AnyRegularField, FieldState } from "./types"
|
|
7
6
|
|
|
8
|
-
/**
|
|
9
|
-
* Link types
|
|
10
|
-
*/
|
|
7
|
+
/** Link types */
|
|
11
8
|
export const LinkType = {
|
|
12
9
|
Any: "Any",
|
|
13
10
|
Document: "Document",
|
|
@@ -20,17 +17,16 @@ export const LinkType = {
|
|
|
20
17
|
*
|
|
21
18
|
* @typeParam TypeEnum - Type API ID of the document.
|
|
22
19
|
* @typeParam LangEnum - Language API ID of the document.
|
|
23
|
-
* @typeParam DataInterface - Data fields for the document (filled via the
|
|
24
|
-
* `
|
|
20
|
+
* @typeParam DataInterface - Data fields for the document (filled via the `fetchLinks` or
|
|
21
|
+
* `graphQuery` query parameter).
|
|
25
22
|
* @typeParam State - State of the field which determines its shape.
|
|
26
23
|
* @typeParam Variant - Variants of the link.
|
|
27
24
|
*/
|
|
28
25
|
export type LinkField<
|
|
29
26
|
TypeEnum = string,
|
|
30
27
|
LangEnum = string,
|
|
31
|
-
DataInterface extends
|
|
32
|
-
|
|
33
|
-
| unknown = unknown,
|
|
28
|
+
DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown =
|
|
29
|
+
unknown,
|
|
34
30
|
State extends FieldState = FieldState,
|
|
35
31
|
Variant = string,
|
|
36
32
|
> = State extends "empty"
|
|
@@ -42,16 +38,15 @@ export type LinkField<
|
|
|
42
38
|
*
|
|
43
39
|
* @typeParam TypeEnum - Type API ID of the document.
|
|
44
40
|
* @typeParam LangEnum - Language API ID of the document.
|
|
45
|
-
* @typeParam DataInterface - Data fields for the document (filled via the
|
|
46
|
-
* `
|
|
41
|
+
* @typeParam DataInterface - Data fields for the document (filled via the `fetchLinks` or
|
|
42
|
+
* `graphQuery` query parameter).
|
|
47
43
|
* @typeParam Variant - Variants of the link.
|
|
48
44
|
*/
|
|
49
45
|
export type FilledLinkField<
|
|
50
46
|
TypeEnum = string,
|
|
51
47
|
LangEnum = string,
|
|
52
|
-
DataInterface extends
|
|
53
|
-
|
|
54
|
-
| unknown = unknown,
|
|
48
|
+
DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown =
|
|
49
|
+
unknown,
|
|
55
50
|
Variant = string,
|
|
56
51
|
> =
|
|
57
52
|
| (FilledContentRelationshipField<TypeEnum, LangEnum, DataInterface> &
|
|
@@ -63,12 +58,11 @@ export type FilledLinkField<
|
|
|
63
58
|
* A link field that is not filled.
|
|
64
59
|
*
|
|
65
60
|
* @typeParam _Unused - THIS PARAMETER IS NOT USED. If you are passing a type,
|
|
66
|
-
*
|
|
61
|
+
* **please remove it**.
|
|
67
62
|
* @typeParam Variant - Variants of the link.
|
|
68
63
|
*/
|
|
69
64
|
export type EmptyLinkField<
|
|
70
|
-
_Unused extends
|
|
71
|
-
(typeof LinkType)[keyof typeof LinkType] = typeof LinkType.Any,
|
|
65
|
+
_Unused extends (typeof LinkType)[keyof typeof LinkType] = typeof LinkType.Any,
|
|
72
66
|
Variant = string,
|
|
73
67
|
> = {
|
|
74
68
|
link_type: "Any"
|
|
@@ -86,12 +80,10 @@ export type FilledLinkToWebField<Variant = string> = {
|
|
|
86
80
|
} & OptionalLinkProperties<Variant>
|
|
87
81
|
|
|
88
82
|
/**
|
|
89
|
-
* Optional properties available to link fields. It is used to augment existing
|
|
90
|
-
*
|
|
91
|
-
* properties.
|
|
83
|
+
* Optional properties available to link fields. It is used to augment existing link-like fields
|
|
84
|
+
* (like content relationship fields) with field-specific properties.
|
|
92
85
|
*
|
|
93
86
|
* @typeParam Variant - Variants of the link.
|
|
94
|
-
*
|
|
95
87
|
* @internal
|
|
96
88
|
*/
|
|
97
89
|
// Remember to update the `getOptionalLinkProperties()` function when updating
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { FieldState } from "./types"
|
|
2
|
-
|
|
3
1
|
import type { OptionalLinkProperties } from "./link"
|
|
2
|
+
import type { FieldState } from "./types"
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* A link field that points to media.
|
|
@@ -11,9 +10,7 @@ import type { OptionalLinkProperties } from "./link"
|
|
|
11
10
|
export type LinkToMediaField<
|
|
12
11
|
State extends FieldState = FieldState,
|
|
13
12
|
Variant = string,
|
|
14
|
-
> = State extends "empty"
|
|
15
|
-
? EmptyLinkToMediaField<Variant>
|
|
16
|
-
: FilledLinkToMediaField<Variant>
|
|
13
|
+
> = State extends "empty" ? EmptyLinkToMediaField<Variant> : FilledLinkToMediaField<Variant>
|
|
17
14
|
|
|
18
15
|
type EmptyLinkToMediaField<Variant = string> = {
|
|
19
16
|
link_type: "Any"
|
|
@@ -4,8 +4,8 @@ import type { FieldState } from "./types"
|
|
|
4
4
|
* A number field.
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
-
*
|
|
8
7
|
* @see More details: {@link https://prismic.io/docs/number}
|
|
9
8
|
*/
|
|
10
|
-
export type NumberField<State extends FieldState = FieldState> =
|
|
11
|
-
|
|
9
|
+
export type NumberField<State extends FieldState = FieldState> = State extends "empty"
|
|
10
|
+
? null
|
|
11
|
+
: number
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { FieldState } from "./types"
|
|
2
|
-
|
|
3
1
|
import type { EmbedField } from "./embed"
|
|
4
2
|
import type { FilledLinkField } from "./link"
|
|
3
|
+
import type { FieldState } from "./types"
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Types enum for RichTextNodes
|
|
@@ -35,116 +34,85 @@ export const RichTextNodeType = {
|
|
|
35
34
|
*
|
|
36
35
|
* @see More details: {@link https://prismic.io/docs/rich-text-title}
|
|
37
36
|
*/
|
|
38
|
-
export type RichTextNodeTypes =
|
|
39
|
-
(typeof RichTextNodeType)[keyof typeof RichTextNodeType]
|
|
37
|
+
export type RichTextNodeTypes = (typeof RichTextNodeType)[keyof typeof RichTextNodeType]
|
|
40
38
|
|
|
41
39
|
// Text nodes
|
|
42
40
|
|
|
43
|
-
/**
|
|
44
|
-
* Base to be extended by other rich text nodes.
|
|
45
|
-
*/
|
|
41
|
+
/** Base to be extended by other rich text nodes. */
|
|
46
42
|
export interface RTTextNodeBase {
|
|
47
43
|
text: string
|
|
48
44
|
spans: RTInlineNode[]
|
|
49
45
|
direction?: "ltr" | "rtl"
|
|
50
46
|
}
|
|
51
47
|
|
|
52
|
-
/**
|
|
53
|
-
* Rich text `heading1` node
|
|
54
|
-
*/
|
|
48
|
+
/** Rich text `heading1` node */
|
|
55
49
|
export interface RTHeading1Node extends RTTextNodeBase {
|
|
56
50
|
type: typeof RichTextNodeType.heading1
|
|
57
51
|
}
|
|
58
52
|
|
|
59
|
-
/**
|
|
60
|
-
* Rich text `heading2` node
|
|
61
|
-
*/
|
|
53
|
+
/** Rich text `heading2` node */
|
|
62
54
|
export interface RTHeading2Node extends RTTextNodeBase {
|
|
63
55
|
type: typeof RichTextNodeType.heading2
|
|
64
56
|
}
|
|
65
57
|
|
|
66
|
-
/**
|
|
67
|
-
* Rich text `heading3` node
|
|
68
|
-
*/
|
|
58
|
+
/** Rich text `heading3` node */
|
|
69
59
|
export interface RTHeading3Node extends RTTextNodeBase {
|
|
70
60
|
type: typeof RichTextNodeType.heading3
|
|
71
61
|
}
|
|
72
62
|
|
|
73
|
-
/**
|
|
74
|
-
* Rich text `heading4` node
|
|
75
|
-
*/
|
|
63
|
+
/** Rich text `heading4` node */
|
|
76
64
|
export interface RTHeading4Node extends RTTextNodeBase {
|
|
77
65
|
type: typeof RichTextNodeType.heading4
|
|
78
66
|
}
|
|
79
67
|
|
|
80
|
-
/**
|
|
81
|
-
* Rich text `heading5` node
|
|
82
|
-
*/
|
|
68
|
+
/** Rich text `heading5` node */
|
|
83
69
|
export interface RTHeading5Node extends RTTextNodeBase {
|
|
84
70
|
type: typeof RichTextNodeType.heading5
|
|
85
71
|
}
|
|
86
72
|
|
|
87
|
-
/**
|
|
88
|
-
* Rich text `heading6` node
|
|
89
|
-
*/
|
|
73
|
+
/** Rich text `heading6` node */
|
|
90
74
|
export interface RTHeading6Node extends RTTextNodeBase {
|
|
91
75
|
type: typeof RichTextNodeType.heading6
|
|
92
76
|
}
|
|
93
77
|
|
|
94
|
-
/**
|
|
95
|
-
* Rich text `paragraph` node
|
|
96
|
-
*/
|
|
78
|
+
/** Rich text `paragraph` node */
|
|
97
79
|
export interface RTParagraphNode extends RTTextNodeBase {
|
|
98
80
|
type: typeof RichTextNodeType.paragraph
|
|
99
81
|
}
|
|
100
82
|
|
|
101
|
-
/**
|
|
102
|
-
* Rich text `preformatted` node
|
|
103
|
-
*/
|
|
83
|
+
/** Rich text `preformatted` node */
|
|
104
84
|
export interface RTPreformattedNode extends RTTextNodeBase {
|
|
105
85
|
type: typeof RichTextNodeType.preformatted
|
|
106
86
|
}
|
|
107
87
|
|
|
108
|
-
/**
|
|
109
|
-
* Rich text `list-item` node
|
|
110
|
-
*/
|
|
88
|
+
/** Rich text `list-item` node */
|
|
111
89
|
export interface RTListItemNode extends RTTextNodeBase {
|
|
112
90
|
type: typeof RichTextNodeType.listItem
|
|
113
91
|
}
|
|
114
92
|
|
|
115
|
-
/**
|
|
116
|
-
* Rich text `o-list-item` node for ordered lists
|
|
117
|
-
*/
|
|
93
|
+
/** Rich text `o-list-item` node for ordered lists */
|
|
118
94
|
export interface RTOListItemNode extends RTTextNodeBase {
|
|
119
95
|
type: typeof RichTextNodeType.oListItem
|
|
120
96
|
}
|
|
121
97
|
|
|
122
98
|
// Span nodes
|
|
123
99
|
|
|
124
|
-
/**
|
|
125
|
-
* @internal Span Node base to be extended for other Span nodes
|
|
126
|
-
*/
|
|
100
|
+
/** @internal Span Node base to be extended for other Span nodes */
|
|
127
101
|
export interface RTSpanNodeBase {
|
|
128
102
|
start: number
|
|
129
103
|
end: number
|
|
130
104
|
}
|
|
131
|
-
/**
|
|
132
|
-
* Rich text `strong` node
|
|
133
|
-
*/
|
|
105
|
+
/** Rich text `strong` node */
|
|
134
106
|
export interface RTStrongNode extends RTSpanNodeBase {
|
|
135
107
|
type: typeof RichTextNodeType.strong
|
|
136
108
|
}
|
|
137
109
|
|
|
138
|
-
/**
|
|
139
|
-
* Rich text `embed` node
|
|
140
|
-
*/
|
|
110
|
+
/** Rich text `embed` node */
|
|
141
111
|
export interface RTEmNode extends RTSpanNodeBase {
|
|
142
112
|
type: typeof RichTextNodeType.em
|
|
143
113
|
}
|
|
144
114
|
|
|
145
|
-
/**
|
|
146
|
-
* Rich text `label` node
|
|
147
|
-
*/
|
|
115
|
+
/** Rich text `label` node */
|
|
148
116
|
export interface RTLabelNode extends RTSpanNodeBase {
|
|
149
117
|
type: typeof RichTextNodeType.label
|
|
150
118
|
data: {
|
|
@@ -154,10 +122,7 @@ export interface RTLabelNode extends RTSpanNodeBase {
|
|
|
154
122
|
|
|
155
123
|
// Media nodes
|
|
156
124
|
|
|
157
|
-
/**
|
|
158
|
-
* Rich text `image` nodes. They could link to other documents, external web
|
|
159
|
-
* links and media fields
|
|
160
|
-
*/
|
|
125
|
+
/** Rich text `image` nodes. They could link to other documents, external web links and media fields */
|
|
161
126
|
export type RTImageNode = {
|
|
162
127
|
type: typeof RichTextNodeType.image
|
|
163
128
|
id: string
|
|
@@ -177,9 +142,7 @@ export type RTImageNode = {
|
|
|
177
142
|
linkTo?: FilledLinkField
|
|
178
143
|
}
|
|
179
144
|
|
|
180
|
-
/**
|
|
181
|
-
* Rich text `embed` node
|
|
182
|
-
*/
|
|
145
|
+
/** Rich text `embed` node */
|
|
183
146
|
export type RTEmbedNode = {
|
|
184
147
|
type: typeof RichTextNodeType.embed
|
|
185
148
|
oembed: EmbedField
|
|
@@ -199,35 +162,27 @@ export interface RTLinkNode extends RTSpanNodeBase {
|
|
|
199
162
|
|
|
200
163
|
// Serialization related nodes
|
|
201
164
|
|
|
202
|
-
/**
|
|
203
|
-
* Rich text `list` node
|
|
204
|
-
*/
|
|
165
|
+
/** Rich text `list` node */
|
|
205
166
|
export interface RTListNode {
|
|
206
167
|
type: typeof RichTextNodeType.list
|
|
207
168
|
items: RTListItemNode[]
|
|
208
169
|
}
|
|
209
170
|
|
|
210
|
-
/**
|
|
211
|
-
* Rich text o-lost node
|
|
212
|
-
*/
|
|
171
|
+
/** Rich text o-lost node */
|
|
213
172
|
export interface RTOListNode {
|
|
214
173
|
type: typeof RichTextNodeType.oList
|
|
215
174
|
items: RTOListItemNode[]
|
|
216
175
|
}
|
|
217
176
|
|
|
218
177
|
// This one is confusing but it's actually the inner content of a block
|
|
219
|
-
/**
|
|
220
|
-
* Rich text `span` node
|
|
221
|
-
*/
|
|
178
|
+
/** Rich text `span` node */
|
|
222
179
|
export interface RTSpanNode extends RTTextNodeBase {
|
|
223
180
|
type: typeof RichTextNodeType.span
|
|
224
181
|
}
|
|
225
182
|
|
|
226
183
|
// Helpers
|
|
227
184
|
|
|
228
|
-
/**
|
|
229
|
-
* Nodes from a rich text field
|
|
230
|
-
*/
|
|
185
|
+
/** Nodes from a rich text field */
|
|
231
186
|
export type RTNode =
|
|
232
187
|
| RTHeading1Node
|
|
233
188
|
| RTHeading2Node
|
|
@@ -242,9 +197,7 @@ export type RTNode =
|
|
|
242
197
|
| RTImageNode
|
|
243
198
|
| RTEmbedNode
|
|
244
199
|
|
|
245
|
-
/**
|
|
246
|
-
* Rich text nodes with text
|
|
247
|
-
*/
|
|
200
|
+
/** Rich text nodes with text */
|
|
248
201
|
export type RTTextNode =
|
|
249
202
|
| RTHeading1Node
|
|
250
203
|
| RTHeading2Node
|
|
@@ -257,9 +210,7 @@ export type RTTextNode =
|
|
|
257
210
|
| RTListItemNode
|
|
258
211
|
| RTOListItemNode
|
|
259
212
|
|
|
260
|
-
/**
|
|
261
|
-
* Rich text block nodes
|
|
262
|
-
*/
|
|
213
|
+
/** Rich text block nodes */
|
|
263
214
|
export type RTBlockNode =
|
|
264
215
|
| RTHeading1Node
|
|
265
216
|
| RTHeading2Node
|
|
@@ -276,14 +227,10 @@ export type RTBlockNode =
|
|
|
276
227
|
| RTImageNode
|
|
277
228
|
| RTEmbedNode
|
|
278
229
|
|
|
279
|
-
/**
|
|
280
|
-
* Inline rich text nodes
|
|
281
|
-
*/
|
|
230
|
+
/** Inline rich text nodes */
|
|
282
231
|
export type RTInlineNode = RTStrongNode | RTEmNode | RTLabelNode | RTLinkNode
|
|
283
232
|
|
|
284
|
-
/**
|
|
285
|
-
* All rich text nodes
|
|
286
|
-
*/
|
|
233
|
+
/** All rich text nodes */
|
|
287
234
|
export type RTAnyNode = RTBlockNode | RTInlineNode | RTSpanNode
|
|
288
235
|
|
|
289
236
|
/**
|
|
@@ -291,5 +238,6 @@ export type RTAnyNode = RTBlockNode | RTInlineNode | RTSpanNode
|
|
|
291
238
|
*
|
|
292
239
|
* @see Rich text field documentation: {@link https://prismic.io/docs/rich-text-title}
|
|
293
240
|
*/
|
|
294
|
-
export type RichTextField<State extends FieldState = FieldState> =
|
|
295
|
-
|
|
241
|
+
export type RichTextField<State extends FieldState = FieldState> = State extends "empty"
|
|
242
|
+
? []
|
|
243
|
+
: [RTNode, ...RTNode[]]
|
|
@@ -5,7 +5,6 @@ import type { FieldState } from "./types"
|
|
|
5
5
|
*
|
|
6
6
|
* @typeParam Enum - Selectable options for the field.
|
|
7
7
|
* @typeParam State - State of the field which determines its shape.
|
|
8
|
-
*
|
|
9
8
|
* @see More details: {@link https://prismic.io/docs/select}
|
|
10
9
|
*/
|
|
11
10
|
export type SelectField<
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import type { AnyRegularField, AnySlicePrimaryField } from "./types"
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* A shared Slice variation.
|
|
5
|
-
*/
|
|
3
|
+
/** A shared Slice variation. */
|
|
6
4
|
export interface SharedSliceVariation<
|
|
7
5
|
Variation = string,
|
|
8
|
-
PrimaryFields extends Record<string, AnySlicePrimaryField> = Record<
|
|
9
|
-
|
|
10
|
-
AnySlicePrimaryField
|
|
11
|
-
>,
|
|
12
|
-
ItemsFields extends Record<string, AnyRegularField> = Record<
|
|
13
|
-
string,
|
|
14
|
-
AnyRegularField
|
|
15
|
-
>,
|
|
6
|
+
PrimaryFields extends Record<string, AnySlicePrimaryField> = Record<string, AnySlicePrimaryField>,
|
|
7
|
+
ItemsFields extends Record<string, AnyRegularField> = Record<string, AnyRegularField>,
|
|
16
8
|
> {
|
|
17
9
|
variation: Variation
|
|
18
10
|
version: string
|
package/src/types/value/slice.ts
CHANGED
|
@@ -7,14 +7,8 @@ import type { AnyRegularField } from "./types"
|
|
|
7
7
|
*/
|
|
8
8
|
export interface Slice<
|
|
9
9
|
SliceType = string,
|
|
10
|
-
PrimaryFields extends Record<string, AnyRegularField> = Record<
|
|
11
|
-
|
|
12
|
-
AnyRegularField
|
|
13
|
-
>,
|
|
14
|
-
ItemsFields extends Record<string, AnyRegularField> = Record<
|
|
15
|
-
string,
|
|
16
|
-
AnyRegularField
|
|
17
|
-
>,
|
|
10
|
+
PrimaryFields extends Record<string, AnyRegularField> = Record<string, AnyRegularField>,
|
|
11
|
+
ItemsFields extends Record<string, AnyRegularField> = Record<string, AnyRegularField>,
|
|
18
12
|
> {
|
|
19
13
|
slice_type: SliceType
|
|
20
14
|
slice_label: string | null
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import type { FieldState } from "./types"
|
|
2
|
-
|
|
3
1
|
import type { SharedSlice } from "./sharedSlice"
|
|
4
2
|
import type { Slice } from "./slice"
|
|
3
|
+
import type { FieldState } from "./types"
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
|
-
* Prismic Slices are sections of your website. Prismic documents contain a
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* landing pages, case studies, and tutorials.
|
|
6
|
+
* Prismic Slices are sections of your website. Prismic documents contain a dynamic "Slice Zone"
|
|
7
|
+
* that allows content creators to add, edit, and rearrange Slices to compose dynamic layouts for
|
|
8
|
+
* any page design, such as blog posts, landing pages, case studies, and tutorials.
|
|
11
9
|
*
|
|
12
10
|
* @see More details: {@link https://prismic.io/docs/slice}
|
|
13
11
|
*/
|
package/src/types/value/table.ts
CHANGED
|
@@ -1,109 +1,70 @@
|
|
|
1
|
-
import type { FieldState } from "./types"
|
|
2
|
-
|
|
3
1
|
import type { RichTextField } from "./richText"
|
|
2
|
+
import type { FieldState } from "./types"
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* A table field.
|
|
7
6
|
*
|
|
8
7
|
* @typeParam State - State of the field which determines its shape.
|
|
9
|
-
*
|
|
10
8
|
* @see More details: {@link https://prismic.io/docs/table}
|
|
11
9
|
*/
|
|
12
|
-
export type TableField<State extends FieldState = FieldState> =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* The head of the table.
|
|
18
|
-
*/
|
|
19
|
-
head?: TableFieldHead
|
|
10
|
+
export type TableField<State extends FieldState = FieldState> = State extends "empty"
|
|
11
|
+
? null
|
|
12
|
+
: {
|
|
13
|
+
/** The head of the table. */
|
|
14
|
+
head?: TableFieldHead
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
body: TableFieldBody
|
|
25
|
-
}
|
|
16
|
+
/** The body of the table. */
|
|
17
|
+
body: TableFieldBody
|
|
18
|
+
}
|
|
26
19
|
|
|
27
|
-
/**
|
|
28
|
-
* Represents a table head.
|
|
29
|
-
*/
|
|
20
|
+
/** Represents a table head. */
|
|
30
21
|
export type TableFieldHead = {
|
|
31
22
|
rows: TableFieldHeadRow[]
|
|
32
23
|
}
|
|
33
24
|
|
|
34
|
-
/**
|
|
35
|
-
* Represents a table body.
|
|
36
|
-
*/
|
|
25
|
+
/** Represents a table body. */
|
|
37
26
|
export type TableFieldBody = {
|
|
38
27
|
rows: TableFieldBodyRow[]
|
|
39
28
|
}
|
|
40
29
|
|
|
41
|
-
/**
|
|
42
|
-
* Represents a row in a table head.
|
|
43
|
-
*/
|
|
30
|
+
/** Represents a row in a table head. */
|
|
44
31
|
export type TableFieldHeadRow = {
|
|
45
|
-
/**
|
|
46
|
-
* Unique key of the row.
|
|
47
|
-
*/
|
|
32
|
+
/** Unique key of the row. */
|
|
48
33
|
key: string
|
|
49
34
|
|
|
50
|
-
/**
|
|
51
|
-
* Cells in the row.
|
|
52
|
-
*/
|
|
35
|
+
/** Cells in the row. */
|
|
53
36
|
cells: TableFieldHeaderCell[]
|
|
54
37
|
}
|
|
55
38
|
|
|
56
|
-
/**
|
|
57
|
-
* Represents a table header cell.
|
|
58
|
-
*/
|
|
39
|
+
/** Represents a table header cell. */
|
|
59
40
|
export type TableFieldHeaderCell = {
|
|
60
|
-
/**
|
|
61
|
-
* Unique key of the cell.
|
|
62
|
-
*/
|
|
41
|
+
/** Unique key of the cell. */
|
|
63
42
|
key: string
|
|
64
43
|
|
|
65
|
-
/**
|
|
66
|
-
* The type of the cell.
|
|
67
|
-
*/
|
|
44
|
+
/** The type of the cell. */
|
|
68
45
|
type: "header"
|
|
69
46
|
|
|
70
|
-
/**
|
|
71
|
-
* The content of the cell.
|
|
72
|
-
*/
|
|
47
|
+
/** The content of the cell. */
|
|
73
48
|
content: RichTextField
|
|
74
49
|
}
|
|
75
50
|
|
|
76
|
-
/**
|
|
77
|
-
* Represents a row in a table body.
|
|
78
|
-
*/
|
|
51
|
+
/** Represents a row in a table body. */
|
|
79
52
|
export type TableFieldBodyRow = {
|
|
80
|
-
/**
|
|
81
|
-
* Unique key of the row.
|
|
82
|
-
*/
|
|
53
|
+
/** Unique key of the row. */
|
|
83
54
|
key: string
|
|
84
55
|
|
|
85
|
-
/**
|
|
86
|
-
* Cells in the row.
|
|
87
|
-
*/
|
|
56
|
+
/** Cells in the row. */
|
|
88
57
|
cells: (TableFieldHeaderCell | TableFieldDataCell)[]
|
|
89
58
|
}
|
|
90
59
|
|
|
91
|
-
/**
|
|
92
|
-
* Represents a table data cell.
|
|
93
|
-
*/
|
|
60
|
+
/** Represents a table data cell. */
|
|
94
61
|
export type TableFieldDataCell = {
|
|
95
|
-
/**
|
|
96
|
-
* Unique key of the cell.
|
|
97
|
-
*/
|
|
62
|
+
/** Unique key of the cell. */
|
|
98
63
|
key: string
|
|
99
64
|
|
|
100
|
-
/**
|
|
101
|
-
* The type of the cell.
|
|
102
|
-
*/
|
|
65
|
+
/** The type of the cell. */
|
|
103
66
|
type: "data"
|
|
104
67
|
|
|
105
|
-
/**
|
|
106
|
-
* The content of the cell.
|
|
107
|
-
*/
|
|
68
|
+
/** The content of the cell. */
|
|
108
69
|
content: RichTextField
|
|
109
70
|
}
|
|
@@ -5,5 +5,6 @@ import type { FieldState } from "./types"
|
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
7
|
*/
|
|
8
|
-
export type TimestampField<State extends FieldState = FieldState> =
|
|
9
|
-
|
|
8
|
+
export type TimestampField<State extends FieldState = FieldState> = State extends "empty"
|
|
9
|
+
? null
|
|
10
|
+
: string
|