@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
|
@@ -1,28 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/util/plan-ranges.ts
|
|
2
|
+
/**
|
|
3
|
+
* Lays out a sequence of contiguous, non-overlapping byte ranges over
|
|
4
|
+
* `[0, totalSize)`. Every produced range is at most `chunkSize` bytes
|
|
5
|
+
* long; the final range may be shorter if `totalSize` is not a multiple
|
|
6
|
+
* of `chunkSize`.
|
|
7
|
+
*
|
|
8
|
+
* Replaces three near-identical hand-rolled loops in
|
|
9
|
+
* `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`.
|
|
10
|
+
*
|
|
11
|
+
* @param totalSize - Total number of bytes to cover.
|
|
12
|
+
* @param chunkSize - Target size of each range in bytes (last range may be smaller).
|
|
13
|
+
*
|
|
14
|
+
* @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`.
|
|
15
|
+
*/
|
|
3
16
|
function planRanges(totalSize, chunkSize) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const plans = [];
|
|
18
|
+
let offset = 0;
|
|
19
|
+
let index = 0;
|
|
20
|
+
while (offset < totalSize) {
|
|
21
|
+
const length = Math.min(chunkSize, totalSize - offset);
|
|
22
|
+
const end = offset + length - 1;
|
|
23
|
+
plans.push({
|
|
24
|
+
partNumber: index + 1,
|
|
25
|
+
index,
|
|
26
|
+
offset,
|
|
27
|
+
length,
|
|
28
|
+
start: offset,
|
|
29
|
+
end
|
|
30
|
+
});
|
|
31
|
+
offset += length;
|
|
32
|
+
index++;
|
|
33
|
+
}
|
|
34
|
+
return plans;
|
|
22
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Format an HTTP `Range:` request-header value covering the given
|
|
38
|
+
* inclusive byte offsets. Centralises the `bytes=<start>-<end>` template
|
|
39
|
+
* so the upload, copy, and download paths agree on syntax.
|
|
40
|
+
*
|
|
41
|
+
* @param start - Inclusive starting byte.
|
|
42
|
+
* @param end - Inclusive ending byte.
|
|
43
|
+
*
|
|
44
|
+
* @returns The header value (e.g. `'bytes=0-99'`).
|
|
45
|
+
*/
|
|
23
46
|
function byteRangeHeader(start, end) {
|
|
24
|
-
|
|
47
|
+
return `bytes=${start}-${end}`;
|
|
25
48
|
}
|
|
49
|
+
//#endregion
|
|
26
50
|
exports.byteRangeHeader = byteRangeHeader;
|
|
27
51
|
exports.planRanges = planRanges;
|
|
28
|
-
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=plan-ranges.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-ranges.cjs","sources":["../../src/util/plan-ranges.ts"],"sourcesContent":["/**\n * Inclusive byte range plan for a single chunk of a larger sequence.\n *\n * Carries every commonly-needed shape so the three call sites (multipart\n * upload, server-side multipart copy, parallel-ranged download) can\n * destructure the fields they want without re-deriving them:\n *\n * - `partNumber` is 1-based to match the B2 `b2_upload_part` /\n * `b2_copy_part` wire format.\n * - `index` is 0-based for callers that key into a `Map` or array slot.\n * - `offset` + `length` are the upload-style framing (where in the\n * source to read, how many bytes).\n * - `start` + `end` (both inclusive) are the HTTP `Range:` /\n * `Content-Range:` framing.\n */\nexport interface RangePlan {\n /** 1-based part number for B2 multipart endpoints. */\n readonly partNumber: number\n /** 0-based slot index for in-memory bookkeeping. */\n readonly index: number\n /** Inclusive byte offset where this range begins. */\n readonly offset: number\n /** Number of bytes in this range. */\n readonly length: number\n /** Alias for {@link offset} — convenient for `bytes=start-end` formatters. */\n readonly start: number\n /** Inclusive byte offset where this range ends (`offset + length - 1`). */\n readonly end: number\n}\n\n/**\n * Lays out a sequence of contiguous, non-overlapping byte ranges over\n * `[0, totalSize)`. Every produced range is at most `chunkSize` bytes\n * long; the final range may be shorter if `totalSize` is not a multiple\n * of `chunkSize`.\n *\n * Replaces three near-identical hand-rolled loops in\n * `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`.\n *\n * @param totalSize - Total number of bytes to cover.\n * @param chunkSize - Target size of each range in bytes (last range may be smaller).\n *\n * @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`.\n */\nexport function planRanges(totalSize: number, chunkSize: number): RangePlan[] {\n const plans: RangePlan[] = []\n let offset = 0\n let index = 0\n while (offset < totalSize) {\n const length = Math.min(chunkSize, totalSize - offset)\n const end = offset + length - 1\n plans.push({\n partNumber: index + 1,\n index,\n offset,\n length,\n start: offset,\n end,\n })\n offset += length\n index++\n }\n return plans\n}\n\n/**\n * Format an HTTP `Range:` request-header value covering the given\n * inclusive byte offsets. Centralises the `bytes=<start>-<end>` template\n * so the upload, copy, and download paths agree on syntax.\n *\n * @param start - Inclusive starting byte.\n * @param end - Inclusive ending byte.\n *\n * @returns The header value (e.g. `'bytes=0-99'`).\n */\nexport function byteRangeHeader(start: number, end: number): string {\n return `bytes=${start}-${end}`\n}\n"],"
|
|
1
|
+
{"version":3,"file":"plan-ranges.cjs","names":[],"sources":["../../src/util/plan-ranges.ts"],"sourcesContent":["/**\n * Inclusive byte range plan for a single chunk of a larger sequence.\n *\n * Carries every commonly-needed shape so the three call sites (multipart\n * upload, server-side multipart copy, parallel-ranged download) can\n * destructure the fields they want without re-deriving them:\n *\n * - `partNumber` is 1-based to match the B2 `b2_upload_part` /\n * `b2_copy_part` wire format.\n * - `index` is 0-based for callers that key into a `Map` or array slot.\n * - `offset` + `length` are the upload-style framing (where in the\n * source to read, how many bytes).\n * - `start` + `end` (both inclusive) are the HTTP `Range:` /\n * `Content-Range:` framing.\n */\nexport interface RangePlan {\n /** 1-based part number for B2 multipart endpoints. */\n readonly partNumber: number\n /** 0-based slot index for in-memory bookkeeping. */\n readonly index: number\n /** Inclusive byte offset where this range begins. */\n readonly offset: number\n /** Number of bytes in this range. */\n readonly length: number\n /** Alias for {@link offset} — convenient for `bytes=start-end` formatters. */\n readonly start: number\n /** Inclusive byte offset where this range ends (`offset + length - 1`). */\n readonly end: number\n}\n\n/**\n * Lays out a sequence of contiguous, non-overlapping byte ranges over\n * `[0, totalSize)`. Every produced range is at most `chunkSize` bytes\n * long; the final range may be shorter if `totalSize` is not a multiple\n * of `chunkSize`.\n *\n * Replaces three near-identical hand-rolled loops in\n * `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`.\n *\n * @param totalSize - Total number of bytes to cover.\n * @param chunkSize - Target size of each range in bytes (last range may be smaller).\n *\n * @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`.\n */\nexport function planRanges(totalSize: number, chunkSize: number): RangePlan[] {\n const plans: RangePlan[] = []\n let offset = 0\n let index = 0\n while (offset < totalSize) {\n const length = Math.min(chunkSize, totalSize - offset)\n const end = offset + length - 1\n plans.push({\n partNumber: index + 1,\n index,\n offset,\n length,\n start: offset,\n end,\n })\n offset += length\n index++\n }\n return plans\n}\n\n/**\n * Format an HTTP `Range:` request-header value covering the given\n * inclusive byte offsets. Centralises the `bytes=<start>-<end>` template\n * so the upload, copy, and download paths agree on syntax.\n *\n * @param start - Inclusive starting byte.\n * @param end - Inclusive ending byte.\n *\n * @returns The header value (e.g. `'bytes=0-99'`).\n */\nexport function byteRangeHeader(start: number, end: number): string {\n return `bytes=${start}-${end}`\n}\n"],"mappings":";;;;;;;;;;;;;;;AA4CA,SAAgB,WAAW,WAAmB,WAAgC;CAC5E,MAAM,QAAqB,CAAC;CAC5B,IAAI,SAAS;CACb,IAAI,QAAQ;CACZ,OAAO,SAAS,WAAW;EACzB,MAAM,SAAS,KAAK,IAAI,WAAW,YAAY,MAAM;EACrD,MAAM,MAAM,SAAS,SAAS;EAC9B,MAAM,KAAK;GACT,YAAY,QAAQ;GACpB;GACA;GACA;GACA,OAAO;GACP;EACF,CAAC;EACD,UAAU;EACV;CACF;CACA,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,gBAAgB,OAAe,KAAqB;CAClE,OAAO,SAAS,MAAM,GAAG;AAC3B"}
|
package/dist/util/plan-ranges.js
CHANGED
|
@@ -1,28 +1,52 @@
|
|
|
1
|
+
//#region src/util/plan-ranges.ts
|
|
2
|
+
/**
|
|
3
|
+
* Lays out a sequence of contiguous, non-overlapping byte ranges over
|
|
4
|
+
* `[0, totalSize)`. Every produced range is at most `chunkSize` bytes
|
|
5
|
+
* long; the final range may be shorter if `totalSize` is not a multiple
|
|
6
|
+
* of `chunkSize`.
|
|
7
|
+
*
|
|
8
|
+
* Replaces three near-identical hand-rolled loops in
|
|
9
|
+
* `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`.
|
|
10
|
+
*
|
|
11
|
+
* @param totalSize - Total number of bytes to cover.
|
|
12
|
+
* @param chunkSize - Target size of each range in bytes (last range may be smaller).
|
|
13
|
+
*
|
|
14
|
+
* @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`.
|
|
15
|
+
*/
|
|
1
16
|
function planRanges(totalSize, chunkSize) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const plans = [];
|
|
18
|
+
let offset = 0;
|
|
19
|
+
let index = 0;
|
|
20
|
+
while (offset < totalSize) {
|
|
21
|
+
const length = Math.min(chunkSize, totalSize - offset);
|
|
22
|
+
const end = offset + length - 1;
|
|
23
|
+
plans.push({
|
|
24
|
+
partNumber: index + 1,
|
|
25
|
+
index,
|
|
26
|
+
offset,
|
|
27
|
+
length,
|
|
28
|
+
start: offset,
|
|
29
|
+
end
|
|
30
|
+
});
|
|
31
|
+
offset += length;
|
|
32
|
+
index++;
|
|
33
|
+
}
|
|
34
|
+
return plans;
|
|
20
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Format an HTTP `Range:` request-header value covering the given
|
|
38
|
+
* inclusive byte offsets. Centralises the `bytes=<start>-<end>` template
|
|
39
|
+
* so the upload, copy, and download paths agree on syntax.
|
|
40
|
+
*
|
|
41
|
+
* @param start - Inclusive starting byte.
|
|
42
|
+
* @param end - Inclusive ending byte.
|
|
43
|
+
*
|
|
44
|
+
* @returns The header value (e.g. `'bytes=0-99'`).
|
|
45
|
+
*/
|
|
21
46
|
function byteRangeHeader(start, end) {
|
|
22
|
-
|
|
47
|
+
return `bytes=${start}-${end}`;
|
|
23
48
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=plan-ranges.js.map
|
|
49
|
+
//#endregion
|
|
50
|
+
export { byteRangeHeader, planRanges };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=plan-ranges.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-ranges.js","sources":["../../src/util/plan-ranges.ts"],"sourcesContent":["/**\n * Inclusive byte range plan for a single chunk of a larger sequence.\n *\n * Carries every commonly-needed shape so the three call sites (multipart\n * upload, server-side multipart copy, parallel-ranged download) can\n * destructure the fields they want without re-deriving them:\n *\n * - `partNumber` is 1-based to match the B2 `b2_upload_part` /\n * `b2_copy_part` wire format.\n * - `index` is 0-based for callers that key into a `Map` or array slot.\n * - `offset` + `length` are the upload-style framing (where in the\n * source to read, how many bytes).\n * - `start` + `end` (both inclusive) are the HTTP `Range:` /\n * `Content-Range:` framing.\n */\nexport interface RangePlan {\n /** 1-based part number for B2 multipart endpoints. */\n readonly partNumber: number\n /** 0-based slot index for in-memory bookkeeping. */\n readonly index: number\n /** Inclusive byte offset where this range begins. */\n readonly offset: number\n /** Number of bytes in this range. */\n readonly length: number\n /** Alias for {@link offset} — convenient for `bytes=start-end` formatters. */\n readonly start: number\n /** Inclusive byte offset where this range ends (`offset + length - 1`). */\n readonly end: number\n}\n\n/**\n * Lays out a sequence of contiguous, non-overlapping byte ranges over\n * `[0, totalSize)`. Every produced range is at most `chunkSize` bytes\n * long; the final range may be shorter if `totalSize` is not a multiple\n * of `chunkSize`.\n *\n * Replaces three near-identical hand-rolled loops in\n * `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`.\n *\n * @param totalSize - Total number of bytes to cover.\n * @param chunkSize - Target size of each range in bytes (last range may be smaller).\n *\n * @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`.\n */\nexport function planRanges(totalSize: number, chunkSize: number): RangePlan[] {\n const plans: RangePlan[] = []\n let offset = 0\n let index = 0\n while (offset < totalSize) {\n const length = Math.min(chunkSize, totalSize - offset)\n const end = offset + length - 1\n plans.push({\n partNumber: index + 1,\n index,\n offset,\n length,\n start: offset,\n end,\n })\n offset += length\n index++\n }\n return plans\n}\n\n/**\n * Format an HTTP `Range:` request-header value covering the given\n * inclusive byte offsets. Centralises the `bytes=<start>-<end>` template\n * so the upload, copy, and download paths agree on syntax.\n *\n * @param start - Inclusive starting byte.\n * @param end - Inclusive ending byte.\n *\n * @returns The header value (e.g. `'bytes=0-99'`).\n */\nexport function byteRangeHeader(start: number, end: number): string {\n return `bytes=${start}-${end}`\n}\n"],"
|
|
1
|
+
{"version":3,"file":"plan-ranges.js","names":[],"sources":["../../src/util/plan-ranges.ts"],"sourcesContent":["/**\n * Inclusive byte range plan for a single chunk of a larger sequence.\n *\n * Carries every commonly-needed shape so the three call sites (multipart\n * upload, server-side multipart copy, parallel-ranged download) can\n * destructure the fields they want without re-deriving them:\n *\n * - `partNumber` is 1-based to match the B2 `b2_upload_part` /\n * `b2_copy_part` wire format.\n * - `index` is 0-based for callers that key into a `Map` or array slot.\n * - `offset` + `length` are the upload-style framing (where in the\n * source to read, how many bytes).\n * - `start` + `end` (both inclusive) are the HTTP `Range:` /\n * `Content-Range:` framing.\n */\nexport interface RangePlan {\n /** 1-based part number for B2 multipart endpoints. */\n readonly partNumber: number\n /** 0-based slot index for in-memory bookkeeping. */\n readonly index: number\n /** Inclusive byte offset where this range begins. */\n readonly offset: number\n /** Number of bytes in this range. */\n readonly length: number\n /** Alias for {@link offset} — convenient for `bytes=start-end` formatters. */\n readonly start: number\n /** Inclusive byte offset where this range ends (`offset + length - 1`). */\n readonly end: number\n}\n\n/**\n * Lays out a sequence of contiguous, non-overlapping byte ranges over\n * `[0, totalSize)`. Every produced range is at most `chunkSize` bytes\n * long; the final range may be shorter if `totalSize` is not a multiple\n * of `chunkSize`.\n *\n * Replaces three near-identical hand-rolled loops in\n * `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`.\n *\n * @param totalSize - Total number of bytes to cover.\n * @param chunkSize - Target size of each range in bytes (last range may be smaller).\n *\n * @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`.\n */\nexport function planRanges(totalSize: number, chunkSize: number): RangePlan[] {\n const plans: RangePlan[] = []\n let offset = 0\n let index = 0\n while (offset < totalSize) {\n const length = Math.min(chunkSize, totalSize - offset)\n const end = offset + length - 1\n plans.push({\n partNumber: index + 1,\n index,\n offset,\n length,\n start: offset,\n end,\n })\n offset += length\n index++\n }\n return plans\n}\n\n/**\n * Format an HTTP `Range:` request-header value covering the given\n * inclusive byte offsets. Centralises the `bytes=<start>-<end>` template\n * so the upload, copy, and download paths agree on syntax.\n *\n * @param start - Inclusive starting byte.\n * @param end - Inclusive ending byte.\n *\n * @returns The header value (e.g. `'bytes=0-99'`).\n */\nexport function byteRangeHeader(start: number, end: number): string {\n return `bytes=${start}-${end}`\n}\n"],"mappings":";;;;;;;;;;;;;;;AA4CA,SAAgB,WAAW,WAAmB,WAAgC;CAC5E,MAAM,QAAqB,CAAC;CAC5B,IAAI,SAAS;CACb,IAAI,QAAQ;CACZ,OAAO,SAAS,WAAW;EACzB,MAAM,SAAS,KAAK,IAAI,WAAW,YAAY,MAAM;EACrD,MAAM,MAAM,SAAS,SAAS;EAC9B,MAAM,KAAK;GACT,YAAY,QAAQ;GACpB;GACA;GACA;GACA,OAAO;GACP;EACF,CAAC;EACD,UAAU;EACV;CACF;CACA,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,gBAAgB,OAAe,KAAqB;CAClE,OAAO,SAAS,MAAM,GAAG;AAC3B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/util/sha1.ts
|
|
2
|
+
var sha1HexPattern = /^[0-9a-f]{40}$/i;
|
|
3
|
+
/**
|
|
4
|
+
* Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest.
|
|
5
|
+
*
|
|
6
|
+
* @param sha1 - SHA-1 value, or null/undefined when unavailable.
|
|
7
|
+
*
|
|
8
|
+
* @returns True when the value is a 40-character hexadecimal SHA-1 digest.
|
|
9
|
+
*/
|
|
10
|
+
function isVerifiableSha1(sha1) {
|
|
11
|
+
return sha1 !== null && sha1 !== void 0 && sha1HexPattern.test(sha1);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Normalizes a verifiable SHA-1 digest to lowercase.
|
|
15
|
+
*
|
|
16
|
+
* @param sha1 - SHA-1 value, or null/undefined when unavailable.
|
|
17
|
+
*
|
|
18
|
+
* @returns A lowercase SHA-1 digest, or null when the value is not verifiable.
|
|
19
|
+
*/
|
|
20
|
+
function normalizeVerifiableSha1(sha1) {
|
|
21
|
+
return isVerifiableSha1(sha1) ? sha1.toLowerCase() : null;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.isVerifiableSha1 = isVerifiableSha1;
|
|
25
|
+
exports.normalizeVerifiableSha1 = normalizeVerifiableSha1;
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=sha1.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha1.cjs","names":[],"sources":["../../src/util/sha1.ts"],"sourcesContent":["const sha1HexPattern = /^[0-9a-f]{40}$/i\n\n/**\n * Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest.\n *\n * @param sha1 - SHA-1 value, or null/undefined when unavailable.\n *\n * @returns True when the value is a 40-character hexadecimal SHA-1 digest.\n */\nexport function isVerifiableSha1(sha1: string | null | undefined): sha1 is string {\n return sha1 !== null && sha1 !== undefined && sha1HexPattern.test(sha1)\n}\n\n/**\n * Normalizes a verifiable SHA-1 digest to lowercase.\n *\n * @param sha1 - SHA-1 value, or null/undefined when unavailable.\n *\n * @returns A lowercase SHA-1 digest, or null when the value is not verifiable.\n */\nexport function normalizeVerifiableSha1(sha1: string | null | undefined): string | null {\n return isVerifiableSha1(sha1) ? sha1.toLowerCase() : null\n}\n"],"mappings":";AAAA,IAAM,iBAAiB;;;;;;;;AASvB,SAAgB,iBAAiB,MAAiD;CAChF,OAAO,SAAS,QAAQ,SAAS,KAAA,KAAa,eAAe,KAAK,IAAI;AACxE;;;;;;;;AASA,SAAgB,wBAAwB,MAAgD;CACtF,OAAO,iBAAiB,IAAI,IAAI,KAAK,YAAY,IAAI;AACvD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest.
|
|
3
|
+
*
|
|
4
|
+
* @param sha1 - SHA-1 value, or null/undefined when unavailable.
|
|
5
|
+
*
|
|
6
|
+
* @returns True when the value is a 40-character hexadecimal SHA-1 digest.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isVerifiableSha1(sha1: string | null | undefined): sha1 is string;
|
|
9
|
+
/**
|
|
10
|
+
* Normalizes a verifiable SHA-1 digest to lowercase.
|
|
11
|
+
*
|
|
12
|
+
* @param sha1 - SHA-1 value, or null/undefined when unavailable.
|
|
13
|
+
*
|
|
14
|
+
* @returns A lowercase SHA-1 digest, or null when the value is not verifiable.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeVerifiableSha1(sha1: string | null | undefined): string | null;
|
|
17
|
+
//# sourceMappingURL=sha1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha1.d.ts","sourceRoot":"","sources":["../../src/util/sha1.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,MAAM,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAEtF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest.
|
|
3
|
+
*
|
|
4
|
+
* @param sha1 - SHA-1 value, or null/undefined when unavailable.
|
|
5
|
+
*
|
|
6
|
+
* @returns True when the value is a 40-character hexadecimal SHA-1 digest.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isVerifiableSha1(sha1: string | null | undefined): sha1 is string;
|
|
9
|
+
/**
|
|
10
|
+
* Normalizes a verifiable SHA-1 digest to lowercase.
|
|
11
|
+
*
|
|
12
|
+
* @param sha1 - SHA-1 value, or null/undefined when unavailable.
|
|
13
|
+
*
|
|
14
|
+
* @returns A lowercase SHA-1 digest, or null when the value is not verifiable.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeVerifiableSha1(sha1: string | null | undefined): string | null;
|
|
17
|
+
//# sourceMappingURL=sha1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha1.d.ts","sourceRoot":"","sources":["../../src/util/sha1.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,MAAM,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAEtF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/util/sha1.ts
|
|
2
|
+
var sha1HexPattern = /^[0-9a-f]{40}$/i;
|
|
3
|
+
/**
|
|
4
|
+
* Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest.
|
|
5
|
+
*
|
|
6
|
+
* @param sha1 - SHA-1 value, or null/undefined when unavailable.
|
|
7
|
+
*
|
|
8
|
+
* @returns True when the value is a 40-character hexadecimal SHA-1 digest.
|
|
9
|
+
*/
|
|
10
|
+
function isVerifiableSha1(sha1) {
|
|
11
|
+
return sha1 !== null && sha1 !== void 0 && sha1HexPattern.test(sha1);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Normalizes a verifiable SHA-1 digest to lowercase.
|
|
15
|
+
*
|
|
16
|
+
* @param sha1 - SHA-1 value, or null/undefined when unavailable.
|
|
17
|
+
*
|
|
18
|
+
* @returns A lowercase SHA-1 digest, or null when the value is not verifiable.
|
|
19
|
+
*/
|
|
20
|
+
function normalizeVerifiableSha1(sha1) {
|
|
21
|
+
return isVerifiableSha1(sha1) ? sha1.toLowerCase() : null;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { isVerifiableSha1, normalizeVerifiableSha1 };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=sha1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha1.js","names":[],"sources":["../../src/util/sha1.ts"],"sourcesContent":["const sha1HexPattern = /^[0-9a-f]{40}$/i\n\n/**\n * Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest.\n *\n * @param sha1 - SHA-1 value, or null/undefined when unavailable.\n *\n * @returns True when the value is a 40-character hexadecimal SHA-1 digest.\n */\nexport function isVerifiableSha1(sha1: string | null | undefined): sha1 is string {\n return sha1 !== null && sha1 !== undefined && sha1HexPattern.test(sha1)\n}\n\n/**\n * Normalizes a verifiable SHA-1 digest to lowercase.\n *\n * @param sha1 - SHA-1 value, or null/undefined when unavailable.\n *\n * @returns A lowercase SHA-1 digest, or null when the value is not verifiable.\n */\nexport function normalizeVerifiableSha1(sha1: string | null | undefined): string | null {\n return isVerifiableSha1(sha1) ? sha1.toLowerCase() : null\n}\n"],"mappings":";AAAA,IAAM,iBAAiB;;;;;;;;AASvB,SAAgB,iBAAiB,MAAiD;CAChF,OAAO,SAAS,QAAQ,SAAS,KAAA,KAAa,eAAe,KAAK,IAAI;AACxE;;;;;;;;AASA,SAAgB,wBAAwB,MAAgD;CACtF,OAAO,iBAAiB,IAAI,IAAI,KAAK,YAAY,IAAI;AACvD"}
|
package/dist/util/text-codec.cjs
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/util/text-codec.ts
|
|
2
|
+
/**
|
|
3
|
+
* Shared UTF-8 codec singletons.
|
|
4
|
+
*
|
|
5
|
+
* Every byte boundary in this SDK is UTF-8: JSON request and response bodies,
|
|
6
|
+
* webhook payloads, simulator stream chunks, and B2 percent-encoding inputs.
|
|
7
|
+
* Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and
|
|
8
|
+
* makes the encoding assumption invisible. Importing these constants makes
|
|
9
|
+
* "we use UTF-8" explicit at every call site and avoids the per-call
|
|
10
|
+
* allocation entirely.
|
|
11
|
+
*
|
|
12
|
+
* Both classes are spec-defined as stateless across encode / decode calls,
|
|
13
|
+
* so a process-wide singleton is safe.
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Process-wide UTF-8 `TextEncoder`. Use this instead of
|
|
19
|
+
* `new TextEncoder()` for any string → bytes conversion in the SDK.
|
|
20
|
+
*/
|
|
21
|
+
var utf8Encoder = new TextEncoder();
|
|
22
|
+
/**
|
|
23
|
+
* Process-wide UTF-8 `TextDecoder`. Use this instead of
|
|
24
|
+
* `new TextDecoder()` for any bytes → string conversion in the SDK.
|
|
25
|
+
*/
|
|
26
|
+
var utf8Decoder = new TextDecoder();
|
|
27
|
+
//#endregion
|
|
5
28
|
exports.utf8Decoder = utf8Decoder;
|
|
6
29
|
exports.utf8Encoder = utf8Encoder;
|
|
7
|
-
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=text-codec.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-codec.cjs","sources":["../../src/util/text-codec.ts"],"sourcesContent":["/**\n * Shared UTF-8 codec singletons.\n *\n * Every byte boundary in this SDK is UTF-8: JSON request and response bodies,\n * webhook payloads, simulator stream chunks, and B2 percent-encoding inputs.\n * Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and\n * makes the encoding assumption invisible. Importing these constants makes\n * \"we use UTF-8\" explicit at every call site and avoids the per-call\n * allocation entirely.\n *\n * Both classes are spec-defined as stateless across encode / decode calls,\n * so a process-wide singleton is safe.\n *\n * @packageDocumentation\n */\n\n/**\n * Process-wide UTF-8 `TextEncoder`. Use this instead of\n * `new TextEncoder()` for any string → bytes conversion in the SDK.\n */\nexport const utf8Encoder = new TextEncoder()\n\n/**\n * Process-wide UTF-8 `TextDecoder`. Use this instead of\n * `new TextDecoder()` for any bytes → string conversion in the SDK.\n */\nexport const utf8Decoder = new TextDecoder()\n"],"
|
|
1
|
+
{"version":3,"file":"text-codec.cjs","names":[],"sources":["../../src/util/text-codec.ts"],"sourcesContent":["/**\n * Shared UTF-8 codec singletons.\n *\n * Every byte boundary in this SDK is UTF-8: JSON request and response bodies,\n * webhook payloads, simulator stream chunks, and B2 percent-encoding inputs.\n * Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and\n * makes the encoding assumption invisible. Importing these constants makes\n * \"we use UTF-8\" explicit at every call site and avoids the per-call\n * allocation entirely.\n *\n * Both classes are spec-defined as stateless across encode / decode calls,\n * so a process-wide singleton is safe.\n *\n * @packageDocumentation\n */\n\n/**\n * Process-wide UTF-8 `TextEncoder`. Use this instead of\n * `new TextEncoder()` for any string → bytes conversion in the SDK.\n */\nexport const utf8Encoder = new TextEncoder()\n\n/**\n * Process-wide UTF-8 `TextDecoder`. Use this instead of\n * `new TextDecoder()` for any bytes → string conversion in the SDK.\n */\nexport const utf8Decoder = new TextDecoder()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,cAAc,IAAI,YAAY;;;;;AAM3C,IAAa,cAAc,IAAI,YAAY"}
|
package/dist/util/text-codec.js
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region src/util/text-codec.ts
|
|
2
|
+
/**
|
|
3
|
+
* Shared UTF-8 codec singletons.
|
|
4
|
+
*
|
|
5
|
+
* Every byte boundary in this SDK is UTF-8: JSON request and response bodies,
|
|
6
|
+
* webhook payloads, simulator stream chunks, and B2 percent-encoding inputs.
|
|
7
|
+
* Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and
|
|
8
|
+
* makes the encoding assumption invisible. Importing these constants makes
|
|
9
|
+
* "we use UTF-8" explicit at every call site and avoids the per-call
|
|
10
|
+
* allocation entirely.
|
|
11
|
+
*
|
|
12
|
+
* Both classes are spec-defined as stateless across encode / decode calls,
|
|
13
|
+
* so a process-wide singleton is safe.
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Process-wide UTF-8 `TextEncoder`. Use this instead of
|
|
19
|
+
* `new TextEncoder()` for any string → bytes conversion in the SDK.
|
|
20
|
+
*/
|
|
21
|
+
var utf8Encoder = new TextEncoder();
|
|
22
|
+
/**
|
|
23
|
+
* Process-wide UTF-8 `TextDecoder`. Use this instead of
|
|
24
|
+
* `new TextDecoder()` for any bytes → string conversion in the SDK.
|
|
25
|
+
*/
|
|
26
|
+
var utf8Decoder = new TextDecoder();
|
|
27
|
+
//#endregion
|
|
28
|
+
export { utf8Decoder, utf8Encoder };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=text-codec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-codec.js","sources":["../../src/util/text-codec.ts"],"sourcesContent":["/**\n * Shared UTF-8 codec singletons.\n *\n * Every byte boundary in this SDK is UTF-8: JSON request and response bodies,\n * webhook payloads, simulator stream chunks, and B2 percent-encoding inputs.\n * Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and\n * makes the encoding assumption invisible. Importing these constants makes\n * \"we use UTF-8\" explicit at every call site and avoids the per-call\n * allocation entirely.\n *\n * Both classes are spec-defined as stateless across encode / decode calls,\n * so a process-wide singleton is safe.\n *\n * @packageDocumentation\n */\n\n/**\n * Process-wide UTF-8 `TextEncoder`. Use this instead of\n * `new TextEncoder()` for any string → bytes conversion in the SDK.\n */\nexport const utf8Encoder = new TextEncoder()\n\n/**\n * Process-wide UTF-8 `TextDecoder`. Use this instead of\n * `new TextDecoder()` for any bytes → string conversion in the SDK.\n */\nexport const utf8Decoder = new TextDecoder()\n"],"
|
|
1
|
+
{"version":3,"file":"text-codec.js","names":[],"sources":["../../src/util/text-codec.ts"],"sourcesContent":["/**\n * Shared UTF-8 codec singletons.\n *\n * Every byte boundary in this SDK is UTF-8: JSON request and response bodies,\n * webhook payloads, simulator stream chunks, and B2 percent-encoding inputs.\n * Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and\n * makes the encoding assumption invisible. Importing these constants makes\n * \"we use UTF-8\" explicit at every call site and avoids the per-call\n * allocation entirely.\n *\n * Both classes are spec-defined as stateless across encode / decode calls,\n * so a process-wide singleton is safe.\n *\n * @packageDocumentation\n */\n\n/**\n * Process-wide UTF-8 `TextEncoder`. Use this instead of\n * `new TextEncoder()` for any string → bytes conversion in the SDK.\n */\nexport const utf8Encoder = new TextEncoder()\n\n/**\n * Process-wide UTF-8 `TextDecoder`. Use this instead of\n * `new TextDecoder()` for any bytes → string conversion in the SDK.\n */\nexport const utf8Decoder = new TextDecoder()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,cAAc,IAAI,YAAY;;;;;AAM3C,IAAa,cAAc,IAAI,YAAY"}
|
package/dist/util/to-error.cjs
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/util/to-error.ts
|
|
2
|
+
/**
|
|
3
|
+
* Coerce an unknown caught value to a real error instance.
|
|
4
|
+
*
|
|
5
|
+
* Existing error objects pass through unchanged so call sites preserve
|
|
6
|
+
* the original stack and any subclass identity. Other values are
|
|
7
|
+
* wrapped in a fresh Error whose message is `String(value)`. Centralises
|
|
8
|
+
* the conditional that previously recurred at every async-boundary
|
|
9
|
+
* catch site in the upload, copy, sync, and stream paths.
|
|
10
|
+
*
|
|
11
|
+
* @param value - Value caught from a `try`/`catch` or rejected promise.
|
|
12
|
+
*
|
|
13
|
+
* @returns An `Error` representing `value`.
|
|
14
|
+
*/
|
|
3
15
|
function toError(value) {
|
|
4
|
-
|
|
16
|
+
return value instanceof Error ? value : new Error(String(value));
|
|
5
17
|
}
|
|
18
|
+
//#endregion
|
|
6
19
|
exports.toError = toError;
|
|
7
|
-
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=to-error.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-error.cjs","sources":["../../src/util/to-error.ts"],"sourcesContent":["/**\n * Coerce an unknown caught value to a real error instance.\n *\n * Existing error objects pass through unchanged so call sites preserve\n * the original stack and any subclass identity. Other values are\n * wrapped in a fresh Error whose message is `String(value)`. Centralises\n * the conditional that previously recurred at every async-boundary\n * catch site in the upload, copy, sync, and stream paths.\n *\n * @param value - Value caught from a `try`/`catch` or rejected promise.\n *\n * @returns An `Error` representing `value`.\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n"],"
|
|
1
|
+
{"version":3,"file":"to-error.cjs","names":[],"sources":["../../src/util/to-error.ts"],"sourcesContent":["/**\n * Coerce an unknown caught value to a real error instance.\n *\n * Existing error objects pass through unchanged so call sites preserve\n * the original stack and any subclass identity. Other values are\n * wrapped in a fresh Error whose message is `String(value)`. Centralises\n * the conditional that previously recurred at every async-boundary\n * catch site in the upload, copy, sync, and stream paths.\n *\n * @param value - Value caught from a `try`/`catch` or rejected promise.\n *\n * @returns An `Error` representing `value`.\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AACjE"}
|
package/dist/util/to-error.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
//#region src/util/to-error.ts
|
|
2
|
+
/**
|
|
3
|
+
* Coerce an unknown caught value to a real error instance.
|
|
4
|
+
*
|
|
5
|
+
* Existing error objects pass through unchanged so call sites preserve
|
|
6
|
+
* the original stack and any subclass identity. Other values are
|
|
7
|
+
* wrapped in a fresh Error whose message is `String(value)`. Centralises
|
|
8
|
+
* the conditional that previously recurred at every async-boundary
|
|
9
|
+
* catch site in the upload, copy, sync, and stream paths.
|
|
10
|
+
*
|
|
11
|
+
* @param value - Value caught from a `try`/`catch` or rejected promise.
|
|
12
|
+
*
|
|
13
|
+
* @returns An `Error` representing `value`.
|
|
14
|
+
*/
|
|
1
15
|
function toError(value) {
|
|
2
|
-
|
|
16
|
+
return value instanceof Error ? value : new Error(String(value));
|
|
3
17
|
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=to-error.js.map
|
|
18
|
+
//#endregion
|
|
19
|
+
export { toError };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=to-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-error.js","sources":["../../src/util/to-error.ts"],"sourcesContent":["/**\n * Coerce an unknown caught value to a real error instance.\n *\n * Existing error objects pass through unchanged so call sites preserve\n * the original stack and any subclass identity. Other values are\n * wrapped in a fresh Error whose message is `String(value)`. Centralises\n * the conditional that previously recurred at every async-boundary\n * catch site in the upload, copy, sync, and stream paths.\n *\n * @param value - Value caught from a `try`/`catch` or rejected promise.\n *\n * @returns An `Error` representing `value`.\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n"],"
|
|
1
|
+
{"version":3,"file":"to-error.js","names":[],"sources":["../../src/util/to-error.ts"],"sourcesContent":["/**\n * Coerce an unknown caught value to a real error instance.\n *\n * Existing error objects pass through unchanged so call sites preserve\n * the original stack and any subclass identity. Other values are\n * wrapped in a fresh Error whose message is `String(value)`. Centralises\n * the conditional that previously recurred at every async-boundary\n * catch site in the upload, copy, sync, and stream paths.\n *\n * @param value - Value caught from a `try`/`catch` or rejected promise.\n *\n * @returns An `Error` representing `value`.\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AACjE"}
|
package/dist/version.cjs
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/version.ts
|
|
2
|
+
/**
|
|
3
|
+
* Current SDK version. Read directly from package.json so there is no
|
|
4
|
+
* second-source-of-truth to keep in sync — bumping `version` in package.json
|
|
5
|
+
* automatically propagates here, into the SDK's User-Agent header, and into
|
|
6
|
+
* the published artifact.
|
|
7
|
+
*
|
|
8
|
+
* Works in every runtime the SDK targets:
|
|
9
|
+
* - Node 22.3+, Bun, Deno: native JSON import attributes.
|
|
10
|
+
* - Vite builds: the JSON import is replaced with a version-only shim so
|
|
11
|
+
* published runtime chunks do not carry unrelated package metadata.
|
|
12
|
+
* - Vitest browser mode: Vite handles the import the same way as build.
|
|
13
|
+
*/
|
|
14
|
+
var VERSION = require("./_virtual/_b2-sdk-version-json.cjs").default.version;
|
|
15
|
+
//#endregion
|
|
5
16
|
exports.VERSION = VERSION;
|
|
6
|
-
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=version.cjs.map
|
package/dist/version.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.cjs","sources":["../src/version.ts"],"sourcesContent":["import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Current SDK version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync — bumping `version` in package.json\n * automatically propagates here, into the SDK's User-Agent header, and into\n * the published artifact.\n *\n * Works in every runtime the SDK targets:\n * - Node 22+, Bun, Deno: native JSON import attributes.\n * - Vite
|
|
1
|
+
{"version":3,"file":"version.cjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Current SDK version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync — bumping `version` in package.json\n * automatically propagates here, into the SDK's User-Agent header, and into\n * the published artifact.\n *\n * Works in every runtime the SDK targets:\n * - Node 22.3+, Bun, Deno: native JSON import attributes.\n * - Vite builds: the JSON import is replaced with a version-only shim so\n * published runtime chunks do not carry unrelated package metadata.\n * - Vitest browser mode: Vite handles the import the same way as build.\n */\nexport const VERSION: string = pkg.version\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,uDAAkB,CAAA,CAAA,QAAI"}
|
package/dist/version.d.cts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* the published artifact.
|
|
6
6
|
*
|
|
7
7
|
* Works in every runtime the SDK targets:
|
|
8
|
-
* - Node 22+, Bun, Deno: native JSON import attributes.
|
|
9
|
-
* - Vite
|
|
10
|
-
*
|
|
8
|
+
* - Node 22.3+, Bun, Deno: native JSON import attributes.
|
|
9
|
+
* - Vite builds: the JSON import is replaced with a version-only shim so
|
|
10
|
+
* published runtime chunks do not carry unrelated package metadata.
|
|
11
11
|
* - Vitest browser mode: Vite handles the import the same way as build.
|
|
12
12
|
*/
|
|
13
13
|
export declare const VERSION: string;
|
package/dist/version.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* the published artifact.
|
|
6
6
|
*
|
|
7
7
|
* Works in every runtime the SDK targets:
|
|
8
|
-
* - Node 22+, Bun, Deno: native JSON import attributes.
|
|
9
|
-
* - Vite
|
|
10
|
-
*
|
|
8
|
+
* - Node 22.3+, Bun, Deno: native JSON import attributes.
|
|
9
|
+
* - Vite builds: the JSON import is replaced with a version-only shim so
|
|
10
|
+
* published runtime chunks do not carry unrelated package metadata.
|
|
11
11
|
* - Vitest browser mode: Vite handles the import the same way as build.
|
|
12
12
|
*/
|
|
13
13
|
export declare const VERSION: string;
|
package/dist/version.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import _b2_sdk_version_json_default from "./_virtual/_b2-sdk-version-json.js";
|
|
2
|
+
//#region src/version.ts
|
|
3
|
+
/**
|
|
4
|
+
* Current SDK version. Read directly from package.json so there is no
|
|
5
|
+
* second-source-of-truth to keep in sync — bumping `version` in package.json
|
|
6
|
+
* automatically propagates here, into the SDK's User-Agent header, and into
|
|
7
|
+
* the published artifact.
|
|
8
|
+
*
|
|
9
|
+
* Works in every runtime the SDK targets:
|
|
10
|
+
* - Node 22.3+, Bun, Deno: native JSON import attributes.
|
|
11
|
+
* - Vite builds: the JSON import is replaced with a version-only shim so
|
|
12
|
+
* published runtime chunks do not carry unrelated package metadata.
|
|
13
|
+
* - Vitest browser mode: Vite handles the import the same way as build.
|
|
14
|
+
*/
|
|
15
|
+
var VERSION = _b2_sdk_version_json_default.version;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { VERSION };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Current SDK version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync — bumping `version` in package.json\n * automatically propagates here, into the SDK's User-Agent header, and into\n * the published artifact.\n *\n * Works in every runtime the SDK targets:\n * - Node 22+, Bun, Deno: native JSON import attributes.\n * - Vite
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Current SDK version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync — bumping `version` in package.json\n * automatically propagates here, into the SDK's User-Agent header, and into\n * the published artifact.\n *\n * Works in every runtime the SDK targets:\n * - Node 22.3+, Bun, Deno: native JSON import attributes.\n * - Vite builds: the JSON import is replaced with a version-only shim so\n * published runtime chunks do not carry unrelated package metadata.\n * - Vitest browser mode: Vite handles the import the same way as build.\n */\nexport const VERSION: string = pkg.version\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAa,UAAkB,6BAAI"}
|