@prismicio/client 7.22.3 → 7.23.0-canary.35b4a42
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 +7 -9
- package/dist/Client.cjs.map +1 -1
- 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 +7 -9
- package/dist/Client.js.map +1 -1
- 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 +4 -5
- package/dist/lib/pLimit.cjs.map +1 -1
- package/dist/lib/pLimit.js +4 -5
- package/dist/lib/pLimit.js.map +1 -1
- 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 +4 -5
- package/dist/lib/throttledWarn.cjs.map +1 -1
- package/dist/lib/throttledWarn.js +4 -5
- package/dist/lib/throttledWarn.js.map +1 -1
- 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/Client.ts +6 -6
- package/src/cookie.ts +3 -0
- package/src/getToolbarSrc.ts +18 -4
- package/src/lib/pLimit.ts +3 -3
- package/src/lib/throttledWarn.ts +3 -3
package/dist/lib/escapeHTML.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/escapeHTML.ts
|
|
2
2
|
const matchHtmlRegExp = /["'&<>]/;
|
|
3
3
|
const escapeHTML = (string) => {
|
|
4
4
|
const str = "" + string;
|
|
@@ -33,7 +33,6 @@ const escapeHTML = (string) => {
|
|
|
33
33
|
}
|
|
34
34
|
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { escapeHTML };
|
|
38
37
|
|
|
39
38
|
//# sourceMappingURL=escapeHTML.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/getOptionalLinkProperties.ts
|
|
2
2
|
/**
|
|
3
3
|
* Returns optional properties only available to link fields. Link fields can have the same shape as
|
|
4
4
|
* content relationship and link to media fields, requiring special treatment to extract
|
|
@@ -14,7 +14,6 @@ const getOptionalLinkProperties = (input) => {
|
|
|
14
14
|
if ("variant" in input) res.variant = input.variant;
|
|
15
15
|
return res;
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.getOptionalLinkProperties = getOptionalLinkProperties;
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=getOptionalLinkProperties.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/getOptionalLinkProperties.ts
|
|
2
2
|
/**
|
|
3
3
|
* Returns optional properties only available to link fields. Link fields can have the same shape as
|
|
4
4
|
* content relationship and link to media fields, requiring special treatment to extract
|
|
@@ -14,7 +14,6 @@ const getOptionalLinkProperties = (input) => {
|
|
|
14
14
|
if ("variant" in input) res.variant = input.variant;
|
|
15
15
|
return res;
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { getOptionalLinkProperties };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=getOptionalLinkProperties.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("../cookie.cjs");
|
|
2
|
-
|
|
2
|
+
// src/lib/getPreviewCookie.ts
|
|
3
3
|
const readValue = (value) => {
|
|
4
4
|
return value.replace(/%3B/g, ";");
|
|
5
5
|
};
|
|
@@ -21,7 +21,6 @@ const getPreviewCookie = (cookieJar) => {
|
|
|
21
21
|
}
|
|
22
22
|
return value;
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
exports.getPreviewCookie = getPreviewCookie;
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=getPreviewCookie.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../cookie.js";
|
|
2
|
-
|
|
2
|
+
// src/lib/getPreviewCookie.ts
|
|
3
3
|
const readValue = (value) => {
|
|
4
4
|
return value.replace(/%3B/g, ";");
|
|
5
5
|
};
|
|
@@ -21,7 +21,6 @@ const getPreviewCookie = (cookieJar) => {
|
|
|
21
21
|
}
|
|
22
22
|
return value;
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { getPreviewCookie };
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=getPreviewCookie.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/isInternalURL.ts
|
|
2
2
|
/**
|
|
3
3
|
* Determines if a URL is internal or external.
|
|
4
4
|
*
|
|
@@ -10,7 +10,6 @@ const isInternalURL = (url) => {
|
|
|
10
10
|
const isSpecialLink = !isInternal && !/^https?:\/\//.test(url);
|
|
11
11
|
return isInternal && !isSpecialLink;
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
exports.isInternalURL = isInternalURL;
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=isInternalURL.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/isInternalURL.ts
|
|
2
2
|
/**
|
|
3
3
|
* Determines if a URL is internal or external.
|
|
4
4
|
*
|
|
@@ -10,7 +10,6 @@ const isInternalURL = (url) => {
|
|
|
10
10
|
const isSpecialLink = !isInternal && !/^https?:\/\//.test(url);
|
|
11
11
|
return isInternal && !isSpecialLink;
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { isInternalURL };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=isInternalURL.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_richText = require("../types/value/richText.cjs");
|
|
2
|
-
const require_link = require("../types/value/link.cjs");
|
|
3
1
|
const require_Asset = require("../types/migration/Asset.cjs");
|
|
4
2
|
const require_Document = require("../types/migration/Document.cjs");
|
|
3
|
+
const require_link = require("../types/value/link.cjs");
|
|
4
|
+
const require_richText = require("../types/value/richText.cjs");
|
|
5
5
|
const require_isValue = require("./isValue.cjs");
|
|
6
|
-
|
|
6
|
+
// src/lib/isMigrationValue.ts
|
|
7
7
|
/**
|
|
8
8
|
* Checks if a value is a migration content relationship field.
|
|
9
9
|
*
|
|
@@ -57,7 +57,6 @@ const linkToMedia = (value) => {
|
|
|
57
57
|
const rtImageNode = (value) => {
|
|
58
58
|
return typeof value === "object" && value !== null && "id" in value && value.id instanceof require_Asset.PrismicMigrationAsset && "type" in value && value.type === require_richText.RichTextNodeType.image;
|
|
59
59
|
};
|
|
60
|
-
//#endregion
|
|
61
60
|
exports.contentRelationship = contentRelationship;
|
|
62
61
|
exports.image = image;
|
|
63
62
|
exports.linkToMedia = linkToMedia;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { RichTextNodeType } from "../types/value/richText.js";
|
|
2
|
-
import { LinkType } from "../types/value/link.js";
|
|
3
1
|
import { PrismicMigrationAsset } from "../types/migration/Asset.js";
|
|
4
2
|
import { PrismicMigrationDocument } from "../types/migration/Document.js";
|
|
3
|
+
import { LinkType } from "../types/value/link.js";
|
|
4
|
+
import { RichTextNodeType } from "../types/value/richText.js";
|
|
5
5
|
import { prismicDocument } from "./isValue.js";
|
|
6
|
-
|
|
6
|
+
// src/lib/isMigrationValue.ts
|
|
7
7
|
/**
|
|
8
8
|
* Checks if a value is a migration content relationship field.
|
|
9
9
|
*
|
|
@@ -57,7 +57,6 @@ const linkToMedia = (value) => {
|
|
|
57
57
|
const rtImageNode = (value) => {
|
|
58
58
|
return typeof value === "object" && value !== null && "id" in value && value.id instanceof PrismicMigrationAsset && "type" in value && value.type === RichTextNodeType.image;
|
|
59
59
|
};
|
|
60
|
-
//#endregion
|
|
61
60
|
export { contentRelationship, image, linkToMedia, rtImageNode };
|
|
62
61
|
|
|
63
62
|
//# sourceMappingURL=isMigrationValue.js.map
|
package/dist/lib/isValue.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_richText = require("../types/value/richText.cjs");
|
|
2
1
|
const require_link = require("../types/value/link.cjs");
|
|
3
|
-
|
|
2
|
+
const require_richText = require("../types/value/richText.cjs");
|
|
3
|
+
// src/lib/isValue.ts
|
|
4
4
|
/**
|
|
5
5
|
* Checks if a value is a link to media field.
|
|
6
6
|
*
|
|
@@ -85,7 +85,6 @@ const prismicDocument = (value) => {
|
|
|
85
85
|
return false;
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
//#endregion
|
|
89
88
|
exports.filledContentRelationship = filledContentRelationship;
|
|
90
89
|
exports.filledImage = filledImage;
|
|
91
90
|
exports.filledLinkToMedia = filledLinkToMedia;
|
package/dist/lib/isValue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RichTextNodeType } from "../types/value/richText.js";
|
|
2
1
|
import { LinkType } from "../types/value/link.js";
|
|
3
|
-
|
|
2
|
+
import { RichTextNodeType } from "../types/value/richText.js";
|
|
3
|
+
// src/lib/isValue.ts
|
|
4
4
|
/**
|
|
5
5
|
* Checks if a value is a link to media field.
|
|
6
6
|
*
|
|
@@ -85,7 +85,6 @@ const prismicDocument = (value) => {
|
|
|
85
85
|
return false;
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
//#endregion
|
|
89
88
|
export { filledContentRelationship, filledImage, filledLinkToMedia, prismicDocument, rtImageNode };
|
|
90
89
|
|
|
91
90
|
//# sourceMappingURL=isValue.js.map
|
package/dist/lib/pLimit.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/pLimit.ts
|
|
2
2
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
3
3
|
/**
|
|
4
4
|
* Creates a limiting function that will only execute one promise at a time and respect a given
|
|
@@ -11,7 +11,7 @@ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
11
11
|
const pLimit = ({ interval } = {}) => {
|
|
12
12
|
const queue = [];
|
|
13
13
|
let busy = false;
|
|
14
|
-
let lastCompletion =
|
|
14
|
+
let lastCompletion = -Infinity;
|
|
15
15
|
const resumeNext = () => {
|
|
16
16
|
if (!busy && queue.length > 0) {
|
|
17
17
|
queue.shift()?.();
|
|
@@ -23,14 +23,14 @@ const pLimit = ({ interval } = {}) => {
|
|
|
23
23
|
resumeNext();
|
|
24
24
|
};
|
|
25
25
|
const run = async (function_, resolve, arguments_) => {
|
|
26
|
-
const timeSinceLastCompletion =
|
|
26
|
+
const timeSinceLastCompletion = performance.now() - lastCompletion;
|
|
27
27
|
if (interval && timeSinceLastCompletion < interval) await sleep(interval - timeSinceLastCompletion);
|
|
28
28
|
const result = (async () => function_(...arguments_))();
|
|
29
29
|
resolve(result);
|
|
30
30
|
try {
|
|
31
31
|
await result;
|
|
32
32
|
} catch {}
|
|
33
|
-
lastCompletion =
|
|
33
|
+
lastCompletion = performance.now();
|
|
34
34
|
next();
|
|
35
35
|
};
|
|
36
36
|
const enqueue = (function_, resolve, arguments_) => {
|
|
@@ -46,7 +46,6 @@ const pLimit = ({ interval } = {}) => {
|
|
|
46
46
|
enqueue(function_, resolve, arguments_);
|
|
47
47
|
}));
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
exports.pLimit = pLimit;
|
|
51
50
|
|
|
52
51
|
//# sourceMappingURL=pLimit.cjs.map
|
package/dist/lib/pLimit.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pLimit.cjs","names":[],"sources":["../../src/lib/pLimit.ts"],"sourcesContent":["/*\n ** Core logic from https://github.com/sindresorhus/p-limit\n ** Many thanks to @sindresorhus\n */\n\n// oxlint-disable-next-line no-explicit-any\ntype AnyFunction = (...arguments_: readonly any[]) => unknown\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))\n\n/**\n * @param fn - Promise-returning/async function.\n * @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the\n * `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't\n * need this optimization unless you're pushing a lot of functions.\n * @returns The promise returned by calling `fn(...arguments)`.\n */\nexport type LimitFunction = <TArguments extends unknown[], TReturnType>(\n\tfunction_: (...arguments_: TArguments) => PromiseLike<TReturnType> | TReturnType,\n\t...arguments_: TArguments\n) => Promise<TReturnType>\n\n/**\n * Creates a limiting function that will only execute one promise at a time and respect a given\n * interval between each call.\n *\n * @param args - Options for the function, `interval` is the minimum time to wait between each\n * promise execution.\n * @returns A limiting function as per configuration, see {@link LimitFunction}.\n */\nexport const pLimit = ({ interval }: { interval?: number } = {}): LimitFunction => {\n\tconst queue: AnyFunction[] = []\n\tlet busy = false\n\tlet lastCompletion =
|
|
1
|
+
{"version":3,"file":"pLimit.cjs","names":[],"sources":["../../src/lib/pLimit.ts"],"sourcesContent":["/*\n ** Core logic from https://github.com/sindresorhus/p-limit\n ** Many thanks to @sindresorhus\n */\n\n// oxlint-disable-next-line no-explicit-any\ntype AnyFunction = (...arguments_: readonly any[]) => unknown\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))\n\n/**\n * @param fn - Promise-returning/async function.\n * @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the\n * `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't\n * need this optimization unless you're pushing a lot of functions.\n * @returns The promise returned by calling `fn(...arguments)`.\n */\nexport type LimitFunction = <TArguments extends unknown[], TReturnType>(\n\tfunction_: (...arguments_: TArguments) => PromiseLike<TReturnType> | TReturnType,\n\t...arguments_: TArguments\n) => Promise<TReturnType>\n\n/**\n * Creates a limiting function that will only execute one promise at a time and respect a given\n * interval between each call.\n *\n * @param args - Options for the function, `interval` is the minimum time to wait between each\n * promise execution.\n * @returns A limiting function as per configuration, see {@link LimitFunction}.\n */\nexport const pLimit = ({ interval }: { interval?: number } = {}): LimitFunction => {\n\tconst queue: AnyFunction[] = []\n\tlet busy = false\n\tlet lastCompletion = -Infinity\n\n\tconst resumeNext = () => {\n\t\tif (!busy && queue.length > 0) {\n\t\t\tqueue.shift()?.()\n\t\t\tbusy = true\n\t\t}\n\t}\n\n\tconst next = () => {\n\t\tbusy = false\n\n\t\tresumeNext()\n\t}\n\n\tconst run = async (\n\t\tfunction_: AnyFunction,\n\t\tresolve: (value: unknown) => void,\n\t\targuments_: unknown[],\n\t) => {\n\t\tconst timeSinceLastCompletion = performance.now() - lastCompletion\n\n\t\tif (interval && timeSinceLastCompletion < interval) {\n\t\t\tawait sleep(interval - timeSinceLastCompletion)\n\t\t}\n\t\tconst result = (async () => function_(...arguments_))()\n\n\t\tresolve(result)\n\n\t\ttry {\n\t\t\tawait result\n\t\t} catch {}\n\n\t\tlastCompletion = performance.now()\n\n\t\tnext()\n\t}\n\n\tconst enqueue = (\n\t\tfunction_: AnyFunction,\n\t\tresolve: (value: unknown) => void,\n\t\targuments_: unknown[],\n\t) => {\n\t\t// Queue `internalResolve` instead of the `run` function\n\t\t// to preserve asynchronous context.\n\t\tnew Promise((internalResolve) => {\n\t\t\tqueue.push(internalResolve)\n\t\t}).then(run.bind(undefined, function_, resolve, arguments_))\n\t\t;(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// after the `internalResolve` function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve()\n\n\t\t\tif (!busy) {\n\t\t\t\tresumeNext()\n\t\t\t}\n\t\t})()\n\t}\n\n\treturn ((function_: AnyFunction, ...arguments_: unknown[]) =>\n\t\tnew Promise<unknown>((resolve) => {\n\t\t\tenqueue(function_, resolve, arguments_)\n\t\t})) as LimitFunction\n}\n"],"mappings":";AAQA,MAAM,SAAS,OAAe,IAAI,SAAS,YAAY,WAAW,SAAS,EAAE,CAAC;;;;;;;;;AAsB9E,MAAa,UAAU,EAAE,aAAoC,CAAC,MAAqB;CAClF,MAAM,QAAuB,CAAC;CAC9B,IAAI,OAAO;CACX,IAAI,iBAAiB;CAErB,MAAM,mBAAmB;EACxB,IAAI,CAAC,QAAQ,MAAM,SAAS,GAAG;GAC9B,MAAM,MAAM,CAAC,GAAG;GAChB,OAAO;EACR;CACD;CAEA,MAAM,aAAa;EAClB,OAAO;EAEP,WAAW;CACZ;CAEA,MAAM,MAAM,OACX,WACA,SACA,eACI;EACJ,MAAM,0BAA0B,YAAY,IAAI,IAAI;EAEpD,IAAI,YAAY,0BAA0B,UACzC,MAAM,MAAM,WAAW,uBAAuB;EAE/C,MAAM,UAAU,YAAY,UAAU,GAAG,UAAU,EAAA,CAAG;EAEtD,QAAQ,MAAM;EAEd,IAAI;GACH,MAAM;EACP,QAAQ,CAAC;EAET,iBAAiB,YAAY,IAAI;EAEjC,KAAK;CACN;CAEA,MAAM,WACL,WACA,SACA,eACI;EAGJ,IAAI,SAAS,oBAAoB;GAChC,MAAM,KAAK,eAAe;EAC3B,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,KAAA,GAAW,WAAW,SAAS,UAAU,CAAC;EAC1D,CAAC,YAAY;GAKb,MAAM,QAAQ,QAAQ;GAEtB,IAAI,CAAC,MACJ,WAAW;EAEb,EAAA,CAAG;CACJ;CAEA,SAAS,WAAwB,GAAG,eACnC,IAAI,SAAkB,YAAY;EACjC,QAAQ,WAAW,SAAS,UAAU;CACvC,CAAC;AACH"}
|
package/dist/lib/pLimit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/pLimit.ts
|
|
2
2
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
3
3
|
/**
|
|
4
4
|
* Creates a limiting function that will only execute one promise at a time and respect a given
|
|
@@ -11,7 +11,7 @@ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
11
11
|
const pLimit = ({ interval } = {}) => {
|
|
12
12
|
const queue = [];
|
|
13
13
|
let busy = false;
|
|
14
|
-
let lastCompletion =
|
|
14
|
+
let lastCompletion = -Infinity;
|
|
15
15
|
const resumeNext = () => {
|
|
16
16
|
if (!busy && queue.length > 0) {
|
|
17
17
|
queue.shift()?.();
|
|
@@ -23,14 +23,14 @@ const pLimit = ({ interval } = {}) => {
|
|
|
23
23
|
resumeNext();
|
|
24
24
|
};
|
|
25
25
|
const run = async (function_, resolve, arguments_) => {
|
|
26
|
-
const timeSinceLastCompletion =
|
|
26
|
+
const timeSinceLastCompletion = performance.now() - lastCompletion;
|
|
27
27
|
if (interval && timeSinceLastCompletion < interval) await sleep(interval - timeSinceLastCompletion);
|
|
28
28
|
const result = (async () => function_(...arguments_))();
|
|
29
29
|
resolve(result);
|
|
30
30
|
try {
|
|
31
31
|
await result;
|
|
32
32
|
} catch {}
|
|
33
|
-
lastCompletion =
|
|
33
|
+
lastCompletion = performance.now();
|
|
34
34
|
next();
|
|
35
35
|
};
|
|
36
36
|
const enqueue = (function_, resolve, arguments_) => {
|
|
@@ -46,7 +46,6 @@ const pLimit = ({ interval } = {}) => {
|
|
|
46
46
|
enqueue(function_, resolve, arguments_);
|
|
47
47
|
}));
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
export { pLimit };
|
|
51
50
|
|
|
52
51
|
//# sourceMappingURL=pLimit.js.map
|
package/dist/lib/pLimit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pLimit.js","names":[],"sources":["../../src/lib/pLimit.ts"],"sourcesContent":["/*\n ** Core logic from https://github.com/sindresorhus/p-limit\n ** Many thanks to @sindresorhus\n */\n\n// oxlint-disable-next-line no-explicit-any\ntype AnyFunction = (...arguments_: readonly any[]) => unknown\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))\n\n/**\n * @param fn - Promise-returning/async function.\n * @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the\n * `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't\n * need this optimization unless you're pushing a lot of functions.\n * @returns The promise returned by calling `fn(...arguments)`.\n */\nexport type LimitFunction = <TArguments extends unknown[], TReturnType>(\n\tfunction_: (...arguments_: TArguments) => PromiseLike<TReturnType> | TReturnType,\n\t...arguments_: TArguments\n) => Promise<TReturnType>\n\n/**\n * Creates a limiting function that will only execute one promise at a time and respect a given\n * interval between each call.\n *\n * @param args - Options for the function, `interval` is the minimum time to wait between each\n * promise execution.\n * @returns A limiting function as per configuration, see {@link LimitFunction}.\n */\nexport const pLimit = ({ interval }: { interval?: number } = {}): LimitFunction => {\n\tconst queue: AnyFunction[] = []\n\tlet busy = false\n\tlet lastCompletion =
|
|
1
|
+
{"version":3,"file":"pLimit.js","names":[],"sources":["../../src/lib/pLimit.ts"],"sourcesContent":["/*\n ** Core logic from https://github.com/sindresorhus/p-limit\n ** Many thanks to @sindresorhus\n */\n\n// oxlint-disable-next-line no-explicit-any\ntype AnyFunction = (...arguments_: readonly any[]) => unknown\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))\n\n/**\n * @param fn - Promise-returning/async function.\n * @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the\n * `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't\n * need this optimization unless you're pushing a lot of functions.\n * @returns The promise returned by calling `fn(...arguments)`.\n */\nexport type LimitFunction = <TArguments extends unknown[], TReturnType>(\n\tfunction_: (...arguments_: TArguments) => PromiseLike<TReturnType> | TReturnType,\n\t...arguments_: TArguments\n) => Promise<TReturnType>\n\n/**\n * Creates a limiting function that will only execute one promise at a time and respect a given\n * interval between each call.\n *\n * @param args - Options for the function, `interval` is the minimum time to wait between each\n * promise execution.\n * @returns A limiting function as per configuration, see {@link LimitFunction}.\n */\nexport const pLimit = ({ interval }: { interval?: number } = {}): LimitFunction => {\n\tconst queue: AnyFunction[] = []\n\tlet busy = false\n\tlet lastCompletion = -Infinity\n\n\tconst resumeNext = () => {\n\t\tif (!busy && queue.length > 0) {\n\t\t\tqueue.shift()?.()\n\t\t\tbusy = true\n\t\t}\n\t}\n\n\tconst next = () => {\n\t\tbusy = false\n\n\t\tresumeNext()\n\t}\n\n\tconst run = async (\n\t\tfunction_: AnyFunction,\n\t\tresolve: (value: unknown) => void,\n\t\targuments_: unknown[],\n\t) => {\n\t\tconst timeSinceLastCompletion = performance.now() - lastCompletion\n\n\t\tif (interval && timeSinceLastCompletion < interval) {\n\t\t\tawait sleep(interval - timeSinceLastCompletion)\n\t\t}\n\t\tconst result = (async () => function_(...arguments_))()\n\n\t\tresolve(result)\n\n\t\ttry {\n\t\t\tawait result\n\t\t} catch {}\n\n\t\tlastCompletion = performance.now()\n\n\t\tnext()\n\t}\n\n\tconst enqueue = (\n\t\tfunction_: AnyFunction,\n\t\tresolve: (value: unknown) => void,\n\t\targuments_: unknown[],\n\t) => {\n\t\t// Queue `internalResolve` instead of the `run` function\n\t\t// to preserve asynchronous context.\n\t\tnew Promise((internalResolve) => {\n\t\t\tqueue.push(internalResolve)\n\t\t}).then(run.bind(undefined, function_, resolve, arguments_))\n\t\t;(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// after the `internalResolve` function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve()\n\n\t\t\tif (!busy) {\n\t\t\t\tresumeNext()\n\t\t\t}\n\t\t})()\n\t}\n\n\treturn ((function_: AnyFunction, ...arguments_: unknown[]) =>\n\t\tnew Promise<unknown>((resolve) => {\n\t\t\tenqueue(function_, resolve, arguments_)\n\t\t})) as LimitFunction\n}\n"],"mappings":";AAQA,MAAM,SAAS,OAAe,IAAI,SAAS,YAAY,WAAW,SAAS,EAAE,CAAC;;;;;;;;;AAsB9E,MAAa,UAAU,EAAE,aAAoC,CAAC,MAAqB;CAClF,MAAM,QAAuB,CAAC;CAC9B,IAAI,OAAO;CACX,IAAI,iBAAiB;CAErB,MAAM,mBAAmB;EACxB,IAAI,CAAC,QAAQ,MAAM,SAAS,GAAG;GAC9B,MAAM,MAAM,CAAC,GAAG;GAChB,OAAO;EACR;CACD;CAEA,MAAM,aAAa;EAClB,OAAO;EAEP,WAAW;CACZ;CAEA,MAAM,MAAM,OACX,WACA,SACA,eACI;EACJ,MAAM,0BAA0B,YAAY,IAAI,IAAI;EAEpD,IAAI,YAAY,0BAA0B,UACzC,MAAM,MAAM,WAAW,uBAAuB;EAE/C,MAAM,UAAU,YAAY,UAAU,GAAG,UAAU,EAAA,CAAG;EAEtD,QAAQ,MAAM;EAEd,IAAI;GACH,MAAM;EACP,QAAQ,CAAC;EAET,iBAAiB,YAAY,IAAI;EAEjC,KAAK;CACN;CAEA,MAAM,WACL,WACA,SACA,eACI;EAGJ,IAAI,SAAS,oBAAoB;GAChC,MAAM,KAAK,eAAe;EAC3B,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,KAAA,GAAW,WAAW,SAAS,UAAU,CAAC;EAC1D,CAAC,YAAY;GAKb,MAAM,QAAQ,QAAQ;GAEtB,IAAI,CAAC,MACJ,WAAW;EAEb,EAAA,CAAG;CACJ;CAEA,SAAS,WAAwB,GAAG,eACnC,IAAI,SAAkB,YAAY;EACjC,QAAQ,WAAW,SAAS,UAAU;CACvC,CAAC;AACH"}
|
package/dist/lib/request.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_pLimit = require("./pLimit.cjs");
|
|
2
|
-
|
|
2
|
+
// src/lib/request.ts
|
|
3
3
|
/**
|
|
4
4
|
* The default number of milliseconds to wait before retrying a rate-limited `fetch()` request (429
|
|
5
5
|
* response code). The default value is only used if the response does not include a `retry-after`
|
|
@@ -57,7 +57,6 @@ async function request(url, init, fetchFn) {
|
|
|
57
57
|
}
|
|
58
58
|
return response;
|
|
59
59
|
}
|
|
60
|
-
//#endregion
|
|
61
60
|
exports.DEFAULT_RETRY_AFTER = DEFAULT_RETRY_AFTER;
|
|
62
61
|
exports.request = request;
|
|
63
62
|
|
package/dist/lib/request.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/lib/request.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A universal API to make network requests. A subset of the `fetch()` API.
|
|
4
3
|
*
|
|
@@ -43,5 +42,4 @@ export interface ResponseLike {
|
|
|
43
42
|
export interface HeadersLike {
|
|
44
43
|
get(name: string): string | null;
|
|
45
44
|
}
|
|
46
|
-
//#endregion
|
|
47
45
|
//# sourceMappingURL=request.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.cts","names":[],"sources":["../../src/lib/request.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"request.d.cts","names":[],"sources":["../../src/lib/request.ts"],"mappings":";;;;;YAsBY,aAAa,eAAe,OAAO,oBAAoB,QAAQ;;;;;;YAY/D;;iBAQK,wBAAwB,KAAK;;EAE7C;;EAMA,aAAa;;EAGb,UAAU;;;;;;;EAWV,SAAS;;;iBAIO;EAChB;EACA;EACA,SAAS;EACT;EAEA,QAAQ;EACR,QAAQ;EACR,eAAe,QAAQ;EACvB,QAAQ,QAAQ;EAChB,SAAS;;;iBAIO;EAChB,IAAI"}
|
package/dist/lib/request.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/lib/request.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A universal API to make network requests. A subset of the `fetch()` API.
|
|
4
3
|
*
|
|
@@ -43,5 +42,4 @@ export interface ResponseLike {
|
|
|
43
42
|
export interface HeadersLike {
|
|
44
43
|
get(name: string): string | null;
|
|
45
44
|
}
|
|
46
|
-
//#endregion
|
|
47
45
|
//# sourceMappingURL=request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","names":[],"sources":["../../src/lib/request.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"request.d.ts","names":[],"sources":["../../src/lib/request.ts"],"mappings":";;;;;YAsBY,aAAa,eAAe,OAAO,oBAAoB,QAAQ;;;;;;YAY/D;;iBAQK,wBAAwB,KAAK;;EAE7C;;EAMA,aAAa;;EAGb,UAAU;;;;;;;EAWV,SAAS;;;iBAIO;EAChB;EACA;EACA,SAAS;EACT;EAEA,QAAQ;EACR,QAAQ;EACR,eAAe,QAAQ;EACvB,QAAQ,QAAQ;EAChB,SAAS;;;iBAIO;EAChB,IAAI"}
|
package/dist/lib/request.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pLimit } from "./pLimit.js";
|
|
2
|
-
|
|
2
|
+
// src/lib/request.ts
|
|
3
3
|
/**
|
|
4
4
|
* The default number of milliseconds to wait before retrying a rate-limited `fetch()` request (429
|
|
5
5
|
* response code). The default value is only used if the response does not include a `retry-after`
|
|
@@ -57,7 +57,6 @@ async function request(url, init, fetchFn) {
|
|
|
57
57
|
}
|
|
58
58
|
return response;
|
|
59
59
|
}
|
|
60
|
-
//#endregion
|
|
61
60
|
export { DEFAULT_RETRY_AFTER, request };
|
|
62
61
|
|
|
63
62
|
//# sourceMappingURL=request.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_richText = require("../types/value/richText.cjs");
|
|
2
|
-
const require_link = require("../types/value/link.cjs");
|
|
3
1
|
const require_isFilled = require("../helpers/isFilled.cjs");
|
|
4
2
|
const require_Asset = require("../types/migration/Asset.cjs");
|
|
5
3
|
const require_Document = require("../types/migration/Document.cjs");
|
|
4
|
+
const require_link = require("../types/value/link.cjs");
|
|
5
|
+
const require_richText = require("../types/value/richText.cjs");
|
|
6
6
|
const require_getOptionalLinkProperties = require("./getOptionalLinkProperties.cjs");
|
|
7
7
|
const require_isMigrationValue = require("./isMigrationValue.cjs");
|
|
8
|
-
|
|
8
|
+
// src/lib/resolveMigrationDocumentData.ts
|
|
9
9
|
/**
|
|
10
10
|
* Resolves a migration content relationship to a content relationship field.
|
|
11
11
|
*
|
|
@@ -140,7 +140,6 @@ async function resolveMigrationDocumentData(input, migration) {
|
|
|
140
140
|
}
|
|
141
141
|
return input;
|
|
142
142
|
}
|
|
143
|
-
//#endregion
|
|
144
143
|
exports.resolveMigrationContentRelationship = resolveMigrationContentRelationship;
|
|
145
144
|
exports.resolveMigrationDocumentData = resolveMigrationDocumentData;
|
|
146
145
|
exports.resolveMigrationImage = resolveMigrationImage;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RichTextNodeType } from "../types/value/richText.js";
|
|
2
|
-
import { LinkType } from "../types/value/link.js";
|
|
3
1
|
import { link } from "../helpers/isFilled.js";
|
|
4
2
|
import { PrismicMigrationAsset } from "../types/migration/Asset.js";
|
|
5
3
|
import { PrismicMigrationDocument } from "../types/migration/Document.js";
|
|
4
|
+
import { LinkType } from "../types/value/link.js";
|
|
5
|
+
import { RichTextNodeType } from "../types/value/richText.js";
|
|
6
6
|
import { getOptionalLinkProperties } from "./getOptionalLinkProperties.js";
|
|
7
7
|
import { contentRelationship, image, linkToMedia, rtImageNode } from "./isMigrationValue.js";
|
|
8
|
-
|
|
8
|
+
// src/lib/resolveMigrationDocumentData.ts
|
|
9
9
|
/**
|
|
10
10
|
* Resolves a migration content relationship to a content relationship field.
|
|
11
11
|
*
|
|
@@ -140,7 +140,6 @@ async function resolveMigrationDocumentData(input, migration) {
|
|
|
140
140
|
}
|
|
141
141
|
return input;
|
|
142
142
|
}
|
|
143
|
-
//#endregion
|
|
144
143
|
export { resolveMigrationContentRelationship, resolveMigrationDocumentData, resolveMigrationImage, resolveMigrationLinkToMedia, resolveMigrationRTImageNode };
|
|
145
144
|
|
|
146
145
|
//# sourceMappingURL=resolveMigrationDocumentData.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_link = require("../types/value/link.cjs");
|
|
2
1
|
const require_asLink = require("../helpers/asLink.cjs");
|
|
2
|
+
const require_link = require("../types/value/link.cjs");
|
|
3
3
|
const require_escapeHTML = require("./escapeHTML.cjs");
|
|
4
|
-
|
|
4
|
+
// src/lib/serializerHelpers.ts
|
|
5
5
|
const formatAttributes = (node, attributes) => {
|
|
6
6
|
const _attributes = { ...attributes };
|
|
7
7
|
if ("direction" in node && node.direction === "rtl") _attributes.dir = node.direction;
|
|
@@ -87,7 +87,6 @@ const serializeSpan = () => {
|
|
|
87
87
|
return text ? require_escapeHTML.escapeHTML(text).replace(/\n/g, "<br />") : "";
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
//#endregion
|
|
91
90
|
exports.serializeEmbed = serializeEmbed;
|
|
92
91
|
exports.serializeHyperlink = serializeHyperlink;
|
|
93
92
|
exports.serializeImage = serializeImage;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LinkType } from "../types/value/link.js";
|
|
2
1
|
import { asLink } from "../helpers/asLink.js";
|
|
2
|
+
import { LinkType } from "../types/value/link.js";
|
|
3
3
|
import { escapeHTML } from "./escapeHTML.js";
|
|
4
|
-
|
|
4
|
+
// src/lib/serializerHelpers.ts
|
|
5
5
|
const formatAttributes = (node, attributes) => {
|
|
6
6
|
const _attributes = { ...attributes };
|
|
7
7
|
if ("direction" in node && node.direction === "rtl") _attributes.dir = node.direction;
|
|
@@ -87,7 +87,6 @@ const serializeSpan = () => {
|
|
|
87
87
|
return text ? escapeHTML(text).replace(/\n/g, "<br />") : "";
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
//#endregion
|
|
91
90
|
export { serializeEmbed, serializeHyperlink, serializeImage, serializePreFormatted, serializeSpan, serializeStandardTag };
|
|
92
91
|
|
|
93
92
|
//# sourceMappingURL=serializerHelpers.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/throttledWarn.ts
|
|
2
2
|
const THROTTLE_THRESHOLD_MS = 5e3;
|
|
3
3
|
let lastMessage;
|
|
4
4
|
let lastCalledAt = 0;
|
|
@@ -11,15 +11,14 @@ let lastCalledAt = 0;
|
|
|
11
11
|
* @param config - Configuration for the log.
|
|
12
12
|
*/
|
|
13
13
|
const throttledWarn = (message) => {
|
|
14
|
-
if (message === lastMessage &&
|
|
15
|
-
lastCalledAt =
|
|
14
|
+
if (message === lastMessage && performance.now() - lastCalledAt < THROTTLE_THRESHOLD_MS) {
|
|
15
|
+
lastCalledAt = performance.now();
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
lastCalledAt =
|
|
18
|
+
lastCalledAt = performance.now();
|
|
19
19
|
lastMessage = message;
|
|
20
20
|
console.warn(message);
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
exports.throttledWarn = throttledWarn;
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=throttledWarn.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttledWarn.cjs","names":[],"sources":["../../src/lib/throttledWarn.ts"],"sourcesContent":["const THROTTLE_THRESHOLD_MS = 5000\n\nlet lastMessage: string | undefined\nlet lastCalledAt = 0\n\n/**\n * Logs a warning. If the message is identical the immediate previous logged message and that\n * message was logged within 5 seconds of the current call, the log is ignored. This throttle\n * behavior prevents identical messages from flooding the console.\n *\n * @param message - A message to log.\n * @param config - Configuration for the log.\n */\nexport const throttledWarn = (message: string): void => {\n\tif (message === lastMessage &&
|
|
1
|
+
{"version":3,"file":"throttledWarn.cjs","names":[],"sources":["../../src/lib/throttledWarn.ts"],"sourcesContent":["const THROTTLE_THRESHOLD_MS = 5000\n\nlet lastMessage: string | undefined\nlet lastCalledAt = 0\n\n/**\n * Logs a warning. If the message is identical the immediate previous logged message and that\n * message was logged within 5 seconds of the current call, the log is ignored. This throttle\n * behavior prevents identical messages from flooding the console.\n *\n * @param message - A message to log.\n * @param config - Configuration for the log.\n */\nexport const throttledWarn = (message: string): void => {\n\tif (message === lastMessage && performance.now() - lastCalledAt < THROTTLE_THRESHOLD_MS) {\n\t\tlastCalledAt = performance.now()\n\n\t\treturn\n\t}\n\n\tlastCalledAt = performance.now()\n\tlastMessage = message\n\n\tconsole.warn(message)\n}\n"],"mappings":";AAAA,MAAM,wBAAwB;AAE9B,IAAI;AACJ,IAAI,eAAe;;;;;;;;;AAUnB,MAAa,iBAAiB,YAA0B;CACvD,IAAI,YAAY,eAAe,YAAY,IAAI,IAAI,eAAe,uBAAuB;EACxF,eAAe,YAAY,IAAI;EAE/B;CACD;CAEA,eAAe,YAAY,IAAI;CAC/B,cAAc;CAEd,QAAQ,KAAK,OAAO;AACrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/throttledWarn.ts
|
|
2
2
|
const THROTTLE_THRESHOLD_MS = 5e3;
|
|
3
3
|
let lastMessage;
|
|
4
4
|
let lastCalledAt = 0;
|
|
@@ -11,15 +11,14 @@ let lastCalledAt = 0;
|
|
|
11
11
|
* @param config - Configuration for the log.
|
|
12
12
|
*/
|
|
13
13
|
const throttledWarn = (message) => {
|
|
14
|
-
if (message === lastMessage &&
|
|
15
|
-
lastCalledAt =
|
|
14
|
+
if (message === lastMessage && performance.now() - lastCalledAt < THROTTLE_THRESHOLD_MS) {
|
|
15
|
+
lastCalledAt = performance.now();
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
lastCalledAt =
|
|
18
|
+
lastCalledAt = performance.now();
|
|
19
19
|
lastMessage = message;
|
|
20
20
|
console.warn(message);
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { throttledWarn };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=throttledWarn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttledWarn.js","names":[],"sources":["../../src/lib/throttledWarn.ts"],"sourcesContent":["const THROTTLE_THRESHOLD_MS = 5000\n\nlet lastMessage: string | undefined\nlet lastCalledAt = 0\n\n/**\n * Logs a warning. If the message is identical the immediate previous logged message and that\n * message was logged within 5 seconds of the current call, the log is ignored. This throttle\n * behavior prevents identical messages from flooding the console.\n *\n * @param message - A message to log.\n * @param config - Configuration for the log.\n */\nexport const throttledWarn = (message: string): void => {\n\tif (message === lastMessage &&
|
|
1
|
+
{"version":3,"file":"throttledWarn.js","names":[],"sources":["../../src/lib/throttledWarn.ts"],"sourcesContent":["const THROTTLE_THRESHOLD_MS = 5000\n\nlet lastMessage: string | undefined\nlet lastCalledAt = 0\n\n/**\n * Logs a warning. If the message is identical the immediate previous logged message and that\n * message was logged within 5 seconds of the current call, the log is ignored. This throttle\n * behavior prevents identical messages from flooding the console.\n *\n * @param message - A message to log.\n * @param config - Configuration for the log.\n */\nexport const throttledWarn = (message: string): void => {\n\tif (message === lastMessage && performance.now() - lastCalledAt < THROTTLE_THRESHOLD_MS) {\n\t\tlastCalledAt = performance.now()\n\n\t\treturn\n\t}\n\n\tlastCalledAt = performance.now()\n\tlastMessage = message\n\n\tconsole.warn(message)\n}\n"],"mappings":";AAAA,MAAM,wBAAwB;AAE9B,IAAI;AACJ,IAAI,eAAe;;;;;;;;;AAUnB,MAAa,iBAAiB,YAA0B;CACvD,IAAI,YAAY,eAAe,YAAY,IAAI,IAAI,eAAe,uBAAuB;EACxF,eAAe,YAAY,IAAI;EAE/B;CACD;CAEA,eAAe,YAAY,IAAI;CAC/B,cAAc;CAEd,QAAQ,KAAK,OAAO;AACrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_errors = require("../errors.cjs");
|
|
2
|
-
|
|
2
|
+
// src/lib/validateAssetMetadata.ts
|
|
3
3
|
/** Max length for asset notes accepted by the API. */
|
|
4
4
|
const ASSET_NOTES_MAX_LENGTH = 500;
|
|
5
5
|
/** Max length for asset credits accepted by the API. */
|
|
@@ -29,7 +29,6 @@ const validateAssetMetadata = ({ notes, credits, alt, tags }) => {
|
|
|
29
29
|
tags
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
exports.validateAssetMetadata = validateAssetMetadata;
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=validateAssetMetadata.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PrismicError } from "../errors.js";
|
|
2
|
-
|
|
2
|
+
// src/lib/validateAssetMetadata.ts
|
|
3
3
|
/** Max length for asset notes accepted by the API. */
|
|
4
4
|
const ASSET_NOTES_MAX_LENGTH = 500;
|
|
5
5
|
/** Max length for asset credits accepted by the API. */
|
|
@@ -29,7 +29,6 @@ const validateAssetMetadata = ({ notes, credits, alt, tags }) => {
|
|
|
29
29
|
tags
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { validateAssetMetadata };
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=validateAssetMetadata.js.map
|
package/dist/package.cjs
CHANGED
package/dist/package.js
CHANGED
package/dist/richtext/asText.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/richtext/asText.ts
|
|
2
2
|
/**
|
|
3
3
|
* Converts a rich text field to a plain text string.
|
|
4
4
|
*
|
|
@@ -12,7 +12,6 @@ const asText = (richTextField, separator = " ") => {
|
|
|
12
12
|
for (let i = 0; i < richTextField.length; i++) if ("text" in richTextField[i]) result += (result ? separator : "") + richTextField[i].text;
|
|
13
13
|
return result;
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
exports.asText = asText;
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=asText.cjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RichTextField } from "../types/value/richText.cjs";
|
|
2
|
-
//#region src/richtext/asText.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Converts a rich text field to a plain text string.
|
|
5
4
|
*
|
|
@@ -9,5 +8,4 @@ import { RichTextField } from "../types/value/richText.cjs";
|
|
|
9
8
|
* @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}
|
|
10
9
|
*/
|
|
11
10
|
export declare const asText: (richTextField: RichTextField, separator?: string) => string;
|
|
12
|
-
//#endregion
|
|
13
11
|
//# sourceMappingURL=asText.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asText.d.cts","names":[],"sources":["../../src/richtext/asText.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"asText.d.cts","names":[],"sources":["../../src/richtext/asText.ts"],"mappings":";;;;;;;;;qBAUa,SAAM,eAAmB,eAAa"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RichTextField } from "../types/value/richText.js";
|
|
2
|
-
//#region src/richtext/asText.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Converts a rich text field to a plain text string.
|
|
5
4
|
*
|
|
@@ -9,5 +8,4 @@ import { RichTextField } from "../types/value/richText.js";
|
|
|
9
8
|
* @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}
|
|
10
9
|
*/
|
|
11
10
|
export declare const asText: (richTextField: RichTextField, separator?: string) => string;
|
|
12
|
-
//#endregion
|
|
13
11
|
//# sourceMappingURL=asText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asText.d.ts","names":[],"sources":["../../src/richtext/asText.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"asText.d.ts","names":[],"sources":["../../src/richtext/asText.ts"],"mappings":";;;;;;;;;qBAUa,SAAM,eAAmB,eAAa"}
|