@distilled.cloud/cloudflare 1.0.0-rc.4 → 1.0.0-rc.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/cloudflare",
3
- "version": "1.0.0-rc.4",
3
+ "version": "1.0.0-rc.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -498,6 +498,17 @@
498
498
  "default": "./lib/services/*.js"
499
499
  }
500
500
  },
501
+ "dependencies": {
502
+ "@distilled.cloud/core": "1.0.0-rc.6"
503
+ },
504
+ "devDependencies": {
505
+ "@types/bun": "latest",
506
+ "@types/node": "latest",
507
+ "@effect/platform-bun": ">=4.0.0-rc.110 || >=4.0.0"
508
+ },
509
+ "peerDependencies": {
510
+ "effect": ">=4.0.0-rc.110 || >=4.0.0"
511
+ },
501
512
  "scripts": {
502
513
  "build": "tsc -b",
503
514
  "download-api-docs": "bun scripts/download-api-docs.ts",
@@ -506,16 +517,5 @@
506
517
  "generate": "bun scripts/generate.ts",
507
518
  "typecheck": "tsc -p tsconfig.json",
508
519
  "typecheck:strict": "tsc -p tsconfig.strict.json"
509
- },
510
- "dependencies": {
511
- "@distilled.cloud/core": "1.0.0-rc.4"
512
- },
513
- "devDependencies": {
514
- "@types/bun": "latest",
515
- "@types/node": "latest",
516
- "@effect/platform-bun": ">=4.0.0-beta.104 || >=4.0.0"
517
- },
518
- "peerDependencies": {
519
- "effect": ">=4.0.0-beta.104 || >=4.0.0"
520
520
  }
521
- }
521
+ }
@@ -35,6 +35,15 @@ export class BucketAlreadyExists
35
35
  [{ code: 10004 }],
36
36
  ) {}
37
37
 
38
+ export class BucketNotEmpty
39
+ extends /*@__PURE__*/ T.applyErrorMatchers(
40
+ /*@__PURE__*/ S.TaggedError<BucketNotEmpty>()("BucketNotEmpty", {
41
+ code: S.Number,
42
+ message: S.String,
43
+ }),
44
+ [{ status: 409, message: { includes: "is not empty" } }],
45
+ ) {}
46
+
38
47
  export class BucketNotFound
39
48
  extends /*@__PURE__*/ T.applyErrorMatchers(
40
49
  /*@__PURE__*/ S.TaggedError<BucketNotFound>()("BucketNotFound", {
@@ -182,7 +191,10 @@ export class NoSuchKey
182
191
  code: S.Number,
183
192
  message: S.String,
184
193
  }),
185
- [{ status: 404, message: { includes: "specified key does not exist" } }],
194
+ [
195
+ { status: 404, message: { includes: "specified key does not exist" } },
196
+ { code: 10007 },
197
+ ],
186
198
  ) {}
187
199
 
188
200
  export class QueueNotFound
@@ -5088,6 +5100,7 @@ export const createTemporaryCredential: API.OperationMethod<
5088
5100
 
5089
5101
  export type DeleteBucketError =
5090
5102
  | NoSuchBucket
5103
+ | BucketNotEmpty
5091
5104
  | InvalidRoute
5092
5105
  | NoRoute
5093
5106
  | CloudflareOpError;
@@ -5102,6 +5115,7 @@ export const deleteBucket: API.OperationMethod<
5102
5115
  output: DeleteBucketResponse,
5103
5116
  errors: [
5104
5117
  NoSuchBucket,
5118
+ BucketNotEmpty,
5105
5119
  InvalidRoute,
5106
5120
  NoRoute,
5107
5121
  CloudflareRateLimited,
@@ -5179,7 +5193,10 @@ export const deleteBucketEventNotification: API.OperationMethod<
5179
5193
  retry: Retry.Retry,
5180
5194
  }));
5181
5195
 
5182
- export type DeleteBucketObjectError = CloudflareOpError;
5196
+ export type DeleteBucketObjectError =
5197
+ | NoSuchBucket
5198
+ | NoSuchKey
5199
+ | CloudflareOpError;
5183
5200
  /** Deletes an object from an R2 bucket. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead. */
5184
5201
  export const deleteBucketObject: API.OperationMethod<
5185
5202
  DeleteBucketObjectRequest,
@@ -5189,7 +5206,7 @@ export const deleteBucketObject: API.OperationMethod<
5189
5206
  > = /*@__PURE__*/ API.make(() => ({
5190
5207
  input: DeleteBucketObjectRequest,
5191
5208
  output: DeleteBucketObjectResponse,
5192
- errors: [CloudflareRateLimited, CloudflareError],
5209
+ errors: [NoSuchBucket, NoSuchKey, CloudflareRateLimited, CloudflareError],
5193
5210
  protocol: CloudflareProtocol,
5194
5211
  retry: Retry.Retry,
5195
5212
  }));
@@ -5511,7 +5528,7 @@ export const listBucketMetrics: API.OperationMethod<
5511
5528
  retry: Retry.Retry,
5512
5529
  }));
5513
5530
 
5514
- export type ListBucketObjectsError = CloudflareOpError;
5531
+ export type ListBucketObjectsError = NoSuchBucket | CloudflareOpError;
5515
5532
  /** Lists objects in an R2 bucket. Returns object metadata including key, size, etag, last modified date, HTTP metadata, and custom metadata. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead. */
5516
5533
  export const listBucketObjects: API.PaginatedOperationMethod<
5517
5534
  ListBucketObjectsRequest,
@@ -5523,7 +5540,7 @@ export const listBucketObjects: API.PaginatedOperationMethod<
5523
5540
  () => ({
5524
5541
  input: ListBucketObjectsRequest,
5525
5542
  output: ListBucketObjectsResponse,
5526
- errors: [CloudflareRateLimited, CloudflareError],
5543
+ errors: [NoSuchBucket, CloudflareRateLimited, CloudflareError],
5527
5544
  protocol: CloudflarePaginatedProtocol,
5528
5545
  retry: Retry.Retry,
5529
5546
  pagination: {
@@ -5821,7 +5838,7 @@ export const updateBucketDomainCustom: API.OperationMethod<
5821
5838
  retry: Retry.Retry,
5822
5839
  }));
5823
5840
 
5824
- export type UploadBucketObjectError = CloudflareOpError;
5841
+ export type UploadBucketObjectError = NoSuchBucket | CloudflareOpError;
5825
5842
  /** Uploads an object to an R2 bucket. The object body is provided as the request body. Returns metadata about the uploaded object. The maximum upload size for this endpoint is 300 MB. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead. */
5826
5843
  export const uploadBucketObject: API.OperationMethod<
5827
5844
  UploadBucketObjectRequest,
@@ -5831,7 +5848,7 @@ export const uploadBucketObject: API.OperationMethod<
5831
5848
  > = /*@__PURE__*/ API.make(() => ({
5832
5849
  input: UploadBucketObjectRequest,
5833
5850
  output: UploadBucketObjectResponse,
5834
- errors: [CloudflareRateLimited, CloudflareError],
5851
+ errors: [NoSuchBucket, CloudflareRateLimited, CloudflareError],
5835
5852
  protocol: CloudflareProtocol,
5836
5853
  retry: Retry.Retry,
5837
5854
  }));