@prismicio/client 7.21.0-alpha.2 → 7.21.0-canary.147e3f2
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 +926 -0
- package/dist/Client.cjs.map +1 -0
- package/dist/Client.d.cts +704 -0
- package/dist/Client.d.cts.map +1 -0
- package/dist/Client.d.ts +704 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +926 -0
- package/dist/Client.js.map +1 -0
- package/dist/Migration.cjs +284 -0
- package/dist/Migration.cjs.map +1 -0
- package/dist/Migration.d.cts +216 -0
- package/dist/Migration.d.cts.map +1 -0
- package/dist/Migration.d.ts +216 -0
- package/dist/Migration.d.ts.map +1 -0
- package/dist/Migration.js +284 -0
- package/dist/Migration.js.map +1 -0
- package/dist/WriteClient.cjs +488 -0
- package/dist/WriteClient.cjs.map +1 -0
- package/dist/WriteClient.d.cts +262 -0
- package/dist/WriteClient.d.cts.map +1 -0
- package/dist/WriteClient.d.ts +262 -0
- package/dist/WriteClient.d.ts.map +1 -0
- package/dist/WriteClient.js +488 -0
- package/dist/WriteClient.js.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +14 -0
- package/dist/_virtual/rolldown_runtime.js +13 -0
- package/dist/buildQueryURL.cjs +96 -0
- package/dist/buildQueryURL.cjs.map +1 -0
- package/dist/buildQueryURL.d.cts +212 -0
- package/dist/buildQueryURL.d.cts.map +1 -0
- package/dist/buildQueryURL.d.ts +212 -0
- package/dist/buildQueryURL.d.ts.map +1 -0
- package/dist/buildQueryURL.js +96 -0
- package/dist/buildQueryURL.js.map +1 -0
- package/dist/cookie.cjs +19 -0
- package/dist/cookie.cjs.map +1 -0
- package/dist/cookie.d.cts +11 -0
- package/dist/cookie.d.cts.map +1 -0
- package/dist/cookie.d.ts +11 -0
- package/dist/cookie.d.ts.map +1 -0
- package/dist/cookie.js +13 -0
- package/dist/cookie.js.map +1 -0
- package/dist/createClient.cjs +33 -0
- package/dist/createClient.cjs.map +1 -0
- package/dist/createClient.d.cts +41 -0
- package/dist/createClient.d.cts.map +1 -0
- package/dist/createClient.d.ts +41 -0
- package/dist/createClient.d.ts.map +1 -0
- package/dist/createClient.js +33 -0
- package/dist/createClient.js.map +1 -0
- package/dist/createMigration.cjs +22 -0
- package/dist/createMigration.cjs.map +1 -0
- package/dist/createMigration.d.cts +30 -0
- package/dist/createMigration.d.cts.map +1 -0
- package/dist/createMigration.d.ts +30 -0
- package/dist/createMigration.d.ts.map +1 -0
- package/dist/createMigration.js +22 -0
- package/dist/createMigration.js.map +1 -0
- package/dist/createWriteClient.cjs +30 -0
- package/dist/createWriteClient.cjs.map +1 -0
- package/dist/createWriteClient.d.cts +38 -0
- package/dist/createWriteClient.d.cts.map +1 -0
- package/dist/createWriteClient.d.ts +38 -0
- package/dist/createWriteClient.d.ts.map +1 -0
- package/dist/createWriteClient.js +30 -0
- package/dist/createWriteClient.js.map +1 -0
- package/dist/errors.cjs +31 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +46 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.ts +46 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +22 -0
- package/dist/errors.js.map +1 -0
- package/dist/filter.cjs +104 -0
- package/dist/filter.cjs.map +1 -0
- package/dist/filter.d.cts +213 -0
- package/dist/filter.d.cts.map +1 -0
- package/dist/filter.d.ts +213 -0
- package/dist/filter.d.ts.map +1 -0
- package/dist/filter.js +103 -0
- package/dist/filter.js.map +1 -0
- package/dist/getGraphQLEndpoint.cjs +21 -0
- package/dist/getGraphQLEndpoint.cjs.map +1 -0
- package/dist/getGraphQLEndpoint.d.cts +14 -0
- package/dist/getGraphQLEndpoint.d.cts.map +1 -0
- package/dist/getGraphQLEndpoint.d.ts +14 -0
- package/dist/getGraphQLEndpoint.d.ts.map +1 -0
- package/dist/getGraphQLEndpoint.js +21 -0
- package/dist/getGraphQLEndpoint.js.map +1 -0
- package/dist/getRepositoryEndpoint.cjs +30 -0
- package/dist/getRepositoryEndpoint.cjs.map +1 -0
- package/dist/getRepositoryEndpoint.d.cts +23 -0
- package/dist/getRepositoryEndpoint.d.cts.map +1 -0
- package/dist/getRepositoryEndpoint.d.ts +23 -0
- package/dist/getRepositoryEndpoint.d.ts.map +1 -0
- package/dist/getRepositoryEndpoint.js +30 -0
- package/dist/getRepositoryEndpoint.js.map +1 -0
- package/dist/getRepositoryName.cjs +25 -0
- package/dist/getRepositoryName.cjs.map +1 -0
- package/dist/getRepositoryName.d.cts +16 -0
- package/dist/getRepositoryName.d.cts.map +1 -0
- package/dist/getRepositoryName.d.ts +16 -0
- package/dist/getRepositoryName.d.ts.map +1 -0
- package/dist/getRepositoryName.js +25 -0
- package/dist/getRepositoryName.js.map +1 -0
- package/dist/getToolbarSrc.cjs +45 -0
- package/dist/getToolbarSrc.cjs.map +1 -0
- package/dist/getToolbarSrc.d.cts +38 -0
- package/dist/getToolbarSrc.d.cts.map +1 -0
- package/dist/getToolbarSrc.d.ts +38 -0
- package/dist/getToolbarSrc.d.ts.map +1 -0
- package/dist/getToolbarSrc.js +45 -0
- package/dist/getToolbarSrc.js.map +1 -0
- package/dist/helpers/asDate.cjs +39 -0
- package/dist/helpers/asDate.cjs.map +1 -0
- package/dist/helpers/asDate.d.cts +29 -0
- package/dist/helpers/asDate.d.cts.map +1 -0
- package/dist/helpers/asDate.d.ts +29 -0
- package/dist/helpers/asDate.d.ts.map +1 -0
- package/dist/helpers/asDate.js +38 -0
- package/dist/helpers/asDate.js.map +1 -0
- package/dist/helpers/asHTML.cjs +83 -0
- package/dist/helpers/asHTML.cjs.map +1 -0
- package/dist/helpers/asHTML.d.cts +147 -0
- package/dist/helpers/asHTML.d.cts.map +1 -0
- package/dist/helpers/asHTML.d.ts +147 -0
- package/dist/helpers/asHTML.d.ts.map +1 -0
- package/dist/helpers/asHTML.js +83 -0
- package/dist/helpers/asHTML.js.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +60 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts +59 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +59 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js +60 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -0
- package/dist/helpers/asImageSrc.cjs +33 -0
- package/dist/helpers/asImageSrc.cjs.map +1 -0
- package/dist/helpers/asImageSrc.d.cts +34 -0
- package/dist/helpers/asImageSrc.d.cts.map +1 -0
- package/dist/helpers/asImageSrc.d.ts +34 -0
- package/dist/helpers/asImageSrc.d.ts.map +1 -0
- package/dist/helpers/asImageSrc.js +33 -0
- package/dist/helpers/asImageSrc.js.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.cjs +79 -0
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.d.cts +67 -0
- package/dist/helpers/asImageWidthSrcSet.d.cts.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.d.ts +67 -0
- package/dist/helpers/asImageWidthSrcSet.d.ts.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.js +79 -0
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -0
- package/dist/helpers/asLink.cjs +29 -0
- package/dist/helpers/asLink.cjs.map +1 -0
- package/dist/helpers/asLink.d.cts +83 -0
- package/dist/helpers/asLink.d.cts.map +1 -0
- package/dist/helpers/asLink.d.ts +83 -0
- package/dist/helpers/asLink.d.ts.map +1 -0
- package/dist/helpers/asLink.js +29 -0
- package/dist/helpers/asLink.js.map +1 -0
- package/dist/helpers/asLinkAttrs.cjs +47 -0
- package/dist/helpers/asLinkAttrs.cjs.map +1 -0
- package/dist/helpers/asLinkAttrs.d.cts +51 -0
- package/dist/helpers/asLinkAttrs.d.cts.map +1 -0
- package/dist/helpers/asLinkAttrs.d.ts +51 -0
- package/dist/helpers/asLinkAttrs.d.ts.map +1 -0
- package/dist/helpers/asLinkAttrs.js +47 -0
- package/dist/helpers/asLinkAttrs.js.map +1 -0
- package/dist/helpers/asText.cjs +16 -0
- package/dist/helpers/asText.cjs.map +1 -0
- package/dist/helpers/asText.d.cts +62 -0
- package/dist/helpers/asText.d.cts.map +1 -0
- package/dist/helpers/asText.d.ts +62 -0
- package/dist/helpers/asText.d.ts.map +1 -0
- package/dist/helpers/asText.js +16 -0
- package/dist/helpers/asText.js.map +1 -0
- package/dist/helpers/documentToLinkField.cjs +33 -0
- package/dist/helpers/documentToLinkField.cjs.map +1 -0
- package/dist/helpers/documentToLinkField.d.cts +21 -0
- package/dist/helpers/documentToLinkField.d.cts.map +1 -0
- package/dist/helpers/documentToLinkField.d.ts +21 -0
- package/dist/helpers/documentToLinkField.d.ts.map +1 -0
- package/dist/helpers/documentToLinkField.js +33 -0
- package/dist/helpers/documentToLinkField.js.map +1 -0
- package/dist/helpers/isFilled.cjs +250 -0
- package/dist/helpers/isFilled.cjs.map +1 -0
- package/dist/helpers/isFilled.d.cts +199 -0
- package/dist/helpers/isFilled.d.cts.map +1 -0
- package/dist/helpers/isFilled.d.ts +199 -0
- package/dist/helpers/isFilled.d.ts.map +1 -0
- package/dist/helpers/isFilled.js +243 -0
- package/dist/helpers/isFilled.js.map +1 -0
- package/dist/helpers/mapSliceZone.cjs +53 -0
- package/dist/helpers/mapSliceZone.cjs.map +1 -0
- package/dist/helpers/mapSliceZone.d.cts +139 -0
- package/dist/helpers/mapSliceZone.d.cts.map +1 -0
- package/dist/helpers/mapSliceZone.d.ts +139 -0
- package/dist/helpers/mapSliceZone.d.ts.map +1 -0
- package/dist/helpers/mapSliceZone.js +52 -0
- package/dist/helpers/mapSliceZone.js.map +1 -0
- package/dist/index.cjs +109 -3882
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +143 -4394
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +143 -4394
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/isRepositoryEndpoint.cjs +23 -0
- package/dist/isRepositoryEndpoint.cjs.map +1 -0
- package/dist/isRepositoryEndpoint.d.cts +14 -0
- package/dist/isRepositoryEndpoint.d.cts.map +1 -0
- package/dist/isRepositoryEndpoint.d.ts +14 -0
- package/dist/isRepositoryEndpoint.d.ts.map +1 -0
- package/dist/isRepositoryEndpoint.js +22 -0
- package/dist/isRepositoryEndpoint.js.map +1 -0
- package/dist/isRepositoryName.cjs +17 -0
- package/dist/isRepositoryName.cjs.map +1 -0
- package/dist/isRepositoryName.d.cts +13 -0
- package/dist/isRepositoryName.d.cts.map +1 -0
- package/dist/isRepositoryName.d.ts +13 -0
- package/dist/isRepositoryName.d.ts.map +1 -0
- package/dist/isRepositoryName.js +16 -0
- package/dist/isRepositoryName.js.map +1 -0
- package/dist/lib/devMsg.cjs +25 -0
- package/dist/lib/devMsg.cjs.map +1 -0
- package/dist/lib/devMsg.js +25 -0
- package/dist/lib/devMsg.js.map +1 -0
- package/dist/lib/escapeHTML.cjs +40 -0
- package/dist/lib/escapeHTML.cjs.map +1 -0
- package/dist/lib/escapeHTML.js +39 -0
- package/dist/lib/escapeHTML.js.map +1 -0
- package/dist/lib/getOptionalLinkProperties.cjs +22 -0
- package/dist/lib/getOptionalLinkProperties.cjs.map +1 -0
- package/dist/lib/getOptionalLinkProperties.js +21 -0
- package/dist/lib/getOptionalLinkProperties.js.map +1 -0
- package/dist/lib/getPreviewCookie.cjs +30 -0
- package/dist/lib/getPreviewCookie.cjs.map +1 -0
- package/dist/lib/getPreviewCookie.js +30 -0
- package/dist/lib/getPreviewCookie.js.map +1 -0
- package/dist/lib/isInternalURL.cjs +18 -0
- package/dist/lib/isInternalURL.cjs.map +1 -0
- package/dist/lib/isInternalURL.js +17 -0
- package/dist/lib/isInternalURL.js.map +1 -0
- package/dist/lib/isMigrationValue.cjs +77 -0
- package/dist/lib/isMigrationValue.cjs.map +1 -0
- package/dist/lib/isMigrationValue.js +74 -0
- package/dist/lib/isMigrationValue.js.map +1 -0
- package/dist/lib/isValue.cjs +110 -0
- package/dist/lib/isValue.cjs.map +1 -0
- package/dist/lib/isValue.js +106 -0
- package/dist/lib/isValue.js.map +1 -0
- package/dist/lib/pLimit.cjs +55 -0
- package/dist/lib/pLimit.cjs.map +1 -0
- package/dist/lib/pLimit.js +54 -0
- package/dist/lib/pLimit.js.map +1 -0
- package/dist/lib/request.cjs +60 -0
- package/dist/lib/request.cjs.map +1 -0
- package/dist/lib/request.d.cts +61 -0
- package/dist/lib/request.d.cts.map +1 -0
- package/dist/lib/request.d.ts +61 -0
- package/dist/lib/request.d.ts.map +1 -0
- package/dist/lib/request.js +60 -0
- package/dist/lib/request.js.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.cjs +156 -0
- package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.js +155 -0
- package/dist/lib/resolveMigrationDocumentData.js.map +1 -0
- package/dist/lib/serializerHelpers.cjs +95 -0
- package/dist/lib/serializerHelpers.cjs.map +1 -0
- package/dist/lib/serializerHelpers.js +90 -0
- package/dist/lib/serializerHelpers.js.map +1 -0
- package/dist/lib/throttledWarn.cjs +27 -0
- package/dist/lib/throttledWarn.cjs.map +1 -0
- package/dist/lib/throttledWarn.js +26 -0
- package/dist/lib/throttledWarn.js.map +1 -0
- package/dist/lib/validateAssetMetadata.cjs +48 -0
- package/dist/lib/validateAssetMetadata.cjs.map +1 -0
- package/dist/lib/validateAssetMetadata.js +48 -0
- package/dist/lib/validateAssetMetadata.js.map +1 -0
- package/dist/package.cjs +19 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/richtext/asText.cjs +21 -0
- package/dist/richtext/asText.cjs.map +1 -0
- package/dist/richtext/asText.d.cts +18 -0
- package/dist/richtext/asText.d.cts.map +1 -0
- package/dist/richtext/asText.d.ts +18 -0
- package/dist/richtext/asText.d.ts.map +1 -0
- package/dist/richtext/asText.js +20 -0
- package/dist/richtext/asText.js.map +1 -0
- package/dist/richtext/asTree.cjs +122 -0
- package/dist/richtext/asTree.cjs.map +1 -0
- package/dist/richtext/asTree.d.cts +20 -0
- package/dist/richtext/asTree.d.cts.map +1 -0
- package/dist/richtext/asTree.d.ts +20 -0
- package/dist/richtext/asTree.d.ts.map +1 -0
- package/dist/richtext/asTree.js +122 -0
- package/dist/richtext/asTree.js.map +1 -0
- package/dist/richtext/composeSerializers.cjs +31 -0
- package/dist/richtext/composeSerializers.cjs.map +1 -0
- package/dist/richtext/composeSerializers.d.cts +22 -0
- package/dist/richtext/composeSerializers.d.cts.map +1 -0
- package/dist/richtext/composeSerializers.d.ts +22 -0
- package/dist/richtext/composeSerializers.d.ts.map +1 -0
- package/dist/richtext/composeSerializers.js +30 -0
- package/dist/richtext/composeSerializers.js.map +1 -0
- package/dist/richtext/serialize.cjs +35 -0
- package/dist/richtext/serialize.cjs.map +1 -0
- package/dist/richtext/serialize.d.cts +25 -0
- package/dist/richtext/serialize.d.cts.map +1 -0
- package/dist/richtext/serialize.d.ts +25 -0
- package/dist/richtext/serialize.d.ts.map +1 -0
- package/dist/richtext/serialize.js +35 -0
- package/dist/richtext/serialize.js.map +1 -0
- package/dist/richtext/types.cjs +13 -0
- package/dist/richtext/types.cjs.map +1 -0
- package/dist/richtext/types.d.cts +71 -0
- package/dist/richtext/types.d.cts.map +1 -0
- package/dist/richtext/types.d.ts +71 -0
- package/dist/richtext/types.d.ts.map +1 -0
- package/dist/richtext/types.js +13 -0
- package/dist/richtext/types.js.map +1 -0
- package/dist/richtext/wrapMapSerializer.cjs +32 -0
- package/dist/richtext/wrapMapSerializer.cjs.map +1 -0
- package/dist/richtext/wrapMapSerializer.d.cts +21 -0
- package/dist/richtext/wrapMapSerializer.d.cts.map +1 -0
- package/dist/richtext/wrapMapSerializer.d.ts +21 -0
- package/dist/richtext/wrapMapSerializer.d.ts.map +1 -0
- package/dist/richtext/wrapMapSerializer.js +32 -0
- package/dist/richtext/wrapMapSerializer.js.map +1 -0
- package/dist/richtext.cjs +13 -0
- package/dist/richtext.d.cts +8 -0
- package/dist/richtext.d.ts +8 -0
- package/dist/richtext.js +8 -0
- package/dist/types/api/asset/asset.d.cts +97 -0
- package/dist/types/api/asset/asset.d.cts.map +1 -0
- package/dist/types/api/asset/asset.d.ts +97 -0
- package/dist/types/api/asset/asset.d.ts.map +1 -0
- package/dist/types/api/asset/tag.d.cts +35 -0
- package/dist/types/api/asset/tag.d.cts.map +1 -0
- package/dist/types/api/asset/tag.d.ts +35 -0
- package/dist/types/api/asset/tag.d.ts.map +1 -0
- package/dist/types/api/integration.d.cts +34 -0
- package/dist/types/api/integration.d.cts.map +1 -0
- package/dist/types/api/integration.d.ts +34 -0
- package/dist/types/api/integration.d.ts.map +1 -0
- package/dist/types/api/query.d.cts +49 -0
- package/dist/types/api/query.d.cts.map +1 -0
- package/dist/types/api/query.d.ts +49 -0
- package/dist/types/api/query.d.ts.map +1 -0
- package/dist/types/api/ref.d.cts +36 -0
- package/dist/types/api/ref.d.cts.map +1 -0
- package/dist/types/api/ref.d.ts +36 -0
- package/dist/types/api/ref.d.ts.map +1 -0
- package/dist/types/api/release.d.cts +17 -0
- package/dist/types/api/release.d.cts.map +1 -0
- package/dist/types/api/release.d.ts +17 -0
- package/dist/types/api/release.d.ts.map +1 -0
- package/dist/types/api/repository.d.cts +115 -0
- package/dist/types/api/repository.d.cts.map +1 -0
- package/dist/types/api/repository.d.ts +115 -0
- package/dist/types/api/repository.d.ts.map +1 -0
- package/dist/types/api/tags.d.cts +13 -0
- package/dist/types/api/tags.d.cts.map +1 -0
- package/dist/types/api/tags.d.ts +13 -0
- package/dist/types/api/tags.d.ts.map +1 -0
- package/dist/types/migration/Asset.cjs +35 -0
- package/dist/types/migration/Asset.cjs.map +1 -0
- package/dist/types/migration/Asset.d.cts +109 -0
- package/dist/types/migration/Asset.d.cts.map +1 -0
- package/dist/types/migration/Asset.d.ts +109 -0
- package/dist/types/migration/Asset.d.ts.map +1 -0
- package/dist/types/migration/Asset.js +34 -0
- package/dist/types/migration/Asset.js.map +1 -0
- package/dist/types/migration/ContentRelationship.d.cts +15 -0
- package/dist/types/migration/ContentRelationship.d.cts.map +1 -0
- package/dist/types/migration/ContentRelationship.d.ts +15 -0
- package/dist/types/migration/ContentRelationship.d.ts.map +1 -0
- package/dist/types/migration/Document.cjs +51 -0
- package/dist/types/migration/Document.cjs.map +1 -0
- package/dist/types/migration/Document.d.cts +97 -0
- package/dist/types/migration/Document.d.cts.map +1 -0
- package/dist/types/migration/Document.d.ts +97 -0
- package/dist/types/migration/Document.d.ts.map +1 -0
- package/dist/types/migration/Document.js +50 -0
- package/dist/types/migration/Document.js.map +1 -0
- package/dist/types/model/boolean.d.cts +21 -0
- package/dist/types/model/boolean.d.cts.map +1 -0
- package/dist/types/model/boolean.d.ts +21 -0
- package/dist/types/model/boolean.d.ts.map +1 -0
- package/dist/types/model/color.d.cts +19 -0
- package/dist/types/model/color.d.cts.map +1 -0
- package/dist/types/model/color.d.ts +19 -0
- package/dist/types/model/color.d.ts.map +1 -0
- package/dist/types/model/contentRelationship.d.cts +59 -0
- package/dist/types/model/contentRelationship.d.cts.map +1 -0
- package/dist/types/model/contentRelationship.d.ts +59 -0
- package/dist/types/model/contentRelationship.d.ts.map +1 -0
- package/dist/types/model/customType.d.cts +54 -0
- package/dist/types/model/customType.d.cts.map +1 -0
- package/dist/types/model/customType.d.ts +54 -0
- package/dist/types/model/customType.d.ts.map +1 -0
- package/dist/types/model/date.d.cts +20 -0
- package/dist/types/model/date.d.cts.map +1 -0
- package/dist/types/model/date.d.ts +20 -0
- package/dist/types/model/date.d.ts.map +1 -0
- package/dist/types/model/embed.d.cts +19 -0
- package/dist/types/model/embed.d.cts.map +1 -0
- package/dist/types/model/embed.d.ts +19 -0
- package/dist/types/model/embed.d.ts.map +1 -0
- package/dist/types/model/geoPoint.d.cts +18 -0
- package/dist/types/model/geoPoint.d.cts.map +1 -0
- package/dist/types/model/geoPoint.d.ts +18 -0
- package/dist/types/model/geoPoint.d.ts.map +1 -0
- package/dist/types/model/group.d.cts +29 -0
- package/dist/types/model/group.d.cts.map +1 -0
- package/dist/types/model/group.d.ts +29 -0
- package/dist/types/model/group.d.ts.map +1 -0
- package/dist/types/model/image.d.cts +37 -0
- package/dist/types/model/image.d.cts.map +1 -0
- package/dist/types/model/image.d.ts +37 -0
- package/dist/types/model/image.d.ts.map +1 -0
- package/dist/types/model/integration.d.cts +20 -0
- package/dist/types/model/integration.d.cts.map +1 -0
- package/dist/types/model/integration.d.ts +20 -0
- package/dist/types/model/integration.d.ts.map +1 -0
- package/dist/types/model/keyText.d.cts +19 -0
- package/dist/types/model/keyText.d.cts.map +1 -0
- package/dist/types/model/keyText.d.ts +19 -0
- package/dist/types/model/keyText.d.ts.map +1 -0
- package/dist/types/model/link.cjs +16 -0
- package/dist/types/model/link.cjs.map +1 -0
- package/dist/types/model/link.d.cts +34 -0
- package/dist/types/model/link.d.cts.map +1 -0
- package/dist/types/model/link.d.ts +34 -0
- package/dist/types/model/link.d.ts.map +1 -0
- package/dist/types/model/link.js +15 -0
- package/dist/types/model/link.js.map +1 -0
- package/dist/types/model/linkToMedia.d.cts +23 -0
- package/dist/types/model/linkToMedia.d.cts.map +1 -0
- package/dist/types/model/linkToMedia.d.ts +23 -0
- package/dist/types/model/linkToMedia.d.ts.map +1 -0
- package/dist/types/model/number.d.cts +21 -0
- package/dist/types/model/number.d.cts.map +1 -0
- package/dist/types/model/number.d.ts +21 -0
- package/dist/types/model/number.d.ts.map +1 -0
- package/dist/types/model/range.d.cts +20 -0
- package/dist/types/model/range.d.cts.map +1 -0
- package/dist/types/model/range.d.ts +20 -0
- package/dist/types/model/range.d.ts.map +1 -0
- package/dist/types/model/richText.d.cts +43 -0
- package/dist/types/model/richText.d.cts.map +1 -0
- package/dist/types/model/richText.d.ts +43 -0
- package/dist/types/model/richText.d.ts.map +1 -0
- package/dist/types/model/select.d.cts +24 -0
- package/dist/types/model/select.d.cts.map +1 -0
- package/dist/types/model/select.d.ts +24 -0
- package/dist/types/model/select.d.ts.map +1 -0
- package/dist/types/model/separator.d.cts +16 -0
- package/dist/types/model/separator.d.cts.map +1 -0
- package/dist/types/model/separator.d.ts +16 -0
- package/dist/types/model/separator.d.ts.map +1 -0
- package/dist/types/model/sharedSlice.d.cts +22 -0
- package/dist/types/model/sharedSlice.d.cts.map +1 -0
- package/dist/types/model/sharedSlice.d.ts +22 -0
- package/dist/types/model/sharedSlice.d.ts.map +1 -0
- package/dist/types/model/sharedSliceVariation.d.cts +25 -0
- package/dist/types/model/sharedSliceVariation.d.cts.map +1 -0
- package/dist/types/model/sharedSliceVariation.d.ts +25 -0
- package/dist/types/model/sharedSliceVariation.d.ts.map +1 -0
- package/dist/types/model/slice.cjs +15 -0
- package/dist/types/model/slice.cjs.map +1 -0
- package/dist/types/model/slice.d.cts +39 -0
- package/dist/types/model/slice.d.cts.map +1 -0
- package/dist/types/model/slice.d.ts +39 -0
- package/dist/types/model/slice.d.ts.map +1 -0
- package/dist/types/model/slice.js +14 -0
- package/dist/types/model/slice.js.map +1 -0
- package/dist/types/model/sliceZone.cjs +15 -0
- package/dist/types/model/sliceZone.cjs.map +1 -0
- package/dist/types/model/sliceZone.d.cts +47 -0
- package/dist/types/model/sliceZone.d.cts.map +1 -0
- package/dist/types/model/sliceZone.d.ts +47 -0
- package/dist/types/model/sliceZone.d.ts.map +1 -0
- package/dist/types/model/sliceZone.js +14 -0
- package/dist/types/model/sliceZone.js.map +1 -0
- package/dist/types/model/table.d.cts +18 -0
- package/dist/types/model/table.d.cts.map +1 -0
- package/dist/types/model/table.d.ts +18 -0
- package/dist/types/model/table.d.ts.map +1 -0
- package/dist/types/model/timestamp.d.cts +20 -0
- package/dist/types/model/timestamp.d.cts.map +1 -0
- package/dist/types/model/timestamp.d.ts +20 -0
- package/dist/types/model/timestamp.d.ts.map +1 -0
- package/dist/types/model/title.d.cts +13 -0
- package/dist/types/model/title.d.cts.map +1 -0
- package/dist/types/model/title.d.ts +13 -0
- package/dist/types/model/title.d.ts.map +1 -0
- package/dist/types/model/types.cjs +32 -0
- package/dist/types/model/types.cjs.map +1 -0
- package/dist/types/model/types.d.cts +82 -0
- package/dist/types/model/types.d.cts.map +1 -0
- package/dist/types/model/types.d.ts +82 -0
- package/dist/types/model/types.d.ts.map +1 -0
- package/dist/types/model/types.js +31 -0
- package/dist/types/model/types.js.map +1 -0
- package/dist/types/model/uid.d.cts +19 -0
- package/dist/types/model/uid.d.cts.map +1 -0
- package/dist/types/model/uid.d.ts +19 -0
- package/dist/types/model/uid.d.ts.map +1 -0
- package/dist/types/value/boolean.d.cts +10 -0
- package/dist/types/value/boolean.d.cts.map +1 -0
- package/dist/types/value/boolean.d.ts +10 -0
- package/dist/types/value/boolean.d.ts.map +1 -0
- package/dist/types/value/color.d.cts +15 -0
- package/dist/types/value/color.d.cts.map +1 -0
- package/dist/types/value/color.d.ts +15 -0
- package/dist/types/value/color.d.ts.map +1 -0
- package/dist/types/value/contentRelationship.d.cts +37 -0
- package/dist/types/value/contentRelationship.d.cts.map +1 -0
- package/dist/types/value/contentRelationship.d.ts +37 -0
- package/dist/types/value/contentRelationship.d.ts.map +1 -0
- package/dist/types/value/date.d.cts +15 -0
- package/dist/types/value/date.d.cts.map +1 -0
- package/dist/types/value/date.d.ts +15 -0
- package/dist/types/value/date.d.ts.map +1 -0
- package/dist/types/value/document.d.cts +120 -0
- package/dist/types/value/document.d.cts.map +1 -0
- package/dist/types/value/document.d.ts +120 -0
- package/dist/types/value/document.d.ts.map +1 -0
- package/dist/types/value/embed.cjs +17 -0
- package/dist/types/value/embed.cjs.map +1 -0
- package/dist/types/value/embed.d.cts +173 -0
- package/dist/types/value/embed.d.cts.map +1 -0
- package/dist/types/value/embed.d.ts +173 -0
- package/dist/types/value/embed.d.ts.map +1 -0
- package/dist/types/value/embed.js +16 -0
- package/dist/types/value/embed.js.map +1 -0
- package/dist/types/value/geoPoint.d.cts +18 -0
- package/dist/types/value/geoPoint.d.cts.map +1 -0
- package/dist/types/value/geoPoint.d.ts +18 -0
- package/dist/types/value/geoPoint.d.ts.map +1 -0
- package/dist/types/value/group.d.cts +19 -0
- package/dist/types/value/group.d.cts.map +1 -0
- package/dist/types/value/group.d.ts +19 -0
- package/dist/types/value/group.d.ts.map +1 -0
- package/dist/types/value/image.d.cts +53 -0
- package/dist/types/value/image.d.cts.map +1 -0
- package/dist/types/value/image.d.ts +53 -0
- package/dist/types/value/image.d.ts.map +1 -0
- package/dist/types/value/integration.d.cts +22 -0
- package/dist/types/value/integration.d.cts.map +1 -0
- package/dist/types/value/integration.d.ts +22 -0
- package/dist/types/value/integration.d.ts.map +1 -0
- package/dist/types/value/keyText.d.cts +15 -0
- package/dist/types/value/keyText.d.cts.map +1 -0
- package/dist/types/value/keyText.d.ts +15 -0
- package/dist/types/value/keyText.d.ts.map +1 -0
- package/dist/types/value/link.cjs +15 -0
- package/dist/types/value/link.cjs.map +1 -0
- package/dist/types/value/link.d.cts +74 -0
- package/dist/types/value/link.d.cts.map +1 -0
- package/dist/types/value/link.d.ts +74 -0
- package/dist/types/value/link.d.ts.map +1 -0
- package/dist/types/value/link.js +14 -0
- package/dist/types/value/link.js.map +1 -0
- package/dist/types/value/linkToMedia.d.cts +33 -0
- package/dist/types/value/linkToMedia.d.cts.map +1 -0
- package/dist/types/value/linkToMedia.d.ts +33 -0
- package/dist/types/value/linkToMedia.d.ts.map +1 -0
- package/dist/types/value/number.d.cts +15 -0
- package/dist/types/value/number.d.cts.map +1 -0
- package/dist/types/value/number.d.ts +15 -0
- package/dist/types/value/number.d.ts.map +1 -0
- package/dist/types/value/richText.cjs +32 -0
- package/dist/types/value/richText.cjs.map +1 -0
- package/dist/types/value/richText.d.cts +221 -0
- package/dist/types/value/richText.d.cts.map +1 -0
- package/dist/types/value/richText.d.ts +221 -0
- package/dist/types/value/richText.d.ts.map +1 -0
- package/dist/types/value/richText.js +31 -0
- package/dist/types/value/richText.js.map +1 -0
- package/dist/types/value/select.d.cts +16 -0
- package/dist/types/value/select.d.cts.map +1 -0
- package/dist/types/value/select.d.ts +16 -0
- package/dist/types/value/select.d.ts.map +1 -0
- package/dist/types/value/sharedSlice.d.cts +17 -0
- package/dist/types/value/sharedSlice.d.cts.map +1 -0
- package/dist/types/value/sharedSlice.d.ts +17 -0
- package/dist/types/value/sharedSlice.d.ts.map +1 -0
- package/dist/types/value/sharedSliceVariation.d.cts +16 -0
- package/dist/types/value/sharedSliceVariation.d.cts.map +1 -0
- package/dist/types/value/sharedSliceVariation.d.ts +16 -0
- package/dist/types/value/sharedSliceVariation.d.ts.map +1 -0
- package/dist/types/value/slice.d.cts +19 -0
- package/dist/types/value/slice.d.cts.map +1 -0
- package/dist/types/value/slice.d.ts +19 -0
- package/dist/types/value/slice.d.ts.map +1 -0
- package/dist/types/value/sliceZone.d.cts +18 -0
- package/dist/types/value/sliceZone.d.cts.map +1 -0
- package/dist/types/value/sliceZone.d.ts +18 -0
- package/dist/types/value/sliceZone.d.ts.map +1 -0
- package/dist/types/value/table.d.cts +97 -0
- package/dist/types/value/table.d.cts.map +1 -0
- package/dist/types/value/table.d.ts +97 -0
- package/dist/types/value/table.d.ts.map +1 -0
- package/dist/types/value/timestamp.d.cts +13 -0
- package/dist/types/value/timestamp.d.cts.map +1 -0
- package/dist/types/value/timestamp.d.ts +13 -0
- package/dist/types/value/timestamp.d.ts.map +1 -0
- package/dist/types/value/title.d.cts +16 -0
- package/dist/types/value/title.d.cts.map +1 -0
- package/dist/types/value/title.d.ts +16 -0
- package/dist/types/value/title.d.ts.map +1 -0
- package/dist/types/value/types.d.cts +61 -0
- package/dist/types/value/types.d.cts.map +1 -0
- package/dist/types/value/types.d.ts +61 -0
- package/dist/types/value/types.d.ts.map +1 -0
- package/dist/types/webhook/apiUpdate.d.cts +57 -0
- package/dist/types/webhook/apiUpdate.d.cts.map +1 -0
- package/dist/types/webhook/apiUpdate.d.ts +57 -0
- package/dist/types/webhook/apiUpdate.d.ts.map +1 -0
- package/dist/types/webhook/testTrigger.d.cts +15 -0
- package/dist/types/webhook/testTrigger.d.cts.map +1 -0
- package/dist/types/webhook/testTrigger.d.ts +15 -0
- package/dist/types/webhook/testTrigger.d.ts.map +1 -0
- package/dist/types/webhook/types.cjs +15 -0
- package/dist/types/webhook/types.cjs.map +1 -0
- package/dist/types/webhook/types.d.cts +23 -0
- package/dist/types/webhook/types.d.cts.map +1 -0
- package/dist/types/webhook/types.d.ts +23 -0
- package/dist/types/webhook/types.d.ts.map +1 -0
- package/dist/types/webhook/types.js +14 -0
- package/dist/types/webhook/types.js.map +1 -0
- package/package.json +29 -35
- package/src/Client.ts +682 -1028
- package/src/WriteClient.ts +44 -46
- package/src/buildQueryURL.ts +14 -20
- package/src/createClient.ts +1 -1
- package/src/errors.ts +94 -0
- package/src/getGraphQLEndpoint.ts +1 -1
- package/src/getRepositoryEndpoint.ts +1 -1
- package/src/getRepositoryName.ts +1 -1
- package/src/getToolbarSrc.ts +1 -1
- package/src/helpers/asHTML.ts +4 -4
- package/src/helpers/asImageWidthSrcSet.ts +1 -5
- package/src/helpers/asLink.ts +0 -3
- package/src/helpers/asLinkAttrs.ts +0 -4
- package/src/helpers/mapSliceZone.ts +5 -5
- package/src/index.ts +11 -8
- package/src/lib/isValue.ts +0 -6
- package/src/lib/pLimit.ts +1 -1
- package/src/lib/request.ts +3 -3
- package/src/lib/{throttledLog.ts → throttledWarn.ts} +3 -14
- package/src/lib/validateAssetMetadata.ts +1 -1
- package/src/types/migration/Document.ts +1 -1
- package/src/types/model/contentRelationship.ts +1 -0
- package/src/types/value/date.ts +1 -1
- package/src/types/value/document.ts +3 -3
- package/src/types/value/timestamp.ts +1 -5
- 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.d.ts +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
- package/src/errors/ForbiddenError.ts +0 -16
- package/src/errors/InvalidDataError.ts +0 -5
- package/src/errors/NotFoundError.ts +0 -5
- package/src/errors/ParsingError.ts +0 -16
- package/src/errors/PreviewTokenExpired.ts +0 -12
- package/src/errors/PrismicError.ts +0 -15
- package/src/errors/RefExpiredError.ts +0 -14
- package/src/errors/RefNotFoundError.ts +0 -14
- package/src/errors/RepositoryNotFoundError.ts +0 -5
- package/src/lib/appendFilters.ts +0 -26
- package/src/lib/castArray.ts +0 -14
- package/src/lib/castThunk.ts +0 -13
- package/src/lib/everyTagFilter.ts +0 -15
- package/src/lib/findMasterRef.ts +0 -16
- package/src/lib/findRef.ts +0 -25
- package/src/lib/findRefByID.ts +0 -17
- package/src/lib/findRefByLabel.ts +0 -17
- package/src/lib/minifyGraphQLQuery.ts +0 -13
- package/src/lib/someTagsFilter.ts +0 -15
- package/src/lib/typeFilter.ts +0 -12
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/errors.d.ts
|
|
2
|
+
declare class PrismicError<Response> extends Error {
|
|
3
|
+
url?: string;
|
|
4
|
+
response: Response;
|
|
5
|
+
constructor(message: string | undefined, url: string | undefined, response: Response);
|
|
6
|
+
}
|
|
7
|
+
type ForbiddenErrorRepositoryAPIResponse = {
|
|
8
|
+
type: string;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
type ForbiddenErrorQueryAPIResponse = {
|
|
12
|
+
error: string;
|
|
13
|
+
};
|
|
14
|
+
declare class ForbiddenError<TResponse = ForbiddenErrorRepositoryAPIResponse | ForbiddenErrorQueryAPIResponse> extends PrismicError<TResponse> {}
|
|
15
|
+
declare class NotFoundError<TResponse = undefined> extends PrismicError<TResponse> {}
|
|
16
|
+
declare class RepositoryNotFoundError<TResponse = undefined> extends NotFoundError<TResponse> {}
|
|
17
|
+
type ParsingErrorAPIResponse = {
|
|
18
|
+
type: "parsing-error";
|
|
19
|
+
message: string;
|
|
20
|
+
pos: {
|
|
21
|
+
line: number;
|
|
22
|
+
column: number;
|
|
23
|
+
id: number;
|
|
24
|
+
location: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare class ParsingError<TResponse = ParsingErrorAPIResponse> extends PrismicError<TResponse> {}
|
|
28
|
+
declare class InvalidDataError<TResponse = undefined> extends PrismicError<TResponse> {}
|
|
29
|
+
type RefExpiredErrorAPIResponse = {
|
|
30
|
+
type: "api_validation_error";
|
|
31
|
+
message: string;
|
|
32
|
+
};
|
|
33
|
+
declare class RefExpiredError<TResponse = RefExpiredErrorAPIResponse> extends ForbiddenError<TResponse> {}
|
|
34
|
+
type RefNotFoundErrorAPIResponse = {
|
|
35
|
+
type: "api_notfound_error";
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
declare class RefNotFoundError<TResponse = RefNotFoundErrorAPIResponse> extends ForbiddenError<TResponse> {}
|
|
39
|
+
type PreviewTokenExpiredErrorAPIResponse = {
|
|
40
|
+
type: "api_security_error";
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
43
|
+
declare class PreviewTokenExpiredError<TResponse = PreviewTokenExpiredErrorAPIResponse> extends ForbiddenError<TResponse> {}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { ForbiddenError, InvalidDataError, NotFoundError, ParsingError, PreviewTokenExpiredError, PrismicError, RefExpiredError, RefNotFoundError, RepositoryNotFoundError };
|
|
46
|
+
//# sourceMappingURL=errors.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";cAAa,+BAA+B,KAAA;EAA/B,GAAA,CAAA,EAAA,MAAA;EAEF,QAAA,EAAA,QAAA;EAKC,WAAA,CAAA,OAAA,EAAA,MAAA,GAAA,SAAA,EAAA,GAAA,EAAA,MAAA,GAAA,SAAA,EAAA,QAAA,EAAA,QAAA;;KASP,mCAAA,GAhB4C;EAgB5C,IAAA,EAAA,MAAA;EAKA,OAAA,EAAA,MAAA;AAIL,CAAA;KAJK,8BAAA,GAMD;EACA,KAAA,EAAA,MAAA;CACmB;AAAb,cAJG,cAIH,CAAA,YAFN,mCAEM,GADN,8BACM,CAAA,SAAA,YAAA,CAAa,SAAb,CAAA,CAAA;AAEG,cAAA,aAAa,CAAA,YAEH,SAAb,CAAA,SAAA,YAAY,CAAC,SAAD,CAAA,CAAA;AAMjB,cAJQ,uBAIe,CAAA,YAAA,SAAA,CAAA,SAFlB,aAEkB,CAFJ,SAEI,CAAA,CAAA;KAAvB,uBAAA,GAYQ;EACU,IAAA,EAAA,eAAA;EAAb,OAAA,EAAA,MAAA;EAAY,GAAA,EAAA;IAET,IAAA,EAAA,MAAA;IAIR,MAAA,EAAA,MAAA;IASQ,EAAA,EAAA,MAAA;IACA,QAAA,EAAA,MAAA;EACY,CAAA;CAAf;AAAc,cAnBX,YAmBW,CAAA,YAlBX,uBAkBW,CAAA,SAjBd,YAiBc,CAjBD,SAiBC,CAAA,CAAA;AAWX,cA1BA,gBA0BgB,CAAA,YAAA,SAAA,CAAA,SAxBnB,YAwBmB,CAxBN,SAwBM,CAAA,CAAA;KAtBxB,0BAAA,GAwBoB;EAAf,IAAA,EAAA,sBAAA;EAAc,OAAA,EAAA,MAAA;AAAc,CAAA;AASzB,cAxBA,eAwBwB,CAAA,YAvBxB,0BAuBwB,CAAA,SAtB3B,cAsB2B,CAtBZ,SAsBY,CAAA,CAAA;KApBhC,2BAAA,GAsBoB;EAAf,IAAA,EAAA,oBAAA;EAAc,OAAA,EAAA,MAAA;;cAbX,6BACA,qCACH,eAAe;KAEpB,mCAAA;;;;cAOQ,qCACA,6CACH,eAAe"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/errors.d.ts
|
|
2
|
+
declare class PrismicError<Response> extends Error {
|
|
3
|
+
url?: string;
|
|
4
|
+
response: Response;
|
|
5
|
+
constructor(message: string | undefined, url: string | undefined, response: Response);
|
|
6
|
+
}
|
|
7
|
+
type ForbiddenErrorRepositoryAPIResponse = {
|
|
8
|
+
type: string;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
type ForbiddenErrorQueryAPIResponse = {
|
|
12
|
+
error: string;
|
|
13
|
+
};
|
|
14
|
+
declare class ForbiddenError<TResponse = ForbiddenErrorRepositoryAPIResponse | ForbiddenErrorQueryAPIResponse> extends PrismicError<TResponse> {}
|
|
15
|
+
declare class NotFoundError<TResponse = undefined> extends PrismicError<TResponse> {}
|
|
16
|
+
declare class RepositoryNotFoundError<TResponse = undefined> extends NotFoundError<TResponse> {}
|
|
17
|
+
type ParsingErrorAPIResponse = {
|
|
18
|
+
type: "parsing-error";
|
|
19
|
+
message: string;
|
|
20
|
+
pos: {
|
|
21
|
+
line: number;
|
|
22
|
+
column: number;
|
|
23
|
+
id: number;
|
|
24
|
+
location: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare class ParsingError<TResponse = ParsingErrorAPIResponse> extends PrismicError<TResponse> {}
|
|
28
|
+
declare class InvalidDataError<TResponse = undefined> extends PrismicError<TResponse> {}
|
|
29
|
+
type RefExpiredErrorAPIResponse = {
|
|
30
|
+
type: "api_validation_error";
|
|
31
|
+
message: string;
|
|
32
|
+
};
|
|
33
|
+
declare class RefExpiredError<TResponse = RefExpiredErrorAPIResponse> extends ForbiddenError<TResponse> {}
|
|
34
|
+
type RefNotFoundErrorAPIResponse = {
|
|
35
|
+
type: "api_notfound_error";
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
declare class RefNotFoundError<TResponse = RefNotFoundErrorAPIResponse> extends ForbiddenError<TResponse> {}
|
|
39
|
+
type PreviewTokenExpiredErrorAPIResponse = {
|
|
40
|
+
type: "api_security_error";
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
43
|
+
declare class PreviewTokenExpiredError<TResponse = PreviewTokenExpiredErrorAPIResponse> extends ForbiddenError<TResponse> {}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { ForbiddenError, InvalidDataError, NotFoundError, ParsingError, PreviewTokenExpiredError, PrismicError, RefExpiredError, RefNotFoundError, RepositoryNotFoundError };
|
|
46
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";cAAa,+BAA+B,KAAA;EAA/B,GAAA,CAAA,EAAA,MAAA;EAEF,QAAA,EAAA,QAAA;EAKC,WAAA,CAAA,OAAA,EAAA,MAAA,GAAA,SAAA,EAAA,GAAA,EAAA,MAAA,GAAA,SAAA,EAAA,QAAA,EAAA,QAAA;;KASP,mCAAA,GAhB4C;EAgB5C,IAAA,EAAA,MAAA;EAKA,OAAA,EAAA,MAAA;AAIL,CAAA;KAJK,8BAAA,GAMD;EACA,KAAA,EAAA,MAAA;CACmB;AAAb,cAJG,cAIH,CAAA,YAFN,mCAEM,GADN,8BACM,CAAA,SAAA,YAAA,CAAa,SAAb,CAAA,CAAA;AAEG,cAAA,aAAa,CAAA,YAEH,SAAb,CAAA,SAAA,YAAY,CAAC,SAAD,CAAA,CAAA;AAMjB,cAJQ,uBAIe,CAAA,YAAA,SAAA,CAAA,SAFlB,aAEkB,CAFJ,SAEI,CAAA,CAAA;KAAvB,uBAAA,GAYQ;EACU,IAAA,EAAA,eAAA;EAAb,OAAA,EAAA,MAAA;EAAY,GAAA,EAAA;IAET,IAAA,EAAA,MAAA;IAIR,MAAA,EAAA,MAAA;IASQ,EAAA,EAAA,MAAA;IACA,QAAA,EAAA,MAAA;EACY,CAAA;CAAf;AAAc,cAnBX,YAmBW,CAAA,YAlBX,uBAkBW,CAAA,SAjBd,YAiBc,CAjBD,SAiBC,CAAA,CAAA;AAWX,cA1BA,gBA0BgB,CAAA,YAAA,SAAA,CAAA,SAxBnB,YAwBmB,CAxBN,SAwBM,CAAA,CAAA;KAtBxB,0BAAA,GAwBoB;EAAf,IAAA,EAAA,sBAAA;EAAc,OAAA,EAAA,MAAA;AAAc,CAAA;AASzB,cAxBA,eAwBwB,CAAA,YAvBxB,0BAuBwB,CAAA,SAtB3B,cAsB2B,CAtBZ,SAsBY,CAAA,CAAA;KApBhC,2BAAA,GAsBoB;EAAf,IAAA,EAAA,oBAAA;EAAc,OAAA,EAAA,MAAA;;cAbX,6BACA,qCACH,eAAe;KAEpB,mCAAA;;;;cAOQ,qCACA,6CACH,eAAe"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/errors.ts
|
|
2
|
+
var PrismicError = class extends Error {
|
|
3
|
+
url;
|
|
4
|
+
response;
|
|
5
|
+
constructor(message = "An invalid API response was returned", url, response) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.url = url;
|
|
8
|
+
this.response = response;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var ForbiddenError = class extends PrismicError {};
|
|
12
|
+
var NotFoundError = class extends PrismicError {};
|
|
13
|
+
var RepositoryNotFoundError = class extends NotFoundError {};
|
|
14
|
+
var ParsingError = class extends PrismicError {};
|
|
15
|
+
var InvalidDataError = class extends PrismicError {};
|
|
16
|
+
var RefExpiredError = class extends ForbiddenError {};
|
|
17
|
+
var RefNotFoundError = class extends ForbiddenError {};
|
|
18
|
+
var PreviewTokenExpiredError = class extends ForbiddenError {};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ForbiddenError, InvalidDataError, NotFoundError, ParsingError, PreviewTokenExpiredError, PrismicError, RefExpiredError, RefNotFoundError, RepositoryNotFoundError };
|
|
22
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","names":[],"sources":["../src/errors.ts"],"sourcesContent":["export class PrismicError<Response> extends Error {\n\turl?: string\n\tresponse: Response\n\n\tconstructor(\n\t\tmessage = \"An invalid API response was returned\",\n\t\turl: string | undefined,\n\t\tresponse: Response,\n\t) {\n\t\tsuper(message)\n\n\t\tthis.url = url\n\t\tthis.response = response\n\t}\n}\n\ntype ForbiddenErrorRepositoryAPIResponse = {\n\ttype: string\n\tmessage: string\n}\n\ntype ForbiddenErrorQueryAPIResponse = {\n\terror: string\n}\n\nexport class ForbiddenError<\n\tTResponse =\n\t\t| ForbiddenErrorRepositoryAPIResponse\n\t\t| ForbiddenErrorQueryAPIResponse,\n> extends PrismicError<TResponse> {}\n\nexport class NotFoundError<\n\tTResponse = undefined,\n> extends PrismicError<TResponse> {}\n\nexport class RepositoryNotFoundError<\n\tTResponse = undefined,\n> extends NotFoundError<TResponse> {}\n\ntype ParsingErrorAPIResponse = {\n\ttype: \"parsing-error\"\n\tmessage: string\n\tpos: {\n\t\tline: number\n\t\tcolumn: number\n\t\tid: number\n\t\tlocation: string\n\t}\n}\n\nexport class ParsingError<\n\tTResponse = ParsingErrorAPIResponse,\n> extends PrismicError<TResponse> {}\n\nexport class InvalidDataError<\n\tTResponse = undefined,\n> extends PrismicError<TResponse> {}\n\ntype RefExpiredErrorAPIResponse = {\n\ttype: \"api_validation_error\"\n\tmessage: string\n}\n\n// This error extends `ForbiddenError` for backwards compatibility. Before the\n// API started returning 410 for expired refs, it returned 403, which threw a\n// `ForbiddenError`.\n// TODO: Extend this error from `PrismicError` in v8.\nexport class RefExpiredError<\n\tTResponse = RefExpiredErrorAPIResponse,\n> extends ForbiddenError<TResponse> {}\n\ntype RefNotFoundErrorAPIResponse = {\n\ttype: \"api_notfound_error\"\n\tmessage: string\n}\n\n// This error extends `ForbiddenError` for backwards compatibility. Before the\n// API started returning 404 for not found refs, it returned 403, which threw a\n// `ForbiddenError`.\n// TODO: Extend this error from `PrismicError` in v8.\nexport class RefNotFoundError<\n\tTResponse = RefNotFoundErrorAPIResponse,\n> extends ForbiddenError<TResponse> {}\n\ntype PreviewTokenExpiredErrorAPIResponse = {\n\ttype: \"api_security_error\"\n\tmessage: string\n}\n\n// This error extends `ForbiddenError` for backwards compatibility.\n// TODO: Extend this error from `PrismicError` in v8.\nexport class PreviewTokenExpiredError<\n\tTResponse = PreviewTokenExpiredErrorAPIResponse,\n> extends ForbiddenError<TResponse> {}\n"],"mappings":";AAAA,IAAa,eAAb,cAA4C,MAAM;CACjD;CACA;CAEA,YACC,UAAU,wCACV,KACA,UACC;AACD,QAAM,QAAQ;AAEd,OAAK,MAAM;AACX,OAAK,WAAW;;;AAalB,IAAa,iBAAb,cAIU,aAAwB;AAElC,IAAa,gBAAb,cAEU,aAAwB;AAElC,IAAa,0BAAb,cAEU,cAAyB;AAanC,IAAa,eAAb,cAEU,aAAwB;AAElC,IAAa,mBAAb,cAEU,aAAwB;AAWlC,IAAa,kBAAb,cAEU,eAA0B;AAWpC,IAAa,mBAAb,cAEU,eAA0B;AASpC,IAAa,2BAAb,cAEU,eAA0B"}
|
package/dist/filter.cjs
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/filter.ts
|
|
3
|
+
/**
|
|
4
|
+
* Formats the value of a filter element to a stringified version accepted by
|
|
5
|
+
* the Prismic REST API.
|
|
6
|
+
*
|
|
7
|
+
* @param value - Value to format.
|
|
8
|
+
*
|
|
9
|
+
* @returns `value` formatted for the Prismic REST API.
|
|
10
|
+
*/
|
|
11
|
+
const formatValue = (value) => {
|
|
12
|
+
if (Array.isArray(value)) return `[${value.map(formatValue).join(", ")}]`;
|
|
13
|
+
if (typeof value === "string") return `"${value}"`;
|
|
14
|
+
if (value instanceof Date) return `${value.getTime()}`;
|
|
15
|
+
return `${value}`;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Creates a filter builder function for filters with a path and arguments.
|
|
19
|
+
*
|
|
20
|
+
* @typeParam Args - Arguments for the filter.
|
|
21
|
+
*
|
|
22
|
+
* @param name - Name of the filter used in the resulting string.
|
|
23
|
+
*
|
|
24
|
+
* @returns Filter builder function for the given name.
|
|
25
|
+
*/
|
|
26
|
+
const pathWithArgsFilter = (name) => {
|
|
27
|
+
/**
|
|
28
|
+
* @param path - Path to the value to be compared.
|
|
29
|
+
*/
|
|
30
|
+
const fn = (path, ...args) => {
|
|
31
|
+
const formattedArgs = args.map(formatValue).join(", ");
|
|
32
|
+
return `[${name}(${path}${path && args.length ? ", " : ""}${formattedArgs})]`;
|
|
33
|
+
};
|
|
34
|
+
return fn;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Creates a filter builder function for filters with only a path.
|
|
38
|
+
*
|
|
39
|
+
* @param name - Name of the filter used in the resulting string.
|
|
40
|
+
*
|
|
41
|
+
* @returns Filter builder function for the given name.
|
|
42
|
+
*/
|
|
43
|
+
const pathFilter = (name) => {
|
|
44
|
+
const filterFn = pathWithArgsFilter(name);
|
|
45
|
+
/**
|
|
46
|
+
* @param path - Path for the filter.
|
|
47
|
+
*/
|
|
48
|
+
const fn = (path) => {
|
|
49
|
+
return filterFn(path);
|
|
50
|
+
};
|
|
51
|
+
return fn;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Creates a filter builder function for filters with only arguments and no
|
|
55
|
+
* path.
|
|
56
|
+
*
|
|
57
|
+
* @param name - Name of the filter used in the resulting string.
|
|
58
|
+
*
|
|
59
|
+
* @returns Filter builder function for the given name.
|
|
60
|
+
*/
|
|
61
|
+
const argsFilter = (name) => {
|
|
62
|
+
const filterFn = pathWithArgsFilter(name);
|
|
63
|
+
/**
|
|
64
|
+
* @param args - Arguments for the filter.
|
|
65
|
+
*/
|
|
66
|
+
const fn = (...args) => {
|
|
67
|
+
return filterFn("", ...args);
|
|
68
|
+
};
|
|
69
|
+
return fn;
|
|
70
|
+
};
|
|
71
|
+
const filter = {
|
|
72
|
+
at: pathWithArgsFilter("at"),
|
|
73
|
+
not: pathWithArgsFilter("not"),
|
|
74
|
+
any: pathWithArgsFilter("any"),
|
|
75
|
+
in: pathWithArgsFilter("in"),
|
|
76
|
+
fulltext: pathWithArgsFilter("fulltext"),
|
|
77
|
+
has: pathFilter("has"),
|
|
78
|
+
missing: pathFilter("missing"),
|
|
79
|
+
similar: argsFilter("similar"),
|
|
80
|
+
geopointNear: pathWithArgsFilter("geopoint.near"),
|
|
81
|
+
numberLessThan: pathWithArgsFilter("number.lt"),
|
|
82
|
+
numberGreaterThan: pathWithArgsFilter("number.gt"),
|
|
83
|
+
numberInRange: pathWithArgsFilter("number.inRange"),
|
|
84
|
+
dateAfter: pathWithArgsFilter("date.after"),
|
|
85
|
+
dateBefore: pathWithArgsFilter("date.before"),
|
|
86
|
+
dateBetween: pathWithArgsFilter("date.between"),
|
|
87
|
+
dateDayOfMonth: pathWithArgsFilter("date.day-of-month"),
|
|
88
|
+
dateDayOfMonthAfter: pathWithArgsFilter("date.day-of-month-after"),
|
|
89
|
+
dateDayOfMonthBefore: pathWithArgsFilter("date.day-of-month-before"),
|
|
90
|
+
dateDayOfWeek: pathWithArgsFilter("date.day-of-week"),
|
|
91
|
+
dateDayOfWeekAfter: pathWithArgsFilter("date.day-of-week-after"),
|
|
92
|
+
dateDayOfWeekBefore: pathWithArgsFilter("date.day-of-week-before"),
|
|
93
|
+
dateMonth: pathWithArgsFilter("date.month"),
|
|
94
|
+
dateMonthAfter: pathWithArgsFilter("date.month-after"),
|
|
95
|
+
dateMonthBefore: pathWithArgsFilter("date.month-before"),
|
|
96
|
+
dateYear: pathWithArgsFilter("date.year"),
|
|
97
|
+
dateHour: pathWithArgsFilter("date.hour"),
|
|
98
|
+
dateHourAfter: pathWithArgsFilter("date.hour-after"),
|
|
99
|
+
dateHourBefore: pathWithArgsFilter("date.hour-before")
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
exports.filter = filter;
|
|
104
|
+
//# sourceMappingURL=filter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.cjs","names":[],"sources":["../src/filter.ts"],"sourcesContent":["/**\n * Formats the value of a filter element to a stringified version accepted by\n * the Prismic REST API.\n *\n * @param value - Value to format.\n *\n * @returns `value` formatted for the Prismic REST API.\n */\nconst formatValue = (\n\tvalue:\n\t\t| string\n\t\t| number\n\t\t| Date\n\t\t| unknown\n\t\t| (string | number | Date | unknown)[],\n): string => {\n\tif (Array.isArray(value)) {\n\t\treturn `[${value.map(formatValue).join(\", \")}]`\n\t}\n\n\tif (typeof value === \"string\") {\n\t\treturn `\"${value}\"`\n\t}\n\n\tif (value instanceof Date) {\n\t\treturn `${value.getTime()}`\n\t}\n\n\treturn `${value}`\n}\n\n/**\n * Creates a filter builder function for filters with a path and arguments.\n *\n * @typeParam Args - Arguments for the filter.\n *\n * @param name - Name of the filter used in the resulting string.\n *\n * @returns Filter builder function for the given name.\n */\nconst pathWithArgsFilter = <Args extends unknown[]>(name: string) => {\n\t/**\n\t * @param path - Path to the value to be compared.\n\t */\n\tconst fn = (path: string, ...args: Args): string => {\n\t\tconst formattedArgs = args.map(formatValue).join(\", \")\n\t\tconst joiner = path && args.length ? \", \" : \"\"\n\n\t\treturn `[${name}(${path}${joiner}${formattedArgs})]`\n\t}\n\n\treturn fn\n}\n\n/**\n * Creates a filter builder function for filters with only a path.\n *\n * @param name - Name of the filter used in the resulting string.\n *\n * @returns Filter builder function for the given name.\n */\nconst pathFilter = (name: string) => {\n\tconst filterFn = pathWithArgsFilter(name)\n\n\t/**\n\t * @param path - Path for the filter.\n\t */\n\tconst fn = (path: string): string => {\n\t\treturn filterFn(path)\n\t}\n\n\treturn fn\n}\n\n/**\n * Creates a filter builder function for filters with only arguments and no\n * path.\n *\n * @param name - Name of the filter used in the resulting string.\n *\n * @returns Filter builder function for the given name.\n */\nconst argsFilter = <Args extends unknown[]>(name: string) => {\n\tconst filterFn = pathWithArgsFilter<Args>(name)\n\n\t/**\n\t * @param args - Arguments for the filter.\n\t */\n\tconst fn = (...args: Args): string => {\n\t\treturn filterFn(\"\", ...args)\n\t}\n\n\treturn fn\n}\n\nexport const filter = {\n\t/**\n\t * The `at` filter checks that the path matches the described value exactly.\n\t * It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#at}\n\t */\n\tat: pathWithArgsFilter<[value: string | number | boolean | Date | string[]]>(\n\t\t\"at\",\n\t),\n\n\t/**\n\t * The `not` filter checks that the path doesn't match the provided value\n\t * exactly. It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#not}\n\t */\n\tnot: pathWithArgsFilter<[value: string | number | boolean | Date | string[]]>(\n\t\t\"not\",\n\t),\n\n\t/**\n\t * The `any` filter takes an array of values. It works exactly the same way as\n\t * the `at` operator, but checks whether the fragment matches any of the\n\t * values in the array.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#any}\n\t */\n\tany: pathWithArgsFilter<[values: (string | number | boolean | Date)[]]>(\n\t\t\"any\",\n\t),\n\n\t/**\n\t * The `in` filter is used specifically to retrieve an array of documents by\n\t * their IDs or UIDs. This filter is much more efficient at this than the any\n\t * filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#in}\n\t */\n\tin: pathWithArgsFilter<[values: string[]]>(\"in\"),\n\n\t/**\n\t * The `fulltext` filter provides two capabilities:\n\t *\n\t * 1. Checking if a certain string is anywhere inside a document (this is what\n\t * you should use to make your project's search engine feature)\n\t * 2. Checking if the string is contained inside a specific custom type’s Rich\n\t * Text or Key Text fragment.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#fulltext}\n\t */\n\tfulltext: pathWithArgsFilter<[searchTerms: string]>(\"fulltext\"),\n\n\t/**\n\t * The `has` filter checks whether a fragment has a value. It will return all\n\t * the documents of the specified type that contain a value for the specified\n\t * field.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#has}\n\t */\n\thas: pathFilter(\"has\"),\n\n\t/**\n\t * The `missing` filter checks if a fragment doesn't have a value. It will\n\t * return all the documents of the specified type that do not contain a value\n\t * for the specified field.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#missing}\n\t */\n\tmissing: pathFilter(\"missing\"),\n\n\t/**\n\t * The `similar` filter takes the ID of a document, and returns a list of\n\t * documents with similar content. This allows you to build an automated\n\t * content discovery feature (for example, a \"Related posts\" section).\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#similar}\n\t */\n\tsimilar: argsFilter<[id: string, value: number]>(\"similar\"),\n\n\t/**\n\t * The `geopoint.near` filter checks that the value in the path is within the\n\t * radius of the given coordinates.\n\t *\n\t * This filter will only work for a geopoint field.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#geopointnear}\n\t */\n\tgeopointNear:\n\t\tpathWithArgsFilter<[latitude: number, longitude: number, radius: number]>(\n\t\t\t\"geopoint.near\",\n\t\t),\n\n\t/**\n\t * The `number.lt` filter checks that the value in the number field is less\n\t * than the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#numberlessthan}\n\t */\n\tnumberLessThan: pathWithArgsFilter<[value: number]>(\"number.lt\"),\n\n\t/**\n\t * The `number.gt` filter checks that the value in the number field is greater\n\t * than the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#numbergreaterthan}\n\t */\n\tnumberGreaterThan: pathWithArgsFilter<[value: number]>(\"number.gt\"),\n\n\t/**\n\t * The `number.inRange` filter checks that the value in the path is within the\n\t * two values passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#numberinrange}\n\t */\n\tnumberInRange:\n\t\tpathWithArgsFilter<[lowerLimit: number, upperLimit: number]>(\n\t\t\t\"number.inRange\",\n\t\t),\n\n\t/**\n\t * The `date.after` filter checks that the value in the path is after the date\n\t * value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateAfter: pathWithArgsFilter<[date: string | number | Date]>(\"date.after\"),\n\n\t/**\n\t * The `date.before` filter checks that the value in the path is before the\n\t * date value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateBefore: pathWithArgsFilter<[date: string | number | Date]>(\"date.before\"),\n\n\t/**\n\t * The `date.between` filter checks that the value in the path is within the\n\t * date values passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateBetween:\n\t\tpathWithArgsFilter<\n\t\t\t[startDate: string | number | Date, endDate: string | number | Date]\n\t\t>(\"date.between\"),\n\n\t/**\n\t * The `date.day-of-month` filter checks that the value in the path is equal\n\t * to the day of the month passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfMonth: pathWithArgsFilter<[day: number]>(\"date.day-of-month\"),\n\n\t/**\n\t * The `date.day-of-month-after` filter checks that the value in the path is\n\t * after the day of the month passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfMonthAfter: pathWithArgsFilter<[day: number]>(\n\t\t\"date.day-of-month-after\",\n\t),\n\n\t/**\n\t * The `date.day-of-month-before` filter checks that the value in the path is\n\t * before the day of the month passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfMonthBefore: pathWithArgsFilter<[day: number]>(\n\t\t\"date.day-of-month-before\",\n\t),\n\n\t/**\n\t * The `date.day-of-week` filter checks that the value in the path is equal to\n\t * the day of the week passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfWeek: pathWithArgsFilter<[day: string | number]>(\"date.day-of-week\"),\n\n\t/**\n\t * The `date.day-of-week-after` filter checks that the value in the path is\n\t * after the day of the week passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfWeekAfter: pathWithArgsFilter<[day: string | number]>(\n\t\t\"date.day-of-week-after\",\n\t),\n\n\t/**\n\t * The date.day-of-week-before filter checks that the value in the path is\n\t * before the day of the week passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfWeekBefore: pathWithArgsFilter<[day: string | number]>(\n\t\t\"date.day-of-week-before\",\n\t),\n\n\t/**\n\t * The `date.month` filter checks that the value in the path occurs in the\n\t * month value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateMonth: pathWithArgsFilter<[month: string | number]>(\"date.month\"),\n\n\t/**\n\t * The `date.month-after` filter checks that the value in the path occurs in\n\t * any month after the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateMonthAfter:\n\t\tpathWithArgsFilter<[month: string | number]>(\"date.month-after\"),\n\n\t/**\n\t * The `date.month-before` filter checks that the value in the path occurs in\n\t * any month before the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateMonthBefore:\n\t\tpathWithArgsFilter<[month: string | number]>(\"date.month-before\"),\n\n\t/**\n\t * The `date.year` filter checks that the value in the path occurs in the year\n\t * value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateYear: pathWithArgsFilter<[year: number]>(\"date.year\"),\n\n\t/**\n\t * The `date.hour` filter checks that the value in the path occurs within the\n\t * hour value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateHour: pathWithArgsFilter<[hour: number]>(\"date.hour\"),\n\n\t/**\n\t * The `date.hour-after` filter checks that the value in the path occurs after\n\t * the hour value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateHourAfter: pathWithArgsFilter<[hour: number]>(\"date.hour-after\"),\n\n\t/**\n\t * The `date.hour-before` filter checks that the value in the path occurs\n\t * before the hour value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateHourBefore: pathWithArgsFilter<[hour: number]>(\"date.hour-before\"),\n}\n"],"mappings":";;;;;;;;;;AAQA,MAAM,eACL,UAMY;AACZ,KAAI,MAAM,QAAQ,MAAM,CACvB,QAAO,IAAI,MAAM,IAAI,YAAY,CAAC,KAAK,KAAK,CAAC;AAG9C,KAAI,OAAO,UAAU,SACpB,QAAO,IAAI,MAAM;AAGlB,KAAI,iBAAiB,KACpB,QAAO,GAAG,MAAM,SAAS;AAG1B,QAAO,GAAG;;;;;;;;;;;AAYX,MAAM,sBAA8C,SAAiB;;;;CAIpE,MAAM,MAAM,MAAc,GAAG,SAAuB;EACnD,MAAM,gBAAgB,KAAK,IAAI,YAAY,CAAC,KAAK,KAAK;AAGtD,SAAO,IAAI,KAAK,GAAG,OAFJ,QAAQ,KAAK,SAAS,OAAO,KAET,cAAc;;AAGlD,QAAO;;;;;;;;;AAUR,MAAM,cAAc,SAAiB;CACpC,MAAM,WAAW,mBAAmB,KAAK;;;;CAKzC,MAAM,MAAM,SAAyB;AACpC,SAAO,SAAS,KAAK;;AAGtB,QAAO;;;;;;;;;;AAWR,MAAM,cAAsC,SAAiB;CAC5D,MAAM,WAAW,mBAAyB,KAAK;;;;CAK/C,MAAM,MAAM,GAAG,SAAuB;AACrC,SAAO,SAAS,IAAI,GAAG,KAAK;;AAG7B,QAAO;;AAGR,MAAa,SAAS;CAOrB,IAAI,mBACH,KACA;CAQD,KAAK,mBACJ,MACA;CASD,KAAK,mBACJ,MACA;CASD,IAAI,mBAAuC,KAAK;CAYhD,UAAU,mBAA0C,WAAW;CAS/D,KAAK,WAAW,MAAM;CAStB,SAAS,WAAW,UAAU;CAS9B,SAAS,WAAwC,UAAU;CAU3D,cACC,mBACC,gBACA;CAQF,gBAAgB,mBAAoC,YAAY;CAQhE,mBAAmB,mBAAoC,YAAY;CAQnE,eACC,mBACC,iBACA;CAQF,WAAW,mBAAmD,aAAa;CAQ3E,YAAY,mBAAmD,cAAc;CAQ7E,aACC,mBAEE,eAAe;CAQlB,gBAAgB,mBAAkC,oBAAoB;CAQtE,qBAAqB,mBACpB,0BACA;CAQD,sBAAsB,mBACrB,2BACA;CAQD,eAAe,mBAA2C,mBAAmB;CAQ7E,oBAAoB,mBACnB,yBACA;CAQD,qBAAqB,mBACpB,0BACA;CAQD,WAAW,mBAA6C,aAAa;CAQrE,gBACC,mBAA6C,mBAAmB;CAQjE,iBACC,mBAA6C,oBAAoB;CAQlE,UAAU,mBAAmC,YAAY;CAQzD,UAAU,mBAAmC,YAAY;CAQzD,eAAe,mBAAmC,kBAAkB;CAQpE,gBAAgB,mBAAmC,mBAAmB;CACtE"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
//#region src/filter.d.ts
|
|
2
|
+
declare const filter: {
|
|
3
|
+
/**
|
|
4
|
+
* The `at` filter checks that the path matches the described value exactly.
|
|
5
|
+
* It takes a single value for a field or an array (only for tags).
|
|
6
|
+
*
|
|
7
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#at}
|
|
8
|
+
*/
|
|
9
|
+
at: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
10
|
+
/**
|
|
11
|
+
* The `not` filter checks that the path doesn't match the provided value
|
|
12
|
+
* exactly. It takes a single value for a field or an array (only for tags).
|
|
13
|
+
*
|
|
14
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#not}
|
|
15
|
+
*/
|
|
16
|
+
not: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
17
|
+
/**
|
|
18
|
+
* The `any` filter takes an array of values. It works exactly the same way as
|
|
19
|
+
* the `at` operator, but checks whether the fragment matches any of the
|
|
20
|
+
* values in the array.
|
|
21
|
+
*
|
|
22
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#any}
|
|
23
|
+
*/
|
|
24
|
+
any: (path: string, values: (string | number | boolean | Date)[]) => string;
|
|
25
|
+
/**
|
|
26
|
+
* The `in` filter is used specifically to retrieve an array of documents by
|
|
27
|
+
* their IDs or UIDs. This filter is much more efficient at this than the any
|
|
28
|
+
* filter.
|
|
29
|
+
*
|
|
30
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#in}
|
|
31
|
+
*/
|
|
32
|
+
in: (path: string, values: string[]) => string;
|
|
33
|
+
/**
|
|
34
|
+
* The `fulltext` filter provides two capabilities:
|
|
35
|
+
*
|
|
36
|
+
* 1. Checking if a certain string is anywhere inside a document (this is what
|
|
37
|
+
* you should use to make your project's search engine feature)
|
|
38
|
+
* 2. Checking if the string is contained inside a specific custom type’s Rich
|
|
39
|
+
* Text or Key Text fragment.
|
|
40
|
+
*
|
|
41
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#fulltext}
|
|
42
|
+
*/
|
|
43
|
+
fulltext: (path: string, searchTerms: string) => string;
|
|
44
|
+
/**
|
|
45
|
+
* The `has` filter checks whether a fragment has a value. It will return all
|
|
46
|
+
* the documents of the specified type that contain a value for the specified
|
|
47
|
+
* field.
|
|
48
|
+
*
|
|
49
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#has}
|
|
50
|
+
*/
|
|
51
|
+
has: (path: string) => string;
|
|
52
|
+
/**
|
|
53
|
+
* The `missing` filter checks if a fragment doesn't have a value. It will
|
|
54
|
+
* return all the documents of the specified type that do not contain a value
|
|
55
|
+
* for the specified field.
|
|
56
|
+
*
|
|
57
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#missing}
|
|
58
|
+
*/
|
|
59
|
+
missing: (path: string) => string;
|
|
60
|
+
/**
|
|
61
|
+
* The `similar` filter takes the ID of a document, and returns a list of
|
|
62
|
+
* documents with similar content. This allows you to build an automated
|
|
63
|
+
* content discovery feature (for example, a "Related posts" section).
|
|
64
|
+
*
|
|
65
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#similar}
|
|
66
|
+
*/
|
|
67
|
+
similar: (id: string, value: number) => string;
|
|
68
|
+
/**
|
|
69
|
+
* The `geopoint.near` filter checks that the value in the path is within the
|
|
70
|
+
* radius of the given coordinates.
|
|
71
|
+
*
|
|
72
|
+
* This filter will only work for a geopoint field.
|
|
73
|
+
*
|
|
74
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#geopointnear}
|
|
75
|
+
*/
|
|
76
|
+
geopointNear: (path: string, latitude: number, longitude: number, radius: number) => string;
|
|
77
|
+
/**
|
|
78
|
+
* The `number.lt` filter checks that the value in the number field is less
|
|
79
|
+
* than the value passed into the filter.
|
|
80
|
+
*
|
|
81
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#numberlessthan}
|
|
82
|
+
*/
|
|
83
|
+
numberLessThan: (path: string, value: number) => string;
|
|
84
|
+
/**
|
|
85
|
+
* The `number.gt` filter checks that the value in the number field is greater
|
|
86
|
+
* than the value passed into the filter.
|
|
87
|
+
*
|
|
88
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#numbergreaterthan}
|
|
89
|
+
*/
|
|
90
|
+
numberGreaterThan: (path: string, value: number) => string;
|
|
91
|
+
/**
|
|
92
|
+
* The `number.inRange` filter checks that the value in the path is within the
|
|
93
|
+
* two values passed into the filter.
|
|
94
|
+
*
|
|
95
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#numberinrange}
|
|
96
|
+
*/
|
|
97
|
+
numberInRange: (path: string, lowerLimit: number, upperLimit: number) => string;
|
|
98
|
+
/**
|
|
99
|
+
* The `date.after` filter checks that the value in the path is after the date
|
|
100
|
+
* value passed into the filter.
|
|
101
|
+
*
|
|
102
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
103
|
+
*/
|
|
104
|
+
dateAfter: (path: string, date: string | number | Date) => string;
|
|
105
|
+
/**
|
|
106
|
+
* The `date.before` filter checks that the value in the path is before the
|
|
107
|
+
* date value passed into the filter.
|
|
108
|
+
*
|
|
109
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
110
|
+
*/
|
|
111
|
+
dateBefore: (path: string, date: string | number | Date) => string;
|
|
112
|
+
/**
|
|
113
|
+
* The `date.between` filter checks that the value in the path is within the
|
|
114
|
+
* date values passed into the filter.
|
|
115
|
+
*
|
|
116
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
117
|
+
*/
|
|
118
|
+
dateBetween: (path: string, startDate: string | number | Date, endDate: string | number | Date) => string;
|
|
119
|
+
/**
|
|
120
|
+
* The `date.day-of-month` filter checks that the value in the path is equal
|
|
121
|
+
* to the day of the month passed into the filter.
|
|
122
|
+
*
|
|
123
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
124
|
+
*/
|
|
125
|
+
dateDayOfMonth: (path: string, day: number) => string;
|
|
126
|
+
/**
|
|
127
|
+
* The `date.day-of-month-after` filter checks that the value in the path is
|
|
128
|
+
* after the day of the month passed into the filter.
|
|
129
|
+
*
|
|
130
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
131
|
+
*/
|
|
132
|
+
dateDayOfMonthAfter: (path: string, day: number) => string;
|
|
133
|
+
/**
|
|
134
|
+
* The `date.day-of-month-before` filter checks that the value in the path is
|
|
135
|
+
* before the day of the month passed into the filter.
|
|
136
|
+
*
|
|
137
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
138
|
+
*/
|
|
139
|
+
dateDayOfMonthBefore: (path: string, day: number) => string;
|
|
140
|
+
/**
|
|
141
|
+
* The `date.day-of-week` filter checks that the value in the path is equal to
|
|
142
|
+
* the day of the week passed into the filter.
|
|
143
|
+
*
|
|
144
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
145
|
+
*/
|
|
146
|
+
dateDayOfWeek: (path: string, day: string | number) => string;
|
|
147
|
+
/**
|
|
148
|
+
* The `date.day-of-week-after` filter checks that the value in the path is
|
|
149
|
+
* after the day of the week passed into the filter.
|
|
150
|
+
*
|
|
151
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
152
|
+
*/
|
|
153
|
+
dateDayOfWeekAfter: (path: string, day: string | number) => string;
|
|
154
|
+
/**
|
|
155
|
+
* The date.day-of-week-before filter checks that the value in the path is
|
|
156
|
+
* before the day of the week passed into the filter.
|
|
157
|
+
*
|
|
158
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
159
|
+
*/
|
|
160
|
+
dateDayOfWeekBefore: (path: string, day: string | number) => string;
|
|
161
|
+
/**
|
|
162
|
+
* The `date.month` filter checks that the value in the path occurs in the
|
|
163
|
+
* month value passed into the filter.
|
|
164
|
+
*
|
|
165
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
166
|
+
*/
|
|
167
|
+
dateMonth: (path: string, month: string | number) => string;
|
|
168
|
+
/**
|
|
169
|
+
* The `date.month-after` filter checks that the value in the path occurs in
|
|
170
|
+
* any month after the value passed into the filter.
|
|
171
|
+
*
|
|
172
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
173
|
+
*/
|
|
174
|
+
dateMonthAfter: (path: string, month: string | number) => string;
|
|
175
|
+
/**
|
|
176
|
+
* The `date.month-before` filter checks that the value in the path occurs in
|
|
177
|
+
* any month before the value passed into the filter.
|
|
178
|
+
*
|
|
179
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
180
|
+
*/
|
|
181
|
+
dateMonthBefore: (path: string, month: string | number) => string;
|
|
182
|
+
/**
|
|
183
|
+
* The `date.year` filter checks that the value in the path occurs in the year
|
|
184
|
+
* value passed into the filter.
|
|
185
|
+
*
|
|
186
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
187
|
+
*/
|
|
188
|
+
dateYear: (path: string, year: number) => string;
|
|
189
|
+
/**
|
|
190
|
+
* The `date.hour` filter checks that the value in the path occurs within the
|
|
191
|
+
* hour value passed into the filter.
|
|
192
|
+
*
|
|
193
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
194
|
+
*/
|
|
195
|
+
dateHour: (path: string, hour: number) => string;
|
|
196
|
+
/**
|
|
197
|
+
* The `date.hour-after` filter checks that the value in the path occurs after
|
|
198
|
+
* the hour value passed into the filter.
|
|
199
|
+
*
|
|
200
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
201
|
+
*/
|
|
202
|
+
dateHourAfter: (path: string, hour: number) => string;
|
|
203
|
+
/**
|
|
204
|
+
* The `date.hour-before` filter checks that the value in the path occurs
|
|
205
|
+
* before the hour value passed into the filter.
|
|
206
|
+
*
|
|
207
|
+
* {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
|
|
208
|
+
*/
|
|
209
|
+
dateHourBefore: (path: string, hour: number) => string;
|
|
210
|
+
};
|
|
211
|
+
//#endregion
|
|
212
|
+
export { filter };
|
|
213
|
+
//# sourceMappingURL=filter.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.d.cts","names":[],"sources":["../src/filter.ts"],"sourcesContent":[],"mappings":";cA+Fa;EAAA;;;;;;EAnDY,EAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,IAAA,GAAA,MAAA,EAAA,EAAA,GAAA,MAAA;EAAA;;;;;;yDAAA;;;;;;;;2DAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAAA;;;;;;;qDAAA;;;;;;;2DAAA,iCAAA"}
|