@prismicio/client 7.21.7-pr.444.5136044 → 7.21.7
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 +263 -190
- package/dist/Client.cjs.map +1 -1
- package/dist/Client.d.cts +241 -175
- package/dist/Client.d.cts.map +1 -1
- package/dist/Client.d.ts +241 -175
- package/dist/Client.d.ts.map +1 -1
- package/dist/Client.js +263 -190
- package/dist/Client.js.map +1 -1
- package/dist/Migration.cjs +86 -54
- package/dist/Migration.cjs.map +1 -1
- package/dist/Migration.d.cts +84 -50
- package/dist/Migration.d.cts.map +1 -1
- package/dist/Migration.d.ts +84 -50
- package/dist/Migration.d.ts.map +1 -1
- package/dist/Migration.js +86 -54
- package/dist/Migration.js.map +1 -1
- package/dist/WriteClient.cjs +77 -39
- package/dist/WriteClient.cjs.map +1 -1
- package/dist/WriteClient.d.cts +63 -24
- package/dist/WriteClient.d.cts.map +1 -1
- package/dist/WriteClient.d.ts +63 -24
- package/dist/WriteClient.d.ts.map +1 -1
- package/dist/WriteClient.js +77 -39
- package/dist/WriteClient.js.map +1 -1
- package/dist/buildQueryURL.cjs +22 -15
- package/dist/buildQueryURL.cjs.map +1 -1
- package/dist/buildQueryURL.d.cts +63 -53
- package/dist/buildQueryURL.d.cts.map +1 -1
- package/dist/buildQueryURL.d.ts +63 -53
- package/dist/buildQueryURL.d.ts.map +1 -1
- package/dist/buildQueryURL.js +22 -15
- package/dist/buildQueryURL.js.map +1 -1
- package/dist/cookie.cjs +4 -1
- package/dist/cookie.cjs.map +1 -1
- package/dist/cookie.d.cts +4 -1
- package/dist/cookie.d.cts.map +1 -1
- package/dist/cookie.d.ts +4 -1
- package/dist/cookie.d.ts.map +1 -1
- package/dist/cookie.js +4 -1
- package/dist/cookie.js.map +1 -1
- package/dist/createClient.cjs +14 -10
- package/dist/createClient.cjs.map +1 -1
- package/dist/createClient.d.cts +18 -11
- package/dist/createClient.d.cts.map +1 -1
- package/dist/createClient.d.ts +18 -11
- package/dist/createClient.d.ts.map +1 -1
- package/dist/createClient.js +14 -10
- package/dist/createClient.js.map +1 -1
- package/dist/createMigration.cjs +7 -4
- package/dist/createMigration.cjs.map +1 -1
- package/dist/createMigration.d.cts +11 -5
- package/dist/createMigration.d.cts.map +1 -1
- package/dist/createMigration.d.ts +11 -5
- package/dist/createMigration.d.ts.map +1 -1
- package/dist/createMigration.js +7 -4
- package/dist/createMigration.js.map +1 -1
- package/dist/createWriteClient.cjs +13 -8
- package/dist/createWriteClient.cjs.map +1 -1
- package/dist/createWriteClient.d.cts +15 -10
- package/dist/createWriteClient.d.cts.map +1 -1
- package/dist/createWriteClient.d.ts +15 -10
- package/dist/createWriteClient.d.ts.map +1 -1
- package/dist/createWriteClient.js +13 -8
- 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 +18 -5
- package/dist/filter.cjs.map +1 -1
- package/dist/filter.d.cts +63 -59
- package/dist/filter.d.cts.map +1 -1
- package/dist/filter.d.ts +63 -59
- package/dist/filter.d.ts.map +1 -1
- package/dist/filter.js +18 -5
- package/dist/filter.js.map +1 -1
- package/dist/getGraphQLEndpoint.cjs +2 -0
- package/dist/getGraphQLEndpoint.cjs.map +1 -1
- package/dist/getGraphQLEndpoint.d.cts +2 -0
- package/dist/getGraphQLEndpoint.d.cts.map +1 -1
- package/dist/getGraphQLEndpoint.d.ts +2 -0
- package/dist/getGraphQLEndpoint.d.ts.map +1 -1
- package/dist/getGraphQLEndpoint.js +2 -0
- package/dist/getGraphQLEndpoint.js.map +1 -1
- package/dist/getRepositoryEndpoint.cjs +8 -4
- package/dist/getRepositoryEndpoint.cjs.map +1 -1
- package/dist/getRepositoryEndpoint.d.cts +8 -4
- package/dist/getRepositoryEndpoint.d.cts.map +1 -1
- package/dist/getRepositoryEndpoint.d.ts +8 -4
- package/dist/getRepositoryEndpoint.d.ts.map +1 -1
- package/dist/getRepositoryEndpoint.js +8 -4
- package/dist/getRepositoryEndpoint.js.map +1 -1
- package/dist/getRepositoryName.cjs +5 -2
- package/dist/getRepositoryName.cjs.map +1 -1
- package/dist/getRepositoryName.d.cts +5 -2
- package/dist/getRepositoryName.d.cts.map +1 -1
- package/dist/getRepositoryName.d.ts +5 -2
- package/dist/getRepositoryName.d.ts.map +1 -1
- package/dist/getRepositoryName.js +5 -2
- package/dist/getRepositoryName.js.map +1 -1
- package/dist/getToolbarSrc.cjs +19 -17
- package/dist/getToolbarSrc.cjs.map +1 -1
- package/dist/getToolbarSrc.d.cts +19 -17
- package/dist/getToolbarSrc.d.cts.map +1 -1
- package/dist/getToolbarSrc.d.ts +19 -17
- package/dist/getToolbarSrc.d.ts.map +1 -1
- package/dist/getToolbarSrc.js +19 -17
- package/dist/getToolbarSrc.js.map +1 -1
- package/dist/helpers/asDate.cjs +9 -6
- package/dist/helpers/asDate.cjs.map +1 -1
- package/dist/helpers/asDate.d.cts +10 -5
- package/dist/helpers/asDate.d.cts.map +1 -1
- package/dist/helpers/asDate.d.ts +10 -5
- package/dist/helpers/asDate.d.ts.map +1 -1
- package/dist/helpers/asDate.js +9 -6
- package/dist/helpers/asDate.js.map +1 -1
- package/dist/helpers/asHTML.cjs +26 -25
- package/dist/helpers/asHTML.cjs.map +1 -1
- package/dist/helpers/asHTML.d.cts +55 -29
- package/dist/helpers/asHTML.d.cts.map +1 -1
- package/dist/helpers/asHTML.d.ts +55 -29
- package/dist/helpers/asHTML.d.ts.map +1 -1
- package/dist/helpers/asHTML.js +26 -25
- package/dist/helpers/asHTML.js.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +27 -21
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts +36 -25
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +36 -25
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.js +27 -21
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
- package/dist/helpers/asImageSrc.cjs +12 -7
- package/dist/helpers/asImageSrc.cjs.map +1 -1
- package/dist/helpers/asImageSrc.d.cts +15 -8
- package/dist/helpers/asImageSrc.d.cts.map +1 -1
- package/dist/helpers/asImageSrc.d.ts +15 -8
- package/dist/helpers/asImageSrc.d.ts.map +1 -1
- package/dist/helpers/asImageSrc.js +12 -7
- package/dist/helpers/asImageSrc.js.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.cjs +32 -25
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.cts +41 -29
- package/dist/helpers/asImageWidthSrcSet.d.cts.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.ts +41 -29
- package/dist/helpers/asImageWidthSrcSet.d.ts.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.js +32 -25
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
- package/dist/helpers/asLink.cjs.map +1 -1
- package/dist/helpers/asLink.d.cts +32 -15
- package/dist/helpers/asLink.d.cts.map +1 -1
- package/dist/helpers/asLink.d.ts +32 -15
- package/dist/helpers/asLink.d.ts.map +1 -1
- package/dist/helpers/asLink.js.map +1 -1
- package/dist/helpers/asLinkAttrs.cjs +11 -8
- package/dist/helpers/asLinkAttrs.cjs.map +1 -1
- package/dist/helpers/asLinkAttrs.d.cts +14 -9
- package/dist/helpers/asLinkAttrs.d.cts.map +1 -1
- package/dist/helpers/asLinkAttrs.d.ts +14 -9
- package/dist/helpers/asLinkAttrs.d.ts.map +1 -1
- package/dist/helpers/asLinkAttrs.js +11 -8
- package/dist/helpers/asLinkAttrs.js.map +1 -1
- package/dist/helpers/asText.cjs.map +1 -1
- package/dist/helpers/asText.d.cts +23 -10
- package/dist/helpers/asText.d.cts.map +1 -1
- package/dist/helpers/asText.d.ts +23 -10
- package/dist/helpers/asText.d.ts.map +1 -1
- package/dist/helpers/asText.js.map +1 -1
- package/dist/helpers/documentToLinkField.cjs +7 -2
- package/dist/helpers/documentToLinkField.cjs.map +1 -1
- package/dist/helpers/documentToLinkField.d.cts +5 -1
- package/dist/helpers/documentToLinkField.d.cts.map +1 -1
- package/dist/helpers/documentToLinkField.d.ts +5 -1
- package/dist/helpers/documentToLinkField.d.ts.map +1 -1
- package/dist/helpers/documentToLinkField.js +7 -2
- package/dist/helpers/documentToLinkField.js.map +1 -1
- package/dist/helpers/isFilled.cjs +35 -8
- package/dist/helpers/isFilled.cjs.map +1 -1
- package/dist/helpers/isFilled.d.cts +32 -8
- package/dist/helpers/isFilled.d.cts.map +1 -1
- package/dist/helpers/isFilled.d.ts +32 -8
- package/dist/helpers/isFilled.d.ts.map +1 -1
- package/dist/helpers/isFilled.js +35 -8
- package/dist/helpers/isFilled.js.map +1 -1
- package/dist/helpers/mapSliceZone.cjs +10 -8
- package/dist/helpers/mapSliceZone.cjs.map +1 -1
- package/dist/helpers/mapSliceZone.d.cts +63 -35
- package/dist/helpers/mapSliceZone.d.cts.map +1 -1
- package/dist/helpers/mapSliceZone.d.ts +63 -35
- package/dist/helpers/mapSliceZone.d.ts.map +1 -1
- package/dist/helpers/mapSliceZone.js +10 -8
- package/dist/helpers/mapSliceZone.js.map +1 -1
- package/dist/index.cjs +17 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -36
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +50 -36
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/dist/isRepositoryEndpoint.cjs +4 -3
- package/dist/isRepositoryEndpoint.cjs.map +1 -1
- package/dist/isRepositoryEndpoint.d.cts +4 -3
- package/dist/isRepositoryEndpoint.d.cts.map +1 -1
- package/dist/isRepositoryEndpoint.d.ts +4 -3
- package/dist/isRepositoryEndpoint.d.ts.map +1 -1
- package/dist/isRepositoryEndpoint.js +4 -3
- package/dist/isRepositoryEndpoint.js.map +1 -1
- package/dist/isRepositoryName.cjs +2 -1
- package/dist/isRepositoryName.cjs.map +1 -1
- package/dist/isRepositoryName.d.cts +2 -1
- package/dist/isRepositoryName.d.cts.map +1 -1
- package/dist/isRepositoryName.d.ts +2 -1
- package/dist/isRepositoryName.d.ts.map +1 -1
- package/dist/isRepositoryName.js +2 -1
- package/dist/isRepositoryName.js.map +1 -1
- package/dist/lib/devMsg.cjs +8 -6
- package/dist/lib/devMsg.cjs.map +1 -1
- package/dist/lib/devMsg.js +8 -6
- package/dist/lib/devMsg.js.map +1 -1
- package/dist/lib/getOptionalLinkProperties.cjs +6 -5
- package/dist/lib/getOptionalLinkProperties.cjs.map +1 -1
- package/dist/lib/getOptionalLinkProperties.js +6 -5
- package/dist/lib/getOptionalLinkProperties.js.map +1 -1
- package/dist/lib/getPreviewCookie.cjs +3 -1
- package/dist/lib/getPreviewCookie.cjs.map +1 -1
- package/dist/lib/getPreviewCookie.js +3 -1
- package/dist/lib/getPreviewCookie.js.map +1 -1
- package/dist/lib/isInternalURL.cjs +1 -0
- package/dist/lib/isInternalURL.cjs.map +1 -1
- package/dist/lib/isInternalURL.js +1 -0
- package/dist/lib/isInternalURL.js.map +1 -1
- package/dist/lib/isMigrationValue.cjs +17 -7
- package/dist/lib/isMigrationValue.cjs.map +1 -1
- package/dist/lib/isMigrationValue.js +17 -7
- package/dist/lib/isMigrationValue.js.map +1 -1
- package/dist/lib/isValue.cjs +16 -2
- package/dist/lib/isValue.cjs.map +1 -1
- package/dist/lib/isValue.js +16 -2
- package/dist/lib/isValue.js.map +1 -1
- package/dist/lib/pLimit.cjs +7 -5
- package/dist/lib/pLimit.cjs.map +1 -1
- package/dist/lib/pLimit.js +7 -5
- package/dist/lib/pLimit.js.map +1 -1
- package/dist/lib/request.cjs +23 -12
- package/dist/lib/request.cjs.map +1 -1
- package/dist/lib/request.d.cts +20 -7
- package/dist/lib/request.d.cts.map +1 -1
- package/dist/lib/request.d.ts +20 -7
- package/dist/lib/request.d.ts.map +1 -1
- package/dist/lib/request.js +23 -12
- package/dist/lib/request.js.map +1 -1
- package/dist/lib/resolveMigrationDocumentData.cjs +15 -7
- package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -1
- package/dist/lib/resolveMigrationDocumentData.js +15 -7
- 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 +4 -3
- package/dist/lib/throttledWarn.cjs.map +1 -1
- package/dist/lib/throttledWarn.js +4 -3
- package/dist/lib/throttledWarn.js.map +1 -1
- package/dist/lib/validateAssetMetadata.cjs +18 -6
- package/dist/lib/validateAssetMetadata.cjs.map +1 -1
- package/dist/lib/validateAssetMetadata.js +18 -6
- 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 +2 -0
- package/dist/richtext/asText.cjs.map +1 -1
- package/dist/richtext/asText.d.cts +2 -0
- package/dist/richtext/asText.d.cts.map +1 -1
- package/dist/richtext/asText.d.ts +2 -0
- package/dist/richtext/asText.d.ts.map +1 -1
- package/dist/richtext/asText.js +2 -0
- package/dist/richtext/asText.js.map +1 -1
- package/dist/richtext/asTree.cjs +4 -2
- package/dist/richtext/asTree.cjs.map +1 -1
- package/dist/richtext/asTree.d.cts +4 -2
- package/dist/richtext/asTree.d.cts.map +1 -1
- package/dist/richtext/asTree.d.ts +4 -2
- package/dist/richtext/asTree.d.ts.map +1 -1
- package/dist/richtext/asTree.js +4 -2
- package/dist/richtext/asTree.js.map +1 -1
- package/dist/richtext/composeSerializers.cjs +7 -4
- package/dist/richtext/composeSerializers.cjs.map +1 -1
- package/dist/richtext/composeSerializers.d.cts +7 -4
- package/dist/richtext/composeSerializers.d.cts.map +1 -1
- package/dist/richtext/composeSerializers.d.ts +7 -4
- package/dist/richtext/composeSerializers.d.ts.map +1 -1
- package/dist/richtext/composeSerializers.js +7 -4
- package/dist/richtext/composeSerializers.js.map +1 -1
- package/dist/richtext/serialize.cjs +6 -2
- package/dist/richtext/serialize.cjs.map +1 -1
- package/dist/richtext/serialize.d.cts +6 -2
- package/dist/richtext/serialize.d.cts.map +1 -1
- package/dist/richtext/serialize.d.ts +6 -2
- package/dist/richtext/serialize.d.ts.map +1 -1
- package/dist/richtext/serialize.js +6 -2
- package/dist/richtext/serialize.js.map +1 -1
- package/dist/richtext/types.cjs.map +1 -1
- package/dist/richtext/types.d.cts +7 -3
- package/dist/richtext/types.d.cts.map +1 -1
- package/dist/richtext/types.d.ts +7 -3
- package/dist/richtext/types.d.ts.map +1 -1
- package/dist/richtext/types.js.map +1 -1
- package/dist/richtext/wrapMapSerializer.cjs +5 -2
- package/dist/richtext/wrapMapSerializer.cjs.map +1 -1
- package/dist/richtext/wrapMapSerializer.d.cts +5 -2
- package/dist/richtext/wrapMapSerializer.d.cts.map +1 -1
- package/dist/richtext/wrapMapSerializer.d.ts +5 -2
- package/dist/richtext/wrapMapSerializer.d.ts.map +1 -1
- package/dist/richtext/wrapMapSerializer.js +5 -2
- package/dist/richtext/wrapMapSerializer.js.map +1 -1
- package/dist/types/api/asset/asset.d.cts +70 -17
- package/dist/types/api/asset/asset.d.cts.map +1 -1
- package/dist/types/api/asset/asset.d.ts +70 -17
- package/dist/types/api/asset/asset.d.ts.map +1 -1
- package/dist/types/api/asset/tag.d.cts +23 -5
- package/dist/types/api/asset/tag.d.cts.map +1 -1
- package/dist/types/api/asset/tag.d.ts +23 -5
- package/dist/types/api/asset/tag.d.ts.map +1 -1
- package/dist/types/api/integration.d.cts +4 -2
- package/dist/types/api/integration.d.cts.map +1 -1
- package/dist/types/api/integration.d.ts +4 -2
- package/dist/types/api/integration.d.ts.map +1 -1
- package/dist/types/api/query.d.cts +27 -10
- package/dist/types/api/query.d.cts.map +1 -1
- package/dist/types/api/query.d.ts +27 -10
- package/dist/types/api/query.d.ts.map +1 -1
- package/dist/types/api/ref.d.cts +16 -6
- package/dist/types/api/ref.d.cts.map +1 -1
- package/dist/types/api/ref.d.ts +16 -6
- package/dist/types/api/ref.d.ts.map +1 -1
- package/dist/types/api/release.d.cts +2 -1
- package/dist/types/api/release.d.cts.map +1 -1
- package/dist/types/api/release.d.ts +2 -1
- package/dist/types/api/release.d.ts.map +1 -1
- package/dist/types/api/repository.d.cts +45 -18
- package/dist/types/api/repository.d.cts.map +1 -1
- package/dist/types/api/repository.d.ts +45 -18
- package/dist/types/api/repository.d.ts.map +1 -1
- package/dist/types/api/tags.d.cts +3 -2
- package/dist/types/api/tags.d.cts.map +1 -1
- package/dist/types/api/tags.d.ts +3 -2
- package/dist/types/api/tags.d.ts.map +1 -1
- package/dist/types/migration/Asset.cjs +13 -4
- package/dist/types/migration/Asset.cjs.map +1 -1
- package/dist/types/migration/Asset.d.cts +66 -20
- package/dist/types/migration/Asset.d.cts.map +1 -1
- package/dist/types/migration/Asset.d.ts +66 -20
- package/dist/types/migration/Asset.d.ts.map +1 -1
- package/dist/types/migration/Asset.js +13 -4
- package/dist/types/migration/Asset.js.map +1 -1
- package/dist/types/migration/ContentRelationship.d.cts +3 -1
- package/dist/types/migration/ContentRelationship.d.cts.map +1 -1
- package/dist/types/migration/ContentRelationship.d.ts +3 -1
- package/dist/types/migration/ContentRelationship.d.ts.map +1 -1
- package/dist/types/migration/Document.cjs +19 -10
- package/dist/types/migration/Document.cjs.map +1 -1
- package/dist/types/migration/Document.d.cts +31 -12
- package/dist/types/migration/Document.d.cts.map +1 -1
- package/dist/types/migration/Document.d.ts +31 -12
- package/dist/types/migration/Document.d.ts.map +1 -1
- package/dist/types/migration/Document.js +19 -10
- package/dist/types/migration/Document.js.map +1 -1
- package/dist/types/model/contentRelationship.d.cts +15 -5
- package/dist/types/model/contentRelationship.d.cts.map +1 -1
- package/dist/types/model/contentRelationship.d.ts +15 -5
- package/dist/types/model/contentRelationship.d.ts.map +1 -1
- package/dist/types/model/customType.d.cts +17 -6
- package/dist/types/model/customType.d.cts.map +1 -1
- package/dist/types/model/customType.d.ts +17 -6
- 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 +3 -1
- package/dist/types/model/range.d.cts.map +1 -1
- package/dist/types/model/range.d.ts +3 -1
- package/dist/types/model/range.d.ts.map +1 -1
- package/dist/types/model/separator.d.cts +3 -1
- package/dist/types/model/separator.d.cts.map +1 -1
- package/dist/types/model/separator.d.ts +3 -1
- 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 +3 -1
- package/dist/types/model/slice.d.cts.map +1 -1
- package/dist/types/model/slice.d.ts +3 -1
- 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 +3 -1
- package/dist/types/model/types.cjs.map +1 -1
- package/dist/types/model/types.d.cts +31 -9
- package/dist/types/model/types.d.cts.map +1 -1
- package/dist/types/model/types.d.ts +31 -9
- package/dist/types/model/types.d.ts.map +1 -1
- package/dist/types/model/types.js +3 -1
- package/dist/types/model/types.js.map +1 -1
- package/dist/types/value/color.d.cts +1 -0
- package/dist/types/value/color.d.cts.map +1 -1
- package/dist/types/value/color.d.ts +1 -0
- package/dist/types/value/color.d.ts.map +1 -1
- package/dist/types/value/contentRelationship.d.cts +5 -3
- package/dist/types/value/contentRelationship.d.cts.map +1 -1
- package/dist/types/value/contentRelationship.d.ts +5 -3
- package/dist/types/value/contentRelationship.d.ts.map +1 -1
- package/dist/types/value/date.d.cts +1 -0
- package/dist/types/value/date.d.cts.map +1 -1
- package/dist/types/value/date.d.ts +1 -0
- package/dist/types/value/date.d.ts.map +1 -1
- package/dist/types/value/document.d.cts +50 -23
- package/dist/types/value/document.d.cts.map +1 -1
- package/dist/types/value/document.d.ts +50 -23
- 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 +95 -28
- package/dist/types/value/embed.d.cts.map +1 -1
- package/dist/types/value/embed.d.ts +95 -28
- 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 +1 -0
- package/dist/types/value/geoPoint.d.cts.map +1 -1
- package/dist/types/value/geoPoint.d.ts +1 -0
- 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 +8 -5
- package/dist/types/value/image.d.cts.map +1 -1
- package/dist/types/value/image.d.ts +8 -5
- package/dist/types/value/image.d.ts.map +1 -1
- package/dist/types/value/integration.d.cts +1 -0
- package/dist/types/value/integration.d.cts.map +1 -1
- package/dist/types/value/integration.d.ts +1 -0
- package/dist/types/value/integration.d.ts.map +1 -1
- package/dist/types/value/keyText.d.cts +1 -0
- package/dist/types/value/keyText.d.cts.map +1 -1
- package/dist/types/value/keyText.d.ts +1 -0
- package/dist/types/value/keyText.d.ts.map +1 -1
- package/dist/types/value/link.cjs +3 -1
- package/dist/types/value/link.cjs.map +1 -1
- package/dist/types/value/link.d.cts +12 -8
- package/dist/types/value/link.d.cts.map +1 -1
- package/dist/types/value/link.d.ts +12 -8
- package/dist/types/value/link.d.ts.map +1 -1
- package/dist/types/value/link.js +3 -1
- 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 +1 -0
- package/dist/types/value/number.d.cts.map +1 -1
- package/dist/types/value/number.d.ts +1 -0
- 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 +77 -26
- package/dist/types/value/richText.d.cts.map +1 -1
- package/dist/types/value/richText.d.ts +77 -26
- 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 +1 -0
- package/dist/types/value/select.d.cts.map +1 -1
- package/dist/types/value/select.d.ts +1 -0
- package/dist/types/value/select.d.ts.map +1 -1
- package/dist/types/value/sharedSliceVariation.d.cts +3 -1
- package/dist/types/value/sharedSliceVariation.d.cts.map +1 -1
- package/dist/types/value/sharedSliceVariation.d.ts +3 -1
- 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 +4 -3
- package/dist/types/value/sliceZone.d.cts.map +1 -1
- package/dist/types/value/sliceZone.d.ts +4 -3
- package/dist/types/value/sliceZone.d.ts.map +1 -1
- package/dist/types/value/table.d.cts +63 -14
- package/dist/types/value/table.d.cts.map +1 -1
- package/dist/types/value/table.d.ts +63 -14
- 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 +24 -11
- package/dist/types/value/types.d.cts.map +1 -1
- package/dist/types/value/types.d.ts +24 -11
- package/dist/types/value/types.d.ts.map +1 -1
- package/dist/types/webhook/apiUpdate.d.cts +3 -1
- package/dist/types/webhook/apiUpdate.d.cts.map +1 -1
- package/dist/types/webhook/apiUpdate.d.ts +3 -1
- package/dist/types/webhook/apiUpdate.d.ts.map +1 -1
- package/package.json +35 -33
- package/src/Client.ts +399 -236
- package/src/Migration.ts +139 -80
- package/src/WriteClient.ts +174 -64
- package/src/buildQueryURL.ts +100 -68
- package/src/cookie.ts +4 -1
- package/src/createClient.ts +20 -12
- package/src/createMigration.ts +16 -8
- package/src/createWriteClient.ts +19 -11
- package/src/errors.ts +15 -5
- package/src/filter.ts +122 -79
- package/src/getGraphQLEndpoint.ts +3 -0
- package/src/getRepositoryEndpoint.ts +9 -4
- package/src/getRepositoryName.ts +5 -2
- package/src/getToolbarSrc.ts +20 -17
- package/src/helpers/asDate.ts +18 -13
- package/src/helpers/asHTML.ts +102 -55
- package/src/helpers/asImagePixelDensitySrcSet.ts +49 -29
- package/src/helpers/asImageSrc.ts +16 -8
- package/src/helpers/asImageWidthSrcSet.ts +52 -33
- package/src/helpers/asLink.ts +54 -26
- package/src/helpers/asLinkAttrs.ts +29 -14
- package/src/helpers/asText.ts +31 -15
- package/src/helpers/documentToLinkField.ts +15 -4
- package/src/helpers/isFilled.ts +51 -14
- package/src/helpers/mapSliceZone.ts +84 -42
- package/src/index.ts +68 -18
- package/src/isRepositoryEndpoint.ts +4 -3
- package/src/isRepositoryName.ts +2 -1
- package/src/lib/devMsg.ts +8 -6
- package/src/lib/getOptionalLinkProperties.ts +6 -5
- package/src/lib/getPreviewCookie.ts +3 -1
- package/src/lib/isInternalURL.ts +1 -0
- package/src/lib/isMigrationValue.ts +22 -9
- package/src/lib/isValue.ts +38 -9
- package/src/lib/pLimit.ts +16 -9
- package/src/lib/request.ts +40 -15
- package/src/lib/resolveMigrationDocumentData.ts +27 -8
- package/src/lib/serializerHelpers.ts +29 -9
- package/src/lib/throttledWarn.ts +8 -4
- package/src/lib/validateAssetMetadata.ts +43 -17
- package/src/richtext/asText.ts +8 -2
- package/src/richtext/asTree.ts +26 -8
- package/src/richtext/composeSerializers.ts +11 -5
- package/src/richtext/serialize.ts +12 -4
- package/src/richtext/types.ts +57 -13
- package/src/richtext/wrapMapSerializer.ts +8 -4
- package/src/types/api/asset/asset.ts +77 -26
- package/src/types/api/asset/tag.ts +18 -6
- package/src/types/api/integration.ts +10 -4
- package/src/types/api/migration/document.ts +27 -11
- package/src/types/api/query.ts +27 -10
- package/src/types/api/ref.ts +16 -6
- package/src/types/api/release.ts +2 -1
- package/src/types/api/repository.ts +45 -18
- package/src/types/api/tags.ts +3 -2
- package/src/types/migration/Asset.ts +82 -26
- package/src/types/migration/ContentRelationship.ts +12 -5
- package/src/types/migration/Document.ts +52 -26
- package/src/types/migration/Link.ts +9 -7
- package/src/types/model/contentRelationship.ts +20 -7
- package/src/types/model/customType.ts +21 -7
- package/src/types/model/image.ts +5 -4
- package/src/types/model/linkToMedia.ts +2 -1
- package/src/types/model/range.ts +3 -1
- package/src/types/model/separator.ts +3 -1
- package/src/types/model/sharedSliceVariation.ts +4 -4
- package/src/types/model/slice.ts +12 -7
- package/src/types/model/sliceZone.ts +11 -4
- package/src/types/model/types.ts +31 -10
- package/src/types/value/color.ts +3 -3
- package/src/types/value/contentRelationship.ts +13 -8
- package/src/types/value/date.ts +3 -1
- package/src/types/value/document.ts +52 -24
- package/src/types/value/embed.ts +80 -33
- package/src/types/value/geoPoint.ts +8 -6
- package/src/types/value/group.ts +4 -1
- package/src/types/value/image.ts +14 -10
- package/src/types/value/integration.ts +1 -0
- package/src/types/value/keyText.ts +3 -3
- package/src/types/value/link.ts +22 -14
- package/src/types/value/linkToMedia.ts +5 -2
- package/src/types/value/number.ts +3 -3
- package/src/types/value/richText.ts +82 -30
- package/src/types/value/select.ts +1 -0
- package/src/types/value/sharedSliceVariation.ts +11 -3
- package/src/types/value/slice.ts +8 -2
- package/src/types/value/sliceZone.ts +6 -4
- package/src/types/value/table.ts +64 -25
- package/src/types/value/timestamp.ts +2 -3
- package/src/types/value/title.ts +18 -16
- package/src/types/value/types.ts +21 -8
- package/src/types/webhook/apiUpdate.ts +3 -1
package/src/types/model/range.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CustomTypeModelFieldType } from "./types"
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated - Legacy field. Use `CustomTypeModelNumberField` instead.
|
|
5
|
+
*/
|
|
4
6
|
export interface CustomTypeModelRangeField {
|
|
5
7
|
type: typeof CustomTypeModelFieldType.Range
|
|
6
8
|
config?: {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CustomTypeModelFieldType } from "./types"
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated - Legacy field. Do not use.
|
|
5
|
+
*/
|
|
4
6
|
export interface CustomTypeModelSeparatorField {
|
|
5
7
|
type: typeof CustomTypeModelFieldType.Separator
|
|
6
8
|
config?: {
|
|
@@ -13,14 +13,14 @@ import type {
|
|
|
13
13
|
*/
|
|
14
14
|
export interface SharedSliceModelVariation<
|
|
15
15
|
ID extends string = string,
|
|
16
|
-
PrimaryFields extends Record<
|
|
16
|
+
PrimaryFields extends Record<
|
|
17
17
|
string,
|
|
18
18
|
CustomTypeModelFieldForSlicePrimary
|
|
19
|
-
>,
|
|
20
|
-
ItemFields extends Record<
|
|
19
|
+
> = Record<string, CustomTypeModelFieldForSlicePrimary>,
|
|
20
|
+
ItemFields extends Record<
|
|
21
21
|
string,
|
|
22
22
|
CustomTypeModelFieldForNestedGroup
|
|
23
|
-
>,
|
|
23
|
+
> = Record<string, CustomTypeModelFieldForNestedGroup>,
|
|
24
24
|
> {
|
|
25
25
|
id: ID
|
|
26
26
|
name: string
|
package/src/types/model/slice.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { CustomTypeModelFieldForNestedGroup } from "./types"
|
|
2
|
+
|
|
1
3
|
import type { CustomTypeModelNestedGroupField } from "./group"
|
|
2
4
|
import type { CustomTypeModelSliceType } from "./sliceZone"
|
|
3
|
-
import type { CustomTypeModelFieldForNestedGroup } from "./types"
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* A Slice for a custom type.
|
|
@@ -11,20 +12,22 @@ import type { CustomTypeModelFieldForNestedGroup } from "./types"
|
|
|
11
12
|
* @typeParam RepeatFields - A record of fields that can be repeated.
|
|
12
13
|
*/
|
|
13
14
|
export interface CustomTypeModelSlice<
|
|
14
|
-
NonRepeatFields extends Record<
|
|
15
|
+
NonRepeatFields extends Record<
|
|
15
16
|
string,
|
|
16
17
|
CustomTypeModelFieldForNestedGroup
|
|
17
|
-
>,
|
|
18
|
-
RepeatFields extends Record<
|
|
18
|
+
> = Record<string, CustomTypeModelFieldForNestedGroup>,
|
|
19
|
+
RepeatFields extends Record<
|
|
19
20
|
string,
|
|
20
21
|
CustomTypeModelFieldForNestedGroup
|
|
21
|
-
>,
|
|
22
|
+
> = Record<string, CustomTypeModelFieldForNestedGroup>,
|
|
22
23
|
> {
|
|
23
24
|
type: typeof CustomTypeModelSliceType.Slice
|
|
24
25
|
fieldset?: string | null
|
|
25
26
|
description?: string
|
|
26
27
|
icon?: string
|
|
27
|
-
display?:
|
|
28
|
+
display?:
|
|
29
|
+
| (typeof CustomTypeModelSliceDisplay)[keyof typeof CustomTypeModelSliceDisplay]
|
|
30
|
+
| string
|
|
28
31
|
"non-repeat"?: NonRepeatFields
|
|
29
32
|
repeat?: RepeatFields
|
|
30
33
|
}
|
|
@@ -39,7 +42,9 @@ export const CustomTypeModelSliceDisplay = {
|
|
|
39
42
|
Grid: "grid",
|
|
40
43
|
} as const
|
|
41
44
|
|
|
42
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated - Legacy slice type. Do not use.
|
|
47
|
+
*/
|
|
43
48
|
export type CustomTypeModelLegacySlice =
|
|
44
49
|
| CustomTypeModelNestedGroupField
|
|
45
50
|
| CustomTypeModelFieldForNestedGroup
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { CustomTypeModelLegacySlice, CustomTypeModelSlice } from "./slice"
|
|
2
1
|
import type { CustomTypeModelFieldType } from "./types"
|
|
3
2
|
|
|
3
|
+
import type { CustomTypeModelLegacySlice, CustomTypeModelSlice } from "./slice"
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* A Slice Zone custom type field.
|
|
6
7
|
*
|
|
@@ -9,13 +10,19 @@ import type { CustomTypeModelFieldType } from "./types"
|
|
|
9
10
|
export interface CustomTypeModelSliceZoneField<
|
|
10
11
|
Slices extends Record<
|
|
11
12
|
string,
|
|
12
|
-
|
|
13
|
+
| CustomTypeModelSlice
|
|
14
|
+
| CustomTypeModelSharedSlice
|
|
15
|
+
| CustomTypeModelLegacySlice
|
|
13
16
|
> = Record<
|
|
14
17
|
string,
|
|
15
|
-
|
|
18
|
+
| CustomTypeModelSlice
|
|
19
|
+
| CustomTypeModelSharedSlice
|
|
20
|
+
| CustomTypeModelLegacySlice
|
|
16
21
|
>,
|
|
17
22
|
> {
|
|
18
|
-
type:
|
|
23
|
+
type:
|
|
24
|
+
| typeof CustomTypeModelFieldType.Slices
|
|
25
|
+
| typeof CustomTypeModelFieldType.LegacySlices
|
|
19
26
|
fieldset?: string | null
|
|
20
27
|
config?: {
|
|
21
28
|
labels?: Record<string, readonly CustomTypeModelSliceLabel[]> | null
|
package/src/types/model/types.ts
CHANGED
|
@@ -4,7 +4,10 @@ import type { CustomTypeModelContentRelationshipField } from "./contentRelations
|
|
|
4
4
|
import type { CustomTypeModelDateField } from "./date"
|
|
5
5
|
import type { CustomTypeModelEmbedField } from "./embed"
|
|
6
6
|
import type { CustomTypeModelGeoPointField } from "./geoPoint"
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
CustomTypeModelGroupField,
|
|
9
|
+
CustomTypeModelNestedGroupField,
|
|
10
|
+
} from "./group"
|
|
8
11
|
import type { CustomTypeModelImageField } from "./image"
|
|
9
12
|
import type { CustomTypeModelIntegrationField } from "./integration"
|
|
10
13
|
import type { CustomTypeModelKeyTextField } from "./keyText"
|
|
@@ -21,7 +24,9 @@ import type { CustomTypeModelTimestampField } from "./timestamp"
|
|
|
21
24
|
import type { CustomTypeModelTitleField } from "./title"
|
|
22
25
|
import type { CustomTypeModelUIDField } from "./uid"
|
|
23
26
|
|
|
24
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Type identifier for a custom type field.
|
|
29
|
+
*/
|
|
25
30
|
export const CustomTypeModelFieldType = {
|
|
26
31
|
Boolean: "Boolean",
|
|
27
32
|
Color: "Color",
|
|
@@ -40,34 +45,50 @@ export const CustomTypeModelFieldType = {
|
|
|
40
45
|
Text: "Text",
|
|
41
46
|
Timestamp: "Timestamp",
|
|
42
47
|
UID: "UID",
|
|
43
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated - Renamed to `Integration`.
|
|
50
|
+
*/
|
|
44
51
|
IntegrationFields: "IntegrationFields",
|
|
45
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated - Legacy field type. Use `Number` instead.
|
|
54
|
+
*/
|
|
46
55
|
Range: "Range",
|
|
47
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated - Legacy field type. Do not use.
|
|
58
|
+
*/
|
|
48
59
|
Separator: "Separator",
|
|
49
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated - Legacy field type. Use `Slices` instead.
|
|
62
|
+
*/
|
|
50
63
|
LegacySlices: "Choice",
|
|
51
64
|
} as const
|
|
52
65
|
|
|
53
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* A custom type field.
|
|
68
|
+
*/
|
|
54
69
|
export type CustomTypeModelField =
|
|
55
70
|
| CustomTypeModelUIDField
|
|
56
71
|
| CustomTypeModelGroupField
|
|
57
72
|
| CustomTypeModelSliceZoneField
|
|
58
73
|
| CustomTypeModelFieldForNestedGroup
|
|
59
74
|
|
|
60
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* Any custom type field that is valid for a slice's primary section.
|
|
77
|
+
*/
|
|
61
78
|
export type CustomTypeModelFieldForSlicePrimary =
|
|
62
79
|
| CustomTypeModelGroupField
|
|
63
80
|
| CustomTypeModelFieldForNestedGroup
|
|
64
81
|
|
|
65
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Any custom type field that is valid for a group field.
|
|
84
|
+
*/
|
|
66
85
|
export type CustomTypeModelFieldForGroup =
|
|
67
86
|
| CustomTypeModelNestedGroupField
|
|
68
87
|
| CustomTypeModelFieldForNestedGroup
|
|
69
88
|
|
|
70
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* Any custom type field that is valid for a nested group field.
|
|
91
|
+
*/
|
|
71
92
|
export type CustomTypeModelFieldForNestedGroup =
|
|
72
93
|
| CustomTypeModelBooleanField
|
|
73
94
|
| CustomTypeModelColorField
|
package/src/types/value/color.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type { FieldState } from "./types"
|
|
|
4
4
|
* A color field.
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
+
*
|
|
7
8
|
* @see More details: {@link https://prismic.io/docs/color}
|
|
8
9
|
*/
|
|
9
|
-
export type ColorField<State extends FieldState = FieldState> =
|
|
10
|
-
? null
|
|
11
|
-
: `#${string}`
|
|
10
|
+
export type ColorField<State extends FieldState = FieldState> =
|
|
11
|
+
State extends "empty" ? null : `#${string}`
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
import type { AnyRegularField, FieldState } from "./types"
|
|
2
|
+
|
|
1
3
|
import type { GroupField } from "./group"
|
|
2
4
|
import type { SliceZone } from "./sliceZone"
|
|
3
|
-
import type { AnyRegularField, FieldState } from "./types"
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Field for related documents
|
|
7
8
|
*
|
|
8
9
|
* @typeParam TypeEnum - Type API ID of the document.
|
|
9
10
|
* @typeParam LangEnum - Language API ID of the document.
|
|
10
|
-
* @typeParam DataInterface - Data fields for the document (filled in via
|
|
11
|
-
* `fetchLinks`).
|
|
11
|
+
* @typeParam DataInterface - Data fields for the document (filled in via
|
|
12
|
+
* GraphQuery of `fetchLinks`).
|
|
12
13
|
* @typeParam State - State of the field which determines its shape.
|
|
13
14
|
*/
|
|
14
15
|
export type ContentRelationshipField<
|
|
15
16
|
TypeEnum = string,
|
|
16
17
|
LangEnum = string,
|
|
17
|
-
DataInterface extends
|
|
18
|
-
|
|
18
|
+
DataInterface extends
|
|
19
|
+
| Record<string, AnyRegularField | GroupField | SliceZone>
|
|
20
|
+
| unknown = unknown,
|
|
19
21
|
State extends FieldState = FieldState,
|
|
20
22
|
> = State extends "empty"
|
|
21
23
|
? EmptyContentRelationshipField
|
|
@@ -25,12 +27,15 @@ export type EmptyContentRelationshipField = {
|
|
|
25
27
|
link_type: "Any"
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Links that refer to documents
|
|
32
|
+
*/
|
|
29
33
|
export interface FilledContentRelationshipField<
|
|
30
34
|
TypeEnum = string,
|
|
31
35
|
LangEnum = string,
|
|
32
|
-
DataInterface extends
|
|
33
|
-
|
|
36
|
+
DataInterface extends
|
|
37
|
+
| Record<string, AnyRegularField | GroupField | SliceZone>
|
|
38
|
+
| unknown = unknown,
|
|
34
39
|
> {
|
|
35
40
|
link_type: "Document"
|
|
36
41
|
id: string
|
package/src/types/value/date.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type { FieldState } from "./types"
|
|
|
4
4
|
* A date field.
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
+
*
|
|
7
8
|
* @see More details: {@link https://prismic.io/docs/date}
|
|
8
9
|
*/
|
|
9
|
-
export type DateField<State extends FieldState = FieldState> =
|
|
10
|
+
export type DateField<State extends FieldState = FieldState> =
|
|
11
|
+
State extends "empty" ? null : string
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { AnyRegularField } from "./types"
|
|
2
|
+
|
|
1
3
|
import type { GroupField } from "./group"
|
|
2
4
|
import type { SliceZone } from "./sliceZone"
|
|
3
5
|
import type { TimestampField } from "./timestamp"
|
|
4
|
-
import type { AnyRegularField } from "./types"
|
|
5
6
|
|
|
6
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Document metadata for a translation of a Prismic document.
|
|
9
|
+
*/
|
|
7
10
|
export interface AlternateLanguage<TypeEnum = string, LangEnum = string> {
|
|
8
11
|
id: string
|
|
9
12
|
uid?: string
|
|
@@ -11,29 +14,43 @@ export interface AlternateLanguage<TypeEnum = string, LangEnum = string> {
|
|
|
11
14
|
lang: LangEnum
|
|
12
15
|
}
|
|
13
16
|
|
|
14
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Metadata for Prismic document
|
|
19
|
+
*/
|
|
15
20
|
export interface PrismicDocumentHeader<TypeEnum = string, LangEnum = string> {
|
|
16
21
|
/**
|
|
17
|
-
* The unique identifier for the document. Guaranteed to be unique among all
|
|
18
|
-
* Prismic repository.
|
|
22
|
+
* The unique identifier for the document. Guaranteed to be unique among all
|
|
23
|
+
* documents in the Prismic repository.
|
|
19
24
|
*/
|
|
20
25
|
id: string
|
|
21
26
|
/**
|
|
22
|
-
* The unique identifier for the document. Guaranteed to be unique among all
|
|
23
|
-
* the same type.
|
|
27
|
+
* The unique identifier for the document. Guaranteed to be unique among all
|
|
28
|
+
* Prismic documents of the same type.
|
|
24
29
|
*/
|
|
25
30
|
uid: string | null
|
|
26
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Url that refers to document.
|
|
33
|
+
*/
|
|
27
34
|
url: string | null
|
|
28
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Type of the document.
|
|
37
|
+
*/
|
|
29
38
|
type: TypeEnum
|
|
30
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Href for document.
|
|
41
|
+
*/
|
|
31
42
|
href: string
|
|
32
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Tags associated with document.
|
|
45
|
+
*/
|
|
33
46
|
tags: string[]
|
|
34
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* The timestamp at which the document was first published.
|
|
49
|
+
*/
|
|
35
50
|
first_publication_date: TimestampField<"filled">
|
|
36
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* The timestamp at which the document was last published.
|
|
53
|
+
*/
|
|
37
54
|
last_publication_date: TimestampField<"filled">
|
|
38
55
|
/**
|
|
39
56
|
* Slugs associated with document.
|
|
@@ -43,11 +60,17 @@ export interface PrismicDocumentHeader<TypeEnum = string, LangEnum = string> {
|
|
|
43
60
|
* https://community.prismic.io/t/what-are-slugs/6493
|
|
44
61
|
*/
|
|
45
62
|
slugs: string[]
|
|
46
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Documents that are related to this document.
|
|
65
|
+
*/
|
|
47
66
|
linked_documents: unknown[] // TODO: Not sure of the type for this one
|
|
48
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Language of document.
|
|
69
|
+
*/
|
|
49
70
|
lang: LangEnum
|
|
50
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* Array to access alternate language versions for document.
|
|
73
|
+
*/
|
|
51
74
|
alternate_languages: AlternateLanguage<TypeEnum, LangEnum>[]
|
|
52
75
|
}
|
|
53
76
|
|
|
@@ -65,12 +88,15 @@ export interface PrismicDocument<
|
|
|
65
88
|
TypeEnum = string,
|
|
66
89
|
LangEnum = string,
|
|
67
90
|
> extends PrismicDocumentHeader<TypeEnum, LangEnum> {
|
|
68
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Data contained in the document.
|
|
93
|
+
*/
|
|
69
94
|
data: DataInterface
|
|
70
95
|
}
|
|
71
96
|
|
|
72
97
|
/**
|
|
73
|
-
* A Prismic document served through REST API v2. Does not contain a UID (a
|
|
98
|
+
* A Prismic document served through REST API v2. Does not contain a UID (a
|
|
99
|
+
* unique identifier).
|
|
74
100
|
*
|
|
75
101
|
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
76
102
|
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
@@ -85,16 +111,18 @@ export interface PrismicDocumentWithoutUID<
|
|
|
85
111
|
LangEnum = string,
|
|
86
112
|
> extends PrismicDocument<DataInterface, TypeEnum, LangEnum> {
|
|
87
113
|
/**
|
|
88
|
-
* This document does not have a UID field. This property will always be
|
|
114
|
+
* This document does not have a UID field. This property will always be
|
|
115
|
+
* `null`.
|
|
89
116
|
*
|
|
90
|
-
* The unique identifier for the document. Guaranteed to be unique among all
|
|
91
|
-
* the same type.
|
|
117
|
+
* The unique identifier for the document. Guaranteed to be unique among all
|
|
118
|
+
* Prismic documents of the same type.
|
|
92
119
|
*/
|
|
93
120
|
uid: null
|
|
94
121
|
}
|
|
95
122
|
|
|
96
123
|
/**
|
|
97
|
-
* A Prismic document served through REST API v2. Contains a UID (a unique
|
|
124
|
+
* A Prismic document served through REST API v2. Contains a UID (a unique
|
|
125
|
+
* identifier).
|
|
98
126
|
*
|
|
99
127
|
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
100
128
|
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
@@ -109,8 +137,8 @@ export interface PrismicDocumentWithUID<
|
|
|
109
137
|
LangEnum = string,
|
|
110
138
|
> extends PrismicDocument<DataInterface, TypeEnum, LangEnum> {
|
|
111
139
|
/**
|
|
112
|
-
* The unique identifier for the document. Guaranteed to be unique among all
|
|
113
|
-
* the same type.
|
|
140
|
+
* The unique identifier for the document. Guaranteed to be unique among all
|
|
141
|
+
* Prismic documents of the same type.
|
|
114
142
|
*/
|
|
115
143
|
uid: string
|
|
116
144
|
}
|
package/src/types/value/embed.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EmptyObjectField, FieldState } from "./types"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* oEmbed 1.0 possible types.
|
|
5
5
|
*
|
|
6
6
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
7
7
|
*/
|
|
@@ -13,56 +13,80 @@ export const OEmbedType = {
|
|
|
13
13
|
} as const
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* oEmbed response base fields. Those are every mandatory fields an oEmbed
|
|
17
|
+
* response must feature.
|
|
17
18
|
*
|
|
18
19
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
19
20
|
*/
|
|
20
21
|
type OEmbedBase<TType extends (typeof OEmbedType)[keyof typeof OEmbedType]> = {
|
|
21
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* oEmbed resource type.
|
|
24
|
+
*/
|
|
22
25
|
type: TType
|
|
23
26
|
|
|
24
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* oEmbed version number, this must be "1.0".
|
|
29
|
+
*/
|
|
25
30
|
version: string
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
/**
|
|
29
|
-
*
|
|
30
|
-
* can feature.
|
|
34
|
+
* oEmbed response extra fields. Those are every non-mandatory and unknown
|
|
35
|
+
* fields an oEmbed response can feature.
|
|
31
36
|
*
|
|
32
37
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
33
38
|
*/
|
|
34
39
|
export type OEmbedExtra = {
|
|
35
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* oEmbed text title, describing the resource.
|
|
42
|
+
*/
|
|
36
43
|
title?: string | null
|
|
37
44
|
|
|
38
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* oEmbed resource author/owner name.
|
|
47
|
+
*/
|
|
39
48
|
author_name?: string | null
|
|
40
49
|
|
|
41
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* oEmbed resource author/owner URL.
|
|
52
|
+
*/
|
|
42
53
|
author_url?: string | null
|
|
43
54
|
|
|
44
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* oEmbed resource provider name.
|
|
57
|
+
*/
|
|
45
58
|
provider_name?: string | null
|
|
46
59
|
|
|
47
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* oEmbed resource provider URL.
|
|
62
|
+
*/
|
|
48
63
|
provider_url?: string | null
|
|
49
64
|
|
|
50
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* oEmbed suggested cache lifetime for the resource, in seconds.
|
|
67
|
+
*/
|
|
51
68
|
cache_age?: number | null
|
|
52
69
|
|
|
53
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* oEmbed resource thumbnail URL.
|
|
72
|
+
*/
|
|
54
73
|
thumbnail_url?: string | null
|
|
55
74
|
|
|
56
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* oEmbed resource thumbnail width.
|
|
77
|
+
*/
|
|
57
78
|
thumbnail_width?: number | null
|
|
58
79
|
|
|
59
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* oEmbed resource thumbnail height.
|
|
82
|
+
*/
|
|
60
83
|
thumbnail_height?: number | null
|
|
61
84
|
|
|
62
85
|
/**
|
|
63
|
-
* Providers may optionally include any parameters not specified in this
|
|
64
|
-
* use the same key-value format) and consumers may
|
|
65
|
-
* parameters they do not
|
|
86
|
+
* Providers may optionally include any parameters not specified in this
|
|
87
|
+
* document (so long as they use the same key-value format) and consumers may
|
|
88
|
+
* choose to ignore these. Consumers must ignore parameters they do not
|
|
89
|
+
* understand.
|
|
66
90
|
*
|
|
67
91
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
68
92
|
*/
|
|
@@ -70,63 +94,85 @@ export type OEmbedExtra = {
|
|
|
70
94
|
}
|
|
71
95
|
|
|
72
96
|
/**
|
|
73
|
-
*
|
|
97
|
+
* oEmbed photo type. Those are every mandatory fields an oEmbed photo response
|
|
98
|
+
* must feature.
|
|
74
99
|
*
|
|
75
100
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
76
101
|
*/
|
|
77
102
|
export type PhotoOEmbed = OEmbedBase<typeof OEmbedType.Photo> & {
|
|
78
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* oEmbed source URL of the image.
|
|
105
|
+
*/
|
|
79
106
|
url: string
|
|
80
107
|
|
|
81
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* oEmbed width in pixels of the image.
|
|
110
|
+
*/
|
|
82
111
|
width: number
|
|
83
112
|
|
|
84
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* oEmbed height in pixels of the image.
|
|
115
|
+
*/
|
|
85
116
|
height: number
|
|
86
117
|
}
|
|
87
118
|
|
|
88
119
|
/**
|
|
89
|
-
*
|
|
120
|
+
* oEmbed video type. Those are every mandatory fields an oEmbed video response
|
|
121
|
+
* must feature.
|
|
90
122
|
*
|
|
91
123
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
92
124
|
*/
|
|
93
125
|
export type VideoOEmbed = OEmbedBase<typeof OEmbedType.Video> & {
|
|
94
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* oEmbed HTML required to embed a video player.
|
|
128
|
+
*/
|
|
95
129
|
html: string
|
|
96
130
|
|
|
97
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* oEmbed width in pixels required to display the HTML.
|
|
133
|
+
*/
|
|
98
134
|
width: number
|
|
99
135
|
|
|
100
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* oEmbed height in pixels required to display the HTML.
|
|
138
|
+
*/
|
|
101
139
|
height: number
|
|
102
140
|
}
|
|
103
141
|
|
|
104
142
|
/**
|
|
105
|
-
*
|
|
143
|
+
* oEmbed link type. Those are every mandatory fields an oEmbed link response
|
|
144
|
+
* must feature.
|
|
106
145
|
*
|
|
107
146
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
108
147
|
*/
|
|
109
148
|
export type LinkOEmbed = OEmbedBase<typeof OEmbedType.Link>
|
|
110
149
|
|
|
111
150
|
/**
|
|
112
|
-
*
|
|
151
|
+
* oEmbed rich type. Those are every mandatory fields an oEmbed rich response
|
|
152
|
+
* must feature.
|
|
113
153
|
*
|
|
114
154
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
115
155
|
*/
|
|
116
156
|
export type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {
|
|
117
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* oEmbed HTML required to display the resource.
|
|
159
|
+
*/
|
|
118
160
|
html: string
|
|
119
161
|
|
|
120
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* oEmbed width in pixels required to display the HTML.
|
|
164
|
+
*/
|
|
121
165
|
width: number
|
|
122
166
|
|
|
123
|
-
/**
|
|
167
|
+
/**
|
|
168
|
+
* oEmbed height in pixels required to display the HTML.
|
|
169
|
+
*/
|
|
124
170
|
height: number
|
|
125
171
|
}
|
|
126
172
|
|
|
127
173
|
/**
|
|
128
|
-
* Any of the possible types of oEmbed response. Those contains only mandatory
|
|
129
|
-
* respective oEmbed response type must feature.
|
|
174
|
+
* Any of the possible types of oEmbed response. Those contains only mandatory
|
|
175
|
+
* fields their respective oEmbed response type must feature.
|
|
130
176
|
*
|
|
131
177
|
* @see oEmbed specification: {@link https://oembed.com}
|
|
132
178
|
*/
|
|
@@ -137,6 +183,7 @@ export type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed
|
|
|
137
183
|
*
|
|
138
184
|
* @typeParam Data - Data provided by the URL's oEmbed provider.
|
|
139
185
|
* @typeParam State - State of the field which determines its shape.
|
|
186
|
+
*
|
|
140
187
|
* @see More details: {@link https://prismic.io/docs/embed}
|
|
141
188
|
*/
|
|
142
189
|
export type EmbedField<
|
|
@@ -4,11 +4,13 @@ import type { EmptyObjectField, FieldState } from "./types"
|
|
|
4
4
|
* A geopoint field.
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
+
*
|
|
7
8
|
* @see More details: {@link https://prismic.io/docs/geopoint}
|
|
8
9
|
*/
|
|
9
|
-
export type GeoPointField<State extends FieldState = FieldState> =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export type GeoPointField<State extends FieldState = FieldState> =
|
|
11
|
+
State extends "empty"
|
|
12
|
+
? EmptyObjectField
|
|
13
|
+
: {
|
|
14
|
+
latitude: number
|
|
15
|
+
longitude: number
|
|
16
|
+
}
|
package/src/types/value/group.ts
CHANGED
|
@@ -19,6 +19,9 @@ export type GroupField<
|
|
|
19
19
|
* More details: {@link https://prismic.io/docs/group}
|
|
20
20
|
*/
|
|
21
21
|
export type NestedGroupField<
|
|
22
|
-
Fields extends Record<string, AnyRegularField> = Record<
|
|
22
|
+
Fields extends Record<string, AnyRegularField> = Record<
|
|
23
|
+
string,
|
|
24
|
+
AnyRegularField
|
|
25
|
+
>,
|
|
23
26
|
State extends FieldState = FieldState,
|
|
24
27
|
> = GroupField<Fields, State>
|