@backblaze-labs/b2-sdk 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -5
- package/README.md +144 -33
- package/dist/_virtual/_b2-sdk-version-json.cjs +4 -0
- package/dist/_virtual/_b2-sdk-version-json.js +4 -0
- package/dist/auth/account-info.d.cts +32 -0
- package/dist/auth/account-info.d.cts.map +1 -1
- package/dist/auth/account-info.d.ts +32 -0
- package/dist/auth/account-info.d.ts.map +1 -1
- package/dist/auth/file.cjs +408 -207
- package/dist/auth/file.cjs.map +1 -1
- package/dist/auth/file.d.cts +77 -3
- package/dist/auth/file.d.cts.map +1 -1
- package/dist/auth/file.d.ts +77 -3
- package/dist/auth/file.d.ts.map +1 -1
- package/dist/auth/file.js +407 -207
- package/dist/auth/file.js.map +1 -1
- package/dist/auth/in-memory.cjs +212 -183
- package/dist/auth/in-memory.cjs.map +1 -1
- package/dist/auth/in-memory.d.cts +8 -0
- package/dist/auth/in-memory.d.cts.map +1 -1
- package/dist/auth/in-memory.d.ts +8 -0
- package/dist/auth/in-memory.d.ts.map +1 -1
- package/dist/auth/in-memory.js +211 -182
- package/dist/auth/in-memory.js.map +1 -1
- package/dist/auth/index.cjs +7 -9
- package/dist/auth/index.d.cts +3 -2
- package/dist/auth/index.d.cts.map +1 -1
- package/dist/auth/index.d.ts +3 -2
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -8
- package/dist/auth/realms.cjs +80 -7
- package/dist/auth/realms.cjs.map +1 -1
- package/dist/auth/realms.d.cts +27 -4
- package/dist/auth/realms.d.cts.map +1 -1
- package/dist/auth/realms.d.ts +27 -4
- package/dist/auth/realms.d.ts.map +1 -1
- package/dist/auth/realms.js +80 -9
- package/dist/auth/realms.js.map +1 -1
- package/dist/auth/upload-url-pool.cjs +55 -51
- package/dist/auth/upload-url-pool.cjs.map +1 -1
- package/dist/auth/upload-url-pool.js +55 -51
- package/dist/auth/upload-url-pool.js.map +1 -1
- package/dist/bucket.cjs +785 -787
- package/dist/bucket.cjs.map +1 -1
- package/dist/bucket.d.cts +35 -47
- package/dist/bucket.d.cts.map +1 -1
- package/dist/bucket.d.ts +35 -47
- package/dist/bucket.d.ts.map +1 -1
- package/dist/bucket.js +780 -782
- package/dist/bucket.js.map +1 -1
- package/dist/client.cjs +246 -228
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +25 -17
- package/dist/client.d.cts.map +1 -1
- package/dist/client.d.ts +25 -17
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +243 -225
- package/dist/client.js.map +1 -1
- package/dist/copy/large.cjs +114 -71
- package/dist/copy/large.cjs.map +1 -1
- package/dist/copy/large.d.cts +6 -0
- package/dist/copy/large.d.cts.map +1 -1
- package/dist/copy/large.d.ts +6 -0
- package/dist/copy/large.d.ts.map +1 -1
- package/dist/copy/large.js +112 -69
- package/dist/copy/large.js.map +1 -1
- package/dist/download/checksum.cjs +89 -0
- package/dist/download/checksum.cjs.map +1 -0
- package/dist/download/checksum.d.cts +40 -0
- package/dist/download/checksum.d.cts.map +1 -0
- package/dist/download/checksum.d.ts +40 -0
- package/dist/download/checksum.d.ts.map +1 -0
- package/dist/download/checksum.js +87 -0
- package/dist/download/checksum.js.map +1 -0
- package/dist/download/parallel.cjs +214 -118
- package/dist/download/parallel.cjs.map +1 -1
- package/dist/download/parallel.d.cts +5 -1
- package/dist/download/parallel.d.cts.map +1 -1
- package/dist/download/parallel.d.ts +5 -1
- package/dist/download/parallel.d.ts.map +1 -1
- package/dist/download/parallel.js +212 -116
- package/dist/download/parallel.js.map +1 -1
- package/dist/download/single.cjs +188 -97
- package/dist/download/single.cjs.map +1 -1
- package/dist/download/single.d.cts +6 -1
- package/dist/download/single.d.cts.map +1 -1
- package/dist/download/single.d.ts +6 -1
- package/dist/download/single.d.ts.map +1 -1
- package/dist/download/single.js +186 -98
- package/dist/download/single.js.map +1 -1
- package/dist/errors/index.cjs +699 -243
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts +285 -82
- package/dist/errors/index.d.cts.map +1 -1
- package/dist/errors/index.d.ts +285 -82
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +678 -261
- package/dist/errors/index.js.map +1 -1
- package/dist/http/retry.cjs +45 -28
- package/dist/http/retry.cjs.map +1 -1
- package/dist/http/retry.d.cts +15 -2
- package/dist/http/retry.d.cts.map +1 -1
- package/dist/http/retry.d.ts +15 -2
- package/dist/http/retry.d.ts.map +1 -1
- package/dist/http/retry.js +46 -31
- package/dist/http/retry.js.map +1 -1
- package/dist/http/transport.cjs +438 -140
- package/dist/http/transport.cjs.map +1 -1
- package/dist/http/transport.d.cts +21 -2
- package/dist/http/transport.d.cts.map +1 -1
- package/dist/http/transport.d.ts +21 -2
- package/dist/http/transport.d.ts.map +1 -1
- package/dist/http/transport.js +437 -140
- package/dist/http/transport.js.map +1 -1
- package/dist/http/url-guard.cjs +154 -89
- package/dist/http/url-guard.cjs.map +1 -1
- package/dist/http/url-guard.d.cts +25 -3
- package/dist/http/url-guard.d.cts.map +1 -1
- package/dist/http/url-guard.d.ts +25 -3
- package/dist/http/url-guard.d.ts.map +1 -1
- package/dist/http/url-guard.js +152 -90
- package/dist/http/url-guard.js.map +1 -1
- package/dist/http/user-agent.cjs +84 -44
- package/dist/http/user-agent.cjs.map +1 -1
- package/dist/http/user-agent.js +84 -46
- package/dist/http/user-agent.js.map +1 -1
- package/dist/index.cjs +101 -77
- package/dist/index.d.cts +27 -21
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +27 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -71
- package/dist/internal/b2-naming.cjs +66 -0
- package/dist/internal/b2-naming.cjs.map +1 -0
- package/dist/internal/b2-naming.d.cts +43 -0
- package/dist/internal/b2-naming.d.cts.map +1 -0
- package/dist/internal/b2-naming.d.ts +43 -0
- package/dist/internal/b2-naming.d.ts.map +1 -0
- package/dist/internal/b2-naming.js +60 -0
- package/dist/internal/b2-naming.js.map +1 -0
- package/dist/internal/upload-retry-options.cjs +21 -0
- package/dist/internal/upload-retry-options.cjs.map +1 -0
- package/dist/internal/upload-retry-options.d.cts +12 -0
- package/dist/internal/upload-retry-options.d.cts.map +1 -0
- package/dist/internal/upload-retry-options.d.ts +12 -0
- package/dist/internal/upload-retry-options.d.ts.map +1 -0
- package/dist/internal/upload-retry-options.js +21 -0
- package/dist/internal/upload-retry-options.js.map +1 -0
- package/dist/internal/url-redaction.cjs +31 -0
- package/dist/internal/url-redaction.cjs.map +1 -0
- package/dist/internal/url-redaction.d.cts +17 -0
- package/dist/internal/url-redaction.d.cts.map +1 -0
- package/dist/internal/url-redaction.d.ts +17 -0
- package/dist/internal/url-redaction.d.ts.map +1 -0
- package/dist/internal/url-redaction.js +31 -0
- package/dist/internal/url-redaction.js.map +1 -0
- package/dist/notifications/index.cjs +4 -6
- package/dist/notifications/index.d.cts +1 -1
- package/dist/notifications/index.d.cts.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +1 -6
- package/dist/notifications/webhook.cjs +195 -85
- package/dist/notifications/webhook.cjs.map +1 -1
- package/dist/notifications/webhook.d.cts.map +1 -1
- package/dist/notifications/webhook.d.ts.map +1 -1
- package/dist/notifications/webhook.js +195 -87
- package/dist/notifications/webhook.js.map +1 -1
- package/dist/object.cjs +253 -210
- package/dist/object.cjs.map +1 -1
- package/dist/object.d.cts +9 -55
- package/dist/object.d.cts.map +1 -1
- package/dist/object.d.ts +9 -55
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +249 -206
- package/dist/object.js.map +1 -1
- package/dist/raw/encoding.cjs +74 -35
- package/dist/raw/encoding.cjs.map +1 -1
- package/dist/raw/encoding.js +74 -38
- package/dist/raw/encoding.js.map +1 -1
- package/dist/raw/index.cjs +678 -587
- package/dist/raw/index.cjs.map +1 -1
- package/dist/raw/index.d.cts +121 -18
- package/dist/raw/index.d.cts.map +1 -1
- package/dist/raw/index.d.ts +121 -18
- package/dist/raw/index.d.ts.map +1 -1
- package/dist/raw/index.js +674 -589
- package/dist/raw/index.js.map +1 -1
- package/dist/s3/index.cjs +355 -18
- package/dist/s3/index.cjs.map +1 -1
- package/dist/s3/index.d.cts +233 -5
- package/dist/s3/index.d.cts.map +1 -1
- package/dist/s3/index.d.ts +233 -5
- package/dist/s3/index.d.ts.map +1 -1
- package/dist/s3/index.js +351 -22
- package/dist/s3/index.js.map +1 -1
- package/dist/s3/sigv4.cjs +149 -0
- package/dist/s3/sigv4.cjs.map +1 -0
- package/dist/s3/sigv4.d.cts +43 -0
- package/dist/s3/sigv4.d.cts.map +1 -0
- package/dist/s3/sigv4.d.ts +43 -0
- package/dist/s3/sigv4.d.ts.map +1 -0
- package/dist/s3/sigv4.js +148 -0
- package/dist/s3/sigv4.js.map +1 -0
- package/dist/s3/validation.cjs +69 -0
- package/dist/s3/validation.cjs.map +1 -0
- package/dist/s3/validation.d.cts +43 -0
- package/dist/s3/validation.d.cts.map +1 -0
- package/dist/s3/validation.d.ts +43 -0
- package/dist/s3/validation.d.ts.map +1 -0
- package/dist/s3/validation.js +66 -0
- package/dist/s3/validation.js.map +1 -0
- package/dist/simulator/capabilities.cjs +63 -48
- package/dist/simulator/capabilities.cjs.map +1 -1
- package/dist/simulator/capabilities.js +63 -49
- package/dist/simulator/capabilities.js.map +1 -1
- package/dist/simulator/index.cjs +2124 -1548
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.d.cts +79 -11
- package/dist/simulator/index.d.cts.map +1 -1
- package/dist/simulator/index.d.ts +79 -11
- package/dist/simulator/index.d.ts.map +1 -1
- package/dist/simulator/index.js +2112 -1546
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/validation.cjs +191 -153
- package/dist/simulator/validation.cjs.map +1 -1
- package/dist/simulator/validation.d.cts +3 -21
- package/dist/simulator/validation.d.cts.map +1 -1
- package/dist/simulator/validation.d.ts +3 -21
- package/dist/simulator/validation.d.ts.map +1 -1
- package/dist/simulator/validation.js +188 -162
- package/dist/simulator/validation.js.map +1 -1
- package/dist/streams/collect.cjs +74 -24
- package/dist/streams/collect.cjs.map +1 -1
- package/dist/streams/collect.d.cts +14 -1
- package/dist/streams/collect.d.cts.map +1 -1
- package/dist/streams/collect.d.ts +14 -1
- package/dist/streams/collect.d.ts.map +1 -1
- package/dist/streams/collect.js +74 -25
- package/dist/streams/collect.js.map +1 -1
- package/dist/streams/file-source.cjs +287 -0
- package/dist/streams/file-source.cjs.map +1 -0
- package/dist/streams/file-source.d.cts +96 -0
- package/dist/streams/file-source.d.cts.map +1 -0
- package/dist/streams/file-source.d.ts +96 -0
- package/dist/streams/file-source.d.ts.map +1 -0
- package/dist/streams/file-source.js +286 -0
- package/dist/streams/file-source.js.map +1 -0
- package/dist/streams/hash.cjs +207 -115
- package/dist/streams/hash.cjs.map +1 -1
- package/dist/streams/hash.d.cts +5 -4
- package/dist/streams/hash.d.cts.map +1 -1
- package/dist/streams/hash.d.ts +5 -4
- package/dist/streams/hash.d.ts.map +1 -1
- package/dist/streams/hash.js +208 -95
- package/dist/streams/hash.js.map +1 -1
- package/dist/streams/index.cjs +12 -12
- package/dist/streams/index.d.cts +3 -3
- package/dist/streams/index.d.cts.map +1 -1
- package/dist/streams/index.d.ts +3 -3
- package/dist/streams/index.d.ts.map +1 -1
- package/dist/streams/index.js +2 -10
- package/dist/streams/progress.cjs +60 -46
- package/dist/streams/progress.cjs.map +1 -1
- package/dist/streams/progress.js +60 -46
- package/dist/streams/progress.js.map +1 -1
- package/dist/streams/source.cjs +316 -146
- package/dist/streams/source.cjs.map +1 -1
- package/dist/streams/source.d.cts +56 -18
- package/dist/streams/source.d.cts.map +1 -1
- package/dist/streams/source.d.ts +56 -18
- package/dist/streams/source.d.ts.map +1 -1
- package/dist/streams/source.js +312 -149
- package/dist/streams/source.js.map +1 -1
- package/dist/sync/actions/index.cjs +236 -184
- package/dist/sync/actions/index.cjs.map +1 -1
- package/dist/sync/actions/index.d.cts +29 -21
- package/dist/sync/actions/index.d.cts.map +1 -1
- package/dist/sync/actions/index.d.ts +29 -21
- package/dist/sync/actions/index.d.ts.map +1 -1
- package/dist/sync/actions/index.js +236 -190
- package/dist/sync/actions/index.js.map +1 -1
- package/dist/sync/b2-sha1-reader.cjs +148 -0
- package/dist/sync/b2-sha1-reader.cjs.map +1 -0
- package/dist/sync/b2-sha1-reader.d.cts +58 -0
- package/dist/sync/b2-sha1-reader.d.cts.map +1 -0
- package/dist/sync/b2-sha1-reader.d.ts +58 -0
- package/dist/sync/b2-sha1-reader.d.ts.map +1 -0
- package/dist/sync/b2-sha1-reader.js +145 -0
- package/dist/sync/b2-sha1-reader.js.map +1 -0
- package/dist/sync/download-staging.cjs +265 -0
- package/dist/sync/download-staging.cjs.map +1 -0
- package/dist/sync/download-staging.d.cts +54 -0
- package/dist/sync/download-staging.d.cts.map +1 -0
- package/dist/sync/download-staging.d.ts +54 -0
- package/dist/sync/download-staging.d.ts.map +1 -0
- package/dist/sync/download-staging.js +259 -0
- package/dist/sync/download-staging.js.map +1 -0
- package/dist/sync/filesystem-errors.cjs +32 -0
- package/dist/sync/filesystem-errors.cjs.map +1 -0
- package/dist/sync/filesystem-errors.d.cts +8 -0
- package/dist/sync/filesystem-errors.d.cts.map +1 -0
- package/dist/sync/filesystem-errors.d.ts +8 -0
- package/dist/sync/filesystem-errors.d.ts.map +1 -0
- package/dist/sync/filesystem-errors.js +32 -0
- package/dist/sync/filesystem-errors.js.map +1 -0
- package/dist/sync/filters.cjs +217 -0
- package/dist/sync/filters.cjs.map +1 -0
- package/dist/sync/filters.d.cts +51 -0
- package/dist/sync/filters.d.cts.map +1 -0
- package/dist/sync/filters.d.ts +51 -0
- package/dist/sync/filters.d.ts.map +1 -0
- package/dist/sync/filters.js +213 -0
- package/dist/sync/filters.js.map +1 -0
- package/dist/sync/index.cjs +39 -22
- package/dist/sync/index.d.cts +14 -9
- package/dist/sync/index.d.cts.map +1 -1
- package/dist/sync/index.d.ts +14 -9
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +9 -20
- package/dist/sync/local-file-identity.cjs +61 -0
- package/dist/sync/local-file-identity.cjs.map +1 -0
- package/dist/sync/local-file-identity.d.cts +37 -0
- package/dist/sync/local-file-identity.d.cts.map +1 -0
- package/dist/sync/local-file-identity.d.ts +37 -0
- package/dist/sync/local-file-identity.d.ts.map +1 -0
- package/dist/sync/local-file-identity.js +60 -0
- package/dist/sync/local-file-identity.js.map +1 -0
- package/dist/sync/local-file-io.cjs +364 -0
- package/dist/sync/local-file-io.cjs.map +1 -0
- package/dist/sync/local-file-io.d.cts +75 -0
- package/dist/sync/local-file-io.d.cts.map +1 -0
- package/dist/sync/local-file-io.d.ts +75 -0
- package/dist/sync/local-file-io.d.ts.map +1 -0
- package/dist/sync/local-file-io.js +360 -0
- package/dist/sync/local-file-io.js.map +1 -0
- package/dist/sync/local-filesystem-root.cjs +27 -0
- package/dist/sync/local-filesystem-root.cjs.map +1 -0
- package/dist/sync/local-filesystem-root.d.cts +18 -0
- package/dist/sync/local-filesystem-root.d.cts.map +1 -0
- package/dist/sync/local-filesystem-root.d.ts +18 -0
- package/dist/sync/local-filesystem-root.d.ts.map +1 -0
- package/dist/sync/local-filesystem-root.js +26 -0
- package/dist/sync/local-filesystem-root.js.map +1 -0
- package/dist/sync/local-sha1.cjs +119 -0
- package/dist/sync/local-sha1.cjs.map +1 -0
- package/dist/sync/local-sha1.d.cts +39 -0
- package/dist/sync/local-sha1.d.cts.map +1 -0
- package/dist/sync/local-sha1.d.ts +39 -0
- package/dist/sync/local-sha1.d.ts.map +1 -0
- package/dist/sync/local-sha1.js +117 -0
- package/dist/sync/local-sha1.js.map +1 -0
- package/dist/sync/pairing.cjs +118 -29
- package/dist/sync/pairing.cjs.map +1 -1
- package/dist/sync/pairing.d.cts +7 -2
- package/dist/sync/pairing.d.cts.map +1 -1
- package/dist/sync/pairing.d.ts +7 -2
- package/dist/sync/pairing.d.ts.map +1 -1
- package/dist/sync/pairing.js +120 -31
- package/dist/sync/pairing.js.map +1 -1
- package/dist/sync/path-order.cjs +30 -0
- package/dist/sync/path-order.cjs.map +1 -0
- package/dist/sync/path-order.d.cts +28 -0
- package/dist/sync/path-order.d.cts.map +1 -0
- package/dist/sync/path-order.d.ts +28 -0
- package/dist/sync/path-order.d.ts.map +1 -0
- package/dist/sync/path-order.js +29 -0
- package/dist/sync/path-order.js.map +1 -0
- package/dist/sync/path-safety.cjs +111 -0
- package/dist/sync/path-safety.cjs.map +1 -0
- package/dist/sync/path-safety.d.cts +78 -0
- package/dist/sync/path-safety.d.cts.map +1 -0
- package/dist/sync/path-safety.d.ts +78 -0
- package/dist/sync/path-safety.d.ts.map +1 -0
- package/dist/sync/path-safety.js +105 -0
- package/dist/sync/path-safety.js.map +1 -0
- package/dist/sync/paths.d.cts +19 -0
- package/dist/sync/paths.d.cts.map +1 -0
- package/dist/sync/paths.d.ts +19 -0
- package/dist/sync/paths.d.ts.map +1 -0
- package/dist/sync/policies/compare.cjs +389 -11
- package/dist/sync/policies/compare.cjs.map +1 -1
- package/dist/sync/policies/compare.d.cts +100 -2
- package/dist/sync/policies/compare.d.cts.map +1 -1
- package/dist/sync/policies/compare.d.ts +100 -2
- package/dist/sync/policies/compare.d.ts.map +1 -1
- package/dist/sync/policies/compare.js +387 -13
- package/dist/sync/policies/compare.js.map +1 -1
- package/dist/sync/policies/index.cjs +76 -65
- package/dist/sync/policies/index.cjs.map +1 -1
- package/dist/sync/policies/index.d.cts +35 -6
- package/dist/sync/policies/index.d.cts.map +1 -1
- package/dist/sync/policies/index.d.ts +35 -6
- package/dist/sync/policies/index.d.ts.map +1 -1
- package/dist/sync/policies/index.js +76 -65
- package/dist/sync/policies/index.js.map +1 -1
- package/dist/sync/prefix.cjs +96 -0
- package/dist/sync/prefix.cjs.map +1 -0
- package/dist/sync/prefix.d.cts +55 -0
- package/dist/sync/prefix.d.cts.map +1 -0
- package/dist/sync/prefix.d.ts +55 -0
- package/dist/sync/prefix.d.ts.map +1 -0
- package/dist/sync/prefix.js +92 -0
- package/dist/sync/prefix.js.map +1 -0
- package/dist/sync/regexp-safety.cjs +192 -0
- package/dist/sync/regexp-safety.cjs.map +1 -0
- package/dist/sync/regexp-safety.d.cts +29 -0
- package/dist/sync/regexp-safety.d.cts.map +1 -0
- package/dist/sync/regexp-safety.d.ts +29 -0
- package/dist/sync/regexp-safety.d.ts.map +1 -0
- package/dist/sync/regexp-safety.js +190 -0
- package/dist/sync/regexp-safety.js.map +1 -0
- package/dist/sync/scan-events.cjs +33 -0
- package/dist/sync/scan-events.cjs.map +1 -0
- package/dist/sync/scan-events.d.cts +17 -0
- package/dist/sync/scan-events.d.cts.map +1 -0
- package/dist/sync/scan-events.d.ts +17 -0
- package/dist/sync/scan-events.d.ts.map +1 -0
- package/dist/sync/scan-events.js +32 -0
- package/dist/sync/scan-events.js.map +1 -0
- package/dist/sync/scan-limit.cjs +33 -0
- package/dist/sync/scan-limit.cjs.map +1 -0
- package/dist/sync/scan-limit.d.cts +21 -0
- package/dist/sync/scan-limit.d.cts.map +1 -0
- package/dist/sync/scan-limit.d.ts +21 -0
- package/dist/sync/scan-limit.d.ts.map +1 -0
- package/dist/sync/scan-limit.js +31 -0
- package/dist/sync/scan-limit.js.map +1 -0
- package/dist/sync/scanners/b2.cjs +239 -55
- package/dist/sync/scanners/b2.cjs.map +1 -1
- package/dist/sync/scanners/b2.d.cts +26 -7
- package/dist/sync/scanners/b2.d.cts.map +1 -1
- package/dist/sync/scanners/b2.d.ts +26 -7
- package/dist/sync/scanners/b2.d.ts.map +1 -1
- package/dist/sync/scanners/b2.js +239 -55
- package/dist/sync/scanners/b2.js.map +1 -1
- package/dist/sync/scanners/local.cjs +215 -56
- package/dist/sync/scanners/local.cjs.map +1 -1
- package/dist/sync/scanners/local.d.cts +22 -7
- package/dist/sync/scanners/local.d.cts.map +1 -1
- package/dist/sync/scanners/local.d.ts +22 -7
- package/dist/sync/scanners/local.d.ts.map +1 -1
- package/dist/sync/scanners/local.js +216 -57
- package/dist/sync/scanners/local.js.map +1 -1
- package/dist/sync/sha1-metadata.cjs +94 -0
- package/dist/sync/sha1-metadata.cjs.map +1 -0
- package/dist/sync/sha1-metadata.d.cts +82 -0
- package/dist/sync/sha1-metadata.d.cts.map +1 -0
- package/dist/sync/sha1-metadata.d.ts +82 -0
- package/dist/sync/sha1-metadata.d.ts.map +1 -0
- package/dist/sync/sha1-metadata.js +89 -0
- package/dist/sync/sha1-metadata.js.map +1 -0
- package/dist/sync/sha1-options.cjs +23 -0
- package/dist/sync/sha1-options.cjs.map +1 -0
- package/dist/sync/sha1-options.d.cts +14 -0
- package/dist/sync/sha1-options.d.cts.map +1 -0
- package/dist/sync/sha1-options.d.ts +14 -0
- package/dist/sync/sha1-options.d.ts.map +1 -0
- package/dist/sync/sha1-options.js +21 -0
- package/dist/sync/sha1-options.js.map +1 -0
- package/dist/sync/synchronizer.cjs +782 -197
- package/dist/sync/synchronizer.cjs.map +1 -1
- package/dist/sync/synchronizer.d.cts +47 -1
- package/dist/sync/synchronizer.d.cts.map +1 -1
- package/dist/sync/synchronizer.d.ts +47 -1
- package/dist/sync/synchronizer.d.ts.map +1 -1
- package/dist/sync/synchronizer.js +779 -173
- package/dist/sync/synchronizer.js.map +1 -1
- package/dist/sync/types.d.cts +208 -16
- package/dist/sync/types.d.cts.map +1 -1
- package/dist/sync/types.d.ts +208 -16
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/types/auth.cjs +76 -56
- package/dist/types/auth.cjs.map +1 -1
- package/dist/types/auth.d.cts +67 -9
- package/dist/types/auth.d.cts.map +1 -1
- package/dist/types/auth.d.ts +67 -9
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/auth.js +77 -57
- package/dist/types/auth.js.map +1 -1
- package/dist/types/bucket.cjs +74 -38
- package/dist/types/bucket.cjs.map +1 -1
- package/dist/types/bucket.js +75 -41
- package/dist/types/bucket.js.map +1 -1
- package/dist/types/encryption.cjs +364 -327
- package/dist/types/encryption.cjs.map +1 -1
- package/dist/types/encryption.d.cts +16 -0
- package/dist/types/encryption.d.cts.map +1 -1
- package/dist/types/encryption.d.ts +16 -0
- package/dist/types/encryption.d.ts.map +1 -1
- package/dist/types/encryption.js +364 -310
- package/dist/types/encryption.js.map +1 -1
- package/dist/types/errors.cjs +47 -0
- package/dist/types/errors.cjs.map +1 -0
- package/dist/types/errors.d.cts +13 -4
- package/dist/types/errors.d.cts.map +1 -1
- package/dist/types/errors.d.ts +13 -4
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +47 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/file.cjs +36 -19
- package/dist/types/file.cjs.map +1 -1
- package/dist/types/file.d.cts +2 -2
- package/dist/types/file.d.cts.map +1 -1
- package/dist/types/file.d.ts +2 -2
- package/dist/types/file.d.ts.map +1 -1
- package/dist/types/file.js +37 -21
- package/dist/types/file.js.map +1 -1
- package/dist/types/ids.cjs +53 -9
- package/dist/types/ids.cjs.map +1 -1
- package/dist/types/ids.js +54 -15
- package/dist/types/ids.js.map +1 -1
- package/dist/types/index.d.cts +12 -11
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +12 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/key.d.cts +44 -8
- package/dist/types/key.d.cts.map +1 -1
- package/dist/types/key.d.ts +44 -8
- package/dist/types/key.d.ts.map +1 -1
- package/dist/types/lock.cjs +33 -13
- package/dist/types/lock.cjs.map +1 -1
- package/dist/types/lock.js +34 -15
- package/dist/types/lock.js.map +1 -1
- package/dist/types/notifications.cjs +44 -22
- package/dist/types/notifications.cjs.map +1 -1
- package/dist/types/notifications.js +45 -23
- package/dist/types/notifications.js.map +1 -1
- package/dist/types/upload.d.cts +39 -5
- package/dist/types/upload.d.cts.map +1 -1
- package/dist/types/upload.d.ts +39 -5
- package/dist/types/upload.d.ts.map +1 -1
- package/dist/upload/abort-scope.cjs +91 -0
- package/dist/upload/abort-scope.cjs.map +1 -0
- package/dist/upload/abort-scope.d.cts +48 -0
- package/dist/upload/abort-scope.d.cts.map +1 -0
- package/dist/upload/abort-scope.d.ts +48 -0
- package/dist/upload/abort-scope.d.ts.map +1 -0
- package/dist/upload/abort-scope.js +88 -0
- package/dist/upload/abort-scope.js.map +1 -0
- package/dist/upload/cancel.cjs +183 -8
- package/dist/upload/cancel.cjs.map +1 -1
- package/dist/upload/cancel.d.cts +110 -2
- package/dist/upload/cancel.d.cts.map +1 -1
- package/dist/upload/cancel.d.ts +110 -2
- package/dist/upload/cancel.d.ts.map +1 -1
- package/dist/upload/cancel.js +178 -9
- package/dist/upload/cancel.js.map +1 -1
- package/dist/upload/concurrency.cjs +79 -52
- package/dist/upload/concurrency.cjs.map +1 -1
- package/dist/upload/concurrency.js +79 -53
- package/dist/upload/concurrency.js.map +1 -1
- package/dist/upload/finish.cjs +59 -0
- package/dist/upload/finish.cjs.map +1 -0
- package/dist/upload/finish.d.cts +26 -0
- package/dist/upload/finish.d.cts.map +1 -0
- package/dist/upload/finish.d.ts +26 -0
- package/dist/upload/finish.d.ts.map +1 -0
- package/dist/upload/finish.js +59 -0
- package/dist/upload/finish.js.map +1 -0
- package/dist/upload/large.cjs +301 -218
- package/dist/upload/large.cjs.map +1 -1
- package/dist/upload/large.d.cts +76 -9
- package/dist/upload/large.d.cts.map +1 -1
- package/dist/upload/large.d.ts +76 -9
- package/dist/upload/large.d.ts.map +1 -1
- package/dist/upload/large.js +301 -218
- package/dist/upload/large.js.map +1 -1
- package/dist/upload/options.cjs +28 -0
- package/dist/upload/options.cjs.map +1 -0
- package/dist/upload/options.d.cts +104 -0
- package/dist/upload/options.d.cts.map +1 -0
- package/dist/upload/options.d.ts +104 -0
- package/dist/upload/options.d.ts.map +1 -0
- package/dist/upload/options.js +27 -0
- package/dist/upload/options.js.map +1 -0
- package/dist/upload/resume.cjs +333 -33
- package/dist/upload/resume.cjs.map +1 -1
- package/dist/upload/resume.d.cts +82 -12
- package/dist/upload/resume.d.cts.map +1 -1
- package/dist/upload/resume.d.ts +82 -12
- package/dist/upload/resume.d.ts.map +1 -1
- package/dist/upload/resume.js +330 -33
- package/dist/upload/resume.js.map +1 -1
- package/dist/upload/retry.cjs +186 -0
- package/dist/upload/retry.cjs.map +1 -0
- package/dist/upload/retry.d.cts +127 -0
- package/dist/upload/retry.d.cts.map +1 -0
- package/dist/upload/retry.d.ts +127 -0
- package/dist/upload/retry.d.ts.map +1 -0
- package/dist/upload/retry.js +182 -0
- package/dist/upload/retry.js.map +1 -0
- package/dist/upload/single.cjs +68 -44
- package/dist/upload/single.cjs.map +1 -1
- package/dist/upload/single.d.cts +2 -1
- package/dist/upload/single.d.cts.map +1 -1
- package/dist/upload/single.d.ts +2 -1
- package/dist/upload/single.d.ts.map +1 -1
- package/dist/upload/single.js +68 -44
- package/dist/upload/single.js.map +1 -1
- package/dist/upload/stream.cjs +317 -193
- package/dist/upload/stream.cjs.map +1 -1
- package/dist/upload/stream.d.cts +3 -1
- package/dist/upload/stream.d.cts.map +1 -1
- package/dist/upload/stream.d.ts +3 -1
- package/dist/upload/stream.d.ts.map +1 -1
- package/dist/upload/stream.js +316 -192
- package/dist/upload/stream.js.map +1 -1
- package/dist/util/best-effort.cjs +42 -8
- package/dist/util/best-effort.cjs.map +1 -1
- package/dist/util/best-effort.d.cts +2 -1
- package/dist/util/best-effort.d.cts.map +1 -1
- package/dist/util/best-effort.d.ts +2 -1
- package/dist/util/best-effort.d.ts.map +1 -1
- package/dist/util/best-effort.js +43 -9
- package/dist/util/best-effort.js.map +1 -1
- package/dist/util/bytes.cjs +23 -0
- package/dist/util/bytes.cjs.map +1 -0
- package/dist/util/bytes.d.cts +15 -0
- package/dist/util/bytes.d.cts.map +1 -0
- package/dist/util/bytes.d.ts +15 -0
- package/dist/util/bytes.d.ts.map +1 -0
- package/dist/util/bytes.js +23 -0
- package/dist/util/bytes.js.map +1 -0
- package/dist/util/crypto.cjs +68 -0
- package/dist/util/crypto.cjs.map +1 -0
- package/dist/util/crypto.d.cts +26 -0
- package/dist/util/crypto.d.cts.map +1 -0
- package/dist/util/crypto.d.ts +26 -0
- package/dist/util/crypto.d.ts.map +1 -0
- package/dist/util/crypto.js +66 -0
- package/dist/util/crypto.js.map +1 -0
- package/dist/util/defaults.cjs +25 -9
- package/dist/util/defaults.cjs.map +1 -1
- package/dist/util/defaults.js +26 -11
- package/dist/util/defaults.js.map +1 -1
- package/dist/util/error-reason.cjs +41 -0
- package/dist/util/error-reason.cjs.map +1 -0
- package/dist/util/error-reason.d.cts +9 -0
- package/dist/util/error-reason.d.cts.map +1 -0
- package/dist/util/error-reason.d.ts +9 -0
- package/dist/util/error-reason.d.ts.map +1 -0
- package/dist/util/error-reason.js +41 -0
- package/dist/util/error-reason.js.map +1 -0
- package/dist/util/http.cjs +23 -0
- package/dist/util/http.cjs.map +1 -0
- package/dist/util/http.d.cts +13 -0
- package/dist/util/http.d.cts.map +1 -0
- package/dist/util/http.d.ts +13 -0
- package/dist/util/http.d.ts.map +1 -0
- package/dist/util/http.js +23 -0
- package/dist/util/http.js.map +1 -0
- package/dist/util/normalize.cjs +66 -7
- package/dist/util/normalize.cjs.map +1 -1
- package/dist/util/normalize.js +67 -10
- package/dist/util/normalize.js.map +1 -1
- package/dist/util/paginator.cjs +63 -14
- package/dist/util/paginator.cjs.map +1 -1
- package/dist/util/paginator.js +64 -16
- package/dist/util/paginator.js.map +1 -1
- package/dist/util/plan-ranges.cjs +47 -22
- package/dist/util/plan-ranges.cjs.map +1 -1
- package/dist/util/plan-ranges.js +48 -24
- package/dist/util/plan-ranges.js.map +1 -1
- package/dist/util/sha1.cjs +27 -0
- package/dist/util/sha1.cjs.map +1 -0
- package/dist/util/sha1.d.cts +17 -0
- package/dist/util/sha1.d.cts.map +1 -0
- package/dist/util/sha1.d.ts +17 -0
- package/dist/util/sha1.d.ts.map +1 -0
- package/dist/util/sha1.js +26 -0
- package/dist/util/sha1.js.map +1 -0
- package/dist/util/text-codec.cjs +29 -5
- package/dist/util/text-codec.cjs.map +1 -1
- package/dist/util/text-codec.js +30 -7
- package/dist/util/text-codec.js.map +1 -1
- package/dist/util/to-error.cjs +18 -4
- package/dist/util/to-error.cjs.map +1 -1
- package/dist/util/to-error.js +19 -5
- package/dist/util/to-error.js.map +1 -1
- package/dist/version.cjs +17 -5
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +3 -3
- package/dist/version.d.ts +3 -3
- package/dist/version.js +19 -6
- package/dist/version.js.map +1 -1
- package/package.json +19 -16
- package/dist/auth/index.cjs.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/notifications/index.cjs.map +0 -1
- package/dist/notifications/index.js.map +0 -1
- package/dist/package.json.cjs +0 -9
- package/dist/package.json.cjs.map +0 -1
- package/dist/package.json.js +0 -9
- package/dist/package.json.js.map +0 -1
- package/dist/streams/index.cjs.map +0 -1
- package/dist/streams/index.js.map +0 -1
- package/dist/sync/index.cjs.map +0 -1
- package/dist/sync/index.js.map +0 -1
package/dist/types/lock.js
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region src/types/lock.ts
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the file-level Object Lock retention mode.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* await object.setRetention(fileId, {
|
|
8
|
+
* mode: RetentionMode.Compliance,
|
|
9
|
+
* retainUntilTimestamp: Date.now() + 86_400_000,
|
|
10
|
+
* })
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
var RetentionMode = {
|
|
14
|
+
/** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */
|
|
15
|
+
Compliance: "compliance",
|
|
16
|
+
/** Locked: can be shortened by callers holding the `bypassGovernance` capability. */
|
|
17
|
+
Governance: "governance"
|
|
6
18
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Named constants for the file legal-hold status.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* await object.setLegalHold(fileId, LegalHoldValue.On)
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
var LegalHoldValue = {
|
|
28
|
+
/** Apply the legal hold. */
|
|
29
|
+
On: "on",
|
|
30
|
+
/** Remove the legal hold. */
|
|
31
|
+
Off: "off"
|
|
12
32
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=lock.js.map
|
|
33
|
+
//#endregion
|
|
34
|
+
export { LegalHoldValue, RetentionMode };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=lock.js.map
|
package/dist/types/lock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.js","sources":["../../src/types/lock.ts"],"sourcesContent":["import type { FileId } from './ids.ts'\n\n/**\n * Named constants for the file-level Object Lock retention mode.\n *\n * @example\n * ```ts\n * await object.setRetention(fileId, {\n * mode: RetentionMode.Compliance,\n * retainUntilTimestamp: Date.now() + 86_400_000,\n * })\n * ```\n */\nexport const RetentionMode = {\n /** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */\n Compliance: 'compliance',\n /** Locked: can be shortened by callers holding the `bypassGovernance` capability. */\n Governance: 'governance',\n} as const\n\n/** File-level Object Lock retention mode. Derived from {@link RetentionMode}. */\nexport type RetentionMode = (typeof RetentionMode)[keyof typeof RetentionMode]\n\n/**\n * Named constants for the file legal-hold status.\n *\n * @example\n * ```ts\n * await object.setLegalHold(fileId, LegalHoldValue.On)\n * ```\n */\nexport const LegalHoldValue = {\n /** Apply the legal hold. */\n On: 'on',\n /** Remove the legal hold. */\n Off: 'off',\n} as const\n\n/** Legal hold status for a file. Derived from {@link LegalHoldValue}. */\nexport type LegalHoldValue = (typeof LegalHoldValue)[keyof typeof LegalHoldValue]\n\n/** Retention settings for a specific file version under Object Lock. */\nexport interface FileRetentionValue {\n /** Retention mode, or null if no retention is set. */\n readonly mode: RetentionMode | null\n /** UTC timestamp (milliseconds) until which the file is retained, or null if not set. */\n readonly retainUntilTimestamp: number | null\n}\n\n/**\n * Request parameters for the `b2_update_file_retention` API call.\n * Updates the Object Lock retention settings on a file version.\n */\nexport interface UpdateFileRetentionRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New retention settings for the file. */\n readonly fileRetention: FileRetentionValue\n /**\n * When `true`, allows shortening a governance-mode retention period. Requires\n * the `bypassGovernance` capability on the application key. Has no effect on\n * compliance-mode retention.\n */\n readonly bypassGovernance?: boolean\n}\n\n/**\n * Request parameters for the `b2_update_file_legal_hold` API call.\n * Updates the legal hold status on a file version.\n */\nexport interface UpdateFileLegalHoldRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New legal hold status: `'on'` or `'off'`. */\n readonly legalHold: LegalHoldValue\n}\n\n/** Response from the `b2_update_file_retention` API call. */\nexport interface UpdateFileRetentionResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Retention settings as applied. */\n readonly fileRetention: FileRetentionValue\n}\n\n/** Response from the `b2_update_file_legal_hold` API call. */\nexport interface UpdateFileLegalHoldResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Legal hold status as applied. */\n readonly legalHold: LegalHoldValue\n}\n"],"
|
|
1
|
+
{"version":3,"file":"lock.js","names":[],"sources":["../../src/types/lock.ts"],"sourcesContent":["import type { FileId } from './ids.ts'\n\n/**\n * Named constants for the file-level Object Lock retention mode.\n *\n * @example\n * ```ts\n * await object.setRetention(fileId, {\n * mode: RetentionMode.Compliance,\n * retainUntilTimestamp: Date.now() + 86_400_000,\n * })\n * ```\n */\nexport const RetentionMode = {\n /** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */\n Compliance: 'compliance',\n /** Locked: can be shortened by callers holding the `bypassGovernance` capability. */\n Governance: 'governance',\n} as const\n\n/** File-level Object Lock retention mode. Derived from {@link RetentionMode}. */\nexport type RetentionMode = (typeof RetentionMode)[keyof typeof RetentionMode]\n\n/**\n * Named constants for the file legal-hold status.\n *\n * @example\n * ```ts\n * await object.setLegalHold(fileId, LegalHoldValue.On)\n * ```\n */\nexport const LegalHoldValue = {\n /** Apply the legal hold. */\n On: 'on',\n /** Remove the legal hold. */\n Off: 'off',\n} as const\n\n/** Legal hold status for a file. Derived from {@link LegalHoldValue}. */\nexport type LegalHoldValue = (typeof LegalHoldValue)[keyof typeof LegalHoldValue]\n\n/** Retention settings for a specific file version under Object Lock. */\nexport interface FileRetentionValue {\n /** Retention mode, or null if no retention is set. */\n readonly mode: RetentionMode | null\n /** UTC timestamp (milliseconds) until which the file is retained, or null if not set. */\n readonly retainUntilTimestamp: number | null\n}\n\n/**\n * Request parameters for the `b2_update_file_retention` API call.\n * Updates the Object Lock retention settings on a file version.\n */\nexport interface UpdateFileRetentionRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New retention settings for the file. */\n readonly fileRetention: FileRetentionValue\n /**\n * When `true`, allows shortening a governance-mode retention period. Requires\n * the `bypassGovernance` capability on the application key. Has no effect on\n * compliance-mode retention.\n */\n readonly bypassGovernance?: boolean\n}\n\n/**\n * Request parameters for the `b2_update_file_legal_hold` API call.\n * Updates the legal hold status on a file version.\n */\nexport interface UpdateFileLegalHoldRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New legal hold status: `'on'` or `'off'`. */\n readonly legalHold: LegalHoldValue\n}\n\n/** Response from the `b2_update_file_retention` API call. */\nexport interface UpdateFileRetentionResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Retention settings as applied. */\n readonly fileRetention: FileRetentionValue\n}\n\n/** Response from the `b2_update_file_legal_hold` API call. */\nexport interface UpdateFileLegalHoldResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Legal hold status as applied. */\n readonly legalHold: LegalHoldValue\n}\n"],"mappings":";;;;;;;;;;;;AAaA,IAAa,gBAAgB;;CAE3B,YAAY;;CAEZ,YAAY;AACd;;;;;;;;;AAaA,IAAa,iBAAiB;;CAE5B,IAAI;;CAEJ,KAAK;AACP"}
|
|
@@ -1,24 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
//#region src/types/notifications.ts
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the B2 event types that can trigger notifications.
|
|
4
|
+
*
|
|
5
|
+
* Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to
|
|
6
|
+
* every sub-event in their category.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* await bucket.setNotificationRules([
|
|
11
|
+
* {
|
|
12
|
+
* name: 'all-uploads',
|
|
13
|
+
* eventTypes: [EventType.ObjectCreatedAll],
|
|
14
|
+
* isEnabled: true,
|
|
15
|
+
* isSuspended: false,
|
|
16
|
+
* objectNamePrefix: '',
|
|
17
|
+
* suspensionReason: '',
|
|
18
|
+
* targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },
|
|
19
|
+
* },
|
|
20
|
+
* ])
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
var EventType = {
|
|
24
|
+
/** Wildcard: any `b2:ObjectCreated:*` sub-event. */
|
|
25
|
+
ObjectCreatedAll: "b2:ObjectCreated:*",
|
|
26
|
+
/** A small-file upload (`b2_upload_file`). */
|
|
27
|
+
ObjectCreatedUpload: "b2:ObjectCreated:Upload",
|
|
28
|
+
/** A multipart upload completed (`b2_finish_large_file`). */
|
|
29
|
+
ObjectCreatedMultipartUpload: "b2:ObjectCreated:MultipartUpload",
|
|
30
|
+
/** A server-side copy (`b2_copy_file` or `b2_copy_part`). */
|
|
31
|
+
ObjectCreatedCopy: "b2:ObjectCreated:Copy",
|
|
32
|
+
/** A replica delivered via cross-region replication. */
|
|
33
|
+
ObjectCreatedReplica: "b2:ObjectCreated:Replica",
|
|
34
|
+
/** A hide marker was created (`b2_hide_file`). */
|
|
35
|
+
ObjectCreatedHide: "b2:ObjectCreated:Hide",
|
|
36
|
+
/** Wildcard: any `b2:ObjectDeleted:*` sub-event. */
|
|
37
|
+
ObjectDeletedAll: "b2:ObjectDeleted:*",
|
|
38
|
+
/** A version was permanently deleted (`b2_delete_file_version`). */
|
|
39
|
+
ObjectDeletedDelete: "b2:ObjectDeleted:Delete",
|
|
40
|
+
/** A version was removed by a lifecycle rule. */
|
|
41
|
+
ObjectDeletedLifecycleRule: "b2:ObjectDeleted:LifecycleRule"
|
|
22
42
|
};
|
|
43
|
+
//#endregion
|
|
23
44
|
exports.EventType = EventType;
|
|
24
|
-
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=notifications.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.cjs","sources":["../../src/types/notifications.ts"],"sourcesContent":["import type { BucketId } from './ids.ts'\n\n/**\n * Named constants for the B2 event types that can trigger notifications.\n *\n * Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to\n * every sub-event in their category.\n *\n * @example\n * ```ts\n * await bucket.setNotificationRules([\n * {\n * name: 'all-uploads',\n * eventTypes: [EventType.ObjectCreatedAll],\n * isEnabled: true,\n * isSuspended: false,\n * objectNamePrefix: '',\n * suspensionReason: '',\n * targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },\n * },\n * ])\n * ```\n */\nexport const EventType = {\n /** Wildcard: any `b2:ObjectCreated:*` sub-event. */\n ObjectCreatedAll: 'b2:ObjectCreated:*',\n /** A small-file upload (`b2_upload_file`). */\n ObjectCreatedUpload: 'b2:ObjectCreated:Upload',\n /** A multipart upload completed (`b2_finish_large_file`). */\n ObjectCreatedMultipartUpload: 'b2:ObjectCreated:MultipartUpload',\n /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */\n ObjectCreatedCopy: 'b2:ObjectCreated:Copy',\n /** A replica delivered via cross-region replication. */\n ObjectCreatedReplica: 'b2:ObjectCreated:Replica',\n /** A hide marker was created (`b2_hide_file`). */\n ObjectCreatedHide: 'b2:ObjectCreated:Hide',\n /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */\n ObjectDeletedAll: 'b2:ObjectDeleted:*',\n /** A version was permanently deleted (`b2_delete_file_version`). */\n ObjectDeletedDelete: 'b2:ObjectDeleted:Delete',\n /** A version was removed by a lifecycle rule. */\n ObjectDeletedLifecycleRule: 'b2:ObjectDeleted:LifecycleRule',\n} as const\n\n/**\n * B2 event types that can trigger notifications. Derived from {@link EventType}.\n */\nexport type EventType = (typeof EventType)[keyof typeof EventType]\n\n/** A rule that defines which bucket events trigger webhook notifications and where they are sent. */\nexport interface EventNotificationRule {\n /** Event types that trigger this notification rule. */\n readonly eventTypes: readonly EventType[]\n /** Whether this rule is actively sending notifications. */\n readonly isEnabled: boolean\n /** Whether B2 has suspended this rule due to delivery failures. */\n readonly isSuspended: boolean\n /** Unique name identifying this rule within the bucket. */\n readonly name: string\n /** Only events for objects with this name prefix trigger the rule. Empty string matches all objects. */\n readonly objectNamePrefix: string\n /** Reason for suspension, or empty string if not suspended. */\n readonly suspensionReason: string\n /** Webhook target configuration. */\n readonly targetConfiguration: {\n /** Target type (e.g., `'url'` for webhook delivery). */\n readonly targetType: string\n /** Webhook URL that receives the event notifications. */\n readonly url: string\n /** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */\n readonly hmacSha256SigningSecret?: string\n /** Optional custom headers included in webhook requests. */\n readonly customHeaders?: Record<string, string>\n }\n}\n\n/** Request parameters for the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesRequest {\n /** Bucket to get notification rules for. */\n readonly bucketId: BucketId\n}\n\n/** Response from the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesResponse {\n /** Bucket these rules belong to. */\n readonly bucketId: BucketId\n /** Array of event notification rules configured on the bucket. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/**\n * Request parameters for the `b2_set_bucket_notification_rules` API call.\n * Replaces all existing notification rules on the bucket.\n */\nexport interface SetBucketNotificationRulesRequest {\n /** Bucket to set notification rules on. */\n readonly bucketId: BucketId\n /** Notification rules to apply. Replaces all existing rules. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/** Response from the `b2_set_bucket_notification_rules` API call. Same shape as the get response. */\nexport type SetBucketNotificationRulesResponse = GetBucketNotificationRulesResponse\n"],"
|
|
1
|
+
{"version":3,"file":"notifications.cjs","names":[],"sources":["../../src/types/notifications.ts"],"sourcesContent":["import type { BucketId } from './ids.ts'\n\n/**\n * Named constants for the B2 event types that can trigger notifications.\n *\n * Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to\n * every sub-event in their category.\n *\n * @example\n * ```ts\n * await bucket.setNotificationRules([\n * {\n * name: 'all-uploads',\n * eventTypes: [EventType.ObjectCreatedAll],\n * isEnabled: true,\n * isSuspended: false,\n * objectNamePrefix: '',\n * suspensionReason: '',\n * targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },\n * },\n * ])\n * ```\n */\nexport const EventType = {\n /** Wildcard: any `b2:ObjectCreated:*` sub-event. */\n ObjectCreatedAll: 'b2:ObjectCreated:*',\n /** A small-file upload (`b2_upload_file`). */\n ObjectCreatedUpload: 'b2:ObjectCreated:Upload',\n /** A multipart upload completed (`b2_finish_large_file`). */\n ObjectCreatedMultipartUpload: 'b2:ObjectCreated:MultipartUpload',\n /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */\n ObjectCreatedCopy: 'b2:ObjectCreated:Copy',\n /** A replica delivered via cross-region replication. */\n ObjectCreatedReplica: 'b2:ObjectCreated:Replica',\n /** A hide marker was created (`b2_hide_file`). */\n ObjectCreatedHide: 'b2:ObjectCreated:Hide',\n /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */\n ObjectDeletedAll: 'b2:ObjectDeleted:*',\n /** A version was permanently deleted (`b2_delete_file_version`). */\n ObjectDeletedDelete: 'b2:ObjectDeleted:Delete',\n /** A version was removed by a lifecycle rule. */\n ObjectDeletedLifecycleRule: 'b2:ObjectDeleted:LifecycleRule',\n} as const\n\n/**\n * B2 event types that can trigger notifications. Derived from {@link EventType}.\n */\nexport type EventType = (typeof EventType)[keyof typeof EventType]\n\n/** A rule that defines which bucket events trigger webhook notifications and where they are sent. */\nexport interface EventNotificationRule {\n /** Event types that trigger this notification rule. */\n readonly eventTypes: readonly EventType[]\n /** Whether this rule is actively sending notifications. */\n readonly isEnabled: boolean\n /** Whether B2 has suspended this rule due to delivery failures. */\n readonly isSuspended: boolean\n /** Unique name identifying this rule within the bucket. */\n readonly name: string\n /** Only events for objects with this name prefix trigger the rule. Empty string matches all objects. */\n readonly objectNamePrefix: string\n /** Reason for suspension, or empty string if not suspended. */\n readonly suspensionReason: string\n /** Webhook target configuration. */\n readonly targetConfiguration: {\n /** Target type (e.g., `'url'` for webhook delivery). */\n readonly targetType: string\n /** Webhook URL that receives the event notifications. */\n readonly url: string\n /** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */\n readonly hmacSha256SigningSecret?: string\n /** Optional custom headers included in webhook requests. */\n readonly customHeaders?: Record<string, string>\n }\n}\n\n/** Request parameters for the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesRequest {\n /** Bucket to get notification rules for. */\n readonly bucketId: BucketId\n}\n\n/** Response from the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesResponse {\n /** Bucket these rules belong to. */\n readonly bucketId: BucketId\n /** Array of event notification rules configured on the bucket. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/**\n * Request parameters for the `b2_set_bucket_notification_rules` API call.\n * Replaces all existing notification rules on the bucket.\n */\nexport interface SetBucketNotificationRulesRequest {\n /** Bucket to set notification rules on. */\n readonly bucketId: BucketId\n /** Notification rules to apply. Replaces all existing rules. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/** Response from the `b2_set_bucket_notification_rules` API call. Same shape as the get response. */\nexport type SetBucketNotificationRulesResponse = GetBucketNotificationRulesResponse\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,YAAY;;CAEvB,kBAAkB;;CAElB,qBAAqB;;CAErB,8BAA8B;;CAE9B,mBAAmB;;CAEnB,sBAAsB;;CAEtB,mBAAmB;;CAEnB,kBAAkB;;CAElB,qBAAqB;;CAErB,4BAA4B;AAC9B"}
|
|
@@ -1,24 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
//#region src/types/notifications.ts
|
|
2
|
+
/**
|
|
3
|
+
* Named constants for the B2 event types that can trigger notifications.
|
|
4
|
+
*
|
|
5
|
+
* Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to
|
|
6
|
+
* every sub-event in their category.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* await bucket.setNotificationRules([
|
|
11
|
+
* {
|
|
12
|
+
* name: 'all-uploads',
|
|
13
|
+
* eventTypes: [EventType.ObjectCreatedAll],
|
|
14
|
+
* isEnabled: true,
|
|
15
|
+
* isSuspended: false,
|
|
16
|
+
* objectNamePrefix: '',
|
|
17
|
+
* suspensionReason: '',
|
|
18
|
+
* targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },
|
|
19
|
+
* },
|
|
20
|
+
* ])
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
var EventType = {
|
|
24
|
+
/** Wildcard: any `b2:ObjectCreated:*` sub-event. */
|
|
25
|
+
ObjectCreatedAll: "b2:ObjectCreated:*",
|
|
26
|
+
/** A small-file upload (`b2_upload_file`). */
|
|
27
|
+
ObjectCreatedUpload: "b2:ObjectCreated:Upload",
|
|
28
|
+
/** A multipart upload completed (`b2_finish_large_file`). */
|
|
29
|
+
ObjectCreatedMultipartUpload: "b2:ObjectCreated:MultipartUpload",
|
|
30
|
+
/** A server-side copy (`b2_copy_file` or `b2_copy_part`). */
|
|
31
|
+
ObjectCreatedCopy: "b2:ObjectCreated:Copy",
|
|
32
|
+
/** A replica delivered via cross-region replication. */
|
|
33
|
+
ObjectCreatedReplica: "b2:ObjectCreated:Replica",
|
|
34
|
+
/** A hide marker was created (`b2_hide_file`). */
|
|
35
|
+
ObjectCreatedHide: "b2:ObjectCreated:Hide",
|
|
36
|
+
/** Wildcard: any `b2:ObjectDeleted:*` sub-event. */
|
|
37
|
+
ObjectDeletedAll: "b2:ObjectDeleted:*",
|
|
38
|
+
/** A version was permanently deleted (`b2_delete_file_version`). */
|
|
39
|
+
ObjectDeletedDelete: "b2:ObjectDeleted:Delete",
|
|
40
|
+
/** A version was removed by a lifecycle rule. */
|
|
41
|
+
ObjectDeletedLifecycleRule: "b2:ObjectDeleted:LifecycleRule"
|
|
20
42
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=notifications.js.map
|
|
43
|
+
//#endregion
|
|
44
|
+
export { EventType };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sources":["../../src/types/notifications.ts"],"sourcesContent":["import type { BucketId } from './ids.ts'\n\n/**\n * Named constants for the B2 event types that can trigger notifications.\n *\n * Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to\n * every sub-event in their category.\n *\n * @example\n * ```ts\n * await bucket.setNotificationRules([\n * {\n * name: 'all-uploads',\n * eventTypes: [EventType.ObjectCreatedAll],\n * isEnabled: true,\n * isSuspended: false,\n * objectNamePrefix: '',\n * suspensionReason: '',\n * targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },\n * },\n * ])\n * ```\n */\nexport const EventType = {\n /** Wildcard: any `b2:ObjectCreated:*` sub-event. */\n ObjectCreatedAll: 'b2:ObjectCreated:*',\n /** A small-file upload (`b2_upload_file`). */\n ObjectCreatedUpload: 'b2:ObjectCreated:Upload',\n /** A multipart upload completed (`b2_finish_large_file`). */\n ObjectCreatedMultipartUpload: 'b2:ObjectCreated:MultipartUpload',\n /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */\n ObjectCreatedCopy: 'b2:ObjectCreated:Copy',\n /** A replica delivered via cross-region replication. */\n ObjectCreatedReplica: 'b2:ObjectCreated:Replica',\n /** A hide marker was created (`b2_hide_file`). */\n ObjectCreatedHide: 'b2:ObjectCreated:Hide',\n /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */\n ObjectDeletedAll: 'b2:ObjectDeleted:*',\n /** A version was permanently deleted (`b2_delete_file_version`). */\n ObjectDeletedDelete: 'b2:ObjectDeleted:Delete',\n /** A version was removed by a lifecycle rule. */\n ObjectDeletedLifecycleRule: 'b2:ObjectDeleted:LifecycleRule',\n} as const\n\n/**\n * B2 event types that can trigger notifications. Derived from {@link EventType}.\n */\nexport type EventType = (typeof EventType)[keyof typeof EventType]\n\n/** A rule that defines which bucket events trigger webhook notifications and where they are sent. */\nexport interface EventNotificationRule {\n /** Event types that trigger this notification rule. */\n readonly eventTypes: readonly EventType[]\n /** Whether this rule is actively sending notifications. */\n readonly isEnabled: boolean\n /** Whether B2 has suspended this rule due to delivery failures. */\n readonly isSuspended: boolean\n /** Unique name identifying this rule within the bucket. */\n readonly name: string\n /** Only events for objects with this name prefix trigger the rule. Empty string matches all objects. */\n readonly objectNamePrefix: string\n /** Reason for suspension, or empty string if not suspended. */\n readonly suspensionReason: string\n /** Webhook target configuration. */\n readonly targetConfiguration: {\n /** Target type (e.g., `'url'` for webhook delivery). */\n readonly targetType: string\n /** Webhook URL that receives the event notifications. */\n readonly url: string\n /** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */\n readonly hmacSha256SigningSecret?: string\n /** Optional custom headers included in webhook requests. */\n readonly customHeaders?: Record<string, string>\n }\n}\n\n/** Request parameters for the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesRequest {\n /** Bucket to get notification rules for. */\n readonly bucketId: BucketId\n}\n\n/** Response from the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesResponse {\n /** Bucket these rules belong to. */\n readonly bucketId: BucketId\n /** Array of event notification rules configured on the bucket. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/**\n * Request parameters for the `b2_set_bucket_notification_rules` API call.\n * Replaces all existing notification rules on the bucket.\n */\nexport interface SetBucketNotificationRulesRequest {\n /** Bucket to set notification rules on. */\n readonly bucketId: BucketId\n /** Notification rules to apply. Replaces all existing rules. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/** Response from the `b2_set_bucket_notification_rules` API call. Same shape as the get response. */\nexport type SetBucketNotificationRulesResponse = GetBucketNotificationRulesResponse\n"],"
|
|
1
|
+
{"version":3,"file":"notifications.js","names":[],"sources":["../../src/types/notifications.ts"],"sourcesContent":["import type { BucketId } from './ids.ts'\n\n/**\n * Named constants for the B2 event types that can trigger notifications.\n *\n * Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to\n * every sub-event in their category.\n *\n * @example\n * ```ts\n * await bucket.setNotificationRules([\n * {\n * name: 'all-uploads',\n * eventTypes: [EventType.ObjectCreatedAll],\n * isEnabled: true,\n * isSuspended: false,\n * objectNamePrefix: '',\n * suspensionReason: '',\n * targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },\n * },\n * ])\n * ```\n */\nexport const EventType = {\n /** Wildcard: any `b2:ObjectCreated:*` sub-event. */\n ObjectCreatedAll: 'b2:ObjectCreated:*',\n /** A small-file upload (`b2_upload_file`). */\n ObjectCreatedUpload: 'b2:ObjectCreated:Upload',\n /** A multipart upload completed (`b2_finish_large_file`). */\n ObjectCreatedMultipartUpload: 'b2:ObjectCreated:MultipartUpload',\n /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */\n ObjectCreatedCopy: 'b2:ObjectCreated:Copy',\n /** A replica delivered via cross-region replication. */\n ObjectCreatedReplica: 'b2:ObjectCreated:Replica',\n /** A hide marker was created (`b2_hide_file`). */\n ObjectCreatedHide: 'b2:ObjectCreated:Hide',\n /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */\n ObjectDeletedAll: 'b2:ObjectDeleted:*',\n /** A version was permanently deleted (`b2_delete_file_version`). */\n ObjectDeletedDelete: 'b2:ObjectDeleted:Delete',\n /** A version was removed by a lifecycle rule. */\n ObjectDeletedLifecycleRule: 'b2:ObjectDeleted:LifecycleRule',\n} as const\n\n/**\n * B2 event types that can trigger notifications. Derived from {@link EventType}.\n */\nexport type EventType = (typeof EventType)[keyof typeof EventType]\n\n/** A rule that defines which bucket events trigger webhook notifications and where they are sent. */\nexport interface EventNotificationRule {\n /** Event types that trigger this notification rule. */\n readonly eventTypes: readonly EventType[]\n /** Whether this rule is actively sending notifications. */\n readonly isEnabled: boolean\n /** Whether B2 has suspended this rule due to delivery failures. */\n readonly isSuspended: boolean\n /** Unique name identifying this rule within the bucket. */\n readonly name: string\n /** Only events for objects with this name prefix trigger the rule. Empty string matches all objects. */\n readonly objectNamePrefix: string\n /** Reason for suspension, or empty string if not suspended. */\n readonly suspensionReason: string\n /** Webhook target configuration. */\n readonly targetConfiguration: {\n /** Target type (e.g., `'url'` for webhook delivery). */\n readonly targetType: string\n /** Webhook URL that receives the event notifications. */\n readonly url: string\n /** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */\n readonly hmacSha256SigningSecret?: string\n /** Optional custom headers included in webhook requests. */\n readonly customHeaders?: Record<string, string>\n }\n}\n\n/** Request parameters for the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesRequest {\n /** Bucket to get notification rules for. */\n readonly bucketId: BucketId\n}\n\n/** Response from the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesResponse {\n /** Bucket these rules belong to. */\n readonly bucketId: BucketId\n /** Array of event notification rules configured on the bucket. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/**\n * Request parameters for the `b2_set_bucket_notification_rules` API call.\n * Replaces all existing notification rules on the bucket.\n */\nexport interface SetBucketNotificationRulesRequest {\n /** Bucket to set notification rules on. */\n readonly bucketId: BucketId\n /** Notification rules to apply. Replaces all existing rules. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/** Response from the `b2_set_bucket_notification_rules` API call. Same shape as the get response. */\nexport type SetBucketNotificationRulesResponse = GetBucketNotificationRulesResponse\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,YAAY;;CAEvB,kBAAkB;;CAElB,qBAAqB;;CAErB,8BAA8B;;CAE9B,mBAAmB;;CAEnB,sBAAsB;;CAEtB,mBAAmB;;CAEnB,kBAAkB;;CAElB,qBAAqB;;CAErB,4BAA4B;AAC9B"}
|
package/dist/types/upload.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EncryptionSetting } from './encryption.js';
|
|
1
|
+
import { EncryptionSetting, PublicEncryptionSetting } from './encryption.js';
|
|
2
|
+
import { FileAction } from './file.js';
|
|
2
3
|
import { BucketId, LargeFileId } from './ids.js';
|
|
3
4
|
import { FileRetentionValue, LegalHoldValue } from './lock.js';
|
|
4
5
|
/** Request parameters for the `b2_get_upload_url` API call. */
|
|
@@ -68,8 +69,41 @@ export interface StartLargeFileRequest {
|
|
|
68
69
|
/** Optional legal hold for the file. */
|
|
69
70
|
readonly legalHold?: LegalHoldValue;
|
|
70
71
|
}
|
|
72
|
+
/** Object Lock retention settings as returned by B2 response objects. */
|
|
73
|
+
export interface ReadableFileRetention {
|
|
74
|
+
/** Whether the caller is authorized to read retention settings. */
|
|
75
|
+
readonly isClientAuthorizedToRead: boolean;
|
|
76
|
+
/** Retention settings, or null when none are set or unreadable. */
|
|
77
|
+
readonly value: FileRetentionValue | null;
|
|
78
|
+
}
|
|
79
|
+
/** Legal hold status as returned by B2 response objects. */
|
|
80
|
+
export interface ReadableLegalHold {
|
|
81
|
+
/** Whether the caller is authorized to read legal hold status. */
|
|
82
|
+
readonly isClientAuthorizedToRead: boolean;
|
|
83
|
+
/** Legal hold value, or null when none is set or unreadable. */
|
|
84
|
+
readonly value: LegalHoldValue | null;
|
|
85
|
+
}
|
|
86
|
+
/** Optional metadata fields B2 may return for unfinished large-file records. */
|
|
87
|
+
export interface UnfinishedLargeFileMetadata {
|
|
88
|
+
/** Action that created this unfinished file version. */
|
|
89
|
+
readonly action?: FileAction;
|
|
90
|
+
/** When present, always 0 for unfinished large files. */
|
|
91
|
+
readonly contentLength?: number;
|
|
92
|
+
/** When present, always `'none'` for unfinished large files. */
|
|
93
|
+
readonly contentSha1?: string;
|
|
94
|
+
/** When present, always null for unfinished large files. */
|
|
95
|
+
readonly contentMd5?: string | null;
|
|
96
|
+
/** Object Lock retention settings for this unfinished file, when readable. */
|
|
97
|
+
readonly fileRetention?: ReadableFileRetention;
|
|
98
|
+
/** Legal hold status for this unfinished file, when readable. */
|
|
99
|
+
readonly legalHold?: ReadableLegalHold;
|
|
100
|
+
/** Server-side encryption applied to this unfinished file. */
|
|
101
|
+
readonly serverSideEncryption?: PublicEncryptionSetting;
|
|
102
|
+
/** UTC timestamp (milliseconds) when this unfinished upload was started. */
|
|
103
|
+
readonly uploadTimestamp?: number;
|
|
104
|
+
}
|
|
71
105
|
/** Response from the `b2_start_large_file` API call. */
|
|
72
|
-
export interface StartLargeFileResponse {
|
|
106
|
+
export interface StartLargeFileResponse extends UnfinishedLargeFileMetadata {
|
|
73
107
|
/** ID assigned to this large file upload. Use this to upload parts and finish the file. */
|
|
74
108
|
readonly fileId: LargeFileId;
|
|
75
109
|
/** Name of the file being uploaded. */
|
|
@@ -124,7 +158,7 @@ export interface UploadPartResponse {
|
|
|
124
158
|
/** SHA-1 checksum of the uploaded part content. */
|
|
125
159
|
readonly contentSha1: string;
|
|
126
160
|
/** Server-side encryption applied to this part. */
|
|
127
|
-
readonly serverSideEncryption:
|
|
161
|
+
readonly serverSideEncryption: PublicEncryptionSetting;
|
|
128
162
|
/** UTC timestamp (milliseconds) when this part was uploaded. */
|
|
129
163
|
readonly uploadTimestamp: number;
|
|
130
164
|
}
|
|
@@ -160,13 +194,13 @@ export interface ListUnfinishedLargeFilesRequest {
|
|
|
160
194
|
readonly bucketId: BucketId;
|
|
161
195
|
/** Only return files whose names start with this prefix. */
|
|
162
196
|
readonly namePrefix?: string;
|
|
163
|
-
/** File ID to start listing from (
|
|
197
|
+
/** File ID to start listing from (inclusive). Used for pagination. */
|
|
164
198
|
readonly startFileId?: LargeFileId;
|
|
165
199
|
/** Maximum number of files to return. */
|
|
166
200
|
readonly maxFileCount?: number;
|
|
167
201
|
}
|
|
168
202
|
/** Metadata for an in-progress large file upload that has not yet been finished or cancelled. */
|
|
169
|
-
export interface UnfinishedLargeFile {
|
|
203
|
+
export interface UnfinishedLargeFile extends UnfinishedLargeFileMetadata {
|
|
170
204
|
/** ID of the large file. */
|
|
171
205
|
readonly fileId: LargeFileId;
|
|
172
206
|
/** Name of the file. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/types/upload.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/types/upload.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEnE,+DAA+D;AAC/D,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;CAC5B;AAED,qGAAqG;AACrG,MAAM,WAAW,oBAAoB;IACnC,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,wEAAwE;IACxE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9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EncryptionSetting } from './encryption.js';
|
|
1
|
+
import { EncryptionSetting, PublicEncryptionSetting } from './encryption.js';
|
|
2
|
+
import { FileAction } from './file.js';
|
|
2
3
|
import { BucketId, LargeFileId } from './ids.js';
|
|
3
4
|
import { FileRetentionValue, LegalHoldValue } from './lock.js';
|
|
4
5
|
/** Request parameters for the `b2_get_upload_url` API call. */
|
|
@@ -68,8 +69,41 @@ export interface StartLargeFileRequest {
|
|
|
68
69
|
/** Optional legal hold for the file. */
|
|
69
70
|
readonly legalHold?: LegalHoldValue;
|
|
70
71
|
}
|
|
72
|
+
/** Object Lock retention settings as returned by B2 response objects. */
|
|
73
|
+
export interface ReadableFileRetention {
|
|
74
|
+
/** Whether the caller is authorized to read retention settings. */
|
|
75
|
+
readonly isClientAuthorizedToRead: boolean;
|
|
76
|
+
/** Retention settings, or null when none are set or unreadable. */
|
|
77
|
+
readonly value: FileRetentionValue | null;
|
|
78
|
+
}
|
|
79
|
+
/** Legal hold status as returned by B2 response objects. */
|
|
80
|
+
export interface ReadableLegalHold {
|
|
81
|
+
/** Whether the caller is authorized to read legal hold status. */
|
|
82
|
+
readonly isClientAuthorizedToRead: boolean;
|
|
83
|
+
/** Legal hold value, or null when none is set or unreadable. */
|
|
84
|
+
readonly value: LegalHoldValue | null;
|
|
85
|
+
}
|
|
86
|
+
/** Optional metadata fields B2 may return for unfinished large-file records. */
|
|
87
|
+
export interface UnfinishedLargeFileMetadata {
|
|
88
|
+
/** Action that created this unfinished file version. */
|
|
89
|
+
readonly action?: FileAction;
|
|
90
|
+
/** When present, always 0 for unfinished large files. */
|
|
91
|
+
readonly contentLength?: number;
|
|
92
|
+
/** When present, always `'none'` for unfinished large files. */
|
|
93
|
+
readonly contentSha1?: string;
|
|
94
|
+
/** When present, always null for unfinished large files. */
|
|
95
|
+
readonly contentMd5?: string | null;
|
|
96
|
+
/** Object Lock retention settings for this unfinished file, when readable. */
|
|
97
|
+
readonly fileRetention?: ReadableFileRetention;
|
|
98
|
+
/** Legal hold status for this unfinished file, when readable. */
|
|
99
|
+
readonly legalHold?: ReadableLegalHold;
|
|
100
|
+
/** Server-side encryption applied to this unfinished file. */
|
|
101
|
+
readonly serverSideEncryption?: PublicEncryptionSetting;
|
|
102
|
+
/** UTC timestamp (milliseconds) when this unfinished upload was started. */
|
|
103
|
+
readonly uploadTimestamp?: number;
|
|
104
|
+
}
|
|
71
105
|
/** Response from the `b2_start_large_file` API call. */
|
|
72
|
-
export interface StartLargeFileResponse {
|
|
106
|
+
export interface StartLargeFileResponse extends UnfinishedLargeFileMetadata {
|
|
73
107
|
/** ID assigned to this large file upload. Use this to upload parts and finish the file. */
|
|
74
108
|
readonly fileId: LargeFileId;
|
|
75
109
|
/** Name of the file being uploaded. */
|
|
@@ -124,7 +158,7 @@ export interface UploadPartResponse {
|
|
|
124
158
|
/** SHA-1 checksum of the uploaded part content. */
|
|
125
159
|
readonly contentSha1: string;
|
|
126
160
|
/** Server-side encryption applied to this part. */
|
|
127
|
-
readonly serverSideEncryption:
|
|
161
|
+
readonly serverSideEncryption: PublicEncryptionSetting;
|
|
128
162
|
/** UTC timestamp (milliseconds) when this part was uploaded. */
|
|
129
163
|
readonly uploadTimestamp: number;
|
|
130
164
|
}
|
|
@@ -160,13 +194,13 @@ export interface ListUnfinishedLargeFilesRequest {
|
|
|
160
194
|
readonly bucketId: BucketId;
|
|
161
195
|
/** Only return files whose names start with this prefix. */
|
|
162
196
|
readonly namePrefix?: string;
|
|
163
|
-
/** File ID to start listing from (
|
|
197
|
+
/** File ID to start listing from (inclusive). Used for pagination. */
|
|
164
198
|
readonly startFileId?: LargeFileId;
|
|
165
199
|
/** Maximum number of files to return. */
|
|
166
200
|
readonly maxFileCount?: number;
|
|
167
201
|
}
|
|
168
202
|
/** Metadata for an in-progress large file upload that has not yet been finished or cancelled. */
|
|
169
|
-
export interface UnfinishedLargeFile {
|
|
203
|
+
export interface UnfinishedLargeFile extends UnfinishedLargeFileMetadata {
|
|
170
204
|
/** ID of the large file. */
|
|
171
205
|
readonly fileId: LargeFileId;
|
|
172
206
|
/** Name of the file. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/types/upload.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/types/upload.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEnE,+DAA+D;AAC/D,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;CAC5B;AAED,qGAAqG;AACrG,MAAM,WAAW,oBAAoB;IACnC,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,wEAAwE;IACxE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,6GAA6G;IAC7G,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,mBAA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Task failures can abort the same scope so sibling tasks stop promptly.
|
|
5
|
+
* @param upstream - Caller-provided abort signal, if any.
|
|
6
|
+
*
|
|
7
|
+
* @returns A linked abort scope.
|
|
8
|
+
*/
|
|
9
|
+
function createAbortScope(upstream) {
|
|
10
|
+
const controller = new AbortController();
|
|
11
|
+
let upstreamAbort;
|
|
12
|
+
const abort = (reason) => {
|
|
13
|
+
if (!controller.signal.aborted) controller.abort(reason);
|
|
14
|
+
};
|
|
15
|
+
if (upstream?.aborted === true) abort(upstream.reason);
|
|
16
|
+
else if (upstream !== void 0) {
|
|
17
|
+
upstreamAbort = () => abort(upstream.reason);
|
|
18
|
+
upstream.addEventListener("abort", upstreamAbort, { once: true });
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
signal: controller.signal,
|
|
22
|
+
abort,
|
|
23
|
+
dispose() {
|
|
24
|
+
if (upstreamAbort !== void 0) upstream?.removeEventListener("abort", upstreamAbort);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Throws the abort reason or first task rejection from a settled task set.
|
|
30
|
+
* @param settled - Results from `Promise.allSettled`.
|
|
31
|
+
* @param abortScope - Scope that coordinated the tasks.
|
|
32
|
+
*
|
|
33
|
+
* @throws The abort reason or first rejected task reason.
|
|
34
|
+
*/
|
|
35
|
+
function throwRejectedOrAbortReason(settled, abortScope) {
|
|
36
|
+
const rejected = settled.find((result) => result.status === "rejected");
|
|
37
|
+
if (rejected === void 0) return;
|
|
38
|
+
if (abortScope.signal.aborted && abortScope.signal.reason !== void 0) throw abortScope.signal.reason;
|
|
39
|
+
/* v8 ignore next -- Defensive fallback for unexpected task rejections outside the abort scope. */
|
|
40
|
+
throw rejected.reason;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns the observable reason for an aborted signal.
|
|
44
|
+
* @param signal - Aborted signal to inspect.
|
|
45
|
+
*
|
|
46
|
+
* @returns The signal's reason, or a standard AbortError when the runtime did not provide one.
|
|
47
|
+
*/
|
|
48
|
+
function abortReason(signal) {
|
|
49
|
+
return signal.reason ?? new DOMException("Aborted", "AbortError");
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Races a request promise against an abort signal.
|
|
53
|
+
*
|
|
54
|
+
* The underlying request must still receive the same signal so transports can
|
|
55
|
+
* cancel their network work. This helper makes callers stop waiting promptly
|
|
56
|
+
* even when a test double or custom transport ignores the signal.
|
|
57
|
+
*
|
|
58
|
+
* @param promise - Request promise to observe.
|
|
59
|
+
* @param signal - Signal that should stop waiting for the request.
|
|
60
|
+
*
|
|
61
|
+
* @returns The request result if it settles before the signal aborts.
|
|
62
|
+
*
|
|
63
|
+
* @throws The abort reason if the signal aborts first, or the request rejection.
|
|
64
|
+
*/
|
|
65
|
+
async function raceWithAbort(promise, signal) {
|
|
66
|
+
if (signal.aborted) {
|
|
67
|
+
promise.catch(() => {});
|
|
68
|
+
throw abortReason(signal);
|
|
69
|
+
}
|
|
70
|
+
let removeAbortListener;
|
|
71
|
+
const abort = new Promise((_, reject) => {
|
|
72
|
+
const onAbort = () => reject(abortReason(signal));
|
|
73
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
74
|
+
removeAbortListener = () => signal.removeEventListener("abort", onAbort);
|
|
75
|
+
});
|
|
76
|
+
try {
|
|
77
|
+
return await Promise.race([promise, abort]);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
if (signal.aborted) promise.catch(() => {});
|
|
80
|
+
throw err;
|
|
81
|
+
} finally {
|
|
82
|
+
removeAbortListener?.();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
exports.abortReason = abortReason;
|
|
87
|
+
exports.createAbortScope = createAbortScope;
|
|
88
|
+
exports.raceWithAbort = raceWithAbort;
|
|
89
|
+
exports.throwRejectedOrAbortReason = throwRejectedOrAbortReason;
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=abort-scope.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort-scope.cjs","names":[],"sources":["../../src/upload/abort-scope.ts"],"sourcesContent":["/** Shared abort scope for multipart work that fans out into concurrent tasks. */\nexport interface AbortScope {\n /** Signal linked to the caller signal and to task-level failures. */\n readonly signal: AbortSignal\n /** Abort the scope if it has not already been aborted. */\n abort(reason: unknown): void\n /** Detach any upstream abort listener. */\n dispose(): void\n}\n\n/**\n * Creates an abort scope linked to an optional upstream signal.\n * Task failures can abort the same scope so sibling tasks stop promptly.\n * @param upstream - Caller-provided abort signal, if any.\n *\n * @returns A linked abort scope.\n */\nexport function createAbortScope(upstream: AbortSignal | undefined): AbortScope {\n const controller = new AbortController()\n let upstreamAbort: (() => void) | undefined\n const abort = (reason: unknown): void => {\n if (!controller.signal.aborted) controller.abort(reason)\n }\n\n if (upstream?.aborted === true) {\n abort(upstream.reason)\n } else if (upstream !== undefined) {\n upstreamAbort = () => abort(upstream.reason)\n upstream.addEventListener('abort', upstreamAbort, { once: true })\n }\n\n return {\n signal: controller.signal,\n abort,\n dispose() {\n if (upstreamAbort !== undefined) upstream?.removeEventListener('abort', upstreamAbort)\n },\n }\n}\n\n/**\n * Throws the abort reason or first task rejection from a settled task set.\n * @param settled - Results from `Promise.allSettled`.\n * @param abortScope - Scope that coordinated the tasks.\n *\n * @throws The abort reason or first rejected task reason.\n */\nexport function throwRejectedOrAbortReason(\n settled: readonly PromiseSettledResult<unknown>[],\n abortScope: AbortScope,\n): void {\n const rejected = settled.find(\n (result): result is PromiseRejectedResult => result.status === 'rejected',\n )\n if (rejected === undefined) return\n if (abortScope.signal.aborted && abortScope.signal.reason !== undefined) {\n throw abortScope.signal.reason\n }\n /* v8 ignore next -- Defensive fallback for unexpected task rejections outside the abort scope. */\n throw rejected.reason\n}\n\n/**\n * Returns the observable reason for an aborted signal.\n * @param signal - Aborted signal to inspect.\n *\n * @returns The signal's reason, or a standard AbortError when the runtime did not provide one.\n */\nexport function abortReason(signal: AbortSignal): unknown {\n return signal.reason ?? new DOMException('Aborted', 'AbortError')\n}\n\n/**\n * Races a request promise against an abort signal.\n *\n * The underlying request must still receive the same signal so transports can\n * cancel their network work. This helper makes callers stop waiting promptly\n * even when a test double or custom transport ignores the signal.\n *\n * @param promise - Request promise to observe.\n * @param signal - Signal that should stop waiting for the request.\n *\n * @returns The request result if it settles before the signal aborts.\n *\n * @throws The abort reason if the signal aborts first, or the request rejection.\n */\nexport async function raceWithAbort<T>(promise: Promise<T>, signal: AbortSignal): Promise<T> {\n if (signal.aborted) {\n promise.catch(() => {})\n throw abortReason(signal)\n }\n\n let removeAbortListener: (() => void) | undefined\n const abort = new Promise<never>((_, reject) => {\n const onAbort = (): void => reject(abortReason(signal))\n signal.addEventListener('abort', onAbort, { once: true })\n removeAbortListener = () => signal.removeEventListener('abort', onAbort)\n })\n\n try {\n return await Promise.race([promise, abort])\n } catch (err) {\n if (signal.aborted) promise.catch(() => {})\n throw err\n } finally {\n removeAbortListener?.()\n }\n}\n"],"mappings":";;;;;;;;AAiBA,SAAgB,iBAAiB,UAA+C;CAC9E,MAAM,aAAa,IAAI,gBAAgB;CACvC,IAAI;CACJ,MAAM,SAAS,WAA0B;EACvC,IAAI,CAAC,WAAW,OAAO,SAAS,WAAW,MAAM,MAAM;CACzD;CAEA,IAAI,UAAU,YAAY,MACxB,MAAM,SAAS,MAAM;MAChB,IAAI,aAAa,KAAA,GAAW;EACjC,sBAAsB,MAAM,SAAS,MAAM;EAC3C,SAAS,iBAAiB,SAAS,eAAe,EAAE,MAAM,KAAK,CAAC;CAClE;CAEA,OAAO;EACL,QAAQ,WAAW;EACnB;EACA,UAAU;GACR,IAAI,kBAAkB,KAAA,GAAW,UAAU,oBAAoB,SAAS,aAAa;EACvF;CACF;AACF;;;;;;;;AASA,SAAgB,2BACd,SACA,YACM;CACN,MAAM,WAAW,QAAQ,MACtB,WAA4C,OAAO,WAAW,UACjE;CACA,IAAI,aAAa,KAAA,GAAW;CAC5B,IAAI,WAAW,OAAO,WAAW,WAAW,OAAO,WAAW,KAAA,GAC5D,MAAM,WAAW,OAAO;;CAG1B,MAAM,SAAS;AACjB;;;;;;;AAQA,SAAgB,YAAY,QAA8B;CACxD,OAAO,OAAO,UAAU,IAAI,aAAa,WAAW,YAAY;AAClE;;;;;;;;;;;;;;;AAgBA,eAAsB,cAAiB,SAAqB,QAAiC;CAC3F,IAAI,OAAO,SAAS;EAClB,QAAQ,YAAY,CAAC,CAAC;EACtB,MAAM,YAAY,MAAM;CAC1B;CAEA,IAAI;CACJ,MAAM,QAAQ,IAAI,SAAgB,GAAG,WAAW;EAC9C,MAAM,gBAAsB,OAAO,YAAY,MAAM,CAAC;EACtD,OAAO,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;EACxD,4BAA4B,OAAO,oBAAoB,SAAS,OAAO;CACzE,CAAC;CAED,IAAI;EACF,OAAO,MAAM,QAAQ,KAAK,CAAC,SAAS,KAAK,CAAC;CAC5C,SAAS,KAAK;EACZ,IAAI,OAAO,SAAS,QAAQ,YAAY,CAAC,CAAC;EAC1C,MAAM;CACR,UAAU;EACR,sBAAsB;CACxB;AACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Shared abort scope for multipart work that fans out into concurrent tasks. */
|
|
2
|
+
export interface AbortScope {
|
|
3
|
+
/** Signal linked to the caller signal and to task-level failures. */
|
|
4
|
+
readonly signal: AbortSignal;
|
|
5
|
+
/** Abort the scope if it has not already been aborted. */
|
|
6
|
+
abort(reason: unknown): void;
|
|
7
|
+
/** Detach any upstream abort listener. */
|
|
8
|
+
dispose(): void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates an abort scope linked to an optional upstream signal.
|
|
12
|
+
* Task failures can abort the same scope so sibling tasks stop promptly.
|
|
13
|
+
* @param upstream - Caller-provided abort signal, if any.
|
|
14
|
+
*
|
|
15
|
+
* @returns A linked abort scope.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createAbortScope(upstream: AbortSignal | undefined): AbortScope;
|
|
18
|
+
/**
|
|
19
|
+
* Throws the abort reason or first task rejection from a settled task set.
|
|
20
|
+
* @param settled - Results from `Promise.allSettled`.
|
|
21
|
+
* @param abortScope - Scope that coordinated the tasks.
|
|
22
|
+
*
|
|
23
|
+
* @throws The abort reason or first rejected task reason.
|
|
24
|
+
*/
|
|
25
|
+
export declare function throwRejectedOrAbortReason(settled: readonly PromiseSettledResult<unknown>[], abortScope: AbortScope): void;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the observable reason for an aborted signal.
|
|
28
|
+
* @param signal - Aborted signal to inspect.
|
|
29
|
+
*
|
|
30
|
+
* @returns The signal's reason, or a standard AbortError when the runtime did not provide one.
|
|
31
|
+
*/
|
|
32
|
+
export declare function abortReason(signal: AbortSignal): unknown;
|
|
33
|
+
/**
|
|
34
|
+
* Races a request promise against an abort signal.
|
|
35
|
+
*
|
|
36
|
+
* The underlying request must still receive the same signal so transports can
|
|
37
|
+
* cancel their network work. This helper makes callers stop waiting promptly
|
|
38
|
+
* even when a test double or custom transport ignores the signal.
|
|
39
|
+
*
|
|
40
|
+
* @param promise - Request promise to observe.
|
|
41
|
+
* @param signal - Signal that should stop waiting for the request.
|
|
42
|
+
*
|
|
43
|
+
* @returns The request result if it settles before the signal aborts.
|
|
44
|
+
*
|
|
45
|
+
* @throws The abort reason if the signal aborts first, or the request rejection.
|
|
46
|
+
*/
|
|
47
|
+
export declare function raceWithAbort<T>(promise: Promise<T>, signal: AbortSignal): Promise<T>;
|
|
48
|
+
//# sourceMappingURL=abort-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort-scope.d.ts","sourceRoot":"","sources":["../../src/upload/abort-scope.js"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,UAAU;IACzB,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,0DAA0D;IAC1D,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAA;IAC5B,0CAA0C;IAC1C,OAAO,IAAI,IAAI,CAAA;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAAG,UAAU,CAqB9E;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,oBAAoB,CAAC,OAAO,CAAC,EAAE,EACjD,UAAU,EAAE,UAAU,GACrB,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAExD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAqB3F"}
|