@prismicio/client 7.21.0-alpha.2 → 7.21.0-pr.414.2f27ec1
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 +1218 -0
- package/dist/Client.cjs.map +1 -0
- package/dist/Client.d.cts +976 -0
- package/dist/Client.d.cts.map +1 -0
- package/dist/Client.d.ts +976 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +1218 -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 +220 -0
- package/dist/buildQueryURL.d.cts.map +1 -0
- package/dist/buildQueryURL.d.ts +220 -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/ForbiddenError.cjs +8 -0
- package/dist/errors/ForbiddenError.cjs.map +1 -0
- package/dist/errors/ForbiddenError.d.cts +14 -0
- package/dist/errors/ForbiddenError.d.cts.map +1 -0
- package/dist/errors/ForbiddenError.d.ts +14 -0
- package/dist/errors/ForbiddenError.d.ts.map +1 -0
- package/dist/errors/ForbiddenError.js +8 -0
- package/dist/errors/ForbiddenError.js.map +1 -0
- package/dist/errors/InvalidDataError.cjs +8 -0
- package/dist/errors/InvalidDataError.cjs.map +1 -0
- package/dist/errors/InvalidDataError.d.cts +7 -0
- package/dist/errors/InvalidDataError.d.cts.map +1 -0
- package/dist/errors/InvalidDataError.d.ts +7 -0
- package/dist/errors/InvalidDataError.d.ts.map +1 -0
- package/dist/errors/InvalidDataError.js +8 -0
- package/dist/errors/InvalidDataError.js.map +1 -0
- package/dist/errors/NotFoundError.cjs +8 -0
- package/dist/errors/NotFoundError.cjs.map +1 -0
- package/dist/errors/NotFoundError.d.cts +7 -0
- package/dist/errors/NotFoundError.d.cts.map +1 -0
- package/dist/errors/NotFoundError.d.ts +7 -0
- package/dist/errors/NotFoundError.d.ts.map +1 -0
- package/dist/errors/NotFoundError.js +8 -0
- package/dist/errors/NotFoundError.js.map +1 -0
- package/dist/errors/ParsingError.cjs +8 -0
- package/dist/errors/ParsingError.cjs.map +1 -0
- package/dist/errors/ParsingError.d.cts +17 -0
- package/dist/errors/ParsingError.d.cts.map +1 -0
- package/dist/errors/ParsingError.d.ts +17 -0
- package/dist/errors/ParsingError.d.ts.map +1 -0
- package/dist/errors/ParsingError.js +8 -0
- package/dist/errors/ParsingError.js.map +1 -0
- package/dist/errors/PreviewTokenExpired.cjs +8 -0
- package/dist/errors/PreviewTokenExpired.cjs.map +1 -0
- package/dist/errors/PreviewTokenExpired.d.cts +11 -0
- package/dist/errors/PreviewTokenExpired.d.cts.map +1 -0
- package/dist/errors/PreviewTokenExpired.d.ts +11 -0
- package/dist/errors/PreviewTokenExpired.d.ts.map +1 -0
- package/dist/errors/PreviewTokenExpired.js +8 -0
- package/dist/errors/PreviewTokenExpired.js.map +1 -0
- package/dist/errors/PrismicError.cjs +15 -0
- package/dist/errors/PrismicError.cjs.map +1 -0
- package/dist/errors/PrismicError.d.cts +9 -0
- package/dist/errors/PrismicError.d.cts.map +1 -0
- package/dist/errors/PrismicError.d.ts +9 -0
- package/dist/errors/PrismicError.d.ts.map +1 -0
- package/dist/errors/PrismicError.js +14 -0
- package/dist/errors/PrismicError.js.map +1 -0
- package/dist/errors/RefExpiredError.cjs +8 -0
- package/dist/errors/RefExpiredError.cjs.map +1 -0
- package/dist/errors/RefExpiredError.d.cts +11 -0
- package/dist/errors/RefExpiredError.d.cts.map +1 -0
- package/dist/errors/RefExpiredError.d.ts +11 -0
- package/dist/errors/RefExpiredError.d.ts.map +1 -0
- package/dist/errors/RefExpiredError.js +8 -0
- package/dist/errors/RefExpiredError.js.map +1 -0
- package/dist/errors/RefNotFoundError.cjs +8 -0
- package/dist/errors/RefNotFoundError.cjs.map +1 -0
- package/dist/errors/RefNotFoundError.d.cts +11 -0
- package/dist/errors/RefNotFoundError.d.cts.map +1 -0
- package/dist/errors/RefNotFoundError.d.ts +11 -0
- package/dist/errors/RefNotFoundError.d.ts.map +1 -0
- package/dist/errors/RefNotFoundError.js +8 -0
- package/dist/errors/RefNotFoundError.js.map +1 -0
- package/dist/errors/RepositoryNotFoundError.cjs +8 -0
- package/dist/errors/RepositoryNotFoundError.cjs.map +1 -0
- package/dist/errors/RepositoryNotFoundError.d.cts +7 -0
- package/dist/errors/RepositoryNotFoundError.d.cts.map +1 -0
- package/dist/errors/RepositoryNotFoundError.d.ts +7 -0
- package/dist/errors/RepositoryNotFoundError.d.ts.map +1 -0
- package/dist/errors/RepositoryNotFoundError.js +8 -0
- package/dist/errors/RepositoryNotFoundError.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 +117 -3882
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +151 -4394
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +151 -4394
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -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/appendFilters.cjs +24 -0
- package/dist/lib/appendFilters.cjs.map +1 -0
- package/dist/lib/appendFilters.js +24 -0
- package/dist/lib/appendFilters.js.map +1 -0
- package/dist/lib/castArray.cjs +20 -0
- package/dist/lib/castArray.cjs.map +1 -0
- package/dist/lib/castArray.js +19 -0
- package/dist/lib/castArray.js.map +1 -0
- package/dist/lib/castThunk.cjs +19 -0
- package/dist/lib/castThunk.cjs.map +1 -0
- package/dist/lib/castThunk.js +18 -0
- package/dist/lib/castThunk.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/everyTagFilter.cjs +19 -0
- package/dist/lib/everyTagFilter.cjs.map +1 -0
- package/dist/lib/everyTagFilter.js +19 -0
- package/dist/lib/everyTagFilter.js.map +1 -0
- package/dist/lib/findMasterRef.cjs +19 -0
- package/dist/lib/findMasterRef.cjs.map +1 -0
- package/dist/lib/findMasterRef.js +19 -0
- package/dist/lib/findMasterRef.js.map +1 -0
- package/dist/lib/findRef.cjs +24 -0
- package/dist/lib/findRef.cjs.map +1 -0
- package/dist/lib/findRef.js +24 -0
- package/dist/lib/findRef.js.map +1 -0
- package/dist/lib/findRefByID.cjs +20 -0
- package/dist/lib/findRefByID.cjs.map +1 -0
- package/dist/lib/findRefByID.js +20 -0
- package/dist/lib/findRefByID.js.map +1 -0
- package/dist/lib/findRefByLabel.cjs +20 -0
- package/dist/lib/findRefByLabel.cjs.map +1 -0
- package/dist/lib/findRefByLabel.js +20 -0
- package/dist/lib/findRefByLabel.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/minifyGraphQLQuery.cjs +16 -0
- package/dist/lib/minifyGraphQLQuery.cjs.map +1 -0
- package/dist/lib/minifyGraphQLQuery.js +15 -0
- package/dist/lib/minifyGraphQLQuery.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/someTagsFilter.cjs +19 -0
- package/dist/lib/someTagsFilter.cjs.map +1 -0
- package/dist/lib/someTagsFilter.js +19 -0
- package/dist/lib/someTagsFilter.js.map +1 -0
- package/dist/lib/throttledLog.cjs +28 -0
- package/dist/lib/throttledLog.cjs.map +1 -0
- package/dist/lib/throttledLog.js +27 -0
- package/dist/lib/throttledLog.js.map +1 -0
- package/dist/lib/typeFilter.cjs +17 -0
- package/dist/lib/typeFilter.cjs.map +1 -0
- package/dist/lib/typeFilter.js +17 -0
- package/dist/lib/typeFilter.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 +26 -9
- package/src/WriteClient.ts +28 -36
- package/src/buildQueryURL.ts +4 -1
- package/src/createClient.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 +1 -0
- 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 +0 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6CM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2CA,8BAAqB;;;;KAatB,iBAAA,GAAoB;;;;KAIpB,sBAAA,GAAyB;;;;AAnEiB,cAoGzC,OA7FkB,EAAA;;;;;;;;;EA2ClB,SAAA,MAAA,EAAA,QAAoC;EAarC,SAAA,EAAA,EAAA,IAAA;EAIA,SAAA,QAAA,EAAA,WAAsB;EAiCrB,SAAA,SAA0B,EAAA,aAAA;EA0G3B,SAAA,IAAA,EAAA,iBAAoB;EAsEpB,SAAA,KAAA,EAAA,mBAAA;;;;;;;;;;KAtEA,iBAAA,GAAoB;;;;KAsEpB,qCAAA,GAAwC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { RichTextNodeType } from "./types/value/richText.js";
|
|
2
|
+
import { mapSliceZone } from "./helpers/mapSliceZone.js";
|
|
3
|
+
import { filter } from "./filter.js";
|
|
4
|
+
import { PrismicError } from "./errors/PrismicError.js";
|
|
5
|
+
import { cookie_exports } from "./cookie.js";
|
|
6
|
+
import { ForbiddenError } from "./errors/ForbiddenError.js";
|
|
7
|
+
import { NotFoundError } from "./errors/NotFoundError.js";
|
|
8
|
+
import { ParsingError } from "./errors/ParsingError.js";
|
|
9
|
+
import { PreviewTokenExpiredError } from "./errors/PreviewTokenExpired.js";
|
|
10
|
+
import { RefExpiredError } from "./errors/RefExpiredError.js";
|
|
11
|
+
import { RefNotFoundError } from "./errors/RefNotFoundError.js";
|
|
12
|
+
import { RepositoryNotFoundError } from "./errors/RepositoryNotFoundError.js";
|
|
13
|
+
import { LinkType } from "./types/value/link.js";
|
|
14
|
+
import { documentToLinkField } from "./helpers/documentToLinkField.js";
|
|
15
|
+
import { asLink } from "./helpers/asLink.js";
|
|
16
|
+
import { buildQueryURL } from "./buildQueryURL.js";
|
|
17
|
+
import { isRepositoryName } from "./isRepositoryName.js";
|
|
18
|
+
import { getRepositoryEndpoint } from "./getRepositoryEndpoint.js";
|
|
19
|
+
import { getRepositoryName } from "./getRepositoryName.js";
|
|
20
|
+
import { isRepositoryEndpoint } from "./isRepositoryEndpoint.js";
|
|
21
|
+
import { Client } from "./Client.js";
|
|
22
|
+
import { createClient } from "./createClient.js";
|
|
23
|
+
import { PrismicMigrationAsset } from "./types/migration/Asset.js";
|
|
24
|
+
import { PrismicMigrationDocument } from "./types/migration/Document.js";
|
|
25
|
+
import { isFilled_exports } from "./helpers/isFilled.js";
|
|
26
|
+
import { InvalidDataError } from "./errors/InvalidDataError.js";
|
|
27
|
+
import { WriteClient } from "./WriteClient.js";
|
|
28
|
+
import { createWriteClient } from "./createWriteClient.js";
|
|
29
|
+
import { Migration } from "./Migration.js";
|
|
30
|
+
import { createMigration } from "./createMigration.js";
|
|
31
|
+
import { getGraphQLEndpoint } from "./getGraphQLEndpoint.js";
|
|
32
|
+
import { getToolbarSrc } from "./getToolbarSrc.js";
|
|
33
|
+
import { asDate } from "./helpers/asDate.js";
|
|
34
|
+
import { asLinkAttrs } from "./helpers/asLinkAttrs.js";
|
|
35
|
+
import { asText } from "./helpers/asText.js";
|
|
36
|
+
import { asHTML } from "./helpers/asHTML.js";
|
|
37
|
+
import { asImageSrc } from "./helpers/asImageSrc.js";
|
|
38
|
+
import { asImageWidthSrcSet } from "./helpers/asImageWidthSrcSet.js";
|
|
39
|
+
import { asImagePixelDensitySrcSet } from "./helpers/asImagePixelDensitySrcSet.js";
|
|
40
|
+
import { OEmbedType } from "./types/value/embed.js";
|
|
41
|
+
import { CustomTypeModelFieldType } from "./types/model/types.js";
|
|
42
|
+
import { CustomTypeModelLinkSelectType } from "./types/model/link.js";
|
|
43
|
+
import { CustomTypeModelSliceType } from "./types/model/sliceZone.js";
|
|
44
|
+
import { CustomTypeModelSliceDisplay } from "./types/model/slice.js";
|
|
45
|
+
import { WebhookType } from "./types/webhook/types.js";
|
|
46
|
+
|
|
47
|
+
//#region src/index.ts
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Renamed to `filter`
|
|
50
|
+
*/
|
|
51
|
+
const predicate = filter;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Renamed to `mapSliceZone`
|
|
54
|
+
*/
|
|
55
|
+
const unstable_mapSliceZone = mapSliceZone;
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Use {@link RichTextNodeType} instead.
|
|
58
|
+
*/
|
|
59
|
+
const Element = RichTextNodeType;
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
export { Client, CustomTypeModelFieldType, CustomTypeModelLinkSelectType, CustomTypeModelSliceDisplay, CustomTypeModelSliceType, Element, ForbiddenError, InvalidDataError, LinkType, Migration, NotFoundError, OEmbedType, ParsingError, PreviewTokenExpiredError, PrismicError, PrismicMigrationAsset, PrismicMigrationDocument, RefExpiredError, RefNotFoundError, RepositoryNotFoundError, RichTextNodeType, WebhookType, WriteClient, asDate, asHTML, asImagePixelDensitySrcSet, asImageSrc, asImageWidthSrcSet, asLink, asLinkAttrs, asText, buildQueryURL, cookie_exports as cookie, createClient, createMigration, createWriteClient, documentToLinkField, filter, getGraphQLEndpoint, getRepositoryEndpoint, getRepositoryName, getToolbarSrc, isFilled_exports as isFilled, isRepositoryEndpoint, isRepositoryName, mapSliceZone, predicate, unstable_mapSliceZone };
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// Imports are used for deprecations.\nimport type { CustomTypeModelIntegrationField } from \"./types/model/integration\"\nimport type { IntegrationField } from \"./types/value/integration\"\nimport { RichTextNodeType } from \"./types/value/richText\"\n\nimport type {\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n} from \"./helpers/asHTML\"\nimport { mapSliceZone } from \"./helpers/mapSliceZone\"\n\nimport { filter } from \"./filter\"\n\n//=============================================================================\n// Client - Query content from Prismic.\n//=============================================================================\n\n// Primary Client API.\nexport { createClient } from \"./createClient\"\nexport { Client } from \"./Client\"\n\n// Write Client API.\nexport { createWriteClient } from \"./createWriteClient\"\nexport { WriteClient } from \"./WriteClient\"\n\n// Migration helper.\nexport { createMigration } from \"./createMigration\"\nexport { Migration } from \"./Migration\"\n\n// API endpoint helpers.\nexport { getRepositoryEndpoint } from \"./getRepositoryEndpoint\"\nexport { getRepositoryName } from \"./getRepositoryName\"\nexport { getGraphQLEndpoint } from \"./getGraphQLEndpoint\"\nexport { isRepositoryName } from \"./isRepositoryName\"\nexport { isRepositoryEndpoint } from \"./isRepositoryEndpoint\"\nexport { buildQueryURL } from \"./buildQueryURL\"\n\n// Toolbar helpers.\nexport { getToolbarSrc } from \"./getToolbarSrc\"\n\n// Query filters API.\n/**\n * @deprecated Renamed to `filter`\n */\n// TODO: Remove when we remove support for deprecated `predicate` export.\nconst predicate = filter\nexport { filter, predicate }\n\n// A collection of well-known cookie names shared between Prismic libraries and systems.\nexport * as cookie from \"./cookie\"\n\n// General types used to query content from Prismic. These are made public to allow users to better type their projects.\nexport type { CreateClient } from \"./createClient\"\nexport type { ClientConfig, HttpRequestLike } from \"./Client\"\nexport type { CreateWriteClient } from \"./createWriteClient\"\nexport type { WriteClientConfig, MigrateReporterEvents } from \"./WriteClient\"\nexport type {\n\tBuildQueryURLArgs,\n\tOrdering,\n\tQueryParams,\n\tRoute,\n} from \"./buildQueryURL\"\nexport type { CreateMigration } from \"./createMigration\"\nexport type {\n\tAbortSignalLike,\n\tFetchLike,\n\tRequestInitLike,\n\tResponseLike,\n} from \"./lib/request\"\n\n//=============================================================================\n// Helpers - Manipulate content from Prismic.\n//=============================================================================\n\n// Primary Helpers API.\nexport { asDate } from \"./helpers/asDate\"\nexport { asLink } from \"./helpers/asLink\"\nexport { asLinkAttrs } from \"./helpers/asLinkAttrs\"\nexport { asText } from \"./helpers/asText\"\nexport { asHTML } from \"./helpers/asHTML\"\nexport { asImageSrc } from \"./helpers/asImageSrc\"\nexport { asImageWidthSrcSet } from \"./helpers/asImageWidthSrcSet\"\nexport { asImagePixelDensitySrcSet } from \"./helpers/asImagePixelDensitySrcSet\"\nexport * as isFilled from \"./helpers/isFilled\"\n\n/**\n * @deprecated Renamed to `mapSliceZone`\n */\nconst unstable_mapSliceZone = mapSliceZone\nexport { mapSliceZone, unstable_mapSliceZone }\n\n// Conversion helper.\nexport { documentToLinkField } from \"./helpers/documentToLinkField\"\n\nexport type { LinkResolverFunction } from \"./helpers/asLink\"\nexport type { AsLinkAttrsConfig } from \"./helpers/asLinkAttrs\"\nexport type { SliceMapper } from \"./helpers/mapSliceZone\"\n\n/**\n * @deprecated Renamed to `HTMLRichTextMapSerializer`\n */\ntype HTMLMapSerializer = HTMLRichTextMapSerializer\n/**\n * @deprecated Renamed to `HTMLRichTextFunctionSerializer`\n */\ntype HTMLFunctionSerializer = HTMLRichTextFunctionSerializer\nexport type {\n\tHTMLRichTextMapSerializer,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLMapSerializer,\n\tHTMLFunctionSerializer,\n}\nexport type { HTMLRichTextSerializer } from \"./helpers/asHTML\"\n\n//=============================================================================\n// Errors - Custom errors for Prismic APIs.\n//=============================================================================\n\n// Client Errors\nexport { PrismicError } from \"./errors/PrismicError\"\nexport { ForbiddenError } from \"./errors/ForbiddenError\"\nexport { InvalidDataError } from \"./errors/InvalidDataError\"\nexport { NotFoundError } from \"./errors/NotFoundError\"\nexport { RefNotFoundError } from \"./errors/RefNotFoundError\"\nexport { RefExpiredError } from \"./errors/RefExpiredError\"\nexport { PreviewTokenExpiredError } from \"./errors/PreviewTokenExpired\"\nexport { ParsingError } from \"./errors/ParsingError\"\nexport { RepositoryNotFoundError } from \"./errors/RepositoryNotFoundError\"\n\n//=============================================================================\n// Types - Types representing Prismic content, models, and API payloads.\n//=============================================================================\n\n// Values - Types representing Prismic content.\n/**\n * @deprecated Use {@link RichTextNodeType} instead.\n */\n// TODO: Remove in v8.\nconst Element = RichTextNodeType\nexport { RichTextNodeType, Element }\nexport { LinkType } from \"./types/value/link\"\nexport { OEmbedType } from \"./types/value/embed\"\n\nexport type {\n\tPrismicDocument,\n\tPrismicDocumentWithUID,\n\tPrismicDocumentWithoutUID,\n\tPrismicDocumentHeader,\n\tAlternateLanguage,\n} from \"./types/value/document\"\n\nexport type {\n\t// RichText & Title\n\tRichTextField,\n\t// RichText & Title (block nodes)\n\tRTTextNodeBase,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTListItemNode,\n\tRTOListItemNode,\n\t// RichText & Title (span nodes)\n\tRTSpanNodeBase,\n\tRTStrongNode,\n\tRTEmNode,\n\tRTLabelNode,\n\t// RichText & Title (media nodes)\n\tRTImageNode,\n\tRTEmbedNode,\n\t// RichText & Title (link nodes)\n\tRTLinkNode,\n\t// RichText & Title (serialization related nodes)\n\tRTListNode,\n\tRTOListNode,\n\tRTSpanNode,\n\t// RichText & Title (helpers)\n\tRTNode,\n\tRTTextNode,\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTAnyNode,\n\tRichTextNodeTypes,\n} from \"./types/value/richText\"\nexport type { TitleField } from \"./types/value/title\"\n\nexport type {\n\tImageField,\n\tImageFieldImage,\n\tFilledImageFieldImage,\n\tEmptyImageFieldImage,\n} from \"./types/value/image\"\n\nexport type {\n\tEmptyLinkField,\n\tLinkField,\n\tFilledLinkToWebField,\n} from \"./types/value/link\"\nexport type {\n\tContentRelationshipField,\n\tFilledContentRelationshipField,\n} from \"./types/value/contentRelationship\"\nexport type {\n\tLinkToMediaField,\n\tFilledLinkToMediaField,\n} from \"./types/value/linkToMedia\"\n\nexport type {\n\tOEmbedExtra,\n\tPhotoOEmbed,\n\tVideoOEmbed,\n\tLinkOEmbed,\n\tRichOEmbed,\n\tAnyOEmbed,\n\tEmbedField,\n} from \"./types/value/embed\"\n\nexport type {\n\tTableField,\n\tTableFieldHead,\n\tTableFieldHeadRow,\n\tTableFieldBody,\n\tTableFieldBodyRow,\n\tTableFieldHeaderCell,\n\tTableFieldDataCell,\n} from \"./types/value/table\"\n\nexport type { BooleanField } from \"./types/value/boolean\"\nexport type { ColorField } from \"./types/value/color\"\nexport type { DateField } from \"./types/value/date\"\nexport type { KeyTextField } from \"./types/value/keyText\"\nexport type { NumberField } from \"./types/value/number\"\nexport type { SelectField } from \"./types/value/select\"\nexport type { TimestampField } from \"./types/value/timestamp\"\nexport type { GeoPointField } from \"./types/value/geoPoint\"\n\n/**\n * @deprecated Renamed to `IntegrationField`\n */\n// TODO: Remove when we remove support for deprecated `IntegrationFields` export.\ntype IntegrationFields = IntegrationField\nexport type { IntegrationField, IntegrationFields }\nexport type { IntegrationFieldData } from \"./types/value/integration\"\n\nexport type { GroupField, NestedGroupField } from \"./types/value/group\"\n\nexport type { SliceZone } from \"./types/value/sliceZone\"\nexport type { Slice } from \"./types/value/slice\"\nexport type { SharedSlice } from \"./types/value/sharedSlice\"\nexport type { SharedSliceVariation } from \"./types/value/sharedSliceVariation\"\n\nexport type {\n\tFieldState,\n\tAnyRegularField,\n\tAnySlicePrimaryField,\n\tRepeatable,\n} from \"./types/value/types\"\n\n// Models - Types representing Prismic content models.\nexport { CustomTypeModelFieldType } from \"./types/model/types\"\nexport { CustomTypeModelLinkSelectType } from \"./types/model/link\"\nexport { CustomTypeModelSliceType } from \"./types/model/sliceZone\"\nexport { CustomTypeModelSliceDisplay } from \"./types/model/slice\"\n\nexport type {\n\tCustomTypeModel,\n\tCustomTypeModelDefinition,\n\tCustomTypeModelTab,\n} from \"./types/model/customType\"\n\nexport type {\n\tCustomTypeModelRichTextField,\n\tCustomTypeModelRichTextMultiField,\n\tCustomTypeModelRichTextSingleField,\n} from \"./types/model/richText\"\nexport type { CustomTypeModelTitleField } from \"./types/model/title\"\n\nexport type {\n\tCustomTypeModelImageField,\n\tCustomTypeModelImageConstraint,\n\tCustomTypeModelImageThumbnail,\n} from \"./types/model/image\"\n\nexport type {\n\tCustomTypeModelFetchCustomTypeLevel1,\n\tCustomTypeModelFetchContentRelationshipLevel1,\n\tCustomTypeModelFetchGroupLevel1,\n\tCustomTypeModelFetchCustomTypeLevel2,\n\tCustomTypeModelFetchGroupLevel2,\n\tCustomTypeModelContentRelationshipField,\n} from \"./types/model/contentRelationship\"\nexport type { CustomTypeModelLinkField } from \"./types/model/link\"\nexport type { CustomTypeModelLinkToMediaField } from \"./types/model/linkToMedia\"\n\nexport type { CustomTypeModelEmbedField } from \"./types/model/embed\"\n\nexport type { CustomTypeModelBooleanField } from \"./types/model/boolean\"\nexport type { CustomTypeModelColorField } from \"./types/model/color\"\nexport type { CustomTypeModelDateField } from \"./types/model/date\"\nexport type { CustomTypeModelKeyTextField } from \"./types/model/keyText\"\nexport type { CustomTypeModelNumberField } from \"./types/model/number\"\nexport type { CustomTypeModelSelectField } from \"./types/model/select\"\nexport type { CustomTypeModelTimestampField } from \"./types/model/timestamp\"\nexport type { CustomTypeModelGeoPointField } from \"./types/model/geoPoint\"\nexport type { CustomTypeModelTableField } from \"./types/model/table\"\n\n/**\n * @deprecated Renamed to `CustomTypeModelIntegrationField`.\n */\n// TODO: Remove when we remove support for deprecated `CustomTypeModelIntegrationField` export.\ntype CustomTypeModelIntegrationFieldsField = CustomTypeModelIntegrationField\nexport {\n\tCustomTypeModelIntegrationField,\n\tCustomTypeModelIntegrationFieldsField,\n}\nexport type {\n\tCustomTypeModelGroupField,\n\tCustomTypeModelNestedGroupField,\n} from \"./types/model/group\"\nexport type {\n\tCustomTypeModelSliceZoneField,\n\tCustomTypeModelSliceLabel,\n\tCustomTypeModelSharedSlice,\n} from \"./types/model/sliceZone\"\nexport type {\n\tCustomTypeModelSlice,\n\tCustomTypeModelLegacySlice,\n} from \"./types/model/slice\"\nexport type { SharedSliceModel } from \"./types/model/sharedSlice\"\nexport type { SharedSliceModelVariation } from \"./types/model/sharedSliceVariation\"\n\nexport type { CustomTypeModelUIDField } from \"./types/model/uid\"\n\nexport type { CustomTypeModelRangeField } from \"./types/model/range\"\nexport type { CustomTypeModelSeparatorField } from \"./types/model/separator\"\n\nexport type {\n\tCustomTypeModelField,\n\tCustomTypeModelFieldForGroup,\n\tCustomTypeModelFieldForNestedGroup,\n\tCustomTypeModelFieldForSlicePrimary,\n} from \"./types/model/types\"\n\n// Migrations - Types representing Prismic Migration API content values.\nexport { PrismicMigrationDocument } from \"./types/migration/Document\"\nexport type {\n\tPendingPrismicDocument,\n\tExistingPrismicDocument,\n\tInjectMigrationSpecificTypes,\n} from \"./types/migration/Document\"\n\nexport { PrismicMigrationAsset } from \"./types/migration/Asset\"\nexport type {\n\tMigrationImage,\n\tMigrationLinkToMedia,\n\tMigrationRTImageNode,\n} from \"./types/migration/Asset\"\nexport type { MigrationContentRelationship } from \"./types/migration/ContentRelationship\"\n\n// API - Types representing Prismic Content API responses.\nexport type { Query } from \"./types/api/query\"\n\nexport type { Ref } from \"./types/api/ref\"\n\nexport type { Release } from \"./types/api/release\"\n\nexport type {\n\tRepository,\n\tLanguage,\n\tForm,\n\tFormField,\n} from \"./types/api/repository\"\n\nexport type { Tags } from \"./types/api/tags\"\n\n// Integration - Types representing Prismic's integration API.\nexport type {\n\tIntegrationAPIItem,\n\tIntegrationAPIResults,\n} from \"./types/api/integration\"\n\n// Webhook - Types representing Prismic webhooks.\nexport { WebhookType } from \"./types/webhook/types\"\n\nexport type { WebhookBody } from \"./types/webhook/types\"\n\nexport type { WebhookBodyAPIUpdate } from \"./types/webhook/apiUpdate\"\n\nexport type { WebhookBodyTestTrigger } from \"./types/webhook/testTrigger\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAM,YAAY;;;;AA2ClB,MAAM,wBAAwB;;;;AAkD9B,MAAM,UAAU"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/isRepositoryEndpoint.ts
|
|
3
|
+
/**
|
|
4
|
+
* Determines if a string is a Prismic Content API endpoint. Note that any valid
|
|
5
|
+
* URL is a valid endpoint to support network proxies.
|
|
6
|
+
*
|
|
7
|
+
* @param input - Input to test.
|
|
8
|
+
*
|
|
9
|
+
* @returns `true` if `input` is a valid Prismic Content API endpoint, `false`
|
|
10
|
+
* otherwise.
|
|
11
|
+
*/
|
|
12
|
+
const isRepositoryEndpoint = (input) => {
|
|
13
|
+
try {
|
|
14
|
+
new URL(input);
|
|
15
|
+
return true;
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.isRepositoryEndpoint = isRepositoryEndpoint;
|
|
23
|
+
//# sourceMappingURL=isRepositoryEndpoint.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRepositoryEndpoint.cjs","names":[],"sources":["../src/isRepositoryEndpoint.ts"],"sourcesContent":["/**\n * Determines if a string is a Prismic Content API endpoint. Note that any valid\n * URL is a valid endpoint to support network proxies.\n *\n * @param input - Input to test.\n *\n * @returns `true` if `input` is a valid Prismic Content API endpoint, `false`\n * otherwise.\n */\nexport const isRepositoryEndpoint = (input: string): boolean => {\n\ttry {\n\t\tnew URL(input)\n\n\t\treturn true\n\t} catch {\n\t\treturn false\n\t}\n}\n"],"mappings":";;;;;;;;;;;AASA,MAAa,wBAAwB,UAA2B;AAC/D,KAAI;AACH,MAAI,IAAI,MAAM;AAEd,SAAO;SACA;AACP,SAAO"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/isRepositoryEndpoint.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines if a string is a Prismic Content API endpoint. Note that any valid
|
|
4
|
+
* URL is a valid endpoint to support network proxies.
|
|
5
|
+
*
|
|
6
|
+
* @param input - Input to test.
|
|
7
|
+
*
|
|
8
|
+
* @returns `true` if `input` is a valid Prismic Content API endpoint, `false`
|
|
9
|
+
* otherwise.
|
|
10
|
+
*/
|
|
11
|
+
declare const isRepositoryEndpoint: (input: string) => boolean;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { isRepositoryEndpoint };
|
|
14
|
+
//# sourceMappingURL=isRepositoryEndpoint.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRepositoryEndpoint.d.cts","names":[],"sources":["../src/isRepositoryEndpoint.ts"],"sourcesContent":[],"mappings":";;AASA;;;;;;;;cAAa"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/isRepositoryEndpoint.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines if a string is a Prismic Content API endpoint. Note that any valid
|
|
4
|
+
* URL is a valid endpoint to support network proxies.
|
|
5
|
+
*
|
|
6
|
+
* @param input - Input to test.
|
|
7
|
+
*
|
|
8
|
+
* @returns `true` if `input` is a valid Prismic Content API endpoint, `false`
|
|
9
|
+
* otherwise.
|
|
10
|
+
*/
|
|
11
|
+
declare const isRepositoryEndpoint: (input: string) => boolean;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { isRepositoryEndpoint };
|
|
14
|
+
//# sourceMappingURL=isRepositoryEndpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRepositoryEndpoint.d.ts","names":[],"sources":["../src/isRepositoryEndpoint.ts"],"sourcesContent":[],"mappings":";;AASA;;;;;;;;cAAa"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/isRepositoryEndpoint.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines if a string is a Prismic Content API endpoint. Note that any valid
|
|
4
|
+
* URL is a valid endpoint to support network proxies.
|
|
5
|
+
*
|
|
6
|
+
* @param input - Input to test.
|
|
7
|
+
*
|
|
8
|
+
* @returns `true` if `input` is a valid Prismic Content API endpoint, `false`
|
|
9
|
+
* otherwise.
|
|
10
|
+
*/
|
|
11
|
+
const isRepositoryEndpoint = (input) => {
|
|
12
|
+
try {
|
|
13
|
+
new URL(input);
|
|
14
|
+
return true;
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { isRepositoryEndpoint };
|
|
22
|
+
//# sourceMappingURL=isRepositoryEndpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRepositoryEndpoint.js","names":[],"sources":["../src/isRepositoryEndpoint.ts"],"sourcesContent":["/**\n * Determines if a string is a Prismic Content API endpoint. Note that any valid\n * URL is a valid endpoint to support network proxies.\n *\n * @param input - Input to test.\n *\n * @returns `true` if `input` is a valid Prismic Content API endpoint, `false`\n * otherwise.\n */\nexport const isRepositoryEndpoint = (input: string): boolean => {\n\ttry {\n\t\tnew URL(input)\n\n\t\treturn true\n\t} catch {\n\t\treturn false\n\t}\n}\n"],"mappings":";;;;;;;;;;AASA,MAAa,wBAAwB,UAA2B;AAC/D,KAAI;AACH,MAAI,IAAI,MAAM;AAEd,SAAO;SACA;AACP,SAAO"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/isRepositoryName.ts
|
|
3
|
+
/**
|
|
4
|
+
* Determines if an input is a valid Prismic repository name.
|
|
5
|
+
*
|
|
6
|
+
* @param input - Input to test.
|
|
7
|
+
*
|
|
8
|
+
* @returns `true` if `input` is a valid Prismic repository name, `false`
|
|
9
|
+
* otherwise.
|
|
10
|
+
*/
|
|
11
|
+
const isRepositoryName = (input) => {
|
|
12
|
+
return /^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(input);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.isRepositoryName = isRepositoryName;
|
|
17
|
+
//# sourceMappingURL=isRepositoryName.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRepositoryName.cjs","names":[],"sources":["../src/isRepositoryName.ts"],"sourcesContent":["/**\n * Determines if an input is a valid Prismic repository name.\n *\n * @param input - Input to test.\n *\n * @returns `true` if `input` is a valid Prismic repository name, `false`\n * otherwise.\n */\nexport const isRepositoryName = (input: string): boolean => {\n\treturn /^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(input)\n}\n"],"mappings":";;;;;;;;;;AAQA,MAAa,oBAAoB,UAA2B;AAC3D,QAAO,2CAA2C,KAAK,MAAM"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/isRepositoryName.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines if an input is a valid Prismic repository name.
|
|
4
|
+
*
|
|
5
|
+
* @param input - Input to test.
|
|
6
|
+
*
|
|
7
|
+
* @returns `true` if `input` is a valid Prismic repository name, `false`
|
|
8
|
+
* otherwise.
|
|
9
|
+
*/
|
|
10
|
+
declare const isRepositoryName: (input: string) => boolean;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { isRepositoryName };
|
|
13
|
+
//# sourceMappingURL=isRepositoryName.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRepositoryName.d.cts","names":[],"sources":["../src/isRepositoryName.ts"],"sourcesContent":[],"mappings":";;AAQA;;;;;;;cAAa"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/isRepositoryName.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines if an input is a valid Prismic repository name.
|
|
4
|
+
*
|
|
5
|
+
* @param input - Input to test.
|
|
6
|
+
*
|
|
7
|
+
* @returns `true` if `input` is a valid Prismic repository name, `false`
|
|
8
|
+
* otherwise.
|
|
9
|
+
*/
|
|
10
|
+
declare const isRepositoryName: (input: string) => boolean;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { isRepositoryName };
|
|
13
|
+
//# sourceMappingURL=isRepositoryName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRepositoryName.d.ts","names":[],"sources":["../src/isRepositoryName.ts"],"sourcesContent":[],"mappings":";;AAQA;;;;;;;cAAa"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/isRepositoryName.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines if an input is a valid Prismic repository name.
|
|
4
|
+
*
|
|
5
|
+
* @param input - Input to test.
|
|
6
|
+
*
|
|
7
|
+
* @returns `true` if `input` is a valid Prismic repository name, `false`
|
|
8
|
+
* otherwise.
|
|
9
|
+
*/
|
|
10
|
+
const isRepositoryName = (input) => {
|
|
11
|
+
return /^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(input);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { isRepositoryName };
|
|
16
|
+
//# sourceMappingURL=isRepositoryName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRepositoryName.js","names":[],"sources":["../src/isRepositoryName.ts"],"sourcesContent":["/**\n * Determines if an input is a valid Prismic repository name.\n *\n * @param input - Input to test.\n *\n * @returns `true` if `input` is a valid Prismic repository name, `false`\n * otherwise.\n */\nexport const isRepositoryName = (input: string): boolean => {\n\treturn /^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(input)\n}\n"],"mappings":";;;;;;;;;AAQA,MAAa,oBAAoB,UAA2B;AAC3D,QAAO,2CAA2C,KAAK,MAAM"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const require_castArray = require('./castArray.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/lib/appendFilters.ts
|
|
4
|
+
/**
|
|
5
|
+
* Adds one or more filters to an object with a `filters` property. Appended
|
|
6
|
+
* filters are added to the end of the existing list.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam T - Object to which filters will be append.
|
|
9
|
+
*
|
|
10
|
+
* @param objWithFilters - Object to append filters on the `filters` property.
|
|
11
|
+
* @param filters - One or more filters to append.
|
|
12
|
+
*
|
|
13
|
+
* @returns The object with the appended filters.
|
|
14
|
+
*/
|
|
15
|
+
const appendFilters = (objWithFilters = {}, filters) => {
|
|
16
|
+
return {
|
|
17
|
+
...objWithFilters,
|
|
18
|
+
filters: [...objWithFilters.filters || [], ...require_castArray.castArray(filters)]
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.appendFilters = appendFilters;
|
|
24
|
+
//# sourceMappingURL=appendFilters.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appendFilters.cjs","names":["castArray"],"sources":["../../src/lib/appendFilters.ts"],"sourcesContent":["import { castArray } from \"./castArray\"\n\ninterface WithFilters {\n\tfilters?: string | string[]\n}\n\n/**\n * Adds one or more filters to an object with a `filters` property. Appended\n * filters are added to the end of the existing list.\n *\n * @typeParam T - Object to which filters will be append.\n *\n * @param objWithFilters - Object to append filters on the `filters` property.\n * @param filters - One or more filters to append.\n *\n * @returns The object with the appended filters.\n */\nexport const appendFilters = <T extends WithFilters>(\n\tobjWithFilters: T = {} as T,\n\tfilters: string | string[],\n): T & { filters: string[] } => {\n\treturn {\n\t\t...objWithFilters,\n\t\tfilters: [...(objWithFilters.filters || []), ...castArray(filters)],\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAa,iBACZ,iBAAoB,EAAE,EACtB,YAC+B;AAC/B,QAAO;EACN,GAAG;EACH,SAAS,CAAC,GAAI,eAAe,WAAW,EAAE,EAAG,GAAGA,4BAAU,QAAQ,CAAC;EACnE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { castArray } from "./castArray.js";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/appendFilters.ts
|
|
4
|
+
/**
|
|
5
|
+
* Adds one or more filters to an object with a `filters` property. Appended
|
|
6
|
+
* filters are added to the end of the existing list.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam T - Object to which filters will be append.
|
|
9
|
+
*
|
|
10
|
+
* @param objWithFilters - Object to append filters on the `filters` property.
|
|
11
|
+
* @param filters - One or more filters to append.
|
|
12
|
+
*
|
|
13
|
+
* @returns The object with the appended filters.
|
|
14
|
+
*/
|
|
15
|
+
const appendFilters = (objWithFilters = {}, filters) => {
|
|
16
|
+
return {
|
|
17
|
+
...objWithFilters,
|
|
18
|
+
filters: [...objWithFilters.filters || [], ...castArray(filters)]
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { appendFilters };
|
|
24
|
+
//# sourceMappingURL=appendFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appendFilters.js","names":[],"sources":["../../src/lib/appendFilters.ts"],"sourcesContent":["import { castArray } from \"./castArray\"\n\ninterface WithFilters {\n\tfilters?: string | string[]\n}\n\n/**\n * Adds one or more filters to an object with a `filters` property. Appended\n * filters are added to the end of the existing list.\n *\n * @typeParam T - Object to which filters will be append.\n *\n * @param objWithFilters - Object to append filters on the `filters` property.\n * @param filters - One or more filters to append.\n *\n * @returns The object with the appended filters.\n */\nexport const appendFilters = <T extends WithFilters>(\n\tobjWithFilters: T = {} as T,\n\tfilters: string | string[],\n): T & { filters: string[] } => {\n\treturn {\n\t\t...objWithFilters,\n\t\tfilters: [...(objWithFilters.filters || []), ...castArray(filters)],\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAa,iBACZ,iBAAoB,EAAE,EACtB,YAC+B;AAC/B,QAAO;EACN,GAAG;EACH,SAAS,CAAC,GAAI,eAAe,WAAW,EAAE,EAAG,GAAG,UAAU,QAAQ,CAAC;EACnE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/lib/castArray.ts
|
|
3
|
+
/**
|
|
4
|
+
* Ensures that a value is an array. If it is already an array, it is returned
|
|
5
|
+
* as is. If it is not an array, it is converted to an array with itself as its
|
|
6
|
+
* only element.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam A - Element of the array.
|
|
9
|
+
*
|
|
10
|
+
* @param a - Value to ensure is an array.
|
|
11
|
+
*
|
|
12
|
+
* @returns `a` as an array.
|
|
13
|
+
*/
|
|
14
|
+
const castArray = (a) => {
|
|
15
|
+
return Array.isArray(a) ? a : [a];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.castArray = castArray;
|
|
20
|
+
//# sourceMappingURL=castArray.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"castArray.cjs","names":[],"sources":["../../src/lib/castArray.ts"],"sourcesContent":["/**\n * Ensures that a value is an array. If it is already an array, it is returned\n * as is. If it is not an array, it is converted to an array with itself as its\n * only element.\n *\n * @typeParam A - Element of the array.\n *\n * @param a - Value to ensure is an array.\n *\n * @returns `a` as an array.\n */\nexport const castArray = <A>(a: A | A[]): A[] => {\n\treturn Array.isArray(a) ? a : [a]\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,aAAgB,MAAoB;AAChD,QAAO,MAAM,QAAQ,EAAE,GAAG,IAAI,CAAC,EAAE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/lib/castArray.ts
|
|
2
|
+
/**
|
|
3
|
+
* Ensures that a value is an array. If it is already an array, it is returned
|
|
4
|
+
* as is. If it is not an array, it is converted to an array with itself as its
|
|
5
|
+
* only element.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam A - Element of the array.
|
|
8
|
+
*
|
|
9
|
+
* @param a - Value to ensure is an array.
|
|
10
|
+
*
|
|
11
|
+
* @returns `a` as an array.
|
|
12
|
+
*/
|
|
13
|
+
const castArray = (a) => {
|
|
14
|
+
return Array.isArray(a) ? a : [a];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { castArray };
|
|
19
|
+
//# sourceMappingURL=castArray.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"castArray.js","names":[],"sources":["../../src/lib/castArray.ts"],"sourcesContent":["/**\n * Ensures that a value is an array. If it is already an array, it is returned\n * as is. If it is not an array, it is converted to an array with itself as its\n * only element.\n *\n * @typeParam A - Element of the array.\n *\n * @param a - Value to ensure is an array.\n *\n * @returns `a` as an array.\n */\nexport const castArray = <A>(a: A | A[]): A[] => {\n\treturn Array.isArray(a) ? a : [a]\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,aAAgB,MAAoB;AAChD,QAAO,MAAM,QAAQ,EAAE,GAAG,IAAI,CAAC,EAAE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/lib/castThunk.ts
|
|
3
|
+
/**
|
|
4
|
+
* Ensures that a value is a thunk. If it is already a thunk, it is returned as
|
|
5
|
+
* is. If it is not a thunk, it is converted to a thunk.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam A - Value returned by the thunk.
|
|
8
|
+
*
|
|
9
|
+
* @param a - Value to ensure is a thunk.
|
|
10
|
+
*
|
|
11
|
+
* @returns `a` as a a thunk.
|
|
12
|
+
*/
|
|
13
|
+
const castThunk = (a) => {
|
|
14
|
+
return typeof a === "function" ? a : () => a;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.castThunk = castThunk;
|
|
19
|
+
//# sourceMappingURL=castThunk.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"castThunk.cjs","names":[],"sources":["../../src/lib/castThunk.ts"],"sourcesContent":["/**\n * Ensures that a value is a thunk. If it is already a thunk, it is returned as\n * is. If it is not a thunk, it is converted to a thunk.\n *\n * @typeParam A - Value returned by the thunk.\n *\n * @param a - Value to ensure is a thunk.\n *\n * @returns `a` as a a thunk.\n */\nexport const castThunk = <A>(a: A | (() => A)): (() => A) => {\n\treturn typeof a === \"function\" ? (a as () => A) : () => a\n}\n"],"mappings":";;;;;;;;;;;;AAUA,MAAa,aAAgB,MAAgC;AAC5D,QAAO,OAAO,MAAM,aAAc,UAAsB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/lib/castThunk.ts
|
|
2
|
+
/**
|
|
3
|
+
* Ensures that a value is a thunk. If it is already a thunk, it is returned as
|
|
4
|
+
* is. If it is not a thunk, it is converted to a thunk.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam A - Value returned by the thunk.
|
|
7
|
+
*
|
|
8
|
+
* @param a - Value to ensure is a thunk.
|
|
9
|
+
*
|
|
10
|
+
* @returns `a` as a a thunk.
|
|
11
|
+
*/
|
|
12
|
+
const castThunk = (a) => {
|
|
13
|
+
return typeof a === "function" ? a : () => a;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { castThunk };
|
|
18
|
+
//# sourceMappingURL=castThunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"castThunk.js","names":[],"sources":["../../src/lib/castThunk.ts"],"sourcesContent":["/**\n * Ensures that a value is a thunk. If it is already a thunk, it is returned as\n * is. If it is not a thunk, it is converted to a thunk.\n *\n * @typeParam A - Value returned by the thunk.\n *\n * @param a - Value to ensure is a thunk.\n *\n * @returns `a` as a a thunk.\n */\nexport const castThunk = <A>(a: A | (() => A)): (() => A) => {\n\treturn typeof a === \"function\" ? (a as () => A) : () => a\n}\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,aAAgB,MAAgC;AAC5D,QAAO,OAAO,MAAM,aAAc,UAAsB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const require_package = require('../package.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/lib/devMsg.ts
|
|
4
|
+
/**
|
|
5
|
+
* Returns a `prismic.dev/msg` URL for a given message slug.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* devMsg("missing-param")
|
|
11
|
+
* // => "https://prismic.dev/msg/client/v1.2.3/missing-param.md"
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param slug - Slug for the message. This corresponds to a Markdown file in
|
|
15
|
+
* the Git repository's `/messages` directory.
|
|
16
|
+
*
|
|
17
|
+
* @returns The `prismic.dev/msg` URL for the given slug.
|
|
18
|
+
*/
|
|
19
|
+
const devMsg = (slug) => {
|
|
20
|
+
return `https://prismic.dev/msg/client/v${require_package.version}/${slug}`;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.devMsg = devMsg;
|
|
25
|
+
//# sourceMappingURL=devMsg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devMsg.cjs","names":["version"],"sources":["../../src/lib/devMsg.ts"],"sourcesContent":["import { version } from \"../../package.json\"\n\n/**\n * Returns a `prismic.dev/msg` URL for a given message slug.\n *\n * @example\n *\n * ```ts\n * devMsg(\"missing-param\")\n * // => \"https://prismic.dev/msg/client/v1.2.3/missing-param.md\"\n * ```\n *\n * @param slug - Slug for the message. This corresponds to a Markdown file in\n * the Git repository's `/messages` directory.\n *\n * @returns The `prismic.dev/msg` URL for the given slug.\n */\nexport const devMsg = (slug: string): string => {\n\treturn `https://prismic.dev/msg/client/v${version}/${slug}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAa,UAAU,SAAyB;AAC/C,QAAO,mCAAmCA,wBAAQ,GAAG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { version } from "../package.js";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/devMsg.ts
|
|
4
|
+
/**
|
|
5
|
+
* Returns a `prismic.dev/msg` URL for a given message slug.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* devMsg("missing-param")
|
|
11
|
+
* // => "https://prismic.dev/msg/client/v1.2.3/missing-param.md"
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param slug - Slug for the message. This corresponds to a Markdown file in
|
|
15
|
+
* the Git repository's `/messages` directory.
|
|
16
|
+
*
|
|
17
|
+
* @returns The `prismic.dev/msg` URL for the given slug.
|
|
18
|
+
*/
|
|
19
|
+
const devMsg = (slug) => {
|
|
20
|
+
return `https://prismic.dev/msg/client/v${version}/${slug}`;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { devMsg };
|
|
25
|
+
//# sourceMappingURL=devMsg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devMsg.js","names":[],"sources":["../../src/lib/devMsg.ts"],"sourcesContent":["import { version } from \"../../package.json\"\n\n/**\n * Returns a `prismic.dev/msg` URL for a given message slug.\n *\n * @example\n *\n * ```ts\n * devMsg(\"missing-param\")\n * // => \"https://prismic.dev/msg/client/v1.2.3/missing-param.md\"\n * ```\n *\n * @param slug - Slug for the message. This corresponds to a Markdown file in\n * the Git repository's `/messages` directory.\n *\n * @returns The `prismic.dev/msg` URL for the given slug.\n */\nexport const devMsg = (slug: string): string => {\n\treturn `https://prismic.dev/msg/client/v${version}/${slug}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAa,UAAU,SAAyB;AAC/C,QAAO,mCAAmC,QAAQ,GAAG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/lib/escapeHTML.ts
|
|
3
|
+
const matchHtmlRegExp = /["'&<>]/;
|
|
4
|
+
const escapeHTML = (string) => {
|
|
5
|
+
const str = "" + string;
|
|
6
|
+
const match = matchHtmlRegExp.exec(str);
|
|
7
|
+
if (!match) return str;
|
|
8
|
+
let escape;
|
|
9
|
+
let html = "";
|
|
10
|
+
let index = 0;
|
|
11
|
+
let lastIndex = 0;
|
|
12
|
+
for (index = match.index; index < str.length; index++) {
|
|
13
|
+
switch (str.charCodeAt(index)) {
|
|
14
|
+
case 34:
|
|
15
|
+
escape = """;
|
|
16
|
+
break;
|
|
17
|
+
case 38:
|
|
18
|
+
escape = "&";
|
|
19
|
+
break;
|
|
20
|
+
case 39:
|
|
21
|
+
escape = "'";
|
|
22
|
+
break;
|
|
23
|
+
case 60:
|
|
24
|
+
escape = "<";
|
|
25
|
+
break;
|
|
26
|
+
case 62:
|
|
27
|
+
escape = ">";
|
|
28
|
+
break;
|
|
29
|
+
default: continue;
|
|
30
|
+
}
|
|
31
|
+
if (lastIndex !== index) html += str.substring(lastIndex, index);
|
|
32
|
+
lastIndex = index + 1;
|
|
33
|
+
html += escape;
|
|
34
|
+
}
|
|
35
|
+
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
exports.escapeHTML = escapeHTML;
|
|
40
|
+
//# sourceMappingURL=escapeHTML.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escapeHTML.cjs","names":[],"sources":["../../src/lib/escapeHTML.ts"],"sourcesContent":["/*\n ** Core logic from https://github.com/component/escape-html\n ** Many thanks to @component\n */\n\nconst matchHtmlRegExp = /[\"'&<>]/\n\nexport const escapeHTML = (string?: string | null): string => {\n\tconst str = \"\" + string\n\tconst match = matchHtmlRegExp.exec(str)\n\n\tif (!match) {\n\t\treturn str\n\t}\n\n\tlet escape\n\tlet html = \"\"\n\tlet index = 0\n\tlet lastIndex = 0\n\n\tfor (index = match.index; index < str.length; index++) {\n\t\tswitch (str.charCodeAt(index)) {\n\t\t\tcase 34: // \"\n\t\t\t\tescape = \""\"\n\t\t\t\tbreak\n\t\t\tcase 38: // &\n\t\t\t\tescape = \"&\"\n\t\t\t\tbreak\n\t\t\tcase 39: // '\n\t\t\t\tescape = \"'\"\n\t\t\t\tbreak\n\t\t\tcase 60: // <\n\t\t\t\tescape = \"<\"\n\t\t\t\tbreak\n\t\t\tcase 62: // >\n\t\t\t\tescape = \">\"\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tcontinue\n\t\t}\n\n\t\tif (lastIndex !== index) {\n\t\t\thtml += str.substring(lastIndex, index)\n\t\t}\n\n\t\tlastIndex = index + 1\n\t\thtml += escape\n\t}\n\n\treturn lastIndex !== index ? html + str.substring(lastIndex, index) : html\n}\n"],"mappings":";;AAKA,MAAM,kBAAkB;AAExB,MAAa,cAAc,WAAmC;CAC7D,MAAM,MAAM,KAAK;CACjB,MAAM,QAAQ,gBAAgB,KAAK,IAAI;AAEvC,KAAI,CAAC,MACJ,QAAO;CAGR,IAAI;CACJ,IAAI,OAAO;CACX,IAAI,QAAQ;CACZ,IAAI,YAAY;AAEhB,MAAK,QAAQ,MAAM,OAAO,QAAQ,IAAI,QAAQ,SAAS;AACtD,UAAQ,IAAI,WAAW,MAAM,EAA7B;GACC,KAAK;AACJ,aAAS;AACT;GACD,KAAK;AACJ,aAAS;AACT;GACD,KAAK;AACJ,aAAS;AACT;GACD,KAAK;AACJ,aAAS;AACT;GACD,KAAK;AACJ,aAAS;AACT;GACD,QACC;;AAGF,MAAI,cAAc,MACjB,SAAQ,IAAI,UAAU,WAAW,MAAM;AAGxC,cAAY,QAAQ;AACpB,UAAQ;;AAGT,QAAO,cAAc,QAAQ,OAAO,IAAI,UAAU,WAAW,MAAM,GAAG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region src/lib/escapeHTML.ts
|
|
2
|
+
const matchHtmlRegExp = /["'&<>]/;
|
|
3
|
+
const escapeHTML = (string) => {
|
|
4
|
+
const str = "" + string;
|
|
5
|
+
const match = matchHtmlRegExp.exec(str);
|
|
6
|
+
if (!match) return str;
|
|
7
|
+
let escape;
|
|
8
|
+
let html = "";
|
|
9
|
+
let index = 0;
|
|
10
|
+
let lastIndex = 0;
|
|
11
|
+
for (index = match.index; index < str.length; index++) {
|
|
12
|
+
switch (str.charCodeAt(index)) {
|
|
13
|
+
case 34:
|
|
14
|
+
escape = """;
|
|
15
|
+
break;
|
|
16
|
+
case 38:
|
|
17
|
+
escape = "&";
|
|
18
|
+
break;
|
|
19
|
+
case 39:
|
|
20
|
+
escape = "'";
|
|
21
|
+
break;
|
|
22
|
+
case 60:
|
|
23
|
+
escape = "<";
|
|
24
|
+
break;
|
|
25
|
+
case 62:
|
|
26
|
+
escape = ">";
|
|
27
|
+
break;
|
|
28
|
+
default: continue;
|
|
29
|
+
}
|
|
30
|
+
if (lastIndex !== index) html += str.substring(lastIndex, index);
|
|
31
|
+
lastIndex = index + 1;
|
|
32
|
+
html += escape;
|
|
33
|
+
}
|
|
34
|
+
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { escapeHTML };
|
|
39
|
+
//# sourceMappingURL=escapeHTML.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escapeHTML.js","names":[],"sources":["../../src/lib/escapeHTML.ts"],"sourcesContent":["/*\n ** Core logic from https://github.com/component/escape-html\n ** Many thanks to @component\n */\n\nconst matchHtmlRegExp = /[\"'&<>]/\n\nexport const escapeHTML = (string?: string | null): string => {\n\tconst str = \"\" + string\n\tconst match = matchHtmlRegExp.exec(str)\n\n\tif (!match) {\n\t\treturn str\n\t}\n\n\tlet escape\n\tlet html = \"\"\n\tlet index = 0\n\tlet lastIndex = 0\n\n\tfor (index = match.index; index < str.length; index++) {\n\t\tswitch (str.charCodeAt(index)) {\n\t\t\tcase 34: // \"\n\t\t\t\tescape = \""\"\n\t\t\t\tbreak\n\t\t\tcase 38: // &\n\t\t\t\tescape = \"&\"\n\t\t\t\tbreak\n\t\t\tcase 39: // '\n\t\t\t\tescape = \"'\"\n\t\t\t\tbreak\n\t\t\tcase 60: // <\n\t\t\t\tescape = \"<\"\n\t\t\t\tbreak\n\t\t\tcase 62: // >\n\t\t\t\tescape = \">\"\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tcontinue\n\t\t}\n\n\t\tif (lastIndex !== index) {\n\t\t\thtml += str.substring(lastIndex, index)\n\t\t}\n\n\t\tlastIndex = index + 1\n\t\thtml += escape\n\t}\n\n\treturn lastIndex !== index ? html + str.substring(lastIndex, index) : html\n}\n"],"mappings":";AAKA,MAAM,kBAAkB;AAExB,MAAa,cAAc,WAAmC;CAC7D,MAAM,MAAM,KAAK;CACjB,MAAM,QAAQ,gBAAgB,KAAK,IAAI;AAEvC,KAAI,CAAC,MACJ,QAAO;CAGR,IAAI;CACJ,IAAI,OAAO;CACX,IAAI,QAAQ;CACZ,IAAI,YAAY;AAEhB,MAAK,QAAQ,MAAM,OAAO,QAAQ,IAAI,QAAQ,SAAS;AACtD,UAAQ,IAAI,WAAW,MAAM,EAA7B;GACC,KAAK;AACJ,aAAS;AACT;GACD,KAAK;AACJ,aAAS;AACT;GACD,KAAK;AACJ,aAAS;AACT;GACD,KAAK;AACJ,aAAS;AACT;GACD,KAAK;AACJ,aAAS;AACT;GACD,QACC;;AAGF,MAAI,cAAc,MACjB,SAAQ,IAAI,UAAU,WAAW,MAAM;AAGxC,cAAY,QAAQ;AACpB,UAAQ;;AAGT,QAAO,cAAc,QAAQ,OAAO,IAAI,UAAU,WAAW,MAAM,GAAG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const require_filter = require('../filter.cjs');
|
|
2
|
+
const require_castArray = require('./castArray.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/lib/everyTagFilter.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates a filter to filter content by document tags. All tags are required on
|
|
7
|
+
* the document.
|
|
8
|
+
*
|
|
9
|
+
* @param tags - Document tags to filter queried content.
|
|
10
|
+
*
|
|
11
|
+
* @returns A filter that can be used in a Prismic REST API V2 request.
|
|
12
|
+
*/
|
|
13
|
+
const everyTagFilter = (tags) => {
|
|
14
|
+
return require_filter.filter.at("document.tags", require_castArray.castArray(tags));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.everyTagFilter = everyTagFilter;
|
|
19
|
+
//# sourceMappingURL=everyTagFilter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"everyTagFilter.cjs","names":["filter","castArray"],"sources":["../../src/lib/everyTagFilter.ts"],"sourcesContent":["import { filter } from \"../filter\"\n\nimport { castArray } from \"./castArray\"\n\n/**\n * Creates a filter to filter content by document tags. All tags are required on\n * the document.\n *\n * @param tags - Document tags to filter queried content.\n *\n * @returns A filter that can be used in a Prismic REST API V2 request.\n */\nexport const everyTagFilter = (tags: string | string[]): string => {\n\treturn filter.at(\"document.tags\", castArray(tags))\n}\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,kBAAkB,SAAoC;AAClE,QAAOA,sBAAO,GAAG,iBAAiBC,4BAAU,KAAK,CAAC"}
|