@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
package/dist/types/ids.cjs
CHANGED
|
@@ -1,27 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/types/ids.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a branded {@link AccountId} from a raw string.
|
|
4
|
+
* @param raw - The raw account ID string from the B2 API.
|
|
5
|
+
*
|
|
6
|
+
* @returns A branded AccountId value.
|
|
7
|
+
*/
|
|
3
8
|
function accountId(raw) {
|
|
4
|
-
|
|
9
|
+
return raw;
|
|
5
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Creates a branded {@link BucketId} from a raw string.
|
|
13
|
+
* @param raw - The raw bucket ID string from the B2 API.
|
|
14
|
+
*
|
|
15
|
+
* @returns A branded BucketId value.
|
|
16
|
+
*/
|
|
6
17
|
function bucketId(raw) {
|
|
7
|
-
|
|
18
|
+
return raw;
|
|
8
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates a branded {@link FileId} from a raw string.
|
|
22
|
+
* @param raw - The raw file ID string from the B2 API.
|
|
23
|
+
*
|
|
24
|
+
* @returns A branded FileId value.
|
|
25
|
+
*/
|
|
9
26
|
function fileId(raw) {
|
|
10
|
-
|
|
27
|
+
return raw;
|
|
11
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates a branded {@link KeyId} from a raw string.
|
|
31
|
+
* @param raw - The raw key ID string from the B2 API.
|
|
32
|
+
*
|
|
33
|
+
* @returns A branded KeyId value.
|
|
34
|
+
*/
|
|
12
35
|
function keyId(raw) {
|
|
13
|
-
|
|
36
|
+
return raw;
|
|
14
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Creates a branded {@link ApplicationKeyId} from a raw string.
|
|
40
|
+
* @param raw - The raw application key ID string from the B2 API.
|
|
41
|
+
*
|
|
42
|
+
* @returns A branded ApplicationKeyId value.
|
|
43
|
+
*/
|
|
15
44
|
function applicationKeyId(raw) {
|
|
16
|
-
|
|
45
|
+
return raw;
|
|
17
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Creates a branded {@link LargeFileId} from a raw string.
|
|
49
|
+
*
|
|
50
|
+
* `LargeFileId` is the same wire-level shape as `FileId` but is a
|
|
51
|
+
* distinct brand so that "ID of an in-progress multipart upload" and
|
|
52
|
+
* "ID of a committed file version" don't get mixed up by accident.
|
|
53
|
+
* `b2_start_large_file` returns one; `b2_finish_large_file` consumes it
|
|
54
|
+
* and produces a regular `FileId`.
|
|
55
|
+
*
|
|
56
|
+
* @param raw - The raw large-file ID string from the B2 API.
|
|
57
|
+
*
|
|
58
|
+
* @returns A branded LargeFileId value.
|
|
59
|
+
*/
|
|
18
60
|
function largeFileId(raw) {
|
|
19
|
-
|
|
61
|
+
return raw;
|
|
20
62
|
}
|
|
63
|
+
//#endregion
|
|
21
64
|
exports.accountId = accountId;
|
|
22
65
|
exports.applicationKeyId = applicationKeyId;
|
|
23
66
|
exports.bucketId = bucketId;
|
|
24
67
|
exports.fileId = fileId;
|
|
25
68
|
exports.keyId = keyId;
|
|
26
69
|
exports.largeFileId = largeFileId;
|
|
27
|
-
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=ids.cjs.map
|
package/dist/types/ids.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.cjs","sources":["../../src/types/ids.ts"],"sourcesContent":["/**\n * Unique symbol used to brand string types, preventing accidental mixing of different ID types.\n */\ndeclare const __brand: unique symbol\n\n/** Compile-time brand tag interface. Never instantiated at runtime. */\nexport interface BrandTag<B extends string> {\n /** Discriminant tag that makes branded types structurally incompatible. */\n readonly [__brand]: B\n}\n\n/**\n * Utility type that intersects a base type with a branded tag.\n * This pattern ensures that branded types are structurally incompatible with each other\n * even though they share the same underlying representation.\n */\nexport type Brand<T, B extends string> = T & BrandTag<B>\n\n/** Unique identifier for a B2 account. Branded to prevent mixing with other string IDs. */\nexport type AccountId = Brand<string, 'AccountId'>\n\n/** Unique identifier for a B2 bucket. Branded to prevent mixing with other string IDs. */\nexport type BucketId = Brand<string, 'BucketId'>\n\n/** Unique identifier for a B2 file version. Branded to prevent mixing with other string IDs. */\nexport type FileId = Brand<string, 'FileId'>\n\n/** Unique identifier for a B2 application key. Branded to prevent mixing with other string IDs. */\nexport type KeyId = Brand<string, 'KeyId'>\n\n/** Unique identifier for a B2 application key, as returned by the API. Branded to prevent mixing with other string IDs. */\nexport type ApplicationKeyId = Brand<string, 'ApplicationKeyId'>\n\n/** Pre-signed URL for uploading files to a specific bucket. Branded to prevent misuse as a regular string. */\nexport type UploadUrl = Brand<string, 'UploadUrl'>\n\n/** Authorization token scoped to a specific upload URL. Branded to prevent mixing with other tokens. */\nexport type UploadAuthToken = Brand<string, 'UploadAuthToken'>\n\n/** Authorization token for B2 API requests. Branded to prevent mixing with other string values. */\nexport type AuthToken = Brand<string, 'AuthToken'>\n\n/** Unique identifier for a large file upload in progress. Branded to prevent mixing with regular FileId values. */\nexport type LargeFileId = Brand<string, 'LargeFileId'>\n\n/**\n * Creates a branded {@link AccountId} from a raw string.\n * @param raw - The raw account ID string from the B2 API.\n *\n * @returns A branded AccountId value.\n */\nexport function accountId(raw: string): AccountId {\n return raw as AccountId\n}\n\n/**\n * Creates a branded {@link BucketId} from a raw string.\n * @param raw - The raw bucket ID string from the B2 API.\n *\n * @returns A branded BucketId value.\n */\nexport function bucketId(raw: string): BucketId {\n return raw as BucketId\n}\n\n/**\n * Creates a branded {@link FileId} from a raw string.\n * @param raw - The raw file ID string from the B2 API.\n *\n * @returns A branded FileId value.\n */\nexport function fileId(raw: string): FileId {\n return raw as FileId\n}\n\n/**\n * Creates a branded {@link KeyId} from a raw string.\n * @param raw - The raw key ID string from the B2 API.\n *\n * @returns A branded KeyId value.\n */\nexport function keyId(raw: string): KeyId {\n return raw as KeyId\n}\n\n/**\n * Creates a branded {@link ApplicationKeyId} from a raw string.\n * @param raw - The raw application key ID string from the B2 API.\n *\n * @returns A branded ApplicationKeyId value.\n */\nexport function applicationKeyId(raw: string): ApplicationKeyId {\n return raw as ApplicationKeyId\n}\n\n/**\n * Creates a branded {@link LargeFileId} from a raw string.\n *\n * `LargeFileId` is the same wire-level shape as `FileId` but is a\n * distinct brand so that \"ID of an in-progress multipart upload\" and\n * \"ID of a committed file version\" don't get mixed up by accident.\n * `b2_start_large_file` returns one; `b2_finish_large_file` consumes it\n * and produces a regular `FileId`.\n *\n * @param raw - The raw large-file ID string from the B2 API.\n *\n * @returns A branded LargeFileId value.\n */\nexport function largeFileId(raw: string): LargeFileId {\n return raw as LargeFileId\n}\n"],"
|
|
1
|
+
{"version":3,"file":"ids.cjs","names":[],"sources":["../../src/types/ids.ts"],"sourcesContent":["/**\n * Unique symbol used to brand string types, preventing accidental mixing of different ID types.\n */\ndeclare const __brand: unique symbol\n\n/** Compile-time brand tag interface. Never instantiated at runtime. */\nexport interface BrandTag<B extends string> {\n /** Discriminant tag that makes branded types structurally incompatible. */\n readonly [__brand]: B\n}\n\n/**\n * Utility type that intersects a base type with a branded tag.\n * This pattern ensures that branded types are structurally incompatible with each other\n * even though they share the same underlying representation.\n */\nexport type Brand<T, B extends string> = T & BrandTag<B>\n\n/** Unique identifier for a B2 account. Branded to prevent mixing with other string IDs. */\nexport type AccountId = Brand<string, 'AccountId'>\n\n/** Unique identifier for a B2 bucket. Branded to prevent mixing with other string IDs. */\nexport type BucketId = Brand<string, 'BucketId'>\n\n/** Unique identifier for a B2 file version. Branded to prevent mixing with other string IDs. */\nexport type FileId = Brand<string, 'FileId'>\n\n/** Unique identifier for a B2 application key. Branded to prevent mixing with other string IDs. */\nexport type KeyId = Brand<string, 'KeyId'>\n\n/** Unique identifier for a B2 application key, as returned by the API. Branded to prevent mixing with other string IDs. */\nexport type ApplicationKeyId = Brand<string, 'ApplicationKeyId'>\n\n/** Pre-signed URL for uploading files to a specific bucket. Branded to prevent misuse as a regular string. */\nexport type UploadUrl = Brand<string, 'UploadUrl'>\n\n/** Authorization token scoped to a specific upload URL. Branded to prevent mixing with other tokens. */\nexport type UploadAuthToken = Brand<string, 'UploadAuthToken'>\n\n/** Authorization token for B2 API requests. Branded to prevent mixing with other string values. */\nexport type AuthToken = Brand<string, 'AuthToken'>\n\n/** Unique identifier for a large file upload in progress. Branded to prevent mixing with regular FileId values. */\nexport type LargeFileId = Brand<string, 'LargeFileId'>\n\n/**\n * Creates a branded {@link AccountId} from a raw string.\n * @param raw - The raw account ID string from the B2 API.\n *\n * @returns A branded AccountId value.\n */\nexport function accountId(raw: string): AccountId {\n return raw as AccountId\n}\n\n/**\n * Creates a branded {@link BucketId} from a raw string.\n * @param raw - The raw bucket ID string from the B2 API.\n *\n * @returns A branded BucketId value.\n */\nexport function bucketId(raw: string): BucketId {\n return raw as BucketId\n}\n\n/**\n * Creates a branded {@link FileId} from a raw string.\n * @param raw - The raw file ID string from the B2 API.\n *\n * @returns A branded FileId value.\n */\nexport function fileId(raw: string): FileId {\n return raw as FileId\n}\n\n/**\n * Creates a branded {@link KeyId} from a raw string.\n * @param raw - The raw key ID string from the B2 API.\n *\n * @returns A branded KeyId value.\n */\nexport function keyId(raw: string): KeyId {\n return raw as KeyId\n}\n\n/**\n * Creates a branded {@link ApplicationKeyId} from a raw string.\n * @param raw - The raw application key ID string from the B2 API.\n *\n * @returns A branded ApplicationKeyId value.\n */\nexport function applicationKeyId(raw: string): ApplicationKeyId {\n return raw as ApplicationKeyId\n}\n\n/**\n * Creates a branded {@link LargeFileId} from a raw string.\n *\n * `LargeFileId` is the same wire-level shape as `FileId` but is a\n * distinct brand so that \"ID of an in-progress multipart upload\" and\n * \"ID of a committed file version\" don't get mixed up by accident.\n * `b2_start_large_file` returns one; `b2_finish_large_file` consumes it\n * and produces a regular `FileId`.\n *\n * @param raw - The raw large-file ID string from the B2 API.\n *\n * @returns A branded LargeFileId value.\n */\nexport function largeFileId(raw: string): LargeFileId {\n return raw as LargeFileId\n}\n"],"mappings":";;;;;;;AAmDA,SAAgB,UAAU,KAAwB;CAChD,OAAO;AACT;;;;;;;AAQA,SAAgB,SAAS,KAAuB;CAC9C,OAAO;AACT;;;;;;;AAQA,SAAgB,OAAO,KAAqB;CAC1C,OAAO;AACT;;;;;;;AAQA,SAAgB,MAAM,KAAoB;CACxC,OAAO;AACT;;;;;;;AAQA,SAAgB,iBAAiB,KAA+B;CAC9D,OAAO;AACT;;;;;;;;;;;;;;AAeA,SAAgB,YAAY,KAA0B;CACpD,OAAO;AACT"}
|
package/dist/types/ids.js
CHANGED
|
@@ -1,27 +1,66 @@
|
|
|
1
|
+
//#region src/types/ids.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a branded {@link AccountId} from a raw string.
|
|
4
|
+
* @param raw - The raw account ID string from the B2 API.
|
|
5
|
+
*
|
|
6
|
+
* @returns A branded AccountId value.
|
|
7
|
+
*/
|
|
1
8
|
function accountId(raw) {
|
|
2
|
-
|
|
9
|
+
return raw;
|
|
3
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Creates a branded {@link BucketId} from a raw string.
|
|
13
|
+
* @param raw - The raw bucket ID string from the B2 API.
|
|
14
|
+
*
|
|
15
|
+
* @returns A branded BucketId value.
|
|
16
|
+
*/
|
|
4
17
|
function bucketId(raw) {
|
|
5
|
-
|
|
18
|
+
return raw;
|
|
6
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates a branded {@link FileId} from a raw string.
|
|
22
|
+
* @param raw - The raw file ID string from the B2 API.
|
|
23
|
+
*
|
|
24
|
+
* @returns A branded FileId value.
|
|
25
|
+
*/
|
|
7
26
|
function fileId(raw) {
|
|
8
|
-
|
|
27
|
+
return raw;
|
|
9
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates a branded {@link KeyId} from a raw string.
|
|
31
|
+
* @param raw - The raw key ID string from the B2 API.
|
|
32
|
+
*
|
|
33
|
+
* @returns A branded KeyId value.
|
|
34
|
+
*/
|
|
10
35
|
function keyId(raw) {
|
|
11
|
-
|
|
36
|
+
return raw;
|
|
12
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Creates a branded {@link ApplicationKeyId} from a raw string.
|
|
40
|
+
* @param raw - The raw application key ID string from the B2 API.
|
|
41
|
+
*
|
|
42
|
+
* @returns A branded ApplicationKeyId value.
|
|
43
|
+
*/
|
|
13
44
|
function applicationKeyId(raw) {
|
|
14
|
-
|
|
45
|
+
return raw;
|
|
15
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Creates a branded {@link LargeFileId} from a raw string.
|
|
49
|
+
*
|
|
50
|
+
* `LargeFileId` is the same wire-level shape as `FileId` but is a
|
|
51
|
+
* distinct brand so that "ID of an in-progress multipart upload" and
|
|
52
|
+
* "ID of a committed file version" don't get mixed up by accident.
|
|
53
|
+
* `b2_start_large_file` returns one; `b2_finish_large_file` consumes it
|
|
54
|
+
* and produces a regular `FileId`.
|
|
55
|
+
*
|
|
56
|
+
* @param raw - The raw large-file ID string from the B2 API.
|
|
57
|
+
*
|
|
58
|
+
* @returns A branded LargeFileId value.
|
|
59
|
+
*/
|
|
16
60
|
function largeFileId(raw) {
|
|
17
|
-
|
|
61
|
+
return raw;
|
|
18
62
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
fileId,
|
|
24
|
-
keyId,
|
|
25
|
-
largeFileId
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=ids.js.map
|
|
63
|
+
//#endregion
|
|
64
|
+
export { accountId, applicationKeyId, bucketId, fileId, keyId, largeFileId };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=ids.js.map
|
package/dist/types/ids.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.js","sources":["../../src/types/ids.ts"],"sourcesContent":["/**\n * Unique symbol used to brand string types, preventing accidental mixing of different ID types.\n */\ndeclare const __brand: unique symbol\n\n/** Compile-time brand tag interface. Never instantiated at runtime. */\nexport interface BrandTag<B extends string> {\n /** Discriminant tag that makes branded types structurally incompatible. */\n readonly [__brand]: B\n}\n\n/**\n * Utility type that intersects a base type with a branded tag.\n * This pattern ensures that branded types are structurally incompatible with each other\n * even though they share the same underlying representation.\n */\nexport type Brand<T, B extends string> = T & BrandTag<B>\n\n/** Unique identifier for a B2 account. Branded to prevent mixing with other string IDs. */\nexport type AccountId = Brand<string, 'AccountId'>\n\n/** Unique identifier for a B2 bucket. Branded to prevent mixing with other string IDs. */\nexport type BucketId = Brand<string, 'BucketId'>\n\n/** Unique identifier for a B2 file version. Branded to prevent mixing with other string IDs. */\nexport type FileId = Brand<string, 'FileId'>\n\n/** Unique identifier for a B2 application key. Branded to prevent mixing with other string IDs. */\nexport type KeyId = Brand<string, 'KeyId'>\n\n/** Unique identifier for a B2 application key, as returned by the API. Branded to prevent mixing with other string IDs. */\nexport type ApplicationKeyId = Brand<string, 'ApplicationKeyId'>\n\n/** Pre-signed URL for uploading files to a specific bucket. Branded to prevent misuse as a regular string. */\nexport type UploadUrl = Brand<string, 'UploadUrl'>\n\n/** Authorization token scoped to a specific upload URL. Branded to prevent mixing with other tokens. */\nexport type UploadAuthToken = Brand<string, 'UploadAuthToken'>\n\n/** Authorization token for B2 API requests. Branded to prevent mixing with other string values. */\nexport type AuthToken = Brand<string, 'AuthToken'>\n\n/** Unique identifier for a large file upload in progress. Branded to prevent mixing with regular FileId values. */\nexport type LargeFileId = Brand<string, 'LargeFileId'>\n\n/**\n * Creates a branded {@link AccountId} from a raw string.\n * @param raw - The raw account ID string from the B2 API.\n *\n * @returns A branded AccountId value.\n */\nexport function accountId(raw: string): AccountId {\n return raw as AccountId\n}\n\n/**\n * Creates a branded {@link BucketId} from a raw string.\n * @param raw - The raw bucket ID string from the B2 API.\n *\n * @returns A branded BucketId value.\n */\nexport function bucketId(raw: string): BucketId {\n return raw as BucketId\n}\n\n/**\n * Creates a branded {@link FileId} from a raw string.\n * @param raw - The raw file ID string from the B2 API.\n *\n * @returns A branded FileId value.\n */\nexport function fileId(raw: string): FileId {\n return raw as FileId\n}\n\n/**\n * Creates a branded {@link KeyId} from a raw string.\n * @param raw - The raw key ID string from the B2 API.\n *\n * @returns A branded KeyId value.\n */\nexport function keyId(raw: string): KeyId {\n return raw as KeyId\n}\n\n/**\n * Creates a branded {@link ApplicationKeyId} from a raw string.\n * @param raw - The raw application key ID string from the B2 API.\n *\n * @returns A branded ApplicationKeyId value.\n */\nexport function applicationKeyId(raw: string): ApplicationKeyId {\n return raw as ApplicationKeyId\n}\n\n/**\n * Creates a branded {@link LargeFileId} from a raw string.\n *\n * `LargeFileId` is the same wire-level shape as `FileId` but is a\n * distinct brand so that \"ID of an in-progress multipart upload\" and\n * \"ID of a committed file version\" don't get mixed up by accident.\n * `b2_start_large_file` returns one; `b2_finish_large_file` consumes it\n * and produces a regular `FileId`.\n *\n * @param raw - The raw large-file ID string from the B2 API.\n *\n * @returns A branded LargeFileId value.\n */\nexport function largeFileId(raw: string): LargeFileId {\n return raw as LargeFileId\n}\n"],"
|
|
1
|
+
{"version":3,"file":"ids.js","names":[],"sources":["../../src/types/ids.ts"],"sourcesContent":["/**\n * Unique symbol used to brand string types, preventing accidental mixing of different ID types.\n */\ndeclare const __brand: unique symbol\n\n/** Compile-time brand tag interface. Never instantiated at runtime. */\nexport interface BrandTag<B extends string> {\n /** Discriminant tag that makes branded types structurally incompatible. */\n readonly [__brand]: B\n}\n\n/**\n * Utility type that intersects a base type with a branded tag.\n * This pattern ensures that branded types are structurally incompatible with each other\n * even though they share the same underlying representation.\n */\nexport type Brand<T, B extends string> = T & BrandTag<B>\n\n/** Unique identifier for a B2 account. Branded to prevent mixing with other string IDs. */\nexport type AccountId = Brand<string, 'AccountId'>\n\n/** Unique identifier for a B2 bucket. Branded to prevent mixing with other string IDs. */\nexport type BucketId = Brand<string, 'BucketId'>\n\n/** Unique identifier for a B2 file version. Branded to prevent mixing with other string IDs. */\nexport type FileId = Brand<string, 'FileId'>\n\n/** Unique identifier for a B2 application key. Branded to prevent mixing with other string IDs. */\nexport type KeyId = Brand<string, 'KeyId'>\n\n/** Unique identifier for a B2 application key, as returned by the API. Branded to prevent mixing with other string IDs. */\nexport type ApplicationKeyId = Brand<string, 'ApplicationKeyId'>\n\n/** Pre-signed URL for uploading files to a specific bucket. Branded to prevent misuse as a regular string. */\nexport type UploadUrl = Brand<string, 'UploadUrl'>\n\n/** Authorization token scoped to a specific upload URL. Branded to prevent mixing with other tokens. */\nexport type UploadAuthToken = Brand<string, 'UploadAuthToken'>\n\n/** Authorization token for B2 API requests. Branded to prevent mixing with other string values. */\nexport type AuthToken = Brand<string, 'AuthToken'>\n\n/** Unique identifier for a large file upload in progress. Branded to prevent mixing with regular FileId values. */\nexport type LargeFileId = Brand<string, 'LargeFileId'>\n\n/**\n * Creates a branded {@link AccountId} from a raw string.\n * @param raw - The raw account ID string from the B2 API.\n *\n * @returns A branded AccountId value.\n */\nexport function accountId(raw: string): AccountId {\n return raw as AccountId\n}\n\n/**\n * Creates a branded {@link BucketId} from a raw string.\n * @param raw - The raw bucket ID string from the B2 API.\n *\n * @returns A branded BucketId value.\n */\nexport function bucketId(raw: string): BucketId {\n return raw as BucketId\n}\n\n/**\n * Creates a branded {@link FileId} from a raw string.\n * @param raw - The raw file ID string from the B2 API.\n *\n * @returns A branded FileId value.\n */\nexport function fileId(raw: string): FileId {\n return raw as FileId\n}\n\n/**\n * Creates a branded {@link KeyId} from a raw string.\n * @param raw - The raw key ID string from the B2 API.\n *\n * @returns A branded KeyId value.\n */\nexport function keyId(raw: string): KeyId {\n return raw as KeyId\n}\n\n/**\n * Creates a branded {@link ApplicationKeyId} from a raw string.\n * @param raw - The raw application key ID string from the B2 API.\n *\n * @returns A branded ApplicationKeyId value.\n */\nexport function applicationKeyId(raw: string): ApplicationKeyId {\n return raw as ApplicationKeyId\n}\n\n/**\n * Creates a branded {@link LargeFileId} from a raw string.\n *\n * `LargeFileId` is the same wire-level shape as `FileId` but is a\n * distinct brand so that \"ID of an in-progress multipart upload\" and\n * \"ID of a committed file version\" don't get mixed up by accident.\n * `b2_start_large_file` returns one; `b2_finish_large_file` consumes it\n * and produces a regular `FileId`.\n *\n * @param raw - The raw large-file ID string from the B2 API.\n *\n * @returns A branded LargeFileId value.\n */\nexport function largeFileId(raw: string): LargeFileId {\n return raw as LargeFileId\n}\n"],"mappings":";;;;;;;AAmDA,SAAgB,UAAU,KAAwB;CAChD,OAAO;AACT;;;;;;;AAQA,SAAgB,SAAS,KAAuB;CAC9C,OAAO;AACT;;;;;;;AAQA,SAAgB,OAAO,KAAqB;CAC1C,OAAO;AACT;;;;;;;AAQA,SAAgB,MAAM,KAAoB;CACxC,OAAO;AACT;;;;;;;AAQA,SAAgB,iBAAiB,KAA+B;CAC9D,OAAO;AACT;;;;;;;;;;;;;;AAeA,SAAgB,YAAY,KAA0B;CACpD,OAAO;AACT"}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -3,23 +3,24 @@
|
|
|
3
3
|
* Public type definitions for the B2 SDK.
|
|
4
4
|
* Re-exports all branded IDs, request/response interfaces, and configuration types.
|
|
5
5
|
*/
|
|
6
|
-
export type {
|
|
7
|
-
export { accountId, applicationKeyId, bucketId, fileId, keyId, largeFileId } from './ids.js';
|
|
8
|
-
export type { AllowedInfo, ApiInfo, AuthorizeAccountRequest, AuthorizeAccountResponse, GroupsApiInfo, StorageApiInfo, } from './auth.js';
|
|
6
|
+
export type { AllowedBucket, AllowedInfo, ApiInfo, AuthorizeAccountRequest, AuthorizeAccountResponse, GroupsApiInfo, StorageApiInfo, } from './auth.js';
|
|
9
7
|
export { Capability } from './auth.js';
|
|
10
|
-
export type { BucketInfo, BucketRetentionPolicy,
|
|
8
|
+
export type { BucketInfo, BucketRetentionPolicy, CorsRule, CreateBucketRequest, DeleteBucketRequest, LifecycleRule, ListBucketsRequest, ListBucketsResponse, RetentionPeriod, UpdateBucketRequest, } from './bucket.js';
|
|
11
9
|
export { BucketRetentionMode, BucketType, CorsOperation } from './bucket.js';
|
|
12
|
-
export type { CopyFileRequest, CopyPartRequest, CopyPartResponse, DeleteFileVersionRequest, DeleteFileVersionResponse, FileVersion, GetFileInfoRequest, HideFileRequest, ListFileNamesRequest, ListFileNamesResponse, ListFileVersionsRequest, ListFileVersionsResponse, } from './file.js';
|
|
13
|
-
export { FileAction, MetadataDirective } from './file.js';
|
|
14
|
-
export type { CancelLargeFileRequest, CancelLargeFileResponse, FinishLargeFileRequest, GetUploadPartUrlRequest, GetUploadPartUrlResponse, GetUploadUrlRequest, GetUploadUrlResponse, ListPartsRequest, ListPartsResponse, ListUnfinishedLargeFilesRequest, ListUnfinishedLargeFilesResponse, PartInfo, StartLargeFileRequest, StartLargeFileResponse, UnfinishedLargeFile, UploadFileHeaders, UploadPartHeaders, UploadPartResponse, } from './upload.js';
|
|
15
10
|
export type { DownloadAuthorizationRequest, DownloadAuthorizationResponse, DownloadByIdRequest, DownloadByNameRequest, DownloadHeaders, } from './download.js';
|
|
16
|
-
export type { EncryptionSetting, NoEncryption, SseB2Setting, SseCCustomerSetting, } from './encryption.js';
|
|
11
|
+
export type { EncryptionSetting, NoEncryption, NoEncryptionWireSetting, PublicEncryptionSetting, SseB2Setting, SseCCustomerSetting, SseCPublicSetting, } from './encryption.js';
|
|
17
12
|
export { EncryptionAlgorithm, EncryptionKey, EncryptionMode, SSE_B2, SSE_NONE, sseCustomer, } from './encryption.js';
|
|
13
|
+
export type { B2ErrorCode, B2ErrorResponse, KnownB2ErrorCode } from './errors.js';
|
|
14
|
+
export { KNOWN_B2_ERROR_CODES } from './errors.js';
|
|
15
|
+
export type { CopyFileRequest, CopyPartRequest, CopyPartResponse, DeleteFileVersionRequest, DeleteFileVersionResponse, FileVersion, GetFileInfoRequest, HideFileRequest, ListFileNamesRequest, ListFileNamesResponse, ListFileVersionsRequest, ListFileVersionsResponse, } from './file.js';
|
|
16
|
+
export { FileAction, MetadataDirective } from './file.js';
|
|
17
|
+
export type { AccountId, ApplicationKeyId, AuthToken, Brand, BrandTag, BucketId, FileId, KeyId, LargeFileId, UploadAuthToken, UploadUrl, } from './ids.js';
|
|
18
|
+
export { accountId, applicationKeyId, bucketId, fileId, keyId, largeFileId } from './ids.js';
|
|
19
|
+
export type { ApplicationKey, CreateKeyBucketScope, CreateKeyOptions, CreateKeyOptionsBase, CreateKeyRequest, DeleteKeyRequest, FullApplicationKey, ListKeysRequest, ListKeysResponse, } from './key.js';
|
|
18
20
|
export type { FileRetentionValue, UpdateFileLegalHoldRequest, UpdateFileLegalHoldResponse, UpdateFileRetentionRequest, UpdateFileRetentionResponse, } from './lock.js';
|
|
19
21
|
export { LegalHoldValue, RetentionMode } from './lock.js';
|
|
20
|
-
export type { ApplicationKey, CreateKeyRequest, DeleteKeyRequest, FullApplicationKey, ListKeysRequest, ListKeysResponse, } from './key.js';
|
|
21
|
-
export type { ReplicationConfiguration, ReplicationDestination, ReplicationRule, ReplicationSource, } from './replication.js';
|
|
22
22
|
export type { EventNotificationRule, GetBucketNotificationRulesRequest, GetBucketNotificationRulesResponse, SetBucketNotificationRulesRequest, SetBucketNotificationRulesResponse, } from './notifications.js';
|
|
23
23
|
export { EventType } from './notifications.js';
|
|
24
|
-
export type {
|
|
24
|
+
export type { ReplicationConfiguration, ReplicationDestination, ReplicationRule, ReplicationSource, } from './replication.js';
|
|
25
|
+
export type { CancelLargeFileRequest, CancelLargeFileResponse, FinishLargeFileRequest, GetUploadPartUrlRequest, GetUploadPartUrlResponse, GetUploadUrlRequest, GetUploadUrlResponse, ListPartsRequest, ListPartsResponse, ListUnfinishedLargeFilesRequest, ListUnfinishedLargeFilesResponse, PartInfo, ReadableFileRetention, ReadableLegalHold, StartLargeFileRequest, StartLargeFileResponse, UnfinishedLargeFile, UnfinishedLargeFileMetadata, UploadFileHeaders, UploadPartHeaders, UploadPartResponse, } from './upload.js';
|
|
25
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.js"],"names":[],"mappings":"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"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,23 +3,24 @@
|
|
|
3
3
|
* Public type definitions for the B2 SDK.
|
|
4
4
|
* Re-exports all branded IDs, request/response interfaces, and configuration types.
|
|
5
5
|
*/
|
|
6
|
-
export type {
|
|
7
|
-
export { accountId, applicationKeyId, bucketId, fileId, keyId, largeFileId } from './ids.js';
|
|
8
|
-
export type { AllowedInfo, ApiInfo, AuthorizeAccountRequest, AuthorizeAccountResponse, GroupsApiInfo, StorageApiInfo, } from './auth.js';
|
|
6
|
+
export type { AllowedBucket, AllowedInfo, ApiInfo, AuthorizeAccountRequest, AuthorizeAccountResponse, GroupsApiInfo, StorageApiInfo, } from './auth.js';
|
|
9
7
|
export { Capability } from './auth.js';
|
|
10
|
-
export type { BucketInfo, BucketRetentionPolicy,
|
|
8
|
+
export type { BucketInfo, BucketRetentionPolicy, CorsRule, CreateBucketRequest, DeleteBucketRequest, LifecycleRule, ListBucketsRequest, ListBucketsResponse, RetentionPeriod, UpdateBucketRequest, } from './bucket.js';
|
|
11
9
|
export { BucketRetentionMode, BucketType, CorsOperation } from './bucket.js';
|
|
12
|
-
export type { CopyFileRequest, CopyPartRequest, CopyPartResponse, DeleteFileVersionRequest, DeleteFileVersionResponse, FileVersion, GetFileInfoRequest, HideFileRequest, ListFileNamesRequest, ListFileNamesResponse, ListFileVersionsRequest, ListFileVersionsResponse, } from './file.js';
|
|
13
|
-
export { FileAction, MetadataDirective } from './file.js';
|
|
14
|
-
export type { CancelLargeFileRequest, CancelLargeFileResponse, FinishLargeFileRequest, GetUploadPartUrlRequest, GetUploadPartUrlResponse, GetUploadUrlRequest, GetUploadUrlResponse, ListPartsRequest, ListPartsResponse, ListUnfinishedLargeFilesRequest, ListUnfinishedLargeFilesResponse, PartInfo, StartLargeFileRequest, StartLargeFileResponse, UnfinishedLargeFile, UploadFileHeaders, UploadPartHeaders, UploadPartResponse, } from './upload.js';
|
|
15
10
|
export type { DownloadAuthorizationRequest, DownloadAuthorizationResponse, DownloadByIdRequest, DownloadByNameRequest, DownloadHeaders, } from './download.js';
|
|
16
|
-
export type { EncryptionSetting, NoEncryption, SseB2Setting, SseCCustomerSetting, } from './encryption.js';
|
|
11
|
+
export type { EncryptionSetting, NoEncryption, NoEncryptionWireSetting, PublicEncryptionSetting, SseB2Setting, SseCCustomerSetting, SseCPublicSetting, } from './encryption.js';
|
|
17
12
|
export { EncryptionAlgorithm, EncryptionKey, EncryptionMode, SSE_B2, SSE_NONE, sseCustomer, } from './encryption.js';
|
|
13
|
+
export type { B2ErrorCode, B2ErrorResponse, KnownB2ErrorCode } from './errors.js';
|
|
14
|
+
export { KNOWN_B2_ERROR_CODES } from './errors.js';
|
|
15
|
+
export type { CopyFileRequest, CopyPartRequest, CopyPartResponse, DeleteFileVersionRequest, DeleteFileVersionResponse, FileVersion, GetFileInfoRequest, HideFileRequest, ListFileNamesRequest, ListFileNamesResponse, ListFileVersionsRequest, ListFileVersionsResponse, } from './file.js';
|
|
16
|
+
export { FileAction, MetadataDirective } from './file.js';
|
|
17
|
+
export type { AccountId, ApplicationKeyId, AuthToken, Brand, BrandTag, BucketId, FileId, KeyId, LargeFileId, UploadAuthToken, UploadUrl, } from './ids.js';
|
|
18
|
+
export { accountId, applicationKeyId, bucketId, fileId, keyId, largeFileId } from './ids.js';
|
|
19
|
+
export type { ApplicationKey, CreateKeyBucketScope, CreateKeyOptions, CreateKeyOptionsBase, CreateKeyRequest, DeleteKeyRequest, FullApplicationKey, ListKeysRequest, ListKeysResponse, } from './key.js';
|
|
18
20
|
export type { FileRetentionValue, UpdateFileLegalHoldRequest, UpdateFileLegalHoldResponse, UpdateFileRetentionRequest, UpdateFileRetentionResponse, } from './lock.js';
|
|
19
21
|
export { LegalHoldValue, RetentionMode } from './lock.js';
|
|
20
|
-
export type { ApplicationKey, CreateKeyRequest, DeleteKeyRequest, FullApplicationKey, ListKeysRequest, ListKeysResponse, } from './key.js';
|
|
21
|
-
export type { ReplicationConfiguration, ReplicationDestination, ReplicationRule, ReplicationSource, } from './replication.js';
|
|
22
22
|
export type { EventNotificationRule, GetBucketNotificationRulesRequest, GetBucketNotificationRulesResponse, SetBucketNotificationRulesRequest, SetBucketNotificationRulesResponse, } from './notifications.js';
|
|
23
23
|
export { EventType } from './notifications.js';
|
|
24
|
-
export type {
|
|
24
|
+
export type { ReplicationConfiguration, ReplicationDestination, ReplicationRule, ReplicationSource, } from './replication.js';
|
|
25
|
+
export type { CancelLargeFileRequest, CancelLargeFileResponse, FinishLargeFileRequest, GetUploadPartUrlRequest, GetUploadPartUrlResponse, GetUploadUrlRequest, GetUploadUrlResponse, ListPartsRequest, ListPartsResponse, ListUnfinishedLargeFilesRequest, ListUnfinishedLargeFilesResponse, PartInfo, ReadableFileRetention, ReadableLegalHold, StartLargeFileRequest, StartLargeFileResponse, UnfinishedLargeFile, UnfinishedLargeFileMetadata, UploadFileHeaders, UploadPartHeaders, UploadPartResponse, } from './upload.js';
|
|
25
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.js"],"names":[],"mappings":"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"}
|
package/dist/types/key.d.cts
CHANGED
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
import { Capability } from './auth.js';
|
|
2
2
|
import { AccountId, ApplicationKeyId, BucketId } from './ids.js';
|
|
3
|
-
/**
|
|
4
|
-
export interface
|
|
5
|
-
/** Account to create the key for. */
|
|
6
|
-
readonly accountId: AccountId;
|
|
3
|
+
/** Shared request parameters for creating an application key. */
|
|
4
|
+
export interface CreateKeyOptionsBase {
|
|
7
5
|
/** Capabilities to grant to the new key. */
|
|
8
6
|
readonly capabilities: readonly Capability[];
|
|
9
7
|
/** Human-readable name for the key (must be unique within the account). */
|
|
10
8
|
readonly keyName: string;
|
|
11
9
|
/** Optional duration in seconds before the key expires. Omit for a key that never expires. */
|
|
12
10
|
readonly validDurationInSeconds?: number;
|
|
13
|
-
/** Optional bucket restriction. When set, the key only grants access to this bucket. */
|
|
14
|
-
readonly bucketId?: BucketId;
|
|
15
11
|
/** Optional file name prefix restriction. When set, the key only grants access to files with this prefix. */
|
|
16
12
|
readonly namePrefix?: string;
|
|
17
13
|
}
|
|
14
|
+
/** Mutually exclusive bucket scope fields for key creation. */
|
|
15
|
+
export type CreateKeyBucketScope = {
|
|
16
|
+
/**
|
|
17
|
+
* Optional bucket restrictions. A bucket list restricts the key to those
|
|
18
|
+
* buckets; null or omitted grants access to all buckets.
|
|
19
|
+
*/
|
|
20
|
+
readonly bucketIds?: readonly BucketId[] | null;
|
|
21
|
+
/** @deprecated Use `bucketIds: [bucketId]` instead. */
|
|
22
|
+
readonly bucketId?: never;
|
|
23
|
+
} | {
|
|
24
|
+
/**
|
|
25
|
+
* Single-bucket restriction.
|
|
26
|
+
*
|
|
27
|
+
* @deprecated Use `bucketIds: [bucketId]` instead.
|
|
28
|
+
*/
|
|
29
|
+
readonly bucketId: BucketId;
|
|
30
|
+
/** Do not provide `bucketIds` with the deprecated `bucketId` alias. */
|
|
31
|
+
readonly bucketIds?: never;
|
|
32
|
+
};
|
|
33
|
+
/** High-level options for creating an application key. */
|
|
34
|
+
export type CreateKeyOptions = CreateKeyOptionsBase & CreateKeyBucketScope;
|
|
35
|
+
/** Request parameters for the `b2_create_key` API call. Creates a new application key. */
|
|
36
|
+
export type CreateKeyRequest = CreateKeyOptions & {
|
|
37
|
+
/** Account to create the key for. */
|
|
38
|
+
readonly accountId: AccountId;
|
|
39
|
+
};
|
|
18
40
|
/**
|
|
19
41
|
* Full application key including the secret, returned only at creation time by `b2_create_key`.
|
|
20
42
|
* The `applicationKey` secret is never returned again after this response.
|
|
@@ -32,7 +54,14 @@ export interface FullApplicationKey {
|
|
|
32
54
|
readonly accountId: AccountId;
|
|
33
55
|
/** UTC timestamp (milliseconds) when this key expires, or null if it does not expire. */
|
|
34
56
|
readonly expirationTimestamp: number | null;
|
|
35
|
-
/** Bucket
|
|
57
|
+
/** Bucket IDs this key is restricted to, or null if unrestricted. */
|
|
58
|
+
readonly bucketIds: readonly BucketId[] | null;
|
|
59
|
+
/**
|
|
60
|
+
* Bucket ID this key is restricted to when it has exactly one bucket, or null
|
|
61
|
+
* if unrestricted or multi-bucket.
|
|
62
|
+
*
|
|
63
|
+
* @deprecated Use `bucketIds` instead.
|
|
64
|
+
*/
|
|
36
65
|
readonly bucketId: BucketId | null;
|
|
37
66
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
38
67
|
readonly namePrefix: string | null;
|
|
@@ -53,7 +82,14 @@ export interface ApplicationKey {
|
|
|
53
82
|
readonly accountId: AccountId;
|
|
54
83
|
/** UTC timestamp (milliseconds) when this key expires, or null if it does not expire. */
|
|
55
84
|
readonly expirationTimestamp: number | null;
|
|
56
|
-
/** Bucket
|
|
85
|
+
/** Bucket IDs this key is restricted to, or null if unrestricted. */
|
|
86
|
+
readonly bucketIds: readonly BucketId[] | null;
|
|
87
|
+
/**
|
|
88
|
+
* Bucket ID this key is restricted to when it has exactly one bucket, or null
|
|
89
|
+
* if unrestricted or multi-bucket.
|
|
90
|
+
*
|
|
91
|
+
* @deprecated Use `bucketIds` instead.
|
|
92
|
+
*/
|
|
57
93
|
readonly bucketId: BucketId | null;
|
|
58
94
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
59
95
|
readonly namePrefix: string | null;
|
package/dist/types/key.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/types/key.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAErE,
|
|
1
|
+
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/types/key.js"],"names":[],"mappings":"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"}
|
package/dist/types/key.d.ts
CHANGED
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
import { Capability } from './auth.js';
|
|
2
2
|
import { AccountId, ApplicationKeyId, BucketId } from './ids.js';
|
|
3
|
-
/**
|
|
4
|
-
export interface
|
|
5
|
-
/** Account to create the key for. */
|
|
6
|
-
readonly accountId: AccountId;
|
|
3
|
+
/** Shared request parameters for creating an application key. */
|
|
4
|
+
export interface CreateKeyOptionsBase {
|
|
7
5
|
/** Capabilities to grant to the new key. */
|
|
8
6
|
readonly capabilities: readonly Capability[];
|
|
9
7
|
/** Human-readable name for the key (must be unique within the account). */
|
|
10
8
|
readonly keyName: string;
|
|
11
9
|
/** Optional duration in seconds before the key expires. Omit for a key that never expires. */
|
|
12
10
|
readonly validDurationInSeconds?: number;
|
|
13
|
-
/** Optional bucket restriction. When set, the key only grants access to this bucket. */
|
|
14
|
-
readonly bucketId?: BucketId;
|
|
15
11
|
/** Optional file name prefix restriction. When set, the key only grants access to files with this prefix. */
|
|
16
12
|
readonly namePrefix?: string;
|
|
17
13
|
}
|
|
14
|
+
/** Mutually exclusive bucket scope fields for key creation. */
|
|
15
|
+
export type CreateKeyBucketScope = {
|
|
16
|
+
/**
|
|
17
|
+
* Optional bucket restrictions. A bucket list restricts the key to those
|
|
18
|
+
* buckets; null or omitted grants access to all buckets.
|
|
19
|
+
*/
|
|
20
|
+
readonly bucketIds?: readonly BucketId[] | null;
|
|
21
|
+
/** @deprecated Use `bucketIds: [bucketId]` instead. */
|
|
22
|
+
readonly bucketId?: never;
|
|
23
|
+
} | {
|
|
24
|
+
/**
|
|
25
|
+
* Single-bucket restriction.
|
|
26
|
+
*
|
|
27
|
+
* @deprecated Use `bucketIds: [bucketId]` instead.
|
|
28
|
+
*/
|
|
29
|
+
readonly bucketId: BucketId;
|
|
30
|
+
/** Do not provide `bucketIds` with the deprecated `bucketId` alias. */
|
|
31
|
+
readonly bucketIds?: never;
|
|
32
|
+
};
|
|
33
|
+
/** High-level options for creating an application key. */
|
|
34
|
+
export type CreateKeyOptions = CreateKeyOptionsBase & CreateKeyBucketScope;
|
|
35
|
+
/** Request parameters for the `b2_create_key` API call. Creates a new application key. */
|
|
36
|
+
export type CreateKeyRequest = CreateKeyOptions & {
|
|
37
|
+
/** Account to create the key for. */
|
|
38
|
+
readonly accountId: AccountId;
|
|
39
|
+
};
|
|
18
40
|
/**
|
|
19
41
|
* Full application key including the secret, returned only at creation time by `b2_create_key`.
|
|
20
42
|
* The `applicationKey` secret is never returned again after this response.
|
|
@@ -32,7 +54,14 @@ export interface FullApplicationKey {
|
|
|
32
54
|
readonly accountId: AccountId;
|
|
33
55
|
/** UTC timestamp (milliseconds) when this key expires, or null if it does not expire. */
|
|
34
56
|
readonly expirationTimestamp: number | null;
|
|
35
|
-
/** Bucket
|
|
57
|
+
/** Bucket IDs this key is restricted to, or null if unrestricted. */
|
|
58
|
+
readonly bucketIds: readonly BucketId[] | null;
|
|
59
|
+
/**
|
|
60
|
+
* Bucket ID this key is restricted to when it has exactly one bucket, or null
|
|
61
|
+
* if unrestricted or multi-bucket.
|
|
62
|
+
*
|
|
63
|
+
* @deprecated Use `bucketIds` instead.
|
|
64
|
+
*/
|
|
36
65
|
readonly bucketId: BucketId | null;
|
|
37
66
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
38
67
|
readonly namePrefix: string | null;
|
|
@@ -53,7 +82,14 @@ export interface ApplicationKey {
|
|
|
53
82
|
readonly accountId: AccountId;
|
|
54
83
|
/** UTC timestamp (milliseconds) when this key expires, or null if it does not expire. */
|
|
55
84
|
readonly expirationTimestamp: number | null;
|
|
56
|
-
/** Bucket
|
|
85
|
+
/** Bucket IDs this key is restricted to, or null if unrestricted. */
|
|
86
|
+
readonly bucketIds: readonly BucketId[] | null;
|
|
87
|
+
/**
|
|
88
|
+
* Bucket ID this key is restricted to when it has exactly one bucket, or null
|
|
89
|
+
* if unrestricted or multi-bucket.
|
|
90
|
+
*
|
|
91
|
+
* @deprecated Use `bucketIds` instead.
|
|
92
|
+
*/
|
|
57
93
|
readonly bucketId: BucketId | null;
|
|
58
94
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
59
95
|
readonly namePrefix: string | null;
|
package/dist/types/key.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/types/key.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAErE,
|
|
1
|
+
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/types/key.js"],"names":[],"mappings":"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"}
|
package/dist/types/lock.cjs
CHANGED
|
@@ -1,17 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region src/types/lock.ts
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the file-level Object Lock retention mode.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* await object.setRetention(fileId, {
|
|
8
|
+
* mode: RetentionMode.Compliance,
|
|
9
|
+
* retainUntilTimestamp: Date.now() + 86_400_000,
|
|
10
|
+
* })
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
var RetentionMode = {
|
|
14
|
+
/** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */
|
|
15
|
+
Compliance: "compliance",
|
|
16
|
+
/** Locked: can be shortened by callers holding the `bypassGovernance` capability. */
|
|
17
|
+
Governance: "governance"
|
|
8
18
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Named constants for the file legal-hold status.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* await object.setLegalHold(fileId, LegalHoldValue.On)
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
var LegalHoldValue = {
|
|
28
|
+
/** Apply the legal hold. */
|
|
29
|
+
On: "on",
|
|
30
|
+
/** Remove the legal hold. */
|
|
31
|
+
Off: "off"
|
|
14
32
|
};
|
|
33
|
+
//#endregion
|
|
15
34
|
exports.LegalHoldValue = LegalHoldValue;
|
|
16
35
|
exports.RetentionMode = RetentionMode;
|
|
17
|
-
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=lock.cjs.map
|
package/dist/types/lock.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.cjs","sources":["../../src/types/lock.ts"],"sourcesContent":["import type { FileId } from './ids.ts'\n\n/**\n * Named constants for the file-level Object Lock retention mode.\n *\n * @example\n * ```ts\n * await object.setRetention(fileId, {\n * mode: RetentionMode.Compliance,\n * retainUntilTimestamp: Date.now() + 86_400_000,\n * })\n * ```\n */\nexport const RetentionMode = {\n /** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */\n Compliance: 'compliance',\n /** Locked: can be shortened by callers holding the `bypassGovernance` capability. */\n Governance: 'governance',\n} as const\n\n/** File-level Object Lock retention mode. Derived from {@link RetentionMode}. */\nexport type RetentionMode = (typeof RetentionMode)[keyof typeof RetentionMode]\n\n/**\n * Named constants for the file legal-hold status.\n *\n * @example\n * ```ts\n * await object.setLegalHold(fileId, LegalHoldValue.On)\n * ```\n */\nexport const LegalHoldValue = {\n /** Apply the legal hold. */\n On: 'on',\n /** Remove the legal hold. */\n Off: 'off',\n} as const\n\n/** Legal hold status for a file. Derived from {@link LegalHoldValue}. */\nexport type LegalHoldValue = (typeof LegalHoldValue)[keyof typeof LegalHoldValue]\n\n/** Retention settings for a specific file version under Object Lock. */\nexport interface FileRetentionValue {\n /** Retention mode, or null if no retention is set. */\n readonly mode: RetentionMode | null\n /** UTC timestamp (milliseconds) until which the file is retained, or null if not set. */\n readonly retainUntilTimestamp: number | null\n}\n\n/**\n * Request parameters for the `b2_update_file_retention` API call.\n * Updates the Object Lock retention settings on a file version.\n */\nexport interface UpdateFileRetentionRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New retention settings for the file. */\n readonly fileRetention: FileRetentionValue\n /**\n * When `true`, allows shortening a governance-mode retention period. Requires\n * the `bypassGovernance` capability on the application key. Has no effect on\n * compliance-mode retention.\n */\n readonly bypassGovernance?: boolean\n}\n\n/**\n * Request parameters for the `b2_update_file_legal_hold` API call.\n * Updates the legal hold status on a file version.\n */\nexport interface UpdateFileLegalHoldRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New legal hold status: `'on'` or `'off'`. */\n readonly legalHold: LegalHoldValue\n}\n\n/** Response from the `b2_update_file_retention` API call. */\nexport interface UpdateFileRetentionResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Retention settings as applied. */\n readonly fileRetention: FileRetentionValue\n}\n\n/** Response from the `b2_update_file_legal_hold` API call. */\nexport interface UpdateFileLegalHoldResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Legal hold status as applied. */\n readonly legalHold: LegalHoldValue\n}\n"],"
|
|
1
|
+
{"version":3,"file":"lock.cjs","names":[],"sources":["../../src/types/lock.ts"],"sourcesContent":["import type { FileId } from './ids.ts'\n\n/**\n * Named constants for the file-level Object Lock retention mode.\n *\n * @example\n * ```ts\n * await object.setRetention(fileId, {\n * mode: RetentionMode.Compliance,\n * retainUntilTimestamp: Date.now() + 86_400_000,\n * })\n * ```\n */\nexport const RetentionMode = {\n /** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */\n Compliance: 'compliance',\n /** Locked: can be shortened by callers holding the `bypassGovernance` capability. */\n Governance: 'governance',\n} as const\n\n/** File-level Object Lock retention mode. Derived from {@link RetentionMode}. */\nexport type RetentionMode = (typeof RetentionMode)[keyof typeof RetentionMode]\n\n/**\n * Named constants for the file legal-hold status.\n *\n * @example\n * ```ts\n * await object.setLegalHold(fileId, LegalHoldValue.On)\n * ```\n */\nexport const LegalHoldValue = {\n /** Apply the legal hold. */\n On: 'on',\n /** Remove the legal hold. */\n Off: 'off',\n} as const\n\n/** Legal hold status for a file. Derived from {@link LegalHoldValue}. */\nexport type LegalHoldValue = (typeof LegalHoldValue)[keyof typeof LegalHoldValue]\n\n/** Retention settings for a specific file version under Object Lock. */\nexport interface FileRetentionValue {\n /** Retention mode, or null if no retention is set. */\n readonly mode: RetentionMode | null\n /** UTC timestamp (milliseconds) until which the file is retained, or null if not set. */\n readonly retainUntilTimestamp: number | null\n}\n\n/**\n * Request parameters for the `b2_update_file_retention` API call.\n * Updates the Object Lock retention settings on a file version.\n */\nexport interface UpdateFileRetentionRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New retention settings for the file. */\n readonly fileRetention: FileRetentionValue\n /**\n * When `true`, allows shortening a governance-mode retention period. Requires\n * the `bypassGovernance` capability on the application key. Has no effect on\n * compliance-mode retention.\n */\n readonly bypassGovernance?: boolean\n}\n\n/**\n * Request parameters for the `b2_update_file_legal_hold` API call.\n * Updates the legal hold status on a file version.\n */\nexport interface UpdateFileLegalHoldRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New legal hold status: `'on'` or `'off'`. */\n readonly legalHold: LegalHoldValue\n}\n\n/** Response from the `b2_update_file_retention` API call. */\nexport interface UpdateFileRetentionResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Retention settings as applied. */\n readonly fileRetention: FileRetentionValue\n}\n\n/** Response from the `b2_update_file_legal_hold` API call. */\nexport interface UpdateFileLegalHoldResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Legal hold status as applied. */\n readonly legalHold: LegalHoldValue\n}\n"],"mappings":";;;;;;;;;;;;AAaA,IAAa,gBAAgB;;CAE3B,YAAY;;CAEZ,YAAY;AACd;;;;;;;;;AAaA,IAAa,iBAAiB;;CAE5B,IAAI;;CAEJ,KAAK;AACP"}
|