@prismicio/client 7.21.0-alpha.2 → 7.21.0-pr.414.8f3ed35
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 +1271 -0
- package/dist/Client.cjs.map +1 -0
- package/dist/Client.d.ts +981 -0
- package/dist/Client.js +1271 -0
- package/dist/Client.js.map +1 -0
- package/dist/Migration.cjs +297 -0
- package/dist/Migration.cjs.map +1 -0
- package/dist/Migration.d.ts +213 -0
- package/dist/Migration.js +297 -0
- package/dist/Migration.js.map +1 -0
- package/dist/WriteClient.cjs +575 -0
- package/dist/WriteClient.cjs.map +1 -0
- package/dist/WriteClient.d.ts +281 -0
- package/dist/WriteClient.js +575 -0
- package/dist/WriteClient.js.map +1 -0
- package/dist/buildQueryURL.cjs +69 -0
- package/dist/buildQueryURL.cjs.map +1 -0
- package/dist/buildQueryURL.d.ts +217 -0
- package/dist/buildQueryURL.js +69 -0
- package/dist/buildQueryURL.js.map +1 -0
- package/dist/cookie.cjs +5 -0
- package/dist/cookie.cjs.map +1 -0
- package/dist/cookie.d.ts +5 -0
- package/dist/cookie.js +5 -0
- package/dist/cookie.js.map +1 -0
- package/dist/createClient.cjs +6 -0
- package/dist/createClient.cjs.map +1 -0
- package/dist/createClient.d.ts +35 -0
- package/dist/createClient.js +6 -0
- package/dist/createClient.js.map +1 -0
- package/dist/createMigration.cjs +6 -0
- package/dist/createMigration.cjs.map +1 -0
- package/dist/createMigration.d.ts +24 -0
- package/dist/createMigration.js +6 -0
- package/dist/createMigration.js.map +1 -0
- package/dist/createWriteClient.cjs +6 -0
- package/dist/createWriteClient.cjs.map +1 -0
- package/dist/createWriteClient.d.ts +32 -0
- package/dist/createWriteClient.js +6 -0
- package/dist/createWriteClient.js.map +1 -0
- package/dist/errors/ForbiddenError.cjs +7 -0
- package/dist/errors/ForbiddenError.cjs.map +1 -0
- package/dist/errors/ForbiddenError.d.ts +11 -0
- package/dist/errors/ForbiddenError.js +7 -0
- package/dist/errors/ForbiddenError.js.map +1 -0
- package/dist/errors/InvalidDataError.cjs +7 -0
- package/dist/errors/InvalidDataError.cjs.map +1 -0
- package/dist/errors/InvalidDataError.d.ts +3 -0
- package/dist/errors/InvalidDataError.js +7 -0
- package/dist/errors/InvalidDataError.js.map +1 -0
- package/dist/errors/NotFoundError.cjs +7 -0
- package/dist/errors/NotFoundError.cjs.map +1 -0
- package/dist/errors/NotFoundError.d.ts +3 -0
- package/dist/errors/NotFoundError.js +7 -0
- package/dist/errors/NotFoundError.js.map +1 -0
- package/dist/errors/ParsingError.cjs +7 -0
- package/dist/errors/ParsingError.cjs.map +1 -0
- package/dist/errors/ParsingError.d.ts +14 -0
- package/dist/errors/ParsingError.js +7 -0
- package/dist/errors/ParsingError.js.map +1 -0
- package/dist/errors/PreviewTokenExpired.cjs +7 -0
- package/dist/errors/PreviewTokenExpired.cjs.map +1 -0
- package/dist/errors/PreviewTokenExpired.d.ts +8 -0
- package/dist/errors/PreviewTokenExpired.js +7 -0
- package/dist/errors/PreviewTokenExpired.js.map +1 -0
- package/dist/errors/PrismicError.cjs +13 -0
- package/dist/errors/PrismicError.cjs.map +1 -0
- package/dist/errors/PrismicError.d.ts +5 -0
- package/dist/errors/PrismicError.js +13 -0
- package/dist/errors/PrismicError.js.map +1 -0
- package/dist/errors/RefExpiredError.cjs +7 -0
- package/dist/errors/RefExpiredError.cjs.map +1 -0
- package/dist/errors/RefExpiredError.d.ts +8 -0
- package/dist/errors/RefExpiredError.js +7 -0
- package/dist/errors/RefExpiredError.js.map +1 -0
- package/dist/errors/RefNotFoundError.cjs +7 -0
- package/dist/errors/RefNotFoundError.cjs.map +1 -0
- package/dist/errors/RefNotFoundError.d.ts +8 -0
- package/dist/errors/RefNotFoundError.js +7 -0
- package/dist/errors/RefNotFoundError.js.map +1 -0
- package/dist/errors/RepositoryNotFoundError.cjs +7 -0
- package/dist/errors/RepositoryNotFoundError.cjs.map +1 -0
- package/dist/errors/RepositoryNotFoundError.d.ts +3 -0
- package/dist/errors/RepositoryNotFoundError.js +7 -0
- package/dist/errors/RepositoryNotFoundError.js.map +1 -0
- package/dist/filter.cjs +247 -0
- package/dist/filter.cjs.map +1 -0
- package/dist/filter.d.ts +209 -0
- package/dist/filter.js +247 -0
- package/dist/filter.js.map +1 -0
- package/dist/getGraphQLEndpoint.cjs +13 -0
- package/dist/getGraphQLEndpoint.cjs.map +1 -0
- package/dist/getGraphQLEndpoint.d.ts +10 -0
- package/dist/getGraphQLEndpoint.js +13 -0
- package/dist/getGraphQLEndpoint.js.map +1 -0
- package/dist/getRepositoryEndpoint.cjs +13 -0
- package/dist/getRepositoryEndpoint.cjs.map +1 -0
- package/dist/getRepositoryEndpoint.d.ts +19 -0
- package/dist/getRepositoryEndpoint.js +13 -0
- package/dist/getRepositoryEndpoint.js.map +1 -0
- package/dist/getRepositoryName.cjs +17 -0
- package/dist/getRepositoryName.cjs.map +1 -0
- package/dist/getRepositoryName.d.ts +12 -0
- package/dist/getRepositoryName.js +17 -0
- package/dist/getRepositoryName.js.map +1 -0
- package/dist/getToolbarSrc.cjs +13 -0
- package/dist/getToolbarSrc.cjs.map +1 -0
- package/dist/getToolbarSrc.d.ts +34 -0
- package/dist/getToolbarSrc.js +13 -0
- package/dist/getToolbarSrc.js.map +1 -0
- package/dist/helpers/asDate.cjs +14 -0
- package/dist/helpers/asDate.cjs.map +1 -0
- package/dist/helpers/asDate.d.ts +24 -0
- package/dist/helpers/asDate.js +14 -0
- package/dist/helpers/asDate.js.map +1 -0
- package/dist/helpers/asHTML.cjs +86 -0
- package/dist/helpers/asHTML.cjs.map +1 -0
- package/dist/helpers/asHTML.d.ts +149 -0
- package/dist/helpers/asHTML.js +86 -0
- package/dist/helpers/asHTML.js.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +21 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +54 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js +21 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -0
- package/dist/helpers/asImageSrc.cjs +13 -0
- package/dist/helpers/asImageSrc.cjs.map +1 -0
- package/dist/helpers/asImageSrc.d.ts +29 -0
- package/dist/helpers/asImageSrc.js +13 -0
- package/dist/helpers/asImageSrc.js.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.cjs +45 -0
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.d.ts +62 -0
- package/dist/helpers/asImageWidthSrcSet.js +45 -0
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -0
- package/dist/helpers/asLink.cjs +47 -0
- package/dist/helpers/asLink.cjs.map +1 -0
- package/dist/helpers/asLink.d.ts +78 -0
- package/dist/helpers/asLink.js +47 -0
- package/dist/helpers/asLink.js.map +1 -0
- package/dist/helpers/asLinkAttrs.cjs +28 -0
- package/dist/helpers/asLinkAttrs.cjs.map +1 -0
- package/dist/helpers/asLinkAttrs.d.ts +47 -0
- package/dist/helpers/asLinkAttrs.js +28 -0
- package/dist/helpers/asLinkAttrs.js.map +1 -0
- package/dist/helpers/asText.cjs +21 -0
- package/dist/helpers/asText.cjs.map +1 -0
- package/dist/helpers/asText.d.ts +57 -0
- package/dist/helpers/asText.js +21 -0
- package/dist/helpers/asText.js.map +1 -0
- package/dist/helpers/documentToLinkField.cjs +26 -0
- package/dist/helpers/documentToLinkField.cjs.map +1 -0
- package/dist/helpers/documentToLinkField.d.ts +17 -0
- package/dist/helpers/documentToLinkField.js +26 -0
- package/dist/helpers/documentToLinkField.js.map +1 -0
- package/dist/helpers/isFilled.cjs +77 -0
- package/dist/helpers/isFilled.cjs.map +1 -0
- package/dist/helpers/isFilled.d.ts +191 -0
- package/dist/helpers/isFilled.js +77 -0
- package/dist/helpers/isFilled.js.map +1 -0
- package/dist/helpers/mapSliceZone.cjs +42 -0
- package/dist/helpers/mapSliceZone.cjs.map +1 -0
- package/dist/helpers/mapSliceZone.d.ts +136 -0
- package/dist/helpers/mapSliceZone.js +42 -0
- package/dist/helpers/mapSliceZone.js.map +1 -0
- package/dist/index.cjs +94 -3880
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +129 -4349
- package/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/dist/isRepositoryEndpoint.cjs +12 -0
- package/dist/isRepositoryEndpoint.cjs.map +1 -0
- package/dist/isRepositoryEndpoint.d.ts +10 -0
- package/dist/isRepositoryEndpoint.js +12 -0
- package/dist/isRepositoryEndpoint.js.map +1 -0
- package/dist/isRepositoryName.cjs +7 -0
- package/dist/isRepositoryName.cjs.map +1 -0
- package/dist/isRepositoryName.d.ts +9 -0
- package/dist/isRepositoryName.js +7 -0
- package/dist/isRepositoryName.js.map +1 -0
- package/dist/lib/appendFilters.cjs +11 -0
- package/dist/lib/appendFilters.cjs.map +1 -0
- package/dist/lib/appendFilters.d.ts +18 -0
- package/dist/lib/appendFilters.js +11 -0
- package/dist/lib/appendFilters.js.map +1 -0
- package/dist/lib/castArray.cjs +7 -0
- package/dist/lib/castArray.cjs.map +1 -0
- package/dist/lib/castArray.d.ts +12 -0
- package/dist/lib/castArray.js +7 -0
- package/dist/lib/castArray.js.map +1 -0
- package/dist/lib/castThunk.cjs +7 -0
- package/dist/lib/castThunk.cjs.map +1 -0
- package/dist/lib/castThunk.d.ts +11 -0
- package/dist/lib/castThunk.js +7 -0
- package/dist/lib/castThunk.js.map +1 -0
- package/dist/lib/devMsg.cjs +8 -0
- package/dist/lib/devMsg.cjs.map +1 -0
- package/dist/lib/devMsg.d.ts +16 -0
- package/dist/lib/devMsg.js +8 -0
- package/dist/lib/devMsg.js.map +1 -0
- package/dist/lib/escapeHTML.cjs +43 -0
- package/dist/lib/escapeHTML.cjs.map +1 -0
- package/dist/lib/escapeHTML.d.ts +1 -0
- package/dist/lib/escapeHTML.js +43 -0
- package/dist/lib/escapeHTML.js.map +1 -0
- package/dist/lib/everyTagFilter.cjs +9 -0
- package/dist/lib/everyTagFilter.cjs.map +1 -0
- package/dist/lib/everyTagFilter.d.ts +9 -0
- package/dist/lib/everyTagFilter.js +9 -0
- package/dist/lib/everyTagFilter.js.map +1 -0
- package/dist/lib/findMasterRef.cjs +8 -0
- package/dist/lib/findMasterRef.cjs.map +1 -0
- package/dist/lib/findMasterRef.d.ts +11 -0
- package/dist/lib/findMasterRef.js +8 -0
- package/dist/lib/findMasterRef.js.map +1 -0
- package/dist/lib/findRef.cjs +12 -0
- package/dist/lib/findRef.cjs.map +1 -0
- package/dist/lib/findRef.d.ts +14 -0
- package/dist/lib/findRef.js +12 -0
- package/dist/lib/findRef.js.map +1 -0
- package/dist/lib/findRefByID.cjs +8 -0
- package/dist/lib/findRefByID.cjs.map +1 -0
- package/dist/lib/findRefByID.d.ts +12 -0
- package/dist/lib/findRefByID.js +8 -0
- package/dist/lib/findRefByID.js.map +1 -0
- package/dist/lib/findRefByLabel.cjs +8 -0
- package/dist/lib/findRefByLabel.cjs.map +1 -0
- package/dist/lib/findRefByLabel.d.ts +12 -0
- package/dist/lib/findRefByLabel.js +8 -0
- package/dist/lib/findRefByLabel.js.map +1 -0
- package/dist/lib/getOptionalLinkProperties.cjs +14 -0
- package/dist/lib/getOptionalLinkProperties.cjs.map +1 -0
- package/dist/lib/getOptionalLinkProperties.d.ts +12 -0
- package/dist/lib/getOptionalLinkProperties.js +14 -0
- package/dist/lib/getOptionalLinkProperties.js.map +1 -0
- package/dist/lib/getPreviewCookie.cjs +21 -0
- package/dist/lib/getPreviewCookie.cjs.map +1 -0
- package/dist/lib/getPreviewCookie.d.ts +9 -0
- package/dist/lib/getPreviewCookie.js +21 -0
- package/dist/lib/getPreviewCookie.js.map +1 -0
- package/dist/lib/isInternalURL.cjs +9 -0
- package/dist/lib/isInternalURL.cjs.map +1 -0
- package/dist/lib/isInternalURL.d.ts +8 -0
- package/dist/lib/isInternalURL.js +9 -0
- package/dist/lib/isInternalURL.js.map +1 -0
- package/dist/lib/isMigrationValue.cjs +24 -0
- package/dist/lib/isMigrationValue.cjs.map +1 -0
- package/dist/lib/isMigrationValue.d.ts +71 -0
- package/dist/lib/isMigrationValue.js +24 -0
- package/dist/lib/isMigrationValue.js.map +1 -0
- package/dist/lib/isValue.cjs +53 -0
- package/dist/lib/isValue.cjs.map +1 -0
- package/dist/lib/isValue.d.ts +78 -0
- package/dist/lib/isValue.js +53 -0
- package/dist/lib/isValue.js.map +1 -0
- package/dist/lib/minifyGraphQLQuery.cjs +7 -0
- package/dist/lib/minifyGraphQLQuery.cjs.map +1 -0
- package/dist/lib/minifyGraphQLQuery.d.ts +8 -0
- package/dist/lib/minifyGraphQLQuery.js +7 -0
- package/dist/lib/minifyGraphQLQuery.js.map +1 -0
- package/dist/lib/pLimit.cjs +48 -0
- package/dist/lib/pLimit.cjs.map +1 -0
- package/dist/lib/pLimit.d.ts +22 -0
- package/dist/lib/pLimit.js +48 -0
- package/dist/lib/pLimit.js.map +1 -0
- package/dist/lib/request.cjs +41 -0
- package/dist/lib/request.cjs.map +1 -0
- package/dist/lib/request.d.ts +73 -0
- package/dist/lib/request.js +41 -0
- package/dist/lib/request.js.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.cjs +132 -0
- package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.d.ts +54 -0
- package/dist/lib/resolveMigrationDocumentData.js +132 -0
- package/dist/lib/resolveMigrationDocumentData.js.map +1 -0
- package/dist/lib/serializerHelpers.cjs +113 -0
- package/dist/lib/serializerHelpers.cjs.map +1 -0
- package/dist/lib/serializerHelpers.d.ts +9 -0
- package/dist/lib/serializerHelpers.js +113 -0
- package/dist/lib/serializerHelpers.js.map +1 -0
- package/dist/lib/someTagsFilter.cjs +9 -0
- package/dist/lib/someTagsFilter.cjs.map +1 -0
- package/dist/lib/someTagsFilter.d.ts +9 -0
- package/dist/lib/someTagsFilter.js +9 -0
- package/dist/lib/someTagsFilter.js.map +1 -0
- package/dist/lib/throttledLog.cjs +17 -0
- package/dist/lib/throttledLog.cjs.map +1 -0
- package/dist/lib/throttledLog.d.ts +15 -0
- package/dist/lib/throttledLog.js +17 -0
- package/dist/lib/throttledLog.js.map +1 -0
- package/dist/lib/typeFilter.cjs +8 -0
- package/dist/lib/typeFilter.cjs.map +1 -0
- package/dist/lib/typeFilter.d.ts +8 -0
- package/dist/lib/typeFilter.js +8 -0
- package/dist/lib/typeFilter.js.map +1 -0
- package/dist/lib/validateAssetMetadata.cjs +28 -0
- package/dist/lib/validateAssetMetadata.cjs.map +1 -0
- package/dist/lib/validateAssetMetadata.d.ts +10 -0
- package/dist/lib/validateAssetMetadata.js +28 -0
- package/dist/lib/validateAssetMetadata.js.map +1 -0
- package/dist/package.json.cjs +7 -0
- package/dist/package.json.cjs.map +1 -0
- package/dist/package.json.js +7 -0
- package/dist/package.json.js.map +1 -0
- package/dist/richtext/asText.cjs +13 -0
- package/dist/richtext/asText.cjs.map +1 -0
- package/dist/richtext/asText.d.ts +12 -0
- package/dist/richtext/asText.js +13 -0
- package/dist/richtext/asText.js.map +1 -0
- package/dist/richtext/asTree.cjs +123 -0
- package/dist/richtext/asTree.cjs.map +1 -0
- package/dist/richtext/asTree.d.ts +14 -0
- package/dist/richtext/asTree.js +123 -0
- package/dist/richtext/asTree.js.map +1 -0
- package/dist/richtext/composeSerializers.cjs +17 -0
- package/dist/richtext/composeSerializers.cjs.map +1 -0
- package/dist/richtext/composeSerializers.d.ts +16 -0
- package/dist/richtext/composeSerializers.js +17 -0
- package/dist/richtext/composeSerializers.js.map +1 -0
- package/dist/richtext/index.d.ts +7 -78
- package/dist/richtext/serialize.cjs +19 -0
- package/dist/richtext/serialize.cjs.map +1 -0
- package/dist/richtext/serialize.d.ts +19 -0
- package/dist/richtext/serialize.js +19 -0
- package/dist/richtext/serialize.js.map +1 -0
- package/dist/richtext/types.cjs +11 -0
- package/dist/richtext/types.cjs.map +1 -0
- package/dist/richtext/types.d.ts +71 -0
- package/dist/richtext/types.js +11 -0
- package/dist/richtext/types.js.map +1 -0
- package/dist/richtext/wrapMapSerializer.cjs +24 -0
- package/dist/richtext/wrapMapSerializer.cjs.map +1 -0
- package/dist/richtext/wrapMapSerializer.d.ts +15 -0
- package/dist/richtext/wrapMapSerializer.js +24 -0
- package/dist/richtext/wrapMapSerializer.js.map +1 -0
- package/dist/richtext.cjs +15 -0
- package/dist/richtext.cjs.map +1 -0
- package/dist/richtext.js +15 -0
- package/dist/richtext.js.map +1 -0
- package/dist/types/api/asset/asset.d.ts +177 -0
- package/dist/types/api/asset/tag.d.ts +53 -0
- package/dist/types/api/integration.d.ts +28 -0
- package/dist/types/api/migration/document.d.ts +60 -0
- package/dist/types/api/query.d.ts +43 -0
- package/dist/types/api/ref.d.ts +32 -0
- package/dist/types/api/release.d.ts +11 -0
- package/dist/types/api/repository.d.ts +109 -0
- package/dist/types/api/tags.d.ts +9 -0
- package/dist/types/migration/Asset.cjs +30 -0
- package/dist/types/migration/Asset.cjs.map +1 -0
- package/dist/types/migration/Asset.d.ts +108 -0
- package/dist/types/migration/Asset.js +30 -0
- package/dist/types/migration/Asset.js.map +1 -0
- package/dist/types/migration/ContentRelationship.d.ts +16 -0
- package/dist/types/migration/Document.cjs +44 -0
- package/dist/types/migration/Document.cjs.map +1 -0
- package/dist/types/migration/Document.d.ts +94 -0
- package/dist/types/migration/Document.js +44 -0
- package/dist/types/migration/Document.js.map +1 -0
- package/dist/types/migration/Link.d.ts +19 -0
- package/dist/types/model/boolean.d.ts +15 -0
- package/dist/types/model/color.d.ts +13 -0
- package/dist/types/model/contentRelationship.d.ts +53 -0
- package/dist/types/model/customType.d.ts +48 -0
- package/dist/types/model/date.d.ts +14 -0
- package/dist/types/model/embed.d.ts +13 -0
- package/dist/types/model/geoPoint.d.ts +12 -0
- package/dist/types/model/group.d.ts +23 -0
- package/dist/types/model/image.d.ts +31 -0
- package/dist/types/model/integration.d.ts +14 -0
- package/dist/types/model/keyText.d.ts +13 -0
- package/dist/types/model/link.cjs +9 -0
- package/dist/types/model/link.cjs.map +1 -0
- package/dist/types/model/link.d.ts +28 -0
- package/dist/types/model/link.js +9 -0
- package/dist/types/model/link.js.map +1 -0
- package/dist/types/model/linkToMedia.d.ts +17 -0
- package/dist/types/model/number.d.ts +15 -0
- package/dist/types/model/range.d.ts +14 -0
- package/dist/types/model/richText.d.ts +37 -0
- package/dist/types/model/select.d.ts +18 -0
- package/dist/types/model/separator.d.ts +10 -0
- package/dist/types/model/sharedSlice.d.ts +16 -0
- package/dist/types/model/sharedSliceVariation.d.ts +19 -0
- package/dist/types/model/slice.cjs +8 -0
- package/dist/types/model/slice.cjs.map +1 -0
- package/dist/types/model/slice.d.ts +33 -0
- package/dist/types/model/slice.js +8 -0
- package/dist/types/model/slice.js.map +1 -0
- package/dist/types/model/sliceZone.cjs +8 -0
- package/dist/types/model/sliceZone.cjs.map +1 -0
- package/dist/types/model/sliceZone.d.ts +41 -0
- package/dist/types/model/sliceZone.js +8 -0
- package/dist/types/model/sliceZone.js.map +1 -0
- package/dist/types/model/table.d.ts +12 -0
- package/dist/types/model/timestamp.d.ts +14 -0
- package/dist/types/model/title.d.ts +7 -0
- package/dist/types/model/types.cjs +39 -0
- package/dist/types/model/types.cjs.map +1 -0
- package/dist/types/model/types.d.ts +76 -0
- package/dist/types/model/types.js +39 -0
- package/dist/types/model/types.js.map +1 -0
- package/dist/types/model/uid.d.ts +13 -0
- package/dist/types/value/boolean.d.ts +6 -0
- package/dist/types/value/color.d.ts +9 -0
- package/dist/types/value/contentRelationship.d.ts +31 -0
- package/dist/types/value/date.d.ts +9 -0
- package/dist/types/value/document.d.ts +114 -0
- package/dist/types/value/embed.cjs +10 -0
- package/dist/types/value/embed.cjs.map +1 -0
- package/dist/types/value/embed.d.ts +168 -0
- package/dist/types/value/embed.js +10 -0
- package/dist/types/value/embed.js.map +1 -0
- package/dist/types/value/geoPoint.d.ts +12 -0
- package/dist/types/value/group.d.ts +13 -0
- package/dist/types/value/image.d.ts +47 -0
- package/dist/types/value/integration.d.ts +16 -0
- package/dist/types/value/keyText.d.ts +9 -0
- package/dist/types/value/link.cjs +10 -0
- package/dist/types/value/link.cjs.map +1 -0
- package/dist/types/value/link.d.ts +68 -0
- package/dist/types/value/link.js +10 -0
- package/dist/types/value/link.js.map +1 -0
- package/dist/types/value/linkToMedia.d.ts +28 -0
- package/dist/types/value/number.d.ts +9 -0
- package/dist/types/value/richText.cjs +25 -0
- package/dist/types/value/richText.cjs.map +1 -0
- package/dist/types/value/richText.d.ts +215 -0
- package/dist/types/value/richText.js +25 -0
- package/dist/types/value/richText.js.map +1 -0
- package/dist/types/value/select.d.ts +10 -0
- package/dist/types/value/sharedSlice.d.ts +11 -0
- package/dist/types/value/sharedSliceVariation.d.ts +10 -0
- package/dist/types/value/slice.d.ts +13 -0
- package/dist/types/value/sliceZone.d.ts +12 -0
- package/dist/types/value/table.d.ts +91 -0
- package/dist/types/value/timestamp.d.ts +7 -0
- package/dist/types/value/title.d.ts +12 -0
- package/dist/types/value/types.d.ts +58 -0
- package/dist/types/webhook/apiUpdate.d.ts +52 -0
- package/dist/types/webhook/testTrigger.d.ts +9 -0
- package/dist/types/webhook/types.cjs +8 -0
- package/dist/types/webhook/types.cjs.map +1 -0
- package/dist/types/webhook/types.d.ts +18 -0
- package/dist/types/webhook/types.js +8 -0
- package/dist/types/webhook/types.js.map +1 -0
- package/package.json +39 -23
- package/src/Client.ts +25 -8
- package/src/WriteClient.ts +22 -33
- package/src/buildQueryURL.ts +4 -1
- package/src/createClient.ts +1 -1
- package/src/index.ts +1 -0
- package/src/types/model/contentRelationship.ts +1 -0
- package/src/types/value/date.ts +1 -1
- package/src/types/value/timestamp.ts +1 -5
- package/dist/index.d.cts +0 -4424
- package/dist/index.d.mts +0 -4424
- package/dist/index.mjs +0 -3837
- package/dist/index.mjs.map +0 -1
- package/dist/richtext/index.cjs +0 -244
- package/dist/richtext/index.cjs.map +0 -1
- package/dist/richtext/index.d.cts +0 -78
- package/dist/richtext/index.d.mts +0 -78
- package/dist/richtext/index.mjs +0 -237
- package/dist/richtext/index.mjs.map +0 -1
- package/dist/shared/client.TSGr56lO.d.cts +0 -899
- package/dist/shared/client.TSGr56lO.d.mts +0 -899
- package/dist/shared/client.TSGr56lO.d.ts +0 -899
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { WebhookBodyBase, WebhookType } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Webhook payload sent when a Prismic repository content is updated.
|
|
4
|
+
*
|
|
5
|
+
* @see More details: {@link https://prismic.io/docs/webhooks}
|
|
6
|
+
*/
|
|
7
|
+
export interface WebhookBodyAPIUpdate extends WebhookBodyBase {
|
|
8
|
+
type: typeof WebhookType.APIUpdate;
|
|
9
|
+
masterRef?: string;
|
|
10
|
+
releases: WebhookBodyAPIUpdateOperations<WebhookBodyAPIUpdateRelease>;
|
|
11
|
+
masks: WebhookBodyAPIUpdateOperations<WebhookBodyAPIUpdateMask>;
|
|
12
|
+
tags: WebhookBodyAPIUpdateOperations<WebhookBodyAPIUpdateTag>;
|
|
13
|
+
documents: string[];
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Experiments are no longer supported by Prismic.
|
|
16
|
+
*/
|
|
17
|
+
experiments?: WebhookBodyAPIUpdateOperations<unknown>;
|
|
18
|
+
}
|
|
19
|
+
interface WebhookBodyAPIUpdateOperations<T> {
|
|
20
|
+
update?: T[];
|
|
21
|
+
addition?: T[];
|
|
22
|
+
deletion?: T[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Metadata representing a mask (also called a custom type).
|
|
26
|
+
*
|
|
27
|
+
* @see More details: {@link https://prismic.io/docs/custom-types}
|
|
28
|
+
*/
|
|
29
|
+
interface WebhookBodyAPIUpdateMask {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Metadata representing a tag.
|
|
35
|
+
*
|
|
36
|
+
* @see More details: {@link https://prismic.io/docs/guides/document-tags}
|
|
37
|
+
*/
|
|
38
|
+
interface WebhookBodyAPIUpdateTag {
|
|
39
|
+
id: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Metadata representing a Release.
|
|
43
|
+
*
|
|
44
|
+
* @see More details: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
|
|
45
|
+
*/
|
|
46
|
+
interface WebhookBodyAPIUpdateRelease {
|
|
47
|
+
id: string;
|
|
48
|
+
ref: string;
|
|
49
|
+
label: string;
|
|
50
|
+
documents: string[];
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WebhookBodyBase, WebhookType } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Webhook payload sent when a test webhook action is triggered.
|
|
4
|
+
*
|
|
5
|
+
* @see More details: {@link https://prismic.io/docs/webhooks}
|
|
6
|
+
*/
|
|
7
|
+
export interface WebhookBodyTestTrigger extends WebhookBodyBase {
|
|
8
|
+
type: typeof WebhookType.TestTrigger;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../../src/types/webhook/types.ts"],"sourcesContent":["import type { WebhookBodyAPIUpdate } from \"./apiUpdate\"\nimport type { WebhookBodyTestTrigger } from \"./testTrigger\"\n\nexport type WebhookBody = WebhookBodyAPIUpdate | WebhookBodyTestTrigger\n\n/**\n * Types of Prismic Webhooks.\n *\n * @see More details: {@link https://prismic.io/docs/webhooks}\n */\nexport const WebhookType = {\n\tAPIUpdate: \"api-update\",\n\tTestTrigger: \"test-trigger\",\n} as const\n\nexport interface WebhookBodyBase {\n\ttype: (typeof WebhookType)[keyof typeof WebhookType]\n\tdomain: string\n\tapiUrl: string\n\tsecret: string | null\n}\n"],"names":[],"mappings":";;AAUO,MAAM,cAAc;AAAA,EAC1B,WAAW;AAAA,EACX,aAAa;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WebhookBodyAPIUpdate } from "./apiUpdate.js";
|
|
2
|
+
import type { WebhookBodyTestTrigger } from "./testTrigger.js";
|
|
3
|
+
export type WebhookBody = WebhookBodyAPIUpdate | WebhookBodyTestTrigger;
|
|
4
|
+
/**
|
|
5
|
+
* Types of Prismic Webhooks.
|
|
6
|
+
*
|
|
7
|
+
* @see More details: {@link https://prismic.io/docs/webhooks}
|
|
8
|
+
*/
|
|
9
|
+
export declare const WebhookType: {
|
|
10
|
+
readonly APIUpdate: "api-update";
|
|
11
|
+
readonly TestTrigger: "test-trigger";
|
|
12
|
+
};
|
|
13
|
+
export interface WebhookBodyBase {
|
|
14
|
+
type: (typeof WebhookType)[keyof typeof WebhookType];
|
|
15
|
+
domain: string;
|
|
16
|
+
apiUrl: string;
|
|
17
|
+
secret: string | null;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/types/webhook/types.ts"],"sourcesContent":["import type { WebhookBodyAPIUpdate } from \"./apiUpdate\"\nimport type { WebhookBodyTestTrigger } from \"./testTrigger\"\n\nexport type WebhookBody = WebhookBodyAPIUpdate | WebhookBodyTestTrigger\n\n/**\n * Types of Prismic Webhooks.\n *\n * @see More details: {@link https://prismic.io/docs/webhooks}\n */\nexport const WebhookType = {\n\tAPIUpdate: \"api-update\",\n\tTestTrigger: \"test-trigger\",\n} as const\n\nexport interface WebhookBodyBase {\n\ttype: (typeof WebhookType)[keyof typeof WebhookType]\n\tdomain: string\n\tapiUrl: string\n\tsecret: string | null\n}\n"],"names":[],"mappings":"AAUO,MAAM,cAAc;AAAA,EAC1B,WAAW;AAAA,EACX,aAAa;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/client",
|
|
3
|
-
"version": "7.21.0-
|
|
3
|
+
"version": "7.21.0-pr.414.8f3ed35",
|
|
4
4
|
"description": "The official JavaScript + TypeScript client library for Prismic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -23,32 +23,50 @@
|
|
|
23
23
|
"type": "module",
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
|
-
"require":
|
|
27
|
-
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
}
|
|
28
34
|
},
|
|
29
35
|
"./richtext": {
|
|
30
|
-
"require":
|
|
31
|
-
|
|
36
|
+
"require": {
|
|
37
|
+
"types": "./dist/richtext/index.d.ts",
|
|
38
|
+
"default": "./dist/richtext.cjs"
|
|
39
|
+
},
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./dist/richtext/index.d.ts",
|
|
42
|
+
"default": "./dist/richtext.js"
|
|
43
|
+
}
|
|
32
44
|
},
|
|
33
45
|
"./package.json": "./package.json"
|
|
34
46
|
},
|
|
35
47
|
"main": "./dist/index.cjs",
|
|
36
|
-
"module": "./dist/index.
|
|
37
|
-
"react-native": "./dist/index.
|
|
48
|
+
"module": "./dist/index.js",
|
|
49
|
+
"react-native": "./dist/index.js",
|
|
38
50
|
"types": "./dist/index.d.ts",
|
|
51
|
+
"typesVersions": {
|
|
52
|
+
"*": {
|
|
53
|
+
"*": [
|
|
54
|
+
"dist/index.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"richtext": [
|
|
57
|
+
"dist/richtext/index.d.ts"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
39
61
|
"files": [
|
|
40
62
|
"dist",
|
|
41
63
|
"src"
|
|
42
64
|
],
|
|
43
65
|
"scripts": {
|
|
44
|
-
"build": "
|
|
45
|
-
"dev": "
|
|
66
|
+
"build": "vite build",
|
|
67
|
+
"dev": "vite build --watch",
|
|
46
68
|
"format": "prettier --write .",
|
|
47
69
|
"prepare": "npm run build",
|
|
48
|
-
"release": "npm run test && standard-version && git push --follow-tags && npm run build && npm publish",
|
|
49
|
-
"release:dry": "standard-version --dry-run",
|
|
50
|
-
"release:alpha": "npm run test && standard-version --release-as minor --prerelease alpha && git push --follow-tags && npm run build && npm publish --tag alpha",
|
|
51
|
-
"release:alpha:dry": "standard-version --release-as minor --prerelease alpha --dry-run",
|
|
52
70
|
"lint": "eslint --ext .js,.ts .",
|
|
53
71
|
"types": "tsc --noEmit",
|
|
54
72
|
"unit": "vitest run --coverage",
|
|
@@ -60,28 +78,26 @@
|
|
|
60
78
|
"imgix-url-builder": "^0.0.6"
|
|
61
79
|
},
|
|
62
80
|
"devDependencies": {
|
|
63
|
-
"@prismicio/
|
|
81
|
+
"@prismicio/e2e-tests-utils": "^1.14.0",
|
|
64
82
|
"@prismicio/types-internal": "^3.16.1",
|
|
65
83
|
"@size-limit/preset-small-lib": "^11.2.0",
|
|
66
|
-
"@trivago/prettier-plugin-sort-imports": "^
|
|
84
|
+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
85
|
+
"@types/node": "^24.10.0",
|
|
67
86
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
68
87
|
"@typescript-eslint/parser": "^6.21.0",
|
|
69
|
-
"@vitest/coverage-v8": "^
|
|
70
|
-
"
|
|
88
|
+
"@vitest/coverage-v8": "^4.0.6",
|
|
89
|
+
"commit-and-tag-version": "^11.0.0",
|
|
71
90
|
"eslint": "^8.57.1",
|
|
72
91
|
"eslint-config-prettier": "^9.1.2",
|
|
73
92
|
"eslint-plugin-prettier": "^5.5.4",
|
|
74
93
|
"eslint-plugin-tsdoc": "^0.3.0",
|
|
75
|
-
"msw": "^1.3.5",
|
|
76
|
-
"node-fetch": "^3.3.2",
|
|
77
94
|
"prettier": "^3.6.2",
|
|
78
95
|
"prettier-plugin-jsdoc": "1.3.3",
|
|
79
96
|
"size-limit": "^11.2.0",
|
|
80
|
-
"standard-version": "^9.5.0",
|
|
81
|
-
"ts-expect": "^1.3.0",
|
|
82
97
|
"typescript": "^5.9.3",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
98
|
+
"vite": "^7.1.12",
|
|
99
|
+
"vite-plugin-sdk": "^0.1.5",
|
|
100
|
+
"vitest": "^4.0.6"
|
|
85
101
|
},
|
|
86
102
|
"engines": {
|
|
87
103
|
"node": ">=14.15.0"
|
package/src/Client.ts
CHANGED
|
@@ -1232,11 +1232,14 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
|
|
|
1232
1232
|
*
|
|
1233
1233
|
* @returns Repository metadata.
|
|
1234
1234
|
*/
|
|
1235
|
-
async getRepository(
|
|
1235
|
+
async getRepository(
|
|
1236
|
+
params?: Pick<BuildQueryURLArgs, "accessToken"> & FetchParams,
|
|
1237
|
+
): Promise<Repository> {
|
|
1236
1238
|
const url = new URL(this.documentAPIEndpoint)
|
|
1237
1239
|
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
+
const accessToken = params?.accessToken || this.accessToken
|
|
1241
|
+
if (accessToken) {
|
|
1242
|
+
url.searchParams.set("access_token", accessToken)
|
|
1240
1243
|
}
|
|
1241
1244
|
|
|
1242
1245
|
const response = await this.#request(url, params)
|
|
@@ -1390,11 +1393,21 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
|
|
|
1390
1393
|
...params
|
|
1391
1394
|
}: Partial<BuildQueryURLArgs> & FetchParams = {}): Promise<string> {
|
|
1392
1395
|
const ref =
|
|
1393
|
-
params.ref ||
|
|
1396
|
+
params.ref ||
|
|
1397
|
+
(await this.getResolvedRefString({
|
|
1398
|
+
accessToken: params.accessToken,
|
|
1399
|
+
signal,
|
|
1400
|
+
fetchOptions,
|
|
1401
|
+
}))
|
|
1394
1402
|
const integrationFieldsRef =
|
|
1395
1403
|
params.integrationFieldsRef ||
|
|
1396
|
-
(
|
|
1397
|
-
.
|
|
1404
|
+
(
|
|
1405
|
+
await this.getCachedRepository({
|
|
1406
|
+
accessToken: params.accessToken,
|
|
1407
|
+
signal,
|
|
1408
|
+
fetchOptions,
|
|
1409
|
+
})
|
|
1410
|
+
).integrationFieldsRef ||
|
|
1398
1411
|
undefined
|
|
1399
1412
|
|
|
1400
1413
|
return buildQueryURL(this.documentAPIEndpoint, {
|
|
@@ -1674,7 +1687,9 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
|
|
|
1674
1687
|
*
|
|
1675
1688
|
* @returns Cached repository metadata.
|
|
1676
1689
|
*/
|
|
1677
|
-
private async getCachedRepository(
|
|
1690
|
+
private async getCachedRepository(
|
|
1691
|
+
params?: Pick<BuildQueryURLArgs, "accessToken"> & FetchParams,
|
|
1692
|
+
): Promise<Repository> {
|
|
1678
1693
|
if (
|
|
1679
1694
|
!this.cachedRepository ||
|
|
1680
1695
|
Date.now() >= this.cachedRepositoryExpiration
|
|
@@ -1709,7 +1724,9 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
|
|
|
1709
1724
|
*
|
|
1710
1725
|
* @returns The ref to use during a query.
|
|
1711
1726
|
*/
|
|
1712
|
-
private async getResolvedRefString(
|
|
1727
|
+
private async getResolvedRefString(
|
|
1728
|
+
params?: Pick<BuildQueryURLArgs, "accessToken"> & FetchParams,
|
|
1729
|
+
): Promise<string> {
|
|
1713
1730
|
if (this.refState.autoPreviewsEnabled) {
|
|
1714
1731
|
let previewRef: string | undefined
|
|
1715
1732
|
|
package/src/WriteClient.ts
CHANGED
|
@@ -372,7 +372,7 @@ export class WriteClient<
|
|
|
372
372
|
): Promise<void> {
|
|
373
373
|
// Resolve master locale
|
|
374
374
|
const repository = await this.getRepository(fetchParams)
|
|
375
|
-
const masterLocale = repository.languages.
|
|
375
|
+
const masterLocale = repository.languages[0].id
|
|
376
376
|
reporter?.({
|
|
377
377
|
type: "documents:masterLocale",
|
|
378
378
|
data: {
|
|
@@ -908,45 +908,34 @@ export class WriteClient<
|
|
|
908
908
|
* @throws {@link PrismicError} For 500, and other unexpected errors.
|
|
909
909
|
*/
|
|
910
910
|
async #handleMigrationAPIError(response: ResponseLike): Promise<never> {
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
json = JSON.parse(text)
|
|
916
|
-
} catch {
|
|
917
|
-
// no-op
|
|
918
|
-
}
|
|
911
|
+
const payload = (await response.json()) as unknown
|
|
912
|
+
|
|
913
|
+
// Common message across all branches
|
|
914
|
+
const message = (payload as { message?: string }).message
|
|
919
915
|
|
|
920
916
|
switch (response.status) {
|
|
921
|
-
case 400:
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
"Validation failed, check the response property of the error for details",
|
|
925
|
-
response.url,
|
|
926
|
-
json, // `json` has the shape Array<{ property: string, value: unknown, error: string }>
|
|
927
|
-
)
|
|
928
|
-
}
|
|
929
|
-
throw new InvalidDataError(text, response.url, text)
|
|
917
|
+
case 400: {
|
|
918
|
+
throw new InvalidDataError(message, response.url, payload)
|
|
919
|
+
}
|
|
930
920
|
|
|
931
|
-
case 401:
|
|
932
|
-
throw new ForbiddenError(
|
|
921
|
+
case 401: {
|
|
922
|
+
throw new ForbiddenError(message, response.url, payload)
|
|
923
|
+
}
|
|
933
924
|
|
|
934
|
-
case 403:
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
json,
|
|
940
|
-
)
|
|
941
|
-
}
|
|
942
|
-
throw new ForbiddenError(text, response.url, text)
|
|
925
|
+
case 403: {
|
|
926
|
+
// The lambda authorizer uses an uppercase key, remove this once it is fixed
|
|
927
|
+
const msg = message ?? (payload as { Message?: string }).Message
|
|
928
|
+
throw new ForbiddenError(msg, response.url, payload)
|
|
929
|
+
}
|
|
943
930
|
|
|
944
|
-
case 404:
|
|
945
|
-
throw new NotFoundError(
|
|
931
|
+
case 404: {
|
|
932
|
+
throw new NotFoundError(message, response.url, payload)
|
|
933
|
+
}
|
|
946
934
|
|
|
947
935
|
case 500:
|
|
948
|
-
default:
|
|
949
|
-
throw new PrismicError(
|
|
936
|
+
default: {
|
|
937
|
+
throw new PrismicError(message, response.url, payload)
|
|
938
|
+
}
|
|
950
939
|
}
|
|
951
940
|
}
|
|
952
941
|
}
|
package/src/buildQueryURL.ts
CHANGED
|
@@ -326,7 +326,10 @@ export const buildQueryURL = (
|
|
|
326
326
|
): string => {
|
|
327
327
|
const { filters, predicates, ...params } = args
|
|
328
328
|
|
|
329
|
-
|
|
329
|
+
if (!endpoint.endsWith("/")) {
|
|
330
|
+
endpoint += "/"
|
|
331
|
+
}
|
|
332
|
+
const url = new URL(`documents/search`, endpoint)
|
|
330
333
|
|
|
331
334
|
if (filters) {
|
|
332
335
|
// TODO: Remove warning when we remove support for string `filters` values.
|
package/src/createClient.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface CreateClient {
|
|
|
36
36
|
*
|
|
37
37
|
* @returns A client that can query content from the repository.
|
|
38
38
|
*
|
|
39
|
-
* @see
|
|
39
|
+
* @see https://prismic.io/docs/technical-reference/prismicio-client/v7
|
|
40
40
|
*/
|
|
41
41
|
export const createClient: CreateClient = <TDocuments extends PrismicDocument>(
|
|
42
42
|
repositoryNameOrEndpoint: string,
|
package/src/index.ts
CHANGED
|
@@ -119,6 +119,7 @@ export type { HTMLRichTextSerializer } from "./helpers/asHTML"
|
|
|
119
119
|
// Client Errors
|
|
120
120
|
export { PrismicError } from "./errors/PrismicError"
|
|
121
121
|
export { ForbiddenError } from "./errors/ForbiddenError"
|
|
122
|
+
export { InvalidDataError } from "./errors/InvalidDataError"
|
|
122
123
|
export { NotFoundError } from "./errors/NotFoundError"
|
|
123
124
|
export { RefNotFoundError } from "./errors/RefNotFoundError"
|
|
124
125
|
export { RefExpiredError } from "./errors/RefExpiredError"
|
package/src/types/value/date.ts
CHANGED
|
@@ -8,4 +8,4 @@ import type { FieldState } from "./types"
|
|
|
8
8
|
* @see More details: {@link https://prismic.io/docs/date}
|
|
9
9
|
*/
|
|
10
10
|
export type DateField<State extends FieldState = FieldState> =
|
|
11
|
-
State extends "empty" ? null :
|
|
11
|
+
State extends "empty" ? null : string
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import type { FieldState } from "./types"
|
|
2
2
|
|
|
3
|
-
import type { DateField } from "./date"
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* A timestamp field.
|
|
7
5
|
*
|
|
8
6
|
* @typeParam State - State of the field which determines its shape.
|
|
9
7
|
*/
|
|
10
8
|
export type TimestampField<State extends FieldState = FieldState> =
|
|
11
|
-
State extends "empty"
|
|
12
|
-
? null
|
|
13
|
-
: `${DateField<"filled">}T${number}:${number}:${number}+${number}`
|
|
9
|
+
State extends "empty" ? null : string
|