@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,150 @@
|
|
|
1
|
+
import { AccountId, AuthToken, BucketId } from './ids.js';
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the B2 API capabilities that can be granted to an
|
|
4
|
+
* application key. Each capability controls access to a specific set of
|
|
5
|
+
* API operations.
|
|
6
|
+
*
|
|
7
|
+
* Use these when constructing the `capabilities` array for an application
|
|
8
|
+
* key request, or when checking required capabilities via
|
|
9
|
+
* `B2Client.hasCapabilities`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const check = client.hasCapabilities([Capability.WriteFiles, Capability.ReadFiles])
|
|
14
|
+
* if (!check.ok) throw new Error(`missing: ${check.missing.join(', ')}`)
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const Capability: {
|
|
18
|
+
/** List application keys. */
|
|
19
|
+
readonly ListKeys: "listKeys";
|
|
20
|
+
/** Create new application keys. */
|
|
21
|
+
readonly WriteKeys: "writeKeys";
|
|
22
|
+
/** Delete application keys. */
|
|
23
|
+
readonly DeleteKeys: "deleteKeys";
|
|
24
|
+
/** List buckets (subject to key restrictions). */
|
|
25
|
+
readonly ListBuckets: "listBuckets";
|
|
26
|
+
/** List bucket names without other metadata. */
|
|
27
|
+
readonly ListAllBucketNames: "listAllBucketNames";
|
|
28
|
+
/** Read bucket settings. */
|
|
29
|
+
readonly ReadBuckets: "readBuckets";
|
|
30
|
+
/** Create and update buckets. */
|
|
31
|
+
readonly WriteBuckets: "writeBuckets";
|
|
32
|
+
/** Remove existing buckets from the account. */
|
|
33
|
+
readonly DeleteBuckets: "deleteBuckets";
|
|
34
|
+
/** Read bucket-level Object Lock retention settings. */
|
|
35
|
+
readonly ReadBucketRetentions: "readBucketRetentions";
|
|
36
|
+
/** Modify bucket-level Object Lock retention settings. */
|
|
37
|
+
readonly WriteBucketRetentions: "writeBucketRetentions";
|
|
38
|
+
/** Read default bucket encryption settings. */
|
|
39
|
+
readonly ReadBucketEncryption: "readBucketEncryption";
|
|
40
|
+
/** Modify default bucket encryption settings. */
|
|
41
|
+
readonly WriteBucketEncryption: "writeBucketEncryption";
|
|
42
|
+
/** Read bucket replication configuration. */
|
|
43
|
+
readonly ReadBucketReplications: "readBucketReplications";
|
|
44
|
+
/** Modify bucket replication configuration. */
|
|
45
|
+
readonly WriteBucketReplications: "writeBucketReplications";
|
|
46
|
+
/** Read bucket event-notification rules. */
|
|
47
|
+
readonly ReadBucketNotifications: "readBucketNotifications";
|
|
48
|
+
/** Modify bucket event-notification rules. */
|
|
49
|
+
readonly WriteBucketNotifications: "writeBucketNotifications";
|
|
50
|
+
/** List file names and versions. */
|
|
51
|
+
readonly ListFiles: "listFiles";
|
|
52
|
+
/** Download files. */
|
|
53
|
+
readonly ReadFiles: "readFiles";
|
|
54
|
+
/** Mint download authorisation tokens. */
|
|
55
|
+
readonly ShareFiles: "shareFiles";
|
|
56
|
+
/** Upload files. */
|
|
57
|
+
readonly WriteFiles: "writeFiles";
|
|
58
|
+
/** Delete file versions. */
|
|
59
|
+
readonly DeleteFiles: "deleteFiles";
|
|
60
|
+
/** Read per-file legal hold flags. */
|
|
61
|
+
readonly ReadFileLegalHolds: "readFileLegalHolds";
|
|
62
|
+
/** Modify per-file legal hold flags. */
|
|
63
|
+
readonly WriteFileLegalHolds: "writeFileLegalHolds";
|
|
64
|
+
/** Read per-file Object Lock retention settings. */
|
|
65
|
+
readonly ReadFileRetentions: "readFileRetentions";
|
|
66
|
+
/** Modify per-file Object Lock retention settings. */
|
|
67
|
+
readonly WriteFileRetentions: "writeFileRetentions";
|
|
68
|
+
/** Shorten governance-mode retention. */
|
|
69
|
+
readonly BypassGovernance: "bypassGovernance";
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* A B2 API capability that can be granted to an application key. Derived
|
|
73
|
+
* from {@link Capability}.
|
|
74
|
+
*/
|
|
75
|
+
export type Capability = (typeof Capability)[keyof typeof Capability];
|
|
76
|
+
/** Describes the capabilities and scope restrictions of an authorized application key. */
|
|
77
|
+
export interface AllowedInfo {
|
|
78
|
+
/** List of capabilities granted to this key. */
|
|
79
|
+
readonly capabilities: readonly Capability[];
|
|
80
|
+
/** Bucket ID this key is restricted to, or null if unrestricted. */
|
|
81
|
+
readonly bucketId: BucketId | null;
|
|
82
|
+
/** Bucket name this key is restricted to, or null if unrestricted. */
|
|
83
|
+
readonly bucketName: string | null;
|
|
84
|
+
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
85
|
+
readonly namePrefix: string | null;
|
|
86
|
+
}
|
|
87
|
+
/** Configuration for the B2 Cloud Storage API returned during authorization. */
|
|
88
|
+
export interface StorageApiInfo {
|
|
89
|
+
/** Minimum allowed part size for large file uploads, in bytes. */
|
|
90
|
+
readonly absoluteMinimumPartSize: number;
|
|
91
|
+
/** Base URL for B2 API calls. */
|
|
92
|
+
readonly apiUrl: string;
|
|
93
|
+
/** Bucket ID this key is restricted to, or null if unrestricted. */
|
|
94
|
+
readonly bucketId: BucketId | null;
|
|
95
|
+
/** Bucket name this key is restricted to, or null if unrestricted. */
|
|
96
|
+
readonly bucketName: string | null;
|
|
97
|
+
/** Base URL for file downloads. */
|
|
98
|
+
readonly downloadUrl: string;
|
|
99
|
+
/** Discriminator indicating this is storage API info. Always `'storageApi'`. */
|
|
100
|
+
readonly infoType: 'storageApi';
|
|
101
|
+
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
102
|
+
readonly namePrefix: string | null;
|
|
103
|
+
/** Recommended part size for large file uploads, in bytes. */
|
|
104
|
+
readonly recommendedPartSize: number;
|
|
105
|
+
/** Base URL for the S3-compatible API. */
|
|
106
|
+
readonly s3ApiUrl: string;
|
|
107
|
+
/** Capabilities and scope of the authorized key. */
|
|
108
|
+
readonly allowed: AllowedInfo;
|
|
109
|
+
}
|
|
110
|
+
/** Configuration for the B2 Groups API returned during authorization. */
|
|
111
|
+
export interface GroupsApiInfo {
|
|
112
|
+
/** Base URL for Groups API calls. */
|
|
113
|
+
readonly groupsApiUrl: string;
|
|
114
|
+
/** Discriminator indicating this is groups API info. Always `'groupsApi'`. */
|
|
115
|
+
readonly infoType: 'groupsApi';
|
|
116
|
+
}
|
|
117
|
+
/** Container for all API-specific configuration returned by `b2_authorize_account`. */
|
|
118
|
+
export interface ApiInfo {
|
|
119
|
+
/** Storage API configuration (always present). */
|
|
120
|
+
readonly storageApi: StorageApiInfo;
|
|
121
|
+
/** Groups API configuration (present only when the account has groups enabled). */
|
|
122
|
+
readonly groupsApi?: GroupsApiInfo;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Response from the `b2_authorize_account` API call.
|
|
126
|
+
* Contains the authorization token and API endpoint URLs needed for subsequent requests.
|
|
127
|
+
*/
|
|
128
|
+
export interface AuthorizeAccountResponse {
|
|
129
|
+
/** The account ID for the authorized account. */
|
|
130
|
+
readonly accountId: AccountId;
|
|
131
|
+
/** Authorization token to use in subsequent API calls. */
|
|
132
|
+
readonly authorizationToken: AuthToken;
|
|
133
|
+
/** API-specific configuration including endpoint URLs and key scope. */
|
|
134
|
+
readonly apiInfo: ApiInfo;
|
|
135
|
+
/** Expiration timestamp of the application key in milliseconds, or null if the key does not expire. */
|
|
136
|
+
readonly applicationKeyExpirationTimestamp: number | null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Request parameters for the `b2_authorize_account` API call.
|
|
140
|
+
* Credentials are sent via HTTP Basic auth in the raw API, but represented here as fields.
|
|
141
|
+
*/
|
|
142
|
+
export interface AuthorizeAccountRequest {
|
|
143
|
+
/** The application key ID (account ID or app key ID). */
|
|
144
|
+
readonly applicationKeyId: string;
|
|
145
|
+
/** The application key secret. */
|
|
146
|
+
readonly applicationKey: string;
|
|
147
|
+
/** Optional realm override (e.g., `'production'`, `'staging'`). Defaults to production. */
|
|
148
|
+
readonly realm?: string;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.js"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { AccountId, AuthToken, BucketId } from './ids.js';
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the B2 API capabilities that can be granted to an
|
|
4
|
+
* application key. Each capability controls access to a specific set of
|
|
5
|
+
* API operations.
|
|
6
|
+
*
|
|
7
|
+
* Use these when constructing the `capabilities` array for an application
|
|
8
|
+
* key request, or when checking required capabilities via
|
|
9
|
+
* `B2Client.hasCapabilities`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const check = client.hasCapabilities([Capability.WriteFiles, Capability.ReadFiles])
|
|
14
|
+
* if (!check.ok) throw new Error(`missing: ${check.missing.join(', ')}`)
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const Capability: {
|
|
18
|
+
/** List application keys. */
|
|
19
|
+
readonly ListKeys: "listKeys";
|
|
20
|
+
/** Create new application keys. */
|
|
21
|
+
readonly WriteKeys: "writeKeys";
|
|
22
|
+
/** Delete application keys. */
|
|
23
|
+
readonly DeleteKeys: "deleteKeys";
|
|
24
|
+
/** List buckets (subject to key restrictions). */
|
|
25
|
+
readonly ListBuckets: "listBuckets";
|
|
26
|
+
/** List bucket names without other metadata. */
|
|
27
|
+
readonly ListAllBucketNames: "listAllBucketNames";
|
|
28
|
+
/** Read bucket settings. */
|
|
29
|
+
readonly ReadBuckets: "readBuckets";
|
|
30
|
+
/** Create and update buckets. */
|
|
31
|
+
readonly WriteBuckets: "writeBuckets";
|
|
32
|
+
/** Remove existing buckets from the account. */
|
|
33
|
+
readonly DeleteBuckets: "deleteBuckets";
|
|
34
|
+
/** Read bucket-level Object Lock retention settings. */
|
|
35
|
+
readonly ReadBucketRetentions: "readBucketRetentions";
|
|
36
|
+
/** Modify bucket-level Object Lock retention settings. */
|
|
37
|
+
readonly WriteBucketRetentions: "writeBucketRetentions";
|
|
38
|
+
/** Read default bucket encryption settings. */
|
|
39
|
+
readonly ReadBucketEncryption: "readBucketEncryption";
|
|
40
|
+
/** Modify default bucket encryption settings. */
|
|
41
|
+
readonly WriteBucketEncryption: "writeBucketEncryption";
|
|
42
|
+
/** Read bucket replication configuration. */
|
|
43
|
+
readonly ReadBucketReplications: "readBucketReplications";
|
|
44
|
+
/** Modify bucket replication configuration. */
|
|
45
|
+
readonly WriteBucketReplications: "writeBucketReplications";
|
|
46
|
+
/** Read bucket event-notification rules. */
|
|
47
|
+
readonly ReadBucketNotifications: "readBucketNotifications";
|
|
48
|
+
/** Modify bucket event-notification rules. */
|
|
49
|
+
readonly WriteBucketNotifications: "writeBucketNotifications";
|
|
50
|
+
/** List file names and versions. */
|
|
51
|
+
readonly ListFiles: "listFiles";
|
|
52
|
+
/** Download files. */
|
|
53
|
+
readonly ReadFiles: "readFiles";
|
|
54
|
+
/** Mint download authorisation tokens. */
|
|
55
|
+
readonly ShareFiles: "shareFiles";
|
|
56
|
+
/** Upload files. */
|
|
57
|
+
readonly WriteFiles: "writeFiles";
|
|
58
|
+
/** Delete file versions. */
|
|
59
|
+
readonly DeleteFiles: "deleteFiles";
|
|
60
|
+
/** Read per-file legal hold flags. */
|
|
61
|
+
readonly ReadFileLegalHolds: "readFileLegalHolds";
|
|
62
|
+
/** Modify per-file legal hold flags. */
|
|
63
|
+
readonly WriteFileLegalHolds: "writeFileLegalHolds";
|
|
64
|
+
/** Read per-file Object Lock retention settings. */
|
|
65
|
+
readonly ReadFileRetentions: "readFileRetentions";
|
|
66
|
+
/** Modify per-file Object Lock retention settings. */
|
|
67
|
+
readonly WriteFileRetentions: "writeFileRetentions";
|
|
68
|
+
/** Shorten governance-mode retention. */
|
|
69
|
+
readonly BypassGovernance: "bypassGovernance";
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* A B2 API capability that can be granted to an application key. Derived
|
|
73
|
+
* from {@link Capability}.
|
|
74
|
+
*/
|
|
75
|
+
export type Capability = (typeof Capability)[keyof typeof Capability];
|
|
76
|
+
/** Describes the capabilities and scope restrictions of an authorized application key. */
|
|
77
|
+
export interface AllowedInfo {
|
|
78
|
+
/** List of capabilities granted to this key. */
|
|
79
|
+
readonly capabilities: readonly Capability[];
|
|
80
|
+
/** Bucket ID this key is restricted to, or null if unrestricted. */
|
|
81
|
+
readonly bucketId: BucketId | null;
|
|
82
|
+
/** Bucket name this key is restricted to, or null if unrestricted. */
|
|
83
|
+
readonly bucketName: string | null;
|
|
84
|
+
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
85
|
+
readonly namePrefix: string | null;
|
|
86
|
+
}
|
|
87
|
+
/** Configuration for the B2 Cloud Storage API returned during authorization. */
|
|
88
|
+
export interface StorageApiInfo {
|
|
89
|
+
/** Minimum allowed part size for large file uploads, in bytes. */
|
|
90
|
+
readonly absoluteMinimumPartSize: number;
|
|
91
|
+
/** Base URL for B2 API calls. */
|
|
92
|
+
readonly apiUrl: string;
|
|
93
|
+
/** Bucket ID this key is restricted to, or null if unrestricted. */
|
|
94
|
+
readonly bucketId: BucketId | null;
|
|
95
|
+
/** Bucket name this key is restricted to, or null if unrestricted. */
|
|
96
|
+
readonly bucketName: string | null;
|
|
97
|
+
/** Base URL for file downloads. */
|
|
98
|
+
readonly downloadUrl: string;
|
|
99
|
+
/** Discriminator indicating this is storage API info. Always `'storageApi'`. */
|
|
100
|
+
readonly infoType: 'storageApi';
|
|
101
|
+
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
102
|
+
readonly namePrefix: string | null;
|
|
103
|
+
/** Recommended part size for large file uploads, in bytes. */
|
|
104
|
+
readonly recommendedPartSize: number;
|
|
105
|
+
/** Base URL for the S3-compatible API. */
|
|
106
|
+
readonly s3ApiUrl: string;
|
|
107
|
+
/** Capabilities and scope of the authorized key. */
|
|
108
|
+
readonly allowed: AllowedInfo;
|
|
109
|
+
}
|
|
110
|
+
/** Configuration for the B2 Groups API returned during authorization. */
|
|
111
|
+
export interface GroupsApiInfo {
|
|
112
|
+
/** Base URL for Groups API calls. */
|
|
113
|
+
readonly groupsApiUrl: string;
|
|
114
|
+
/** Discriminator indicating this is groups API info. Always `'groupsApi'`. */
|
|
115
|
+
readonly infoType: 'groupsApi';
|
|
116
|
+
}
|
|
117
|
+
/** Container for all API-specific configuration returned by `b2_authorize_account`. */
|
|
118
|
+
export interface ApiInfo {
|
|
119
|
+
/** Storage API configuration (always present). */
|
|
120
|
+
readonly storageApi: StorageApiInfo;
|
|
121
|
+
/** Groups API configuration (present only when the account has groups enabled). */
|
|
122
|
+
readonly groupsApi?: GroupsApiInfo;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Response from the `b2_authorize_account` API call.
|
|
126
|
+
* Contains the authorization token and API endpoint URLs needed for subsequent requests.
|
|
127
|
+
*/
|
|
128
|
+
export interface AuthorizeAccountResponse {
|
|
129
|
+
/** The account ID for the authorized account. */
|
|
130
|
+
readonly accountId: AccountId;
|
|
131
|
+
/** Authorization token to use in subsequent API calls. */
|
|
132
|
+
readonly authorizationToken: AuthToken;
|
|
133
|
+
/** API-specific configuration including endpoint URLs and key scope. */
|
|
134
|
+
readonly apiInfo: ApiInfo;
|
|
135
|
+
/** Expiration timestamp of the application key in milliseconds, or null if the key does not expire. */
|
|
136
|
+
readonly applicationKeyExpirationTimestamp: number | null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Request parameters for the `b2_authorize_account` API call.
|
|
140
|
+
* Credentials are sent via HTTP Basic auth in the raw API, but represented here as fields.
|
|
141
|
+
*/
|
|
142
|
+
export interface AuthorizeAccountRequest {
|
|
143
|
+
/** The application key ID (account ID or app key ID). */
|
|
144
|
+
readonly applicationKeyId: string;
|
|
145
|
+
/** The application key secret. */
|
|
146
|
+
readonly applicationKey: string;
|
|
147
|
+
/** Optional realm override (e.g., `'production'`, `'staging'`). Defaults to production. */
|
|
148
|
+
readonly realm?: string;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.js"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const Capability = {
|
|
2
|
+
/** List application keys. */
|
|
3
|
+
ListKeys: "listKeys",
|
|
4
|
+
/** Create new application keys. */
|
|
5
|
+
WriteKeys: "writeKeys",
|
|
6
|
+
/** Delete application keys. */
|
|
7
|
+
DeleteKeys: "deleteKeys",
|
|
8
|
+
/** List buckets (subject to key restrictions). */
|
|
9
|
+
ListBuckets: "listBuckets",
|
|
10
|
+
/** List bucket names without other metadata. */
|
|
11
|
+
ListAllBucketNames: "listAllBucketNames",
|
|
12
|
+
/** Read bucket settings. */
|
|
13
|
+
ReadBuckets: "readBuckets",
|
|
14
|
+
/** Create and update buckets. */
|
|
15
|
+
WriteBuckets: "writeBuckets",
|
|
16
|
+
/** Remove existing buckets from the account. */
|
|
17
|
+
DeleteBuckets: "deleteBuckets",
|
|
18
|
+
/** Read bucket-level Object Lock retention settings. */
|
|
19
|
+
ReadBucketRetentions: "readBucketRetentions",
|
|
20
|
+
/** Modify bucket-level Object Lock retention settings. */
|
|
21
|
+
WriteBucketRetentions: "writeBucketRetentions",
|
|
22
|
+
/** Read default bucket encryption settings. */
|
|
23
|
+
ReadBucketEncryption: "readBucketEncryption",
|
|
24
|
+
/** Modify default bucket encryption settings. */
|
|
25
|
+
WriteBucketEncryption: "writeBucketEncryption",
|
|
26
|
+
/** Read bucket replication configuration. */
|
|
27
|
+
ReadBucketReplications: "readBucketReplications",
|
|
28
|
+
/** Modify bucket replication configuration. */
|
|
29
|
+
WriteBucketReplications: "writeBucketReplications",
|
|
30
|
+
/** Read bucket event-notification rules. */
|
|
31
|
+
ReadBucketNotifications: "readBucketNotifications",
|
|
32
|
+
/** Modify bucket event-notification rules. */
|
|
33
|
+
WriteBucketNotifications: "writeBucketNotifications",
|
|
34
|
+
/** List file names and versions. */
|
|
35
|
+
ListFiles: "listFiles",
|
|
36
|
+
/** Download files. */
|
|
37
|
+
ReadFiles: "readFiles",
|
|
38
|
+
/** Mint download authorisation tokens. */
|
|
39
|
+
ShareFiles: "shareFiles",
|
|
40
|
+
/** Upload files. */
|
|
41
|
+
WriteFiles: "writeFiles",
|
|
42
|
+
/** Delete file versions. */
|
|
43
|
+
DeleteFiles: "deleteFiles",
|
|
44
|
+
/** Read per-file legal hold flags. */
|
|
45
|
+
ReadFileLegalHolds: "readFileLegalHolds",
|
|
46
|
+
/** Modify per-file legal hold flags. */
|
|
47
|
+
WriteFileLegalHolds: "writeFileLegalHolds",
|
|
48
|
+
/** Read per-file Object Lock retention settings. */
|
|
49
|
+
ReadFileRetentions: "readFileRetentions",
|
|
50
|
+
/** Modify per-file Object Lock retention settings. */
|
|
51
|
+
WriteFileRetentions: "writeFileRetentions",
|
|
52
|
+
/** Shorten governance-mode retention. */
|
|
53
|
+
BypassGovernance: "bypassGovernance"
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
Capability
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sources":["../../src/types/auth.ts"],"sourcesContent":["import type { AccountId, AuthToken, BucketId } from './ids.ts'\n\n/**\n * Named constants for the B2 API capabilities that can be granted to an\n * application key. Each capability controls access to a specific set of\n * API operations.\n *\n * Use these when constructing the `capabilities` array for an application\n * key request, or when checking required capabilities via\n * `B2Client.hasCapabilities`.\n *\n * @example\n * ```ts\n * const check = client.hasCapabilities([Capability.WriteFiles, Capability.ReadFiles])\n * if (!check.ok) throw new Error(`missing: ${check.missing.join(', ')}`)\n * ```\n */\nexport const Capability = {\n /** List application keys. */\n ListKeys: 'listKeys',\n /** Create new application keys. */\n WriteKeys: 'writeKeys',\n /** Delete application keys. */\n DeleteKeys: 'deleteKeys',\n /** List buckets (subject to key restrictions). */\n ListBuckets: 'listBuckets',\n /** List bucket names without other metadata. */\n ListAllBucketNames: 'listAllBucketNames',\n /** Read bucket settings. */\n ReadBuckets: 'readBuckets',\n /** Create and update buckets. */\n WriteBuckets: 'writeBuckets',\n /** Remove existing buckets from the account. */\n DeleteBuckets: 'deleteBuckets',\n /** Read bucket-level Object Lock retention settings. */\n ReadBucketRetentions: 'readBucketRetentions',\n /** Modify bucket-level Object Lock retention settings. */\n WriteBucketRetentions: 'writeBucketRetentions',\n /** Read default bucket encryption settings. */\n ReadBucketEncryption: 'readBucketEncryption',\n /** Modify default bucket encryption settings. */\n WriteBucketEncryption: 'writeBucketEncryption',\n /** Read bucket replication configuration. */\n ReadBucketReplications: 'readBucketReplications',\n /** Modify bucket replication configuration. */\n WriteBucketReplications: 'writeBucketReplications',\n /** Read bucket event-notification rules. */\n ReadBucketNotifications: 'readBucketNotifications',\n /** Modify bucket event-notification rules. */\n WriteBucketNotifications: 'writeBucketNotifications',\n /** List file names and versions. */\n ListFiles: 'listFiles',\n /** Download files. */\n ReadFiles: 'readFiles',\n /** Mint download authorisation tokens. */\n ShareFiles: 'shareFiles',\n /** Upload files. */\n WriteFiles: 'writeFiles',\n /** Delete file versions. */\n DeleteFiles: 'deleteFiles',\n /** Read per-file legal hold flags. */\n ReadFileLegalHolds: 'readFileLegalHolds',\n /** Modify per-file legal hold flags. */\n WriteFileLegalHolds: 'writeFileLegalHolds',\n /** Read per-file Object Lock retention settings. */\n ReadFileRetentions: 'readFileRetentions',\n /** Modify per-file Object Lock retention settings. */\n WriteFileRetentions: 'writeFileRetentions',\n /** Shorten governance-mode retention. */\n BypassGovernance: 'bypassGovernance',\n} as const\n\n/**\n * A B2 API capability that can be granted to an application key. Derived\n * from {@link Capability}.\n */\nexport type Capability = (typeof Capability)[keyof typeof Capability]\n\n/** Describes the capabilities and scope restrictions of an authorized application key. */\nexport interface AllowedInfo {\n /** List of capabilities granted to this key. */\n readonly capabilities: readonly Capability[]\n /** Bucket ID this key is restricted to, or null if unrestricted. */\n readonly bucketId: BucketId | null\n /** Bucket name this key is restricted to, or null if unrestricted. */\n readonly bucketName: string | null\n /** File name prefix this key is restricted to, or null if unrestricted. */\n readonly namePrefix: string | null\n}\n\n/** Configuration for the B2 Cloud Storage API returned during authorization. */\nexport interface StorageApiInfo {\n /** Minimum allowed part size for large file uploads, in bytes. */\n readonly absoluteMinimumPartSize: number\n /** Base URL for B2 API calls. */\n readonly apiUrl: string\n /** Bucket ID this key is restricted to, or null if unrestricted. */\n readonly bucketId: BucketId | null\n /** Bucket name this key is restricted to, or null if unrestricted. */\n readonly bucketName: string | null\n /** Base URL for file downloads. */\n readonly downloadUrl: string\n /** Discriminator indicating this is storage API info. Always `'storageApi'`. */\n readonly infoType: 'storageApi'\n /** File name prefix this key is restricted to, or null if unrestricted. */\n readonly namePrefix: string | null\n /** Recommended part size for large file uploads, in bytes. */\n readonly recommendedPartSize: number\n /** Base URL for the S3-compatible API. */\n readonly s3ApiUrl: string\n /** Capabilities and scope of the authorized key. */\n readonly allowed: AllowedInfo\n}\n\n/** Configuration for the B2 Groups API returned during authorization. */\nexport interface GroupsApiInfo {\n /** Base URL for Groups API calls. */\n readonly groupsApiUrl: string\n /** Discriminator indicating this is groups API info. Always `'groupsApi'`. */\n readonly infoType: 'groupsApi'\n}\n\n/** Container for all API-specific configuration returned by `b2_authorize_account`. */\nexport interface ApiInfo {\n /** Storage API configuration (always present). */\n readonly storageApi: StorageApiInfo\n /** Groups API configuration (present only when the account has groups enabled). */\n readonly groupsApi?: GroupsApiInfo\n}\n\n/**\n * Response from the `b2_authorize_account` API call.\n * Contains the authorization token and API endpoint URLs needed for subsequent requests.\n */\nexport interface AuthorizeAccountResponse {\n /** The account ID for the authorized account. */\n readonly accountId: AccountId\n /** Authorization token to use in subsequent API calls. */\n readonly authorizationToken: AuthToken\n /** API-specific configuration including endpoint URLs and key scope. */\n readonly apiInfo: ApiInfo\n /** Expiration timestamp of the application key in milliseconds, or null if the key does not expire. */\n readonly applicationKeyExpirationTimestamp: number | null\n}\n\n/**\n * Request parameters for the `b2_authorize_account` API call.\n * Credentials are sent via HTTP Basic auth in the raw API, but represented here as fields.\n */\nexport interface AuthorizeAccountRequest {\n /** The application key ID (account ID or app key ID). */\n readonly applicationKeyId: string\n /** The application key secret. */\n readonly applicationKey: string\n /** Optional realm override (e.g., `'production'`, `'staging'`). Defaults to production. */\n readonly realm?: string\n}\n"],"names":[],"mappings":"AAiBO,MAAM,aAAa;AAAA;AAAA,EAExB,UAAU;AAAA;AAAA,EAEV,WAAW;AAAA;AAAA,EAEX,YAAY;AAAA;AAAA,EAEZ,aAAa;AAAA;AAAA,EAEb,oBAAoB;AAAA;AAAA,EAEpB,aAAa;AAAA;AAAA,EAEb,cAAc;AAAA;AAAA,EAEd,eAAe;AAAA;AAAA,EAEf,sBAAsB;AAAA;AAAA,EAEtB,uBAAuB;AAAA;AAAA,EAEvB,sBAAsB;AAAA;AAAA,EAEtB,uBAAuB;AAAA;AAAA,EAEvB,wBAAwB;AAAA;AAAA,EAExB,yBAAyB;AAAA;AAAA,EAEzB,yBAAyB;AAAA;AAAA,EAEzB,0BAA0B;AAAA;AAAA,EAE1B,WAAW;AAAA;AAAA,EAEX,WAAW;AAAA;AAAA,EAEX,YAAY;AAAA;AAAA,EAEZ,YAAY;AAAA;AAAA,EAEZ,aAAa;AAAA;AAAA,EAEb,oBAAoB;AAAA;AAAA,EAEpB,qBAAqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA,EAEpB,qBAAqB;AAAA;AAAA,EAErB,kBAAkB;AACpB;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const BucketType = {
|
|
4
|
+
/** Publicly downloadable without authentication. */
|
|
5
|
+
AllPublic: "allPublic",
|
|
6
|
+
/** Requires a valid auth token to download. */
|
|
7
|
+
AllPrivate: "allPrivate",
|
|
8
|
+
/** Internal snapshot bucket type, generally not user-created. */
|
|
9
|
+
Snapshot: "snapshot",
|
|
10
|
+
/** B2-restricted bucket (e.g., for S3-compatible workflows). */
|
|
11
|
+
Restricted: "restricted"
|
|
12
|
+
};
|
|
13
|
+
const CorsOperation = {
|
|
14
|
+
/** Native B2 download-by-name request. */
|
|
15
|
+
B2DownloadFileByName: "b2_download_file_by_name",
|
|
16
|
+
/** Native B2 download-by-id request. */
|
|
17
|
+
B2DownloadFileById: "b2_download_file_by_id",
|
|
18
|
+
/** Native B2 small-file upload. */
|
|
19
|
+
B2UploadFile: "b2_upload_file",
|
|
20
|
+
/** Native B2 multipart-part upload. */
|
|
21
|
+
B2UploadPart: "b2_upload_part",
|
|
22
|
+
/** S3-compatible DELETE. */
|
|
23
|
+
S3Delete: "s3_delete",
|
|
24
|
+
/** S3-compatible GET. */
|
|
25
|
+
S3Get: "s3_get",
|
|
26
|
+
/** S3-compatible HEAD. */
|
|
27
|
+
S3Head: "s3_head",
|
|
28
|
+
/** S3-compatible POST. */
|
|
29
|
+
S3Post: "s3_post",
|
|
30
|
+
/** S3-compatible PUT. */
|
|
31
|
+
S3Put: "s3_put"
|
|
32
|
+
};
|
|
33
|
+
const BucketRetentionMode = {
|
|
34
|
+
/** Files cannot be deleted or modified during the retention period, even by the account owner. */
|
|
35
|
+
Compliance: "compliance",
|
|
36
|
+
/** Files cannot be deleted during retention except by callers with the `bypassGovernance` capability. */
|
|
37
|
+
Governance: "governance",
|
|
38
|
+
/** No default retention is applied to new uploads. */
|
|
39
|
+
None: "none"
|
|
40
|
+
};
|
|
41
|
+
exports.BucketRetentionMode = BucketRetentionMode;
|
|
42
|
+
exports.BucketType = BucketType;
|
|
43
|
+
exports.CorsOperation = CorsOperation;
|
|
44
|
+
//# sourceMappingURL=bucket.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bucket.cjs","sources":["../../src/types/bucket.ts"],"sourcesContent":["import type { EncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId } from './ids.ts'\nimport type { ReplicationConfiguration } from './replication.ts'\n\n/**\n * Named constants for the bucket access level.\n *\n * The {@link BucketType} type alias is derived from the values of this\n * object, so the const is the single source of truth: adding a key here\n * automatically widens the type union.\n *\n * @example\n * ```ts\n * await client.createBucket({ bucketName: 'my-app-logs', bucketType: BucketType.AllPrivate })\n * ```\n */\nexport const BucketType = {\n /** Publicly downloadable without authentication. */\n AllPublic: 'allPublic',\n /** Requires a valid auth token to download. */\n AllPrivate: 'allPrivate',\n /** Internal snapshot bucket type, generally not user-created. */\n Snapshot: 'snapshot',\n /** B2-restricted bucket (e.g., for S3-compatible workflows). */\n Restricted: 'restricted',\n} as const\n\n/** Access level for a B2 bucket. Derived from {@link BucketType}. */\nexport type BucketType = (typeof BucketType)[keyof typeof BucketType]\n\n/** Rule that automatically hides or deletes files after a specified number of days. */\nexport interface LifecycleRule {\n /** Days after hiding before automatic deletion, or null to never auto-delete hidden files. */\n readonly daysFromHidingToDeleting: number | null\n /** Days after upload before automatic hiding, or null to never auto-hide. */\n readonly daysFromUploadingToHiding: number | null\n /** File name prefix this rule applies to. Empty string matches all files. */\n readonly fileNamePrefix: string\n}\n\n/**\n * Named constants for the B2 + S3 operations a CORS rule can permit.\n *\n * @example\n * ```ts\n * await bucket.update({\n * corsRules: [{\n * corsRuleName: 'browser-downloads',\n * allowedOrigins: ['https://example.com'],\n * allowedOperations: [CorsOperation.B2DownloadFileByName, CorsOperation.S3Get],\n * allowedHeaders: null,\n * exposeHeaders: null,\n * maxAgeSeconds: 3600,\n * }],\n * })\n * ```\n */\nexport const CorsOperation = {\n /** Native B2 download-by-name request. */\n B2DownloadFileByName: 'b2_download_file_by_name',\n /** Native B2 download-by-id request. */\n B2DownloadFileById: 'b2_download_file_by_id',\n /** Native B2 small-file upload. */\n B2UploadFile: 'b2_upload_file',\n /** Native B2 multipart-part upload. */\n B2UploadPart: 'b2_upload_part',\n /** S3-compatible DELETE. */\n S3Delete: 's3_delete',\n /** S3-compatible GET. */\n S3Get: 's3_get',\n /** S3-compatible HEAD. */\n S3Head: 's3_head',\n /** S3-compatible POST. */\n S3Post: 's3_post',\n /** S3-compatible PUT. */\n S3Put: 's3_put',\n} as const\n\n/**\n * A B2 or S3 operation that a CORS rule can permit. Derived from\n * {@link CorsOperation}.\n */\nexport type CorsOperation = (typeof CorsOperation)[keyof typeof CorsOperation]\n\n/** Cross-Origin Resource Sharing (CORS) rule for browser-based access to a bucket. */\nexport interface CorsRule {\n /** Unique name identifying this CORS rule within the bucket. */\n readonly corsRuleName: string\n /** Origins allowed to make cross-origin requests (e.g., `'https://example.com'`). */\n readonly allowedOrigins: readonly string[]\n /** B2 and S3 operations permitted by this rule. */\n readonly allowedOperations: readonly CorsOperation[]\n /** Request headers allowed in preflight requests, or null if none are allowed. */\n readonly allowedHeaders: readonly string[] | null\n /** Response headers exposed to the browser, or null if none are exposed. */\n readonly exposeHeaders: readonly string[] | null\n /** Maximum time (in seconds) browsers may cache the preflight response. */\n readonly maxAgeSeconds: number\n}\n\n/**\n * Named constants for the bucket-level Object Lock retention mode.\n *\n * Pair with {@link BucketRetentionPolicy} when setting a bucket's default\n * retention: `{ mode: BucketRetentionMode.Compliance, period: { duration: 30, unit: 'days' } }`.\n */\nexport const BucketRetentionMode = {\n /** Files cannot be deleted or modified during the retention period, even by the account owner. */\n Compliance: 'compliance',\n /** Files cannot be deleted during retention except by callers with the `bypassGovernance` capability. */\n Governance: 'governance',\n /** No default retention is applied to new uploads. */\n None: 'none',\n} as const\n\n/** Bucket-level Object Lock retention mode. Derived from {@link BucketRetentionMode}. */\nexport type BucketRetentionMode = (typeof BucketRetentionMode)[keyof typeof BucketRetentionMode]\n\n/** Duration and unit for a retention period. */\nexport interface RetentionPeriod {\n /** Length of the retention period. */\n readonly duration: number\n /** Time unit for the retention period. */\n readonly unit: 'days' | 'years'\n}\n\n/** Default Object Lock retention policy applied to new files in a bucket. */\nexport interface BucketRetentionPolicy {\n /** Retention mode for the policy. */\n readonly mode: BucketRetentionMode\n /** Retention period, or null when mode is `'none'`. */\n readonly period: RetentionPeriod | null\n}\n\n/**\n * Complete bucket metadata as returned by the B2 API.\n * Corresponds to the bucket object in responses from `b2_list_buckets`, `b2_create_bucket`, and `b2_update_bucket`.\n */\nexport interface BucketInfo {\n /** Account that owns this bucket. */\n readonly accountId: AccountId\n /** Unique identifier for this bucket. */\n readonly bucketId: BucketId\n /** Globally unique name of this bucket. */\n readonly bucketName: string\n /** Access level of this bucket. */\n readonly bucketType: BucketType\n /** User-defined key-value metadata stored on the bucket. */\n readonly bucketInfo: Record<string, string>\n /** CORS rules configured on this bucket. */\n readonly corsRules: readonly CorsRule[]\n /** Default server-side encryption setting for new files in this bucket. */\n readonly defaultServerSideEncryption: EncryptionSetting\n /** File Lock configuration including authorization status and current settings. */\n readonly fileLockConfiguration: {\n /** Whether the caller is authorized to read file lock settings. */\n readonly isClientAuthorizedToRead: boolean\n /** File lock settings, or null if the caller lacks read authorization. */\n readonly value: {\n /** Whether Object Lock is enabled on this bucket. */\n readonly isFileLockEnabled: boolean\n /** Default retention policy for newly uploaded files. */\n readonly defaultRetention: BucketRetentionPolicy\n } | null\n }\n /** Lifecycle rules configured on this bucket. */\n readonly lifecycleRules: readonly LifecycleRule[]\n /** Set of options enabled on this bucket (e.g., `'s3'`). */\n readonly options: readonly string[]\n /** Monotonically increasing revision number, incremented on each bucket update. */\n readonly revision: number\n /** Default retention policy for newly uploaded files. */\n readonly defaultRetention: BucketRetentionPolicy\n /** Cross-region replication configuration for this bucket. */\n readonly replicationConfiguration: ReplicationConfiguration\n}\n\n/**\n * Request parameters for the `b2_create_bucket` API call.\n */\nexport interface CreateBucketRequest {\n /** Account that will own the new bucket. */\n readonly accountId: AccountId\n /** Globally unique name for the bucket. */\n readonly bucketName: string\n /** Access level for the bucket. */\n readonly bucketType: BucketType\n /** Optional user-defined key-value metadata. */\n readonly bucketInfo?: Record<string, string>\n /** Optional CORS rules. */\n readonly corsRules?: readonly CorsRule[]\n /** Optional default server-side encryption setting. */\n readonly defaultServerSideEncryption?: EncryptionSetting\n /** Optional default Object Lock retention policy. */\n readonly defaultRetention?: BucketRetentionPolicy\n /** Whether to enable Object Lock on the bucket. Cannot be changed after creation. */\n readonly fileLockEnabled?: boolean\n /** Optional lifecycle rules. */\n readonly lifecycleRules?: readonly LifecycleRule[]\n /** Optional replication configuration. */\n readonly replicationConfiguration?: ReplicationConfiguration\n}\n\n/**\n * Request parameters for the `b2_update_bucket` API call.\n */\nexport interface UpdateBucketRequest {\n /** Account that owns the bucket. */\n readonly accountId: AccountId\n /** ID of the bucket to update. */\n readonly bucketId: BucketId\n /** New access level for the bucket. */\n readonly bucketType?: BucketType\n /** Updated user-defined key-value metadata. Replaces all existing metadata. */\n readonly bucketInfo?: Record<string, string>\n /** Updated CORS rules. Replaces all existing rules. */\n readonly corsRules?: readonly CorsRule[]\n /** Updated default server-side encryption setting. */\n readonly defaultServerSideEncryption?: EncryptionSetting\n /** Updated default Object Lock retention policy. */\n readonly defaultRetention?: BucketRetentionPolicy\n /** Whether to enable Object Lock. Can only transition from disabled to enabled. */\n readonly fileLockEnabled?: boolean\n /** Updated lifecycle rules. Replaces all existing rules. */\n readonly lifecycleRules?: readonly LifecycleRule[]\n /** Updated replication configuration. */\n readonly replicationConfiguration?: ReplicationConfiguration\n /** Optimistic locking: only update if the bucket's current revision matches this value. */\n readonly ifRevisionIs?: number\n}\n\n/**\n * Request parameters for the `b2_list_buckets` API call.\n */\nexport interface ListBucketsRequest {\n /** Account whose buckets to list. */\n readonly accountId: AccountId\n /** Optional filter to return only the bucket with this ID. */\n readonly bucketId?: BucketId\n /** Optional filter to return only the bucket with this name. */\n readonly bucketName?: string\n /** Optional filter to return only buckets of these types. */\n readonly bucketTypes?: readonly BucketType[]\n}\n\n/** Response from the `b2_list_buckets` API call. */\nexport interface ListBucketsResponse {\n /** Array of buckets matching the request filters. */\n readonly buckets: readonly BucketInfo[]\n}\n\n/**\n * Request parameters for the `b2_delete_bucket` API call.\n */\nexport interface DeleteBucketRequest {\n /** Account that owns the bucket. */\n readonly accountId: AccountId\n /** ID of the bucket to delete. The bucket must be empty. */\n readonly bucketId: BucketId\n}\n"],"names":[],"mappings":";;AAgBO,MAAM,aAAa;AAAA;AAAA,EAExB,WAAW;AAAA;AAAA,EAEX,YAAY;AAAA;AAAA,EAEZ,UAAU;AAAA;AAAA,EAEV,YAAY;AACd;AAgCO,MAAM,gBAAgB;AAAA;AAAA,EAE3B,sBAAsB;AAAA;AAAA,EAEtB,oBAAoB;AAAA;AAAA,EAEpB,cAAc;AAAA;AAAA,EAEd,cAAc;AAAA;AAAA,EAEd,UAAU;AAAA;AAAA,EAEV,OAAO;AAAA;AAAA,EAEP,QAAQ;AAAA;AAAA,EAER,QAAQ;AAAA;AAAA,EAER,OAAO;AACT;AA8BO,MAAM,sBAAsB;AAAA;AAAA,EAEjC,YAAY;AAAA;AAAA,EAEZ,YAAY;AAAA;AAAA,EAEZ,MAAM;AACR;;;;"}
|