@backblaze-labs/b2-sdk 0.1.0
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/CHANGELOG.md +121 -0
- package/LICENSE +21 -0
- package/README.md +664 -0
- package/dist/auth/account-info.d.cts +51 -0
- package/dist/auth/account-info.d.cts.map +1 -0
- package/dist/auth/account-info.d.ts +51 -0
- package/dist/auth/account-info.d.ts.map +1 -0
- package/dist/auth/file.cjs +210 -0
- package/dist/auth/file.cjs.map +1 -0
- package/dist/auth/file.d.cts +157 -0
- package/dist/auth/file.d.cts.map +1 -0
- package/dist/auth/file.d.ts +157 -0
- package/dist/auth/file.d.ts.map +1 -0
- package/dist/auth/file.js +210 -0
- package/dist/auth/file.js.map +1 -0
- package/dist/auth/in-memory.cjs +184 -0
- package/dist/auth/in-memory.cjs.map +1 -0
- package/dist/auth/in-memory.d.cts +147 -0
- package/dist/auth/in-memory.d.cts.map +1 -0
- package/dist/auth/in-memory.d.ts +147 -0
- package/dist/auth/in-memory.d.ts.map +1 -0
- package/dist/auth/in-memory.js +184 -0
- package/dist/auth/in-memory.js.map +1 -0
- package/dist/auth/index.cjs +10 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.d.cts +6 -0
- package/dist/auth/index.d.cts.map +1 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +10 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/realms.cjs +12 -0
- package/dist/auth/realms.cjs.map +1 -0
- package/dist/auth/realms.d.cts +12 -0
- package/dist/auth/realms.d.cts.map +1 -0
- package/dist/auth/realms.d.ts +12 -0
- package/dist/auth/realms.d.ts.map +1 -0
- package/dist/auth/realms.js +12 -0
- package/dist/auth/realms.js.map +1 -0
- package/dist/auth/upload-url-pool.cjs +52 -0
- package/dist/auth/upload-url-pool.cjs.map +1 -0
- package/dist/auth/upload-url-pool.d.cts +35 -0
- package/dist/auth/upload-url-pool.d.cts.map +1 -0
- package/dist/auth/upload-url-pool.d.ts +35 -0
- package/dist/auth/upload-url-pool.d.ts.map +1 -0
- package/dist/auth/upload-url-pool.js +52 -0
- package/dist/auth/upload-url-pool.js.map +1 -0
- package/dist/bucket.cjs +789 -0
- package/dist/bucket.cjs.map +1 -0
- package/dist/bucket.d.cts +659 -0
- package/dist/bucket.d.cts.map +1 -0
- package/dist/bucket.d.ts +659 -0
- package/dist/bucket.d.ts.map +1 -0
- package/dist/bucket.js +789 -0
- package/dist/bucket.js.map +1 -0
- package/dist/client.cjs +230 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +222 -0
- package/dist/client.d.cts.map +1 -0
- package/dist/client.d.ts +222 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +230 -0
- package/dist/client.js.map +1 -0
- package/dist/copy/large.cjs +74 -0
- package/dist/copy/large.cjs.map +1 -0
- package/dist/copy/large.d.cts +53 -0
- package/dist/copy/large.d.cts.map +1 -0
- package/dist/copy/large.d.ts +53 -0
- package/dist/copy/large.d.ts.map +1 -0
- package/dist/copy/large.js +74 -0
- package/dist/copy/large.js.map +1 -0
- package/dist/download/parallel.cjs +122 -0
- package/dist/download/parallel.cjs.map +1 -0
- package/dist/download/parallel.d.cts +42 -0
- package/dist/download/parallel.d.cts.map +1 -0
- package/dist/download/parallel.d.ts +42 -0
- package/dist/download/parallel.d.ts.map +1 -0
- package/dist/download/parallel.js +122 -0
- package/dist/download/parallel.js.map +1 -0
- package/dist/download/single.cjs +117 -0
- package/dist/download/single.cjs.map +1 -0
- package/dist/download/single.d.cts +152 -0
- package/dist/download/single.d.cts.map +1 -0
- package/dist/download/single.d.ts +152 -0
- package/dist/download/single.d.ts.map +1 -0
- package/dist/download/single.js +117 -0
- package/dist/download/single.js.map +1 -0
- package/dist/errors/index.cjs +268 -0
- package/dist/errors/index.cjs.map +1 -0
- package/dist/errors/index.d.cts +264 -0
- package/dist/errors/index.d.cts.map +1 -0
- package/dist/errors/index.d.ts +264 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +268 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/http/retry.cjs +36 -0
- package/dist/http/retry.cjs.map +1 -0
- package/dist/http/retry.d.cts +34 -0
- package/dist/http/retry.d.cts.map +1 -0
- package/dist/http/retry.d.ts +34 -0
- package/dist/http/retry.d.ts.map +1 -0
- package/dist/http/retry.js +36 -0
- package/dist/http/retry.js.map +1 -0
- package/dist/http/transport.cjs +143 -0
- package/dist/http/transport.cjs.map +1 -0
- package/dist/http/transport.d.cts +122 -0
- package/dist/http/transport.d.cts.map +1 -0
- package/dist/http/transport.d.ts +122 -0
- package/dist/http/transport.d.ts.map +1 -0
- package/dist/http/transport.js +143 -0
- package/dist/http/transport.js.map +1 -0
- package/dist/http/url-guard.cjs +97 -0
- package/dist/http/url-guard.cjs.map +1 -0
- package/dist/http/url-guard.d.cts +88 -0
- package/dist/http/url-guard.d.cts.map +1 -0
- package/dist/http/url-guard.d.ts +88 -0
- package/dist/http/url-guard.d.ts.map +1 -0
- package/dist/http/url-guard.js +97 -0
- package/dist/http/url-guard.js.map +1 -0
- package/dist/http/user-agent.cjs +51 -0
- package/dist/http/user-agent.cjs.map +1 -0
- package/dist/http/user-agent.d.cts +28 -0
- package/dist/http/user-agent.d.cts.map +1 -0
- package/dist/http/user-agent.d.ts +28 -0
- package/dist/http/user-agent.d.ts.map +1 -0
- package/dist/http/user-agent.js +51 -0
- package/dist/http/user-agent.js.map +1 -0
- package/dist/index.cjs +78 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +39 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/dist/notifications/index.cjs +7 -0
- package/dist/notifications/index.cjs.map +1 -0
- package/dist/notifications/index.d.cts +3 -0
- package/dist/notifications/index.d.cts.map +1 -0
- package/dist/notifications/index.d.ts +3 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +7 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/webhook.cjs +106 -0
- package/dist/notifications/webhook.cjs.map +1 -0
- package/dist/notifications/webhook.d.cts +146 -0
- package/dist/notifications/webhook.d.cts.map +1 -0
- package/dist/notifications/webhook.d.ts +146 -0
- package/dist/notifications/webhook.d.ts.map +1 -0
- package/dist/notifications/webhook.js +106 -0
- package/dist/notifications/webhook.js.map +1 -0
- package/dist/object.cjs +212 -0
- package/dist/object.cjs.map +1 -0
- package/dist/object.d.cts +263 -0
- package/dist/object.d.cts.map +1 -0
- package/dist/object.d.ts +263 -0
- package/dist/object.d.ts.map +1 -0
- package/dist/object.js +212 -0
- package/dist/object.js.map +1 -0
- package/dist/package.json.cjs +9 -0
- package/dist/package.json.cjs.map +1 -0
- package/dist/package.json.js +9 -0
- package/dist/package.json.js.map +1 -0
- package/dist/raw/encoding.cjs +47 -0
- package/dist/raw/encoding.cjs.map +1 -0
- package/dist/raw/encoding.d.cts +46 -0
- package/dist/raw/encoding.d.cts.map +1 -0
- package/dist/raw/encoding.d.ts +46 -0
- package/dist/raw/encoding.d.ts.map +1 -0
- package/dist/raw/encoding.js +47 -0
- package/dist/raw/encoding.js.map +1 -0
- package/dist/raw/index.cjs +600 -0
- package/dist/raw/index.cjs.map +1 -0
- package/dist/raw/index.d.cts +381 -0
- package/dist/raw/index.d.cts.map +1 -0
- package/dist/raw/index.d.ts +381 -0
- package/dist/raw/index.d.ts.map +1 -0
- package/dist/raw/index.js +601 -0
- package/dist/raw/index.js.map +1 -0
- package/dist/s3/index.cjs +23 -0
- package/dist/s3/index.cjs.map +1 -0
- package/dist/s3/index.d.cts +74 -0
- package/dist/s3/index.d.cts.map +1 -0
- package/dist/s3/index.d.ts +74 -0
- package/dist/s3/index.d.ts.map +1 -0
- package/dist/s3/index.js +23 -0
- package/dist/s3/index.js.map +1 -0
- package/dist/simulator/capabilities.cjs +53 -0
- package/dist/simulator/capabilities.cjs.map +1 -0
- package/dist/simulator/capabilities.d.cts +15 -0
- package/dist/simulator/capabilities.d.cts.map +1 -0
- package/dist/simulator/capabilities.d.ts +15 -0
- package/dist/simulator/capabilities.d.ts.map +1 -0
- package/dist/simulator/capabilities.js +53 -0
- package/dist/simulator/capabilities.js.map +1 -0
- package/dist/simulator/index.cjs +1559 -0
- package/dist/simulator/index.cjs.map +1 -0
- package/dist/simulator/index.d.cts +495 -0
- package/dist/simulator/index.d.cts.map +1 -0
- package/dist/simulator/index.d.ts +495 -0
- package/dist/simulator/index.d.ts.map +1 -0
- package/dist/simulator/index.js +1560 -0
- package/dist/simulator/index.js.map +1 -0
- package/dist/simulator/validation.cjs +174 -0
- package/dist/simulator/validation.cjs.map +1 -0
- package/dist/simulator/validation.d.cts +104 -0
- package/dist/simulator/validation.d.cts.map +1 -0
- package/dist/simulator/validation.d.ts +104 -0
- package/dist/simulator/validation.d.ts.map +1 -0
- package/dist/simulator/validation.js +174 -0
- package/dist/simulator/validation.js.map +1 -0
- package/dist/streams/collect.cjs +26 -0
- package/dist/streams/collect.cjs.map +1 -0
- package/dist/streams/collect.d.cts +18 -0
- package/dist/streams/collect.d.cts.map +1 -0
- package/dist/streams/collect.d.ts +18 -0
- package/dist/streams/collect.d.ts.map +1 -0
- package/dist/streams/collect.js +26 -0
- package/dist/streams/collect.js.map +1 -0
- package/dist/streams/hash.cjs +123 -0
- package/dist/streams/hash.cjs.map +1 -0
- package/dist/streams/hash.d.cts +42 -0
- package/dist/streams/hash.d.cts.map +1 -0
- package/dist/streams/hash.d.ts +42 -0
- package/dist/streams/hash.d.ts.map +1 -0
- package/dist/streams/hash.js +101 -0
- package/dist/streams/hash.js.map +1 -0
- package/dist/streams/index.cjs +13 -0
- package/dist/streams/index.cjs.map +1 -0
- package/dist/streams/index.d.cts +7 -0
- package/dist/streams/index.d.cts.map +1 -0
- package/dist/streams/index.d.ts +7 -0
- package/dist/streams/index.d.ts.map +1 -0
- package/dist/streams/index.js +13 -0
- package/dist/streams/index.js.map +1 -0
- package/dist/streams/progress.cjs +47 -0
- package/dist/streams/progress.cjs.map +1 -0
- package/dist/streams/progress.d.cts +53 -0
- package/dist/streams/progress.d.cts.map +1 -0
- package/dist/streams/progress.d.ts +53 -0
- package/dist/streams/progress.d.ts.map +1 -0
- package/dist/streams/progress.js +47 -0
- package/dist/streams/progress.js.map +1 -0
- package/dist/streams/source.cjs +155 -0
- package/dist/streams/source.cjs.map +1 -0
- package/dist/streams/source.d.cts +140 -0
- package/dist/streams/source.d.cts.map +1 -0
- package/dist/streams/source.d.ts +140 -0
- package/dist/streams/source.d.ts.map +1 -0
- package/dist/streams/source.js +155 -0
- package/dist/streams/source.js.map +1 -0
- package/dist/sync/actions/index.cjs +191 -0
- package/dist/sync/actions/index.cjs.map +1 -0
- package/dist/sync/actions/index.d.cts +167 -0
- package/dist/sync/actions/index.d.cts.map +1 -0
- package/dist/sync/actions/index.d.ts +167 -0
- package/dist/sync/actions/index.d.ts.map +1 -0
- package/dist/sync/actions/index.js +191 -0
- package/dist/sync/actions/index.js.map +1 -0
- package/dist/sync/index.cjs +23 -0
- package/dist/sync/index.cjs.map +1 -0
- package/dist/sync/index.d.cts +21 -0
- package/dist/sync/index.d.cts.map +1 -0
- package/dist/sync/index.d.ts +21 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +23 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/pairing.cjs +31 -0
- package/dist/sync/pairing.cjs.map +1 -0
- package/dist/sync/pairing.d.cts +13 -0
- package/dist/sync/pairing.d.cts.map +1 -0
- package/dist/sync/pairing.d.ts +13 -0
- package/dist/sync/pairing.d.ts.map +1 -0
- package/dist/sync/pairing.js +31 -0
- package/dist/sync/pairing.js.map +1 -0
- package/dist/sync/policies/compare.cjs +14 -0
- package/dist/sync/policies/compare.cjs.map +1 -0
- package/dist/sync/policies/compare.d.cts +13 -0
- package/dist/sync/policies/compare.d.cts.map +1 -0
- package/dist/sync/policies/compare.d.ts +13 -0
- package/dist/sync/policies/compare.d.ts.map +1 -0
- package/dist/sync/policies/compare.js +14 -0
- package/dist/sync/policies/compare.js.map +1 -0
- package/dist/sync/policies/index.cjs +74 -0
- package/dist/sync/policies/index.cjs.map +1 -0
- package/dist/sync/policies/index.d.cts +42 -0
- package/dist/sync/policies/index.d.cts.map +1 -0
- package/dist/sync/policies/index.d.ts +42 -0
- package/dist/sync/policies/index.d.ts.map +1 -0
- package/dist/sync/policies/index.js +74 -0
- package/dist/sync/policies/index.js.map +1 -0
- package/dist/sync/scanners/b2.cjs +57 -0
- package/dist/sync/scanners/b2.cjs.map +1 -0
- package/dist/sync/scanners/b2.d.cts +20 -0
- package/dist/sync/scanners/b2.d.cts.map +1 -0
- package/dist/sync/scanners/b2.d.ts +20 -0
- package/dist/sync/scanners/b2.d.ts.map +1 -0
- package/dist/sync/scanners/b2.js +57 -0
- package/dist/sync/scanners/b2.js.map +1 -0
- package/dist/sync/scanners/local.cjs +58 -0
- package/dist/sync/scanners/local.cjs.map +1 -0
- package/dist/sync/scanners/local.d.cts +24 -0
- package/dist/sync/scanners/local.d.cts.map +1 -0
- package/dist/sync/scanners/local.d.ts +24 -0
- package/dist/sync/scanners/local.d.ts.map +1 -0
- package/dist/sync/scanners/local.js +58 -0
- package/dist/sync/scanners/local.js.map +1 -0
- package/dist/sync/synchronizer.cjs +203 -0
- package/dist/sync/synchronizer.cjs.map +1 -0
- package/dist/sync/synchronizer.d.cts +52 -0
- package/dist/sync/synchronizer.d.cts.map +1 -0
- package/dist/sync/synchronizer.d.ts +52 -0
- package/dist/sync/synchronizer.d.ts.map +1 -0
- package/dist/sync/synchronizer.js +181 -0
- package/dist/sync/synchronizer.js.map +1 -0
- package/dist/sync/types.d.cts +121 -0
- package/dist/sync/types.d.cts.map +1 -0
- package/dist/sync/types.d.ts +121 -0
- package/dist/sync/types.d.ts.map +1 -0
- package/dist/types/auth.cjs +58 -0
- package/dist/types/auth.cjs.map +1 -0
- package/dist/types/auth.d.cts +150 -0
- package/dist/types/auth.d.cts.map +1 -0
- package/dist/types/auth.d.ts +150 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +58 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/bucket.cjs +44 -0
- package/dist/types/bucket.cjs.map +1 -0
- package/dist/types/bucket.d.cts +245 -0
- package/dist/types/bucket.d.cts.map +1 -0
- package/dist/types/bucket.d.ts +245 -0
- package/dist/types/bucket.d.ts.map +1 -0
- package/dist/types/bucket.js +44 -0
- package/dist/types/bucket.js.map +1 -0
- package/dist/types/download.d.cts +110 -0
- package/dist/types/download.d.cts.map +1 -0
- package/dist/types/download.d.ts +110 -0
- package/dist/types/download.d.ts.map +1 -0
- package/dist/types/encryption.cjs +343 -0
- package/dist/types/encryption.cjs.map +1 -0
- package/dist/types/encryption.d.cts +132 -0
- package/dist/types/encryption.d.cts.map +1 -0
- package/dist/types/encryption.d.ts +132 -0
- package/dist/types/encryption.d.ts.map +1 -0
- package/dist/types/encryption.js +321 -0
- package/dist/types/encryption.js.map +1 -0
- package/dist/types/errors.d.cts +16 -0
- package/dist/types/errors.d.cts.map +1 -0
- package/dist/types/errors.d.ts +16 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/file.cjs +23 -0
- package/dist/types/file.cjs.map +1 -0
- package/dist/types/file.d.cts +220 -0
- package/dist/types/file.d.cts.map +1 -0
- package/dist/types/file.d.ts +220 -0
- package/dist/types/file.d.ts.map +1 -0
- package/dist/types/file.js +23 -0
- package/dist/types/file.js.map +1 -0
- package/dist/types/ids.cjs +27 -0
- package/dist/types/ids.cjs.map +1 -0
- package/dist/types/ids.d.cts +84 -0
- package/dist/types/ids.d.cts.map +1 -0
- package/dist/types/ids.d.ts +84 -0
- package/dist/types/ids.d.ts.map +1 -0
- package/dist/types/ids.js +27 -0
- package/dist/types/ids.js.map +1 -0
- package/dist/types/index.d.cts +25 -0
- package/dist/types/index.d.cts.map +1 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/key.d.cts +84 -0
- package/dist/types/key.d.cts.map +1 -0
- package/dist/types/key.d.ts +84 -0
- package/dist/types/key.d.ts.map +1 -0
- package/dist/types/lock.cjs +17 -0
- package/dist/types/lock.cjs.map +1 -0
- package/dist/types/lock.d.cts +92 -0
- package/dist/types/lock.d.cts.map +1 -0
- package/dist/types/lock.d.ts +92 -0
- package/dist/types/lock.d.ts.map +1 -0
- package/dist/types/lock.js +17 -0
- package/dist/types/lock.js.map +1 -0
- package/dist/types/notifications.cjs +24 -0
- package/dist/types/notifications.cjs.map +1 -0
- package/dist/types/notifications.d.cts +97 -0
- package/dist/types/notifications.d.cts.map +1 -0
- package/dist/types/notifications.d.ts +97 -0
- package/dist/types/notifications.d.ts.map +1 -0
- package/dist/types/notifications.js +24 -0
- package/dist/types/notifications.js.map +1 -0
- package/dist/types/replication.d.cts +42 -0
- package/dist/types/replication.d.cts.map +1 -0
- package/dist/types/replication.d.ts +42 -0
- package/dist/types/replication.d.ts.map +1 -0
- package/dist/types/upload.d.cts +219 -0
- package/dist/types/upload.d.cts.map +1 -0
- package/dist/types/upload.d.ts +219 -0
- package/dist/types/upload.d.ts.map +1 -0
- package/dist/upload/cancel.cjs +10 -0
- package/dist/upload/cancel.cjs.map +1 -0
- package/dist/upload/cancel.d.cts +23 -0
- package/dist/upload/cancel.d.cts.map +1 -0
- package/dist/upload/cancel.d.ts +23 -0
- package/dist/upload/cancel.d.ts.map +1 -0
- package/dist/upload/cancel.js +10 -0
- package/dist/upload/cancel.js.map +1 -0
- package/dist/upload/concurrency.cjs +54 -0
- package/dist/upload/concurrency.cjs.map +1 -0
- package/dist/upload/concurrency.d.cts +46 -0
- package/dist/upload/concurrency.d.cts.map +1 -0
- package/dist/upload/concurrency.d.ts +46 -0
- package/dist/upload/concurrency.d.ts.map +1 -0
- package/dist/upload/concurrency.js +54 -0
- package/dist/upload/concurrency.js.map +1 -0
- package/dist/upload/large.cjs +222 -0
- package/dist/upload/large.cjs.map +1 -0
- package/dist/upload/large.d.cts +71 -0
- package/dist/upload/large.d.cts.map +1 -0
- package/dist/upload/large.d.ts +71 -0
- package/dist/upload/large.d.ts.map +1 -0
- package/dist/upload/large.js +222 -0
- package/dist/upload/large.js.map +1 -0
- package/dist/upload/resume.cjs +34 -0
- package/dist/upload/resume.cjs.map +1 -0
- package/dist/upload/resume.d.cts +33 -0
- package/dist/upload/resume.d.cts.map +1 -0
- package/dist/upload/resume.d.ts +33 -0
- package/dist/upload/resume.d.ts.map +1 -0
- package/dist/upload/resume.js +34 -0
- package/dist/upload/resume.js.map +1 -0
- package/dist/upload/single.cjs +47 -0
- package/dist/upload/single.cjs.map +1 -0
- package/dist/upload/single.d.cts +51 -0
- package/dist/upload/single.d.cts.map +1 -0
- package/dist/upload/single.d.ts +51 -0
- package/dist/upload/single.d.ts.map +1 -0
- package/dist/upload/single.js +47 -0
- package/dist/upload/single.js.map +1 -0
- package/dist/upload/stream.cjs +198 -0
- package/dist/upload/stream.cjs.map +1 -0
- package/dist/upload/stream.d.cts +61 -0
- package/dist/upload/stream.d.cts.map +1 -0
- package/dist/upload/stream.d.ts +61 -0
- package/dist/upload/stream.d.ts.map +1 -0
- package/dist/upload/stream.js +198 -0
- package/dist/upload/stream.js.map +1 -0
- package/dist/util/best-effort.cjs +10 -0
- package/dist/util/best-effort.cjs.map +1 -0
- package/dist/util/best-effort.d.cts +31 -0
- package/dist/util/best-effort.d.cts.map +1 -0
- package/dist/util/best-effort.d.ts +31 -0
- package/dist/util/best-effort.d.ts.map +1 -0
- package/dist/util/best-effort.js +10 -0
- package/dist/util/best-effort.js.map +1 -0
- package/dist/util/defaults.cjs +11 -0
- package/dist/util/defaults.cjs.map +1 -0
- package/dist/util/defaults.d.cts +54 -0
- package/dist/util/defaults.d.cts.map +1 -0
- package/dist/util/defaults.d.ts +54 -0
- package/dist/util/defaults.d.ts.map +1 -0
- package/dist/util/defaults.js +11 -0
- package/dist/util/defaults.js.map +1 -0
- package/dist/util/normalize.cjs +16 -0
- package/dist/util/normalize.cjs.map +1 -0
- package/dist/util/normalize.d.cts +62 -0
- package/dist/util/normalize.d.cts.map +1 -0
- package/dist/util/normalize.d.ts +62 -0
- package/dist/util/normalize.d.ts.map +1 -0
- package/dist/util/normalize.js +16 -0
- package/dist/util/normalize.js.map +1 -0
- package/dist/util/paginator.cjs +20 -0
- package/dist/util/paginator.cjs.map +1 -0
- package/dist/util/paginator.d.cts +120 -0
- package/dist/util/paginator.d.cts.map +1 -0
- package/dist/util/paginator.d.ts +120 -0
- package/dist/util/paginator.d.ts.map +1 -0
- package/dist/util/paginator.js +20 -0
- package/dist/util/paginator.js.map +1 -0
- package/dist/util/plan-ranges.cjs +28 -0
- package/dist/util/plan-ranges.cjs.map +1 -0
- package/dist/util/plan-ranges.d.cts +56 -0
- package/dist/util/plan-ranges.d.cts.map +1 -0
- package/dist/util/plan-ranges.d.ts +56 -0
- package/dist/util/plan-ranges.d.ts.map +1 -0
- package/dist/util/plan-ranges.js +28 -0
- package/dist/util/plan-ranges.js.map +1 -0
- package/dist/util/text-codec.cjs +7 -0
- package/dist/util/text-codec.cjs.map +1 -0
- package/dist/util/text-codec.d.cts +26 -0
- package/dist/util/text-codec.d.cts.map +1 -0
- package/dist/util/text-codec.d.ts +26 -0
- package/dist/util/text-codec.d.ts.map +1 -0
- package/dist/util/text-codec.js +7 -0
- package/dist/util/text-codec.js.map +1 -0
- package/dist/util/to-error.cjs +7 -0
- package/dist/util/to-error.cjs.map +1 -0
- package/dist/util/to-error.d.cts +15 -0
- package/dist/util/to-error.d.cts.map +1 -0
- package/dist/util/to-error.d.ts +15 -0
- package/dist/util/to-error.d.ts.map +1 -0
- package/dist/util/to-error.js +7 -0
- package/dist/util/to-error.js.map +1 -0
- package/dist/version.cjs +6 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.d.cts +14 -0
- package/dist/version.d.cts.map +1 -0
- package/dist/version.d.ts +14 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +198 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* B2 spec-compliance validation helpers for the simulator.
|
|
3
|
+
*
|
|
4
|
+
* Each function mirrors a documented B2 input limit (file name length,
|
|
5
|
+
* bucket name regex, file-info byte budget, etc.). Validators return
|
|
6
|
+
* `null` for valid input or a `{ code, message }` pair that the handler
|
|
7
|
+
* converts into a synthetic `400`/`403` response with the right B2
|
|
8
|
+
* error code.
|
|
9
|
+
*
|
|
10
|
+
* Keeping validation in one module makes the simulator's "what does B2
|
|
11
|
+
* reject?" surface auditable in a single file. Doc references inline at
|
|
12
|
+
* each rule so the spec source is immediate.
|
|
13
|
+
*
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
*/
|
|
16
|
+
/** Shape returned by validation functions when input is rejected. */
|
|
17
|
+
export interface ValidationError {
|
|
18
|
+
readonly code: string;
|
|
19
|
+
readonly message: string;
|
|
20
|
+
}
|
|
21
|
+
/** Minimum B2 bucket-name length per https://www.backblaze.com/apidocs/b2-create-bucket. */
|
|
22
|
+
export declare const BUCKET_NAME_MIN = 6;
|
|
23
|
+
/** Maximum B2 bucket-name length per https://www.backblaze.com/apidocs/b2-create-bucket. */
|
|
24
|
+
export declare const BUCKET_NAME_MAX = 63;
|
|
25
|
+
/**
|
|
26
|
+
* Validates a bucket name against B2's documented rules.
|
|
27
|
+
*
|
|
28
|
+
* @param name - Caller-supplied bucket name.
|
|
29
|
+
*
|
|
30
|
+
* @returns A `{ code, message }` pair on failure, or `null` when valid.
|
|
31
|
+
*
|
|
32
|
+
* @see https://www.backblaze.com/apidocs/b2-create-bucket
|
|
33
|
+
*/
|
|
34
|
+
export declare function validateBucketName(name: string): ValidationError | null;
|
|
35
|
+
/** Max file-name length is 1024 BYTES (UTF-8 encoded), not chars. */
|
|
36
|
+
export declare const FILE_NAME_MAX_BYTES = 1024;
|
|
37
|
+
/**
|
|
38
|
+
* Validates a file name against B2's documented rules. Mirrors the
|
|
39
|
+
* server-side checks B2 runs on `b2_upload_file` / `b2_hide_file` /
|
|
40
|
+
* `b2_start_large_file` / `b2_copy_file` filename inputs.
|
|
41
|
+
*
|
|
42
|
+
* @param name - Caller-supplied file name (raw, unencoded).
|
|
43
|
+
*
|
|
44
|
+
* @returns A `{ code, message }` pair on failure, or `null` when valid.
|
|
45
|
+
*
|
|
46
|
+
* @see https://www.backblaze.com/apidocs/b2-upload-file
|
|
47
|
+
*/
|
|
48
|
+
export declare function validateFileName(name: string): ValidationError | null;
|
|
49
|
+
/** Per-file fileInfo total size cap (sum of key+value bytes). */
|
|
50
|
+
export declare const FILE_INFO_TOTAL_MAX = 2048;
|
|
51
|
+
/** Per-key fileInfo value byte cap. */
|
|
52
|
+
export declare const FILE_INFO_VALUE_MAX = 2048;
|
|
53
|
+
/**
|
|
54
|
+
* Validates a `fileInfo` record against B2's byte-budget and
|
|
55
|
+
* key-shape rules.
|
|
56
|
+
*
|
|
57
|
+
* @param info - Caller-supplied fileInfo record.
|
|
58
|
+
*
|
|
59
|
+
* @returns A `{ code, message }` pair on failure, or `null` when valid.
|
|
60
|
+
*
|
|
61
|
+
* @see https://www.backblaze.com/apidocs/b2-upload-file
|
|
62
|
+
*/
|
|
63
|
+
export declare function validateFileInfo(info: Record<string, string>): ValidationError | null;
|
|
64
|
+
/** Per-bucket bucketInfo total max keys. */
|
|
65
|
+
export declare const BUCKET_INFO_MAX_KEYS = 10;
|
|
66
|
+
/** Per-key bucketInfo value byte cap. */
|
|
67
|
+
export declare const BUCKET_INFO_VALUE_MAX = 2048;
|
|
68
|
+
/**
|
|
69
|
+
* Validates a `bucketInfo` record against B2's per-bucket metadata rules.
|
|
70
|
+
*
|
|
71
|
+
* @param info - Caller-supplied bucketInfo record.
|
|
72
|
+
*
|
|
73
|
+
* @returns A `{ code, message }` pair on failure, or `null` when valid.
|
|
74
|
+
*
|
|
75
|
+
* @see https://www.backblaze.com/apidocs/b2-create-bucket
|
|
76
|
+
*/
|
|
77
|
+
export declare function validateBucketInfo(info: Record<string, string>): ValidationError | null;
|
|
78
|
+
/**
|
|
79
|
+
* Per-endpoint upper bound on the `maxFileCount` (or `maxKeyCount` /
|
|
80
|
+
* `maxPartCount`) request field. Sourced from the B2 endpoint docs.
|
|
81
|
+
*/
|
|
82
|
+
export declare const LIST_ENDPOINT_CAPS: {
|
|
83
|
+
/** `b2_list_file_names.maxFileCount` cap. */
|
|
84
|
+
readonly b2_list_file_names: 10000;
|
|
85
|
+
/** `b2_list_file_versions.maxFileCount` cap. */
|
|
86
|
+
readonly b2_list_file_versions: 10000;
|
|
87
|
+
/** `b2_list_unfinished_large_files.maxFileCount` cap. */
|
|
88
|
+
readonly b2_list_unfinished_large_files: 100;
|
|
89
|
+
/** `b2_list_keys.maxKeyCount` cap. */
|
|
90
|
+
readonly b2_list_keys: 10000;
|
|
91
|
+
/** `b2_list_parts.maxPartCount` cap. */
|
|
92
|
+
readonly b2_list_parts: 10000;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Validates a `maxFileCount` (or `maxKeyCount` / `maxPartCount`) value
|
|
96
|
+
* against the per-endpoint cap documented by B2.
|
|
97
|
+
*
|
|
98
|
+
* @param requested - Caller-supplied count.
|
|
99
|
+
* @param endpoint - Which list endpoint this applies to.
|
|
100
|
+
*
|
|
101
|
+
* @returns A `{ code, message }` pair on failure, or `null` when valid.
|
|
102
|
+
*/
|
|
103
|
+
export declare function validateMaxCount(requested: number | undefined, endpoint: keyof typeof LIST_ENDPOINT_CAPS): ValidationError | null;
|
|
104
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/simulator/validation.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAMD,4FAA4F;AAC5F,eAAO,MAAM,eAAe,IAAI,CAAA;AAChC,4FAA4F;AAC5F,eAAO,MAAM,eAAe,KAAK,CAAA;AAMjC;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAqBvE;AAMD,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,OAAO,CAAA;AAIvC;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAsCrE;AAMD,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,OAAO,CAAA;AACvC,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,OAAO,CAAA;AAIvC;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,eAAe,GAAG,IAAI,CA6BrF;AAED,4CAA4C;AAC5C,eAAO,MAAM,oBAAoB,KAAK,CAAA;AACtC,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,OAAO,CAAA;AAIzC;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,eAAe,GAAG,IAAI,CA8BvF;AAMD;;;GAGG;AACH,eAAO,MAAM,kBAAkB;IAC7B,6CAA6C;;IAE7C,gDAAgD;;IAEhD,yDAAyD;;IAEzD,sCAAsC;;IAEtC,wCAAwC;;CAEhC,CAAA;AAEV;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,OAAO,kBAAkB,GACxC,eAAe,GAAG,IAAI,CAgBxB"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { utf8Encoder } from "../util/text-codec.js";
|
|
2
|
+
const BUCKET_NAME_MIN = 6;
|
|
3
|
+
const BUCKET_NAME_MAX = 63;
|
|
4
|
+
const BUCKET_NAME_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/;
|
|
5
|
+
const BUCKET_NAME_RESERVED_PREFIX = "b2-";
|
|
6
|
+
function validateBucketName(name) {
|
|
7
|
+
if (typeof name !== "string" || name.length < BUCKET_NAME_MIN || name.length > BUCKET_NAME_MAX) {
|
|
8
|
+
return {
|
|
9
|
+
code: "invalid_bucket_name",
|
|
10
|
+
message: `bucketName must be ${BUCKET_NAME_MIN}-${BUCKET_NAME_MAX} characters`
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
if (!BUCKET_NAME_REGEX.test(name)) {
|
|
14
|
+
return {
|
|
15
|
+
code: "invalid_bucket_name",
|
|
16
|
+
message: "bucketName must contain only letters, digits, and hyphens; cannot start or end with a hyphen"
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
if (name.startsWith(BUCKET_NAME_RESERVED_PREFIX)) {
|
|
20
|
+
return {
|
|
21
|
+
code: "invalid_bucket_name",
|
|
22
|
+
message: `bucketName cannot start with the reserved prefix "${BUCKET_NAME_RESERVED_PREFIX}"`
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const FILE_NAME_MAX_BYTES = 1024;
|
|
28
|
+
const FILE_NAME_DEL = 127;
|
|
29
|
+
function validateFileName(name) {
|
|
30
|
+
if (typeof name !== "string" || name.length === 0) {
|
|
31
|
+
return { code: "invalid_file_name", message: "fileName must be a non-empty string" };
|
|
32
|
+
}
|
|
33
|
+
const bytes = utf8Encoder.encode(name);
|
|
34
|
+
if (bytes.byteLength > FILE_NAME_MAX_BYTES) {
|
|
35
|
+
return {
|
|
36
|
+
code: "invalid_file_name",
|
|
37
|
+
message: `fileName exceeds the 1024-byte UTF-8 limit (got ${bytes.byteLength})`
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
for (let i = 0; i < name.length; i++) {
|
|
41
|
+
const code = name.charCodeAt(i);
|
|
42
|
+
if (code < 32 || code === FILE_NAME_DEL) {
|
|
43
|
+
return {
|
|
44
|
+
code: "invalid_file_name",
|
|
45
|
+
message: "fileName must not contain control characters (U+0000-U+001F or U+007F)"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (name === "." || name === "..") {
|
|
50
|
+
return {
|
|
51
|
+
code: "invalid_file_name",
|
|
52
|
+
message: 'fileName cannot be exactly "." or ".."'
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (name.startsWith("/") || name.endsWith("/") || name.includes("//")) {
|
|
56
|
+
return {
|
|
57
|
+
code: "invalid_file_name",
|
|
58
|
+
message: 'fileName cannot start with "/", end with "/", or contain "//"'
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const FILE_INFO_TOTAL_MAX = 2048;
|
|
64
|
+
const FILE_INFO_VALUE_MAX = 2048;
|
|
65
|
+
const FILE_INFO_KEY_REGEX = /^[a-zA-Z0-9_-]+$/;
|
|
66
|
+
function validateFileInfo(info) {
|
|
67
|
+
let total = 0;
|
|
68
|
+
for (const [key, value] of Object.entries(info)) {
|
|
69
|
+
if (!FILE_INFO_KEY_REGEX.test(key)) {
|
|
70
|
+
return {
|
|
71
|
+
code: "invalid_file_info",
|
|
72
|
+
message: `fileInfo key "${key}" must match ^[a-zA-Z0-9_-]+$`
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (typeof value !== "string") {
|
|
76
|
+
return { code: "invalid_file_info", message: `fileInfo value for "${key}" must be a string` };
|
|
77
|
+
}
|
|
78
|
+
const keyBytes = utf8Encoder.encode(key).byteLength;
|
|
79
|
+
const valueBytes = utf8Encoder.encode(value).byteLength;
|
|
80
|
+
if (valueBytes > FILE_INFO_VALUE_MAX) {
|
|
81
|
+
return {
|
|
82
|
+
code: "invalid_file_info",
|
|
83
|
+
message: `fileInfo value for "${key}" exceeds ${FILE_INFO_VALUE_MAX} bytes`
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
total += keyBytes + valueBytes;
|
|
87
|
+
}
|
|
88
|
+
if (total > FILE_INFO_TOTAL_MAX) {
|
|
89
|
+
return {
|
|
90
|
+
code: "invalid_file_info",
|
|
91
|
+
message: `fileInfo total size ${total} bytes exceeds the ${FILE_INFO_TOTAL_MAX}-byte limit`
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
const BUCKET_INFO_MAX_KEYS = 10;
|
|
97
|
+
const BUCKET_INFO_VALUE_MAX = 2048;
|
|
98
|
+
const BUCKET_INFO_KEY_REGEX = /^[a-zA-Z0-9_-]+$/;
|
|
99
|
+
function validateBucketInfo(info) {
|
|
100
|
+
const entries = Object.entries(info);
|
|
101
|
+
if (entries.length > BUCKET_INFO_MAX_KEYS) {
|
|
102
|
+
return {
|
|
103
|
+
code: "invalid_bucket_info",
|
|
104
|
+
message: `bucketInfo cannot have more than ${BUCKET_INFO_MAX_KEYS} keys (got ${entries.length})`
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
for (const [key, value] of entries) {
|
|
108
|
+
if (!BUCKET_INFO_KEY_REGEX.test(key)) {
|
|
109
|
+
return {
|
|
110
|
+
code: "invalid_bucket_info",
|
|
111
|
+
message: `bucketInfo key "${key}" must match ^[a-zA-Z0-9_-]+$`
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (typeof value !== "string") {
|
|
115
|
+
return {
|
|
116
|
+
code: "invalid_bucket_info",
|
|
117
|
+
message: `bucketInfo value for "${key}" must be a string`
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const valueBytes = utf8Encoder.encode(value).byteLength;
|
|
121
|
+
if (valueBytes > BUCKET_INFO_VALUE_MAX) {
|
|
122
|
+
return {
|
|
123
|
+
code: "invalid_bucket_info",
|
|
124
|
+
message: `bucketInfo value for "${key}" exceeds ${BUCKET_INFO_VALUE_MAX} bytes`
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
const LIST_ENDPOINT_CAPS = {
|
|
131
|
+
/** `b2_list_file_names.maxFileCount` cap. */
|
|
132
|
+
b2_list_file_names: 1e4,
|
|
133
|
+
/** `b2_list_file_versions.maxFileCount` cap. */
|
|
134
|
+
b2_list_file_versions: 1e4,
|
|
135
|
+
/** `b2_list_unfinished_large_files.maxFileCount` cap. */
|
|
136
|
+
b2_list_unfinished_large_files: 100,
|
|
137
|
+
/** `b2_list_keys.maxKeyCount` cap. */
|
|
138
|
+
b2_list_keys: 1e4,
|
|
139
|
+
/** `b2_list_parts.maxPartCount` cap. */
|
|
140
|
+
b2_list_parts: 1e4
|
|
141
|
+
};
|
|
142
|
+
function validateMaxCount(requested, endpoint) {
|
|
143
|
+
if (requested === void 0) return null;
|
|
144
|
+
if (!Number.isInteger(requested) || requested < 1) {
|
|
145
|
+
return {
|
|
146
|
+
code: "bad_request",
|
|
147
|
+
message: `maxFileCount must be a positive integer (got ${requested})`
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const cap = LIST_ENDPOINT_CAPS[endpoint];
|
|
151
|
+
if (requested > cap) {
|
|
152
|
+
return {
|
|
153
|
+
code: "bad_request",
|
|
154
|
+
message: `maxFileCount ${requested} exceeds the ${endpoint} cap of ${cap}`
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
BUCKET_INFO_MAX_KEYS,
|
|
161
|
+
BUCKET_INFO_VALUE_MAX,
|
|
162
|
+
BUCKET_NAME_MAX,
|
|
163
|
+
BUCKET_NAME_MIN,
|
|
164
|
+
FILE_INFO_TOTAL_MAX,
|
|
165
|
+
FILE_INFO_VALUE_MAX,
|
|
166
|
+
FILE_NAME_MAX_BYTES,
|
|
167
|
+
LIST_ENDPOINT_CAPS,
|
|
168
|
+
validateBucketInfo,
|
|
169
|
+
validateBucketName,
|
|
170
|
+
validateFileInfo,
|
|
171
|
+
validateFileName,
|
|
172
|
+
validateMaxCount
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sources":["../../src/simulator/validation.ts"],"sourcesContent":["/**\n * B2 spec-compliance validation helpers for the simulator.\n *\n * Each function mirrors a documented B2 input limit (file name length,\n * bucket name regex, file-info byte budget, etc.). Validators return\n * `null` for valid input or a `{ code, message }` pair that the handler\n * converts into a synthetic `400`/`403` response with the right B2\n * error code.\n *\n * Keeping validation in one module makes the simulator's \"what does B2\n * reject?\" surface auditable in a single file. Doc references inline at\n * each rule so the spec source is immediate.\n *\n * @packageDocumentation\n */\n\nimport { utf8Encoder } from '../util/text-codec.ts'\n\n/** Shape returned by validation functions when input is rejected. */\nexport interface ValidationError {\n readonly code: string\n readonly message: string\n}\n\n// ---------------------------------------------------------------------------\n// Bucket name (`b2_create_bucket`, `b2_update_bucket`)\n// ---------------------------------------------------------------------------\n\n/** Minimum B2 bucket-name length per https://www.backblaze.com/apidocs/b2-create-bucket. */\nexport const BUCKET_NAME_MIN = 6\n/** Maximum B2 bucket-name length per https://www.backblaze.com/apidocs/b2-create-bucket. */\nexport const BUCKET_NAME_MAX = 63\n/** Bucket-name char set: letters, digits, hyphens. Anchored, leading/trailing hyphens are illegal. */\nconst BUCKET_NAME_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/\n/** Reserved prefix — B2 forbids consumer-created buckets starting with `b2-`. */\nconst BUCKET_NAME_RESERVED_PREFIX = 'b2-'\n\n/**\n * Validates a bucket name against B2's documented rules.\n *\n * @param name - Caller-supplied bucket name.\n *\n * @returns A `{ code, message }` pair on failure, or `null` when valid.\n *\n * @see https://www.backblaze.com/apidocs/b2-create-bucket\n */\nexport function validateBucketName(name: string): ValidationError | null {\n if (typeof name !== 'string' || name.length < BUCKET_NAME_MIN || name.length > BUCKET_NAME_MAX) {\n return {\n code: 'invalid_bucket_name',\n message: `bucketName must be ${BUCKET_NAME_MIN}-${BUCKET_NAME_MAX} characters`,\n }\n }\n if (!BUCKET_NAME_REGEX.test(name)) {\n return {\n code: 'invalid_bucket_name',\n message:\n 'bucketName must contain only letters, digits, and hyphens; cannot start or end with a hyphen',\n }\n }\n if (name.startsWith(BUCKET_NAME_RESERVED_PREFIX)) {\n return {\n code: 'invalid_bucket_name',\n message: `bucketName cannot start with the reserved prefix \"${BUCKET_NAME_RESERVED_PREFIX}\"`,\n }\n }\n return null\n}\n\n// ---------------------------------------------------------------------------\n// File name (every upload / hide / copy entry point)\n// ---------------------------------------------------------------------------\n\n/** Max file-name length is 1024 BYTES (UTF-8 encoded), not chars. */\nexport const FILE_NAME_MAX_BYTES = 1024\n/** Control-character range B2 rejects: U+0000-U+001F (32 codepoints) plus DEL (U+007F). */\nconst FILE_NAME_DEL = 0x7f\n\n/**\n * Validates a file name against B2's documented rules. Mirrors the\n * server-side checks B2 runs on `b2_upload_file` / `b2_hide_file` /\n * `b2_start_large_file` / `b2_copy_file` filename inputs.\n *\n * @param name - Caller-supplied file name (raw, unencoded).\n *\n * @returns A `{ code, message }` pair on failure, or `null` when valid.\n *\n * @see https://www.backblaze.com/apidocs/b2-upload-file\n */\nexport function validateFileName(name: string): ValidationError | null {\n if (typeof name !== 'string' || name.length === 0) {\n return { code: 'invalid_file_name', message: 'fileName must be a non-empty string' }\n }\n const bytes = utf8Encoder.encode(name)\n if (bytes.byteLength > FILE_NAME_MAX_BYTES) {\n return {\n code: 'invalid_file_name',\n message: `fileName exceeds the 1024-byte UTF-8 limit (got ${bytes.byteLength})`,\n }\n }\n for (let i = 0; i < name.length; i++) {\n const code = name.charCodeAt(i)\n if (code < 0x20 || code === FILE_NAME_DEL) {\n return {\n code: 'invalid_file_name',\n message: 'fileName must not contain control characters (U+0000-U+001F or U+007F)',\n }\n }\n }\n // Path segments equal to `.` or `..` alone are illegal per B2 docs.\n // Embedded `..` within a segment (e.g. `a..b`) is fine, and a path\n // like `../foo` is fine because the SDK doesn't interpret it; only\n // bare `.` or `..` as a complete name is rejected.\n if (name === '.' || name === '..') {\n return {\n code: 'invalid_file_name',\n message: 'fileName cannot be exactly \".\" or \"..\"',\n }\n }\n // No leading or trailing slash, no `//`.\n if (name.startsWith('/') || name.endsWith('/') || name.includes('//')) {\n return {\n code: 'invalid_file_name',\n message: 'fileName cannot start with \"/\", end with \"/\", or contain \"//\"',\n }\n }\n return null\n}\n\n// ---------------------------------------------------------------------------\n// File-info / Bucket-info byte budget\n// ---------------------------------------------------------------------------\n\n/** Per-file fileInfo total size cap (sum of key+value bytes). */\nexport const FILE_INFO_TOTAL_MAX = 2048\n/** Per-key fileInfo value byte cap. */\nexport const FILE_INFO_VALUE_MAX = 2048\n/** Allowed key character set (case-insensitive). */\nconst FILE_INFO_KEY_REGEX = /^[a-zA-Z0-9_-]+$/\n\n/**\n * Validates a `fileInfo` record against B2's byte-budget and\n * key-shape rules.\n *\n * @param info - Caller-supplied fileInfo record.\n *\n * @returns A `{ code, message }` pair on failure, or `null` when valid.\n *\n * @see https://www.backblaze.com/apidocs/b2-upload-file\n */\nexport function validateFileInfo(info: Record<string, string>): ValidationError | null {\n let total = 0\n for (const [key, value] of Object.entries(info)) {\n if (!FILE_INFO_KEY_REGEX.test(key)) {\n return {\n code: 'invalid_file_info',\n message: `fileInfo key \"${key}\" must match ^[a-zA-Z0-9_-]+$`,\n }\n }\n if (typeof value !== 'string') {\n return { code: 'invalid_file_info', message: `fileInfo value for \"${key}\" must be a string` }\n }\n const keyBytes = utf8Encoder.encode(key).byteLength\n const valueBytes = utf8Encoder.encode(value).byteLength\n if (valueBytes > FILE_INFO_VALUE_MAX) {\n return {\n code: 'invalid_file_info',\n message: `fileInfo value for \"${key}\" exceeds ${FILE_INFO_VALUE_MAX} bytes`,\n }\n }\n total += keyBytes + valueBytes\n }\n if (total > FILE_INFO_TOTAL_MAX) {\n return {\n code: 'invalid_file_info',\n message: `fileInfo total size ${total} bytes exceeds the ${FILE_INFO_TOTAL_MAX}-byte limit`,\n }\n }\n return null\n}\n\n/** Per-bucket bucketInfo total max keys. */\nexport const BUCKET_INFO_MAX_KEYS = 10\n/** Per-key bucketInfo value byte cap. */\nexport const BUCKET_INFO_VALUE_MAX = 2048\n/** Allowed key character set for bucketInfo. */\nconst BUCKET_INFO_KEY_REGEX = /^[a-zA-Z0-9_-]+$/\n\n/**\n * Validates a `bucketInfo` record against B2's per-bucket metadata rules.\n *\n * @param info - Caller-supplied bucketInfo record.\n *\n * @returns A `{ code, message }` pair on failure, or `null` when valid.\n *\n * @see https://www.backblaze.com/apidocs/b2-create-bucket\n */\nexport function validateBucketInfo(info: Record<string, string>): ValidationError | null {\n const entries = Object.entries(info)\n if (entries.length > BUCKET_INFO_MAX_KEYS) {\n return {\n code: 'invalid_bucket_info',\n message: `bucketInfo cannot have more than ${BUCKET_INFO_MAX_KEYS} keys (got ${entries.length})`,\n }\n }\n for (const [key, value] of entries) {\n if (!BUCKET_INFO_KEY_REGEX.test(key)) {\n return {\n code: 'invalid_bucket_info',\n message: `bucketInfo key \"${key}\" must match ^[a-zA-Z0-9_-]+$`,\n }\n }\n if (typeof value !== 'string') {\n return {\n code: 'invalid_bucket_info',\n message: `bucketInfo value for \"${key}\" must be a string`,\n }\n }\n const valueBytes = utf8Encoder.encode(value).byteLength\n if (valueBytes > BUCKET_INFO_VALUE_MAX) {\n return {\n code: 'invalid_bucket_info',\n message: `bucketInfo value for \"${key}\" exceeds ${BUCKET_INFO_VALUE_MAX} bytes`,\n }\n }\n }\n return null\n}\n\n// ---------------------------------------------------------------------------\n// maxFileCount caps per endpoint\n// ---------------------------------------------------------------------------\n\n/**\n * Per-endpoint upper bound on the `maxFileCount` (or `maxKeyCount` /\n * `maxPartCount`) request field. Sourced from the B2 endpoint docs.\n */\nexport const LIST_ENDPOINT_CAPS = {\n /** `b2_list_file_names.maxFileCount` cap. */\n b2_list_file_names: 10_000,\n /** `b2_list_file_versions.maxFileCount` cap. */\n b2_list_file_versions: 10_000,\n /** `b2_list_unfinished_large_files.maxFileCount` cap. */\n b2_list_unfinished_large_files: 100,\n /** `b2_list_keys.maxKeyCount` cap. */\n b2_list_keys: 10_000,\n /** `b2_list_parts.maxPartCount` cap. */\n b2_list_parts: 10_000,\n} as const\n\n/**\n * Validates a `maxFileCount` (or `maxKeyCount` / `maxPartCount`) value\n * against the per-endpoint cap documented by B2.\n *\n * @param requested - Caller-supplied count.\n * @param endpoint - Which list endpoint this applies to.\n *\n * @returns A `{ code, message }` pair on failure, or `null` when valid.\n */\nexport function validateMaxCount(\n requested: number | undefined,\n endpoint: keyof typeof LIST_ENDPOINT_CAPS,\n): ValidationError | null {\n if (requested === undefined) return null\n if (!Number.isInteger(requested) || requested < 1) {\n return {\n code: 'bad_request',\n message: `maxFileCount must be a positive integer (got ${requested})`,\n }\n }\n const cap = LIST_ENDPOINT_CAPS[endpoint]\n if (requested > cap) {\n return {\n code: 'bad_request',\n message: `maxFileCount ${requested} exceeds the ${endpoint} cap of ${cap}`,\n }\n }\n return null\n}\n"],"names":[],"mappings":";AA6BO,MAAM,kBAAkB;AAExB,MAAM,kBAAkB;AAE/B,MAAM,oBAAoB;AAE1B,MAAM,8BAA8B;AAW7B,SAAS,mBAAmB,MAAsC;AACvE,MAAI,OAAO,SAAS,YAAY,KAAK,SAAS,mBAAmB,KAAK,SAAS,iBAAiB;AAC9F,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,sBAAsB,eAAe,IAAI,eAAe;AAAA,IAAA;AAAA,EAErE;AACA,MAAI,CAAC,kBAAkB,KAAK,IAAI,GAAG;AACjC,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SACE;AAAA,IAAA;AAAA,EAEN;AACA,MAAI,KAAK,WAAW,2BAA2B,GAAG;AAChD,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,qDAAqD,2BAA2B;AAAA,IAAA;AAAA,EAE7F;AACA,SAAO;AACT;AAOO,MAAM,sBAAsB;AAEnC,MAAM,gBAAgB;AAaf,SAAS,iBAAiB,MAAsC;AACrE,MAAI,OAAO,SAAS,YAAY,KAAK,WAAW,GAAG;AACjD,WAAO,EAAE,MAAM,qBAAqB,SAAS,sCAAA;AAAA,EAC/C;AACA,QAAM,QAAQ,YAAY,OAAO,IAAI;AACrC,MAAI,MAAM,aAAa,qBAAqB;AAC1C,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,mDAAmD,MAAM,UAAU;AAAA,IAAA;AAAA,EAEhF;AACA,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,OAAO,KAAK,WAAW,CAAC;AAC9B,QAAI,OAAO,MAAQ,SAAS,eAAe;AACzC,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS;AAAA,MAAA;AAAA,IAEb;AAAA,EACF;AAKA,MAAI,SAAS,OAAO,SAAS,MAAM;AACjC,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EAEb;AAEA,MAAI,KAAK,WAAW,GAAG,KAAK,KAAK,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,GAAG;AACrE,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EAEb;AACA,SAAO;AACT;AAOO,MAAM,sBAAsB;AAE5B,MAAM,sBAAsB;AAEnC,MAAM,sBAAsB;AAYrB,SAAS,iBAAiB,MAAsD;AACrF,MAAI,QAAQ;AACZ,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC/C,QAAI,CAAC,oBAAoB,KAAK,GAAG,GAAG;AAClC,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS,iBAAiB,GAAG;AAAA,MAAA;AAAA,IAEjC;AACA,QAAI,OAAO,UAAU,UAAU;AAC7B,aAAO,EAAE,MAAM,qBAAqB,SAAS,uBAAuB,GAAG,qBAAA;AAAA,IACzE;AACA,UAAM,WAAW,YAAY,OAAO,GAAG,EAAE;AACzC,UAAM,aAAa,YAAY,OAAO,KAAK,EAAE;AAC7C,QAAI,aAAa,qBAAqB;AACpC,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS,uBAAuB,GAAG,aAAa,mBAAmB;AAAA,MAAA;AAAA,IAEvE;AACA,aAAS,WAAW;AAAA,EACtB;AACA,MAAI,QAAQ,qBAAqB;AAC/B,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,uBAAuB,KAAK,sBAAsB,mBAAmB;AAAA,IAAA;AAAA,EAElF;AACA,SAAO;AACT;AAGO,MAAM,uBAAuB;AAE7B,MAAM,wBAAwB;AAErC,MAAM,wBAAwB;AAWvB,SAAS,mBAAmB,MAAsD;AACvF,QAAM,UAAU,OAAO,QAAQ,IAAI;AACnC,MAAI,QAAQ,SAAS,sBAAsB;AACzC,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,oCAAoC,oBAAoB,cAAc,QAAQ,MAAM;AAAA,IAAA;AAAA,EAEjG;AACA,aAAW,CAAC,KAAK,KAAK,KAAK,SAAS;AAClC,QAAI,CAAC,sBAAsB,KAAK,GAAG,GAAG;AACpC,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS,mBAAmB,GAAG;AAAA,MAAA;AAAA,IAEnC;AACA,QAAI,OAAO,UAAU,UAAU;AAC7B,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS,yBAAyB,GAAG;AAAA,MAAA;AAAA,IAEzC;AACA,UAAM,aAAa,YAAY,OAAO,KAAK,EAAE;AAC7C,QAAI,aAAa,uBAAuB;AACtC,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS,yBAAyB,GAAG,aAAa,qBAAqB;AAAA,MAAA;AAAA,IAE3E;AAAA,EACF;AACA,SAAO;AACT;AAUO,MAAM,qBAAqB;AAAA;AAAA,EAEhC,oBAAoB;AAAA;AAAA,EAEpB,uBAAuB;AAAA;AAAA,EAEvB,gCAAgC;AAAA;AAAA,EAEhC,cAAc;AAAA;AAAA,EAEd,eAAe;AACjB;AAWO,SAAS,iBACd,WACA,UACwB;AACxB,MAAI,cAAc,OAAW,QAAO;AACpC,MAAI,CAAC,OAAO,UAAU,SAAS,KAAK,YAAY,GAAG;AACjD,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,gDAAgD,SAAS;AAAA,IAAA;AAAA,EAEtE;AACA,QAAM,MAAM,mBAAmB,QAAQ;AACvC,MAAI,YAAY,KAAK;AACnB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,gBAAgB,SAAS,gBAAgB,QAAQ,WAAW,GAAG;AAAA,IAAA;AAAA,EAE5E;AACA,SAAO;AACT;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
async function collectStream(stream) {
|
|
4
|
+
const reader = stream.getReader();
|
|
5
|
+
try {
|
|
6
|
+
const chunks = [];
|
|
7
|
+
let total = 0;
|
|
8
|
+
while (true) {
|
|
9
|
+
const { done, value } = await reader.read();
|
|
10
|
+
if (done) break;
|
|
11
|
+
chunks.push(value);
|
|
12
|
+
total += value.byteLength;
|
|
13
|
+
}
|
|
14
|
+
const result = new Uint8Array(total);
|
|
15
|
+
let offset = 0;
|
|
16
|
+
for (const chunk of chunks) {
|
|
17
|
+
result.set(chunk, offset);
|
|
18
|
+
offset += chunk.byteLength;
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
} finally {
|
|
22
|
+
reader.releaseLock();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.collectStream = collectStream;
|
|
26
|
+
//# sourceMappingURL=collect.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.cjs","sources":["../../src/streams/collect.ts"],"sourcesContent":["/**\n * Drain a `ReadableStream<Uint8Array>` into a single contiguous\n * `Uint8Array`. Releases the reader lock on both the happy and error\n * paths so the underlying stream can propagate close / error events to\n * the upstream producer.\n *\n * Used by both `createParallelDownloadStream` (per-range fetch) and\n * `StreamSource.toArrayBuffer` (whole-source materialisation). The two\n * code paths previously hand-rolled the same accumulate-then-concat\n * loop; consolidating here removes ~25 duplicated lines and a class of\n * lock-leak bugs.\n *\n * @param stream - Readable stream to consume. Will be fully drained.\n *\n * @returns A new `Uint8Array` containing every byte the stream produced.\n */\nexport async function collectStream(stream: ReadableStream<Uint8Array>): Promise<Uint8Array> {\n const reader = stream.getReader()\n try {\n const chunks: Uint8Array[] = []\n let total = 0\n while (true) {\n const { done, value } = await reader.read()\n if (done) break\n chunks.push(value)\n total += value.byteLength\n }\n const result = new Uint8Array(total)\n let offset = 0\n for (const chunk of chunks) {\n result.set(chunk, offset)\n offset += chunk.byteLength\n }\n return result\n } finally {\n // Releasing here lets the underlying stream propagate close / error\n // events to any upstream producer (e.g. a Node `Readable`) even on\n // the error path where a mid-read throw left the reader locked.\n reader.releaseLock()\n }\n}\n"],"names":[],"mappings":";;AAgBA,eAAsB,cAAc,QAAyD;AAC3F,QAAM,SAAS,OAAO,UAAA;AACtB,MAAI;AACF,UAAM,SAAuB,CAAA;AAC7B,QAAI,QAAQ;AACZ,WAAO,MAAM;AACX,YAAM,EAAE,MAAM,MAAA,IAAU,MAAM,OAAO,KAAA;AACrC,UAAI,KAAM;AACV,aAAO,KAAK,KAAK;AACjB,eAAS,MAAM;AAAA,IACjB;AACA,UAAM,SAAS,IAAI,WAAW,KAAK;AACnC,QAAI,SAAS;AACb,eAAW,SAAS,QAAQ;AAC1B,aAAO,IAAI,OAAO,MAAM;AACxB,gBAAU,MAAM;AAAA,IAClB;AACA,WAAO;AAAA,EACT,UAAA;AAIE,WAAO,YAAA;AAAA,EACT;AACF;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drain a `ReadableStream<Uint8Array>` into a single contiguous
|
|
3
|
+
* `Uint8Array`. Releases the reader lock on both the happy and error
|
|
4
|
+
* paths so the underlying stream can propagate close / error events to
|
|
5
|
+
* the upstream producer.
|
|
6
|
+
*
|
|
7
|
+
* Used by both `createParallelDownloadStream` (per-range fetch) and
|
|
8
|
+
* `StreamSource.toArrayBuffer` (whole-source materialisation). The two
|
|
9
|
+
* code paths previously hand-rolled the same accumulate-then-concat
|
|
10
|
+
* loop; consolidating here removes ~25 duplicated lines and a class of
|
|
11
|
+
* lock-leak bugs.
|
|
12
|
+
*
|
|
13
|
+
* @param stream - Readable stream to consume. Will be fully drained.
|
|
14
|
+
*
|
|
15
|
+
* @returns A new `Uint8Array` containing every byte the stream produced.
|
|
16
|
+
*/
|
|
17
|
+
export declare function collectStream(stream: ReadableStream<Uint8Array>): Promise<Uint8Array>;
|
|
18
|
+
//# sourceMappingURL=collect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../src/streams/collect.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAwB3F"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drain a `ReadableStream<Uint8Array>` into a single contiguous
|
|
3
|
+
* `Uint8Array`. Releases the reader lock on both the happy and error
|
|
4
|
+
* paths so the underlying stream can propagate close / error events to
|
|
5
|
+
* the upstream producer.
|
|
6
|
+
*
|
|
7
|
+
* Used by both `createParallelDownloadStream` (per-range fetch) and
|
|
8
|
+
* `StreamSource.toArrayBuffer` (whole-source materialisation). The two
|
|
9
|
+
* code paths previously hand-rolled the same accumulate-then-concat
|
|
10
|
+
* loop; consolidating here removes ~25 duplicated lines and a class of
|
|
11
|
+
* lock-leak bugs.
|
|
12
|
+
*
|
|
13
|
+
* @param stream - Readable stream to consume. Will be fully drained.
|
|
14
|
+
*
|
|
15
|
+
* @returns A new `Uint8Array` containing every byte the stream produced.
|
|
16
|
+
*/
|
|
17
|
+
export declare function collectStream(stream: ReadableStream<Uint8Array>): Promise<Uint8Array>;
|
|
18
|
+
//# sourceMappingURL=collect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../src/streams/collect.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAwB3F"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
async function collectStream(stream) {
|
|
2
|
+
const reader = stream.getReader();
|
|
3
|
+
try {
|
|
4
|
+
const chunks = [];
|
|
5
|
+
let total = 0;
|
|
6
|
+
while (true) {
|
|
7
|
+
const { done, value } = await reader.read();
|
|
8
|
+
if (done) break;
|
|
9
|
+
chunks.push(value);
|
|
10
|
+
total += value.byteLength;
|
|
11
|
+
}
|
|
12
|
+
const result = new Uint8Array(total);
|
|
13
|
+
let offset = 0;
|
|
14
|
+
for (const chunk of chunks) {
|
|
15
|
+
result.set(chunk, offset);
|
|
16
|
+
offset += chunk.byteLength;
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
} finally {
|
|
20
|
+
reader.releaseLock();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
collectStream
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=collect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.js","sources":["../../src/streams/collect.ts"],"sourcesContent":["/**\n * Drain a `ReadableStream<Uint8Array>` into a single contiguous\n * `Uint8Array`. Releases the reader lock on both the happy and error\n * paths so the underlying stream can propagate close / error events to\n * the upstream producer.\n *\n * Used by both `createParallelDownloadStream` (per-range fetch) and\n * `StreamSource.toArrayBuffer` (whole-source materialisation). The two\n * code paths previously hand-rolled the same accumulate-then-concat\n * loop; consolidating here removes ~25 duplicated lines and a class of\n * lock-leak bugs.\n *\n * @param stream - Readable stream to consume. Will be fully drained.\n *\n * @returns A new `Uint8Array` containing every byte the stream produced.\n */\nexport async function collectStream(stream: ReadableStream<Uint8Array>): Promise<Uint8Array> {\n const reader = stream.getReader()\n try {\n const chunks: Uint8Array[] = []\n let total = 0\n while (true) {\n const { done, value } = await reader.read()\n if (done) break\n chunks.push(value)\n total += value.byteLength\n }\n const result = new Uint8Array(total)\n let offset = 0\n for (const chunk of chunks) {\n result.set(chunk, offset)\n offset += chunk.byteLength\n }\n return result\n } finally {\n // Releasing here lets the underlying stream propagate close / error\n // events to any upstream producer (e.g. a Node `Readable`) even on\n // the error path where a mid-read throw left the reader locked.\n reader.releaseLock()\n }\n}\n"],"names":[],"mappings":"AAgBA,eAAsB,cAAc,QAAyD;AAC3F,QAAM,SAAS,OAAO,UAAA;AACtB,MAAI;AACF,UAAM,SAAuB,CAAA;AAC7B,QAAI,QAAQ;AACZ,WAAO,MAAM;AACX,YAAM,EAAE,MAAM,MAAA,IAAU,MAAM,OAAO,KAAA;AACrC,UAAI,KAAM;AACV,aAAO,KAAK,KAAK;AACjB,eAAS,MAAM;AAAA,IACjB;AACA,UAAM,SAAS,IAAI,WAAW,KAAK;AACnC,QAAI,SAAS;AACb,eAAW,SAAS,QAAQ;AAC1B,aAAO,IAAI,OAAO,MAAM;AACxB,gBAAU,MAAM;AAAA,IAClB;AACA,WAAO;AAAA,EACT,UAAA;AAIE,WAAO,YAAA;AAAA,EACT;AACF;"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
|
+
let nodeCreateHash;
|
|
26
|
+
async function getNodeCreateHash() {
|
|
27
|
+
if (nodeCreateHash !== void 0) return nodeCreateHash;
|
|
28
|
+
try {
|
|
29
|
+
const crypto2 = await import("node:crypto");
|
|
30
|
+
if (typeof crypto2.createHash !== "function") throw new Error("createHash unavailable");
|
|
31
|
+
nodeCreateHash = (algo) => {
|
|
32
|
+
const h = crypto2.createHash(algo);
|
|
33
|
+
return {
|
|
34
|
+
update(data) {
|
|
35
|
+
h.update(data);
|
|
36
|
+
},
|
|
37
|
+
digest(encoding) {
|
|
38
|
+
return h.digest(encoding);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
} catch {
|
|
43
|
+
nodeCreateHash = null;
|
|
44
|
+
}
|
|
45
|
+
return nodeCreateHash;
|
|
46
|
+
}
|
|
47
|
+
class IncrementalSha1 {
|
|
48
|
+
/** Buffered chunks for WebCrypto fallback path. */
|
|
49
|
+
chunks = [];
|
|
50
|
+
/** Total bytes fed into the hash so far. */
|
|
51
|
+
totalLength = 0;
|
|
52
|
+
/** Node.js hash instance, or null if using WebCrypto fallback. */
|
|
53
|
+
nodeHash = null;
|
|
54
|
+
/** Resolves once the crypto backend has been loaded. */
|
|
55
|
+
initPromise;
|
|
56
|
+
/** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */
|
|
57
|
+
constructor() {
|
|
58
|
+
this.initPromise = getNodeCreateHash().then((factory) => {
|
|
59
|
+
if (factory) this.nodeHash = factory("sha1");
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Feed data into the hash. Async because it lazily initializes the crypto backend.
|
|
64
|
+
* @param data - The bytes to include in the hash computation.
|
|
65
|
+
*
|
|
66
|
+
* @returns A promise that resolves once the data has been consumed.
|
|
67
|
+
*/
|
|
68
|
+
async update(data) {
|
|
69
|
+
await this.initPromise;
|
|
70
|
+
if (this.nodeHash) {
|
|
71
|
+
this.nodeHash.update(data);
|
|
72
|
+
} else {
|
|
73
|
+
this.chunks.push(new Uint8Array(data));
|
|
74
|
+
}
|
|
75
|
+
this.totalLength += data.byteLength;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Finalize the hash and return the hex-encoded SHA-1 digest.
|
|
79
|
+
* @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.
|
|
80
|
+
*/
|
|
81
|
+
async digest() {
|
|
82
|
+
await this.initPromise;
|
|
83
|
+
if (this.nodeHash) {
|
|
84
|
+
return this.nodeHash.digest("hex");
|
|
85
|
+
}
|
|
86
|
+
const combined = new Uint8Array(this.totalLength);
|
|
87
|
+
let offset = 0;
|
|
88
|
+
for (const chunk of this.chunks) {
|
|
89
|
+
combined.set(chunk, offset);
|
|
90
|
+
offset += chunk.byteLength;
|
|
91
|
+
}
|
|
92
|
+
const hashBuffer = await crypto.subtle.digest("SHA-1", combined.buffer);
|
|
93
|
+
return hexEncode(new Uint8Array(hashBuffer));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Total number of bytes fed into the hash so far.
|
|
97
|
+
*
|
|
98
|
+
* @returns The cumulative byte count across all update calls.
|
|
99
|
+
*/
|
|
100
|
+
get bytesProcessed() {
|
|
101
|
+
return this.totalLength;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function hexEncode(bytes) {
|
|
105
|
+
const hex = [];
|
|
106
|
+
for (const b of bytes) {
|
|
107
|
+
hex.push(b.toString(16).padStart(2, "0"));
|
|
108
|
+
}
|
|
109
|
+
return hex.join("");
|
|
110
|
+
}
|
|
111
|
+
async function sha1Hex(data) {
|
|
112
|
+
const factory = await getNodeCreateHash();
|
|
113
|
+
if (factory) {
|
|
114
|
+
const h = factory("sha1");
|
|
115
|
+
h.update(data);
|
|
116
|
+
return h.digest("hex");
|
|
117
|
+
}
|
|
118
|
+
const hashBuffer = await crypto.subtle.digest("SHA-1", data.buffer);
|
|
119
|
+
return hexEncode(new Uint8Array(hashBuffer));
|
|
120
|
+
}
|
|
121
|
+
exports.IncrementalSha1 = IncrementalSha1;
|
|
122
|
+
exports.sha1Hex = sha1Hex;
|
|
123
|
+
//# sourceMappingURL=hash.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.cjs","sources":["../../src/streams/hash.ts"],"sourcesContent":["/** Internal wrapper around a Node.js Hash instance. */\ntype NodeHasher = { update(data: Uint8Array): void; digest(encoding: string): string }\n\n/** Factory that creates a NodeHasher for a given algorithm name. */\ntype NodeHashFactory = (algorithm: string) => NodeHasher\n\nlet nodeCreateHash: NodeHashFactory | null | undefined\n\n/**\n * Lazily loads `node:crypto` and caches the factory. Returns null in non-Node runtimes.\n *\n * @returns The cached hash factory, or null if Node crypto is unavailable.\n */\nasync function getNodeCreateHash(): Promise<NodeHashFactory | null> {\n if (nodeCreateHash !== undefined) return nodeCreateHash\n try {\n // @ts-ignore -- node:crypto may not exist in browser/edge runtimes\n const crypto = await import('node:crypto')\n // Vite's browser shim resolves the import but does not implement\n // `createHash`. Probe explicitly so we fall through to the WebCrypto\n // path instead of returning a broken factory.\n if (typeof crypto.createHash !== 'function') throw new Error('createHash unavailable')\n nodeCreateHash = (algo: string) => {\n const h = crypto.createHash(algo)\n return {\n update(data: Uint8Array) {\n h.update(data)\n },\n digest(encoding: string) {\n return h.digest(encoding as 'hex') as string\n },\n }\n }\n /* v8 ignore next 3 -- non-Node runtime fallback, unreachable in Node tests */\n } catch {\n nodeCreateHash = null\n }\n return nodeCreateHash\n}\n\n/**\n * Incrementally computes SHA-1 hashes over streaming data.\n * Uses Node.js `crypto` when available, falling back to WebCrypto.\n */\nexport class IncrementalSha1 {\n /** Buffered chunks for WebCrypto fallback path. */\n private chunks: Uint8Array[] = []\n /** Total bytes fed into the hash so far. */\n private totalLength = 0\n /** Node.js hash instance, or null if using WebCrypto fallback. */\n private nodeHash: NodeHasher | null = null\n /** Resolves once the crypto backend has been loaded. */\n private initPromise: Promise<void>\n\n /** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */\n constructor() {\n this.initPromise = getNodeCreateHash().then((factory) => {\n if (factory) this.nodeHash = factory('sha1')\n })\n }\n\n /**\n * Feed data into the hash. Async because it lazily initializes the crypto backend.\n * @param data - The bytes to include in the hash computation.\n *\n * @returns A promise that resolves once the data has been consumed.\n */\n async update(data: Uint8Array): Promise<void> {\n await this.initPromise\n if (this.nodeHash) {\n this.nodeHash.update(data)\n } else {\n this.chunks.push(new Uint8Array(data))\n }\n this.totalLength += data.byteLength\n }\n\n /**\n * Finalize the hash and return the hex-encoded SHA-1 digest.\n * @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.\n */\n async digest(): Promise<string> {\n await this.initPromise\n if (this.nodeHash) {\n return this.nodeHash.digest('hex')\n }\n\n /* v8 ignore start -- WebCrypto fallback path, only reachable when node:crypto is unavailable */\n const combined = new Uint8Array(this.totalLength)\n let offset = 0\n for (const chunk of this.chunks) {\n combined.set(chunk, offset)\n offset += chunk.byteLength\n }\n\n const hashBuffer = await crypto.subtle.digest('SHA-1', combined.buffer as ArrayBuffer)\n return hexEncode(new Uint8Array(hashBuffer))\n /* v8 ignore stop */\n }\n\n /**\n * Total number of bytes fed into the hash so far.\n *\n * @returns The cumulative byte count across all update calls.\n */\n get bytesProcessed(): number {\n return this.totalLength\n }\n}\n\n/* v8 ignore start -- WebCrypto fallback path, only reachable when node:crypto is unavailable (browser/edge runtimes) */\n/**\n * Convert a byte array to a lowercase hex string.\n * @param bytes - The raw bytes to encode as hexadecimal characters.\n *\n * @returns The lowercase hex-encoded string representation of the input bytes.\n */\nfunction hexEncode(bytes: Uint8Array): string {\n const hex: string[] = []\n for (const b of bytes) {\n hex.push(b.toString(16).padStart(2, '0'))\n }\n return hex.join('')\n}\n/* v8 ignore stop */\n\n/**\n * Compute the SHA-1 hex digest of a complete byte array in one shot.\n * @param data - The byte array to hash.\n *\n * @returns The lowercase hex-encoded SHA-1 digest of the input.\n */\nexport async function sha1Hex(data: Uint8Array): Promise<string> {\n const factory = await getNodeCreateHash()\n if (factory) {\n const h = factory('sha1')\n h.update(data)\n return h.digest('hex')\n }\n /* v8 ignore next 2 -- WebCrypto fallback, only reachable when node:crypto is unavailable */\n const hashBuffer = await crypto.subtle.digest('SHA-1', data.buffer as ArrayBuffer)\n return hexEncode(new Uint8Array(hashBuffer))\n}\n"],"names":["crypto"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAI;AAOJ,eAAe,oBAAqD;AAClE,MAAI,mBAAmB,OAAW,QAAO;AACzC,MAAI;AAEF,UAAMA,UAAS,MAAM,OAAO,aAAa;AAIzC,QAAI,OAAOA,QAAO,eAAe,WAAY,OAAM,IAAI,MAAM,wBAAwB;AACrF,qBAAiB,CAAC,SAAiB;AACjC,YAAM,IAAIA,QAAO,WAAW,IAAI;AAChC,aAAO;AAAA,QACL,OAAO,MAAkB;AACvB,YAAE,OAAO,IAAI;AAAA,QACf;AAAA,QACA,OAAO,UAAkB;AACvB,iBAAO,EAAE,OAAO,QAAiB;AAAA,QACnC;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEF,QAAQ;AACN,qBAAiB;AAAA,EACnB;AACA,SAAO;AACT;AAMO,MAAM,gBAAgB;AAAA;AAAA,EAEnB,SAAuB,CAAA;AAAA;AAAA,EAEvB,cAAc;AAAA;AAAA,EAEd,WAA8B;AAAA;AAAA,EAE9B;AAAA;AAAA,EAGR,cAAc;AACZ,SAAK,cAAc,kBAAA,EAAoB,KAAK,CAAC,YAAY;AACvD,UAAI,QAAS,MAAK,WAAW,QAAQ,MAAM;AAAA,IAC7C,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAO,MAAiC;AAC5C,UAAM,KAAK;AACX,QAAI,KAAK,UAAU;AACjB,WAAK,SAAS,OAAO,IAAI;AAAA,IAC3B,OAAO;AACL,WAAK,OAAO,KAAK,IAAI,WAAW,IAAI,CAAC;AAAA,IACvC;AACA,SAAK,eAAe,KAAK;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,SAA0B;AAC9B,UAAM,KAAK;AACX,QAAI,KAAK,UAAU;AACjB,aAAO,KAAK,SAAS,OAAO,KAAK;AAAA,IACnC;AAGA,UAAM,WAAW,IAAI,WAAW,KAAK,WAAW;AAChD,QAAI,SAAS;AACb,eAAW,SAAS,KAAK,QAAQ;AAC/B,eAAS,IAAI,OAAO,MAAM;AAC1B,gBAAU,MAAM;AAAA,IAClB;AAEA,UAAM,aAAa,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,MAAqB;AACrF,WAAO,UAAU,IAAI,WAAW,UAAU,CAAC;AAAA,EAE7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,iBAAyB;AAC3B,WAAO,KAAK;AAAA,EACd;AACF;AASA,SAAS,UAAU,OAA2B;AAC5C,QAAM,MAAgB,CAAA;AACtB,aAAW,KAAK,OAAO;AACrB,QAAI,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC;AAAA,EAC1C;AACA,SAAO,IAAI,KAAK,EAAE;AACpB;AASA,eAAsB,QAAQ,MAAmC;AAC/D,QAAM,UAAU,MAAM,kBAAA;AACtB,MAAI,SAAS;AACX,UAAM,IAAI,QAAQ,MAAM;AACxB,MAAE,OAAO,IAAI;AACb,WAAO,EAAE,OAAO,KAAK;AAAA,EACvB;AAEA,QAAM,aAAa,MAAM,OAAO,OAAO,OAAO,SAAS,KAAK,MAAqB;AACjF,SAAO,UAAU,IAAI,WAAW,UAAU,CAAC;AAC7C;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incrementally computes SHA-1 hashes over streaming data.
|
|
3
|
+
* Uses Node.js `crypto` when available, falling back to WebCrypto.
|
|
4
|
+
*/
|
|
5
|
+
export declare class IncrementalSha1 {
|
|
6
|
+
/** Buffered chunks for WebCrypto fallback path. */
|
|
7
|
+
private chunks;
|
|
8
|
+
/** Total bytes fed into the hash so far. */
|
|
9
|
+
private totalLength;
|
|
10
|
+
/** Node.js hash instance, or null if using WebCrypto fallback. */
|
|
11
|
+
private nodeHash;
|
|
12
|
+
/** Resolves once the crypto backend has been loaded. */
|
|
13
|
+
private initPromise;
|
|
14
|
+
/** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Feed data into the hash. Async because it lazily initializes the crypto backend.
|
|
18
|
+
* @param data - The bytes to include in the hash computation.
|
|
19
|
+
*
|
|
20
|
+
* @returns A promise that resolves once the data has been consumed.
|
|
21
|
+
*/
|
|
22
|
+
update(data: Uint8Array): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Finalize the hash and return the hex-encoded SHA-1 digest.
|
|
25
|
+
* @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.
|
|
26
|
+
*/
|
|
27
|
+
digest(): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Total number of bytes fed into the hash so far.
|
|
30
|
+
*
|
|
31
|
+
* @returns The cumulative byte count across all update calls.
|
|
32
|
+
*/
|
|
33
|
+
get bytesProcessed(): number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Compute the SHA-1 hex digest of a complete byte array in one shot.
|
|
37
|
+
* @param data - The byte array to hash.
|
|
38
|
+
*
|
|
39
|
+
* @returns The lowercase hex-encoded SHA-1 digest of the input.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sha1Hex(data: Uint8Array): Promise<string>;
|
|
42
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/streams/hash.js"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,qBAAa,eAAe;IAC1B,mDAAmD;IACnD,OAAO,CAAC,MAAM,CAAmB;IACjC,4CAA4C;IAC5C,OAAO,CAAC,WAAW,CAAI;IACvB,kEAAkE;IAClE,OAAO,CAAC,QAAQ,CAA0B;IAC1C,wDAAwD;IACxD,OAAO,CAAC,WAAW,CAAe;IAElC,+EAA+E;;IAO/E;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAU7C;;;OAGG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAmB/B;;;;OAIG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;CACF;AAkBD;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAU/D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incrementally computes SHA-1 hashes over streaming data.
|
|
3
|
+
* Uses Node.js `crypto` when available, falling back to WebCrypto.
|
|
4
|
+
*/
|
|
5
|
+
export declare class IncrementalSha1 {
|
|
6
|
+
/** Buffered chunks for WebCrypto fallback path. */
|
|
7
|
+
private chunks;
|
|
8
|
+
/** Total bytes fed into the hash so far. */
|
|
9
|
+
private totalLength;
|
|
10
|
+
/** Node.js hash instance, or null if using WebCrypto fallback. */
|
|
11
|
+
private nodeHash;
|
|
12
|
+
/** Resolves once the crypto backend has been loaded. */
|
|
13
|
+
private initPromise;
|
|
14
|
+
/** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Feed data into the hash. Async because it lazily initializes the crypto backend.
|
|
18
|
+
* @param data - The bytes to include in the hash computation.
|
|
19
|
+
*
|
|
20
|
+
* @returns A promise that resolves once the data has been consumed.
|
|
21
|
+
*/
|
|
22
|
+
update(data: Uint8Array): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Finalize the hash and return the hex-encoded SHA-1 digest.
|
|
25
|
+
* @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.
|
|
26
|
+
*/
|
|
27
|
+
digest(): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Total number of bytes fed into the hash so far.
|
|
30
|
+
*
|
|
31
|
+
* @returns The cumulative byte count across all update calls.
|
|
32
|
+
*/
|
|
33
|
+
get bytesProcessed(): number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Compute the SHA-1 hex digest of a complete byte array in one shot.
|
|
37
|
+
* @param data - The byte array to hash.
|
|
38
|
+
*
|
|
39
|
+
* @returns The lowercase hex-encoded SHA-1 digest of the input.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sha1Hex(data: Uint8Array): Promise<string>;
|
|
42
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/streams/hash.js"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,qBAAa,eAAe;IAC1B,mDAAmD;IACnD,OAAO,CAAC,MAAM,CAAmB;IACjC,4CAA4C;IAC5C,OAAO,CAAC,WAAW,CAAI;IACvB,kEAAkE;IAClE,OAAO,CAAC,QAAQ,CAA0B;IAC1C,wDAAwD;IACxD,OAAO,CAAC,WAAW,CAAe;IAElC,+EAA+E;;IAO/E;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAU7C;;;OAGG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAmB/B;;;;OAIG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;CACF;AAkBD;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAU/D"}
|