@backblaze-labs/b2-sdk 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -5
- package/README.md +144 -33
- package/dist/_virtual/_b2-sdk-version-json.cjs +4 -0
- package/dist/_virtual/_b2-sdk-version-json.js +4 -0
- package/dist/auth/account-info.d.cts +32 -0
- package/dist/auth/account-info.d.cts.map +1 -1
- package/dist/auth/account-info.d.ts +32 -0
- package/dist/auth/account-info.d.ts.map +1 -1
- package/dist/auth/file.cjs +408 -207
- package/dist/auth/file.cjs.map +1 -1
- package/dist/auth/file.d.cts +77 -3
- package/dist/auth/file.d.cts.map +1 -1
- package/dist/auth/file.d.ts +77 -3
- package/dist/auth/file.d.ts.map +1 -1
- package/dist/auth/file.js +407 -207
- package/dist/auth/file.js.map +1 -1
- package/dist/auth/in-memory.cjs +212 -183
- package/dist/auth/in-memory.cjs.map +1 -1
- package/dist/auth/in-memory.d.cts +8 -0
- package/dist/auth/in-memory.d.cts.map +1 -1
- package/dist/auth/in-memory.d.ts +8 -0
- package/dist/auth/in-memory.d.ts.map +1 -1
- package/dist/auth/in-memory.js +211 -182
- package/dist/auth/in-memory.js.map +1 -1
- package/dist/auth/index.cjs +7 -9
- package/dist/auth/index.d.cts +3 -2
- package/dist/auth/index.d.cts.map +1 -1
- package/dist/auth/index.d.ts +3 -2
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -8
- package/dist/auth/realms.cjs +80 -7
- package/dist/auth/realms.cjs.map +1 -1
- package/dist/auth/realms.d.cts +27 -4
- package/dist/auth/realms.d.cts.map +1 -1
- package/dist/auth/realms.d.ts +27 -4
- package/dist/auth/realms.d.ts.map +1 -1
- package/dist/auth/realms.js +80 -9
- package/dist/auth/realms.js.map +1 -1
- package/dist/auth/upload-url-pool.cjs +55 -51
- package/dist/auth/upload-url-pool.cjs.map +1 -1
- package/dist/auth/upload-url-pool.js +55 -51
- package/dist/auth/upload-url-pool.js.map +1 -1
- package/dist/bucket.cjs +785 -787
- package/dist/bucket.cjs.map +1 -1
- package/dist/bucket.d.cts +35 -47
- package/dist/bucket.d.cts.map +1 -1
- package/dist/bucket.d.ts +35 -47
- package/dist/bucket.d.ts.map +1 -1
- package/dist/bucket.js +780 -782
- package/dist/bucket.js.map +1 -1
- package/dist/client.cjs +246 -228
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +25 -17
- package/dist/client.d.cts.map +1 -1
- package/dist/client.d.ts +25 -17
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +243 -225
- package/dist/client.js.map +1 -1
- package/dist/copy/large.cjs +114 -71
- package/dist/copy/large.cjs.map +1 -1
- package/dist/copy/large.d.cts +6 -0
- package/dist/copy/large.d.cts.map +1 -1
- package/dist/copy/large.d.ts +6 -0
- package/dist/copy/large.d.ts.map +1 -1
- package/dist/copy/large.js +112 -69
- package/dist/copy/large.js.map +1 -1
- package/dist/download/checksum.cjs +89 -0
- package/dist/download/checksum.cjs.map +1 -0
- package/dist/download/checksum.d.cts +40 -0
- package/dist/download/checksum.d.cts.map +1 -0
- package/dist/download/checksum.d.ts +40 -0
- package/dist/download/checksum.d.ts.map +1 -0
- package/dist/download/checksum.js +87 -0
- package/dist/download/checksum.js.map +1 -0
- package/dist/download/parallel.cjs +214 -118
- package/dist/download/parallel.cjs.map +1 -1
- package/dist/download/parallel.d.cts +5 -1
- package/dist/download/parallel.d.cts.map +1 -1
- package/dist/download/parallel.d.ts +5 -1
- package/dist/download/parallel.d.ts.map +1 -1
- package/dist/download/parallel.js +212 -116
- package/dist/download/parallel.js.map +1 -1
- package/dist/download/single.cjs +188 -97
- package/dist/download/single.cjs.map +1 -1
- package/dist/download/single.d.cts +6 -1
- package/dist/download/single.d.cts.map +1 -1
- package/dist/download/single.d.ts +6 -1
- package/dist/download/single.d.ts.map +1 -1
- package/dist/download/single.js +186 -98
- package/dist/download/single.js.map +1 -1
- package/dist/errors/index.cjs +699 -243
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts +285 -82
- package/dist/errors/index.d.cts.map +1 -1
- package/dist/errors/index.d.ts +285 -82
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +678 -261
- package/dist/errors/index.js.map +1 -1
- package/dist/http/retry.cjs +45 -28
- package/dist/http/retry.cjs.map +1 -1
- package/dist/http/retry.d.cts +15 -2
- package/dist/http/retry.d.cts.map +1 -1
- package/dist/http/retry.d.ts +15 -2
- package/dist/http/retry.d.ts.map +1 -1
- package/dist/http/retry.js +46 -31
- package/dist/http/retry.js.map +1 -1
- package/dist/http/transport.cjs +438 -140
- package/dist/http/transport.cjs.map +1 -1
- package/dist/http/transport.d.cts +21 -2
- package/dist/http/transport.d.cts.map +1 -1
- package/dist/http/transport.d.ts +21 -2
- package/dist/http/transport.d.ts.map +1 -1
- package/dist/http/transport.js +437 -140
- package/dist/http/transport.js.map +1 -1
- package/dist/http/url-guard.cjs +154 -89
- package/dist/http/url-guard.cjs.map +1 -1
- package/dist/http/url-guard.d.cts +25 -3
- package/dist/http/url-guard.d.cts.map +1 -1
- package/dist/http/url-guard.d.ts +25 -3
- package/dist/http/url-guard.d.ts.map +1 -1
- package/dist/http/url-guard.js +152 -90
- package/dist/http/url-guard.js.map +1 -1
- package/dist/http/user-agent.cjs +84 -44
- package/dist/http/user-agent.cjs.map +1 -1
- package/dist/http/user-agent.js +84 -46
- package/dist/http/user-agent.js.map +1 -1
- package/dist/index.cjs +101 -77
- package/dist/index.d.cts +27 -21
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +27 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -71
- package/dist/internal/b2-naming.cjs +66 -0
- package/dist/internal/b2-naming.cjs.map +1 -0
- package/dist/internal/b2-naming.d.cts +43 -0
- package/dist/internal/b2-naming.d.cts.map +1 -0
- package/dist/internal/b2-naming.d.ts +43 -0
- package/dist/internal/b2-naming.d.ts.map +1 -0
- package/dist/internal/b2-naming.js +60 -0
- package/dist/internal/b2-naming.js.map +1 -0
- package/dist/internal/upload-retry-options.cjs +21 -0
- package/dist/internal/upload-retry-options.cjs.map +1 -0
- package/dist/internal/upload-retry-options.d.cts +12 -0
- package/dist/internal/upload-retry-options.d.cts.map +1 -0
- package/dist/internal/upload-retry-options.d.ts +12 -0
- package/dist/internal/upload-retry-options.d.ts.map +1 -0
- package/dist/internal/upload-retry-options.js +21 -0
- package/dist/internal/upload-retry-options.js.map +1 -0
- package/dist/internal/url-redaction.cjs +31 -0
- package/dist/internal/url-redaction.cjs.map +1 -0
- package/dist/internal/url-redaction.d.cts +17 -0
- package/dist/internal/url-redaction.d.cts.map +1 -0
- package/dist/internal/url-redaction.d.ts +17 -0
- package/dist/internal/url-redaction.d.ts.map +1 -0
- package/dist/internal/url-redaction.js +31 -0
- package/dist/internal/url-redaction.js.map +1 -0
- package/dist/notifications/index.cjs +4 -6
- package/dist/notifications/index.d.cts +1 -1
- package/dist/notifications/index.d.cts.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +1 -6
- package/dist/notifications/webhook.cjs +195 -85
- package/dist/notifications/webhook.cjs.map +1 -1
- package/dist/notifications/webhook.d.cts.map +1 -1
- package/dist/notifications/webhook.d.ts.map +1 -1
- package/dist/notifications/webhook.js +195 -87
- package/dist/notifications/webhook.js.map +1 -1
- package/dist/object.cjs +253 -210
- package/dist/object.cjs.map +1 -1
- package/dist/object.d.cts +9 -55
- package/dist/object.d.cts.map +1 -1
- package/dist/object.d.ts +9 -55
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +249 -206
- package/dist/object.js.map +1 -1
- package/dist/raw/encoding.cjs +74 -35
- package/dist/raw/encoding.cjs.map +1 -1
- package/dist/raw/encoding.js +74 -38
- package/dist/raw/encoding.js.map +1 -1
- package/dist/raw/index.cjs +678 -587
- package/dist/raw/index.cjs.map +1 -1
- package/dist/raw/index.d.cts +121 -18
- package/dist/raw/index.d.cts.map +1 -1
- package/dist/raw/index.d.ts +121 -18
- package/dist/raw/index.d.ts.map +1 -1
- package/dist/raw/index.js +674 -589
- package/dist/raw/index.js.map +1 -1
- package/dist/s3/index.cjs +355 -18
- package/dist/s3/index.cjs.map +1 -1
- package/dist/s3/index.d.cts +233 -5
- package/dist/s3/index.d.cts.map +1 -1
- package/dist/s3/index.d.ts +233 -5
- package/dist/s3/index.d.ts.map +1 -1
- package/dist/s3/index.js +351 -22
- package/dist/s3/index.js.map +1 -1
- package/dist/s3/sigv4.cjs +149 -0
- package/dist/s3/sigv4.cjs.map +1 -0
- package/dist/s3/sigv4.d.cts +43 -0
- package/dist/s3/sigv4.d.cts.map +1 -0
- package/dist/s3/sigv4.d.ts +43 -0
- package/dist/s3/sigv4.d.ts.map +1 -0
- package/dist/s3/sigv4.js +148 -0
- package/dist/s3/sigv4.js.map +1 -0
- package/dist/s3/validation.cjs +69 -0
- package/dist/s3/validation.cjs.map +1 -0
- package/dist/s3/validation.d.cts +43 -0
- package/dist/s3/validation.d.cts.map +1 -0
- package/dist/s3/validation.d.ts +43 -0
- package/dist/s3/validation.d.ts.map +1 -0
- package/dist/s3/validation.js +66 -0
- package/dist/s3/validation.js.map +1 -0
- package/dist/simulator/capabilities.cjs +63 -48
- package/dist/simulator/capabilities.cjs.map +1 -1
- package/dist/simulator/capabilities.js +63 -49
- package/dist/simulator/capabilities.js.map +1 -1
- package/dist/simulator/index.cjs +2124 -1548
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.d.cts +79 -11
- package/dist/simulator/index.d.cts.map +1 -1
- package/dist/simulator/index.d.ts +79 -11
- package/dist/simulator/index.d.ts.map +1 -1
- package/dist/simulator/index.js +2112 -1546
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/validation.cjs +191 -153
- package/dist/simulator/validation.cjs.map +1 -1
- package/dist/simulator/validation.d.cts +3 -21
- package/dist/simulator/validation.d.cts.map +1 -1
- package/dist/simulator/validation.d.ts +3 -21
- package/dist/simulator/validation.d.ts.map +1 -1
- package/dist/simulator/validation.js +188 -162
- package/dist/simulator/validation.js.map +1 -1
- package/dist/streams/collect.cjs +74 -24
- package/dist/streams/collect.cjs.map +1 -1
- package/dist/streams/collect.d.cts +14 -1
- package/dist/streams/collect.d.cts.map +1 -1
- package/dist/streams/collect.d.ts +14 -1
- package/dist/streams/collect.d.ts.map +1 -1
- package/dist/streams/collect.js +74 -25
- package/dist/streams/collect.js.map +1 -1
- package/dist/streams/file-source.cjs +287 -0
- package/dist/streams/file-source.cjs.map +1 -0
- package/dist/streams/file-source.d.cts +96 -0
- package/dist/streams/file-source.d.cts.map +1 -0
- package/dist/streams/file-source.d.ts +96 -0
- package/dist/streams/file-source.d.ts.map +1 -0
- package/dist/streams/file-source.js +286 -0
- package/dist/streams/file-source.js.map +1 -0
- package/dist/streams/hash.cjs +207 -115
- package/dist/streams/hash.cjs.map +1 -1
- package/dist/streams/hash.d.cts +5 -4
- package/dist/streams/hash.d.cts.map +1 -1
- package/dist/streams/hash.d.ts +5 -4
- package/dist/streams/hash.d.ts.map +1 -1
- package/dist/streams/hash.js +208 -95
- package/dist/streams/hash.js.map +1 -1
- package/dist/streams/index.cjs +12 -12
- package/dist/streams/index.d.cts +3 -3
- package/dist/streams/index.d.cts.map +1 -1
- package/dist/streams/index.d.ts +3 -3
- package/dist/streams/index.d.ts.map +1 -1
- package/dist/streams/index.js +2 -10
- package/dist/streams/progress.cjs +60 -46
- package/dist/streams/progress.cjs.map +1 -1
- package/dist/streams/progress.js +60 -46
- package/dist/streams/progress.js.map +1 -1
- package/dist/streams/source.cjs +316 -146
- package/dist/streams/source.cjs.map +1 -1
- package/dist/streams/source.d.cts +56 -18
- package/dist/streams/source.d.cts.map +1 -1
- package/dist/streams/source.d.ts +56 -18
- package/dist/streams/source.d.ts.map +1 -1
- package/dist/streams/source.js +312 -149
- package/dist/streams/source.js.map +1 -1
- package/dist/sync/actions/index.cjs +236 -184
- package/dist/sync/actions/index.cjs.map +1 -1
- package/dist/sync/actions/index.d.cts +29 -21
- package/dist/sync/actions/index.d.cts.map +1 -1
- package/dist/sync/actions/index.d.ts +29 -21
- package/dist/sync/actions/index.d.ts.map +1 -1
- package/dist/sync/actions/index.js +236 -190
- package/dist/sync/actions/index.js.map +1 -1
- package/dist/sync/b2-sha1-reader.cjs +148 -0
- package/dist/sync/b2-sha1-reader.cjs.map +1 -0
- package/dist/sync/b2-sha1-reader.d.cts +58 -0
- package/dist/sync/b2-sha1-reader.d.cts.map +1 -0
- package/dist/sync/b2-sha1-reader.d.ts +58 -0
- package/dist/sync/b2-sha1-reader.d.ts.map +1 -0
- package/dist/sync/b2-sha1-reader.js +145 -0
- package/dist/sync/b2-sha1-reader.js.map +1 -0
- package/dist/sync/download-staging.cjs +265 -0
- package/dist/sync/download-staging.cjs.map +1 -0
- package/dist/sync/download-staging.d.cts +54 -0
- package/dist/sync/download-staging.d.cts.map +1 -0
- package/dist/sync/download-staging.d.ts +54 -0
- package/dist/sync/download-staging.d.ts.map +1 -0
- package/dist/sync/download-staging.js +259 -0
- package/dist/sync/download-staging.js.map +1 -0
- package/dist/sync/filesystem-errors.cjs +32 -0
- package/dist/sync/filesystem-errors.cjs.map +1 -0
- package/dist/sync/filesystem-errors.d.cts +8 -0
- package/dist/sync/filesystem-errors.d.cts.map +1 -0
- package/dist/sync/filesystem-errors.d.ts +8 -0
- package/dist/sync/filesystem-errors.d.ts.map +1 -0
- package/dist/sync/filesystem-errors.js +32 -0
- package/dist/sync/filesystem-errors.js.map +1 -0
- package/dist/sync/filters.cjs +217 -0
- package/dist/sync/filters.cjs.map +1 -0
- package/dist/sync/filters.d.cts +51 -0
- package/dist/sync/filters.d.cts.map +1 -0
- package/dist/sync/filters.d.ts +51 -0
- package/dist/sync/filters.d.ts.map +1 -0
- package/dist/sync/filters.js +213 -0
- package/dist/sync/filters.js.map +1 -0
- package/dist/sync/index.cjs +39 -22
- package/dist/sync/index.d.cts +14 -9
- package/dist/sync/index.d.cts.map +1 -1
- package/dist/sync/index.d.ts +14 -9
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +9 -20
- package/dist/sync/local-file-identity.cjs +61 -0
- package/dist/sync/local-file-identity.cjs.map +1 -0
- package/dist/sync/local-file-identity.d.cts +37 -0
- package/dist/sync/local-file-identity.d.cts.map +1 -0
- package/dist/sync/local-file-identity.d.ts +37 -0
- package/dist/sync/local-file-identity.d.ts.map +1 -0
- package/dist/sync/local-file-identity.js +60 -0
- package/dist/sync/local-file-identity.js.map +1 -0
- package/dist/sync/local-file-io.cjs +364 -0
- package/dist/sync/local-file-io.cjs.map +1 -0
- package/dist/sync/local-file-io.d.cts +75 -0
- package/dist/sync/local-file-io.d.cts.map +1 -0
- package/dist/sync/local-file-io.d.ts +75 -0
- package/dist/sync/local-file-io.d.ts.map +1 -0
- package/dist/sync/local-file-io.js +360 -0
- package/dist/sync/local-file-io.js.map +1 -0
- package/dist/sync/local-filesystem-root.cjs +27 -0
- package/dist/sync/local-filesystem-root.cjs.map +1 -0
- package/dist/sync/local-filesystem-root.d.cts +18 -0
- package/dist/sync/local-filesystem-root.d.cts.map +1 -0
- package/dist/sync/local-filesystem-root.d.ts +18 -0
- package/dist/sync/local-filesystem-root.d.ts.map +1 -0
- package/dist/sync/local-filesystem-root.js +26 -0
- package/dist/sync/local-filesystem-root.js.map +1 -0
- package/dist/sync/local-sha1.cjs +119 -0
- package/dist/sync/local-sha1.cjs.map +1 -0
- package/dist/sync/local-sha1.d.cts +39 -0
- package/dist/sync/local-sha1.d.cts.map +1 -0
- package/dist/sync/local-sha1.d.ts +39 -0
- package/dist/sync/local-sha1.d.ts.map +1 -0
- package/dist/sync/local-sha1.js +117 -0
- package/dist/sync/local-sha1.js.map +1 -0
- package/dist/sync/pairing.cjs +118 -29
- package/dist/sync/pairing.cjs.map +1 -1
- package/dist/sync/pairing.d.cts +7 -2
- package/dist/sync/pairing.d.cts.map +1 -1
- package/dist/sync/pairing.d.ts +7 -2
- package/dist/sync/pairing.d.ts.map +1 -1
- package/dist/sync/pairing.js +120 -31
- package/dist/sync/pairing.js.map +1 -1
- package/dist/sync/path-order.cjs +30 -0
- package/dist/sync/path-order.cjs.map +1 -0
- package/dist/sync/path-order.d.cts +28 -0
- package/dist/sync/path-order.d.cts.map +1 -0
- package/dist/sync/path-order.d.ts +28 -0
- package/dist/sync/path-order.d.ts.map +1 -0
- package/dist/sync/path-order.js +29 -0
- package/dist/sync/path-order.js.map +1 -0
- package/dist/sync/path-safety.cjs +111 -0
- package/dist/sync/path-safety.cjs.map +1 -0
- package/dist/sync/path-safety.d.cts +78 -0
- package/dist/sync/path-safety.d.cts.map +1 -0
- package/dist/sync/path-safety.d.ts +78 -0
- package/dist/sync/path-safety.d.ts.map +1 -0
- package/dist/sync/path-safety.js +105 -0
- package/dist/sync/path-safety.js.map +1 -0
- package/dist/sync/paths.d.cts +19 -0
- package/dist/sync/paths.d.cts.map +1 -0
- package/dist/sync/paths.d.ts +19 -0
- package/dist/sync/paths.d.ts.map +1 -0
- package/dist/sync/policies/compare.cjs +389 -11
- package/dist/sync/policies/compare.cjs.map +1 -1
- package/dist/sync/policies/compare.d.cts +100 -2
- package/dist/sync/policies/compare.d.cts.map +1 -1
- package/dist/sync/policies/compare.d.ts +100 -2
- package/dist/sync/policies/compare.d.ts.map +1 -1
- package/dist/sync/policies/compare.js +387 -13
- package/dist/sync/policies/compare.js.map +1 -1
- package/dist/sync/policies/index.cjs +76 -65
- package/dist/sync/policies/index.cjs.map +1 -1
- package/dist/sync/policies/index.d.cts +35 -6
- package/dist/sync/policies/index.d.cts.map +1 -1
- package/dist/sync/policies/index.d.ts +35 -6
- package/dist/sync/policies/index.d.ts.map +1 -1
- package/dist/sync/policies/index.js +76 -65
- package/dist/sync/policies/index.js.map +1 -1
- package/dist/sync/prefix.cjs +96 -0
- package/dist/sync/prefix.cjs.map +1 -0
- package/dist/sync/prefix.d.cts +55 -0
- package/dist/sync/prefix.d.cts.map +1 -0
- package/dist/sync/prefix.d.ts +55 -0
- package/dist/sync/prefix.d.ts.map +1 -0
- package/dist/sync/prefix.js +92 -0
- package/dist/sync/prefix.js.map +1 -0
- package/dist/sync/regexp-safety.cjs +192 -0
- package/dist/sync/regexp-safety.cjs.map +1 -0
- package/dist/sync/regexp-safety.d.cts +29 -0
- package/dist/sync/regexp-safety.d.cts.map +1 -0
- package/dist/sync/regexp-safety.d.ts +29 -0
- package/dist/sync/regexp-safety.d.ts.map +1 -0
- package/dist/sync/regexp-safety.js +190 -0
- package/dist/sync/regexp-safety.js.map +1 -0
- package/dist/sync/scan-events.cjs +33 -0
- package/dist/sync/scan-events.cjs.map +1 -0
- package/dist/sync/scan-events.d.cts +17 -0
- package/dist/sync/scan-events.d.cts.map +1 -0
- package/dist/sync/scan-events.d.ts +17 -0
- package/dist/sync/scan-events.d.ts.map +1 -0
- package/dist/sync/scan-events.js +32 -0
- package/dist/sync/scan-events.js.map +1 -0
- package/dist/sync/scan-limit.cjs +33 -0
- package/dist/sync/scan-limit.cjs.map +1 -0
- package/dist/sync/scan-limit.d.cts +21 -0
- package/dist/sync/scan-limit.d.cts.map +1 -0
- package/dist/sync/scan-limit.d.ts +21 -0
- package/dist/sync/scan-limit.d.ts.map +1 -0
- package/dist/sync/scan-limit.js +31 -0
- package/dist/sync/scan-limit.js.map +1 -0
- package/dist/sync/scanners/b2.cjs +239 -55
- package/dist/sync/scanners/b2.cjs.map +1 -1
- package/dist/sync/scanners/b2.d.cts +26 -7
- package/dist/sync/scanners/b2.d.cts.map +1 -1
- package/dist/sync/scanners/b2.d.ts +26 -7
- package/dist/sync/scanners/b2.d.ts.map +1 -1
- package/dist/sync/scanners/b2.js +239 -55
- package/dist/sync/scanners/b2.js.map +1 -1
- package/dist/sync/scanners/local.cjs +215 -56
- package/dist/sync/scanners/local.cjs.map +1 -1
- package/dist/sync/scanners/local.d.cts +22 -7
- package/dist/sync/scanners/local.d.cts.map +1 -1
- package/dist/sync/scanners/local.d.ts +22 -7
- package/dist/sync/scanners/local.d.ts.map +1 -1
- package/dist/sync/scanners/local.js +216 -57
- package/dist/sync/scanners/local.js.map +1 -1
- package/dist/sync/sha1-metadata.cjs +94 -0
- package/dist/sync/sha1-metadata.cjs.map +1 -0
- package/dist/sync/sha1-metadata.d.cts +82 -0
- package/dist/sync/sha1-metadata.d.cts.map +1 -0
- package/dist/sync/sha1-metadata.d.ts +82 -0
- package/dist/sync/sha1-metadata.d.ts.map +1 -0
- package/dist/sync/sha1-metadata.js +89 -0
- package/dist/sync/sha1-metadata.js.map +1 -0
- package/dist/sync/sha1-options.cjs +23 -0
- package/dist/sync/sha1-options.cjs.map +1 -0
- package/dist/sync/sha1-options.d.cts +14 -0
- package/dist/sync/sha1-options.d.cts.map +1 -0
- package/dist/sync/sha1-options.d.ts +14 -0
- package/dist/sync/sha1-options.d.ts.map +1 -0
- package/dist/sync/sha1-options.js +21 -0
- package/dist/sync/sha1-options.js.map +1 -0
- package/dist/sync/synchronizer.cjs +782 -197
- package/dist/sync/synchronizer.cjs.map +1 -1
- package/dist/sync/synchronizer.d.cts +47 -1
- package/dist/sync/synchronizer.d.cts.map +1 -1
- package/dist/sync/synchronizer.d.ts +47 -1
- package/dist/sync/synchronizer.d.ts.map +1 -1
- package/dist/sync/synchronizer.js +779 -173
- package/dist/sync/synchronizer.js.map +1 -1
- package/dist/sync/types.d.cts +208 -16
- package/dist/sync/types.d.cts.map +1 -1
- package/dist/sync/types.d.ts +208 -16
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/types/auth.cjs +76 -56
- package/dist/types/auth.cjs.map +1 -1
- package/dist/types/auth.d.cts +67 -9
- package/dist/types/auth.d.cts.map +1 -1
- package/dist/types/auth.d.ts +67 -9
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/auth.js +77 -57
- package/dist/types/auth.js.map +1 -1
- package/dist/types/bucket.cjs +74 -38
- package/dist/types/bucket.cjs.map +1 -1
- package/dist/types/bucket.js +75 -41
- package/dist/types/bucket.js.map +1 -1
- package/dist/types/encryption.cjs +364 -327
- package/dist/types/encryption.cjs.map +1 -1
- package/dist/types/encryption.d.cts +16 -0
- package/dist/types/encryption.d.cts.map +1 -1
- package/dist/types/encryption.d.ts +16 -0
- package/dist/types/encryption.d.ts.map +1 -1
- package/dist/types/encryption.js +364 -310
- package/dist/types/encryption.js.map +1 -1
- package/dist/types/errors.cjs +47 -0
- package/dist/types/errors.cjs.map +1 -0
- package/dist/types/errors.d.cts +13 -4
- package/dist/types/errors.d.cts.map +1 -1
- package/dist/types/errors.d.ts +13 -4
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +47 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/file.cjs +36 -19
- package/dist/types/file.cjs.map +1 -1
- package/dist/types/file.d.cts +2 -2
- package/dist/types/file.d.cts.map +1 -1
- package/dist/types/file.d.ts +2 -2
- package/dist/types/file.d.ts.map +1 -1
- package/dist/types/file.js +37 -21
- package/dist/types/file.js.map +1 -1
- package/dist/types/ids.cjs +53 -9
- package/dist/types/ids.cjs.map +1 -1
- package/dist/types/ids.js +54 -15
- package/dist/types/ids.js.map +1 -1
- package/dist/types/index.d.cts +12 -11
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +12 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/key.d.cts +44 -8
- package/dist/types/key.d.cts.map +1 -1
- package/dist/types/key.d.ts +44 -8
- package/dist/types/key.d.ts.map +1 -1
- package/dist/types/lock.cjs +33 -13
- package/dist/types/lock.cjs.map +1 -1
- package/dist/types/lock.js +34 -15
- package/dist/types/lock.js.map +1 -1
- package/dist/types/notifications.cjs +44 -22
- package/dist/types/notifications.cjs.map +1 -1
- package/dist/types/notifications.js +45 -23
- package/dist/types/notifications.js.map +1 -1
- package/dist/types/upload.d.cts +39 -5
- package/dist/types/upload.d.cts.map +1 -1
- package/dist/types/upload.d.ts +39 -5
- package/dist/types/upload.d.ts.map +1 -1
- package/dist/upload/abort-scope.cjs +91 -0
- package/dist/upload/abort-scope.cjs.map +1 -0
- package/dist/upload/abort-scope.d.cts +48 -0
- package/dist/upload/abort-scope.d.cts.map +1 -0
- package/dist/upload/abort-scope.d.ts +48 -0
- package/dist/upload/abort-scope.d.ts.map +1 -0
- package/dist/upload/abort-scope.js +88 -0
- package/dist/upload/abort-scope.js.map +1 -0
- package/dist/upload/cancel.cjs +183 -8
- package/dist/upload/cancel.cjs.map +1 -1
- package/dist/upload/cancel.d.cts +110 -2
- package/dist/upload/cancel.d.cts.map +1 -1
- package/dist/upload/cancel.d.ts +110 -2
- package/dist/upload/cancel.d.ts.map +1 -1
- package/dist/upload/cancel.js +178 -9
- package/dist/upload/cancel.js.map +1 -1
- package/dist/upload/concurrency.cjs +79 -52
- package/dist/upload/concurrency.cjs.map +1 -1
- package/dist/upload/concurrency.js +79 -53
- package/dist/upload/concurrency.js.map +1 -1
- package/dist/upload/finish.cjs +59 -0
- package/dist/upload/finish.cjs.map +1 -0
- package/dist/upload/finish.d.cts +26 -0
- package/dist/upload/finish.d.cts.map +1 -0
- package/dist/upload/finish.d.ts +26 -0
- package/dist/upload/finish.d.ts.map +1 -0
- package/dist/upload/finish.js +59 -0
- package/dist/upload/finish.js.map +1 -0
- package/dist/upload/large.cjs +301 -218
- package/dist/upload/large.cjs.map +1 -1
- package/dist/upload/large.d.cts +76 -9
- package/dist/upload/large.d.cts.map +1 -1
- package/dist/upload/large.d.ts +76 -9
- package/dist/upload/large.d.ts.map +1 -1
- package/dist/upload/large.js +301 -218
- package/dist/upload/large.js.map +1 -1
- package/dist/upload/options.cjs +28 -0
- package/dist/upload/options.cjs.map +1 -0
- package/dist/upload/options.d.cts +104 -0
- package/dist/upload/options.d.cts.map +1 -0
- package/dist/upload/options.d.ts +104 -0
- package/dist/upload/options.d.ts.map +1 -0
- package/dist/upload/options.js +27 -0
- package/dist/upload/options.js.map +1 -0
- package/dist/upload/resume.cjs +333 -33
- package/dist/upload/resume.cjs.map +1 -1
- package/dist/upload/resume.d.cts +82 -12
- package/dist/upload/resume.d.cts.map +1 -1
- package/dist/upload/resume.d.ts +82 -12
- package/dist/upload/resume.d.ts.map +1 -1
- package/dist/upload/resume.js +330 -33
- package/dist/upload/resume.js.map +1 -1
- package/dist/upload/retry.cjs +186 -0
- package/dist/upload/retry.cjs.map +1 -0
- package/dist/upload/retry.d.cts +127 -0
- package/dist/upload/retry.d.cts.map +1 -0
- package/dist/upload/retry.d.ts +127 -0
- package/dist/upload/retry.d.ts.map +1 -0
- package/dist/upload/retry.js +182 -0
- package/dist/upload/retry.js.map +1 -0
- package/dist/upload/single.cjs +68 -44
- package/dist/upload/single.cjs.map +1 -1
- package/dist/upload/single.d.cts +2 -1
- package/dist/upload/single.d.cts.map +1 -1
- package/dist/upload/single.d.ts +2 -1
- package/dist/upload/single.d.ts.map +1 -1
- package/dist/upload/single.js +68 -44
- package/dist/upload/single.js.map +1 -1
- package/dist/upload/stream.cjs +317 -193
- package/dist/upload/stream.cjs.map +1 -1
- package/dist/upload/stream.d.cts +3 -1
- package/dist/upload/stream.d.cts.map +1 -1
- package/dist/upload/stream.d.ts +3 -1
- package/dist/upload/stream.d.ts.map +1 -1
- package/dist/upload/stream.js +316 -192
- package/dist/upload/stream.js.map +1 -1
- package/dist/util/best-effort.cjs +42 -8
- package/dist/util/best-effort.cjs.map +1 -1
- package/dist/util/best-effort.d.cts +2 -1
- package/dist/util/best-effort.d.cts.map +1 -1
- package/dist/util/best-effort.d.ts +2 -1
- package/dist/util/best-effort.d.ts.map +1 -1
- package/dist/util/best-effort.js +43 -9
- package/dist/util/best-effort.js.map +1 -1
- package/dist/util/bytes.cjs +23 -0
- package/dist/util/bytes.cjs.map +1 -0
- package/dist/util/bytes.d.cts +15 -0
- package/dist/util/bytes.d.cts.map +1 -0
- package/dist/util/bytes.d.ts +15 -0
- package/dist/util/bytes.d.ts.map +1 -0
- package/dist/util/bytes.js +23 -0
- package/dist/util/bytes.js.map +1 -0
- package/dist/util/crypto.cjs +68 -0
- package/dist/util/crypto.cjs.map +1 -0
- package/dist/util/crypto.d.cts +26 -0
- package/dist/util/crypto.d.cts.map +1 -0
- package/dist/util/crypto.d.ts +26 -0
- package/dist/util/crypto.d.ts.map +1 -0
- package/dist/util/crypto.js +66 -0
- package/dist/util/crypto.js.map +1 -0
- package/dist/util/defaults.cjs +25 -9
- package/dist/util/defaults.cjs.map +1 -1
- package/dist/util/defaults.js +26 -11
- package/dist/util/defaults.js.map +1 -1
- package/dist/util/error-reason.cjs +41 -0
- package/dist/util/error-reason.cjs.map +1 -0
- package/dist/util/error-reason.d.cts +9 -0
- package/dist/util/error-reason.d.cts.map +1 -0
- package/dist/util/error-reason.d.ts +9 -0
- package/dist/util/error-reason.d.ts.map +1 -0
- package/dist/util/error-reason.js +41 -0
- package/dist/util/error-reason.js.map +1 -0
- package/dist/util/http.cjs +23 -0
- package/dist/util/http.cjs.map +1 -0
- package/dist/util/http.d.cts +13 -0
- package/dist/util/http.d.cts.map +1 -0
- package/dist/util/http.d.ts +13 -0
- package/dist/util/http.d.ts.map +1 -0
- package/dist/util/http.js +23 -0
- package/dist/util/http.js.map +1 -0
- package/dist/util/normalize.cjs +66 -7
- package/dist/util/normalize.cjs.map +1 -1
- package/dist/util/normalize.js +67 -10
- package/dist/util/normalize.js.map +1 -1
- package/dist/util/paginator.cjs +63 -14
- package/dist/util/paginator.cjs.map +1 -1
- package/dist/util/paginator.js +64 -16
- package/dist/util/paginator.js.map +1 -1
- package/dist/util/plan-ranges.cjs +47 -22
- package/dist/util/plan-ranges.cjs.map +1 -1
- package/dist/util/plan-ranges.js +48 -24
- package/dist/util/plan-ranges.js.map +1 -1
- package/dist/util/sha1.cjs +27 -0
- package/dist/util/sha1.cjs.map +1 -0
- package/dist/util/sha1.d.cts +17 -0
- package/dist/util/sha1.d.cts.map +1 -0
- package/dist/util/sha1.d.ts +17 -0
- package/dist/util/sha1.d.ts.map +1 -0
- package/dist/util/sha1.js +26 -0
- package/dist/util/sha1.js.map +1 -0
- package/dist/util/text-codec.cjs +29 -5
- package/dist/util/text-codec.cjs.map +1 -1
- package/dist/util/text-codec.js +30 -7
- package/dist/util/text-codec.js.map +1 -1
- package/dist/util/to-error.cjs +18 -4
- package/dist/util/to-error.cjs.map +1 -1
- package/dist/util/to-error.js +19 -5
- package/dist/util/to-error.js.map +1 -1
- package/dist/version.cjs +17 -5
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +3 -3
- package/dist/version.d.ts +3 -3
- package/dist/version.js +19 -6
- package/dist/version.js.map +1 -1
- package/package.json +19 -16
- package/dist/auth/index.cjs.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/notifications/index.cjs.map +0 -1
- package/dist/notifications/index.js.map +0 -1
- package/dist/package.json.cjs +0 -9
- package/dist/package.json.cjs.map +0 -1
- package/dist/package.json.js +0 -9
- package/dist/package.json.js.map +0 -1
- package/dist/streams/index.cjs.map +0 -1
- package/dist/streams/index.js.map +0 -1
- package/dist/sync/index.cjs.map +0 -1
- package/dist/sync/index.js.map +0 -1
package/dist/sync/types.d.ts
CHANGED
|
@@ -1,11 +1,97 @@
|
|
|
1
1
|
import { EncryptionSetting } from '../types/encryption.js';
|
|
2
2
|
import { FileVersion } from '../types/file.js';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { SyncSha1State } from './sha1-metadata.js';
|
|
4
|
+
/**
|
|
5
|
+
* Strategy for comparing source and destination files.
|
|
6
|
+
*
|
|
7
|
+
* The `sha1` mode compares 40-character hexadecimal SHA-1 digests as a practical drift
|
|
8
|
+
* detector. Digest case is normalized before comparison. Missing, null, unavailable, or
|
|
9
|
+
* non-verifiable metadata cannot prove equality: the high-level synchronizer either transfers
|
|
10
|
+
* conservatively for untrusted metadata or skips action generation with a surfaced event when a
|
|
11
|
+
* B2 file has no comparable digest. Untrusted B2 metadata may require downloading the selected
|
|
12
|
+
* B2 version to hash its bytes before equality can be trusted. This is not a cryptographic
|
|
13
|
+
* integrity or tamper-proofing guarantee, because SHA-1 collisions are possible.
|
|
14
|
+
*/
|
|
15
|
+
export type CompareMode = 'modtime' | 'size' | 'sha1' | 'none';
|
|
5
16
|
/** Strategy for handling destination files not present in the source. */
|
|
6
17
|
export type KeepMode = 'no-delete' | 'delete' | 'keep-days';
|
|
7
18
|
/** Direction of a sync operation. */
|
|
8
19
|
export type SyncDirection = 'local-to-b2' | 'b2-to-local' | 'b2-to-b2';
|
|
20
|
+
/**
|
|
21
|
+
* Glob string or regular expression used to include or exclude sync paths.
|
|
22
|
+
*
|
|
23
|
+
* Glob strings use a small SDK-defined dialect against folder-relative paths with forward
|
|
24
|
+
* slashes: `*` and `?` match within one path segment, and a path segment that is exactly `**`
|
|
25
|
+
* matches across directory boundaries. Character classes, brace expansion, extglobs, and
|
|
26
|
+
* backslash escaping are not supported. Slash-less globs use basename-style matching at any
|
|
27
|
+
* directory depth, so `*.tmp` matches `nested/file.tmp` and `readme.md` matches both `readme.md`
|
|
28
|
+
* and `docs/readme.md`. They also match ancestor directory names, so `node_modules` matches every
|
|
29
|
+
* file under a `node_modules` directory. Exclude filters win over include filters.
|
|
30
|
+
*
|
|
31
|
+
* Regular expressions are matched against the full relative path. Global and sticky flags are
|
|
32
|
+
* ignored so matching does not mutate `lastIndex`. RegExp acceptance is a best-effort safety
|
|
33
|
+
* heuristic for synchronous matching, and the exact accepted subset may change as the SDK tightens
|
|
34
|
+
* protection. Current guards reject overly long sources, backreferences, multiple unbounded
|
|
35
|
+
* quantifiers, large or excessive bounded quantifiers, and quantified groups whose subtree
|
|
36
|
+
* contains a quantifier or alternation.
|
|
37
|
+
* When any RegExp filter is configured, paths longer than the SDK's RegExp input guard are skipped
|
|
38
|
+
* instead of being fed to the JavaScript RegExp engine. This is fail-closed for deny-lists: an
|
|
39
|
+
* untestable long path is not allowed through an exclude RegExp filter.
|
|
40
|
+
*/
|
|
41
|
+
export type SyncFilterPattern = string | RegExp;
|
|
42
|
+
/**
|
|
43
|
+
* Include/exclude filters applied to sync paths relative to each folder root.
|
|
44
|
+
*
|
|
45
|
+
* `SyncOptions.include` and `SyncOptions.exclude` are the canonical filters for
|
|
46
|
+
* {@link synchronize}; they are passed down into folder scans and then enforced again during
|
|
47
|
+
* pairing as the SDK policy boundary. Calling
|
|
48
|
+
* {@link SyncFolder.scan} directly can pass the same filter object for standalone scans.
|
|
49
|
+
*/
|
|
50
|
+
export interface SyncFilterOptions {
|
|
51
|
+
/**
|
|
52
|
+
* Optional allow-list. When present, only paths matching at least one pattern are scanned.
|
|
53
|
+
* B2 scans can push down only the safe literal prefix from slash-containing glob includes;
|
|
54
|
+
* other include filtering is client-side.
|
|
55
|
+
*/
|
|
56
|
+
readonly include?: readonly SyncFilterPattern[];
|
|
57
|
+
/**
|
|
58
|
+
* Optional deny-list. Paths matching any exclude pattern are skipped even when they also match
|
|
59
|
+
* an include pattern. Excludes are client-side filters; they do not reduce B2 list API calls or
|
|
60
|
+
* the B2 scanner's version grouping and sort memory.
|
|
61
|
+
*/
|
|
62
|
+
readonly exclude?: readonly SyncFilterPattern[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Options accepted by {@link SyncFolder.scan}. Includes filters plus an optional scan-level
|
|
66
|
+
* callback for paths the scanner cannot safely represent or test.
|
|
67
|
+
*/
|
|
68
|
+
export interface SyncScanOptions extends SyncFilterOptions {
|
|
69
|
+
/**
|
|
70
|
+
* Optional signal checked by built-in scanners while enumerating. Aborting stops local traversal
|
|
71
|
+
* promptly and stops B2 scans before requesting the next page.
|
|
72
|
+
*/
|
|
73
|
+
readonly signal?: AbortSignal;
|
|
74
|
+
/**
|
|
75
|
+
* Receives scan diagnostics. Built-in scanners may continue after recoverable per-path
|
|
76
|
+
* diagnostics, such as unreadable local children, but fatal scan failures still abort.
|
|
77
|
+
*/
|
|
78
|
+
readonly onError?: (event: SyncErrorEvent) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Receives scanner skip diagnostics. Built-in scans isolate callback errors so diagnostics
|
|
81
|
+
* handlers cannot abort the scan.
|
|
82
|
+
*/
|
|
83
|
+
readonly onSkip?: (event: SyncSkipEvent) => void;
|
|
84
|
+
/**
|
|
85
|
+
* When true, B2 scanners skip names that cannot be written safely to a local filesystem
|
|
86
|
+
* destination and reject case/Unicode-canonical local path collisions.
|
|
87
|
+
*/
|
|
88
|
+
readonly requireLocalSafePaths?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Maximum number of entries a scanner may retain before failing with a defined error instead of
|
|
91
|
+
* continuing toward unbounded heap growth. Defaults to the SDK scan limit.
|
|
92
|
+
*/
|
|
93
|
+
readonly maxScanEntries?: number;
|
|
94
|
+
}
|
|
9
95
|
/** Common metadata for a file discovered during a folder scan. */
|
|
10
96
|
export interface SyncPath {
|
|
11
97
|
/** Path relative to the sync folder root, using forward slashes. */
|
|
@@ -14,11 +100,51 @@ export interface SyncPath {
|
|
|
14
100
|
readonly modTimeMillis: number;
|
|
15
101
|
/** File size in bytes. */
|
|
16
102
|
readonly size: number;
|
|
103
|
+
/**
|
|
104
|
+
* SHA-1 checksum state for compare modes that need content hashes.
|
|
105
|
+
*
|
|
106
|
+
* - `undefined`: not computed yet; the synchronizer may hash local files before comparing.
|
|
107
|
+
* - `null`: known to be unavailable; `sha1` sync skips the pair with a surfaced event.
|
|
108
|
+
* - 40-character hex string: known verifiable digest.
|
|
109
|
+
* - other string: untrusted provider metadata such as B2's `unverified:<hex>` sentinel;
|
|
110
|
+
* consumers must not treat it as proof that bytes match. The `sha1` synchronizer must
|
|
111
|
+
* verify untrusted B2 bytes before using them for equality, or transfer conservatively.
|
|
112
|
+
*
|
|
113
|
+
* Use `parseSyncContentSha1`, `selectB2ComparableSha1`, and `untrustedSha1` from the sync
|
|
114
|
+
* entrypoint to construct or inspect this field without depending on sentinel strings.
|
|
115
|
+
*/
|
|
116
|
+
readonly contentSha1?: string | null;
|
|
117
|
+
/**
|
|
118
|
+
* Explicit SHA-1 trust and availability state. Prefer this field for custom
|
|
119
|
+
* scanners that can distinguish verified digests from untrusted provider
|
|
120
|
+
* metadata without relying on `contentSha1` sentinel strings. When omitted,
|
|
121
|
+
* the synchronizer derives the state from `contentSha1` for compatibility.
|
|
122
|
+
*/
|
|
123
|
+
readonly contentSha1State?: SyncSha1State;
|
|
124
|
+
}
|
|
125
|
+
/** Filesystem identity captured while scanning a local file. */
|
|
126
|
+
export interface LocalFileIdentity {
|
|
127
|
+
/** Device ID from the local filesystem. */
|
|
128
|
+
readonly deviceId: number;
|
|
129
|
+
/** Inode number from the local filesystem. */
|
|
130
|
+
readonly inode: number;
|
|
131
|
+
/** Size observed during the scan. */
|
|
132
|
+
readonly size: number;
|
|
133
|
+
/** Modification time observed during the scan, floored to milliseconds. */
|
|
134
|
+
readonly modTimeMillis: number;
|
|
135
|
+
/**
|
|
136
|
+
* Node `Stats.ctimeMs` observed during the scan, floored to milliseconds.
|
|
137
|
+
* This is inode-change time on POSIX and may be creation time on Windows.
|
|
138
|
+
* Built-in local scans populate this; custom scanners may omit it.
|
|
139
|
+
*/
|
|
140
|
+
readonly changeTimeMillis?: number;
|
|
17
141
|
}
|
|
18
142
|
/** A file on the local filesystem discovered during a scan. */
|
|
19
143
|
export interface LocalSyncPath extends SyncPath {
|
|
20
144
|
/** Absolute filesystem path to the file. */
|
|
21
145
|
readonly absolutePath: string;
|
|
146
|
+
/** Optional filesystem identity used to reject scan-to-read races. */
|
|
147
|
+
readonly fileIdentity?: LocalFileIdentity;
|
|
22
148
|
}
|
|
23
149
|
/** A file in a B2 bucket discovered during a scan. */
|
|
24
150
|
export interface B2SyncPath extends SyncPath {
|
|
@@ -30,13 +156,15 @@ export interface B2SyncPath extends SyncPath {
|
|
|
30
156
|
/** Discriminated event types emitted during synchronization. */
|
|
31
157
|
export type SyncEventType = 'upload-start' | 'upload-done' | 'download-start' | 'download-done' | 'copy-start' | 'copy-done' | 'hide' | 'delete-remote' | 'delete-local' | 'skip' | 'error' | 'compare';
|
|
32
158
|
/**
|
|
33
|
-
* Action event types: per-file
|
|
34
|
-
*
|
|
35
|
-
*
|
|
159
|
+
* Action event types: per-file transfer or metadata-change outcomes that
|
|
160
|
+
* always carry a `path` and a `size`. Skips are reported separately as
|
|
161
|
+
* {@link SyncSkipEvent} because they carry a diagnostic `message`.
|
|
36
162
|
*/
|
|
37
|
-
export type SyncActionEventType = 'upload-start' | 'upload-done' | 'download-start' | 'download-done' | 'copy-start' | 'copy-done' | 'hide' | 'delete-remote' | 'delete-local'
|
|
163
|
+
export type SyncActionEventType = 'upload-start' | 'upload-done' | 'download-start' | 'download-done' | 'copy-start' | 'copy-done' | 'hide' | 'delete-remote' | 'delete-local';
|
|
164
|
+
/** Machine-readable reasons emitted with scanner and diagnostic skip events. */
|
|
165
|
+
export type SyncSkipReason = 'outside-prefix' | 'unsafe-name' | 'local-unsafe-name' | 'relative-path-collision' | 'local-path-collision' | 'filesystem-error' | 'path-too-long-for-regexp' | 'scan-skip-overflow' | 'stale-download-partial';
|
|
38
166
|
/**
|
|
39
|
-
* Per-action progress event (transfer
|
|
167
|
+
* Per-action progress event (transfer or metadata change). All
|
|
40
168
|
* action-event variants share the same shape; the `type` tag distinguishes
|
|
41
169
|
* them.
|
|
42
170
|
*/
|
|
@@ -45,9 +173,22 @@ export interface SyncActionEvent {
|
|
|
45
173
|
readonly type: SyncActionEventType;
|
|
46
174
|
/** Relative path of the file this event concerns. */
|
|
47
175
|
readonly path: string;
|
|
48
|
-
/** Size in bytes of the file involved, or 0 for metadata-only
|
|
176
|
+
/** Size in bytes of the file involved, or `0` for metadata-only actions. */
|
|
49
177
|
readonly size: number;
|
|
50
178
|
}
|
|
179
|
+
/** Per-file comparison progress event. */
|
|
180
|
+
export interface SyncCompareEvent {
|
|
181
|
+
/** Discriminant tag (always the literal string `'compare'`). */
|
|
182
|
+
readonly type: 'compare';
|
|
183
|
+
/** Relative path of the compared file. */
|
|
184
|
+
readonly path: string;
|
|
185
|
+
/** Reserved for compatibility with earlier metadata-only compare events. */
|
|
186
|
+
readonly size: 0;
|
|
187
|
+
/** Local file bytes hashed while preparing this comparison, if any. */
|
|
188
|
+
readonly bytesHashed?: number;
|
|
189
|
+
/** B2 bytes downloaded and hashed while verifying untrusted SHA-1 metadata, if any. */
|
|
190
|
+
readonly bytesVerified?: number;
|
|
191
|
+
}
|
|
51
192
|
/**
|
|
52
193
|
* `skip` event — a destination-only file that policy decided to keep, or
|
|
53
194
|
* a same-on-both file that didn't need transfer. Always carries a
|
|
@@ -56,12 +197,16 @@ export interface SyncActionEvent {
|
|
|
56
197
|
export interface SyncSkipEvent {
|
|
57
198
|
/** Discriminant tag (always the literal string `'skip'`). */
|
|
58
199
|
readonly type: 'skip';
|
|
59
|
-
/** Relative path of the skipped file. */
|
|
200
|
+
/** Relative path of the skipped file, or the raw B2 key when no safe relative path exists. */
|
|
60
201
|
readonly path: string;
|
|
61
202
|
/** Size in bytes of the file involved, always 0 for skip events. */
|
|
62
203
|
readonly size: number;
|
|
63
204
|
/** Human-readable reason for skipping this file. */
|
|
64
205
|
readonly message: string;
|
|
206
|
+
/** Machine-readable skip reason when emitted by a scanner or diagnostic buffer. */
|
|
207
|
+
readonly reason?: SyncSkipReason;
|
|
208
|
+
/** Original B2 key when the skip came from a B2 scan. */
|
|
209
|
+
readonly b2FileName?: string;
|
|
65
210
|
}
|
|
66
211
|
/**
|
|
67
212
|
* `error` event — an action threw or the engine encountered a fatal
|
|
@@ -77,6 +222,12 @@ export interface SyncErrorEvent {
|
|
|
77
222
|
readonly size: number;
|
|
78
223
|
/** Human-readable error message; never empty. */
|
|
79
224
|
readonly message: string;
|
|
225
|
+
/** Number of failed actions represented by an aggregate run-level error event. */
|
|
226
|
+
readonly failureCount?: number;
|
|
227
|
+
/** Bounded distinct relative paths of failed actions represented by an aggregate error event. */
|
|
228
|
+
readonly failedPaths?: readonly string[];
|
|
229
|
+
/** Number of failed action paths omitted from a bounded aggregate error event. */
|
|
230
|
+
readonly failedPathOmittedCount?: number;
|
|
80
231
|
}
|
|
81
232
|
/**
|
|
82
233
|
* An event emitted by the sync engine to report progress, skip
|
|
@@ -84,23 +235,45 @@ export interface SyncErrorEvent {
|
|
|
84
235
|
* `case 'error':` (or `'skip':`) to narrow into a variant with `message`
|
|
85
236
|
* guaranteed non-optional.
|
|
86
237
|
*/
|
|
87
|
-
export type SyncEvent = SyncActionEvent | SyncSkipEvent | SyncErrorEvent;
|
|
238
|
+
export type SyncEvent = SyncActionEvent | SyncCompareEvent | SyncSkipEvent | SyncErrorEvent;
|
|
88
239
|
/** Configuration options for a sync operation. */
|
|
89
|
-
export interface SyncOptions {
|
|
240
|
+
export interface SyncOptions extends SyncFilterOptions {
|
|
90
241
|
/** How to decide whether two files differ. */
|
|
91
242
|
readonly compareMode: CompareMode;
|
|
92
243
|
/** What to do with destination files absent from the source. */
|
|
93
244
|
readonly keepMode: KeepMode;
|
|
94
245
|
/** Number of days to retain orphaned destination files when keepMode is 'keep-days'. */
|
|
95
246
|
readonly keepDays?: number;
|
|
96
|
-
/** Maximum number of concurrent transfer actions. Defaults to 4. */
|
|
247
|
+
/** Maximum number of concurrent transfer actions. Must be a positive integer. Defaults to 4. */
|
|
97
248
|
readonly concurrency?: number;
|
|
98
249
|
/** When true, actions are generated but not executed. */
|
|
99
250
|
readonly dryRun?: boolean;
|
|
100
251
|
/** Tolerance for comparison (bytes for size, milliseconds for modtime). */
|
|
101
252
|
readonly compareThreshold?: number;
|
|
102
|
-
/** Signal to abort the sync operation. */
|
|
253
|
+
/** Signal to abort the sync operation, including scans and in-progress SHA-1 reads. */
|
|
103
254
|
readonly signal?: AbortSignal;
|
|
255
|
+
/** Optional idle/no-progress timeout in milliseconds for SHA-1 reads in `sha1` mode. */
|
|
256
|
+
readonly sha1ReadTimeoutMillis?: number;
|
|
257
|
+
/**
|
|
258
|
+
* Optional absolute deadline in milliseconds for untrusted B2 SHA-1 verification reads.
|
|
259
|
+
* Objects that cannot be fully verified before this deadline are skipped for that run.
|
|
260
|
+
*/
|
|
261
|
+
readonly sha1VerificationTimeoutMillis?: number;
|
|
262
|
+
/**
|
|
263
|
+
* Optional per-file byte ceiling for untrusted B2 SHA-1 verification reads.
|
|
264
|
+
*
|
|
265
|
+
* By default, verifying untrusted B2 metadata may download the selected version's full
|
|
266
|
+
* `contentLength` each run. Set this to a lower value to skip objects above the per-file
|
|
267
|
+
* budget before they can be treated as equal.
|
|
268
|
+
*/
|
|
269
|
+
readonly sha1VerificationMaxBytes?: number;
|
|
270
|
+
/**
|
|
271
|
+
* Idle timeout in milliseconds for B2-to-local download body reads. Must be positive, or
|
|
272
|
+
* `Infinity` to disable the timeout. Defaults to 60 seconds.
|
|
273
|
+
*/
|
|
274
|
+
readonly downloadIdleTimeoutMillis?: number;
|
|
275
|
+
/** Maximum scanner entries retained before failing with a defined scan-limit error. */
|
|
276
|
+
readonly maxScanEntries?: number;
|
|
104
277
|
/** Optional provider for per-file encryption settings. */
|
|
105
278
|
readonly encryptionProvider?: SyncEncryptionProvider;
|
|
106
279
|
}
|
|
@@ -111,11 +284,30 @@ export interface SyncEncryptionProvider {
|
|
|
111
284
|
/** Returns the encryption setting to use when downloading a file, or undefined for default. */
|
|
112
285
|
getSettingForDownload(fileVersion: FileVersion): EncryptionSetting | undefined;
|
|
113
286
|
}
|
|
114
|
-
/**
|
|
287
|
+
/**
|
|
288
|
+
* A scannable folder (local or B2) that yields files relative to its sync root.
|
|
289
|
+
*
|
|
290
|
+
* Built-in scanners currently sort before yielding. Large local trees or B2 prefixes may therefore
|
|
291
|
+
* require memory proportional to the scanned entries; B2 scans also group listed versions before
|
|
292
|
+
* yielding. For B2, `maxScanEntries` counts every listed file version before prefix, safety, and
|
|
293
|
+
* filter checks, and exclude filters or non-literal includes do not bound B2 listing calls.
|
|
294
|
+
*/
|
|
115
295
|
export interface SyncFolder {
|
|
116
296
|
/** Whether this folder is local or in B2. */
|
|
117
297
|
readonly type: 'local' | 'b2';
|
|
118
|
-
/**
|
|
119
|
-
|
|
298
|
+
/**
|
|
299
|
+
* True when `scan(filters)` already enforces include/exclude filters itself as an optimization.
|
|
300
|
+
* The synchronizer still reapplies filters after custom scanner output as the SDK policy
|
|
301
|
+
* boundary. Custom folders that set this should use the exported filter helpers from
|
|
302
|
+
* `@backblaze-labs/b2-sdk/sync` to stay aligned with the SDK glob and RegExp dialect.
|
|
303
|
+
*/
|
|
304
|
+
readonly appliesScanFilters?: true;
|
|
305
|
+
/**
|
|
306
|
+
* True when `scan(filters)` already yields entries in `compareSyncRelativePaths` order.
|
|
307
|
+
* Custom folders that omit this are sorted by `synchronize()` before pairing.
|
|
308
|
+
*/
|
|
309
|
+
readonly appliesScanSorting?: true;
|
|
310
|
+
/** Scans the folder and yields files relative to the folder root. */
|
|
311
|
+
scan(options?: SyncScanOptions): AsyncIterable<SyncPath>;
|
|
120
312
|
}
|
|
121
313
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/sync/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAE9D,yEAAyE;AACzE,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAA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
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
//#region src/types/auth.ts
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the B2 API capabilities that can be granted to an
|
|
4
|
+
* application key. Each capability controls access to a specific set of
|
|
5
|
+
* API operations.
|
|
6
|
+
*
|
|
7
|
+
* Use these when constructing the `capabilities` array for an application
|
|
8
|
+
* key request, or when checking required capabilities via
|
|
9
|
+
* `B2Client.hasCapabilities`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const check = client.hasCapabilities([Capability.WriteFiles, Capability.ReadFiles])
|
|
14
|
+
* if (!check.ok) throw new Error(`missing: ${check.missing.join(', ')}`)
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
var Capability = {
|
|
18
|
+
/** List application keys. */
|
|
19
|
+
ListKeys: "listKeys",
|
|
20
|
+
/** Create new application keys. */
|
|
21
|
+
WriteKeys: "writeKeys",
|
|
22
|
+
/** Delete application keys. */
|
|
23
|
+
DeleteKeys: "deleteKeys",
|
|
24
|
+
/** List buckets (subject to key restrictions). */
|
|
25
|
+
ListBuckets: "listBuckets",
|
|
26
|
+
/** List bucket names without other metadata. */
|
|
27
|
+
ListAllBucketNames: "listAllBucketNames",
|
|
28
|
+
/** Read bucket settings. */
|
|
29
|
+
ReadBuckets: "readBuckets",
|
|
30
|
+
/** Create and update buckets. */
|
|
31
|
+
WriteBuckets: "writeBuckets",
|
|
32
|
+
/** Remove existing buckets from the account. */
|
|
33
|
+
DeleteBuckets: "deleteBuckets",
|
|
34
|
+
/** Read bucket-level Object Lock retention settings. */
|
|
35
|
+
ReadBucketRetentions: "readBucketRetentions",
|
|
36
|
+
/** Modify bucket-level Object Lock retention settings. */
|
|
37
|
+
WriteBucketRetentions: "writeBucketRetentions",
|
|
38
|
+
/** Read default bucket encryption settings. */
|
|
39
|
+
ReadBucketEncryption: "readBucketEncryption",
|
|
40
|
+
/** Modify default bucket encryption settings. */
|
|
41
|
+
WriteBucketEncryption: "writeBucketEncryption",
|
|
42
|
+
/** Read bucket replication configuration. */
|
|
43
|
+
ReadBucketReplications: "readBucketReplications",
|
|
44
|
+
/** Modify bucket replication configuration. */
|
|
45
|
+
WriteBucketReplications: "writeBucketReplications",
|
|
46
|
+
/** Read bucket event-notification rules. */
|
|
47
|
+
ReadBucketNotifications: "readBucketNotifications",
|
|
48
|
+
/** Modify bucket event-notification rules. */
|
|
49
|
+
WriteBucketNotifications: "writeBucketNotifications",
|
|
50
|
+
/** Read bucket logging settings. */
|
|
51
|
+
ReadBucketLogging: "readBucketLogging",
|
|
52
|
+
/** Modify bucket logging settings. */
|
|
53
|
+
WriteBucketLogging: "writeBucketLogging",
|
|
54
|
+
/** List file names and versions. */
|
|
55
|
+
ListFiles: "listFiles",
|
|
56
|
+
/** Download files. */
|
|
57
|
+
ReadFiles: "readFiles",
|
|
58
|
+
/** Mint download authorisation tokens. */
|
|
59
|
+
ShareFiles: "shareFiles",
|
|
60
|
+
/** Upload files. */
|
|
61
|
+
WriteFiles: "writeFiles",
|
|
62
|
+
/** Delete file versions. */
|
|
63
|
+
DeleteFiles: "deleteFiles",
|
|
64
|
+
/** Read per-file legal hold flags. */
|
|
65
|
+
ReadFileLegalHolds: "readFileLegalHolds",
|
|
66
|
+
/** Modify per-file legal hold flags. */
|
|
67
|
+
WriteFileLegalHolds: "writeFileLegalHolds",
|
|
68
|
+
/** Read per-file Object Lock retention settings. */
|
|
69
|
+
ReadFileRetentions: "readFileRetentions",
|
|
70
|
+
/** Modify per-file Object Lock retention settings. */
|
|
71
|
+
WriteFileRetentions: "writeFileRetentions",
|
|
72
|
+
/** Shorten governance-mode retention. */
|
|
73
|
+
BypassGovernance: "bypassGovernance"
|
|
56
74
|
};
|
|
75
|
+
//#endregion
|
|
57
76
|
exports.Capability = Capability;
|
|
58
|
-
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=auth.cjs.map
|
package/dist/types/auth.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.cjs","sources":["../../src/types/auth.ts"],"sourcesContent":["import type { AccountId, AuthToken, BucketId } from './ids.ts'\n\n/**\n * Named constants for the B2 API capabilities that can be granted to an\n * application key. Each capability controls access to a specific set of\n * API operations.\n *\n * Use these when constructing the `capabilities` array for an application\n * key request, or when checking required capabilities via\n * `B2Client.hasCapabilities`.\n *\n * @example\n * ```ts\n * const check = client.hasCapabilities([Capability.WriteFiles, Capability.ReadFiles])\n * if (!check.ok) throw new Error(`missing: ${check.missing.join(', ')}`)\n * ```\n */\nexport const Capability = {\n /** List application keys. */\n ListKeys: 'listKeys',\n /** Create new application keys. */\n WriteKeys: 'writeKeys',\n /** Delete application keys. */\n DeleteKeys: 'deleteKeys',\n /** List buckets (subject to key restrictions). */\n ListBuckets: 'listBuckets',\n /** List bucket names without other metadata. */\n ListAllBucketNames: 'listAllBucketNames',\n /** Read bucket settings. */\n ReadBuckets: 'readBuckets',\n /** Create and update buckets. */\n WriteBuckets: 'writeBuckets',\n /** Remove existing buckets from the account. */\n DeleteBuckets: 'deleteBuckets',\n /** Read bucket-level Object Lock retention settings. */\n ReadBucketRetentions: 'readBucketRetentions',\n /** Modify bucket-level Object Lock retention settings. */\n WriteBucketRetentions: 'writeBucketRetentions',\n /** Read default bucket encryption settings. */\n ReadBucketEncryption: 'readBucketEncryption',\n /** Modify default bucket encryption settings. */\n WriteBucketEncryption: 'writeBucketEncryption',\n /** Read bucket replication configuration. */\n ReadBucketReplications: 'readBucketReplications',\n /** Modify bucket replication configuration. */\n WriteBucketReplications: 'writeBucketReplications',\n /** Read bucket event-notification rules. */\n ReadBucketNotifications: 'readBucketNotifications',\n /** Modify bucket event-notification rules. */\n WriteBucketNotifications: 'writeBucketNotifications',\n /** List file names and versions. */\n ListFiles: 'listFiles',\n /** Download files. */\n ReadFiles: 'readFiles',\n /** Mint download authorisation tokens. */\n ShareFiles: 'shareFiles',\n /** Upload files. */\n WriteFiles: 'writeFiles',\n /** Delete file versions. */\n DeleteFiles: 'deleteFiles',\n /** Read per-file legal hold flags. */\n ReadFileLegalHolds: 'readFileLegalHolds',\n /** Modify per-file legal hold flags. */\n WriteFileLegalHolds: 'writeFileLegalHolds',\n /** Read per-file Object Lock retention settings. */\n ReadFileRetentions: 'readFileRetentions',\n /** Modify per-file Object Lock retention settings. */\n WriteFileRetentions: 'writeFileRetentions',\n /** Shorten governance-mode retention. */\n BypassGovernance: 'bypassGovernance',\n} as const\n\n/**\n * A B2 API capability that can be granted to an application key. Derived\n * from {@link Capability}.\n */\nexport type Capability = (typeof Capability)[keyof typeof Capability]\n\n/** Describes the capabilities and scope restrictions of an authorized application key. */\nexport interface AllowedInfo {\n /** List of capabilities granted to this key. */\n readonly capabilities: readonly Capability[]\n /** Bucket ID this key is restricted to, or null if unrestricted
|
|
1
|
+
{"version":3,"file":"auth.cjs","names":[],"sources":["../../src/types/auth.ts"],"sourcesContent":["import type { AccountId, AuthToken, BucketId } from './ids.ts'\n\n/**\n * Named constants for the B2 API capabilities that can be granted to an\n * application key. Each capability controls access to a specific set of\n * API operations.\n *\n * Use these when constructing the `capabilities` array for an application\n * key request, or when checking required capabilities via\n * `B2Client.hasCapabilities`.\n *\n * @example\n * ```ts\n * const check = client.hasCapabilities([Capability.WriteFiles, Capability.ReadFiles])\n * if (!check.ok) throw new Error(`missing: ${check.missing.join(', ')}`)\n * ```\n */\nexport const Capability = {\n /** List application keys. */\n ListKeys: 'listKeys',\n /** Create new application keys. */\n WriteKeys: 'writeKeys',\n /** Delete application keys. */\n DeleteKeys: 'deleteKeys',\n /** List buckets (subject to key restrictions). */\n ListBuckets: 'listBuckets',\n /** List bucket names without other metadata. */\n ListAllBucketNames: 'listAllBucketNames',\n /** Read bucket settings. */\n ReadBuckets: 'readBuckets',\n /** Create and update buckets. */\n WriteBuckets: 'writeBuckets',\n /** Remove existing buckets from the account. */\n DeleteBuckets: 'deleteBuckets',\n /** Read bucket-level Object Lock retention settings. */\n ReadBucketRetentions: 'readBucketRetentions',\n /** Modify bucket-level Object Lock retention settings. */\n WriteBucketRetentions: 'writeBucketRetentions',\n /** Read default bucket encryption settings. */\n ReadBucketEncryption: 'readBucketEncryption',\n /** Modify default bucket encryption settings. */\n WriteBucketEncryption: 'writeBucketEncryption',\n /** Read bucket replication configuration. */\n ReadBucketReplications: 'readBucketReplications',\n /** Modify bucket replication configuration. */\n WriteBucketReplications: 'writeBucketReplications',\n /** Read bucket event-notification rules. */\n ReadBucketNotifications: 'readBucketNotifications',\n /** Modify bucket event-notification rules. */\n WriteBucketNotifications: 'writeBucketNotifications',\n /** Read bucket logging settings. */\n ReadBucketLogging: 'readBucketLogging',\n /** Modify bucket logging settings. */\n WriteBucketLogging: 'writeBucketLogging',\n /** List file names and versions. */\n ListFiles: 'listFiles',\n /** Download files. */\n ReadFiles: 'readFiles',\n /** Mint download authorisation tokens. */\n ShareFiles: 'shareFiles',\n /** Upload files. */\n WriteFiles: 'writeFiles',\n /** Delete file versions. */\n DeleteFiles: 'deleteFiles',\n /** Read per-file legal hold flags. */\n ReadFileLegalHolds: 'readFileLegalHolds',\n /** Modify per-file legal hold flags. */\n WriteFileLegalHolds: 'writeFileLegalHolds',\n /** Read per-file Object Lock retention settings. */\n ReadFileRetentions: 'readFileRetentions',\n /** Modify per-file Object Lock retention settings. */\n WriteFileRetentions: 'writeFileRetentions',\n /** Shorten governance-mode retention. */\n BypassGovernance: 'bypassGovernance',\n} as const\n\n/**\n * A B2 API capability that can be granted to an application key. Derived\n * from {@link Capability}.\n */\nexport type Capability = (typeof Capability)[keyof typeof Capability]\n\n/** Bucket restriction entry returned by v4 `b2_authorize_account`. */\nexport interface AllowedBucket {\n /** Bucket ID the key can access. */\n readonly id: BucketId\n /** Bucket name when available, or null when B2 does not include it. */\n readonly name: string | null\n}\n\n/** Describes the capabilities and scope restrictions of an authorized application key. */\nexport interface AllowedInfo {\n /** List of capabilities granted to this key. */\n readonly capabilities: readonly Capability[]\n /** Bucket restrictions for v4 authorization, or null if unrestricted. */\n readonly buckets: readonly AllowedBucket[] | null\n /**\n * Bucket ID this key is restricted to when it has exactly one bucket, or null\n * if unrestricted or multi-bucket.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `buckets`; use `buckets` instead.\n */\n readonly bucketId: BucketId | null\n /**\n * Bucket name this key is restricted to when it has exactly one bucket, or\n * null if unrestricted, multi-bucket, or unknown.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `buckets`; use `buckets` instead.\n */\n readonly bucketName: string | null\n /** File name prefix this key is restricted to, or null if unrestricted. */\n readonly namePrefix: string | null\n}\n\n/** Configuration for the B2 Cloud Storage API returned during authorization. */\nexport interface StorageApiInfo {\n /** Minimum allowed part size for large file uploads, in bytes. */\n readonly absoluteMinimumPartSize: number\n /** Base URL for B2 API calls. */\n readonly apiUrl: string\n /**\n * Bucket ID this key is restricted to when it has exactly one bucket, or null\n * if unrestricted or multi-bucket.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `allowed.buckets`; use `allowed.buckets` instead.\n */\n readonly bucketId: BucketId | null\n /**\n * Bucket name this key is restricted to when it has exactly one bucket, or\n * null if unrestricted, multi-bucket, or unknown.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `allowed.buckets`; use `allowed.buckets` instead.\n */\n readonly bucketName: string | null\n /** Base URL for file downloads. */\n readonly downloadUrl: string\n /**\n * Discriminator indicating this is storage API info. Always `'storageApi'`.\n *\n * @deprecated Removed from the v4 wire shape but normalized by the SDK for\n * compatibility.\n */\n readonly infoType: 'storageApi'\n /**\n * File name prefix this key is restricted to, or null if unrestricted.\n *\n * @deprecated The SDK normalizes this compatibility alias from v4\n * `allowed.namePrefix`; use `allowed.namePrefix` instead.\n */\n readonly namePrefix: string | null\n /** Recommended part size for large file uploads, in bytes. */\n readonly recommendedPartSize: number\n /** Base URL for the S3-compatible API. */\n readonly s3ApiUrl: string\n /** Capabilities and scope of the authorized key. */\n readonly allowed: AllowedInfo\n}\n\n/** Configuration for the B2 Groups API returned during authorization. */\nexport interface GroupsApiInfo {\n /** Base URL for Groups API calls. */\n readonly groupsApiUrl: string\n /** Discriminator indicating this is groups API info. Always `'groupsApi'`. */\n readonly infoType: 'groupsApi'\n}\n\n/** Container for all API-specific configuration returned by `b2_authorize_account`. */\nexport interface ApiInfo {\n /** Storage API configuration (always present). */\n readonly storageApi: StorageApiInfo\n /** Groups API configuration (present only when the account has groups enabled). */\n readonly groupsApi?: GroupsApiInfo\n}\n\n/**\n * Normalized SDK-facing response from the `b2_authorize_account` API call.\n * The SDK uses the v4 endpoint and preserves deprecated v3 compatibility\n * aliases such as `storageApi.bucketId` and `allowed.bucketId`.\n */\nexport interface AuthorizeAccountResponse {\n /** The account ID for the authorized account. */\n readonly accountId: AccountId\n /** Authorization token to use in subsequent API calls. */\n readonly authorizationToken: AuthToken\n /** API-specific configuration including endpoint URLs and key scope. */\n readonly apiInfo: ApiInfo\n /** Expiration timestamp of the application key in milliseconds, or null if the key does not expire. */\n readonly applicationKeyExpirationTimestamp: number | null\n}\n\n/**\n * Request parameters for the `b2_authorize_account` API call.\n * Credentials are sent via HTTP Basic auth in the raw API, but represented here as fields.\n */\nexport interface AuthorizeAccountRequest {\n /** The application key ID (account ID or app key ID). */\n readonly applicationKeyId: string\n /** The application key secret. */\n readonly applicationKey: string\n /**\n * Optional realm override. Accepts a known realm-map key (`\"production\"` or\n * `\"staging\"`) or a direct base URL. Custom HTTPS hosts are trusted with the\n * application key during authorize, so never derive this value from untrusted\n * input. URL values must use HTTPS, or loopback IP literal HTTP for local\n * testing only; application-key credentials are sent unencrypted over\n * loopback HTTP. Unsupported schemes, malformed URLs, non-URL strings,\n * plaintext HTTP hostnames such as `localhost`, and non-loopback plaintext\n * HTTP are rejected before credentials are sent. URL values must not include\n * userinfo, query strings, or fragments. Defaults to production.\n */\n readonly realm?: string\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,IAAa,aAAa;;CAExB,UAAU;;CAEV,WAAW;;CAEX,YAAY;;CAEZ,aAAa;;CAEb,oBAAoB;;CAEpB,aAAa;;CAEb,cAAc;;CAEd,eAAe;;CAEf,sBAAsB;;CAEtB,uBAAuB;;CAEvB,sBAAsB;;CAEtB,uBAAuB;;CAEvB,wBAAwB;;CAExB,yBAAyB;;CAEzB,yBAAyB;;CAEzB,0BAA0B;;CAE1B,mBAAmB;;CAEnB,oBAAoB;;CAEpB,WAAW;;CAEX,WAAW;;CAEX,YAAY;;CAEZ,YAAY;;CAEZ,aAAa;;CAEb,oBAAoB;;CAEpB,qBAAqB;;CAErB,oBAAoB;;CAEpB,qBAAqB;;CAErB,kBAAkB;AACpB"}
|
package/dist/types/auth.d.cts
CHANGED
|
@@ -47,6 +47,10 @@ export declare const Capability: {
|
|
|
47
47
|
readonly ReadBucketNotifications: "readBucketNotifications";
|
|
48
48
|
/** Modify bucket event-notification rules. */
|
|
49
49
|
readonly WriteBucketNotifications: "writeBucketNotifications";
|
|
50
|
+
/** Read bucket logging settings. */
|
|
51
|
+
readonly ReadBucketLogging: "readBucketLogging";
|
|
52
|
+
/** Modify bucket logging settings. */
|
|
53
|
+
readonly WriteBucketLogging: "writeBucketLogging";
|
|
50
54
|
/** List file names and versions. */
|
|
51
55
|
readonly ListFiles: "listFiles";
|
|
52
56
|
/** Download files. */
|
|
@@ -73,13 +77,34 @@ export declare const Capability: {
|
|
|
73
77
|
* from {@link Capability}.
|
|
74
78
|
*/
|
|
75
79
|
export type Capability = (typeof Capability)[keyof typeof Capability];
|
|
80
|
+
/** Bucket restriction entry returned by v4 `b2_authorize_account`. */
|
|
81
|
+
export interface AllowedBucket {
|
|
82
|
+
/** Bucket ID the key can access. */
|
|
83
|
+
readonly id: BucketId;
|
|
84
|
+
/** Bucket name when available, or null when B2 does not include it. */
|
|
85
|
+
readonly name: string | null;
|
|
86
|
+
}
|
|
76
87
|
/** Describes the capabilities and scope restrictions of an authorized application key. */
|
|
77
88
|
export interface AllowedInfo {
|
|
78
89
|
/** List of capabilities granted to this key. */
|
|
79
90
|
readonly capabilities: readonly Capability[];
|
|
80
|
-
/** Bucket
|
|
91
|
+
/** Bucket restrictions for v4 authorization, or null if unrestricted. */
|
|
92
|
+
readonly buckets: readonly AllowedBucket[] | null;
|
|
93
|
+
/**
|
|
94
|
+
* Bucket ID this key is restricted to when it has exactly one bucket, or null
|
|
95
|
+
* if unrestricted or multi-bucket.
|
|
96
|
+
*
|
|
97
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
98
|
+
* `buckets`; use `buckets` instead.
|
|
99
|
+
*/
|
|
81
100
|
readonly bucketId: BucketId | null;
|
|
82
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Bucket name this key is restricted to when it has exactly one bucket, or
|
|
103
|
+
* null if unrestricted, multi-bucket, or unknown.
|
|
104
|
+
*
|
|
105
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
106
|
+
* `buckets`; use `buckets` instead.
|
|
107
|
+
*/
|
|
83
108
|
readonly bucketName: string | null;
|
|
84
109
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
85
110
|
readonly namePrefix: string | null;
|
|
@@ -90,15 +115,37 @@ export interface StorageApiInfo {
|
|
|
90
115
|
readonly absoluteMinimumPartSize: number;
|
|
91
116
|
/** Base URL for B2 API calls. */
|
|
92
117
|
readonly apiUrl: string;
|
|
93
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* Bucket ID this key is restricted to when it has exactly one bucket, or null
|
|
120
|
+
* if unrestricted or multi-bucket.
|
|
121
|
+
*
|
|
122
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
123
|
+
* `allowed.buckets`; use `allowed.buckets` instead.
|
|
124
|
+
*/
|
|
94
125
|
readonly bucketId: BucketId | null;
|
|
95
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Bucket name this key is restricted to when it has exactly one bucket, or
|
|
128
|
+
* null if unrestricted, multi-bucket, or unknown.
|
|
129
|
+
*
|
|
130
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
131
|
+
* `allowed.buckets`; use `allowed.buckets` instead.
|
|
132
|
+
*/
|
|
96
133
|
readonly bucketName: string | null;
|
|
97
134
|
/** Base URL for file downloads. */
|
|
98
135
|
readonly downloadUrl: string;
|
|
99
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* Discriminator indicating this is storage API info. Always `'storageApi'`.
|
|
138
|
+
*
|
|
139
|
+
* @deprecated Removed from the v4 wire shape but normalized by the SDK for
|
|
140
|
+
* compatibility.
|
|
141
|
+
*/
|
|
100
142
|
readonly infoType: 'storageApi';
|
|
101
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* File name prefix this key is restricted to, or null if unrestricted.
|
|
145
|
+
*
|
|
146
|
+
* @deprecated The SDK normalizes this compatibility alias from v4
|
|
147
|
+
* `allowed.namePrefix`; use `allowed.namePrefix` instead.
|
|
148
|
+
*/
|
|
102
149
|
readonly namePrefix: string | null;
|
|
103
150
|
/** Recommended part size for large file uploads, in bytes. */
|
|
104
151
|
readonly recommendedPartSize: number;
|
|
@@ -122,8 +169,9 @@ export interface ApiInfo {
|
|
|
122
169
|
readonly groupsApi?: GroupsApiInfo;
|
|
123
170
|
}
|
|
124
171
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
172
|
+
* Normalized SDK-facing response from the `b2_authorize_account` API call.
|
|
173
|
+
* The SDK uses the v4 endpoint and preserves deprecated v3 compatibility
|
|
174
|
+
* aliases such as `storageApi.bucketId` and `allowed.bucketId`.
|
|
127
175
|
*/
|
|
128
176
|
export interface AuthorizeAccountResponse {
|
|
129
177
|
/** The account ID for the authorized account. */
|
|
@@ -144,7 +192,17 @@ export interface AuthorizeAccountRequest {
|
|
|
144
192
|
readonly applicationKeyId: string;
|
|
145
193
|
/** The application key secret. */
|
|
146
194
|
readonly applicationKey: string;
|
|
147
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* Optional realm override. Accepts a known realm-map key (`"production"` or
|
|
197
|
+
* `"staging"`) or a direct base URL. Custom HTTPS hosts are trusted with the
|
|
198
|
+
* application key during authorize, so never derive this value from untrusted
|
|
199
|
+
* input. URL values must use HTTPS, or loopback IP literal HTTP for local
|
|
200
|
+
* testing only; application-key credentials are sent unencrypted over
|
|
201
|
+
* loopback HTTP. Unsupported schemes, malformed URLs, non-URL strings,
|
|
202
|
+
* plaintext HTTP hostnames such as `localhost`, and non-loopback plaintext
|
|
203
|
+
* HTTP are rejected before credentials are sent. URL values must not include
|
|
204
|
+
* userinfo, query strings, or fragments. Defaults to production.
|
|
205
|
+
*/
|
|
148
206
|
readonly realm?: string;
|
|
149
207
|
}
|
|
150
208
|
//# sourceMappingURL=auth.d.ts.map
|