@backblaze-labs/b2-sdk 0.3.0 → 0.4.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 +45 -1
- package/README.md +18 -5
- package/dist/_virtual/_b2-sdk-version-json.cjs +1 -1
- package/dist/_virtual/_b2-sdk-version-json.js +1 -1
- package/dist/auth/reauth-coalescer.cjs +65 -0
- package/dist/auth/reauth-coalescer.cjs.map +1 -0
- package/dist/auth/reauth-coalescer.d.cts +34 -0
- package/dist/auth/reauth-coalescer.d.cts.map +1 -0
- package/dist/auth/reauth-coalescer.d.ts +34 -0
- package/dist/auth/reauth-coalescer.d.ts.map +1 -0
- package/dist/auth/reauth-coalescer.js +65 -0
- package/dist/auth/reauth-coalescer.js.map +1 -0
- package/dist/backup/raw.cjs +37 -15
- package/dist/backup/raw.cjs.map +1 -1
- package/dist/backup/raw.d.cts +2 -2
- package/dist/backup/raw.d.cts.map +1 -1
- package/dist/backup/raw.d.ts +2 -2
- package/dist/backup/raw.d.ts.map +1 -1
- package/dist/backup/raw.js +37 -15
- package/dist/backup/raw.js.map +1 -1
- package/dist/bucket-validation.cjs +111 -0
- package/dist/bucket-validation.cjs.map +1 -0
- package/dist/bucket-validation.d.cts +27 -0
- package/dist/bucket-validation.d.cts.map +1 -0
- package/dist/bucket-validation.d.ts +27 -0
- package/dist/bucket-validation.d.ts.map +1 -0
- package/dist/bucket-validation.js +109 -0
- package/dist/bucket-validation.js.map +1 -0
- package/dist/bucket.cjs +123 -73
- package/dist/bucket.cjs.map +1 -1
- package/dist/bucket.d.cts +156 -61
- package/dist/bucket.d.cts.map +1 -1
- package/dist/bucket.d.ts +156 -61
- package/dist/bucket.d.ts.map +1 -1
- package/dist/bucket.js +123 -73
- package/dist/bucket.js.map +1 -1
- package/dist/client.cjs +29 -8
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +30 -9
- package/dist/client.d.cts.map +1 -1
- package/dist/client.d.ts +30 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +29 -8
- package/dist/client.js.map +1 -1
- package/dist/download/single.cjs +38 -13
- package/dist/download/single.cjs.map +1 -1
- package/dist/download/single.d.cts +10 -4
- package/dist/download/single.d.cts.map +1 -1
- package/dist/download/single.d.ts +10 -4
- package/dist/download/single.d.ts.map +1 -1
- package/dist/download/single.js +38 -13
- package/dist/download/single.js.map +1 -1
- package/dist/errors/index.cjs +27 -4
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts +15 -0
- package/dist/errors/index.d.cts.map +1 -1
- package/dist/errors/index.d.ts +15 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +27 -5
- package/dist/errors/index.js.map +1 -1
- package/dist/http/non-idempotent-mutations.cjs +38 -0
- package/dist/http/non-idempotent-mutations.cjs.map +1 -0
- package/dist/http/non-idempotent-mutations.d.cts +25 -0
- package/dist/http/non-idempotent-mutations.d.cts.map +1 -0
- package/dist/http/non-idempotent-mutations.d.ts +25 -0
- package/dist/http/non-idempotent-mutations.d.ts.map +1 -0
- package/dist/http/non-idempotent-mutations.js +35 -0
- package/dist/http/non-idempotent-mutations.js.map +1 -0
- package/dist/http/transport.cjs +9 -8
- package/dist/http/transport.cjs.map +1 -1
- package/dist/http/transport.d.cts +5 -0
- package/dist/http/transport.d.cts.map +1 -1
- package/dist/http/transport.d.ts +5 -0
- package/dist/http/transport.d.ts.map +1 -1
- package/dist/http/transport.js +9 -8
- package/dist/http/transport.js.map +1 -1
- package/dist/http/user-agent.cjs +12 -1
- package/dist/http/user-agent.cjs.map +1 -1
- package/dist/http/user-agent.d.cts +8 -0
- package/dist/http/user-agent.d.cts.map +1 -1
- package/dist/http/user-agent.d.ts +8 -0
- package/dist/http/user-agent.d.ts.map +1 -1
- package/dist/http/user-agent.js +13 -3
- package/dist/http/user-agent.js.map +1 -1
- package/dist/index.cjs +25 -0
- package/dist/index.d.cts +10 -9
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/notifications/index.cjs +3 -0
- package/dist/notifications/index.d.cts +2 -0
- package/dist/notifications/index.d.cts.map +1 -1
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +2 -1
- package/dist/object.cjs +12 -1
- package/dist/object.cjs.map +1 -1
- package/dist/object.d.cts +7 -1
- package/dist/object.d.cts.map +1 -1
- package/dist/object.d.ts +7 -1
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +12 -1
- package/dist/object.js.map +1 -1
- package/dist/partner/auth-core.cjs +4 -23
- package/dist/partner/auth-core.cjs.map +1 -1
- package/dist/partner/auth-core.d.cts +1 -1
- package/dist/partner/auth-core.d.cts.map +1 -1
- package/dist/partner/auth-core.d.ts +1 -1
- package/dist/partner/auth-core.d.ts.map +1 -1
- package/dist/partner/auth-core.js +5 -24
- package/dist/partner/auth-core.js.map +1 -1
- package/dist/partner/client.cjs +25 -10
- package/dist/partner/client.cjs.map +1 -1
- package/dist/partner/client.d.cts +32 -10
- package/dist/partner/client.d.cts.map +1 -1
- package/dist/partner/client.d.ts +32 -10
- package/dist/partner/client.d.ts.map +1 -1
- package/dist/partner/client.js +25 -10
- package/dist/partner/client.js.map +1 -1
- package/dist/partner/endpoint-url.cjs +1 -0
- package/dist/partner/endpoint-url.cjs.map +1 -1
- package/dist/partner/endpoint-url.d.cts +2 -0
- package/dist/partner/endpoint-url.d.cts.map +1 -1
- package/dist/partner/endpoint-url.d.ts +2 -0
- package/dist/partner/endpoint-url.d.ts.map +1 -1
- package/dist/partner/endpoint-url.js +1 -0
- package/dist/partner/endpoint-url.js.map +1 -1
- package/dist/partner/in-memory.cjs.map +1 -1
- package/dist/partner/in-memory.js.map +1 -1
- package/dist/partner/index.cjs +9 -0
- package/dist/partner/index.d.cts +11 -2
- package/dist/partner/index.d.cts.map +1 -1
- package/dist/partner/index.d.ts +11 -2
- package/dist/partner/index.d.ts.map +1 -1
- package/dist/partner/index.js +3 -1
- package/dist/partner/raw.cjs +52 -44
- package/dist/partner/raw.cjs.map +1 -1
- package/dist/partner/raw.d.cts +16 -19
- package/dist/partner/raw.d.cts.map +1 -1
- package/dist/partner/raw.d.ts +16 -19
- package/dist/partner/raw.d.ts.map +1 -1
- package/dist/partner/raw.js +52 -44
- package/dist/partner/raw.js.map +1 -1
- package/dist/partner/redaction.cjs +133 -108
- package/dist/partner/redaction.cjs.map +1 -1
- package/dist/partner/redaction.d.cts +47 -13
- package/dist/partner/redaction.d.cts.map +1 -1
- package/dist/partner/redaction.d.ts +47 -13
- package/dist/partner/redaction.d.ts.map +1 -1
- package/dist/partner/redaction.js +133 -109
- package/dist/partner/redaction.js.map +1 -1
- package/dist/raw/encoding.cjs +29 -10
- package/dist/raw/encoding.cjs.map +1 -1
- package/dist/raw/encoding.d.cts +3 -2
- package/dist/raw/encoding.d.cts.map +1 -1
- package/dist/raw/encoding.d.ts +3 -2
- package/dist/raw/encoding.d.ts.map +1 -1
- package/dist/raw/encoding.js +29 -10
- package/dist/raw/encoding.js.map +1 -1
- package/dist/raw/index.cjs +64 -39
- package/dist/raw/index.cjs.map +1 -1
- package/dist/raw/index.d.cts +21 -19
- package/dist/raw/index.d.cts.map +1 -1
- package/dist/raw/index.d.ts +21 -19
- package/dist/raw/index.d.ts.map +1 -1
- package/dist/raw/index.js +47 -40
- package/dist/raw/index.js.map +1 -1
- package/dist/raw/url.cjs.map +1 -1
- package/dist/raw/url.d.cts +3 -3
- package/dist/raw/url.d.ts +3 -3
- package/dist/raw/url.js.map +1 -1
- package/dist/simulator/index.cjs +456 -125
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.d.cts +16 -1
- package/dist/simulator/index.d.cts.map +1 -1
- package/dist/simulator/index.d.ts +16 -1
- package/dist/simulator/index.d.ts.map +1 -1
- package/dist/simulator/index.js +449 -130
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/partner-capabilities.cjs +77 -0
- package/dist/simulator/partner-capabilities.cjs.map +1 -0
- package/dist/simulator/partner-capabilities.d.cts +53 -0
- package/dist/simulator/partner-capabilities.d.cts.map +1 -0
- package/dist/simulator/partner-capabilities.d.ts +53 -0
- package/dist/simulator/partner-capabilities.d.ts.map +1 -0
- package/dist/simulator/partner-capabilities.js +73 -0
- package/dist/simulator/partner-capabilities.js.map +1 -0
- package/dist/simulator/partner.cjs +55 -61
- package/dist/simulator/partner.cjs.map +1 -1
- package/dist/simulator/partner.d.cts +5 -2
- package/dist/simulator/partner.d.cts.map +1 -1
- package/dist/simulator/partner.d.ts +5 -2
- package/dist/simulator/partner.d.ts.map +1 -1
- package/dist/simulator/partner.js +56 -61
- package/dist/simulator/partner.js.map +1 -1
- package/dist/simulator/validation.cjs +160 -30
- package/dist/simulator/validation.cjs.map +1 -1
- package/dist/simulator/validation.d.cts +28 -6
- package/dist/simulator/validation.d.cts.map +1 -1
- package/dist/simulator/validation.d.ts +28 -6
- package/dist/simulator/validation.d.ts.map +1 -1
- package/dist/simulator/validation.js +148 -31
- package/dist/simulator/validation.js.map +1 -1
- package/dist/streams/file-source.cjs +1 -1
- package/dist/streams/file-source.cjs.map +1 -1
- package/dist/streams/file-source.js +1 -1
- package/dist/streams/file-source.js.map +1 -1
- package/dist/streams/hash.cjs +246 -13
- package/dist/streams/hash.cjs.map +1 -1
- package/dist/streams/hash.d.cts +37 -12
- package/dist/streams/hash.d.cts.map +1 -1
- package/dist/streams/hash.d.ts +37 -12
- package/dist/streams/hash.d.ts.map +1 -1
- package/dist/streams/hash.js +246 -15
- package/dist/streams/hash.js.map +1 -1
- package/dist/streams/index.cjs +2 -0
- package/dist/streams/index.d.cts +1 -1
- package/dist/streams/index.d.cts.map +1 -1
- package/dist/streams/index.d.ts +1 -1
- package/dist/streams/index.d.ts.map +1 -1
- package/dist/streams/index.js +2 -2
- package/dist/streams/progress.cjs +63 -4
- package/dist/streams/progress.cjs.map +1 -1
- package/dist/streams/progress.d.cts +28 -2
- package/dist/streams/progress.d.cts.map +1 -1
- package/dist/streams/progress.d.ts +28 -2
- package/dist/streams/progress.d.ts.map +1 -1
- package/dist/streams/progress.js +63 -4
- package/dist/streams/progress.js.map +1 -1
- package/dist/sync/download-staging.cjs +147 -35
- package/dist/sync/download-staging.cjs.map +1 -1
- package/dist/sync/download-staging.d.cts +25 -2
- package/dist/sync/download-staging.d.cts.map +1 -1
- package/dist/sync/download-staging.d.ts +25 -2
- package/dist/sync/download-staging.d.ts.map +1 -1
- package/dist/sync/download-staging.js +146 -36
- package/dist/sync/download-staging.js.map +1 -1
- package/dist/sync/index.d.cts +1 -1
- package/dist/sync/index.d.cts.map +1 -1
- package/dist/sync/index.d.ts +1 -1
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/local-file-io.cjs +5 -1
- package/dist/sync/local-file-io.cjs.map +1 -1
- package/dist/sync/local-file-io.d.cts +2 -0
- package/dist/sync/local-file-io.d.cts.map +1 -1
- package/dist/sync/local-file-io.d.ts +2 -0
- package/dist/sync/local-file-io.d.ts.map +1 -1
- package/dist/sync/local-file-io.js +5 -1
- package/dist/sync/local-file-io.js.map +1 -1
- package/dist/sync/pairing.cjs +1 -0
- package/dist/sync/pairing.cjs.map +1 -1
- package/dist/sync/pairing.js +1 -0
- package/dist/sync/pairing.js.map +1 -1
- package/dist/sync/scanners/b2.cjs +2 -0
- package/dist/sync/scanners/b2.cjs.map +1 -1
- package/dist/sync/scanners/b2.d.cts.map +1 -1
- package/dist/sync/scanners/b2.d.ts.map +1 -1
- package/dist/sync/scanners/b2.js +2 -0
- package/dist/sync/scanners/b2.js.map +1 -1
- package/dist/sync/scanners/local.cjs +150 -33
- package/dist/sync/scanners/local.cjs.map +1 -1
- package/dist/sync/scanners/local.d.cts +6 -0
- package/dist/sync/scanners/local.d.cts.map +1 -1
- package/dist/sync/scanners/local.d.ts +6 -0
- package/dist/sync/scanners/local.d.ts.map +1 -1
- package/dist/sync/scanners/local.js +150 -33
- package/dist/sync/scanners/local.js.map +1 -1
- package/dist/sync/synchronizer.cjs +76 -29
- package/dist/sync/synchronizer.cjs.map +1 -1
- package/dist/sync/synchronizer.d.cts +1 -0
- package/dist/sync/synchronizer.d.cts.map +1 -1
- package/dist/sync/synchronizer.d.ts +1 -0
- package/dist/sync/synchronizer.d.ts.map +1 -1
- package/dist/sync/synchronizer.js +76 -29
- package/dist/sync/synchronizer.js.map +1 -1
- package/dist/sync/types.d.cts +19 -3
- package/dist/sync/types.d.cts.map +1 -1
- package/dist/sync/types.d.ts +19 -3
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/types/backup.d.cts +6 -1
- package/dist/types/backup.d.cts.map +1 -1
- package/dist/types/backup.d.ts +6 -1
- package/dist/types/backup.d.ts.map +1 -1
- package/dist/types/bucket.cjs +81 -11
- package/dist/types/bucket.cjs.map +1 -1
- package/dist/types/bucket.d.cts +190 -39
- package/dist/types/bucket.d.cts.map +1 -1
- package/dist/types/bucket.d.ts +190 -39
- package/dist/types/bucket.d.ts.map +1 -1
- package/dist/types/bucket.js +67 -12
- package/dist/types/bucket.js.map +1 -1
- package/dist/types/download.cjs.map +1 -1
- package/dist/types/download.d.cts +3 -17
- package/dist/types/download.d.cts.map +1 -1
- package/dist/types/download.d.ts +3 -17
- package/dist/types/download.d.ts.map +1 -1
- package/dist/types/download.js.map +1 -1
- package/dist/types/encryption.cjs +18 -0
- package/dist/types/encryption.cjs.map +1 -1
- package/dist/types/encryption.d.cts +21 -11
- package/dist/types/encryption.d.cts.map +1 -1
- package/dist/types/encryption.d.ts +21 -11
- package/dist/types/encryption.d.ts.map +1 -1
- package/dist/types/encryption.js +18 -0
- package/dist/types/encryption.js.map +1 -1
- package/dist/types/file.cjs +3 -0
- package/dist/types/file.cjs.map +1 -1
- package/dist/types/file.d.cts +125 -16
- package/dist/types/file.d.cts.map +1 -1
- package/dist/types/file.d.ts +125 -16
- package/dist/types/file.d.ts.map +1 -1
- package/dist/types/file.js +3 -1
- package/dist/types/file.js.map +1 -1
- package/dist/types/index.d.cts +7 -7
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/key.d.cts +4 -3
- package/dist/types/key.d.cts.map +1 -1
- package/dist/types/key.d.ts +4 -3
- package/dist/types/key.d.ts.map +1 -1
- package/dist/types/notifications.cjs +30 -0
- package/dist/types/notifications.cjs.map +1 -1
- package/dist/types/notifications.d.cts +26 -1
- package/dist/types/notifications.d.cts.map +1 -1
- package/dist/types/notifications.d.ts +26 -1
- package/dist/types/notifications.d.ts.map +1 -1
- package/dist/types/notifications.js +29 -1
- package/dist/types/notifications.js.map +1 -1
- package/dist/types/partner.cjs.map +1 -1
- package/dist/types/partner.d.cts +28 -36
- package/dist/types/partner.d.cts.map +1 -1
- package/dist/types/partner.d.ts +28 -36
- package/dist/types/partner.d.ts.map +1 -1
- package/dist/types/partner.js.map +1 -1
- package/dist/types/upload.d.cts +4 -0
- package/dist/types/upload.d.cts.map +1 -1
- package/dist/types/upload.d.ts +4 -0
- package/dist/types/upload.d.ts.map +1 -1
- package/dist/upload/large.cjs +10 -7
- package/dist/upload/large.cjs.map +1 -1
- package/dist/upload/large.d.cts +15 -6
- package/dist/upload/large.d.cts.map +1 -1
- package/dist/upload/large.d.ts +15 -6
- package/dist/upload/large.d.ts.map +1 -1
- package/dist/upload/large.js +10 -7
- package/dist/upload/large.js.map +1 -1
- package/dist/upload/options.cjs.map +1 -1
- package/dist/upload/options.d.cts +12 -0
- package/dist/upload/options.d.cts.map +1 -1
- package/dist/upload/options.d.ts +12 -0
- package/dist/upload/options.d.ts.map +1 -1
- package/dist/upload/options.js.map +1 -1
- package/dist/upload/resume.cjs +4 -3
- package/dist/upload/resume.cjs.map +1 -1
- package/dist/upload/resume.d.cts +6 -4
- package/dist/upload/resume.d.cts.map +1 -1
- package/dist/upload/resume.d.ts +6 -4
- package/dist/upload/resume.d.ts.map +1 -1
- package/dist/upload/resume.js +4 -3
- package/dist/upload/resume.js.map +1 -1
- package/dist/upload/retry.cjs +17 -10
- package/dist/upload/retry.cjs.map +1 -1
- package/dist/upload/retry.d.cts.map +1 -1
- package/dist/upload/retry.d.ts.map +1 -1
- package/dist/upload/retry.js +17 -10
- package/dist/upload/retry.js.map +1 -1
- package/dist/upload/single.cjs +35 -31
- package/dist/upload/single.cjs.map +1 -1
- package/dist/upload/single.d.cts +6 -0
- package/dist/upload/single.d.cts.map +1 -1
- package/dist/upload/single.d.ts +6 -0
- package/dist/upload/single.d.ts.map +1 -1
- package/dist/upload/single.js +35 -31
- package/dist/upload/single.js.map +1 -1
- package/dist/upload/stream.cjs +12 -1
- package/dist/upload/stream.cjs.map +1 -1
- package/dist/upload/stream.d.cts +6 -0
- package/dist/upload/stream.d.cts.map +1 -1
- package/dist/upload/stream.d.ts +6 -0
- package/dist/upload/stream.d.ts.map +1 -1
- package/dist/upload/stream.js +12 -1
- package/dist/upload/stream.js.map +1 -1
- package/dist/version.cjs +56 -4
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +53 -4
- package/dist/version.d.cts.map +1 -1
- package/dist/version.d.ts +53 -4
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +52 -5
- package/dist/version.js.map +1 -1
- package/package.json +11 -4
package/dist/types/index.d.ts
CHANGED
|
@@ -6,23 +6,23 @@
|
|
|
6
6
|
export type { AllowedBucket, AllowedInfo, ApiInfo, AuthorizeAccountRequest, AuthorizeAccountResponse, GroupsApiInfo, StorageApiInfo, } from './auth.js';
|
|
7
7
|
export { Capability } from './auth.js';
|
|
8
8
|
export type { ComputerBackup, DeleteComputerRequest, DeleteComputerResponse, DeleteComputerResult, ListComputersRequest, ListComputersResponse, ListComputersResult, } from './backup.js';
|
|
9
|
-
export type { BucketInfo, BucketRetentionPolicy, CorsRule, CreateBucketRequest, DeleteBucketRequest, LifecycleRule, ListBucketsRequest, ListBucketsResponse, RetentionPeriod, UpdateBucketRequest, } from './bucket.js';
|
|
10
|
-
export { BucketRetentionMode, BucketType, CorsOperation } from './bucket.js';
|
|
9
|
+
export type { BucketDefaultRetention, BucketDefaultServerSideEncryption, BucketDefaultServerSideEncryptionSetting, BucketInfo, BucketListType, BucketResponseType, BucketRetentionPolicy, BucketTypesFilter, CorsAllowedOperation, CorsRule, CreateBucketRequest, DeleteBucketRequest, KnownBucketKeyOption, LifecycleRule, ListBucketsRequest, ListBucketsResponse, NoBucketDefaultRetention, ReadableReplicationConfiguration, RetentionPeriod, UpdateBucketRequest, } from './bucket.js';
|
|
10
|
+
export { BUCKET_INFO_KEY_MAX_BYTES, BUCKET_INFO_KEY_MIN_BYTES, BUCKET_INFO_KEY_PATTERN, BUCKET_INFO_RESERVED_PREFIX, BUCKET_INFO_VALUES_MAX_BYTES, BucketKeyOption, BucketRetentionMode, BucketType, CORS_ALLOWED_OPERATIONS, CORS_MAX_AGE_SECONDS_MAX, CORS_RULE_MAX_BYTES, CORS_RULE_NAME_MAX_LENGTH, CORS_RULE_NAME_MIN_LENGTH, CORS_RULE_NAME_PATTERN, CORS_RULE_NAME_RESERVED_PREFIX, CORS_RULES_MAX_COUNT, CorsOperation, KnownBucketResponseType, } from './bucket.js';
|
|
11
11
|
export type { DownloadAuthorizationRequest, DownloadAuthorizationResponse, DownloadByIdRequest, DownloadByNameRequest, DownloadHeaderParseIssue, DownloadHeaders, DownloadServerSideEncryption, SseCDownloadSetting, } from './download.js';
|
|
12
12
|
export { DownloadClientUnauthorizedToReadMarker, DownloadHeaderName } from './download.js';
|
|
13
|
-
export type { EncryptionSetting, NoEncryption, NoEncryptionWireSetting, PublicEncryptionSetting, SseB2Setting, SseCCustomerSetting, SseCPublicSetting, } from './encryption.js';
|
|
13
|
+
export type { EncryptionSetting, NoEncryption, NoEncryptionWireSetting, PublicEncryptionSetting, SseB2Setting, SseCCustomerSetting, SseCKeyMaterial, SseCPublicSetting, } from './encryption.js';
|
|
14
14
|
export { EncryptionAlgorithm, EncryptionKey, EncryptionMode, SSE_B2, SSE_NONE, sseCustomer, } from './encryption.js';
|
|
15
15
|
export type { B2ErrorCode, B2ErrorResponse, KnownB2ErrorCode } from './errors.js';
|
|
16
16
|
export { KNOWN_B2_ERROR_CODES } from './errors.js';
|
|
17
|
-
export type { CopyFileRequest, CopyPartRequest, CopyPartResponse, DeleteFileVersionRequest, DeleteFileVersionResponse, FileVersion, GetFileInfoRequest, HideFileRequest, ListFileNamesRequest, ListFileNamesResponse, ListFileVersionsRequest, ListFileVersionsResponse, ReplicationStatus, } from './file.js';
|
|
18
|
-
export { FileAction, MetadataDirective } from './file.js';
|
|
17
|
+
export type { ConcreteFileAction, CopyFileRequest, CopyPartRequest, CopyPartResponse, DeleteFileVersionRequest, DeleteFileVersionResponse, FileNameListEntry, FileVersion, FileVersionListEntry, FolderFileVersion, GetFileInfoRequest, HideFileRequest, ListedConcreteFileVersion, ListedFileAction, ListedFileVersion, ListedHideFileVersion, ListFileNamesMaybeDelimiterRequest, ListFileNamesRequest, ListFileNamesResponse, ListFileNamesWithDelimiterRequest, ListFileNamesWithDelimiterResponse, ListFileVersionsMaybeDelimiterRequest, ListFileVersionsRequest, ListFileVersionsResponse, ListFileVersionsWithDelimiterRequest, ListFileVersionsWithDelimiterResponse, ReplicationStatus, } from './file.js';
|
|
18
|
+
export { FileAction, HIDE_MARKER_CONTENT_TYPE, MetadataDirective } from './file.js';
|
|
19
19
|
export type { AccountId, ApplicationKeyId, AuthToken, Brand, BrandTag, BucketId, ComputerId, FileId, GroupId, KeyId, LargeFileId, PartnerToken, UploadAuthToken, UploadUrl, } from './ids.js';
|
|
20
20
|
export { accountId, applicationKeyId, bucketId, computerId, fileId, groupId, keyId, largeFileId, partnerToken, } from './ids.js';
|
|
21
21
|
export type { ApplicationKey, CreateKeyBucketScope, CreateKeyOptions, CreateKeyOptionsBase, CreateKeyRequest, DeleteKeyRequest, FullApplicationKey, ListKeysRequest, ListKeysResponse, } from './key.js';
|
|
22
22
|
export type { FileRetentionValue, ReadableFileRetention, ReadableLegalHold, UpdateFileLegalHoldRequest, UpdateFileLegalHoldResponse, UpdateFileRetentionRequest, UpdateFileRetentionResponse, } from './lock.js';
|
|
23
23
|
export { LegalHoldValue, RetentionMode } from './lock.js';
|
|
24
|
-
export type { EventNotificationRule, GetBucketNotificationRulesRequest, GetBucketNotificationRulesResponse, SetBucketNotificationRulesRequest, SetBucketNotificationRulesResponse, } from './notifications.js';
|
|
25
|
-
export { EventType } from './notifications.js';
|
|
24
|
+
export type { EventNotificationCustomHeader, EventNotificationRule, GetBucketNotificationRulesRequest, GetBucketNotificationRulesResponse, SetBucketNotificationRulesRequest, SetBucketNotificationRulesResponse, } from './notifications.js';
|
|
25
|
+
export { EventType, notificationCustomHeadersToRecord, recordToNotificationCustomHeaders, } from './notifications.js';
|
|
26
26
|
export type { CreateGroupMemberRequest, CreateGroupMemberResponse, CreateGroupMemberResult, EjectGroupMemberRequest, EjectGroupMemberResponse, EjectGroupMemberResult, ListedGroupMember, ListGroupMembersRequest, ListGroupMembersResponse, ListGroupMembersResult, ListGroupsRequest, ListGroupsResponse, ListGroupsResult, PartnerAccountStandingDetails, PartnerApiInfo, PartnerAuthorizeResponse, PartnerB2Stats, PartnerBackupApiInfo, PartnerGroup, PartnerGroupMember, PartnerGroupStats, PartnerGroupsApiInfo, PartnerStorageApiInfo, ReserveTrialCreateAccountRequest, ReserveTrialCreateAccountRequestEntry, ReserveTrialCreateAccountResponse, ReserveTrialCreateAccountResult, } from './partner.js';
|
|
27
27
|
export { PartnerCapability, Region } from './partner.js';
|
|
28
28
|
export type { ReplicationConfiguration, ReplicationDestination, ReplicationRule, ReplicationSource, } from './replication.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,aAAa,EACb,WAAW,EACX,OAAO,EACP,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,EACb,cAAc,GACf,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,UAAU,EACV,qBAAqB,EACrB,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,GACpB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,aAAa,EACb,WAAW,EACX,OAAO,EACP,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,EACb,cAAc,GACf,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,sBAAsB,EACtB,iCAAiC,EACjC,wCAAwC,EACxC,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,gCAAgC,EAChC,eAAe,EACf,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAIpB,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,yBA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iC,EACjC,+BAA+B,GAChC,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACxD,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,+BAA+B,EAC/B,gCAAgC,EAChC,QAAQ,EACR,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAA"}
|
package/dist/types/key.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Capability } from './auth.js';
|
|
2
|
+
import { BucketKeyOption } from './bucket.js';
|
|
2
3
|
import { AccountId, ApplicationKeyId, BucketId } from './ids.js';
|
|
3
4
|
/** Shared request parameters for creating an application key. */
|
|
4
5
|
export interface CreateKeyOptionsBase {
|
|
@@ -66,7 +67,7 @@ export interface FullApplicationKey {
|
|
|
66
67
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
67
68
|
readonly namePrefix: string | null;
|
|
68
69
|
/** Set of options enabled on this key. */
|
|
69
|
-
readonly options: readonly
|
|
70
|
+
readonly options: readonly BucketKeyOption[];
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* Application key metadata (without the secret) as returned by `b2_list_keys`.
|
|
@@ -94,7 +95,7 @@ export interface ApplicationKey {
|
|
|
94
95
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
95
96
|
readonly namePrefix: string | null;
|
|
96
97
|
/** Set of options enabled on this key. */
|
|
97
|
-
readonly options: readonly
|
|
98
|
+
readonly options: readonly BucketKeyOption[];
|
|
98
99
|
}
|
|
99
100
|
/** Request parameters for the `b2_list_keys` API call. */
|
|
100
101
|
export interface ListKeysRequest {
|
|
@@ -102,7 +103,7 @@ export interface ListKeysRequest {
|
|
|
102
103
|
readonly accountId: AccountId;
|
|
103
104
|
/** Maximum number of keys to return per request. */
|
|
104
105
|
readonly maxKeyCount?: number;
|
|
105
|
-
/** Application key ID to start listing
|
|
106
|
+
/** Application key ID to start listing at, usually from `nextApplicationKeyId`. */
|
|
106
107
|
readonly startApplicationKeyId?: ApplicationKeyId;
|
|
107
108
|
}
|
|
108
109
|
/** Response from the `b2_list_keys` API call. */
|
package/dist/types/key.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/types/key.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAErE,iEAAiE;AACjE,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,EAAE,SAAS,UAAU,EAAE,CAAA;IAC5C,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IACxC,6GAA6G;IAC7G,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,+DAA+D;AAC/D,MAAM,MAAM,oBAAoB,GAC5B;IACE;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAA;IAC/C,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAC1B,GACD;IACE;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,uEAAuE;IACvE,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QAAQ,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,CAAA;CAClD;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,CAAA;IACxC,2FAA2F;IAC3F,QAAQ,CAAC,oBAAoB,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACvD;AAED,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAA;CAC5C"}
|
package/dist/types/key.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Capability } from './auth.js';
|
|
2
|
+
import { BucketKeyOption } from './bucket.js';
|
|
2
3
|
import { AccountId, ApplicationKeyId, BucketId } from './ids.js';
|
|
3
4
|
/** Shared request parameters for creating an application key. */
|
|
4
5
|
export interface CreateKeyOptionsBase {
|
|
@@ -66,7 +67,7 @@ export interface FullApplicationKey {
|
|
|
66
67
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
67
68
|
readonly namePrefix: string | null;
|
|
68
69
|
/** Set of options enabled on this key. */
|
|
69
|
-
readonly options: readonly
|
|
70
|
+
readonly options: readonly BucketKeyOption[];
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* Application key metadata (without the secret) as returned by `b2_list_keys`.
|
|
@@ -94,7 +95,7 @@ export interface ApplicationKey {
|
|
|
94
95
|
/** File name prefix this key is restricted to, or null if unrestricted. */
|
|
95
96
|
readonly namePrefix: string | null;
|
|
96
97
|
/** Set of options enabled on this key. */
|
|
97
|
-
readonly options: readonly
|
|
98
|
+
readonly options: readonly BucketKeyOption[];
|
|
98
99
|
}
|
|
99
100
|
/** Request parameters for the `b2_list_keys` API call. */
|
|
100
101
|
export interface ListKeysRequest {
|
|
@@ -102,7 +103,7 @@ export interface ListKeysRequest {
|
|
|
102
103
|
readonly accountId: AccountId;
|
|
103
104
|
/** Maximum number of keys to return per request. */
|
|
104
105
|
readonly maxKeyCount?: number;
|
|
105
|
-
/** Application key ID to start listing
|
|
106
|
+
/** Application key ID to start listing at, usually from `nextApplicationKeyId`. */
|
|
106
107
|
readonly startApplicationKeyId?: ApplicationKeyId;
|
|
107
108
|
}
|
|
108
109
|
/** Response from the `b2_list_keys` API call. */
|
package/dist/types/key.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/types/key.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAErE,iEAAiE;AACjE,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,EAAE,SAAS,UAAU,EAAE,CAAA;IAC5C,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IACxC,6GAA6G;IAC7G,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,+DAA+D;AAC/D,MAAM,MAAM,oBAAoB,GAC5B;IACE;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAA;IAC/C,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAC1B,GACD;IACE;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,CAAA;CAC3B,CAAA;AAEL,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,oBAAoB,CAAA;AAE1E,0FAA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,cAAc,EAAE,CAAA;IACxC,2FAA2F;IAC3F,QAAQ,CAAC,oBAAoB,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACvD;AAED,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAA;CAC5C"}
|
|
@@ -40,7 +40,37 @@ var EventType = {
|
|
|
40
40
|
/** A version was removed by a lifecycle rule. */
|
|
41
41
|
ObjectDeletedLifecycleRule: "b2:ObjectDeleted:LifecycleRule"
|
|
42
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Convert B2's wire-shaped custom headers to a lookup record.
|
|
45
|
+
*
|
|
46
|
+
* Duplicate header names are represented by the last value in the array.
|
|
47
|
+
*
|
|
48
|
+
* @param customHeaders - Wire-shaped custom headers from an event-notification rule.
|
|
49
|
+
*
|
|
50
|
+
* @returns A name/value lookup record.
|
|
51
|
+
*/
|
|
52
|
+
function notificationCustomHeadersToRecord(customHeaders) {
|
|
53
|
+
const record = Object.create(null);
|
|
54
|
+
for (const { name, value } of customHeaders ?? []) record[name] = value;
|
|
55
|
+
return record;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Convert a lookup record to B2's wire-shaped custom headers.
|
|
59
|
+
*
|
|
60
|
+
* @param customHeaders - Name/value header lookup.
|
|
61
|
+
*
|
|
62
|
+
* @returns Wire-shaped custom headers for an event-notification rule.
|
|
63
|
+
*/
|
|
64
|
+
function recordToNotificationCustomHeaders(customHeaders) {
|
|
65
|
+
if (customHeaders === void 0) return [];
|
|
66
|
+
return Object.entries(customHeaders).map(([name, value]) => ({
|
|
67
|
+
name,
|
|
68
|
+
value
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
43
71
|
//#endregion
|
|
44
72
|
exports.EventType = EventType;
|
|
73
|
+
exports.notificationCustomHeadersToRecord = notificationCustomHeadersToRecord;
|
|
74
|
+
exports.recordToNotificationCustomHeaders = recordToNotificationCustomHeaders;
|
|
45
75
|
|
|
46
76
|
//# sourceMappingURL=notifications.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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: 'webhook', 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 /** Maximum number of events B2 may include in a single webhook request. */\n readonly maxEventsPerBatch?: number\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 (`'webhook'` for webhook delivery). */\n readonly targetType: 'webhook'\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?:
|
|
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: 'webhook', 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 custom HTTP header included with event-notification webhook requests. */\nexport interface EventNotificationCustomHeader {\n /** Header name. */\n readonly name: string\n /** Header value. */\n readonly value: string\n}\n\n/**\n * Convert B2's wire-shaped custom headers to a lookup record.\n *\n * Duplicate header names are represented by the last value in the array.\n *\n * @param customHeaders - Wire-shaped custom headers from an event-notification rule.\n *\n * @returns A name/value lookup record.\n */\nexport function notificationCustomHeadersToRecord(\n customHeaders: readonly EventNotificationCustomHeader[] | undefined,\n): Record<string, string> {\n const record = Object.create(null) as Record<string, string>\n for (const { name, value } of customHeaders ?? []) {\n record[name] = value\n }\n return record\n}\n\n/**\n * Convert a lookup record to B2's wire-shaped custom headers.\n *\n * @param customHeaders - Name/value header lookup.\n *\n * @returns Wire-shaped custom headers for an event-notification rule.\n */\nexport function recordToNotificationCustomHeaders(\n customHeaders: Readonly<Record<string, string>> | undefined,\n): EventNotificationCustomHeader[] {\n if (customHeaders === undefined) return []\n return Object.entries(customHeaders).map(([name, value]) => ({ name, value }))\n}\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 /** Maximum number of events B2 may include in a single webhook request. */\n readonly maxEventsPerBatch?: number\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 (`'webhook'` for webhook delivery). */\n readonly targetType: 'webhook'\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?: readonly EventNotificationCustomHeader[]\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;;;;;;;;;;AAwBA,SAAgB,kCACd,eACwB;CACxB,MAAM,SAAS,OAAO,OAAO,IAAI;CACjC,KAAK,MAAM,EAAE,MAAM,WAAW,iBAAiB,CAAC,GAC9C,OAAO,QAAQ;CAEjB,OAAO;AACT;;;;;;;;AASA,SAAgB,kCACd,eACiC;CACjC,IAAI,kBAAkB,KAAA,GAAW,OAAO,CAAC;CACzC,OAAO,OAAO,QAAQ,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,YAAY;EAAE;EAAM;CAAM,EAAE;AAC/E"}
|
|
@@ -44,6 +44,31 @@ export declare const EventType: {
|
|
|
44
44
|
* B2 event types that can trigger notifications. Derived from {@link EventType}.
|
|
45
45
|
*/
|
|
46
46
|
export type EventType = (typeof EventType)[keyof typeof EventType];
|
|
47
|
+
/** A custom HTTP header included with event-notification webhook requests. */
|
|
48
|
+
export interface EventNotificationCustomHeader {
|
|
49
|
+
/** Header name. */
|
|
50
|
+
readonly name: string;
|
|
51
|
+
/** Header value. */
|
|
52
|
+
readonly value: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Convert B2's wire-shaped custom headers to a lookup record.
|
|
56
|
+
*
|
|
57
|
+
* Duplicate header names are represented by the last value in the array.
|
|
58
|
+
*
|
|
59
|
+
* @param customHeaders - Wire-shaped custom headers from an event-notification rule.
|
|
60
|
+
*
|
|
61
|
+
* @returns A name/value lookup record.
|
|
62
|
+
*/
|
|
63
|
+
export declare function notificationCustomHeadersToRecord(customHeaders: readonly EventNotificationCustomHeader[] | undefined): Record<string, string>;
|
|
64
|
+
/**
|
|
65
|
+
* Convert a lookup record to B2's wire-shaped custom headers.
|
|
66
|
+
*
|
|
67
|
+
* @param customHeaders - Name/value header lookup.
|
|
68
|
+
*
|
|
69
|
+
* @returns Wire-shaped custom headers for an event-notification rule.
|
|
70
|
+
*/
|
|
71
|
+
export declare function recordToNotificationCustomHeaders(customHeaders: Readonly<Record<string, string>> | undefined): EventNotificationCustomHeader[];
|
|
47
72
|
/** A rule that defines which bucket events trigger webhook notifications and where they are sent. */
|
|
48
73
|
export interface EventNotificationRule {
|
|
49
74
|
/** Event types that trigger this notification rule. */
|
|
@@ -69,7 +94,7 @@ export interface EventNotificationRule {
|
|
|
69
94
|
/** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */
|
|
70
95
|
readonly hmacSha256SigningSecret?: string;
|
|
71
96
|
/** Optional custom headers included in webhook requests. */
|
|
72
|
-
readonly customHeaders?:
|
|
97
|
+
readonly customHeaders?: readonly EventNotificationCustomHeader[];
|
|
73
98
|
};
|
|
74
99
|
}
|
|
75
100
|
/** Request parameters for the `b2_get_bucket_notification_rules` API call. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/types/notifications.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS;IACpB,oDAAoD;;IAEpD,8CAA8C;;IAE9C,6DAA6D;;IAE7D,6DAA6D;;IAE7D,wDAAwD;;IAExD,kDAAkD;;IAElD,oDAAoD;;IAEpD,oEAAoE;;IAEpE,iDAAiD;;CAEzC,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAA;AAElE,qGAAqG;AACrG,MAAM,WAAW,qBAAqB;IACpC,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAA;IACzC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IACnC,2DAA2D;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E;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAiC;IAChD,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,sBAAsB,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAClE;AAED,qGAAqG;AACrG,MAAM,MAAM,kCAAkC,GAAG,kCAAkC,CAAA"}
|
|
@@ -44,6 +44,31 @@ export declare const EventType: {
|
|
|
44
44
|
* B2 event types that can trigger notifications. Derived from {@link EventType}.
|
|
45
45
|
*/
|
|
46
46
|
export type EventType = (typeof EventType)[keyof typeof EventType];
|
|
47
|
+
/** A custom HTTP header included with event-notification webhook requests. */
|
|
48
|
+
export interface EventNotificationCustomHeader {
|
|
49
|
+
/** Header name. */
|
|
50
|
+
readonly name: string;
|
|
51
|
+
/** Header value. */
|
|
52
|
+
readonly value: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Convert B2's wire-shaped custom headers to a lookup record.
|
|
56
|
+
*
|
|
57
|
+
* Duplicate header names are represented by the last value in the array.
|
|
58
|
+
*
|
|
59
|
+
* @param customHeaders - Wire-shaped custom headers from an event-notification rule.
|
|
60
|
+
*
|
|
61
|
+
* @returns A name/value lookup record.
|
|
62
|
+
*/
|
|
63
|
+
export declare function notificationCustomHeadersToRecord(customHeaders: readonly EventNotificationCustomHeader[] | undefined): Record<string, string>;
|
|
64
|
+
/**
|
|
65
|
+
* Convert a lookup record to B2's wire-shaped custom headers.
|
|
66
|
+
*
|
|
67
|
+
* @param customHeaders - Name/value header lookup.
|
|
68
|
+
*
|
|
69
|
+
* @returns Wire-shaped custom headers for an event-notification rule.
|
|
70
|
+
*/
|
|
71
|
+
export declare function recordToNotificationCustomHeaders(customHeaders: Readonly<Record<string, string>> | undefined): EventNotificationCustomHeader[];
|
|
47
72
|
/** A rule that defines which bucket events trigger webhook notifications and where they are sent. */
|
|
48
73
|
export interface EventNotificationRule {
|
|
49
74
|
/** Event types that trigger this notification rule. */
|
|
@@ -69,7 +94,7 @@ export interface EventNotificationRule {
|
|
|
69
94
|
/** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */
|
|
70
95
|
readonly hmacSha256SigningSecret?: string;
|
|
71
96
|
/** Optional custom headers included in webhook requests. */
|
|
72
|
-
readonly customHeaders?:
|
|
97
|
+
readonly customHeaders?: readonly EventNotificationCustomHeader[];
|
|
73
98
|
};
|
|
74
99
|
}
|
|
75
100
|
/** Request parameters for the `b2_get_bucket_notification_rules` API call. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/types/notifications.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS;IACpB,oDAAoD;;IAEpD,8CAA8C;;IAE9C,6DAA6D;;IAE7D,6DAA6D;;IAE7D,wDAAwD;;IAExD,kDAAkD;;IAElD,oDAAoD;;IAEpD,oEAAoE;;IAEpE,iDAAiD;;CAEzC,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAA;AAElE,qGAAqG;AACrG,MAAM,WAAW,qBAAqB;IACpC,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAA;IACzC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IACnC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wGAAwG;IACxG,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,+DAA+D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IAChE,QAAQ,CAAC,sBAAsB,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAClE;AAED,qGAAqG;AACrG,MAAM,MAAM,kCAAkC,GAAG,kCAAkC,CAAA"}
|
|
@@ -40,7 +40,35 @@ var EventType = {
|
|
|
40
40
|
/** A version was removed by a lifecycle rule. */
|
|
41
41
|
ObjectDeletedLifecycleRule: "b2:ObjectDeleted:LifecycleRule"
|
|
42
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Convert B2's wire-shaped custom headers to a lookup record.
|
|
45
|
+
*
|
|
46
|
+
* Duplicate header names are represented by the last value in the array.
|
|
47
|
+
*
|
|
48
|
+
* @param customHeaders - Wire-shaped custom headers from an event-notification rule.
|
|
49
|
+
*
|
|
50
|
+
* @returns A name/value lookup record.
|
|
51
|
+
*/
|
|
52
|
+
function notificationCustomHeadersToRecord(customHeaders) {
|
|
53
|
+
const record = Object.create(null);
|
|
54
|
+
for (const { name, value } of customHeaders ?? []) record[name] = value;
|
|
55
|
+
return record;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Convert a lookup record to B2's wire-shaped custom headers.
|
|
59
|
+
*
|
|
60
|
+
* @param customHeaders - Name/value header lookup.
|
|
61
|
+
*
|
|
62
|
+
* @returns Wire-shaped custom headers for an event-notification rule.
|
|
63
|
+
*/
|
|
64
|
+
function recordToNotificationCustomHeaders(customHeaders) {
|
|
65
|
+
if (customHeaders === void 0) return [];
|
|
66
|
+
return Object.entries(customHeaders).map(([name, value]) => ({
|
|
67
|
+
name,
|
|
68
|
+
value
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
43
71
|
//#endregion
|
|
44
|
-
export { EventType };
|
|
72
|
+
export { EventType, notificationCustomHeadersToRecord, recordToNotificationCustomHeaders };
|
|
45
73
|
|
|
46
74
|
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +1 @@
|
|
|
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: 'webhook', 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 /** Maximum number of events B2 may include in a single webhook request. */\n readonly maxEventsPerBatch?: number\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 (`'webhook'` for webhook delivery). */\n readonly targetType: 'webhook'\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?:
|
|
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: 'webhook', 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 custom HTTP header included with event-notification webhook requests. */\nexport interface EventNotificationCustomHeader {\n /** Header name. */\n readonly name: string\n /** Header value. */\n readonly value: string\n}\n\n/**\n * Convert B2's wire-shaped custom headers to a lookup record.\n *\n * Duplicate header names are represented by the last value in the array.\n *\n * @param customHeaders - Wire-shaped custom headers from an event-notification rule.\n *\n * @returns A name/value lookup record.\n */\nexport function notificationCustomHeadersToRecord(\n customHeaders: readonly EventNotificationCustomHeader[] | undefined,\n): Record<string, string> {\n const record = Object.create(null) as Record<string, string>\n for (const { name, value } of customHeaders ?? []) {\n record[name] = value\n }\n return record\n}\n\n/**\n * Convert a lookup record to B2's wire-shaped custom headers.\n *\n * @param customHeaders - Name/value header lookup.\n *\n * @returns Wire-shaped custom headers for an event-notification rule.\n */\nexport function recordToNotificationCustomHeaders(\n customHeaders: Readonly<Record<string, string>> | undefined,\n): EventNotificationCustomHeader[] {\n if (customHeaders === undefined) return []\n return Object.entries(customHeaders).map(([name, value]) => ({ name, value }))\n}\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 /** Maximum number of events B2 may include in a single webhook request. */\n readonly maxEventsPerBatch?: number\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 (`'webhook'` for webhook delivery). */\n readonly targetType: 'webhook'\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?: readonly EventNotificationCustomHeader[]\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;;;;;;;;;;AAwBA,SAAgB,kCACd,eACwB;CACxB,MAAM,SAAS,OAAO,OAAO,IAAI;CACjC,KAAK,MAAM,EAAE,MAAM,WAAW,iBAAiB,CAAC,GAC9C,OAAO,QAAQ;CAEjB,OAAO;AACT;;;;;;;;AASA,SAAgB,kCACd,eACiC;CACjC,IAAI,kBAAkB,KAAA,GAAW,OAAO,CAAC;CACzC,OAAO,OAAO,QAAQ,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,YAAY;EAAE;EAAM;CAAM,EAAE;AAC/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partner.cjs","names":[],"sources":["../../src/types/partner.ts"],"sourcesContent":["import type { Capability } from './auth.ts'\nimport type { AccountId, ApplicationKeyId, BucketId, GroupId, PartnerToken } from './ids.ts'\n\nexport type { ComputerId, GroupId, PartnerToken } from './ids.ts'\nexport { computerId, groupId, partnerToken } from './ids.ts'\n\n/**\n * Named constants for Partner API and Computer Backup API capabilities.\n *\n * Partner grant sets are separate from the storage-facing capability set. The\n * Partner and Backup authorization surfaces currently document the full-access\n * grant as `all`.\n */\nexport const PartnerCapability = {\n /** Full Partner API or Computer Backup API access for the authorized key. */\n All: 'all',\n} as const\n\n/** Partner API or Computer Backup API capability derived from {@link PartnerCapability}. */\nexport type PartnerCapability = (typeof PartnerCapability)[keyof typeof PartnerCapability]\n\n/**\n * Named constants for Backblaze regions accepted by Partner API account-creation endpoints.\n */\nexport const Region = {\n /** US East region. */\n UsEast: 'us-east',\n /** US West region. */\n UsWest: 'us-west',\n /** Canada East region. */\n CaEast: 'ca-east',\n /** EU Central region. */\n EuCentral: 'eu-central',\n} as const\n\n/** Backblaze region identifier derived from {@link Region}. */\nexport type Region = (typeof Region)[keyof typeof Region]\n\n/** Partner API endpoint information returned by `b2_authorize_account`. */\nexport interface PartnerGroupsApiInfo {\n /** Capabilities granted for Partner API calls, currently documented as `['all']`. */\n readonly capabilities: readonly PartnerCapability[]\n /** Base URL for Partner API calls. */\n readonly groupsApiUrl: string\n /** Discriminator indicating this is Partner API information. */\n readonly infoType: 'groupsApi'\n}\n\n/** Computer Backup API endpoint information returned by `b2_authorize_account`. */\nexport interface PartnerBackupApiInfo {\n /** Capabilities granted for Computer Backup API calls, currently documented as `['all']`. */\n readonly capabilities: readonly PartnerCapability[]\n /** Base URL for Computer Backup API calls. */\n readonly backupApiUrl: string\n /** Discriminator indicating this is Computer Backup API information. */\n readonly infoType: 'backupApi'\n}\n\n/** Storage API endpoint information returned alongside Partner authorization details. */\nexport interface PartnerStorageApiInfo {\n /** Minimum allowed part size for large file uploads, in bytes. */\n readonly absoluteMinimumPartSize: number\n /** Base URL for B2 Native API calls. */\n readonly apiUrl: string\n /** Bucket ID this key is restricted to, or null if unrestricted. */\n readonly bucketId: BucketId | null\n /** Bucket name this key is restricted to, or null if unrestricted or unavailable. */\n readonly bucketName: string | null\n /** Storage API capabilities granted to this key. */\n readonly capabilities: readonly Capability[]\n /** Base URL for file downloads. */\n readonly downloadUrl: string\n /** Discriminator indicating this is storage API information. */\n readonly infoType: 'storageApi'\n /** File name prefix this key is restricted to, or null if unrestricted. */\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}\n\n/**\n * API-specific information needed by Partner and Computer Backup API clients.\n * At least one of `groupsApi` or `backupApi` is present in a normalized\n * Partner authorization response. Suite URLs and capabilities in this object\n * are the authoritative values; flattened fields on\n * {@link PartnerAuthorizeResponse} are convenience mirrors.\n */\nexport interface PartnerApiInfo {\n /** B2 Native API configuration returned with Partner authorization details when storage is enabled. */\n readonly storageApi?: PartnerStorageApiInfo\n /** Partner API configuration, present when the authorized account has Partner API access. */\n readonly groupsApi?: PartnerGroupsApiInfo\n /** Computer Backup API configuration, present when the authorized account has Backup API access. */\n readonly backupApi?: PartnerBackupApiInfo\n}\n\n/** Response from Partner-oriented `b2_authorize_account`. */\nexport interface PartnerAuthorizeResponse {\n /** Account ID for the authorized partner administrator. */\n readonly accountId: AccountId\n /** Authorization token to use for Partner API and Computer Backup API requests. Do not log this secret value. */\n readonly authorizationToken: PartnerToken\n /** Suite-shaped API information returned by `b2_authorize_account`; authoritative for suite URLs and capabilities. */\n readonly apiInfo: PartnerApiInfo\n /** Convenience mirror of `apiInfo.groupsApi.groupsApiUrl` when the Partner suite is enabled. */\n readonly groupsApiUrl?: string\n /** Convenience mirror of `apiInfo.backupApi.backupApiUrl` when the Backup suite is enabled. */\n readonly backupApiUrl?: string\n /** Convenience mirror of `apiInfo.groupsApi.capabilities` when the Partner suite is enabled. */\n readonly groupsCapabilities?: readonly PartnerCapability[]\n /** Convenience mirror of `apiInfo.backupApi.capabilities` when the Backup suite is enabled. */\n readonly backupCapabilities?: readonly PartnerCapability[]\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 `b2_create_group_member`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface CreateGroupMemberRequest {\n /** Account ID of the group administrator authorized for the Partner API. */\n readonly adminAccountId: AccountId\n /** Group ID that the new Backblaze account will join. */\n readonly groupId: GroupId\n /** Email address for the new group member account. */\n readonly memberEmail: string\n /** Region for the new account's data, or null to use the current default region. */\n readonly region?: Region | null\n}\n\n/**\n * Group member fields returned by Partner API membership operations.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerGroupMember {\n /** Account ID for the group member. Group member account IDs reuse the SDK's existing AccountId brand. */\n readonly accountId: AccountId\n /** Email address of the group member account. */\n readonly email: string\n /** Group ID that contains the member. */\n readonly groupId: GroupId\n /** Name of the group that contains the member. */\n readonly groupName: string\n /** Region where the group member account's data resides. */\n readonly region: Region\n /** S3-compatible endpoint domain for the group member account. */\n readonly s3Endpoint: string\n}\n\n/**\n * Single result element returned by `b2_create_group_member`.\n *\n * The `b2_create_group_member` wire response is a JSON array of these objects.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface CreateGroupMemberResult {\n /** Application key ID for the new group member account. */\n readonly applicationKeyId: ApplicationKeyId\n /** Application key secret for the new group member account. Do not log this secret value. */\n readonly applicationKey: string\n /** Newly created group member account details. */\n readonly groupMember: PartnerGroupMember\n}\n\n/**\n * Array-shaped wire response from `b2_create_group_member`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type CreateGroupMemberResponse = readonly CreateGroupMemberResult[]\n\n/**\n * Request parameters for `b2_eject_group_member`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface EjectGroupMemberRequest {\n /** Account ID of the group administrator authorized for the Partner API. */\n readonly adminAccountId: AccountId\n /** Group ID that currently contains the member. */\n readonly groupId: GroupId\n /** Account ID of the group member being ejected. */\n readonly memberAccountId: AccountId\n /** Replacement email for the ejected account, or null to keep the current email address. */\n readonly email?: string | null\n}\n\n/**\n * Single result element returned by `b2_eject_group_member`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type EjectGroupMemberResult = PartnerGroupMember\n\n/**\n * Single-object wire response from `b2_eject_group_member`.\n *\n * B2 returns one ejected-member object (not an array), unlike\n * `b2_create_group_member` which returns an array.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type EjectGroupMemberResponse = EjectGroupMemberResult\n\n/**\n * Request parameters for `b2_list_groups`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupsRequest {\n /** Account ID of the group administrator authorized for the Partner API. */\n readonly adminAccountId: AccountId\n /** Optional group name filter. Multiple groups may share the same name. */\n readonly groupName?: string\n /** Group ID to start listing from for pagination. */\n readonly startGroupId?: GroupId\n /** Maximum number of groups to return. The documented range is 1 through 100. */\n readonly maxGroupCount?: number\n}\n\n/**\n * B2 storage statistics returned for partner groups and group members.\n *\n * The Partner API currently returns count fields as JSON strings even though\n * they are numeric-looking values. The SDK preserves those decimal strings\n * instead of normalizing them to numbers.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerB2Stats {\n /** Total bytes stored as a decimal string. */\n readonly b2BytesStoredCount: string\n /** Total files stored as a decimal string. */\n readonly b2FilesStoredCount: string\n /** ISO 8601 UTC date-time string for the daily B2 statistics snapshot, or null if unavailable. */\n readonly b2StatsAsOfTimestamp: string | null\n /** Total bucket count as a decimal string. */\n readonly bucketCount: string\n}\n\n/**\n * Account standing information for a partner group.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerAccountStandingDetails {\n /** Account standing state reported by the Partner API. */\n readonly state: string\n}\n\n/**\n * Daily group statistics returned by `b2_list_groups`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerGroupStats {\n /** ISO 8601 UTC date-time string for when the group was created. */\n readonly createdTimestamp: string\n /** ISO 8601 UTC date-time string for the last update to the group's statistics. */\n readonly groupStatsAsOfTimestamp: string\n /** Total number of accepted members in the group. */\n readonly memberCount: number\n}\n\n/**\n * Group record returned by `b2_list_groups`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerGroup {\n /** Account standing information for the group. */\n readonly accountStandingDetails: PartnerAccountStandingDetails\n /** B2 storage statistics for the group. Count fields are preserved as decimal strings. */\n readonly b2Stats: PartnerB2Stats\n /** Unique ID of the group. */\n readonly groupId: GroupId\n /** Human-readable group name. */\n readonly groupName: string\n /** Products enabled for the group, such as `BACKUP` or `STORAGE`. */\n readonly groupProducts: readonly string[]\n /** Daily aggregate statistics for the group. */\n readonly groupStats: PartnerGroupStats\n}\n\n/**\n * Single result element returned by `b2_list_groups`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupsResult {\n /** Account ID for the group administrator whose groups were listed. */\n readonly accountId: AccountId\n /** Groups matching the request. */\n readonly groups: readonly PartnerGroup[]\n /** Next group ID to use for pagination, or null if all groups have been listed. */\n readonly nextGroupId: GroupId | null\n}\n\n/**\n * Single-object wire response from `b2_list_groups`.\n *\n * B2 returns one object with `accountId`, `groups`, and the `nextGroupId`\n * cursor (not an array), unlike `b2_list_group_members` which returns an array.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type ListGroupsResponse = ListGroupsResult\n\n/**\n * Request parameters for `b2_list_group_members`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupMembersRequest {\n /** Account ID of the group administrator authorized for the Partner API. */\n readonly adminAccountId: AccountId\n /** Group ID whose active members should be listed. */\n readonly groupId: GroupId\n /** First member email address to return for pagination. */\n readonly startEmail?: string\n /** Maximum number of group members to return. The documented maximum is 1000. */\n readonly maxMemberCount?: number\n}\n\n/**\n * Group member record returned by `b2_list_group_members`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListedGroupMember extends PartnerGroupMember {\n /** B2 storage statistics for the member. Count fields are preserved as decimal strings. */\n readonly b2Stats: PartnerB2Stats\n}\n\n/**\n * Single result element returned by `b2_list_group_members`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupMembersResult {\n /** Group ID whose members were listed. */\n readonly groupId: GroupId\n /** Human-readable group name. */\n readonly groupName: string\n /** Next email address to use for pagination, or null if all members have been listed. */\n readonly nextEmail: string | null\n /** Active accepted group members matching the request. */\n readonly groupMembers: readonly ListedGroupMember[]\n}\n\n/**\n * Array-shaped wire response from `b2_list_group_members`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type ListGroupMembersResponse = readonly ListGroupMembersResult[]\n\n/**\n * Single request element accepted by `b2_reserve_trial_create_account`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ReserveTrialCreateAccountRequestEntry {\n /** Email address for the new B2 reserve trial account. */\n readonly email: string\n /** Region for the new account's data, or null to let Backblaze choose. */\n readonly region?: Region | null\n /** Trial duration in days. The documented range is 7 through 30. */\n readonly term: number\n /** Trial storage amount in TB. The documented range is 1 through 50. */\n readonly storage: number\n}\n\n/**\n * Array-shaped wire request body for `b2_reserve_trial_create_account`.\n * The Partner API requires at least one request entry per call.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type ReserveTrialCreateAccountRequest = readonly [\n ReserveTrialCreateAccountRequestEntry,\n ...ReserveTrialCreateAccountRequestEntry[],\n]\n\n/**\n * Single result element returned by `b2_reserve_trial_create_account`.\n *\n * The `b2_reserve_trial_create_account` wire response is a JSON array of\n * these objects.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ReserveTrialCreateAccountResult {\n /** Account ID of the newly created B2 reserve trial account. */\n readonly accountId: AccountId\n /** Application key secret for the new account. Do not log this secret value. */\n readonly applicationKey: string\n /** Application key ID for the new account. */\n readonly applicationKeyId: ApplicationKeyId\n /** S3-compatible endpoint domain for the new account. */\n readonly s3Endpoint: string\n /** Trial start date in ISO 8601 `yyyy-MM-dd` format in UTC. */\n readonly startDate: string\n /** Trial end date in ISO 8601 `yyyy-MM-dd` format in UTC. */\n readonly endDate: string\n /** Email address for the new B2 reserve trial account. */\n readonly email: string\n /** Bucket name accessible with the returned application key. */\n readonly bucketName: string\n /** Bucket ID accessible with the returned application key. */\n readonly bucketId: BucketId\n}\n\n/**\n * Array-shaped wire response from `b2_reserve_trial_create_account`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type ReserveTrialCreateAccountResponse = readonly ReserveTrialCreateAccountResult[]\n"],"mappings":";;;;;;;;;AAaA,IAAa,oBAAoB;;AAE/B,KAAK,MACP;;;;AAQA,IAAa,SAAS;;CAEpB,QAAQ;;CAER,QAAQ;;CAER,QAAQ;;CAER,WAAW;AACb"}
|
|
1
|
+
{"version":3,"file":"partner.cjs","names":[],"sources":["../../src/types/partner.ts"],"sourcesContent":["import type { Capability } from './auth.ts'\nimport type { AccountId, ApplicationKeyId, BucketId, GroupId, PartnerToken } from './ids.ts'\n\nexport type { ComputerId, GroupId, PartnerToken } from './ids.ts'\nexport { computerId, groupId, partnerToken } from './ids.ts'\n\n/**\n * Named constants for Partner API and Computer Backup API capabilities.\n *\n * Partner grant sets are separate from the storage-facing capability set. The\n * Partner and Backup authorization surfaces currently document the full-access\n * grant as `all`.\n */\nexport const PartnerCapability = {\n /** Full Partner API or Computer Backup API access for the authorized key. */\n All: 'all',\n} as const\n\n/** Partner API or Computer Backup API capability derived from {@link PartnerCapability}. */\nexport type PartnerCapability = (typeof PartnerCapability)[keyof typeof PartnerCapability]\n\n/**\n * Named constants for Backblaze regions accepted by Partner API account-creation endpoints.\n */\nexport const Region = {\n /** US East region. */\n UsEast: 'us-east',\n /** US West region. */\n UsWest: 'us-west',\n /** Canada East region. */\n CaEast: 'ca-east',\n /** EU Central region. */\n EuCentral: 'eu-central',\n} as const\n\n/** Backblaze region identifier derived from {@link Region}. */\nexport type Region = (typeof Region)[keyof typeof Region]\n\n/** Partner API endpoint information returned by `b2_authorize_account`. */\nexport interface PartnerGroupsApiInfo {\n /** Capabilities granted for Partner API calls, currently documented as `['all']`. */\n readonly capabilities: readonly PartnerCapability[]\n /** Base URL for Partner API calls. */\n readonly groupsApiUrl: string\n /** Discriminator indicating this is Partner API information. */\n readonly infoType: 'groupsApi'\n}\n\n/** Computer Backup API endpoint information returned by `b2_authorize_account`. */\nexport interface PartnerBackupApiInfo {\n /** Capabilities granted for Computer Backup API calls, currently documented as `['all']`. */\n readonly capabilities: readonly PartnerCapability[]\n /** Base URL for Computer Backup API calls. */\n readonly backupApiUrl: string\n /** Discriminator indicating this is Computer Backup API information. */\n readonly infoType: 'backupApi'\n}\n\n/** Storage API endpoint information returned alongside Partner authorization details. */\nexport interface PartnerStorageApiInfo {\n /** Minimum allowed part size for large file uploads, in bytes. */\n readonly absoluteMinimumPartSize: number\n /** Base URL for B2 Native API calls. */\n readonly apiUrl: string\n /** Bucket ID this key is restricted to, or null if unrestricted. */\n readonly bucketId: BucketId | null\n /** Bucket name this key is restricted to, or null if unrestricted or unavailable. */\n readonly bucketName: string | null\n /** Storage API capabilities granted to this key. */\n readonly capabilities: readonly Capability[]\n /** Base URL for file downloads. */\n readonly downloadUrl: string\n /** Discriminator indicating this is storage API information. */\n readonly infoType: 'storageApi'\n /** File name prefix this key is restricted to, or null if unrestricted. */\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}\n\n/**\n * API-specific information needed by Partner and Computer Backup API clients.\n * At least one of `groupsApi` or `backupApi` is present in a normalized\n * Partner authorization response. Suite URLs and capabilities in this object\n * are the authoritative values; flattened fields on\n * {@link PartnerAuthorizeResponse} are convenience mirrors.\n */\nexport interface PartnerApiInfo {\n /** B2 Native API configuration returned with Partner authorization details when storage is enabled. */\n readonly storageApi?: PartnerStorageApiInfo\n /** Partner API configuration, present when the authorized account has Partner API access. */\n readonly groupsApi?: PartnerGroupsApiInfo\n /** Computer Backup API configuration, present when the authorized account has Backup API access. */\n readonly backupApi?: PartnerBackupApiInfo\n}\n\n/** Response from Partner-oriented `b2_authorize_account`. */\nexport interface PartnerAuthorizeResponse {\n /** Account ID for the authorized partner administrator. */\n readonly accountId: AccountId\n /** Authorization token to use for Partner API and Computer Backup API requests. Do not log this secret value. */\n readonly authorizationToken: PartnerToken\n /** Suite-shaped API information returned by `b2_authorize_account`; authoritative for suite URLs and capabilities. */\n readonly apiInfo: PartnerApiInfo\n /** Convenience mirror of `apiInfo.groupsApi.groupsApiUrl` when the Partner suite is enabled. */\n readonly groupsApiUrl?: string\n /** Convenience mirror of `apiInfo.backupApi.backupApiUrl` when the Backup suite is enabled. */\n readonly backupApiUrl?: string\n /** Convenience mirror of `apiInfo.groupsApi.capabilities` when the Partner suite is enabled. */\n readonly groupsCapabilities?: readonly PartnerCapability[]\n /** Convenience mirror of `apiInfo.backupApi.capabilities` when the Backup suite is enabled. */\n readonly backupCapabilities?: readonly PartnerCapability[]\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 `b2_create_group_member`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface CreateGroupMemberRequest {\n /** Account ID of the group administrator authorized for the Partner API. */\n readonly adminAccountId: AccountId\n /** Group ID that the new Backblaze account will join. */\n readonly groupId: GroupId\n /** Email address for the new group member account. */\n readonly memberEmail: string\n /** Region for the new account's data, or null to use the current default region. */\n readonly region?: Region | null\n}\n\n/**\n * Group member fields returned by Partner API membership operations.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerGroupMember {\n /** Account ID for the group member. Group member account IDs reuse the SDK's existing AccountId brand. */\n readonly accountId: AccountId\n /** Email address of the group member account. */\n readonly email: string\n /** Group ID that contains the member. */\n readonly groupId: GroupId\n /** Name of the group that contains the member. */\n readonly groupName: string\n /** Region where the group member account's data resides. */\n readonly region: Region\n /** S3-compatible endpoint domain for the group member account. */\n readonly s3Endpoint: string\n}\n\n/**\n * Single result element returned by `b2_create_group_member`.\n *\n * The `b2_create_group_member` wire response is one JSON object.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface CreateGroupMemberResult {\n /** Application key ID for the new group member account. */\n readonly applicationKeyId: ApplicationKeyId\n /** Application key secret for the new group member account. Do not log this secret value. */\n readonly applicationKey: string\n /** Newly created group member account details. */\n readonly groupMember: PartnerGroupMember\n}\n\n/**\n * Single-object wire response from `b2_create_group_member`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type CreateGroupMemberResponse = CreateGroupMemberResult\n\n/**\n * Request parameters for `b2_eject_group_member`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface EjectGroupMemberRequest {\n /** Account ID of the group administrator authorized for the Partner API. */\n readonly adminAccountId: AccountId\n /** Group ID that currently contains the member. */\n readonly groupId: GroupId\n /** Account ID of the group member being ejected. */\n readonly memberAccountId: AccountId\n /** Replacement email for the ejected account, or null to keep the current email address. */\n readonly email?: string | null\n}\n\n/**\n * Single result element returned by `b2_eject_group_member`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type EjectGroupMemberResult = PartnerGroupMember\n\n/**\n * Single-object wire response from `b2_eject_group_member`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type EjectGroupMemberResponse = EjectGroupMemberResult\n\n/**\n * Request parameters for `b2_list_groups`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupsRequest {\n /** Account ID of the group administrator authorized for the Partner API. */\n readonly adminAccountId: AccountId\n /** Optional group name filter. Multiple groups may share the same name. */\n readonly groupName?: string\n /** Group ID to start listing from for pagination. */\n readonly startGroupId?: GroupId\n /** Maximum number of groups to return. The documented range is 1 through 100. */\n readonly maxGroupCount?: number\n}\n\n/**\n * B2 storage statistics returned for partner groups and group members.\n *\n * Live `b2_list_groups` and `b2_list_group_members` responses return the count\n * fields as JSON numbers (matching the Partner docs), and the daily-snapshot\n * timestamp as a B2 `dYYYYMMDD_mHHMMSS` string.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerB2Stats {\n /** Total bytes stored, as an integer count. */\n readonly b2BytesStoredCount: number\n /** Total files stored, as an integer count. */\n readonly b2FilesStoredCount: number\n /** B2 `dYYYYMMDD_mHHMMSS` UTC timestamp for the daily B2 statistics snapshot, or null if unavailable. */\n readonly b2StatsAsOfTimestamp: string | null\n /** Total bucket count, as an integer count. */\n readonly bucketCount: number\n}\n\n/**\n * Account standing information for a partner group.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerAccountStandingDetails {\n /** Account standing state reported by the Partner API. */\n readonly state: string\n}\n\n/**\n * Daily group statistics returned by `b2_list_groups`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerGroupStats {\n /** B2 `dYYYYMMDD_mHHMMSS` UTC timestamp for when the group was created. */\n readonly createdTimestamp: string\n /** B2 `dYYYYMMDD_mHHMMSS` UTC timestamp for the last update to the group's statistics. */\n readonly groupStatsAsOfTimestamp: string\n /** Total number of accepted members in the group. */\n readonly memberCount: number\n}\n\n/**\n * Group record returned by `b2_list_groups`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerGroup {\n /** Account standing information for the group. */\n readonly accountStandingDetails: PartnerAccountStandingDetails\n /** B2 storage statistics for the group. Count fields are integer numbers. */\n readonly b2Stats: PartnerB2Stats\n /** Unique ID of the group. */\n readonly groupId: GroupId\n /** Human-readable group name. */\n readonly groupName: string\n /** Products enabled for the group, such as `BACKUP` or `STORAGE`. */\n readonly groupProducts: readonly string[]\n /** Daily aggregate statistics for the group. */\n readonly groupStats: PartnerGroupStats\n}\n\n/**\n * Single result element returned by `b2_list_groups`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupsResult {\n /** Account ID for the group administrator whose groups were listed. */\n readonly accountId: AccountId\n /** Groups matching the request. */\n readonly groups: readonly PartnerGroup[]\n /** Next group ID to use for pagination, or null if all groups have been listed. */\n readonly nextGroupId: GroupId | null\n}\n\n/**\n * Single-object wire response from `b2_list_groups`.\n *\n * B2 returns one object with `accountId`, `groups`, and the `nextGroupId`\n * cursor, not an array. `b2_list_group_members` is likewise a single object.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type ListGroupsResponse = ListGroupsResult\n\n/**\n * Request parameters for `b2_list_group_members`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupMembersRequest {\n /** Account ID of the group administrator authorized for the Partner API. */\n readonly adminAccountId: AccountId\n /** Group ID whose active members should be listed. */\n readonly groupId: GroupId\n /** First member email address to return for pagination. */\n readonly startEmail?: string\n /** Maximum number of group members to return. The documented maximum is 1000. */\n readonly maxMemberCount?: number\n}\n\n/**\n * Group member record returned by `b2_list_group_members`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListedGroupMember extends PartnerGroupMember {\n /** B2 storage statistics for the member. Count fields are integer numbers. */\n readonly b2Stats: PartnerB2Stats\n}\n\n/**\n * One page of members for a group, returned by `b2_list_group_members`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupMembersResult {\n /** Group ID whose members were listed. */\n readonly groupId: GroupId\n /** Human-readable group name. */\n readonly groupName: string\n /** Next email address to use for pagination, or null if all members have been listed. */\n readonly nextEmail: string | null\n /** Active accepted group members matching the request. */\n readonly groupMembers: readonly ListedGroupMember[]\n}\n\n/**\n * Single-object wire response from `b2_list_group_members`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type ListGroupMembersResponse = ListGroupMembersResult\n\n/**\n * Request body accepted by `b2_reserve_trial_create_account`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ReserveTrialCreateAccountRequest {\n /** Email address for the new B2 reserve trial account. */\n readonly email: string\n /** Region for the new account's data, or null to let Backblaze choose. */\n readonly region?: Region | null\n /** Trial duration in days. The documented range is 7 through 30. */\n readonly term: number\n /** Trial storage amount in TB. The documented range is 1 through 50. */\n readonly storage: number\n}\n\n/**\n * Request element type for caller-managed batches of single-account requests.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type ReserveTrialCreateAccountRequestEntry = ReserveTrialCreateAccountRequest\n\n/**\n * Single result element returned by `b2_reserve_trial_create_account`.\n *\n * The `b2_reserve_trial_create_account` wire response is one JSON object.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ReserveTrialCreateAccountResult {\n /** Account ID of the newly created B2 reserve trial account. */\n readonly accountId: AccountId\n /** Application key secret for the new account. Do not log this secret value. */\n readonly applicationKey: string\n /** Application key ID for the new account. */\n readonly applicationKeyId: ApplicationKeyId\n /** S3-compatible endpoint domain for the new account. */\n readonly s3Endpoint: string\n /** Trial start date in ISO 8601 `yyyy-MM-dd` format in UTC. */\n readonly startDate: string\n /** Trial end date in ISO 8601 `yyyy-MM-dd` format in UTC. */\n readonly endDate: string\n /** Email address for the new B2 reserve trial account. */\n readonly email: string\n /** Bucket name accessible with the returned application key. */\n readonly bucketName: string\n /** Bucket ID accessible with the returned application key. */\n readonly bucketId: BucketId\n}\n\n/**\n * Single-object wire response from `b2_reserve_trial_create_account`.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type ReserveTrialCreateAccountResponse = ReserveTrialCreateAccountResult\n"],"mappings":";;;;;;;;;AAaA,IAAa,oBAAoB;;AAE/B,KAAK,MACP;;;;AAQA,IAAa,SAAS;;CAEpB,QAAQ;;CAER,QAAQ;;CAER,QAAQ;;CAER,WAAW;AACb"}
|