@prismicio/client 7.22.3 → 7.23.0-canary.3712f41
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 +3 -4
- package/dist/Client.d.cts +3 -4
- package/dist/Client.d.cts.map +1 -1
- package/dist/Client.d.ts +3 -4
- package/dist/Client.d.ts.map +1 -1
- package/dist/Client.js +3 -4
- package/dist/Migration.cjs +5 -6
- package/dist/Migration.d.cts +5 -6
- package/dist/Migration.d.cts.map +1 -1
- package/dist/Migration.d.ts +5 -6
- package/dist/Migration.d.ts.map +1 -1
- package/dist/Migration.js +5 -6
- package/dist/WriteClient.cjs +3 -4
- package/dist/WriteClient.d.cts +4 -5
- package/dist/WriteClient.d.cts.map +1 -1
- package/dist/WriteClient.d.ts +4 -5
- package/dist/WriteClient.d.ts.map +1 -1
- package/dist/WriteClient.js +3 -4
- package/dist/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/buildQueryURL.cjs +1 -2
- package/dist/buildQueryURL.d.cts +1 -2
- package/dist/buildQueryURL.d.cts.map +1 -1
- package/dist/buildQueryURL.d.ts +1 -2
- package/dist/buildQueryURL.d.ts.map +1 -1
- package/dist/buildQueryURL.js +1 -2
- package/dist/cookie.cjs +8 -3
- package/dist/cookie.cjs.map +1 -1
- package/dist/cookie.d.cts +3 -2
- package/dist/cookie.d.cts.map +1 -1
- package/dist/cookie.d.ts +3 -2
- package/dist/cookie.d.ts.map +1 -1
- package/dist/cookie.js +8 -4
- package/dist/cookie.js.map +1 -1
- package/dist/createClient.cjs +1 -2
- package/dist/createClient.d.cts +1 -3
- package/dist/createClient.d.cts.map +1 -1
- package/dist/createClient.d.ts +1 -3
- package/dist/createClient.d.ts.map +1 -1
- package/dist/createClient.js +1 -2
- package/dist/createMigration.cjs +1 -2
- package/dist/createMigration.d.cts +1 -3
- package/dist/createMigration.d.cts.map +1 -1
- package/dist/createMigration.d.ts +1 -3
- package/dist/createMigration.d.ts.map +1 -1
- package/dist/createMigration.js +1 -2
- package/dist/createWriteClient.cjs +1 -2
- package/dist/createWriteClient.d.cts +0 -2
- package/dist/createWriteClient.d.cts.map +1 -1
- package/dist/createWriteClient.d.ts +0 -2
- package/dist/createWriteClient.d.ts.map +1 -1
- package/dist/createWriteClient.js +1 -2
- package/dist/errors.cjs +1 -2
- package/dist/errors.d.cts +1 -2
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.ts +1 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -2
- package/dist/filter.cjs +1 -2
- package/dist/filter.d.cts +0 -2
- package/dist/filter.d.cts.map +1 -1
- package/dist/filter.d.ts +0 -2
- package/dist/filter.d.ts.map +1 -1
- package/dist/filter.js +1 -2
- package/dist/getGraphQLEndpoint.cjs +1 -2
- package/dist/getGraphQLEndpoint.d.cts +0 -2
- package/dist/getGraphQLEndpoint.d.cts.map +1 -1
- package/dist/getGraphQLEndpoint.d.ts +0 -2
- package/dist/getGraphQLEndpoint.d.ts.map +1 -1
- package/dist/getGraphQLEndpoint.js +1 -2
- package/dist/getRepositoryEndpoint.cjs +1 -2
- package/dist/getRepositoryEndpoint.d.cts +0 -2
- package/dist/getRepositoryEndpoint.d.cts.map +1 -1
- package/dist/getRepositoryEndpoint.d.ts +0 -2
- package/dist/getRepositoryEndpoint.d.ts.map +1 -1
- package/dist/getRepositoryEndpoint.js +1 -2
- package/dist/getRepositoryName.cjs +1 -2
- package/dist/getRepositoryName.d.cts +0 -2
- package/dist/getRepositoryName.d.cts.map +1 -1
- package/dist/getRepositoryName.d.ts +0 -2
- package/dist/getRepositoryName.d.ts.map +1 -1
- package/dist/getRepositoryName.js +1 -2
- package/dist/getToolbarSrc.cjs +9 -5
- package/dist/getToolbarSrc.cjs.map +1 -1
- package/dist/getToolbarSrc.d.cts +10 -3
- package/dist/getToolbarSrc.d.cts.map +1 -1
- package/dist/getToolbarSrc.d.ts +10 -3
- package/dist/getToolbarSrc.d.ts.map +1 -1
- package/dist/getToolbarSrc.js +9 -5
- package/dist/getToolbarSrc.js.map +1 -1
- package/dist/helpers/asDate.cjs +1 -2
- package/dist/helpers/asDate.d.cts +1 -2
- package/dist/helpers/asDate.d.cts.map +1 -1
- package/dist/helpers/asDate.d.ts +1 -2
- package/dist/helpers/asDate.d.ts.map +1 -1
- package/dist/helpers/asDate.js +1 -2
- package/dist/helpers/asHTML.cjs +2 -3
- package/dist/helpers/asHTML.d.cts +2 -3
- package/dist/helpers/asHTML.d.cts.map +1 -1
- package/dist/helpers/asHTML.d.ts +2 -3
- package/dist/helpers/asHTML.d.ts.map +1 -1
- package/dist/helpers/asHTML.js +2 -3
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +1 -2
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts +1 -2
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +1 -2
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.js +1 -2
- package/dist/helpers/asImageSrc.cjs +1 -2
- package/dist/helpers/asImageSrc.d.cts +1 -2
- package/dist/helpers/asImageSrc.d.cts.map +1 -1
- package/dist/helpers/asImageSrc.d.ts +1 -2
- package/dist/helpers/asImageSrc.d.ts.map +1 -1
- package/dist/helpers/asImageSrc.js +1 -2
- package/dist/helpers/asImageWidthSrcSet.cjs +1 -2
- package/dist/helpers/asImageWidthSrcSet.d.cts +1 -2
- package/dist/helpers/asImageWidthSrcSet.d.cts.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.ts +1 -2
- package/dist/helpers/asImageWidthSrcSet.d.ts.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.js +1 -2
- package/dist/helpers/asLink.cjs +1 -2
- package/dist/helpers/asLink.d.cts +3 -4
- package/dist/helpers/asLink.d.cts.map +1 -1
- package/dist/helpers/asLink.d.ts +3 -4
- package/dist/helpers/asLink.d.ts.map +1 -1
- package/dist/helpers/asLink.js +1 -2
- package/dist/helpers/asLinkAttrs.cjs +2 -3
- package/dist/helpers/asLinkAttrs.d.cts +3 -4
- package/dist/helpers/asLinkAttrs.d.cts.map +1 -1
- package/dist/helpers/asLinkAttrs.d.ts +3 -4
- package/dist/helpers/asLinkAttrs.d.ts.map +1 -1
- package/dist/helpers/asLinkAttrs.js +2 -3
- package/dist/helpers/asText.cjs +1 -2
- package/dist/helpers/asText.d.cts +1 -2
- package/dist/helpers/asText.d.cts.map +1 -1
- package/dist/helpers/asText.d.ts +1 -2
- package/dist/helpers/asText.d.ts.map +1 -1
- package/dist/helpers/asText.js +1 -2
- package/dist/helpers/documentToLinkField.cjs +1 -2
- package/dist/helpers/documentToLinkField.d.cts +1 -2
- package/dist/helpers/documentToLinkField.d.cts.map +1 -1
- package/dist/helpers/documentToLinkField.d.ts +1 -2
- package/dist/helpers/documentToLinkField.d.ts.map +1 -1
- package/dist/helpers/documentToLinkField.js +1 -2
- package/dist/helpers/isFilled.cjs +1 -2
- package/dist/helpers/isFilled.d.cts +7 -8
- package/dist/helpers/isFilled.d.ts +7 -8
- package/dist/helpers/isFilled.js +1 -2
- package/dist/helpers/mapSliceZone.cjs +1 -2
- package/dist/helpers/mapSliceZone.d.cts +1 -2
- package/dist/helpers/mapSliceZone.d.cts.map +1 -1
- package/dist/helpers/mapSliceZone.d.ts +1 -2
- package/dist/helpers/mapSliceZone.d.ts.map +1 -1
- package/dist/helpers/mapSliceZone.js +1 -2
- package/dist/index.cjs +17 -18
- package/dist/index.d.cts +62 -64
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +62 -64
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -18
- package/dist/isRepositoryEndpoint.cjs +1 -2
- package/dist/isRepositoryEndpoint.d.cts +0 -2
- package/dist/isRepositoryEndpoint.d.cts.map +1 -1
- package/dist/isRepositoryEndpoint.d.ts +0 -2
- package/dist/isRepositoryEndpoint.d.ts.map +1 -1
- package/dist/isRepositoryEndpoint.js +1 -2
- package/dist/isRepositoryName.cjs +1 -2
- package/dist/isRepositoryName.d.cts +0 -2
- package/dist/isRepositoryName.d.cts.map +1 -1
- package/dist/isRepositoryName.d.ts +0 -2
- package/dist/isRepositoryName.d.ts.map +1 -1
- package/dist/isRepositoryName.js +1 -2
- package/dist/lib/devMsg.cjs +1 -2
- package/dist/lib/devMsg.js +1 -2
- package/dist/lib/escapeHTML.cjs +1 -2
- package/dist/lib/escapeHTML.js +1 -2
- package/dist/lib/getOptionalLinkProperties.cjs +1 -2
- package/dist/lib/getOptionalLinkProperties.js +1 -2
- package/dist/lib/getPreviewCookie.cjs +1 -2
- package/dist/lib/getPreviewCookie.js +1 -2
- package/dist/lib/isInternalURL.cjs +1 -2
- package/dist/lib/isInternalURL.js +1 -2
- package/dist/lib/isMigrationValue.cjs +3 -4
- package/dist/lib/isMigrationValue.js +3 -4
- package/dist/lib/isValue.cjs +2 -3
- package/dist/lib/isValue.js +2 -3
- package/dist/lib/pLimit.cjs +1 -2
- package/dist/lib/pLimit.js +1 -2
- package/dist/lib/request.cjs +1 -2
- package/dist/lib/request.d.cts +0 -2
- package/dist/lib/request.d.cts.map +1 -1
- package/dist/lib/request.d.ts +0 -2
- package/dist/lib/request.d.ts.map +1 -1
- package/dist/lib/request.js +1 -2
- package/dist/lib/resolveMigrationDocumentData.cjs +3 -4
- package/dist/lib/resolveMigrationDocumentData.js +3 -4
- package/dist/lib/serializerHelpers.cjs +2 -3
- package/dist/lib/serializerHelpers.js +2 -3
- package/dist/lib/throttledWarn.cjs +1 -2
- package/dist/lib/throttledWarn.js +1 -2
- package/dist/lib/validateAssetMetadata.cjs +1 -2
- package/dist/lib/validateAssetMetadata.js +1 -2
- package/dist/package.cjs +2 -3
- package/dist/package.js +2 -3
- package/dist/richtext/asText.cjs +1 -2
- package/dist/richtext/asText.d.cts +0 -2
- package/dist/richtext/asText.d.cts.map +1 -1
- package/dist/richtext/asText.d.ts +0 -2
- package/dist/richtext/asText.d.ts.map +1 -1
- package/dist/richtext/asText.js +1 -2
- package/dist/richtext/asTree.cjs +1 -2
- package/dist/richtext/asTree.d.cts +0 -2
- package/dist/richtext/asTree.d.cts.map +1 -1
- package/dist/richtext/asTree.d.ts +0 -2
- package/dist/richtext/asTree.d.ts.map +1 -1
- package/dist/richtext/asTree.js +1 -2
- package/dist/richtext/composeSerializers.cjs +1 -2
- package/dist/richtext/composeSerializers.d.cts +0 -2
- package/dist/richtext/composeSerializers.d.cts.map +1 -1
- package/dist/richtext/composeSerializers.d.ts +0 -2
- package/dist/richtext/composeSerializers.d.ts.map +1 -1
- package/dist/richtext/composeSerializers.js +1 -2
- package/dist/richtext/serialize.cjs +1 -2
- package/dist/richtext/serialize.d.cts +0 -2
- package/dist/richtext/serialize.d.cts.map +1 -1
- package/dist/richtext/serialize.d.ts +0 -2
- package/dist/richtext/serialize.d.ts.map +1 -1
- package/dist/richtext/serialize.js +1 -2
- package/dist/richtext/types.cjs +1 -2
- package/dist/richtext/types.d.cts +0 -2
- package/dist/richtext/types.d.cts.map +1 -1
- package/dist/richtext/types.d.ts +0 -2
- package/dist/richtext/types.d.ts.map +1 -1
- package/dist/richtext/types.js +1 -2
- package/dist/richtext/wrapMapSerializer.cjs +1 -2
- package/dist/richtext/wrapMapSerializer.d.cts +0 -2
- package/dist/richtext/wrapMapSerializer.d.cts.map +1 -1
- package/dist/richtext/wrapMapSerializer.d.ts +0 -2
- package/dist/richtext/wrapMapSerializer.d.ts.map +1 -1
- package/dist/richtext/wrapMapSerializer.js +1 -2
- package/dist/richtext.cjs +2 -2
- package/dist/richtext.d.cts +2 -2
- package/dist/richtext.d.ts +2 -2
- package/dist/richtext.js +2 -2
- package/dist/types/api/asset/asset.d.cts +0 -2
- package/dist/types/api/asset/asset.d.cts.map +1 -1
- package/dist/types/api/asset/asset.d.ts +0 -2
- package/dist/types/api/asset/asset.d.ts.map +1 -1
- package/dist/types/api/asset/tag.d.cts +0 -2
- package/dist/types/api/asset/tag.d.cts.map +1 -1
- package/dist/types/api/asset/tag.d.ts +0 -2
- package/dist/types/api/asset/tag.d.ts.map +1 -1
- package/dist/types/api/integration.d.cts +0 -2
- package/dist/types/api/integration.d.cts.map +1 -1
- package/dist/types/api/integration.d.ts +0 -2
- package/dist/types/api/integration.d.ts.map +1 -1
- package/dist/types/api/migration/release.d.cts +0 -2
- package/dist/types/api/migration/release.d.cts.map +1 -1
- package/dist/types/api/migration/release.d.ts +0 -2
- package/dist/types/api/migration/release.d.ts.map +1 -1
- package/dist/types/api/query.d.cts +0 -2
- package/dist/types/api/query.d.cts.map +1 -1
- package/dist/types/api/query.d.ts +0 -2
- package/dist/types/api/query.d.ts.map +1 -1
- package/dist/types/api/ref.d.cts +0 -2
- package/dist/types/api/ref.d.cts.map +1 -1
- package/dist/types/api/ref.d.ts +0 -2
- package/dist/types/api/ref.d.ts.map +1 -1
- package/dist/types/api/release.d.cts +0 -2
- package/dist/types/api/release.d.cts.map +1 -1
- package/dist/types/api/release.d.ts +0 -2
- package/dist/types/api/release.d.ts.map +1 -1
- package/dist/types/api/repository.d.cts +0 -2
- package/dist/types/api/repository.d.cts.map +1 -1
- package/dist/types/api/repository.d.ts +0 -2
- package/dist/types/api/repository.d.ts.map +1 -1
- package/dist/types/api/tags.d.cts +0 -2
- package/dist/types/api/tags.d.cts.map +1 -1
- package/dist/types/api/tags.d.ts +0 -2
- package/dist/types/api/tags.d.ts.map +1 -1
- package/dist/types/migration/Asset.cjs +1 -2
- package/dist/types/migration/Asset.d.cts +1 -3
- package/dist/types/migration/Asset.d.cts.map +1 -1
- package/dist/types/migration/Asset.d.ts +1 -3
- package/dist/types/migration/Asset.d.ts.map +1 -1
- package/dist/types/migration/Asset.js +1 -2
- package/dist/types/migration/ContentRelationship.d.cts +1 -2
- package/dist/types/migration/ContentRelationship.d.cts.map +1 -1
- package/dist/types/migration/ContentRelationship.d.ts +1 -2
- package/dist/types/migration/ContentRelationship.d.ts.map +1 -1
- package/dist/types/migration/Document.cjs +1 -2
- package/dist/types/migration/Document.d.cts +5 -6
- package/dist/types/migration/Document.d.cts.map +1 -1
- package/dist/types/migration/Document.d.ts +5 -6
- package/dist/types/migration/Document.d.ts.map +1 -1
- package/dist/types/migration/Document.js +1 -2
- package/dist/types/model/boolean.d.cts +0 -2
- package/dist/types/model/boolean.d.cts.map +1 -1
- package/dist/types/model/boolean.d.ts +0 -2
- package/dist/types/model/boolean.d.ts.map +1 -1
- package/dist/types/model/color.d.cts +0 -2
- package/dist/types/model/color.d.cts.map +1 -1
- package/dist/types/model/color.d.ts +0 -2
- package/dist/types/model/color.d.ts.map +1 -1
- package/dist/types/model/contentRelationship.d.cts +0 -2
- package/dist/types/model/contentRelationship.d.cts.map +1 -1
- package/dist/types/model/contentRelationship.d.ts +0 -2
- package/dist/types/model/contentRelationship.d.ts.map +1 -1
- package/dist/types/model/customType.d.cts +0 -2
- package/dist/types/model/customType.d.cts.map +1 -1
- package/dist/types/model/customType.d.ts +0 -2
- package/dist/types/model/customType.d.ts.map +1 -1
- package/dist/types/model/date.d.cts +0 -2
- package/dist/types/model/date.d.cts.map +1 -1
- package/dist/types/model/date.d.ts +0 -2
- package/dist/types/model/date.d.ts.map +1 -1
- package/dist/types/model/embed.d.cts +0 -2
- package/dist/types/model/embed.d.cts.map +1 -1
- package/dist/types/model/embed.d.ts +0 -2
- package/dist/types/model/embed.d.ts.map +1 -1
- package/dist/types/model/geoPoint.d.cts +0 -2
- package/dist/types/model/geoPoint.d.cts.map +1 -1
- package/dist/types/model/geoPoint.d.ts +0 -2
- package/dist/types/model/geoPoint.d.ts.map +1 -1
- package/dist/types/model/group.d.cts +0 -2
- package/dist/types/model/group.d.cts.map +1 -1
- package/dist/types/model/group.d.ts +0 -2
- package/dist/types/model/group.d.ts.map +1 -1
- package/dist/types/model/image.d.cts +0 -2
- package/dist/types/model/image.d.cts.map +1 -1
- package/dist/types/model/image.d.ts +0 -2
- package/dist/types/model/image.d.ts.map +1 -1
- package/dist/types/model/integration.d.cts +0 -2
- package/dist/types/model/integration.d.cts.map +1 -1
- package/dist/types/model/integration.d.ts +0 -2
- package/dist/types/model/integration.d.ts.map +1 -1
- package/dist/types/model/keyText.d.cts +0 -2
- package/dist/types/model/keyText.d.cts.map +1 -1
- package/dist/types/model/keyText.d.ts +0 -2
- package/dist/types/model/keyText.d.ts.map +1 -1
- package/dist/types/model/link.cjs +1 -2
- package/dist/types/model/link.d.cts +0 -2
- package/dist/types/model/link.d.cts.map +1 -1
- package/dist/types/model/link.d.ts +0 -2
- package/dist/types/model/link.d.ts.map +1 -1
- package/dist/types/model/link.js +1 -2
- package/dist/types/model/linkToMedia.d.cts +0 -2
- package/dist/types/model/linkToMedia.d.cts.map +1 -1
- package/dist/types/model/linkToMedia.d.ts +0 -2
- package/dist/types/model/linkToMedia.d.ts.map +1 -1
- package/dist/types/model/number.d.cts +0 -2
- package/dist/types/model/number.d.cts.map +1 -1
- package/dist/types/model/number.d.ts +0 -2
- package/dist/types/model/number.d.ts.map +1 -1
- package/dist/types/model/range.d.cts +0 -2
- package/dist/types/model/range.d.cts.map +1 -1
- package/dist/types/model/range.d.ts +0 -2
- package/dist/types/model/range.d.ts.map +1 -1
- package/dist/types/model/richText.d.cts +0 -2
- package/dist/types/model/richText.d.cts.map +1 -1
- package/dist/types/model/richText.d.ts +0 -2
- package/dist/types/model/richText.d.ts.map +1 -1
- package/dist/types/model/select.d.cts +0 -2
- package/dist/types/model/select.d.cts.map +1 -1
- package/dist/types/model/select.d.ts +0 -2
- package/dist/types/model/select.d.ts.map +1 -1
- package/dist/types/model/separator.d.cts +0 -2
- package/dist/types/model/separator.d.cts.map +1 -1
- package/dist/types/model/separator.d.ts +0 -2
- package/dist/types/model/separator.d.ts.map +1 -1
- package/dist/types/model/sharedSlice.d.cts +1 -3
- package/dist/types/model/sharedSlice.d.cts.map +1 -1
- package/dist/types/model/sharedSlice.d.ts +1 -3
- package/dist/types/model/sharedSlice.d.ts.map +1 -1
- package/dist/types/model/sharedSliceVariation.d.cts +0 -2
- package/dist/types/model/sharedSliceVariation.d.cts.map +1 -1
- package/dist/types/model/sharedSliceVariation.d.ts +0 -2
- package/dist/types/model/sharedSliceVariation.d.ts.map +1 -1
- package/dist/types/model/slice.cjs +1 -2
- package/dist/types/model/slice.d.cts +0 -2
- package/dist/types/model/slice.d.cts.map +1 -1
- package/dist/types/model/slice.d.ts +0 -2
- package/dist/types/model/slice.d.ts.map +1 -1
- package/dist/types/model/slice.js +1 -2
- package/dist/types/model/sliceZone.cjs +1 -2
- package/dist/types/model/sliceZone.d.cts +0 -2
- package/dist/types/model/sliceZone.d.cts.map +1 -1
- package/dist/types/model/sliceZone.d.ts +0 -2
- package/dist/types/model/sliceZone.d.ts.map +1 -1
- package/dist/types/model/sliceZone.js +1 -2
- package/dist/types/model/table.d.cts +0 -2
- package/dist/types/model/table.d.cts.map +1 -1
- package/dist/types/model/table.d.ts +0 -2
- package/dist/types/model/table.d.ts.map +1 -1
- package/dist/types/model/timestamp.d.cts +0 -2
- package/dist/types/model/timestamp.d.cts.map +1 -1
- package/dist/types/model/timestamp.d.ts +0 -2
- package/dist/types/model/timestamp.d.ts.map +1 -1
- package/dist/types/model/title.d.cts +0 -2
- package/dist/types/model/title.d.cts.map +1 -1
- package/dist/types/model/title.d.ts +0 -2
- package/dist/types/model/title.d.ts.map +1 -1
- package/dist/types/model/types.cjs +1 -2
- package/dist/types/model/types.d.cts +2 -4
- package/dist/types/model/types.d.cts.map +1 -1
- package/dist/types/model/types.d.ts +2 -4
- package/dist/types/model/types.d.ts.map +1 -1
- package/dist/types/model/types.js +1 -2
- package/dist/types/model/uid.d.cts +0 -2
- package/dist/types/model/uid.d.cts.map +1 -1
- package/dist/types/model/uid.d.ts +0 -2
- package/dist/types/model/uid.d.ts.map +1 -1
- package/dist/types/value/boolean.d.cts +0 -2
- package/dist/types/value/boolean.d.cts.map +1 -1
- package/dist/types/value/boolean.d.ts +0 -2
- package/dist/types/value/boolean.d.ts.map +1 -1
- package/dist/types/value/color.d.cts +0 -2
- package/dist/types/value/color.d.cts.map +1 -1
- package/dist/types/value/color.d.ts +0 -2
- package/dist/types/value/color.d.ts.map +1 -1
- package/dist/types/value/contentRelationship.d.cts +0 -2
- package/dist/types/value/contentRelationship.d.cts.map +1 -1
- package/dist/types/value/contentRelationship.d.ts +0 -2
- package/dist/types/value/contentRelationship.d.ts.map +1 -1
- package/dist/types/value/date.d.cts +0 -2
- package/dist/types/value/date.d.cts.map +1 -1
- package/dist/types/value/date.d.ts +0 -2
- package/dist/types/value/date.d.ts.map +1 -1
- package/dist/types/value/document.d.cts +0 -2
- package/dist/types/value/document.d.cts.map +1 -1
- package/dist/types/value/document.d.ts +0 -2
- package/dist/types/value/document.d.ts.map +1 -1
- package/dist/types/value/embed.cjs +1 -2
- package/dist/types/value/embed.d.cts +1 -2
- package/dist/types/value/embed.d.cts.map +1 -1
- package/dist/types/value/embed.d.ts +1 -2
- package/dist/types/value/embed.d.ts.map +1 -1
- package/dist/types/value/embed.js +1 -2
- package/dist/types/value/geoPoint.d.cts +0 -2
- package/dist/types/value/geoPoint.d.cts.map +1 -1
- package/dist/types/value/geoPoint.d.ts +0 -2
- package/dist/types/value/geoPoint.d.ts.map +1 -1
- package/dist/types/value/group.d.cts +0 -2
- package/dist/types/value/group.d.cts.map +1 -1
- package/dist/types/value/group.d.ts +0 -2
- package/dist/types/value/group.d.ts.map +1 -1
- package/dist/types/value/image.d.cts +0 -2
- package/dist/types/value/image.d.cts.map +1 -1
- package/dist/types/value/image.d.ts +0 -2
- package/dist/types/value/image.d.ts.map +1 -1
- package/dist/types/value/integration.d.cts +0 -2
- package/dist/types/value/integration.d.cts.map +1 -1
- package/dist/types/value/integration.d.ts +0 -2
- package/dist/types/value/integration.d.ts.map +1 -1
- package/dist/types/value/keyText.d.cts +0 -2
- package/dist/types/value/keyText.d.cts.map +1 -1
- package/dist/types/value/keyText.d.ts +0 -2
- package/dist/types/value/keyText.d.ts.map +1 -1
- package/dist/types/value/link.cjs +1 -2
- package/dist/types/value/link.d.cts +2 -4
- package/dist/types/value/link.d.cts.map +1 -1
- package/dist/types/value/link.d.ts +2 -4
- package/dist/types/value/link.d.ts.map +1 -1
- package/dist/types/value/link.js +1 -2
- package/dist/types/value/linkToMedia.d.cts +1 -2
- package/dist/types/value/linkToMedia.d.cts.map +1 -1
- package/dist/types/value/linkToMedia.d.ts +1 -2
- package/dist/types/value/linkToMedia.d.ts.map +1 -1
- package/dist/types/value/number.d.cts +0 -2
- package/dist/types/value/number.d.cts.map +1 -1
- package/dist/types/value/number.d.ts +0 -2
- package/dist/types/value/number.d.ts.map +1 -1
- package/dist/types/value/richText.cjs +1 -2
- package/dist/types/value/richText.d.cts +1 -3
- package/dist/types/value/richText.d.cts.map +1 -1
- package/dist/types/value/richText.d.ts +1 -3
- package/dist/types/value/richText.d.ts.map +1 -1
- package/dist/types/value/richText.js +1 -2
- package/dist/types/value/select.d.cts +0 -2
- package/dist/types/value/select.d.cts.map +1 -1
- package/dist/types/value/select.d.ts +0 -2
- package/dist/types/value/select.d.ts.map +1 -1
- package/dist/types/value/sharedSlice.d.cts +0 -2
- package/dist/types/value/sharedSlice.d.cts.map +1 -1
- package/dist/types/value/sharedSlice.d.ts +0 -2
- package/dist/types/value/sharedSlice.d.ts.map +1 -1
- package/dist/types/value/sharedSliceVariation.d.cts +0 -2
- package/dist/types/value/sharedSliceVariation.d.cts.map +1 -1
- package/dist/types/value/sharedSliceVariation.d.ts +0 -2
- package/dist/types/value/sharedSliceVariation.d.ts.map +1 -1
- package/dist/types/value/slice.d.cts +0 -2
- package/dist/types/value/slice.d.cts.map +1 -1
- package/dist/types/value/slice.d.ts +0 -2
- package/dist/types/value/slice.d.ts.map +1 -1
- package/dist/types/value/sliceZone.d.cts +0 -2
- package/dist/types/value/sliceZone.d.cts.map +1 -1
- package/dist/types/value/sliceZone.d.ts +0 -2
- package/dist/types/value/sliceZone.d.ts.map +1 -1
- package/dist/types/value/table.d.cts +1 -3
- package/dist/types/value/table.d.cts.map +1 -1
- package/dist/types/value/table.d.ts +1 -3
- package/dist/types/value/table.d.ts.map +1 -1
- package/dist/types/value/timestamp.d.cts +0 -2
- package/dist/types/value/timestamp.d.cts.map +1 -1
- package/dist/types/value/timestamp.d.ts +0 -2
- package/dist/types/value/timestamp.d.ts.map +1 -1
- package/dist/types/value/title.d.cts +1 -3
- package/dist/types/value/title.d.cts.map +1 -1
- package/dist/types/value/title.d.ts +1 -3
- package/dist/types/value/title.d.ts.map +1 -1
- package/dist/types/value/types.d.cts +5 -6
- package/dist/types/value/types.d.cts.map +1 -1
- package/dist/types/value/types.d.ts +5 -6
- package/dist/types/value/types.d.ts.map +1 -1
- package/dist/types/webhook/apiUpdate.d.cts +1 -2
- package/dist/types/webhook/apiUpdate.d.cts.map +1 -1
- package/dist/types/webhook/apiUpdate.d.ts +1 -2
- package/dist/types/webhook/apiUpdate.d.ts.map +1 -1
- package/dist/types/webhook/testTrigger.d.cts +0 -2
- package/dist/types/webhook/testTrigger.d.cts.map +1 -1
- package/dist/types/webhook/testTrigger.d.ts +0 -2
- package/dist/types/webhook/testTrigger.d.ts.map +1 -1
- package/dist/types/webhook/types.cjs +1 -2
- package/dist/types/webhook/types.d.cts +0 -2
- package/dist/types/webhook/types.d.cts.map +1 -1
- package/dist/types/webhook/types.d.ts +0 -2
- package/dist/types/webhook/types.d.ts.map +1 -1
- package/dist/types/webhook/types.js +1 -2
- package/package.json +7 -7
- package/src/cookie.ts +3 -0
- package/src/getToolbarSrc.ts +18 -4
package/dist/createMigration.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_Migration = require("./Migration.cjs");
|
|
2
|
-
|
|
2
|
+
// src/createMigration.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates a Prismic migration instance that can be used to prepare your migration to Prismic.
|
|
5
5
|
*
|
|
@@ -12,7 +12,6 @@ const require_Migration = require("./Migration.cjs");
|
|
|
12
12
|
* @returns A migration instance to prepare your migration.
|
|
13
13
|
*/
|
|
14
14
|
const createMigration = () => new require_Migration.Migration();
|
|
15
|
-
//#endregion
|
|
16
15
|
exports.createMigration = createMigration;
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=createMigration.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { PrismicDocument } from "./types/value/document.cjs";
|
|
2
1
|
import { Migration } from "./Migration.cjs";
|
|
3
|
-
|
|
2
|
+
import { PrismicDocument } from "./types/value/document.cjs";
|
|
4
3
|
/** Type definitions for the `createMigration()` function. May be augmented by third-party libraries. */
|
|
5
4
|
export interface CreateMigration {
|
|
6
5
|
<TDocuments extends PrismicDocument>(...args: ConstructorParameters<typeof Migration>): Migration<TDocuments>;
|
|
@@ -17,5 +16,4 @@ export interface CreateMigration {
|
|
|
17
16
|
* @returns A migration instance to prepare your migration.
|
|
18
17
|
*/
|
|
19
18
|
export declare const createMigration: CreateMigration;
|
|
20
|
-
//#endregion
|
|
21
19
|
//# sourceMappingURL=createMigration.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMigration.d.cts","names":[],"sources":["../src/createMigration.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createMigration.d.cts","names":[],"sources":["../src/createMigration.ts"],"mappings":";;;iBAIiB;GACf,mBAAmB,oBAChB,MAAM,6BAA6B,aACpC,UAAU;;;;;;;;;;;;;qBAcD,iBAAiB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { PrismicDocument } from "./types/value/document.js";
|
|
2
1
|
import { Migration } from "./Migration.js";
|
|
3
|
-
|
|
2
|
+
import { PrismicDocument } from "./types/value/document.js";
|
|
4
3
|
/** Type definitions for the `createMigration()` function. May be augmented by third-party libraries. */
|
|
5
4
|
export interface CreateMigration {
|
|
6
5
|
<TDocuments extends PrismicDocument>(...args: ConstructorParameters<typeof Migration>): Migration<TDocuments>;
|
|
@@ -17,5 +16,4 @@ export interface CreateMigration {
|
|
|
17
16
|
* @returns A migration instance to prepare your migration.
|
|
18
17
|
*/
|
|
19
18
|
export declare const createMigration: CreateMigration;
|
|
20
|
-
//#endregion
|
|
21
19
|
//# sourceMappingURL=createMigration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMigration.d.ts","names":[],"sources":["../src/createMigration.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createMigration.d.ts","names":[],"sources":["../src/createMigration.ts"],"mappings":";;;iBAIiB;GACf,mBAAmB,oBAChB,MAAM,6BAA6B,aACpC,UAAU;;;;;;;;;;;;;qBAcD,iBAAiB"}
|
package/dist/createMigration.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Migration } from "./Migration.js";
|
|
2
|
-
|
|
2
|
+
// src/createMigration.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates a Prismic migration instance that can be used to prepare your migration to Prismic.
|
|
5
5
|
*
|
|
@@ -12,7 +12,6 @@ import { Migration } from "./Migration.js";
|
|
|
12
12
|
* @returns A migration instance to prepare your migration.
|
|
13
13
|
*/
|
|
14
14
|
const createMigration = () => new Migration();
|
|
15
|
-
//#endregion
|
|
16
15
|
export { createMigration };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=createMigration.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_WriteClient = require("./WriteClient.cjs");
|
|
2
|
-
|
|
2
|
+
// src/createWriteClient.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates a Prismic client that can be used to query and write content to a repository.
|
|
5
5
|
*
|
|
@@ -18,7 +18,6 @@ const require_WriteClient = require("./WriteClient.cjs");
|
|
|
18
18
|
* @returns A client that can query and write content to the repository.
|
|
19
19
|
*/
|
|
20
20
|
const createWriteClient = (repositoryName, options) => new require_WriteClient.WriteClient(repositoryName, options);
|
|
21
|
-
//#endregion
|
|
22
21
|
exports.createWriteClient = createWriteClient;
|
|
23
22
|
|
|
24
23
|
//# sourceMappingURL=createWriteClient.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PrismicDocument } from "./types/value/document.cjs";
|
|
2
2
|
import { WriteClient } from "./WriteClient.cjs";
|
|
3
|
-
//#region src/createWriteClient.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Type definitions for the `createWriteClient()` function. May be augmented by third-party
|
|
6
5
|
* libraries.
|
|
@@ -26,5 +25,4 @@ export interface CreateWriteClient {
|
|
|
26
25
|
* @returns A client that can query and write content to the repository.
|
|
27
26
|
*/
|
|
28
27
|
export declare const createWriteClient: CreateWriteClient;
|
|
29
|
-
//#endregion
|
|
30
28
|
//# sourceMappingURL=createWriteClient.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createWriteClient.d.cts","names":[],"sources":["../src/createWriteClient.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createWriteClient.d.cts","names":[],"sources":["../src/createWriteClient.ts"],"mappings":";;;;;;iBAQiB;GACf,mBAAmB,oBAChB,MAAM,6BAA6B,eACpC,YAAY;;;;;;;;;;;;;;;;;;;qBAoBH,mBAAmB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PrismicDocument } from "./types/value/document.js";
|
|
2
2
|
import { WriteClient } from "./WriteClient.js";
|
|
3
|
-
//#region src/createWriteClient.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Type definitions for the `createWriteClient()` function. May be augmented by third-party
|
|
6
5
|
* libraries.
|
|
@@ -26,5 +25,4 @@ export interface CreateWriteClient {
|
|
|
26
25
|
* @returns A client that can query and write content to the repository.
|
|
27
26
|
*/
|
|
28
27
|
export declare const createWriteClient: CreateWriteClient;
|
|
29
|
-
//#endregion
|
|
30
28
|
//# sourceMappingURL=createWriteClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createWriteClient.d.ts","names":[],"sources":["../src/createWriteClient.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createWriteClient.d.ts","names":[],"sources":["../src/createWriteClient.ts"],"mappings":";;;;;;iBAQiB;GACf,mBAAmB,oBAChB,MAAM,6BAA6B,eACpC,YAAY;;;;;;;;;;;;;;;;;;;qBAoBH,mBAAmB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WriteClient } from "./WriteClient.js";
|
|
2
|
-
|
|
2
|
+
// src/createWriteClient.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates a Prismic client that can be used to query and write content to a repository.
|
|
5
5
|
*
|
|
@@ -18,7 +18,6 @@ import { WriteClient } from "./WriteClient.js";
|
|
|
18
18
|
* @returns A client that can query and write content to the repository.
|
|
19
19
|
*/
|
|
20
20
|
const createWriteClient = (repositoryName, options) => new WriteClient(repositoryName, options);
|
|
21
|
-
//#endregion
|
|
22
21
|
export { createWriteClient };
|
|
23
22
|
|
|
24
23
|
//# sourceMappingURL=createWriteClient.js.map
|
package/dist/errors.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors.ts
|
|
2
2
|
var PrismicError = class extends Error {
|
|
3
3
|
url;
|
|
4
4
|
response;
|
|
@@ -16,7 +16,6 @@ var InvalidDataError = class extends PrismicError {};
|
|
|
16
16
|
var RefExpiredError = class extends ForbiddenError {};
|
|
17
17
|
var RefNotFoundError = class extends ForbiddenError {};
|
|
18
18
|
var PreviewTokenExpiredError = class extends ForbiddenError {};
|
|
19
|
-
//#endregion
|
|
20
19
|
exports.ForbiddenError = ForbiddenError;
|
|
21
20
|
exports.InvalidDataError = InvalidDataError;
|
|
22
21
|
exports.NotFoundError = NotFoundError;
|
package/dist/errors.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/errors.d.ts
|
|
2
1
|
export declare class PrismicError<Response> extends Error {
|
|
3
2
|
url?: string;
|
|
4
3
|
response: Response;
|
|
@@ -41,5 +40,5 @@ type PreviewTokenExpiredErrorAPIResponse = {
|
|
|
41
40
|
message: string;
|
|
42
41
|
};
|
|
43
42
|
export declare class PreviewTokenExpiredError<TResponse = PreviewTokenExpiredErrorAPIResponse> extends ForbiddenError<TResponse> {}
|
|
44
|
-
|
|
43
|
+
export {};
|
|
45
44
|
//# sourceMappingURL=errors.d.cts.map
|
package/dist/errors.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"mappings":"A,qBAAa,aAAa,kBAAkB;EAC3C;EACA,UAAU;EAEV,YACC,6BACA,yBACA,UAAU;;KASP;EACJ;EACA;;KAGI;EACJ;;qBAGY,eACZ,YAAY,sCAAsC,wCACzC,aAAa;qBAEV,cAAc,+BAA+B,aAAa;qBAE1D,wBAAwB,+BAA+B,cAAc;KAE7E;EACJ;EACA;EACA;IACC;IACA;IACA;IACA;;;qBAIW,aAAa,YAAY,iCAAiC,aAAa;qBAEvE,iBAAiB,+BAA+B,aAAa;KAErE;EACJ;EACA;;qBAOY,gBACZ,YAAY,oCACH,eAAe;KAEpB;EACJ;EACA;;qBAOY,iBACZ,YAAY,qCACH,eAAe;KAEpB;EACJ;EACA;;qBAKY,yBACZ,YAAY,6CACH,eAAe"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/errors.d.ts
|
|
2
1
|
export declare class PrismicError<Response> extends Error {
|
|
3
2
|
url?: string;
|
|
4
3
|
response: Response;
|
|
@@ -41,5 +40,5 @@ type PreviewTokenExpiredErrorAPIResponse = {
|
|
|
41
40
|
message: string;
|
|
42
41
|
};
|
|
43
42
|
export declare class PreviewTokenExpiredError<TResponse = PreviewTokenExpiredErrorAPIResponse> extends ForbiddenError<TResponse> {}
|
|
44
|
-
|
|
43
|
+
export {};
|
|
45
44
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","names":[],"sources":["../src/errors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","names":[],"sources":["../src/errors.ts"],"mappings":"A,qBAAa,aAAa,kBAAkB;EAC3C;EACA,UAAU;EAEV,YACC,6BACA,yBACA,UAAU;;KASP;EACJ;EACA;;KAGI;EACJ;;qBAGY,eACZ,YAAY,sCAAsC,wCACzC,aAAa;qBAEV,cAAc,+BAA+B,aAAa;qBAE1D,wBAAwB,+BAA+B,cAAc;KAE7E;EACJ;EACA;EACA;IACC;IACA;IACA;IACA;;;qBAIW,aAAa,YAAY,iCAAiC,aAAa;qBAEvE,iBAAiB,+BAA+B,aAAa;KAErE;EACJ;EACA;;qBAOY,gBACZ,YAAY,oCACH,eAAe;KAEpB;EACJ;EACA;;qBAOY,iBACZ,YAAY,qCACH,eAAe;KAEpB;EACJ;EACA;;qBAKY,yBACZ,YAAY,6CACH,eAAe"}
|
package/dist/errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors.ts
|
|
2
2
|
var PrismicError = class extends Error {
|
|
3
3
|
url;
|
|
4
4
|
response;
|
|
@@ -16,7 +16,6 @@ var InvalidDataError = class extends PrismicError {};
|
|
|
16
16
|
var RefExpiredError = class extends ForbiddenError {};
|
|
17
17
|
var RefNotFoundError = class extends ForbiddenError {};
|
|
18
18
|
var PreviewTokenExpiredError = class extends ForbiddenError {};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { ForbiddenError, InvalidDataError, NotFoundError, ParsingError, PreviewTokenExpiredError, PrismicError, RefExpiredError, RefNotFoundError, RepositoryNotFoundError };
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=errors.js.map
|
package/dist/filter.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/filter.ts
|
|
2
2
|
/**
|
|
3
3
|
* Formats the value of a filter element to a stringified version accepted by the Prismic REST API.
|
|
4
4
|
*
|
|
@@ -259,7 +259,6 @@ const filter = {
|
|
|
259
259
|
*/
|
|
260
260
|
dateHourBefore: pathWithArgsFilter("date.hour-before")
|
|
261
261
|
};
|
|
262
|
-
//#endregion
|
|
263
262
|
exports.filter = filter;
|
|
264
263
|
|
|
265
264
|
//# sourceMappingURL=filter.cjs.map
|
package/dist/filter.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/filter.d.ts
|
|
2
1
|
export declare const filter: {
|
|
3
2
|
/**
|
|
4
3
|
* The `at` filter checks that the path matches the described value exactly. It takes a single
|
|
@@ -204,5 +203,4 @@ export declare const filter: {
|
|
|
204
203
|
*/
|
|
205
204
|
dateHourBefore: (path: string, hour: number) => string;
|
|
206
205
|
};
|
|
207
|
-
//#endregion
|
|
208
206
|
//# sourceMappingURL=filter.d.cts.map
|
package/dist/filter.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.cts","names":[],"sources":["../src/filter.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter.d.cts","names":[],"sources":["../src/filter.ts"],"mappings":"A,qBA6Ea;;;;;;;EAOZ,KAAE,cAnDsB,8CAAA;;;;;;;EA2DxB,MAAG,cA3DqB,8CAAA;;;;;;;EAmExB,MAAG,cAnEqB,qCAAA;;;;;;;EA2ExB,KAAE,cA3EsB;;;;;;;;;;;EAuFxB,WAAQ,cAvFgB;;;;;;;EA+FxB,MAAG;;;;;;;EAQH,UAAO;;;;;;;;EASP,UAAO,YAAA;;;;;;;;;EAUP,eAAY,cA1HY,kBAAA,mBAAA;;;;;;;EAmIxB,iBAAc,cAnIU;;;;;;;EA2IxB,oBAAiB,cA3IO;;;;;;;EAmJxB,gBAAa,cAnJW,oBAAA;;;;;;;EA2JxB,YAAS,cA3Je,wBAAA;;;;;;;EAmKxB,aAAU,cAnKc,wBAAA;;;;;;;EA2KxB,cAAW,cA3Ka,6BAAA,MAAA,2BAAA;;;;;;;EAsLxB,iBAAc,cAtLU;;;;;;;EA8LxB,sBAAmB,cA9LK;;;;;;;EAsMxB,uBAAoB,cAtMI;;;;;;;EA8MxB,gBAAa,cA9MW;;;;;;;EAsNxB,qBAAkB,cAtNM;;;;;;;EA8NxB,sBAAmB,cA9NK;;;;;;;EAsOxB,YAAS,cAtOe;;;;;;;EA8OxB,iBAAc,cA9OU;;;;;;;EAsPxB,kBAAe,cAtPS;;;;;;;EA8PxB,WAAQ,cA9PgB;;;;;;;EAsQxB,WAAQ,cAtQgB;;;;;;;EA8QxB,gBAAa,cA9QW;;;;;;;EAsRxB,iBAAc,cAtRU"}
|
package/dist/filter.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/filter.d.ts
|
|
2
1
|
export declare const filter: {
|
|
3
2
|
/**
|
|
4
3
|
* The `at` filter checks that the path matches the described value exactly. It takes a single
|
|
@@ -204,5 +203,4 @@ export declare const filter: {
|
|
|
204
203
|
*/
|
|
205
204
|
dateHourBefore: (path: string, hour: number) => string;
|
|
206
205
|
};
|
|
207
|
-
//#endregion
|
|
208
206
|
//# sourceMappingURL=filter.d.ts.map
|
package/dist/filter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","names":[],"sources":["../src/filter.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter.d.ts","names":[],"sources":["../src/filter.ts"],"mappings":"A,qBA6Ea;;;;;;;EAOZ,KAAE,cAnDsB,8CAAA;;;;;;;EA2DxB,MAAG,cA3DqB,8CAAA;;;;;;;EAmExB,MAAG,cAnEqB,qCAAA;;;;;;;EA2ExB,KAAE,cA3EsB;;;;;;;;;;;EAuFxB,WAAQ,cAvFgB;;;;;;;EA+FxB,MAAG;;;;;;;EAQH,UAAO;;;;;;;;EASP,UAAO,YAAA;;;;;;;;;EAUP,eAAY,cA1HY,kBAAA,mBAAA;;;;;;;EAmIxB,iBAAc,cAnIU;;;;;;;EA2IxB,oBAAiB,cA3IO;;;;;;;EAmJxB,gBAAa,cAnJW,oBAAA;;;;;;;EA2JxB,YAAS,cA3Je,wBAAA;;;;;;;EAmKxB,aAAU,cAnKc,wBAAA;;;;;;;EA2KxB,cAAW,cA3Ka,6BAAA,MAAA,2BAAA;;;;;;;EAsLxB,iBAAc,cAtLU;;;;;;;EA8LxB,sBAAmB,cA9LK;;;;;;;EAsMxB,uBAAoB,cAtMI;;;;;;;EA8MxB,gBAAa,cA9MW;;;;;;;EAsNxB,qBAAkB,cAtNM;;;;;;;EA8NxB,sBAAmB,cA9NK;;;;;;;EAsOxB,YAAS,cAtOe;;;;;;;EA8OxB,iBAAc,cA9OU;;;;;;;EAsPxB,kBAAe,cAtPS;;;;;;;EA8PxB,WAAQ,cA9PgB;;;;;;;EAsQxB,WAAQ,cAtQgB;;;;;;;EA8QxB,gBAAa,cA9QW;;;;;;;EAsRxB,iBAAc,cAtRU"}
|
package/dist/filter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/filter.ts
|
|
2
2
|
/**
|
|
3
3
|
* Formats the value of a filter element to a stringified version accepted by the Prismic REST API.
|
|
4
4
|
*
|
|
@@ -259,7 +259,6 @@ const filter = {
|
|
|
259
259
|
*/
|
|
260
260
|
dateHourBefore: pathWithArgsFilter("date.hour-before")
|
|
261
261
|
};
|
|
262
|
-
//#endregion
|
|
263
262
|
export { filter };
|
|
264
263
|
|
|
265
264
|
//# sourceMappingURL=filter.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_errors = require("./errors.cjs");
|
|
2
2
|
const require_isRepositoryName = require("./isRepositoryName.cjs");
|
|
3
|
-
|
|
3
|
+
// src/getGraphQLEndpoint.ts
|
|
4
4
|
/**
|
|
5
5
|
* Get a repository's Prismic GraphQL endpoint.
|
|
6
6
|
*
|
|
@@ -12,7 +12,6 @@ const getGraphQLEndpoint = (repositoryName) => {
|
|
|
12
12
|
if (require_isRepositoryName.isRepositoryName(repositoryName)) return `https://${repositoryName}.cdn.prismic.io/graphql`;
|
|
13
13
|
else throw new require_errors.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
exports.getGraphQLEndpoint = getGraphQLEndpoint;
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=getGraphQLEndpoint.cjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/getGraphQLEndpoint.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Get a repository's Prismic GraphQL endpoint.
|
|
4
3
|
*
|
|
@@ -7,5 +6,4 @@
|
|
|
7
6
|
* @returns The repository's Prismic REST API V2 endpoint
|
|
8
7
|
*/
|
|
9
8
|
export declare const getGraphQLEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/graphql`;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=getGraphQLEndpoint.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGraphQLEndpoint.d.cts","names":[],"sources":["../src/getGraphQLEndpoint.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getGraphQLEndpoint.d.cts","names":[],"sources":["../src/getGraphQLEndpoint.ts"],"mappings":";;;;;;;qBAUa,qBAAsB,+BAA6B,gBAC/C,8BACH"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/getGraphQLEndpoint.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Get a repository's Prismic GraphQL endpoint.
|
|
4
3
|
*
|
|
@@ -7,5 +6,4 @@
|
|
|
7
6
|
* @returns The repository's Prismic REST API V2 endpoint
|
|
8
7
|
*/
|
|
9
8
|
export declare const getGraphQLEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/graphql`;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=getGraphQLEndpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGraphQLEndpoint.d.ts","names":[],"sources":["../src/getGraphQLEndpoint.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getGraphQLEndpoint.d.ts","names":[],"sources":["../src/getGraphQLEndpoint.ts"],"mappings":";;;;;;;qBAUa,qBAAsB,+BAA6B,gBAC/C,8BACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PrismicError } from "./errors.js";
|
|
2
2
|
import { isRepositoryName } from "./isRepositoryName.js";
|
|
3
|
-
|
|
3
|
+
// src/getGraphQLEndpoint.ts
|
|
4
4
|
/**
|
|
5
5
|
* Get a repository's Prismic GraphQL endpoint.
|
|
6
6
|
*
|
|
@@ -12,7 +12,6 @@ const getGraphQLEndpoint = (repositoryName) => {
|
|
|
12
12
|
if (isRepositoryName(repositoryName)) return `https://${repositoryName}.cdn.prismic.io/graphql`;
|
|
13
13
|
else throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { getGraphQLEndpoint };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=getGraphQLEndpoint.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_errors = require("./errors.cjs");
|
|
2
2
|
const require_isRepositoryName = require("./isRepositoryName.cjs");
|
|
3
|
-
|
|
3
|
+
// src/getRepositoryEndpoint.ts
|
|
4
4
|
/**
|
|
5
5
|
* Get a repository's Prismic Content API endpoint.
|
|
6
6
|
*
|
|
@@ -19,7 +19,6 @@ const getRepositoryEndpoint = (repositoryName) => {
|
|
|
19
19
|
if (require_isRepositoryName.isRepositoryName(repositoryName)) return `https://${repositoryName}.cdn.prismic.io/api/v2`;
|
|
20
20
|
else throw new require_errors.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
exports.getRepositoryEndpoint = getRepositoryEndpoint;
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=getRepositoryEndpoint.cjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/getRepositoryEndpoint.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Get a repository's Prismic Content API endpoint.
|
|
4
3
|
*
|
|
@@ -14,5 +13,4 @@
|
|
|
14
13
|
* @throws {@link Error} Thrown if an invalid repository name is provided.
|
|
15
14
|
*/
|
|
16
15
|
export declare const getRepositoryEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/api/v2`;
|
|
17
|
-
//#endregion
|
|
18
16
|
//# sourceMappingURL=getRepositoryEndpoint.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepositoryEndpoint.d.cts","names":[],"sources":["../src/getRepositoryEndpoint.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getRepositoryEndpoint.d.cts","names":[],"sources":["../src/getRepositoryEndpoint.ts"],"mappings":";;;;;;;;;;;;;;qBAiBa,wBAAyB,+BAA6B,gBAClD,8BACH"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/getRepositoryEndpoint.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Get a repository's Prismic Content API endpoint.
|
|
4
3
|
*
|
|
@@ -14,5 +13,4 @@
|
|
|
14
13
|
* @throws {@link Error} Thrown if an invalid repository name is provided.
|
|
15
14
|
*/
|
|
16
15
|
export declare const getRepositoryEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/api/v2`;
|
|
17
|
-
//#endregion
|
|
18
16
|
//# sourceMappingURL=getRepositoryEndpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepositoryEndpoint.d.ts","names":[],"sources":["../src/getRepositoryEndpoint.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getRepositoryEndpoint.d.ts","names":[],"sources":["../src/getRepositoryEndpoint.ts"],"mappings":";;;;;;;;;;;;;;qBAiBa,wBAAyB,+BAA6B,gBAClD,8BACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PrismicError } from "./errors.js";
|
|
2
2
|
import { isRepositoryName } from "./isRepositoryName.js";
|
|
3
|
-
|
|
3
|
+
// src/getRepositoryEndpoint.ts
|
|
4
4
|
/**
|
|
5
5
|
* Get a repository's Prismic Content API endpoint.
|
|
6
6
|
*
|
|
@@ -19,7 +19,6 @@ const getRepositoryEndpoint = (repositoryName) => {
|
|
|
19
19
|
if (isRepositoryName(repositoryName)) return `https://${repositoryName}.cdn.prismic.io/api/v2`;
|
|
20
20
|
else throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { getRepositoryEndpoint };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=getRepositoryEndpoint.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_errors = require("./errors.cjs");
|
|
2
|
-
|
|
2
|
+
// src/getRepositoryName.ts
|
|
3
3
|
/**
|
|
4
4
|
* Get a Prismic repository's name from its standard Prismic Document API or GraphQL endpoint.
|
|
5
5
|
*
|
|
@@ -15,7 +15,6 @@ const getRepositoryName = (repositoryEndpoint) => {
|
|
|
15
15
|
} catch {}
|
|
16
16
|
throw new require_errors.PrismicError(`An invalid Prismic Document API endpoint was provided: ${repositoryEndpoint}`, void 0, void 0);
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
exports.getRepositoryName = getRepositoryName;
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=getRepositoryName.cjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/getRepositoryName.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Get a Prismic repository's name from its standard Prismic Document API or GraphQL endpoint.
|
|
4
3
|
*
|
|
@@ -8,5 +7,4 @@
|
|
|
8
7
|
* provided.
|
|
9
8
|
*/
|
|
10
9
|
export declare const getRepositoryName: (repositoryEndpoint: string) => string;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=getRepositoryName.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepositoryName.d.cts","names":[],"sources":["../src/getRepositoryName.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getRepositoryName.d.cts","names":[],"sources":["../src/getRepositoryName.ts"],"mappings":";;;;;;;;qBAUa,oBAAiB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/getRepositoryName.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Get a Prismic repository's name from its standard Prismic Document API or GraphQL endpoint.
|
|
4
3
|
*
|
|
@@ -8,5 +7,4 @@
|
|
|
8
7
|
* provided.
|
|
9
8
|
*/
|
|
10
9
|
export declare const getRepositoryName: (repositoryEndpoint: string) => string;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=getRepositoryName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepositoryName.d.ts","names":[],"sources":["../src/getRepositoryName.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getRepositoryName.d.ts","names":[],"sources":["../src/getRepositoryName.ts"],"mappings":";;;;;;;;qBAUa,oBAAiB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PrismicError } from "./errors.js";
|
|
2
|
-
|
|
2
|
+
// src/getRepositoryName.ts
|
|
3
3
|
/**
|
|
4
4
|
* Get a Prismic repository's name from its standard Prismic Document API or GraphQL endpoint.
|
|
5
5
|
*
|
|
@@ -15,7 +15,6 @@ const getRepositoryName = (repositoryEndpoint) => {
|
|
|
15
15
|
} catch {}
|
|
16
16
|
throw new PrismicError(`An invalid Prismic Document API endpoint was provided: ${repositoryEndpoint}`, void 0, void 0);
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { getRepositoryName };
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=getRepositoryName.js.map
|
package/dist/getToolbarSrc.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_errors = require("./errors.cjs");
|
|
2
2
|
const require_isRepositoryName = require("./isRepositoryName.cjs");
|
|
3
|
-
|
|
3
|
+
// src/getToolbarSrc.ts
|
|
4
4
|
/**
|
|
5
5
|
* Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the
|
|
6
6
|
* script into your app.
|
|
@@ -30,13 +30,17 @@ const require_isRepositoryName = require("./isRepositoryName.cjs");
|
|
|
30
30
|
*
|
|
31
31
|
* @param repositoryName - The name of the Prismic repository. For example, `"my-repo"` if the
|
|
32
32
|
* repository URL is `my-repo.prismic.io`.
|
|
33
|
+
* @param config - Options that configure the toolbar URL.
|
|
33
34
|
* @returns The URL for the given Prismic repository's Prismic Toolbar script.
|
|
34
35
|
*/
|
|
35
|
-
const getToolbarSrc = (repositoryName) => {
|
|
36
|
-
if (require_isRepositoryName.isRepositoryName(repositoryName))
|
|
37
|
-
|
|
36
|
+
const getToolbarSrc = (repositoryName, config) => {
|
|
37
|
+
if (require_isRepositoryName.isRepositoryName(repositoryName)) {
|
|
38
|
+
const url = new URL(`${config?.host ?? "https://static.cdn.prismic.io"}/prismic.js`);
|
|
39
|
+
url.searchParams.set("repo", repositoryName);
|
|
40
|
+
if (config?.version) url.searchParams.set("v", config.version.toString());
|
|
41
|
+
return url.toString();
|
|
42
|
+
} else throw new require_errors.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
|
|
38
43
|
};
|
|
39
|
-
//#endregion
|
|
40
44
|
exports.getToolbarSrc = getToolbarSrc;
|
|
41
45
|
|
|
42
46
|
//# sourceMappingURL=getToolbarSrc.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToolbarSrc.cjs","names":["isRepositoryName","PrismicError"],"sources":["../src/getToolbarSrc.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the\n * script into your app.\n *\n * @example\n * \t```typescriptreact\n * \t// In Next.js apps, use `next/script` in your `app/layout.tsx` file.\n *\n * \timport Script from \"next/script\";\n * \timport * as prismic from \"@prismicio/client\";\n *\n * \texport default function RootLayout({\n * \tchildren,\n * \t}: {\n * \tchildren: React.ReactNode,\n * \t}) {\n * \tconst toolbarSrc = prismic.getToolbarSrc(\"my-repo\");\n *\n * \treturn (\n * \t<html lang=\"en\">\n * \t<body>{children}</body>\n * \t<Script src={toolbarSrc} />\n * \t</html>\n * \t);\n * \t}\n * \t```\n *\n * @param repositoryName - The name of the Prismic repository. For example, `\"my-repo\"` if the\n * repository URL is `my-repo.prismic.io`.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc =
|
|
1
|
+
{"version":3,"file":"getToolbarSrc.cjs","names":["isRepositoryName","PrismicError"],"sources":["../src/getToolbarSrc.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the\n * script into your app.\n *\n * @example\n * \t```typescriptreact\n * \t// In Next.js apps, use `next/script` in your `app/layout.tsx` file.\n *\n * \timport Script from \"next/script\";\n * \timport * as prismic from \"@prismicio/client\";\n *\n * \texport default function RootLayout({\n * \tchildren,\n * \t}: {\n * \tchildren: React.ReactNode,\n * \t}) {\n * \tconst toolbarSrc = prismic.getToolbarSrc(\"my-repo\");\n *\n * \treturn (\n * \t<html lang=\"en\">\n * \t<body>{children}</body>\n * \t<Script src={toolbarSrc} />\n * \t</html>\n * \t);\n * \t}\n * \t```\n *\n * @param repositoryName - The name of the Prismic repository. For example, `\"my-repo\"` if the\n * repository URL is `my-repo.prismic.io`.\n * @param config - Options that configure the toolbar URL.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc = (\n\trepositoryName: string,\n\tconfig?: {\n\t\t/** The version of the Prismic Toolbar to load. Defaults to 4. */\n\t\tversion?: 4 | 5\n\t\t/**\n\t\t * The URL the toolbar script is loaded from, without a trailing slash. For example, a toolbar\n\t\t * preview build. Defaults to `https://static.cdn.prismic.io`.\n\t\t */\n\t\thost?: string\n\t},\n): string => {\n\tif (isRepositoryName(repositoryName)) {\n\t\tconst url = new URL(`${config?.host ?? \"https://static.cdn.prismic.io\"}/prismic.js`)\n\t\turl.searchParams.set(\"repo\", repositoryName)\n\t\tif (config?.version) url.searchParams.set(\"v\", config.version.toString())\n\n\t\treturn url.toString()\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAa,iBACZ,gBACA,WASY;CACZ,IAAIA,yBAAAA,iBAAiB,cAAc,GAAG;EACrC,MAAM,MAAM,IAAI,IAAI,GAAG,QAAQ,QAAQ,gCAAgC,YAAY;EACnF,IAAI,aAAa,IAAI,QAAQ,cAAc;EAC3C,IAAI,QAAQ,SAAS,IAAI,aAAa,IAAI,KAAK,OAAO,QAAQ,SAAS,CAAC;EAExE,OAAO,IAAI,SAAS;CACrB,OACC,MAAM,IAAIC,eAAAA,aACT,iDAAiD,kBACjD,KAAA,GACA,KAAA,CACD;AAEF"}
|
package/dist/getToolbarSrc.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/getToolbarSrc.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the
|
|
4
3
|
* script into your app.
|
|
@@ -28,8 +27,16 @@
|
|
|
28
27
|
*
|
|
29
28
|
* @param repositoryName - The name of the Prismic repository. For example, `"my-repo"` if the
|
|
30
29
|
* repository URL is `my-repo.prismic.io`.
|
|
30
|
+
* @param config - Options that configure the toolbar URL.
|
|
31
31
|
* @returns The URL for the given Prismic repository's Prismic Toolbar script.
|
|
32
32
|
*/
|
|
33
|
-
export declare const getToolbarSrc:
|
|
34
|
-
|
|
33
|
+
export declare const getToolbarSrc: (repositoryName: string, config?: {
|
|
34
|
+
/** The version of the Prismic Toolbar to load. Defaults to 4. */
|
|
35
|
+
version?: 4 | 5;
|
|
36
|
+
/**
|
|
37
|
+
* The URL the toolbar script is loaded from, without a trailing slash. For example, a toolbar
|
|
38
|
+
* preview build. Defaults to `https://static.cdn.prismic.io`.
|
|
39
|
+
*/
|
|
40
|
+
host?: string;
|
|
41
|
+
}) => string;
|
|
35
42
|
//# sourceMappingURL=getToolbarSrc.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToolbarSrc.d.cts","names":[],"sources":["../src/getToolbarSrc.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getToolbarSrc.d.cts","names":[],"sources":["../src/getToolbarSrc.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmCa,gBAAa,wBACH;;EAGrB;;;;;EAKA"}
|
package/dist/getToolbarSrc.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/getToolbarSrc.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the
|
|
4
3
|
* script into your app.
|
|
@@ -28,8 +27,16 @@
|
|
|
28
27
|
*
|
|
29
28
|
* @param repositoryName - The name of the Prismic repository. For example, `"my-repo"` if the
|
|
30
29
|
* repository URL is `my-repo.prismic.io`.
|
|
30
|
+
* @param config - Options that configure the toolbar URL.
|
|
31
31
|
* @returns The URL for the given Prismic repository's Prismic Toolbar script.
|
|
32
32
|
*/
|
|
33
|
-
export declare const getToolbarSrc:
|
|
34
|
-
|
|
33
|
+
export declare const getToolbarSrc: (repositoryName: string, config?: {
|
|
34
|
+
/** The version of the Prismic Toolbar to load. Defaults to 4. */
|
|
35
|
+
version?: 4 | 5;
|
|
36
|
+
/**
|
|
37
|
+
* The URL the toolbar script is loaded from, without a trailing slash. For example, a toolbar
|
|
38
|
+
* preview build. Defaults to `https://static.cdn.prismic.io`.
|
|
39
|
+
*/
|
|
40
|
+
host?: string;
|
|
41
|
+
}) => string;
|
|
35
42
|
//# sourceMappingURL=getToolbarSrc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToolbarSrc.d.ts","names":[],"sources":["../src/getToolbarSrc.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getToolbarSrc.d.ts","names":[],"sources":["../src/getToolbarSrc.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmCa,gBAAa,wBACH;;EAGrB;;;;;EAKA"}
|
package/dist/getToolbarSrc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PrismicError } from "./errors.js";
|
|
2
2
|
import { isRepositoryName } from "./isRepositoryName.js";
|
|
3
|
-
|
|
3
|
+
// src/getToolbarSrc.ts
|
|
4
4
|
/**
|
|
5
5
|
* Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the
|
|
6
6
|
* script into your app.
|
|
@@ -30,13 +30,17 @@ import { isRepositoryName } from "./isRepositoryName.js";
|
|
|
30
30
|
*
|
|
31
31
|
* @param repositoryName - The name of the Prismic repository. For example, `"my-repo"` if the
|
|
32
32
|
* repository URL is `my-repo.prismic.io`.
|
|
33
|
+
* @param config - Options that configure the toolbar URL.
|
|
33
34
|
* @returns The URL for the given Prismic repository's Prismic Toolbar script.
|
|
34
35
|
*/
|
|
35
|
-
const getToolbarSrc = (repositoryName) => {
|
|
36
|
-
if (isRepositoryName(repositoryName))
|
|
37
|
-
|
|
36
|
+
const getToolbarSrc = (repositoryName, config) => {
|
|
37
|
+
if (isRepositoryName(repositoryName)) {
|
|
38
|
+
const url = new URL(`${config?.host ?? "https://static.cdn.prismic.io"}/prismic.js`);
|
|
39
|
+
url.searchParams.set("repo", repositoryName);
|
|
40
|
+
if (config?.version) url.searchParams.set("v", config.version.toString());
|
|
41
|
+
return url.toString();
|
|
42
|
+
} else throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
|
|
38
43
|
};
|
|
39
|
-
//#endregion
|
|
40
44
|
export { getToolbarSrc };
|
|
41
45
|
|
|
42
46
|
//# sourceMappingURL=getToolbarSrc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToolbarSrc.js","names":[],"sources":["../src/getToolbarSrc.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the\n * script into your app.\n *\n * @example\n * \t```typescriptreact\n * \t// In Next.js apps, use `next/script` in your `app/layout.tsx` file.\n *\n * \timport Script from \"next/script\";\n * \timport * as prismic from \"@prismicio/client\";\n *\n * \texport default function RootLayout({\n * \tchildren,\n * \t}: {\n * \tchildren: React.ReactNode,\n * \t}) {\n * \tconst toolbarSrc = prismic.getToolbarSrc(\"my-repo\");\n *\n * \treturn (\n * \t<html lang=\"en\">\n * \t<body>{children}</body>\n * \t<Script src={toolbarSrc} />\n * \t</html>\n * \t);\n * \t}\n * \t```\n *\n * @param repositoryName - The name of the Prismic repository. For example, `\"my-repo\"` if the\n * repository URL is `my-repo.prismic.io`.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc =
|
|
1
|
+
{"version":3,"file":"getToolbarSrc.js","names":[],"sources":["../src/getToolbarSrc.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the\n * script into your app.\n *\n * @example\n * \t```typescriptreact\n * \t// In Next.js apps, use `next/script` in your `app/layout.tsx` file.\n *\n * \timport Script from \"next/script\";\n * \timport * as prismic from \"@prismicio/client\";\n *\n * \texport default function RootLayout({\n * \tchildren,\n * \t}: {\n * \tchildren: React.ReactNode,\n * \t}) {\n * \tconst toolbarSrc = prismic.getToolbarSrc(\"my-repo\");\n *\n * \treturn (\n * \t<html lang=\"en\">\n * \t<body>{children}</body>\n * \t<Script src={toolbarSrc} />\n * \t</html>\n * \t);\n * \t}\n * \t```\n *\n * @param repositoryName - The name of the Prismic repository. For example, `\"my-repo\"` if the\n * repository URL is `my-repo.prismic.io`.\n * @param config - Options that configure the toolbar URL.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc = (\n\trepositoryName: string,\n\tconfig?: {\n\t\t/** The version of the Prismic Toolbar to load. Defaults to 4. */\n\t\tversion?: 4 | 5\n\t\t/**\n\t\t * The URL the toolbar script is loaded from, without a trailing slash. For example, a toolbar\n\t\t * preview build. Defaults to `https://static.cdn.prismic.io`.\n\t\t */\n\t\thost?: string\n\t},\n): string => {\n\tif (isRepositoryName(repositoryName)) {\n\t\tconst url = new URL(`${config?.host ?? \"https://static.cdn.prismic.io\"}/prismic.js`)\n\t\turl.searchParams.set(\"repo\", repositoryName)\n\t\tif (config?.version) url.searchParams.set(\"v\", config.version.toString())\n\n\t\treturn url.toString()\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAa,iBACZ,gBACA,WASY;CACZ,IAAI,iBAAiB,cAAc,GAAG;EACrC,MAAM,MAAM,IAAI,IAAI,GAAG,QAAQ,QAAQ,gCAAgC,YAAY;EACnF,IAAI,aAAa,IAAI,QAAQ,cAAc;EAC3C,IAAI,QAAQ,SAAS,IAAI,aAAa,IAAI,KAAK,OAAO,QAAQ,SAAS,CAAC;EAExE,OAAO,IAAI,SAAS;CACrB,OACC,MAAM,IAAI,aACT,iDAAiD,kBACjD,KAAA,GACA,KAAA,CACD;AAEF"}
|