@backblaze-labs/b2-sdk 0.1.0 → 0.2.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 +110 -5
- package/README.md +144 -33
- package/dist/_virtual/_b2-sdk-version-json.cjs +4 -0
- package/dist/_virtual/_b2-sdk-version-json.js +4 -0
- package/dist/auth/account-info.d.cts +32 -0
- package/dist/auth/account-info.d.cts.map +1 -1
- package/dist/auth/account-info.d.ts +32 -0
- package/dist/auth/account-info.d.ts.map +1 -1
- package/dist/auth/file.cjs +408 -207
- package/dist/auth/file.cjs.map +1 -1
- package/dist/auth/file.d.cts +77 -3
- package/dist/auth/file.d.cts.map +1 -1
- package/dist/auth/file.d.ts +77 -3
- package/dist/auth/file.d.ts.map +1 -1
- package/dist/auth/file.js +407 -207
- package/dist/auth/file.js.map +1 -1
- package/dist/auth/in-memory.cjs +212 -183
- package/dist/auth/in-memory.cjs.map +1 -1
- package/dist/auth/in-memory.d.cts +8 -0
- package/dist/auth/in-memory.d.cts.map +1 -1
- package/dist/auth/in-memory.d.ts +8 -0
- package/dist/auth/in-memory.d.ts.map +1 -1
- package/dist/auth/in-memory.js +211 -182
- package/dist/auth/in-memory.js.map +1 -1
- package/dist/auth/index.cjs +7 -9
- package/dist/auth/index.d.cts +3 -2
- package/dist/auth/index.d.cts.map +1 -1
- package/dist/auth/index.d.ts +3 -2
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -8
- package/dist/auth/realms.cjs +80 -7
- package/dist/auth/realms.cjs.map +1 -1
- package/dist/auth/realms.d.cts +27 -4
- package/dist/auth/realms.d.cts.map +1 -1
- package/dist/auth/realms.d.ts +27 -4
- package/dist/auth/realms.d.ts.map +1 -1
- package/dist/auth/realms.js +80 -9
- package/dist/auth/realms.js.map +1 -1
- package/dist/auth/upload-url-pool.cjs +55 -51
- package/dist/auth/upload-url-pool.cjs.map +1 -1
- package/dist/auth/upload-url-pool.js +55 -51
- package/dist/auth/upload-url-pool.js.map +1 -1
- package/dist/bucket.cjs +785 -787
- package/dist/bucket.cjs.map +1 -1
- package/dist/bucket.d.cts +35 -47
- package/dist/bucket.d.cts.map +1 -1
- package/dist/bucket.d.ts +35 -47
- package/dist/bucket.d.ts.map +1 -1
- package/dist/bucket.js +780 -782
- package/dist/bucket.js.map +1 -1
- package/dist/client.cjs +246 -228
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +25 -17
- package/dist/client.d.cts.map +1 -1
- package/dist/client.d.ts +25 -17
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +243 -225
- package/dist/client.js.map +1 -1
- package/dist/copy/large.cjs +114 -71
- package/dist/copy/large.cjs.map +1 -1
- package/dist/copy/large.d.cts +6 -0
- package/dist/copy/large.d.cts.map +1 -1
- package/dist/copy/large.d.ts +6 -0
- package/dist/copy/large.d.ts.map +1 -1
- package/dist/copy/large.js +112 -69
- package/dist/copy/large.js.map +1 -1
- package/dist/download/checksum.cjs +89 -0
- package/dist/download/checksum.cjs.map +1 -0
- package/dist/download/checksum.d.cts +40 -0
- package/dist/download/checksum.d.cts.map +1 -0
- package/dist/download/checksum.d.ts +40 -0
- package/dist/download/checksum.d.ts.map +1 -0
- package/dist/download/checksum.js +87 -0
- package/dist/download/checksum.js.map +1 -0
- package/dist/download/parallel.cjs +214 -118
- package/dist/download/parallel.cjs.map +1 -1
- package/dist/download/parallel.d.cts +5 -1
- package/dist/download/parallel.d.cts.map +1 -1
- package/dist/download/parallel.d.ts +5 -1
- package/dist/download/parallel.d.ts.map +1 -1
- package/dist/download/parallel.js +212 -116
- package/dist/download/parallel.js.map +1 -1
- package/dist/download/single.cjs +188 -97
- package/dist/download/single.cjs.map +1 -1
- package/dist/download/single.d.cts +6 -1
- package/dist/download/single.d.cts.map +1 -1
- package/dist/download/single.d.ts +6 -1
- package/dist/download/single.d.ts.map +1 -1
- package/dist/download/single.js +186 -98
- package/dist/download/single.js.map +1 -1
- package/dist/errors/index.cjs +699 -243
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts +285 -82
- package/dist/errors/index.d.cts.map +1 -1
- package/dist/errors/index.d.ts +285 -82
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +678 -261
- package/dist/errors/index.js.map +1 -1
- package/dist/http/retry.cjs +45 -28
- package/dist/http/retry.cjs.map +1 -1
- package/dist/http/retry.d.cts +15 -2
- package/dist/http/retry.d.cts.map +1 -1
- package/dist/http/retry.d.ts +15 -2
- package/dist/http/retry.d.ts.map +1 -1
- package/dist/http/retry.js +46 -31
- package/dist/http/retry.js.map +1 -1
- package/dist/http/transport.cjs +438 -140
- package/dist/http/transport.cjs.map +1 -1
- package/dist/http/transport.d.cts +21 -2
- package/dist/http/transport.d.cts.map +1 -1
- package/dist/http/transport.d.ts +21 -2
- package/dist/http/transport.d.ts.map +1 -1
- package/dist/http/transport.js +437 -140
- package/dist/http/transport.js.map +1 -1
- package/dist/http/url-guard.cjs +154 -89
- package/dist/http/url-guard.cjs.map +1 -1
- package/dist/http/url-guard.d.cts +25 -3
- package/dist/http/url-guard.d.cts.map +1 -1
- package/dist/http/url-guard.d.ts +25 -3
- package/dist/http/url-guard.d.ts.map +1 -1
- package/dist/http/url-guard.js +152 -90
- package/dist/http/url-guard.js.map +1 -1
- package/dist/http/user-agent.cjs +84 -44
- package/dist/http/user-agent.cjs.map +1 -1
- package/dist/http/user-agent.js +84 -46
- package/dist/http/user-agent.js.map +1 -1
- package/dist/index.cjs +101 -77
- package/dist/index.d.cts +27 -21
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +27 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -71
- package/dist/internal/b2-naming.cjs +66 -0
- package/dist/internal/b2-naming.cjs.map +1 -0
- package/dist/internal/b2-naming.d.cts +43 -0
- package/dist/internal/b2-naming.d.cts.map +1 -0
- package/dist/internal/b2-naming.d.ts +43 -0
- package/dist/internal/b2-naming.d.ts.map +1 -0
- package/dist/internal/b2-naming.js +60 -0
- package/dist/internal/b2-naming.js.map +1 -0
- package/dist/internal/upload-retry-options.cjs +21 -0
- package/dist/internal/upload-retry-options.cjs.map +1 -0
- package/dist/internal/upload-retry-options.d.cts +12 -0
- package/dist/internal/upload-retry-options.d.cts.map +1 -0
- package/dist/internal/upload-retry-options.d.ts +12 -0
- package/dist/internal/upload-retry-options.d.ts.map +1 -0
- package/dist/internal/upload-retry-options.js +21 -0
- package/dist/internal/upload-retry-options.js.map +1 -0
- package/dist/internal/url-redaction.cjs +31 -0
- package/dist/internal/url-redaction.cjs.map +1 -0
- package/dist/internal/url-redaction.d.cts +17 -0
- package/dist/internal/url-redaction.d.cts.map +1 -0
- package/dist/internal/url-redaction.d.ts +17 -0
- package/dist/internal/url-redaction.d.ts.map +1 -0
- package/dist/internal/url-redaction.js +31 -0
- package/dist/internal/url-redaction.js.map +1 -0
- package/dist/notifications/index.cjs +4 -6
- package/dist/notifications/index.d.cts +1 -1
- package/dist/notifications/index.d.cts.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +1 -6
- package/dist/notifications/webhook.cjs +195 -85
- package/dist/notifications/webhook.cjs.map +1 -1
- package/dist/notifications/webhook.d.cts.map +1 -1
- package/dist/notifications/webhook.d.ts.map +1 -1
- package/dist/notifications/webhook.js +195 -87
- package/dist/notifications/webhook.js.map +1 -1
- package/dist/object.cjs +253 -210
- package/dist/object.cjs.map +1 -1
- package/dist/object.d.cts +9 -55
- package/dist/object.d.cts.map +1 -1
- package/dist/object.d.ts +9 -55
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +249 -206
- package/dist/object.js.map +1 -1
- package/dist/raw/encoding.cjs +74 -35
- package/dist/raw/encoding.cjs.map +1 -1
- package/dist/raw/encoding.js +74 -38
- package/dist/raw/encoding.js.map +1 -1
- package/dist/raw/index.cjs +678 -587
- package/dist/raw/index.cjs.map +1 -1
- package/dist/raw/index.d.cts +121 -18
- package/dist/raw/index.d.cts.map +1 -1
- package/dist/raw/index.d.ts +121 -18
- package/dist/raw/index.d.ts.map +1 -1
- package/dist/raw/index.js +674 -589
- package/dist/raw/index.js.map +1 -1
- package/dist/s3/index.cjs +355 -18
- package/dist/s3/index.cjs.map +1 -1
- package/dist/s3/index.d.cts +233 -5
- package/dist/s3/index.d.cts.map +1 -1
- package/dist/s3/index.d.ts +233 -5
- package/dist/s3/index.d.ts.map +1 -1
- package/dist/s3/index.js +351 -22
- package/dist/s3/index.js.map +1 -1
- package/dist/s3/sigv4.cjs +149 -0
- package/dist/s3/sigv4.cjs.map +1 -0
- package/dist/s3/sigv4.d.cts +43 -0
- package/dist/s3/sigv4.d.cts.map +1 -0
- package/dist/s3/sigv4.d.ts +43 -0
- package/dist/s3/sigv4.d.ts.map +1 -0
- package/dist/s3/sigv4.js +148 -0
- package/dist/s3/sigv4.js.map +1 -0
- package/dist/s3/validation.cjs +69 -0
- package/dist/s3/validation.cjs.map +1 -0
- package/dist/s3/validation.d.cts +43 -0
- package/dist/s3/validation.d.cts.map +1 -0
- package/dist/s3/validation.d.ts +43 -0
- package/dist/s3/validation.d.ts.map +1 -0
- package/dist/s3/validation.js +66 -0
- package/dist/s3/validation.js.map +1 -0
- package/dist/simulator/capabilities.cjs +63 -48
- package/dist/simulator/capabilities.cjs.map +1 -1
- package/dist/simulator/capabilities.js +63 -49
- package/dist/simulator/capabilities.js.map +1 -1
- package/dist/simulator/index.cjs +2124 -1548
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.d.cts +79 -11
- package/dist/simulator/index.d.cts.map +1 -1
- package/dist/simulator/index.d.ts +79 -11
- package/dist/simulator/index.d.ts.map +1 -1
- package/dist/simulator/index.js +2112 -1546
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/validation.cjs +191 -153
- package/dist/simulator/validation.cjs.map +1 -1
- package/dist/simulator/validation.d.cts +3 -21
- package/dist/simulator/validation.d.cts.map +1 -1
- package/dist/simulator/validation.d.ts +3 -21
- package/dist/simulator/validation.d.ts.map +1 -1
- package/dist/simulator/validation.js +188 -162
- package/dist/simulator/validation.js.map +1 -1
- package/dist/streams/collect.cjs +74 -24
- package/dist/streams/collect.cjs.map +1 -1
- package/dist/streams/collect.d.cts +14 -1
- package/dist/streams/collect.d.cts.map +1 -1
- package/dist/streams/collect.d.ts +14 -1
- package/dist/streams/collect.d.ts.map +1 -1
- package/dist/streams/collect.js +74 -25
- package/dist/streams/collect.js.map +1 -1
- package/dist/streams/file-source.cjs +287 -0
- package/dist/streams/file-source.cjs.map +1 -0
- package/dist/streams/file-source.d.cts +96 -0
- package/dist/streams/file-source.d.cts.map +1 -0
- package/dist/streams/file-source.d.ts +96 -0
- package/dist/streams/file-source.d.ts.map +1 -0
- package/dist/streams/file-source.js +286 -0
- package/dist/streams/file-source.js.map +1 -0
- package/dist/streams/hash.cjs +207 -115
- package/dist/streams/hash.cjs.map +1 -1
- package/dist/streams/hash.d.cts +5 -4
- package/dist/streams/hash.d.cts.map +1 -1
- package/dist/streams/hash.d.ts +5 -4
- package/dist/streams/hash.d.ts.map +1 -1
- package/dist/streams/hash.js +208 -95
- package/dist/streams/hash.js.map +1 -1
- package/dist/streams/index.cjs +12 -12
- package/dist/streams/index.d.cts +3 -3
- package/dist/streams/index.d.cts.map +1 -1
- package/dist/streams/index.d.ts +3 -3
- package/dist/streams/index.d.ts.map +1 -1
- package/dist/streams/index.js +2 -10
- package/dist/streams/progress.cjs +60 -46
- package/dist/streams/progress.cjs.map +1 -1
- package/dist/streams/progress.js +60 -46
- package/dist/streams/progress.js.map +1 -1
- package/dist/streams/source.cjs +316 -146
- package/dist/streams/source.cjs.map +1 -1
- package/dist/streams/source.d.cts +56 -18
- package/dist/streams/source.d.cts.map +1 -1
- package/dist/streams/source.d.ts +56 -18
- package/dist/streams/source.d.ts.map +1 -1
- package/dist/streams/source.js +312 -149
- package/dist/streams/source.js.map +1 -1
- package/dist/sync/actions/index.cjs +236 -184
- package/dist/sync/actions/index.cjs.map +1 -1
- package/dist/sync/actions/index.d.cts +29 -21
- package/dist/sync/actions/index.d.cts.map +1 -1
- package/dist/sync/actions/index.d.ts +29 -21
- package/dist/sync/actions/index.d.ts.map +1 -1
- package/dist/sync/actions/index.js +236 -190
- package/dist/sync/actions/index.js.map +1 -1
- package/dist/sync/b2-sha1-reader.cjs +148 -0
- package/dist/sync/b2-sha1-reader.cjs.map +1 -0
- package/dist/sync/b2-sha1-reader.d.cts +58 -0
- package/dist/sync/b2-sha1-reader.d.cts.map +1 -0
- package/dist/sync/b2-sha1-reader.d.ts +58 -0
- package/dist/sync/b2-sha1-reader.d.ts.map +1 -0
- package/dist/sync/b2-sha1-reader.js +145 -0
- package/dist/sync/b2-sha1-reader.js.map +1 -0
- package/dist/sync/download-staging.cjs +265 -0
- package/dist/sync/download-staging.cjs.map +1 -0
- package/dist/sync/download-staging.d.cts +54 -0
- package/dist/sync/download-staging.d.cts.map +1 -0
- package/dist/sync/download-staging.d.ts +54 -0
- package/dist/sync/download-staging.d.ts.map +1 -0
- package/dist/sync/download-staging.js +259 -0
- package/dist/sync/download-staging.js.map +1 -0
- package/dist/sync/filesystem-errors.cjs +32 -0
- package/dist/sync/filesystem-errors.cjs.map +1 -0
- package/dist/sync/filesystem-errors.d.cts +8 -0
- package/dist/sync/filesystem-errors.d.cts.map +1 -0
- package/dist/sync/filesystem-errors.d.ts +8 -0
- package/dist/sync/filesystem-errors.d.ts.map +1 -0
- package/dist/sync/filesystem-errors.js +32 -0
- package/dist/sync/filesystem-errors.js.map +1 -0
- package/dist/sync/filters.cjs +217 -0
- package/dist/sync/filters.cjs.map +1 -0
- package/dist/sync/filters.d.cts +51 -0
- package/dist/sync/filters.d.cts.map +1 -0
- package/dist/sync/filters.d.ts +51 -0
- package/dist/sync/filters.d.ts.map +1 -0
- package/dist/sync/filters.js +213 -0
- package/dist/sync/filters.js.map +1 -0
- package/dist/sync/index.cjs +39 -22
- package/dist/sync/index.d.cts +14 -9
- package/dist/sync/index.d.cts.map +1 -1
- package/dist/sync/index.d.ts +14 -9
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +9 -20
- package/dist/sync/local-file-identity.cjs +61 -0
- package/dist/sync/local-file-identity.cjs.map +1 -0
- package/dist/sync/local-file-identity.d.cts +37 -0
- package/dist/sync/local-file-identity.d.cts.map +1 -0
- package/dist/sync/local-file-identity.d.ts +37 -0
- package/dist/sync/local-file-identity.d.ts.map +1 -0
- package/dist/sync/local-file-identity.js +60 -0
- package/dist/sync/local-file-identity.js.map +1 -0
- package/dist/sync/local-file-io.cjs +364 -0
- package/dist/sync/local-file-io.cjs.map +1 -0
- package/dist/sync/local-file-io.d.cts +75 -0
- package/dist/sync/local-file-io.d.cts.map +1 -0
- package/dist/sync/local-file-io.d.ts +75 -0
- package/dist/sync/local-file-io.d.ts.map +1 -0
- package/dist/sync/local-file-io.js +360 -0
- package/dist/sync/local-file-io.js.map +1 -0
- package/dist/sync/local-filesystem-root.cjs +27 -0
- package/dist/sync/local-filesystem-root.cjs.map +1 -0
- package/dist/sync/local-filesystem-root.d.cts +18 -0
- package/dist/sync/local-filesystem-root.d.cts.map +1 -0
- package/dist/sync/local-filesystem-root.d.ts +18 -0
- package/dist/sync/local-filesystem-root.d.ts.map +1 -0
- package/dist/sync/local-filesystem-root.js +26 -0
- package/dist/sync/local-filesystem-root.js.map +1 -0
- package/dist/sync/local-sha1.cjs +119 -0
- package/dist/sync/local-sha1.cjs.map +1 -0
- package/dist/sync/local-sha1.d.cts +39 -0
- package/dist/sync/local-sha1.d.cts.map +1 -0
- package/dist/sync/local-sha1.d.ts +39 -0
- package/dist/sync/local-sha1.d.ts.map +1 -0
- package/dist/sync/local-sha1.js +117 -0
- package/dist/sync/local-sha1.js.map +1 -0
- package/dist/sync/pairing.cjs +118 -29
- package/dist/sync/pairing.cjs.map +1 -1
- package/dist/sync/pairing.d.cts +7 -2
- package/dist/sync/pairing.d.cts.map +1 -1
- package/dist/sync/pairing.d.ts +7 -2
- package/dist/sync/pairing.d.ts.map +1 -1
- package/dist/sync/pairing.js +120 -31
- package/dist/sync/pairing.js.map +1 -1
- package/dist/sync/path-order.cjs +30 -0
- package/dist/sync/path-order.cjs.map +1 -0
- package/dist/sync/path-order.d.cts +28 -0
- package/dist/sync/path-order.d.cts.map +1 -0
- package/dist/sync/path-order.d.ts +28 -0
- package/dist/sync/path-order.d.ts.map +1 -0
- package/dist/sync/path-order.js +29 -0
- package/dist/sync/path-order.js.map +1 -0
- package/dist/sync/path-safety.cjs +111 -0
- package/dist/sync/path-safety.cjs.map +1 -0
- package/dist/sync/path-safety.d.cts +78 -0
- package/dist/sync/path-safety.d.cts.map +1 -0
- package/dist/sync/path-safety.d.ts +78 -0
- package/dist/sync/path-safety.d.ts.map +1 -0
- package/dist/sync/path-safety.js +105 -0
- package/dist/sync/path-safety.js.map +1 -0
- package/dist/sync/paths.d.cts +19 -0
- package/dist/sync/paths.d.cts.map +1 -0
- package/dist/sync/paths.d.ts +19 -0
- package/dist/sync/paths.d.ts.map +1 -0
- package/dist/sync/policies/compare.cjs +389 -11
- package/dist/sync/policies/compare.cjs.map +1 -1
- package/dist/sync/policies/compare.d.cts +100 -2
- package/dist/sync/policies/compare.d.cts.map +1 -1
- package/dist/sync/policies/compare.d.ts +100 -2
- package/dist/sync/policies/compare.d.ts.map +1 -1
- package/dist/sync/policies/compare.js +387 -13
- package/dist/sync/policies/compare.js.map +1 -1
- package/dist/sync/policies/index.cjs +76 -65
- package/dist/sync/policies/index.cjs.map +1 -1
- package/dist/sync/policies/index.d.cts +35 -6
- package/dist/sync/policies/index.d.cts.map +1 -1
- package/dist/sync/policies/index.d.ts +35 -6
- package/dist/sync/policies/index.d.ts.map +1 -1
- package/dist/sync/policies/index.js +76 -65
- package/dist/sync/policies/index.js.map +1 -1
- package/dist/sync/prefix.cjs +96 -0
- package/dist/sync/prefix.cjs.map +1 -0
- package/dist/sync/prefix.d.cts +55 -0
- package/dist/sync/prefix.d.cts.map +1 -0
- package/dist/sync/prefix.d.ts +55 -0
- package/dist/sync/prefix.d.ts.map +1 -0
- package/dist/sync/prefix.js +92 -0
- package/dist/sync/prefix.js.map +1 -0
- package/dist/sync/regexp-safety.cjs +192 -0
- package/dist/sync/regexp-safety.cjs.map +1 -0
- package/dist/sync/regexp-safety.d.cts +29 -0
- package/dist/sync/regexp-safety.d.cts.map +1 -0
- package/dist/sync/regexp-safety.d.ts +29 -0
- package/dist/sync/regexp-safety.d.ts.map +1 -0
- package/dist/sync/regexp-safety.js +190 -0
- package/dist/sync/regexp-safety.js.map +1 -0
- package/dist/sync/scan-events.cjs +33 -0
- package/dist/sync/scan-events.cjs.map +1 -0
- package/dist/sync/scan-events.d.cts +17 -0
- package/dist/sync/scan-events.d.cts.map +1 -0
- package/dist/sync/scan-events.d.ts +17 -0
- package/dist/sync/scan-events.d.ts.map +1 -0
- package/dist/sync/scan-events.js +32 -0
- package/dist/sync/scan-events.js.map +1 -0
- package/dist/sync/scan-limit.cjs +33 -0
- package/dist/sync/scan-limit.cjs.map +1 -0
- package/dist/sync/scan-limit.d.cts +21 -0
- package/dist/sync/scan-limit.d.cts.map +1 -0
- package/dist/sync/scan-limit.d.ts +21 -0
- package/dist/sync/scan-limit.d.ts.map +1 -0
- package/dist/sync/scan-limit.js +31 -0
- package/dist/sync/scan-limit.js.map +1 -0
- package/dist/sync/scanners/b2.cjs +239 -55
- package/dist/sync/scanners/b2.cjs.map +1 -1
- package/dist/sync/scanners/b2.d.cts +26 -7
- package/dist/sync/scanners/b2.d.cts.map +1 -1
- package/dist/sync/scanners/b2.d.ts +26 -7
- package/dist/sync/scanners/b2.d.ts.map +1 -1
- package/dist/sync/scanners/b2.js +239 -55
- package/dist/sync/scanners/b2.js.map +1 -1
- package/dist/sync/scanners/local.cjs +215 -56
- package/dist/sync/scanners/local.cjs.map +1 -1
- package/dist/sync/scanners/local.d.cts +22 -7
- package/dist/sync/scanners/local.d.cts.map +1 -1
- package/dist/sync/scanners/local.d.ts +22 -7
- package/dist/sync/scanners/local.d.ts.map +1 -1
- package/dist/sync/scanners/local.js +216 -57
- package/dist/sync/scanners/local.js.map +1 -1
- package/dist/sync/sha1-metadata.cjs +94 -0
- package/dist/sync/sha1-metadata.cjs.map +1 -0
- package/dist/sync/sha1-metadata.d.cts +82 -0
- package/dist/sync/sha1-metadata.d.cts.map +1 -0
- package/dist/sync/sha1-metadata.d.ts +82 -0
- package/dist/sync/sha1-metadata.d.ts.map +1 -0
- package/dist/sync/sha1-metadata.js +89 -0
- package/dist/sync/sha1-metadata.js.map +1 -0
- package/dist/sync/sha1-options.cjs +23 -0
- package/dist/sync/sha1-options.cjs.map +1 -0
- package/dist/sync/sha1-options.d.cts +14 -0
- package/dist/sync/sha1-options.d.cts.map +1 -0
- package/dist/sync/sha1-options.d.ts +14 -0
- package/dist/sync/sha1-options.d.ts.map +1 -0
- package/dist/sync/sha1-options.js +21 -0
- package/dist/sync/sha1-options.js.map +1 -0
- package/dist/sync/synchronizer.cjs +782 -197
- package/dist/sync/synchronizer.cjs.map +1 -1
- package/dist/sync/synchronizer.d.cts +47 -1
- package/dist/sync/synchronizer.d.cts.map +1 -1
- package/dist/sync/synchronizer.d.ts +47 -1
- package/dist/sync/synchronizer.d.ts.map +1 -1
- package/dist/sync/synchronizer.js +779 -173
- package/dist/sync/synchronizer.js.map +1 -1
- package/dist/sync/types.d.cts +208 -16
- package/dist/sync/types.d.cts.map +1 -1
- package/dist/sync/types.d.ts +208 -16
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/types/auth.cjs +76 -56
- package/dist/types/auth.cjs.map +1 -1
- package/dist/types/auth.d.cts +67 -9
- package/dist/types/auth.d.cts.map +1 -1
- package/dist/types/auth.d.ts +67 -9
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/auth.js +77 -57
- package/dist/types/auth.js.map +1 -1
- package/dist/types/bucket.cjs +74 -38
- package/dist/types/bucket.cjs.map +1 -1
- package/dist/types/bucket.js +75 -41
- package/dist/types/bucket.js.map +1 -1
- package/dist/types/encryption.cjs +364 -327
- package/dist/types/encryption.cjs.map +1 -1
- package/dist/types/encryption.d.cts +16 -0
- package/dist/types/encryption.d.cts.map +1 -1
- package/dist/types/encryption.d.ts +16 -0
- package/dist/types/encryption.d.ts.map +1 -1
- package/dist/types/encryption.js +364 -310
- package/dist/types/encryption.js.map +1 -1
- package/dist/types/errors.cjs +47 -0
- package/dist/types/errors.cjs.map +1 -0
- package/dist/types/errors.d.cts +13 -4
- package/dist/types/errors.d.cts.map +1 -1
- package/dist/types/errors.d.ts +13 -4
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +47 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/file.cjs +36 -19
- package/dist/types/file.cjs.map +1 -1
- package/dist/types/file.d.cts +2 -2
- package/dist/types/file.d.cts.map +1 -1
- package/dist/types/file.d.ts +2 -2
- package/dist/types/file.d.ts.map +1 -1
- package/dist/types/file.js +37 -21
- package/dist/types/file.js.map +1 -1
- package/dist/types/ids.cjs +53 -9
- package/dist/types/ids.cjs.map +1 -1
- package/dist/types/ids.js +54 -15
- package/dist/types/ids.js.map +1 -1
- package/dist/types/index.d.cts +12 -11
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +12 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/key.d.cts +44 -8
- package/dist/types/key.d.cts.map +1 -1
- package/dist/types/key.d.ts +44 -8
- package/dist/types/key.d.ts.map +1 -1
- package/dist/types/lock.cjs +33 -13
- package/dist/types/lock.cjs.map +1 -1
- package/dist/types/lock.js +34 -15
- package/dist/types/lock.js.map +1 -1
- package/dist/types/notifications.cjs +44 -22
- package/dist/types/notifications.cjs.map +1 -1
- package/dist/types/notifications.js +45 -23
- package/dist/types/notifications.js.map +1 -1
- package/dist/types/upload.d.cts +39 -5
- package/dist/types/upload.d.cts.map +1 -1
- package/dist/types/upload.d.ts +39 -5
- package/dist/types/upload.d.ts.map +1 -1
- package/dist/upload/abort-scope.cjs +91 -0
- package/dist/upload/abort-scope.cjs.map +1 -0
- package/dist/upload/abort-scope.d.cts +48 -0
- package/dist/upload/abort-scope.d.cts.map +1 -0
- package/dist/upload/abort-scope.d.ts +48 -0
- package/dist/upload/abort-scope.d.ts.map +1 -0
- package/dist/upload/abort-scope.js +88 -0
- package/dist/upload/abort-scope.js.map +1 -0
- package/dist/upload/cancel.cjs +183 -8
- package/dist/upload/cancel.cjs.map +1 -1
- package/dist/upload/cancel.d.cts +110 -2
- package/dist/upload/cancel.d.cts.map +1 -1
- package/dist/upload/cancel.d.ts +110 -2
- package/dist/upload/cancel.d.ts.map +1 -1
- package/dist/upload/cancel.js +178 -9
- package/dist/upload/cancel.js.map +1 -1
- package/dist/upload/concurrency.cjs +79 -52
- package/dist/upload/concurrency.cjs.map +1 -1
- package/dist/upload/concurrency.js +79 -53
- package/dist/upload/concurrency.js.map +1 -1
- package/dist/upload/finish.cjs +59 -0
- package/dist/upload/finish.cjs.map +1 -0
- package/dist/upload/finish.d.cts +26 -0
- package/dist/upload/finish.d.cts.map +1 -0
- package/dist/upload/finish.d.ts +26 -0
- package/dist/upload/finish.d.ts.map +1 -0
- package/dist/upload/finish.js +59 -0
- package/dist/upload/finish.js.map +1 -0
- package/dist/upload/large.cjs +301 -218
- package/dist/upload/large.cjs.map +1 -1
- package/dist/upload/large.d.cts +76 -9
- package/dist/upload/large.d.cts.map +1 -1
- package/dist/upload/large.d.ts +76 -9
- package/dist/upload/large.d.ts.map +1 -1
- package/dist/upload/large.js +301 -218
- package/dist/upload/large.js.map +1 -1
- package/dist/upload/options.cjs +28 -0
- package/dist/upload/options.cjs.map +1 -0
- package/dist/upload/options.d.cts +104 -0
- package/dist/upload/options.d.cts.map +1 -0
- package/dist/upload/options.d.ts +104 -0
- package/dist/upload/options.d.ts.map +1 -0
- package/dist/upload/options.js +27 -0
- package/dist/upload/options.js.map +1 -0
- package/dist/upload/resume.cjs +333 -33
- package/dist/upload/resume.cjs.map +1 -1
- package/dist/upload/resume.d.cts +82 -12
- package/dist/upload/resume.d.cts.map +1 -1
- package/dist/upload/resume.d.ts +82 -12
- package/dist/upload/resume.d.ts.map +1 -1
- package/dist/upload/resume.js +330 -33
- package/dist/upload/resume.js.map +1 -1
- package/dist/upload/retry.cjs +186 -0
- package/dist/upload/retry.cjs.map +1 -0
- package/dist/upload/retry.d.cts +127 -0
- package/dist/upload/retry.d.cts.map +1 -0
- package/dist/upload/retry.d.ts +127 -0
- package/dist/upload/retry.d.ts.map +1 -0
- package/dist/upload/retry.js +182 -0
- package/dist/upload/retry.js.map +1 -0
- package/dist/upload/single.cjs +68 -44
- package/dist/upload/single.cjs.map +1 -1
- package/dist/upload/single.d.cts +2 -1
- package/dist/upload/single.d.cts.map +1 -1
- package/dist/upload/single.d.ts +2 -1
- package/dist/upload/single.d.ts.map +1 -1
- package/dist/upload/single.js +68 -44
- package/dist/upload/single.js.map +1 -1
- package/dist/upload/stream.cjs +317 -193
- package/dist/upload/stream.cjs.map +1 -1
- package/dist/upload/stream.d.cts +3 -1
- package/dist/upload/stream.d.cts.map +1 -1
- package/dist/upload/stream.d.ts +3 -1
- package/dist/upload/stream.d.ts.map +1 -1
- package/dist/upload/stream.js +316 -192
- package/dist/upload/stream.js.map +1 -1
- package/dist/util/best-effort.cjs +42 -8
- package/dist/util/best-effort.cjs.map +1 -1
- package/dist/util/best-effort.d.cts +2 -1
- package/dist/util/best-effort.d.cts.map +1 -1
- package/dist/util/best-effort.d.ts +2 -1
- package/dist/util/best-effort.d.ts.map +1 -1
- package/dist/util/best-effort.js +43 -9
- package/dist/util/best-effort.js.map +1 -1
- package/dist/util/bytes.cjs +23 -0
- package/dist/util/bytes.cjs.map +1 -0
- package/dist/util/bytes.d.cts +15 -0
- package/dist/util/bytes.d.cts.map +1 -0
- package/dist/util/bytes.d.ts +15 -0
- package/dist/util/bytes.d.ts.map +1 -0
- package/dist/util/bytes.js +23 -0
- package/dist/util/bytes.js.map +1 -0
- package/dist/util/crypto.cjs +68 -0
- package/dist/util/crypto.cjs.map +1 -0
- package/dist/util/crypto.d.cts +26 -0
- package/dist/util/crypto.d.cts.map +1 -0
- package/dist/util/crypto.d.ts +26 -0
- package/dist/util/crypto.d.ts.map +1 -0
- package/dist/util/crypto.js +66 -0
- package/dist/util/crypto.js.map +1 -0
- package/dist/util/defaults.cjs +25 -9
- package/dist/util/defaults.cjs.map +1 -1
- package/dist/util/defaults.js +26 -11
- package/dist/util/defaults.js.map +1 -1
- package/dist/util/error-reason.cjs +41 -0
- package/dist/util/error-reason.cjs.map +1 -0
- package/dist/util/error-reason.d.cts +9 -0
- package/dist/util/error-reason.d.cts.map +1 -0
- package/dist/util/error-reason.d.ts +9 -0
- package/dist/util/error-reason.d.ts.map +1 -0
- package/dist/util/error-reason.js +41 -0
- package/dist/util/error-reason.js.map +1 -0
- package/dist/util/http.cjs +23 -0
- package/dist/util/http.cjs.map +1 -0
- package/dist/util/http.d.cts +13 -0
- package/dist/util/http.d.cts.map +1 -0
- package/dist/util/http.d.ts +13 -0
- package/dist/util/http.d.ts.map +1 -0
- package/dist/util/http.js +23 -0
- package/dist/util/http.js.map +1 -0
- package/dist/util/normalize.cjs +66 -7
- package/dist/util/normalize.cjs.map +1 -1
- package/dist/util/normalize.js +67 -10
- package/dist/util/normalize.js.map +1 -1
- package/dist/util/paginator.cjs +63 -14
- package/dist/util/paginator.cjs.map +1 -1
- package/dist/util/paginator.js +64 -16
- package/dist/util/paginator.js.map +1 -1
- package/dist/util/plan-ranges.cjs +47 -22
- package/dist/util/plan-ranges.cjs.map +1 -1
- package/dist/util/plan-ranges.js +48 -24
- package/dist/util/plan-ranges.js.map +1 -1
- package/dist/util/sha1.cjs +27 -0
- package/dist/util/sha1.cjs.map +1 -0
- package/dist/util/sha1.d.cts +17 -0
- package/dist/util/sha1.d.cts.map +1 -0
- package/dist/util/sha1.d.ts +17 -0
- package/dist/util/sha1.d.ts.map +1 -0
- package/dist/util/sha1.js +26 -0
- package/dist/util/sha1.js.map +1 -0
- package/dist/util/text-codec.cjs +29 -5
- package/dist/util/text-codec.cjs.map +1 -1
- package/dist/util/text-codec.js +30 -7
- package/dist/util/text-codec.js.map +1 -1
- package/dist/util/to-error.cjs +18 -4
- package/dist/util/to-error.cjs.map +1 -1
- package/dist/util/to-error.js +19 -5
- package/dist/util/to-error.js.map +1 -1
- package/dist/version.cjs +17 -5
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +3 -3
- package/dist/version.d.ts +3 -3
- package/dist/version.js +19 -6
- package/dist/version.js.map +1 -1
- package/package.json +19 -16
- package/dist/auth/index.cjs.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/notifications/index.cjs.map +0 -1
- package/dist/notifications/index.js.map +0 -1
- package/dist/package.json.cjs +0 -9
- package/dist/package.json.cjs.map +0 -1
- package/dist/package.json.js +0 -9
- package/dist/package.json.js.map +0 -1
- package/dist/streams/index.cjs.map +0 -1
- package/dist/streams/index.js.map +0 -1
- package/dist/sync/index.cjs.map +0 -1
- package/dist/sync/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE9D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU;IACrB,6BAA6B;;IAE7B,mCAAmC;;IAEnC,+BAA+B;;IAE/B,kDAAkD;;IAElD,gDAAgD;;IAEhD,4BAA4B;;IAE5B,iCAAiC;;IAEjC,gDAAgD;;IAEhD,wDAAwD;;IAExD,0DAA0D;;IAE1D,+CAA+C;;IAE/C,iDAAiD;;IAEjD,6CAA6C;;IAE7C,+CAA+C;;IAE/C,4CAA4C;;IAE5C,8CAA8C;;IAE9C,oCAAoC;;IAEpC,sBAAsB;;IAE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Aa;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAA;CAC/B;AAED,uFAAuF;AACvF,MAAM,WAAW,OAAO;IACtB,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAA;IACnC,mFAAmF;IACnF,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAA;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,kBAAkB,EAAE,SAAS,CAAA;IACtC,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,uGAAuG;IACvG,QAAQ,CAAC,iCAAiC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1D;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,yDAAyD;IACzD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,kCAAkC;IAClC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
package/dist/types/auth.d.ts
CHANGED
|
@@ -47,6 +47,10 @@ export declare const Capability: {
|
|
|
47
47
|
readonly ReadBucketNotifications: "readBucketNotifications";
|
|
48
48
|
/** Modify bucket event-notification rules. */
|
|
49
49
|
readonly WriteBucketNotifications: "writeBucketNotifications";
|
|
50
|
+
/** Read bucket logging settings. */
|
|
51
|
+
readonly ReadBucketLogging: "readBucketLogging";
|
|
52
|
+
/** Modify bucket logging settings. */
|
|
53
|
+
readonly WriteBucketLogging: "writeBucketLogging";
|
|
50
54
|
/** List file names and versions. */
|
|
51
55
|
readonly ListFiles: "listFiles";
|
|
52
56
|
/** Download files. */
|
|
@@ -73,13 +77,34 @@ export declare const Capability: {
|
|
|
73
77
|
* from {@link Capability}.
|
|
74
78
|
*/
|
|
75
79
|
export type Capability = (typeof Capability)[keyof typeof Capability];
|
|
80
|
+
/** Bucket restriction entry returned by v4 `b2_authorize_account`. */
|
|
81
|
+
export interface AllowedBucket {
|
|
82
|
+
/** Bucket ID the key can access. */
|
|
83
|
+
readonly id: BucketId;
|
|
84
|
+
/** Bucket name when available, or null when B2 does not include it. */
|
|
85
|
+
readonly name: string | null;
|
|
86
|
+
}
|
|
76
87
|
/** Describes the capabilities and scope restrictions of an authorized application key. */
|
|
77
88
|
export interface AllowedInfo {
|
|
78
89
|
/** List of capabilities granted to this key. */
|
|
79
90
|
readonly capabilities: readonly Capability[];
|
|
80
|
-
/** Bucket
|
|
91
|
+
/** Bucket restrictions for v4 authorization, or null if unrestricted. */
|
|
92
|
+
readonly buckets: readonly AllowedBucket[] | null;
|
|
93
|
+
/**
|
|
94
|
+
* Bucket ID this key is restricted to when it has exactly one bucket, or null
|
|
95
|
+
* if unrestricted or multi-bucket.
|
|
96
|
+
*
|
|
97
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
98
|
+
* `buckets`; use `buckets` instead.
|
|
99
|
+
*/
|
|
81
100
|
readonly bucketId: BucketId | null;
|
|
82
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Bucket name this key is restricted to when it has exactly one bucket, or
|
|
103
|
+
* null if unrestricted, multi-bucket, or unknown.
|
|
104
|
+
*
|
|
105
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
106
|
+
* `buckets`; use `buckets` instead.
|
|
107
|
+
*/
|
|
83
108
|
readonly bucketName: string | null;
|
|
84
109
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
85
110
|
readonly namePrefix: string | null;
|
|
@@ -90,15 +115,37 @@ export interface StorageApiInfo {
|
|
|
90
115
|
readonly absoluteMinimumPartSize: number;
|
|
91
116
|
/** Base URL for B2 API calls. */
|
|
92
117
|
readonly apiUrl: string;
|
|
93
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* Bucket ID this key is restricted to when it has exactly one bucket, or null
|
|
120
|
+
* if unrestricted or multi-bucket.
|
|
121
|
+
*
|
|
122
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
123
|
+
* `allowed.buckets`; use `allowed.buckets` instead.
|
|
124
|
+
*/
|
|
94
125
|
readonly bucketId: BucketId | null;
|
|
95
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Bucket name this key is restricted to when it has exactly one bucket, or
|
|
128
|
+
* null if unrestricted, multi-bucket, or unknown.
|
|
129
|
+
*
|
|
130
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
131
|
+
* `allowed.buckets`; use `allowed.buckets` instead.
|
|
132
|
+
*/
|
|
96
133
|
readonly bucketName: string | null;
|
|
97
134
|
/** Base URL for file downloads. */
|
|
98
135
|
readonly downloadUrl: string;
|
|
99
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* Discriminator indicating this is storage API info. Always `'storageApi'`.
|
|
138
|
+
*
|
|
139
|
+
* @deprecated Removed from the v4 wire shape but normalized by the SDK for
|
|
140
|
+
* compatibility.
|
|
141
|
+
*/
|
|
100
142
|
readonly infoType: 'storageApi';
|
|
101
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* File name prefix this key is restricted to, or null if unrestricted.
|
|
145
|
+
*
|
|
146
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
147
|
+
* `allowed.namePrefix`; use `allowed.namePrefix` instead.
|
|
148
|
+
*/
|
|
102
149
|
readonly namePrefix: string | null;
|
|
103
150
|
/** Recommended part size for large file uploads, in bytes. */
|
|
104
151
|
readonly recommendedPartSize: number;
|
|
@@ -122,8 +169,9 @@ export interface ApiInfo {
|
|
|
122
169
|
readonly groupsApi?: GroupsApiInfo;
|
|
123
170
|
}
|
|
124
171
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
172
|
+
* Normalized SDK-facing response from the `b2_authorize_account` API call.
|
|
173
|
+
* The SDK uses the v4 endpoint and preserves deprecated v3 compatibility
|
|
174
|
+
* aliases such as `storageApi.bucketId` and `allowed.bucketId`.
|
|
127
175
|
*/
|
|
128
176
|
export interface AuthorizeAccountResponse {
|
|
129
177
|
/** The account ID for the authorized account. */
|
|
@@ -144,7 +192,17 @@ export interface AuthorizeAccountRequest {
|
|
|
144
192
|
readonly applicationKeyId: string;
|
|
145
193
|
/** The application key secret. */
|
|
146
194
|
readonly applicationKey: string;
|
|
147
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* Optional realm override. Accepts a known realm-map key (`"production"` or
|
|
197
|
+
* `"staging"`) or a direct base URL. Custom HTTPS hosts are trusted with the
|
|
198
|
+
* application key during authorize, so never derive this value from untrusted
|
|
199
|
+
* input. URL values must use HTTPS, or loopback IP literal HTTP for local
|
|
200
|
+
* testing only; application-key credentials are sent unencrypted over
|
|
201
|
+
* loopback HTTP. Unsupported schemes, malformed URLs, non-URL strings,
|
|
202
|
+
* plaintext HTTP hostnames such as `localhost`, and non-loopback plaintext
|
|
203
|
+
* HTTP are rejected before credentials are sent. URL values must not include
|
|
204
|
+
* userinfo, query strings, or fragments. Defaults to production.
|
|
205
|
+
*/
|
|
148
206
|
readonly realm?: string;
|
|
149
207
|
}
|
|
150
208
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/types/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE9D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU;IACrB,6BAA6B;;IAE7B,mCAAmC;;IAEnC,+BAA+B;;IAE/B,kDAAkD;;IAElD,gDAAgD;;IAEhD,4BAA4B;;IAE5B,iCAAiC;;IAEjC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
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
//#region src/types/auth.ts
|
|
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
|
+
var Capability = {
|
|
18
|
+
/** List application keys. */
|
|
19
|
+
ListKeys: "listKeys",
|
|
20
|
+
/** Create new application keys. */
|
|
21
|
+
WriteKeys: "writeKeys",
|
|
22
|
+
/** Delete application keys. */
|
|
23
|
+
DeleteKeys: "deleteKeys",
|
|
24
|
+
/** List buckets (subject to key restrictions). */
|
|
25
|
+
ListBuckets: "listBuckets",
|
|
26
|
+
/** List bucket names without other metadata. */
|
|
27
|
+
ListAllBucketNames: "listAllBucketNames",
|
|
28
|
+
/** Read bucket settings. */
|
|
29
|
+
ReadBuckets: "readBuckets",
|
|
30
|
+
/** Create and update buckets. */
|
|
31
|
+
WriteBuckets: "writeBuckets",
|
|
32
|
+
/** Remove existing buckets from the account. */
|
|
33
|
+
DeleteBuckets: "deleteBuckets",
|
|
34
|
+
/** Read bucket-level Object Lock retention settings. */
|
|
35
|
+
ReadBucketRetentions: "readBucketRetentions",
|
|
36
|
+
/** Modify bucket-level Object Lock retention settings. */
|
|
37
|
+
WriteBucketRetentions: "writeBucketRetentions",
|
|
38
|
+
/** Read default bucket encryption settings. */
|
|
39
|
+
ReadBucketEncryption: "readBucketEncryption",
|
|
40
|
+
/** Modify default bucket encryption settings. */
|
|
41
|
+
WriteBucketEncryption: "writeBucketEncryption",
|
|
42
|
+
/** Read bucket replication configuration. */
|
|
43
|
+
ReadBucketReplications: "readBucketReplications",
|
|
44
|
+
/** Modify bucket replication configuration. */
|
|
45
|
+
WriteBucketReplications: "writeBucketReplications",
|
|
46
|
+
/** Read bucket event-notification rules. */
|
|
47
|
+
ReadBucketNotifications: "readBucketNotifications",
|
|
48
|
+
/** Modify bucket event-notification rules. */
|
|
49
|
+
WriteBucketNotifications: "writeBucketNotifications",
|
|
50
|
+
/** Read bucket logging settings. */
|
|
51
|
+
ReadBucketLogging: "readBucketLogging",
|
|
52
|
+
/** Modify bucket logging settings. */
|
|
53
|
+
WriteBucketLogging: "writeBucketLogging",
|
|
54
|
+
/** List file names and versions. */
|
|
55
|
+
ListFiles: "listFiles",
|
|
56
|
+
/** Download files. */
|
|
57
|
+
ReadFiles: "readFiles",
|
|
58
|
+
/** Mint download authorisation tokens. */
|
|
59
|
+
ShareFiles: "shareFiles",
|
|
60
|
+
/** Upload files. */
|
|
61
|
+
WriteFiles: "writeFiles",
|
|
62
|
+
/** Delete file versions. */
|
|
63
|
+
DeleteFiles: "deleteFiles",
|
|
64
|
+
/** Read per-file legal hold flags. */
|
|
65
|
+
ReadFileLegalHolds: "readFileLegalHolds",
|
|
66
|
+
/** Modify per-file legal hold flags. */
|
|
67
|
+
WriteFileLegalHolds: "writeFileLegalHolds",
|
|
68
|
+
/** Read per-file Object Lock retention settings. */
|
|
69
|
+
ReadFileRetentions: "readFileRetentions",
|
|
70
|
+
/** Modify per-file Object Lock retention settings. */
|
|
71
|
+
WriteFileRetentions: "writeFileRetentions",
|
|
72
|
+
/** Shorten governance-mode retention. */
|
|
73
|
+
BypassGovernance: "bypassGovernance"
|
|
54
74
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=auth.js.map
|
|
75
|
+
//#endregion
|
|
76
|
+
export { Capability };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=auth.js.map
|
package/dist/types/auth.js.map
CHANGED
|
@@ -1 +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
|
|
1
|
+
{"version":3,"file":"auth.js","names":[],"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 /** Read bucket logging settings. */\n ReadBucketLogging: 'readBucketLogging',\n /** Modify bucket logging settings. */\n WriteBucketLogging: 'writeBucketLogging',\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/** Bucket restriction entry returned by v4 `b2_authorize_account`. */\nexport interface AllowedBucket {\n /** Bucket ID the key can access. */\n readonly id: BucketId\n /** Bucket name when available, or null when B2 does not include it. */\n readonly name: string | null\n}\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 restrictions for v4 authorization, or null if unrestricted. */\n readonly buckets: readonly AllowedBucket[] | null\n /**\n * Bucket ID this key is restricted to when it has exactly one bucket, or null\n * if unrestricted or multi-bucket.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `buckets`; use `buckets` instead.\n */\n readonly bucketId: BucketId | null\n /**\n * Bucket name this key is restricted to when it has exactly one bucket, or\n * null if unrestricted, multi-bucket, or unknown.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `buckets`; use `buckets` instead.\n */\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 /**\n * Bucket ID this key is restricted to when it has exactly one bucket, or null\n * if unrestricted or multi-bucket.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `allowed.buckets`; use `allowed.buckets` instead.\n */\n readonly bucketId: BucketId | null\n /**\n * Bucket name this key is restricted to when it has exactly one bucket, or\n * null if unrestricted, multi-bucket, or unknown.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `allowed.buckets`; use `allowed.buckets` instead.\n */\n readonly bucketName: string | null\n /** Base URL for file downloads. */\n readonly downloadUrl: string\n /**\n * Discriminator indicating this is storage API info. Always `'storageApi'`.\n *\n * @deprecated Removed from the v4 wire shape but normalized by the SDK for\n * compatibility.\n */\n readonly infoType: 'storageApi'\n /**\n * File name prefix this key is restricted to, or null if unrestricted.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `allowed.namePrefix`; use `allowed.namePrefix` instead.\n */\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 * Normalized SDK-facing response from the `b2_authorize_account` API call.\n * The SDK uses the v4 endpoint and preserves deprecated v3 compatibility\n * aliases such as `storageApi.bucketId` and `allowed.bucketId`.\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 /**\n * Optional realm override. Accepts a known realm-map key (`\"production\"` or\n * `\"staging\"`) or a direct base URL. Custom HTTPS hosts are trusted with the\n * application key during authorize, so never derive this value from untrusted\n * input. URL values must use HTTPS, or loopback IP literal HTTP for local\n * testing only; application-key credentials are sent unencrypted over\n * loopback HTTP. Unsupported schemes, malformed URLs, non-URL strings,\n * plaintext HTTP hostnames such as `localhost`, and non-loopback plaintext\n * HTTP are rejected before credentials are sent. URL values must not include\n * userinfo, query strings, or fragments. Defaults to production.\n */\n readonly realm?: string\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,IAAa,aAAa;;CAExB,UAAU;;CAEV,WAAW;;CAEX,YAAY;;CAEZ,aAAa;;CAEb,oBAAoB;;CAEpB,aAAa;;CAEb,cAAc;;CAEd,eAAe;;CAEf,sBAAsB;;CAEtB,uBAAuB;;CAEvB,sBAAsB;;CAEtB,uBAAuB;;CAEvB,wBAAwB;;CAExB,yBAAyB;;CAEzB,yBAAyB;;CAEzB,0BAA0B;;CAE1B,mBAAmB;;CAEnB,oBAAoB;;CAEpB,WAAW;;CAEX,WAAW;;CAEX,YAAY;;CAEZ,YAAY;;CAEZ,aAAa;;CAEb,oBAAoB;;CAEpB,qBAAqB;;CAErB,oBAAoB;;CAEpB,qBAAqB;;CAErB,kBAAkB;AACpB"}
|
package/dist/types/bucket.cjs
CHANGED
|
@@ -1,44 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
//#region src/types/bucket.ts
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the bucket access level.
|
|
4
|
+
*
|
|
5
|
+
* The {@link BucketType} type alias is derived from the values of this
|
|
6
|
+
* object, so the const is the single source of truth: adding a key here
|
|
7
|
+
* automatically widens the type union.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* await client.createBucket({ bucketName: 'my-app-logs', bucketType: BucketType.AllPrivate })
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
var BucketType = {
|
|
15
|
+
/** Publicly downloadable without authentication. */
|
|
16
|
+
AllPublic: "allPublic",
|
|
17
|
+
/** Requires a valid auth token to download. */
|
|
18
|
+
AllPrivate: "allPrivate",
|
|
19
|
+
/** Internal snapshot bucket type, generally not user-created. */
|
|
20
|
+
Snapshot: "snapshot",
|
|
21
|
+
/** B2-restricted bucket (e.g., for S3-compatible workflows). */
|
|
22
|
+
Restricted: "restricted"
|
|
12
23
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Named constants for the B2 + S3 operations a CORS rule can permit.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* await bucket.update({
|
|
30
|
+
* corsRules: [{
|
|
31
|
+
* corsRuleName: 'browser-downloads',
|
|
32
|
+
* allowedOrigins: ['https://example.com'],
|
|
33
|
+
* allowedOperations: [CorsOperation.B2DownloadFileByName, CorsOperation.S3Get],
|
|
34
|
+
* allowedHeaders: null,
|
|
35
|
+
* exposeHeaders: null,
|
|
36
|
+
* maxAgeSeconds: 3600,
|
|
37
|
+
* }],
|
|
38
|
+
* })
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
var CorsOperation = {
|
|
42
|
+
/** Native B2 download-by-name request. */
|
|
43
|
+
B2DownloadFileByName: "b2_download_file_by_name",
|
|
44
|
+
/** Native B2 download-by-id request. */
|
|
45
|
+
B2DownloadFileById: "b2_download_file_by_id",
|
|
46
|
+
/** Native B2 small-file upload. */
|
|
47
|
+
B2UploadFile: "b2_upload_file",
|
|
48
|
+
/** Native B2 multipart-part upload. */
|
|
49
|
+
B2UploadPart: "b2_upload_part",
|
|
50
|
+
/** S3-compatible DELETE. */
|
|
51
|
+
S3Delete: "s3_delete",
|
|
52
|
+
/** S3-compatible GET. */
|
|
53
|
+
S3Get: "s3_get",
|
|
54
|
+
/** S3-compatible HEAD. */
|
|
55
|
+
S3Head: "s3_head",
|
|
56
|
+
/** S3-compatible POST. */
|
|
57
|
+
S3Post: "s3_post",
|
|
58
|
+
/** S3-compatible PUT. */
|
|
59
|
+
S3Put: "s3_put"
|
|
32
60
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Named constants for the bucket-level Object Lock retention mode.
|
|
63
|
+
*
|
|
64
|
+
* Pair with {@link BucketRetentionPolicy} when setting a bucket's default
|
|
65
|
+
* retention: `{ mode: BucketRetentionMode.Compliance, period: { duration: 30, unit: 'days' } }`.
|
|
66
|
+
*/
|
|
67
|
+
var BucketRetentionMode = {
|
|
68
|
+
/** Files cannot be deleted or modified during the retention period, even by the account owner. */
|
|
69
|
+
Compliance: "compliance",
|
|
70
|
+
/** Files cannot be deleted during retention except by callers with the `bypassGovernance` capability. */
|
|
71
|
+
Governance: "governance",
|
|
72
|
+
/** No default retention is applied to new uploads. */
|
|
73
|
+
None: "none"
|
|
40
74
|
};
|
|
75
|
+
//#endregion
|
|
41
76
|
exports.BucketRetentionMode = BucketRetentionMode;
|
|
42
77
|
exports.BucketType = BucketType;
|
|
43
78
|
exports.CorsOperation = CorsOperation;
|
|
44
|
-
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=bucket.cjs.map
|
|
@@ -1 +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;;;;"}
|
|
1
|
+
{"version":3,"file":"bucket.cjs","names":[],"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"],"mappings":";;;;;;;;;;;;;AAgBA,IAAa,aAAa;;CAExB,WAAW;;CAEX,YAAY;;CAEZ,UAAU;;CAEV,YAAY;AACd;;;;;;;;;;;;;;;;;;AAgCA,IAAa,gBAAgB;;CAE3B,sBAAsB;;CAEtB,oBAAoB;;CAEpB,cAAc;;CAEd,cAAc;;CAEd,UAAU;;CAEV,OAAO;;CAEP,QAAQ;;CAER,QAAQ;;CAER,OAAO;AACT;;;;;;;AA8BA,IAAa,sBAAsB;;CAEjC,YAAY;;CAEZ,YAAY;;CAEZ,MAAM;AACR"}
|