@backblaze-labs/b2-sdk 0.1.0 → 0.3.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 +151 -5
- package/README.md +163 -34
- 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/backup/client.cjs +206 -0
- package/dist/backup/client.cjs.map +1 -0
- package/dist/backup/client.d.cts +238 -0
- package/dist/backup/client.d.cts.map +1 -0
- package/dist/backup/client.d.ts +238 -0
- package/dist/backup/client.d.ts.map +1 -0
- package/dist/backup/client.js +206 -0
- package/dist/backup/client.js.map +1 -0
- package/dist/backup/index.cjs +15 -0
- package/dist/backup/index.d.cts +22 -0
- package/dist/backup/index.d.cts.map +1 -0
- package/dist/backup/index.d.ts +22 -0
- package/dist/backup/index.d.ts.map +1 -0
- package/dist/backup/index.js +7 -0
- package/dist/backup/raw.cjs +146 -0
- package/dist/backup/raw.cjs.map +1 -0
- package/dist/backup/raw.d.cts +122 -0
- package/dist/backup/raw.d.cts.map +1 -0
- package/dist/backup/raw.d.ts +122 -0
- package/dist/backup/raw.d.ts.map +1 -0
- package/dist/backup/raw.js +146 -0
- package/dist/backup/raw.js.map +1 -0
- package/dist/bucket.cjs +786 -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 +781 -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 +116 -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 +114 -69
- package/dist/copy/large.js.map +1 -1
- package/dist/download/checksum.cjs +93 -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 +91 -0
- package/dist/download/checksum.js.map +1 -0
- package/dist/download/parallel.cjs +251 -118
- package/dist/download/parallel.cjs.map +1 -1
- package/dist/download/parallel.d.cts +13 -2
- package/dist/download/parallel.d.cts.map +1 -1
- package/dist/download/parallel.d.ts +13 -2
- package/dist/download/parallel.d.ts.map +1 -1
- package/dist/download/parallel.js +249 -116
- package/dist/download/parallel.js.map +1 -1
- package/dist/download/single.cjs +323 -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 +322 -99
- package/dist/download/single.js.map +1 -1
- package/dist/errors/index.cjs +869 -243
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts +404 -82
- package/dist/errors/index.d.cts.map +1 -1
- package/dist/errors/index.d.ts +404 -82
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +835 -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 +476 -140
- package/dist/http/transport.cjs.map +1 -1
- package/dist/http/transport.d.cts +46 -5
- package/dist/http/transport.d.cts.map +1 -1
- package/dist/http/transport.d.ts +46 -5
- package/dist/http/transport.d.ts.map +1 -1
- package/dist/http/transport.js +474 -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 +124 -77
- package/dist/index.d.cts +29 -21
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +29 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -72
- 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 +13 -57
- package/dist/object.d.cts.map +1 -1
- package/dist/object.d.ts +13 -57
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +249 -206
- package/dist/object.js.map +1 -1
- package/dist/partner/account-info.d.cts +43 -0
- package/dist/partner/account-info.d.cts.map +1 -0
- package/dist/partner/account-info.d.ts +43 -0
- package/dist/partner/account-info.d.ts.map +1 -0
- package/dist/partner/auth-clone.cjs +64 -0
- package/dist/partner/auth-clone.cjs.map +1 -0
- package/dist/partner/auth-clone.d.cts +27 -0
- package/dist/partner/auth-clone.d.cts.map +1 -0
- package/dist/partner/auth-clone.d.ts +27 -0
- package/dist/partner/auth-clone.d.ts.map +1 -0
- package/dist/partner/auth-clone.js +63 -0
- package/dist/partner/auth-clone.js.map +1 -0
- package/dist/partner/auth-core.cjs +175 -0
- package/dist/partner/auth-core.cjs.map +1 -0
- package/dist/partner/auth-core.d.cts +111 -0
- package/dist/partner/auth-core.d.cts.map +1 -0
- package/dist/partner/auth-core.d.ts +111 -0
- package/dist/partner/auth-core.d.ts.map +1 -0
- package/dist/partner/auth-core.js +175 -0
- package/dist/partner/auth-core.js.map +1 -0
- package/dist/partner/auth-shape.cjs +36 -0
- package/dist/partner/auth-shape.cjs.map +1 -0
- package/dist/partner/auth-shape.d.cts +12 -0
- package/dist/partner/auth-shape.d.cts.map +1 -0
- package/dist/partner/auth-shape.d.ts +12 -0
- package/dist/partner/auth-shape.d.ts.map +1 -0
- package/dist/partner/auth-shape.js +36 -0
- package/dist/partner/auth-shape.js.map +1 -0
- package/dist/partner/client.cjs +255 -0
- package/dist/partner/client.cjs.map +1 -0
- package/dist/partner/client.d.cts +335 -0
- package/dist/partner/client.d.cts.map +1 -0
- package/dist/partner/client.d.ts +335 -0
- package/dist/partner/client.d.ts.map +1 -0
- package/dist/partner/client.js +255 -0
- package/dist/partner/client.js.map +1 -0
- package/dist/partner/endpoint-url.cjs +108 -0
- package/dist/partner/endpoint-url.cjs.map +1 -0
- package/dist/partner/endpoint-url.d.cts +72 -0
- package/dist/partner/endpoint-url.d.cts.map +1 -0
- package/dist/partner/endpoint-url.d.ts +72 -0
- package/dist/partner/endpoint-url.d.ts.map +1 -0
- package/dist/partner/endpoint-url.js +105 -0
- package/dist/partner/endpoint-url.js.map +1 -0
- package/dist/partner/in-memory.cjs +135 -0
- package/dist/partner/in-memory.cjs.map +1 -0
- package/dist/partner/in-memory.d.cts +99 -0
- package/dist/partner/in-memory.d.cts.map +1 -0
- package/dist/partner/in-memory.d.ts +99 -0
- package/dist/partner/in-memory.d.ts.map +1 -0
- package/dist/partner/in-memory.js +135 -0
- package/dist/partner/in-memory.js.map +1 -0
- package/dist/partner/index.cjs +18 -0
- package/dist/partner/index.d.cts +23 -0
- package/dist/partner/index.d.cts.map +1 -0
- package/dist/partner/index.d.ts +23 -0
- package/dist/partner/index.d.ts.map +1 -0
- package/dist/partner/index.js +7 -0
- package/dist/partner/raw.cjs +392 -0
- package/dist/partner/raw.cjs.map +1 -0
- package/dist/partner/raw.d.cts +223 -0
- package/dist/partner/raw.d.cts.map +1 -0
- package/dist/partner/raw.d.ts +223 -0
- package/dist/partner/raw.d.ts.map +1 -0
- package/dist/partner/raw.js +390 -0
- package/dist/partner/raw.js.map +1 -0
- package/dist/partner/redaction-placeholders.cjs +10 -0
- package/dist/partner/redaction-placeholders.cjs.map +1 -0
- package/dist/partner/redaction-placeholders.d.cts +5 -0
- package/dist/partner/redaction-placeholders.d.cts.map +1 -0
- package/dist/partner/redaction-placeholders.d.ts +5 -0
- package/dist/partner/redaction-placeholders.d.ts.map +1 -0
- package/dist/partner/redaction-placeholders.js +9 -0
- package/dist/partner/redaction-placeholders.js.map +1 -0
- package/dist/partner/redaction.cjs +267 -0
- package/dist/partner/redaction.cjs.map +1 -0
- package/dist/partner/redaction.d.cts +124 -0
- package/dist/partner/redaction.d.cts.map +1 -0
- package/dist/partner/redaction.d.ts +124 -0
- package/dist/partner/redaction.d.ts.map +1 -0
- package/dist/partner/redaction.js +257 -0
- package/dist/partner/redaction.js.map +1 -0
- 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 +740 -587
- package/dist/raw/index.cjs.map +1 -1
- package/dist/raw/index.d.cts +126 -19
- package/dist/raw/index.d.cts.map +1 -1
- package/dist/raw/index.d.ts +126 -19
- package/dist/raw/index.d.ts.map +1 -1
- package/dist/raw/index.js +736 -589
- package/dist/raw/index.js.map +1 -1
- package/dist/raw/url.cjs +111 -0
- package/dist/raw/url.cjs.map +1 -0
- package/dist/raw/url.d.cts +41 -0
- package/dist/raw/url.d.cts.map +1 -0
- package/dist/raw/url.d.ts +41 -0
- package/dist/raw/url.d.ts.map +1 -0
- package/dist/raw/url.js +110 -0
- package/dist/raw/url.js.map +1 -0
- 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 +154 -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 +153 -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 +3114 -1547
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.d.cts +186 -20
- package/dist/simulator/index.d.cts.map +1 -1
- package/dist/simulator/index.d.ts +186 -20
- package/dist/simulator/index.d.ts.map +1 -1
- package/dist/simulator/index.js +3098 -1545
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/partner.cjs +719 -0
- package/dist/simulator/partner.cjs.map +1 -0
- package/dist/simulator/partner.d.cts +183 -0
- package/dist/simulator/partner.d.cts.map +1 -0
- package/dist/simulator/partner.d.ts +183 -0
- package/dist/simulator/partner.d.ts.map +1 -0
- package/dist/simulator/partner.js +718 -0
- package/dist/simulator/partner.js.map +1 -0
- package/dist/simulator/validation.cjs +772 -157
- package/dist/simulator/validation.cjs.map +1 -1
- package/dist/simulator/validation.d.cts +120 -21
- package/dist/simulator/validation.d.cts.map +1 -1
- package/dist/simulator/validation.d.ts +120 -21
- package/dist/simulator/validation.d.ts.map +1 -1
- package/dist/simulator/validation.js +755 -167
- 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 +3 -11
- 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 +317 -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 +313 -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 +152 -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 +149 -0
- package/dist/sync/b2-sha1-reader.js.map +1 -0
- package/dist/sync/download-staging.cjs +266 -0
- package/dist/sync/download-staging.cjs.map +1 -0
- package/dist/sync/download-staging.d.cts +55 -0
- package/dist/sync/download-staging.d.cts.map +1 -0
- package/dist/sync/download-staging.d.ts +55 -0
- package/dist/sync/download-staging.d.ts.map +1 -0
- package/dist/sync/download-staging.js +260 -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 +369 -0
- package/dist/sync/local-file-io.cjs.map +1 -0
- package/dist/sync/local-file-io.d.cts +76 -0
- package/dist/sync/local-file-io.d.cts.map +1 -0
- package/dist/sync/local-file-io.d.ts +76 -0
- package/dist/sync/local-file-io.d.ts.map +1 -0
- package/dist/sync/local-file-io.js +365 -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 +110 -0
- package/dist/sync/local-sha1.cjs.map +1 -0
- package/dist/sync/local-sha1.d.cts +31 -0
- package/dist/sync/local-sha1.d.cts.map +1 -0
- package/dist/sync/local-sha1.d.ts +31 -0
- package/dist/sync/local-sha1.d.ts.map +1 -0
- package/dist/sync/local-sha1.js +109 -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 +391 -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 +389 -13
- package/dist/sync/policies/compare.js.map +1 -1
- package/dist/sync/policies/index.cjs +70 -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 +70 -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 +783 -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 +780 -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 +80 -56
- package/dist/types/auth.cjs.map +1 -1
- package/dist/types/auth.d.cts +71 -9
- package/dist/types/auth.d.cts.map +1 -1
- package/dist/types/auth.d.ts +71 -9
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/auth.js +81 -57
- package/dist/types/auth.js.map +1 -1
- package/dist/types/backup.d.cts +80 -0
- package/dist/types/backup.d.cts.map +1 -0
- package/dist/types/backup.d.ts +80 -0
- package/dist/types/backup.d.ts.map +1 -0
- package/dist/types/bucket.cjs +74 -38
- package/dist/types/bucket.cjs.map +1 -1
- package/dist/types/bucket.d.cts +4 -2
- package/dist/types/bucket.d.cts.map +1 -1
- package/dist/types/bucket.d.ts +4 -2
- package/dist/types/bucket.d.ts.map +1 -1
- package/dist/types/bucket.js +75 -41
- package/dist/types/bucket.js.map +1 -1
- package/dist/types/download.cjs +62 -0
- package/dist/types/download.cjs.map +1 -0
- package/dist/types/download.d.cts +98 -0
- package/dist/types/download.d.cts.map +1 -1
- package/dist/types/download.d.ts +98 -0
- package/dist/types/download.d.ts.map +1 -1
- package/dist/types/download.js +61 -0
- package/dist/types/download.js.map +1 -0
- package/dist/types/encryption.cjs +194 -328
- package/dist/types/encryption.cjs.map +1 -1
- package/dist/types/encryption.d.cts +48 -0
- package/dist/types/encryption.d.cts.map +1 -1
- package/dist/types/encryption.d.ts +48 -0
- package/dist/types/encryption.d.ts.map +1 -1
- package/dist/types/encryption.js +192 -311
- package/dist/types/encryption.js.map +1 -1
- package/dist/types/errors.cjs +56 -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 +56 -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 +17 -4
- package/dist/types/file.d.cts.map +1 -1
- package/dist/types/file.d.ts +17 -4
- 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 +83 -9
- package/dist/types/ids.cjs.map +1 -1
- package/dist/types/ids.d.cts +32 -0
- package/dist/types/ids.d.cts.map +1 -1
- package/dist/types/ids.d.ts +32 -0
- package/dist/types/ids.d.ts.map +1 -1
- package/dist/types/ids.js +82 -16
- package/dist/types/ids.js.map +1 -1
- package/dist/types/index.d.cts +18 -13
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +18 -13
- 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.d.cts +14 -0
- package/dist/types/lock.d.cts.map +1 -1
- package/dist/types/lock.d.ts +14 -0
- package/dist/types/lock.d.ts.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.d.cts +5 -3
- package/dist/types/notifications.d.cts.map +1 -1
- package/dist/types/notifications.d.ts +5 -3
- package/dist/types/notifications.d.ts.map +1 -1
- package/dist/types/notifications.js +45 -23
- package/dist/types/notifications.js.map +1 -1
- package/dist/types/partner.cjs +32 -0
- package/dist/types/partner.cjs.map +1 -0
- package/dist/types/partner.d.cts +394 -0
- package/dist/types/partner.d.cts.map +1 -0
- package/dist/types/partner.d.ts +394 -0
- package/dist/types/partner.d.ts.map +1 -0
- package/dist/types/partner.js +29 -0
- package/dist/types/partner.js.map +1 -0
- package/dist/types/upload.d.cts +53 -6
- package/dist/types/upload.d.cts.map +1 -1
- package/dist/types/upload.d.ts +53 -6
- package/dist/types/upload.d.ts.map +1 -1
- package/dist/upload/abort-scope.cjs +46 -0
- package/dist/upload/abort-scope.cjs.map +1 -0
- package/dist/upload/abort-scope.d.cts +26 -0
- package/dist/upload/abort-scope.d.cts.map +1 -0
- package/dist/upload/abort-scope.d.ts +26 -0
- package/dist/upload/abort-scope.d.ts.map +1 -0
- package/dist/upload/abort-scope.js +45 -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 +54 -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 +54 -0
- package/dist/upload/finish.js.map +1 -0
- package/dist/upload/large.cjs +305 -218
- package/dist/upload/large.cjs.map +1 -1
- package/dist/upload/large.d.cts +90 -9
- package/dist/upload/large.d.cts.map +1 -1
- package/dist/upload/large.d.ts +90 -9
- package/dist/upload/large.d.ts.map +1 -1
- package/dist/upload/large.js +305 -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 +116 -0
- package/dist/upload/options.d.cts.map +1 -0
- package/dist/upload/options.d.ts +116 -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 +334 -33
- package/dist/upload/resume.cjs.map +1 -1
- package/dist/upload/resume.d.cts +84 -12
- package/dist/upload/resume.d.cts.map +1 -1
- package/dist/upload/resume.d.ts +84 -12
- package/dist/upload/resume.d.ts.map +1 -1
- package/dist/upload/resume.js +331 -33
- package/dist/upload/resume.js.map +1 -1
- package/dist/upload/retry.cjs +191 -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 +187 -0
- package/dist/upload/retry.js.map +1 -0
- package/dist/upload/single.cjs +69 -44
- package/dist/upload/single.cjs.map +1 -1
- package/dist/upload/single.d.cts +8 -1
- package/dist/upload/single.d.cts.map +1 -1
- package/dist/upload/single.d.ts +8 -1
- package/dist/upload/single.d.ts.map +1 -1
- package/dist/upload/single.js +69 -44
- package/dist/upload/single.js.map +1 -1
- package/dist/upload/stream.cjs +319 -193
- package/dist/upload/stream.cjs.map +1 -1
- package/dist/upload/stream.d.cts +9 -1
- package/dist/upload/stream.d.cts.map +1 -1
- package/dist/upload/stream.d.ts +9 -1
- package/dist/upload/stream.d.ts.map +1 -1
- package/dist/upload/stream.js +318 -192
- package/dist/upload/stream.js.map +1 -1
- package/dist/util/abort.cjs +114 -0
- package/dist/util/abort.cjs.map +1 -0
- package/dist/util/abort.d.cts +65 -0
- package/dist/util/abort.d.cts.map +1 -0
- package/dist/util/abort.d.ts +65 -0
- package/dist/util/abort.d.ts.map +1 -0
- package/dist/util/abort.js +109 -0
- package/dist/util/abort.js.map +1 -0
- 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 +28 -9
- package/dist/util/defaults.cjs.map +1 -1
- package/dist/util/defaults.d.cts +2 -0
- package/dist/util/defaults.d.cts.map +1 -1
- package/dist/util/defaults.d.ts +2 -0
- package/dist/util/defaults.d.ts.map +1 -1
- package/dist/util/defaults.js +28 -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/md5.cjs +211 -0
- package/dist/util/md5.cjs.map +1 -0
- package/dist/util/md5.d.cts +43 -0
- package/dist/util/md5.d.cts.map +1 -0
- package/dist/util/md5.d.ts +43 -0
- package/dist/util/md5.d.ts.map +1 -0
- package/dist/util/md5.js +209 -0
- package/dist/util/md5.js.map +1 -0
- package/dist/util/normalize.cjs +66 -7
- package/dist/util/normalize.cjs.map +1 -1
- package/dist/util/normalize.d.cts +7 -7
- package/dist/util/normalize.d.cts.map +1 -1
- package/dist/util/normalize.d.ts +7 -7
- package/dist/util/normalize.d.ts.map +1 -1
- package/dist/util/normalize.js +67 -10
- package/dist/util/normalize.js.map +1 -1
- package/dist/util/paginator.cjs +69 -14
- package/dist/util/paginator.cjs.map +1 -1
- package/dist/util/paginator.d.cts +3 -1
- package/dist/util/paginator.d.cts.map +1 -1
- package/dist/util/paginator.d.ts +3 -1
- package/dist/util/paginator.d.ts.map +1 -1
- package/dist/util/paginator.js +70 -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 +45 -20
- 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/errors.d.cts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* B2 API error codes documented by the SDK.
|
|
3
|
+
* This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback
|
|
4
|
+
* so callers can receive unknown future server codes while keeping autocomplete
|
|
5
|
+
* for known values.
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
+
export declare const KNOWN_B2_ERROR_CODES: readonly ["expired_auth_token", "bad_auth_token", "unauthorized", "bad_request", "bad_bucket_name", "bad_bucket_id", "not_found", "method_not_allowed", "request_timeout", "too_many_requests", "conflict", "duplicate_bucket_name", "too_many_buckets", "too_many_files", "too_many_members", "cap_exceeded", "storage_cap_exceeded", "transaction_cap_exceeded", "download_cap_exceeded", "access_denied", "service_unavailable", "internal_error", "bad_json", "invalid_account_id", "invalid_bucket_id", "invalid_bucket_name", "invalid_bucket_info", "invalid_computer_id", "invalid_email", "invalid_group_id", "invalid_member_account_id", "invalid_region", "invalid_sms_phone", "file_not_present", "no_such_file", "out_of_range", "range_not_satisfiable", "invalid_file_id", "invalid_file_name", "invalid_file_info", "invalid_part_number", "method_failure", "bad_sha1_checksum"];
|
|
8
|
+
/** B2 error codes documented by the SDK and classified exhaustively. */
|
|
9
|
+
export type KnownB2ErrorCode = (typeof KNOWN_B2_ERROR_CODES)[number];
|
|
10
|
+
/**
|
|
11
|
+
* B2 API error code value.
|
|
12
|
+
* Known codes are enumerated for autocomplete; unknown future server codes are
|
|
13
|
+
* still accepted as strings.
|
|
14
|
+
*/
|
|
15
|
+
export type B2ErrorCode = KnownB2ErrorCode | (string & {});
|
|
7
16
|
/** Standard error response body returned by the B2 API on failure. */
|
|
8
17
|
export interface B2ErrorResponse {
|
|
9
18
|
/** HTTP status code from the B2 API response. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,o2BA4CvB,CAAA;AAEV,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAE1D,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB"}
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* B2 API error codes documented by the SDK.
|
|
3
|
+
* This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback
|
|
4
|
+
* so callers can receive unknown future server codes while keeping autocomplete
|
|
5
|
+
* for known values.
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
+
export declare const KNOWN_B2_ERROR_CODES: readonly ["expired_auth_token", "bad_auth_token", "unauthorized", "bad_request", "bad_bucket_name", "bad_bucket_id", "not_found", "method_not_allowed", "request_timeout", "too_many_requests", "conflict", "duplicate_bucket_name", "too_many_buckets", "too_many_files", "too_many_members", "cap_exceeded", "storage_cap_exceeded", "transaction_cap_exceeded", "download_cap_exceeded", "access_denied", "service_unavailable", "internal_error", "bad_json", "invalid_account_id", "invalid_bucket_id", "invalid_bucket_name", "invalid_bucket_info", "invalid_computer_id", "invalid_email", "invalid_group_id", "invalid_member_account_id", "invalid_region", "invalid_sms_phone", "file_not_present", "no_such_file", "out_of_range", "range_not_satisfiable", "invalid_file_id", "invalid_file_name", "invalid_file_info", "invalid_part_number", "method_failure", "bad_sha1_checksum"];
|
|
8
|
+
/** B2 error codes documented by the SDK and classified exhaustively. */
|
|
9
|
+
export type KnownB2ErrorCode = (typeof KNOWN_B2_ERROR_CODES)[number];
|
|
10
|
+
/**
|
|
11
|
+
* B2 API error code value.
|
|
12
|
+
* Known codes are enumerated for autocomplete; unknown future server codes are
|
|
13
|
+
* still accepted as strings.
|
|
14
|
+
*/
|
|
15
|
+
export type B2ErrorCode = KnownB2ErrorCode | (string & {});
|
|
7
16
|
/** Standard error response body returned by the B2 API on failure. */
|
|
8
17
|
export interface B2ErrorResponse {
|
|
9
18
|
/** HTTP status code from the B2 API response. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,o2BA4CvB,CAAA;AAEV,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAE1D,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region src/types/errors.ts
|
|
2
|
+
/**
|
|
3
|
+
* B2 API error codes documented by the SDK.
|
|
4
|
+
* This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback
|
|
5
|
+
* so callers can receive unknown future server codes while keeping autocomplete
|
|
6
|
+
* for known values.
|
|
7
|
+
*/
|
|
8
|
+
var KNOWN_B2_ERROR_CODES = [
|
|
9
|
+
"expired_auth_token",
|
|
10
|
+
"bad_auth_token",
|
|
11
|
+
"unauthorized",
|
|
12
|
+
"bad_request",
|
|
13
|
+
"bad_bucket_name",
|
|
14
|
+
"bad_bucket_id",
|
|
15
|
+
"not_found",
|
|
16
|
+
"method_not_allowed",
|
|
17
|
+
"request_timeout",
|
|
18
|
+
"too_many_requests",
|
|
19
|
+
"conflict",
|
|
20
|
+
"duplicate_bucket_name",
|
|
21
|
+
"too_many_buckets",
|
|
22
|
+
"too_many_files",
|
|
23
|
+
"too_many_members",
|
|
24
|
+
"cap_exceeded",
|
|
25
|
+
"storage_cap_exceeded",
|
|
26
|
+
"transaction_cap_exceeded",
|
|
27
|
+
"download_cap_exceeded",
|
|
28
|
+
"access_denied",
|
|
29
|
+
"service_unavailable",
|
|
30
|
+
"internal_error",
|
|
31
|
+
"bad_json",
|
|
32
|
+
"invalid_account_id",
|
|
33
|
+
"invalid_bucket_id",
|
|
34
|
+
"invalid_bucket_name",
|
|
35
|
+
"invalid_bucket_info",
|
|
36
|
+
"invalid_computer_id",
|
|
37
|
+
"invalid_email",
|
|
38
|
+
"invalid_group_id",
|
|
39
|
+
"invalid_member_account_id",
|
|
40
|
+
"invalid_region",
|
|
41
|
+
"invalid_sms_phone",
|
|
42
|
+
"file_not_present",
|
|
43
|
+
"no_such_file",
|
|
44
|
+
"out_of_range",
|
|
45
|
+
"range_not_satisfiable",
|
|
46
|
+
"invalid_file_id",
|
|
47
|
+
"invalid_file_name",
|
|
48
|
+
"invalid_file_info",
|
|
49
|
+
"invalid_part_number",
|
|
50
|
+
"method_failure",
|
|
51
|
+
"bad_sha1_checksum"
|
|
52
|
+
];
|
|
53
|
+
//#endregion
|
|
54
|
+
export { KNOWN_B2_ERROR_CODES };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","names":[],"sources":["../../src/types/errors.ts"],"sourcesContent":["/**\n * B2 API error codes documented by the SDK.\n * This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback\n * so callers can receive unknown future server codes while keeping autocomplete\n * for known values.\n */\nexport const KNOWN_B2_ERROR_CODES = [\n 'expired_auth_token',\n 'bad_auth_token',\n 'unauthorized',\n 'bad_request',\n 'bad_bucket_name',\n 'bad_bucket_id',\n 'not_found',\n 'method_not_allowed',\n 'request_timeout',\n 'too_many_requests',\n 'conflict',\n 'duplicate_bucket_name',\n 'too_many_buckets',\n 'too_many_files',\n 'too_many_members',\n 'cap_exceeded',\n 'storage_cap_exceeded',\n 'transaction_cap_exceeded',\n 'download_cap_exceeded',\n 'access_denied',\n 'service_unavailable',\n 'internal_error',\n 'bad_json',\n 'invalid_account_id',\n 'invalid_bucket_id',\n 'invalid_bucket_name',\n 'invalid_bucket_info',\n 'invalid_computer_id',\n 'invalid_email',\n 'invalid_group_id',\n 'invalid_member_account_id',\n 'invalid_region',\n 'invalid_sms_phone',\n 'file_not_present',\n 'no_such_file',\n 'out_of_range',\n 'range_not_satisfiable',\n 'invalid_file_id',\n 'invalid_file_name',\n 'invalid_file_info',\n 'invalid_part_number',\n 'method_failure',\n 'bad_sha1_checksum',\n] as const\n\n/** B2 error codes documented by the SDK and classified exhaustively. */\nexport type KnownB2ErrorCode = (typeof KNOWN_B2_ERROR_CODES)[number]\n\n/**\n * B2 API error code value.\n * Known codes are enumerated for autocomplete; unknown future server codes are\n * still accepted as strings.\n */\nexport type B2ErrorCode = KnownB2ErrorCode | (string & {})\n\n/** Standard error response body returned by the B2 API on failure. */\nexport interface B2ErrorResponse {\n /** HTTP status code from the B2 API response. */\n readonly status: number\n /** Machine-readable error code identifying the specific failure. */\n readonly code: B2ErrorCode\n /** Human-readable description of the error. */\n readonly message: string\n}\n"],"mappings":";;;;;;;AAMA,IAAa,uBAAuB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
package/dist/types/file.cjs
CHANGED
|
@@ -1,23 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
//#region src/types/file.ts
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the action that created a file version.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* if (file.action === FileAction.Hide) { ... }
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
var FileAction = {
|
|
11
|
+
/** Large file upload started but not yet finished. */
|
|
12
|
+
Start: "start",
|
|
13
|
+
/** Normal upload (small or finished large file). */
|
|
14
|
+
Upload: "upload",
|
|
15
|
+
/** Hide marker (soft delete). */
|
|
16
|
+
Hide: "hide",
|
|
17
|
+
/** Virtual folder marker. */
|
|
18
|
+
Folder: "folder",
|
|
19
|
+
/** Created via server-side copy. */
|
|
20
|
+
Copy: "copy"
|
|
14
21
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Named constants for how metadata is handled during a file copy.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
var MetadataDirective = {
|
|
31
|
+
/** Preserve the source file's contentType and fileInfo. */
|
|
32
|
+
Copy: "COPY",
|
|
33
|
+
/** Use the values provided in the copy request. */
|
|
34
|
+
Replace: "REPLACE"
|
|
20
35
|
};
|
|
36
|
+
//#endregion
|
|
21
37
|
exports.FileAction = FileAction;
|
|
22
38
|
exports.MetadataDirective = MetadataDirective;
|
|
23
|
-
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=file.cjs.map
|
package/dist/types/file.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.cjs","sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status, or null if replication is not configured. */\n readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: EncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n}\n"],"names":[],"mappings":";;AAYO,MAAM,aAAa;AAAA;AAAA,EAExB,OAAO;AAAA;AAAA,EAEP,QAAQ;AAAA;AAAA,EAER,MAAM;AAAA;AAAA,EAEN,QAAQ;AAAA;AAAA,EAER,MAAM;AACR;AAqJO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,MAAM;AAAA;AAAA,EAEN,SAAS;AACX;;;"}
|
|
1
|
+
{"version":3,"file":"file.cjs","names":[],"sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting, PublicEncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Replication status for a file version or unfinished large file.\n *\n * B2 returns these uppercase wire values as-is and omits the containing\n * `replicationStatus` field when the file is not covered by a replication rule.\n */\nexport type ReplicationStatus = 'PENDING' | 'COMPLETED' | 'FAILED' | 'REPLICA'\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status when this file is covered by a replication rule. */\n readonly replicationStatus?: ReplicationStatus\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: PublicEncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n /** MD5 checksum of the copied part content, or null if not available. */\n readonly contentMd5: string | null\n /** Server-side encryption applied to this copied part. */\n readonly serverSideEncryption: PublicEncryptionSetting\n /** UTC timestamp (milliseconds) when this part was copied. */\n readonly uploadTimestamp: number\n}\n"],"mappings":";;;;;;;;;AAYA,IAAa,aAAa;;CAExB,OAAO;;CAEP,QAAQ;;CAER,MAAM;;CAEN,QAAQ;;CAER,MAAM;AACR;;;;;;;;;AA6JA,IAAa,oBAAoB;;CAE/B,MAAM;;CAEN,SAAS;AACX"}
|
package/dist/types/file.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EncryptionSetting } from './encryption.js';
|
|
1
|
+
import { EncryptionSetting, PublicEncryptionSetting } from './encryption.js';
|
|
2
2
|
import { AccountId, BucketId, FileId } from './ids.js';
|
|
3
3
|
import { FileRetentionValue, LegalHoldValue } from './lock.js';
|
|
4
4
|
/**
|
|
@@ -31,6 +31,13 @@ export declare const FileAction: {
|
|
|
31
31
|
* - `'copy'`: file was created via server-side copy.
|
|
32
32
|
*/
|
|
33
33
|
export type FileAction = (typeof FileAction)[keyof typeof FileAction];
|
|
34
|
+
/**
|
|
35
|
+
* Replication status for a file version or unfinished large file.
|
|
36
|
+
*
|
|
37
|
+
* B2 returns these uppercase wire values as-is and omits the containing
|
|
38
|
+
* `replicationStatus` field when the file is not covered by a replication rule.
|
|
39
|
+
*/
|
|
40
|
+
export type ReplicationStatus = 'PENDING' | 'COMPLETED' | 'FAILED' | 'REPLICA';
|
|
34
41
|
/**
|
|
35
42
|
* Complete metadata for a single file version in B2.
|
|
36
43
|
* Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,
|
|
@@ -71,10 +78,10 @@ export interface FileVersion {
|
|
|
71
78
|
/** Legal hold value, or null if the caller lacks read authorization. */
|
|
72
79
|
readonly value: LegalHoldValue | null;
|
|
73
80
|
};
|
|
74
|
-
/** Replication status
|
|
75
|
-
readonly replicationStatus
|
|
81
|
+
/** Replication status when this file is covered by a replication rule. */
|
|
82
|
+
readonly replicationStatus?: ReplicationStatus;
|
|
76
83
|
/** Server-side encryption settings applied to this file version. */
|
|
77
|
-
readonly serverSideEncryption:
|
|
84
|
+
readonly serverSideEncryption: PublicEncryptionSetting;
|
|
78
85
|
/** UTC timestamp (milliseconds) when this version was uploaded. */
|
|
79
86
|
readonly uploadTimestamp: number;
|
|
80
87
|
}
|
|
@@ -216,5 +223,11 @@ export interface CopyPartResponse {
|
|
|
216
223
|
readonly contentLength: number;
|
|
217
224
|
/** SHA-1 checksum of the copied part content. */
|
|
218
225
|
readonly contentSha1: string;
|
|
226
|
+
/** MD5 checksum of the copied part content, or null if not available. */
|
|
227
|
+
readonly contentMd5: string | null;
|
|
228
|
+
/** Server-side encryption applied to this copied part. */
|
|
229
|
+
readonly serverSideEncryption: PublicEncryptionSetting;
|
|
230
|
+
/** UTC timestamp (milliseconds) when this part was copied. */
|
|
231
|
+
readonly uploadTimestamp: number;
|
|
219
232
|
}
|
|
220
233
|
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/types/file.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/types/file.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;IACrB,sDAAsD;;IAEtD,oDAAoD;;IAEpD,iCAAiC;;IAEjC,6BAA6B;;IAE7B,oCAAoC;;CAE5B,CAAA;AAEV;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAErE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE9E;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,QAAQ,CAAC,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,EAAE,uBAAuB,CAAA;IACtD,8DAA8D;IAC9D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CACjC"}
|
package/dist/types/file.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EncryptionSetting } from './encryption.js';
|
|
1
|
+
import { EncryptionSetting, PublicEncryptionSetting } from './encryption.js';
|
|
2
2
|
import { AccountId, BucketId, FileId } from './ids.js';
|
|
3
3
|
import { FileRetentionValue, LegalHoldValue } from './lock.js';
|
|
4
4
|
/**
|
|
@@ -31,6 +31,13 @@ export declare const FileAction: {
|
|
|
31
31
|
* - `'copy'`: file was created via server-side copy.
|
|
32
32
|
*/
|
|
33
33
|
export type FileAction = (typeof FileAction)[keyof typeof FileAction];
|
|
34
|
+
/**
|
|
35
|
+
* Replication status for a file version or unfinished large file.
|
|
36
|
+
*
|
|
37
|
+
* B2 returns these uppercase wire values as-is and omits the containing
|
|
38
|
+
* `replicationStatus` field when the file is not covered by a replication rule.
|
|
39
|
+
*/
|
|
40
|
+
export type ReplicationStatus = 'PENDING' | 'COMPLETED' | 'FAILED' | 'REPLICA';
|
|
34
41
|
/**
|
|
35
42
|
* Complete metadata for a single file version in B2.
|
|
36
43
|
* Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,
|
|
@@ -71,10 +78,10 @@ export interface FileVersion {
|
|
|
71
78
|
/** Legal hold value, or null if the caller lacks read authorization. */
|
|
72
79
|
readonly value: LegalHoldValue | null;
|
|
73
80
|
};
|
|
74
|
-
/** Replication status
|
|
75
|
-
readonly replicationStatus
|
|
81
|
+
/** Replication status when this file is covered by a replication rule. */
|
|
82
|
+
readonly replicationStatus?: ReplicationStatus;
|
|
76
83
|
/** Server-side encryption settings applied to this file version. */
|
|
77
|
-
readonly serverSideEncryption:
|
|
84
|
+
readonly serverSideEncryption: PublicEncryptionSetting;
|
|
78
85
|
/** UTC timestamp (milliseconds) when this version was uploaded. */
|
|
79
86
|
readonly uploadTimestamp: number;
|
|
80
87
|
}
|
|
@@ -216,5 +223,11 @@ export interface CopyPartResponse {
|
|
|
216
223
|
readonly contentLength: number;
|
|
217
224
|
/** SHA-1 checksum of the copied part content. */
|
|
218
225
|
readonly contentSha1: string;
|
|
226
|
+
/** MD5 checksum of the copied part content, or null if not available. */
|
|
227
|
+
readonly contentMd5: string | null;
|
|
228
|
+
/** Server-side encryption applied to this copied part. */
|
|
229
|
+
readonly serverSideEncryption: PublicEncryptionSetting;
|
|
230
|
+
/** UTC timestamp (milliseconds) when this part was copied. */
|
|
231
|
+
readonly uploadTimestamp: number;
|
|
219
232
|
}
|
|
220
233
|
//# sourceMappingURL=file.d.ts.map
|
package/dist/types/file.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/types/file.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/types/file.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;IACrB,sDAAsD;;IAEtD,oDAAoD;;IAEpD,iCAAiC;;IAEjC,6BAA6B;;IAE7B,oCAAoC;;CAE5B,CAAA;AAEV;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAErE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAA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AAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,0DAA0D;IAC1D,QAAQ,CAAC,oBAAoB,EAAE,uBAAuB,CAAA;IACtD,8DAA8D;IAC9D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CACjC"}
|
package/dist/types/file.js
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
//#region src/types/file.ts
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the action that created a file version.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* if (file.action === FileAction.Hide) { ... }
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
var FileAction = {
|
|
11
|
+
/** Large file upload started but not yet finished. */
|
|
12
|
+
Start: "start",
|
|
13
|
+
/** Normal upload (small or finished large file). */
|
|
14
|
+
Upload: "upload",
|
|
15
|
+
/** Hide marker (soft delete). */
|
|
16
|
+
Hide: "hide",
|
|
17
|
+
/** Virtual folder marker. */
|
|
18
|
+
Folder: "folder",
|
|
19
|
+
/** Created via server-side copy. */
|
|
20
|
+
Copy: "copy"
|
|
12
21
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Named constants for how metadata is handled during a file copy.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
var MetadataDirective = {
|
|
31
|
+
/** Preserve the source file's contentType and fileInfo. */
|
|
32
|
+
Copy: "COPY",
|
|
33
|
+
/** Use the values provided in the copy request. */
|
|
34
|
+
Replace: "REPLACE"
|
|
18
35
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=file.js.map
|
|
36
|
+
//#endregion
|
|
37
|
+
export { FileAction, MetadataDirective };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=file.js.map
|
package/dist/types/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status, or null if replication is not configured. */\n readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: EncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n}\n"],"names":[],"mappings":"AAYO,MAAM,aAAa;AAAA;AAAA,EAExB,OAAO;AAAA;AAAA,EAEP,QAAQ;AAAA;AAAA,EAER,MAAM;AAAA;AAAA,EAEN,QAAQ;AAAA;AAAA,EAER,MAAM;AACR;AAqJO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,MAAM;AAAA;AAAA,EAEN,SAAS;AACX;"}
|
|
1
|
+
{"version":3,"file":"file.js","names":[],"sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting, PublicEncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Replication status for a file version or unfinished large file.\n *\n * B2 returns these uppercase wire values as-is and omits the containing\n * `replicationStatus` field when the file is not covered by a replication rule.\n */\nexport type ReplicationStatus = 'PENDING' | 'COMPLETED' | 'FAILED' | 'REPLICA'\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status when this file is covered by a replication rule. */\n readonly replicationStatus?: ReplicationStatus\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: PublicEncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n /** MD5 checksum of the copied part content, or null if not available. */\n readonly contentMd5: string | null\n /** Server-side encryption applied to this copied part. */\n readonly serverSideEncryption: PublicEncryptionSetting\n /** UTC timestamp (milliseconds) when this part was copied. */\n readonly uploadTimestamp: number\n}\n"],"mappings":";;;;;;;;;AAYA,IAAa,aAAa;;CAExB,OAAO;;CAEP,QAAQ;;CAER,MAAM;;CAEN,QAAQ;;CAER,MAAM;AACR;;;;;;;;;AA6JA,IAAa,oBAAoB;;CAE/B,MAAM;;CAEN,SAAS;AACX"}
|
package/dist/types/ids.cjs
CHANGED
|
@@ -1,27 +1,101 @@
|
|
|
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 GroupId} from a raw string.
|
|
49
|
+
* @param raw - The raw group ID string from the Partner API.
|
|
50
|
+
*
|
|
51
|
+
* @returns A branded GroupId value.
|
|
52
|
+
*/
|
|
53
|
+
function groupId(raw) {
|
|
54
|
+
return raw;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Creates a branded {@link ComputerId} from a raw string.
|
|
58
|
+
* @param raw - The raw computer ID string from the Computer Backup API.
|
|
59
|
+
*
|
|
60
|
+
* @returns A branded ComputerId value.
|
|
61
|
+
*/
|
|
62
|
+
function computerId(raw) {
|
|
63
|
+
return raw;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates a branded {@link PartnerToken} from a raw authorization token string.
|
|
67
|
+
* @param raw - The raw Partner/Backup authorization token from the B2 API.
|
|
68
|
+
*
|
|
69
|
+
* @returns A branded PartnerToken value.
|
|
70
|
+
*/
|
|
71
|
+
function partnerToken(raw) {
|
|
72
|
+
return raw;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Creates a branded {@link LargeFileId} from a raw string.
|
|
76
|
+
*
|
|
77
|
+
* `LargeFileId` is the same wire-level shape as `FileId` but is a
|
|
78
|
+
* distinct brand so that "ID of an in-progress multipart upload" and
|
|
79
|
+
* "ID of a committed file version" don't get mixed up by accident.
|
|
80
|
+
* `b2_start_large_file` returns one; `b2_finish_large_file` consumes it
|
|
81
|
+
* and produces a regular `FileId`.
|
|
82
|
+
*
|
|
83
|
+
* @param raw - The raw large-file ID string from the B2 API.
|
|
84
|
+
*
|
|
85
|
+
* @returns A branded LargeFileId value.
|
|
86
|
+
*/
|
|
18
87
|
function largeFileId(raw) {
|
|
19
|
-
|
|
88
|
+
return raw;
|
|
20
89
|
}
|
|
90
|
+
//#endregion
|
|
21
91
|
exports.accountId = accountId;
|
|
22
92
|
exports.applicationKeyId = applicationKeyId;
|
|
23
93
|
exports.bucketId = bucketId;
|
|
94
|
+
exports.computerId = computerId;
|
|
24
95
|
exports.fileId = fileId;
|
|
96
|
+
exports.groupId = groupId;
|
|
25
97
|
exports.keyId = keyId;
|
|
26
98
|
exports.largeFileId = largeFileId;
|
|
27
|
-
|
|
99
|
+
exports.partnerToken = partnerToken;
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=ids.cjs.map
|