@distilled.cloud/cloudflare 1.0.0-rc.11 → 1.0.0-rc.13

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.
Files changed (50) hide show
  1. package/README.md +37 -0
  2. package/lib/index.d.ts +1 -1
  3. package/lib/index.d.ts.map +1 -1
  4. package/lib/index.js +1 -1
  5. package/lib/index.js.map +1 -1
  6. package/lib/protocol.d.ts +2 -2
  7. package/lib/protocol.d.ts.map +1 -1
  8. package/lib/protocol.js +13 -6
  9. package/lib/protocol.js.map +1 -1
  10. package/lib/response-validation.test.d.ts +6 -0
  11. package/lib/response-validation.test.d.ts.map +1 -0
  12. package/lib/response-validation.test.js +45 -0
  13. package/lib/response-validation.test.js.map +1 -0
  14. package/lib/services/dns.d.ts +8 -2
  15. package/lib/services/dns.d.ts.map +1 -1
  16. package/lib/services/dns.js +8 -2
  17. package/lib/services/dns.js.map +1 -1
  18. package/lib/services/queues.d.ts +7 -1
  19. package/lib/services/queues.d.ts.map +1 -1
  20. package/lib/services/queues.js +12 -0
  21. package/lib/services/queues.js.map +1 -1
  22. package/lib/services/r2.d.ts +17 -5
  23. package/lib/services/r2.d.ts.map +1 -1
  24. package/lib/services/r2.js +42 -5
  25. package/lib/services/r2.js.map +1 -1
  26. package/lib/services/workers.d.ts +7 -1
  27. package/lib/services/workers.d.ts.map +1 -1
  28. package/lib/services/workers.js +12 -1
  29. package/lib/services/workers.js.map +1 -1
  30. package/lib/services/workers_for_platforms.d.ts +533 -12
  31. package/lib/services/workers_for_platforms.d.ts.map +1 -1
  32. package/lib/services/workers_for_platforms.js +708 -1029
  33. package/lib/services/workers_for_platforms.js.map +1 -1
  34. package/lib/services/zero_trust.d.ts +26 -6
  35. package/lib/services/zero_trust.d.ts.map +1 -1
  36. package/lib/services/zero_trust.js +53 -6
  37. package/lib/services/zero_trust.js.map +1 -1
  38. package/lib/traits.d.ts +1 -1
  39. package/lib/traits.d.ts.map +1 -1
  40. package/package.json +4 -4
  41. package/src/index.ts +1 -1
  42. package/src/protocol.ts +28 -9
  43. package/src/response-validation.test.ts +67 -0
  44. package/src/services/dns.ts +13 -4
  45. package/src/services/queues.ts +19 -0
  46. package/src/services/r2.ts +69 -10
  47. package/src/services/workers.ts +22 -2
  48. package/src/services/workers_for_platforms.ts +1625 -1072
  49. package/src/services/zero_trust.ts +85 -12
  50. package/src/traits.ts +1 -1
package/lib/traits.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type * as HttpClientError from "effect/unstable/http/HttpClientError";
1
+ import type * as HttpClientError from "effect/http/HttpClientError";
2
2
  import type * as Stream from "effect/Stream";
3
3
  export { Body, Header, Query, DeepQuery, Label, Http, ResponseCode, HttpBody, FormDataFile, StringEncoded, KeyDictionary, UnionCases, applyErrorMatchers, getErrorMatchers, type HttpTrait, type ErrorMatcher, bodySymbol, headerSymbol, querySymbol, deepQuerySymbol, labelSymbol, httpSymbol, responseCodeSymbol, httpBodySymbol, formDataFileSymbol, stringEncodedSymbol, keyDictionarySymbol, unionCasesSymbol, errorMatchersSymbol, } from "@distilled.cloud/core/trait";
4
4
  export declare const envelopePayloadRootSymbol: unique symbol;
@@ -1 +1 @@
1
- {"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,KAAK,eAAe,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,SAAS,EACT,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAMrC,eAAO,MAAM,yBAAyB,eAErC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,wDACiB,CAAC;AAElD,eAAO,MAAM,gBAAgB,eAE5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,wDAA+C,CAAC;AAEvE,eAAO,MAAM,qBAAqB,eAEjC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,wDACiB,CAAC;AAE9C,eAAO,MAAM,wBAAwB,eAEpC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,wDACiB,CAAC;AAEjD,sDAAsD;AACtD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAC5C,UAAU,EACV,eAAe,CAAC,eAAe,CAChC,CAAC"}
1
+ {"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,SAAS,EACT,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAMrC,eAAO,MAAM,yBAAyB,eAErC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,wDACiB,CAAC;AAElD,eAAO,MAAM,gBAAgB,eAE5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,wDAA+C,CAAC;AAEvE,eAAO,MAAM,qBAAqB,eAEjC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,wDACiB,CAAC;AAE9C,eAAO,MAAM,wBAAwB,eAEpC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,wDACiB,CAAC;AAEjD,sDAAsD;AACtD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAC5C,UAAU,EACV,eAAe,CAAC,eAAe,CAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/cloudflare",
3
- "version": "1.0.0-rc.11",
3
+ "version": "1.0.0-rc.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -513,15 +513,15 @@
513
513
  }
514
514
  },
515
515
  "dependencies": {
516
- "@distilled.cloud/core": "1.0.0-rc.11"
516
+ "@distilled.cloud/core": "1.0.0-rc.13"
517
517
  },
518
518
  "devDependencies": {
519
519
  "@types/bun": "1.3.14",
520
520
  "@types/node": "26.2.0",
521
- "@effect/platform-bun": ">=4.0.0-rc.115 || >=4.0.0"
521
+ "@effect/platform-bun": "^4.0.0"
522
522
  },
523
523
  "peerDependencies": {
524
- "effect": ">=4.0.0-rc.115 || >=4.0.0"
524
+ "effect": "^4.0.0"
525
525
  },
526
526
  "scripts": {
527
527
  "build": "tsc -b",
package/src/index.ts CHANGED
@@ -15,4 +15,4 @@ export {
15
15
  } from "./protocol.ts";
16
16
  export { cloudflarePaginate, ResultInfo } from "./pagination.ts";
17
17
  export * as Retry from "./retry.ts";
18
- export * as Services from "./services/index.ts";
18
+ export * from "./services/index.ts";
package/src/protocol.ts CHANGED
@@ -24,10 +24,10 @@
24
24
  import * as Effect from "effect/Effect";
25
25
  import * as Layer from "effect/Layer";
26
26
  import type * as AST from "effect/SchemaAST";
27
- import type * as HttpClient from "effect/unstable/http/HttpClient";
28
- import type * as HttpClientError from "effect/unstable/http/HttpClientError";
29
- import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
30
- import type * as HttpClientResponse from "effect/unstable/http/HttpClientResponse";
27
+ import type * as HttpClient from "effect/http/HttpClient";
28
+ import type * as HttpClientError from "effect/http/HttpClientError";
29
+ import type * as HttpClientRequest from "effect/http/HttpClientRequest";
30
+ import type * as HttpClientResponse from "effect/http/HttpClientResponse";
31
31
  import * as API from "@distilled.cloud/core/api";
32
32
  import {
33
33
  bodySymbol,
@@ -54,6 +54,7 @@ import {
54
54
  TooManyRequests,
55
55
  Unauthorized,
56
56
  } from "@distilled.cloud/core/errors";
57
+ import { validateResponse } from "@distilled.cloud/core/response-validation";
57
58
  import {
58
59
  parseRetryAfterForStatus,
59
60
  parseServerRetryHint,
@@ -67,6 +68,7 @@ import {
67
68
  import {
68
69
  type CloudflareError,
69
70
  CloudflareHttpError,
71
+ CloudflareParseError,
70
72
  type CloudflareRateLimited,
71
73
  type DefaultErrors,
72
74
  InvalidRoute,
@@ -389,9 +391,12 @@ const makeDecode =
389
391
  isTransientAuthBlip ? tagRetryable(error) : error;
390
392
 
391
393
  // 1. Per-operation typed error (matcher metadata on the class).
392
- const typed = matchTypedError(errorClasses, status, [
393
- { code: errorCode, message: errorMessage },
394
- ]);
394
+ const typed = matchTypedError(
395
+ errorClasses,
396
+ status,
397
+ [{ code: errorCode, message: errorMessage }],
398
+ { body: nonJson ? text : json, headers },
399
+ );
395
400
  if (typed !== undefined) {
396
401
  return yield* Effect.fail(tagBlip(typed)) as Effect.Effect<never>;
397
402
  }
@@ -442,6 +447,16 @@ const makeDecode =
442
447
  );
443
448
  }
444
449
 
450
+ // Strict mode (core/response-validation) checks the TS-shaped output
451
+ // against the schema; lenient mode returns it as built.
452
+ const body: unknown = nonJson ? text : json;
453
+ const validate = (value: unknown) =>
454
+ validateResponse(
455
+ outputAst,
456
+ value,
457
+ (cause) => new CloudflareParseError({ body, cause }),
458
+ ).pipe(Effect.catch(fail));
459
+
445
460
  if (nonJson) json = {};
446
461
 
447
462
  // Unwrap the envelope: the payload is `result` (fall back to the whole
@@ -459,9 +474,13 @@ const makeDecode =
459
474
  // Bare-payload response: the whole value IS the envelope's `result`
460
475
  // (array/scalar), returned directly rather than wrapped in a struct.
461
476
  if (getAnn(outputAst, envelopePayloadRootSymbol) !== undefined) {
462
- return mapKeys(outputAst, payload, "decode", rootDict);
477
+ return yield* validate(mapKeys(outputAst, payload, "decode", rootDict));
463
478
  }
464
479
 
480
+ // A non-JSON body for a struct output: lenient returns the text as
481
+ // read; strict fails it against the struct schema.
482
+ if (nonJson) return yield* validate(text);
483
+
465
484
  const result: Record<string, unknown> = {};
466
485
 
467
486
  for (const prop of getProps(outputAst)) {
@@ -503,7 +522,7 @@ const makeDecode =
503
522
  }
504
523
  }
505
524
  }
506
- return result;
525
+ return yield* validate(result);
507
526
  });
508
527
 
509
528
  export const CloudflareProtocol: Layer.Layer<API.Protocol> = Layer.succeed(
@@ -0,0 +1,67 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { runValidationModes } from "@distilled.cloud/core/testing";
3
+ import * as Effect from "effect/Effect";
4
+ import { credentials } from "./credentials.ts";
5
+ import { CloudflareParseError } from "./errors.ts";
6
+ import * as Retry from "./retry.ts";
7
+ import { verifyToken } from "./services/user.ts";
8
+ import type { CloudflareOpError } from "./protocol.ts";
9
+
10
+ // verifyToken declares `{ id: string; status: string; expiresOn?: string | null; notBefore?: string | null }`,
11
+ // unwrapped from the `{ success, errors, messages, result }` envelope.
12
+ const run = (body: string) =>
13
+ runValidationModes(
14
+ verifyToken({}).pipe(
15
+ Retry.none,
16
+ Effect.provide(credentials({ apiToken: "test" })),
17
+ ),
18
+ { body },
19
+ );
20
+
21
+ const envelope = (result: unknown) =>
22
+ JSON.stringify({ success: true, errors: [], messages: [], result });
23
+
24
+ describe("Cloudflare response validation", () => {
25
+ test("a matching body succeeds unchanged in both modes", async () => {
26
+ const { lenient, strict } = await run(
27
+ envelope({
28
+ id: "ed17574386854bf78a67040be0a770b0",
29
+ status: "active",
30
+ expires_on: "2030-01-01T00:00:00Z",
31
+ }),
32
+ );
33
+ const expected = {
34
+ id: "ed17574386854bf78a67040be0a770b0",
35
+ status: "active",
36
+ expiresOn: "2030-01-01T00:00:00Z",
37
+ };
38
+ expect(lenient).toMatchObject({ _tag: "Success", success: expected });
39
+ expect(strict).toMatchObject({ _tag: "Success", success: expected });
40
+ });
41
+
42
+ test("a body missing required members: lenient returns it, strict fails", async () => {
43
+ const { lenient, strict } = await run(
44
+ envelope({ id: "ed17574386854bf78a67040be0a770b0" }),
45
+ );
46
+ expect(lenient).toMatchObject({
47
+ _tag: "Success",
48
+ success: { id: "ed17574386854bf78a67040be0a770b0" },
49
+ });
50
+ expect(strict._tag).toBe("Failure");
51
+ expect((strict as any).failure).toBeInstanceOf(CloudflareParseError);
52
+ });
53
+
54
+ test("a non-JSON body: lenient returns the text, strict fails", async () => {
55
+ const { lenient, strict } = await run("not json");
56
+ expect(lenient).toMatchObject({ _tag: "Success", success: "not json" });
57
+ expect((strict as any).failure).toBeInstanceOf(CloudflareParseError);
58
+ expect((strict as any).failure.body).toBe("not json");
59
+ });
60
+ });
61
+
62
+ // CloudflareParseError is part of every operation's declared error type.
63
+ export const parseErrorIsDeclared: [CloudflareParseError] extends [
64
+ CloudflareOpError,
65
+ ]
66
+ ? true
67
+ : false = true;
@@ -182,6 +182,15 @@ export class PeerNotFound
182
182
  [{ status: 404 }],
183
183
  ) {}
184
184
 
185
+ export class RecordNotFound
186
+ extends /*@__PURE__*/ T.applyErrorMatchers(
187
+ /*@__PURE__*/ S.TaggedError<RecordNotFound>()("RecordNotFound", {
188
+ code: S.Number,
189
+ message: S.String,
190
+ }),
191
+ [{ code: 81044 }],
192
+ ) {}
193
+
185
194
  export class TsigNotFound
186
195
  extends /*@__PURE__*/ T.applyErrorMatchers(
187
196
  /*@__PURE__*/ S.TaggedError<TsigNotFound>()("TsigNotFound", {
@@ -31254,7 +31263,7 @@ export const deleteDnssec: API.OperationMethod<
31254
31263
  retry: Retry.Retry,
31255
31264
  }));
31256
31265
 
31257
- export type DeleteRecordError = CloudflareOpError;
31266
+ export type DeleteRecordError = RecordNotFound | CloudflareOpError;
31258
31267
  /** Permanently removes a DNS record from the zone. */
31259
31268
  export const deleteRecord: API.OperationMethod<
31260
31269
  DeleteRecordRequest,
@@ -31264,7 +31273,7 @@ export const deleteRecord: API.OperationMethod<
31264
31273
  > = /*@__PURE__*/ API.make(() => ({
31265
31274
  input: DeleteRecordRequest,
31266
31275
  output: DeleteRecordResponse,
31267
- errors: [CloudflareRateLimited, CloudflareError],
31276
+ errors: [RecordNotFound, CloudflareRateLimited, CloudflareError],
31268
31277
  protocol: CloudflareProtocol,
31269
31278
  retry: Retry.Retry,
31270
31279
  }));
@@ -31490,7 +31499,7 @@ export const getDnssec: API.OperationMethod<
31490
31499
  retry: Retry.Retry,
31491
31500
  }));
31492
31501
 
31493
- export type GetRecordError = Forbidden | CloudflareOpError;
31502
+ export type GetRecordError = Forbidden | RecordNotFound | CloudflareOpError;
31494
31503
  /** Retrieves details for a specific DNS record in the zone. */
31495
31504
  export const getRecord: API.OperationMethod<
31496
31505
  GetRecordRequest,
@@ -31500,7 +31509,7 @@ export const getRecord: API.OperationMethod<
31500
31509
  > = /*@__PURE__*/ API.make(() => ({
31501
31510
  input: GetRecordRequest,
31502
31511
  output: GetRecordResponse,
31503
- errors: [Forbidden, CloudflareRateLimited, CloudflareError],
31512
+ errors: [Forbidden, RecordNotFound, CloudflareRateLimited, CloudflareError],
31504
31513
  protocol: CloudflareProtocol,
31505
31514
  retry: Retry.Retry,
31506
31515
  }));
@@ -152,6 +152,23 @@ export class QueueHandlerMissing
152
152
  ],
153
153
  ) {}
154
154
 
155
+ export class QueueHttpPullNotEnabled
156
+ extends /*@__PURE__*/ T.applyErrorMatchers(
157
+ /*@__PURE__*/ S.TaggedError<QueueHttpPullNotEnabled>()(
158
+ "QueueHttpPullNotEnabled",
159
+ {
160
+ code: S.Number,
161
+ message: S.String,
162
+ },
163
+ ),
164
+ [
165
+ {
166
+ code: 0,
167
+ message: "messages cannot be pulled unless http_pull mode is enabled",
168
+ },
169
+ ],
170
+ ) {}
171
+
155
172
  export class QueueInUseByEventNotification
156
173
  extends /*@__PURE__*/ T.applyErrorMatchers(
157
174
  /*@__PURE__*/ S.TaggedError<QueueInUseByEventNotification>()(
@@ -5384,6 +5401,7 @@ export type PullMessageError =
5384
5401
  | InvalidQueueId
5385
5402
  | QueueNotFound
5386
5403
  | InvalidRoute
5404
+ | QueueHttpPullNotEnabled
5387
5405
  | CloudflareOpError;
5388
5406
  /** Pull a batch of messages from a Queue */
5389
5407
  export const pullMessage: API.OperationMethod<
@@ -5399,6 +5417,7 @@ export const pullMessage: API.OperationMethod<
5399
5417
  InvalidQueueId,
5400
5418
  QueueNotFound,
5401
5419
  InvalidRoute,
5420
+ QueueHttpPullNotEnabled,
5402
5421
  CloudflareRateLimited,
5403
5422
  CloudflareError,
5404
5423
  ],
@@ -206,6 +206,35 @@ export class QueueNotFound
206
206
  [{ code: 11000 }],
207
207
  ) {}
208
208
 
209
+ export class SuperSlurperJobOperationFailed
210
+ extends /*@__PURE__*/ T.applyErrorMatchers(
211
+ /*@__PURE__*/ S.TaggedError<SuperSlurperJobOperationFailed>()(
212
+ "SuperSlurperJobOperationFailed",
213
+ {
214
+ code: S.Number,
215
+ message: S.String,
216
+ },
217
+ ),
218
+ [{ status: 500, message: "Internal Server Error" }],
219
+ ) {}
220
+
221
+ export class SuperSlurperPreconnectivityFailed
222
+ extends /*@__PURE__*/ T.applyErrorMatchers(
223
+ /*@__PURE__*/ S.TaggedError<SuperSlurperPreconnectivityFailed>()(
224
+ "SuperSlurperPreconnectivityFailed",
225
+ {
226
+ code: S.Number,
227
+ message: S.String,
228
+ },
229
+ ),
230
+ [
231
+ {
232
+ status: 403,
233
+ message: "Preconnectivity failed, please verify tokens and try again",
234
+ },
235
+ ],
236
+ ) {}
237
+
209
238
  export interface AbortAllSuperSlurperJobRequest {
210
239
  accountId: string;
211
240
  }
@@ -5126,7 +5155,9 @@ export const abortAllSuperSlurperJob: API.OperationMethod<
5126
5155
  retry: Retry.Retry,
5127
5156
  }));
5128
5157
 
5129
- export type AbortSuperSlurperJobError = CloudflareOpError;
5158
+ export type AbortSuperSlurperJobError =
5159
+ | SuperSlurperJobOperationFailed
5160
+ | CloudflareOpError;
5130
5161
  /** Cancels a specific R2 Super Slurper migration job. Any objects in the middle of a transfer will finish, but no new objects will start transferring. */
5131
5162
  export const abortSuperSlurperJob: API.OperationMethod<
5132
5163
  AbortSuperSlurperJobRequest,
@@ -5136,7 +5167,11 @@ export const abortSuperSlurperJob: API.OperationMethod<
5136
5167
  > = /*@__PURE__*/ API.make(() => ({
5137
5168
  input: AbortSuperSlurperJobRequest,
5138
5169
  output: AbortSuperSlurperJobResponse,
5139
- errors: [CloudflareRateLimited, CloudflareError],
5170
+ errors: [
5171
+ SuperSlurperJobOperationFailed,
5172
+ CloudflareRateLimited,
5173
+ CloudflareError,
5174
+ ],
5140
5175
  protocol: CloudflareProtocol,
5141
5176
  retry: Retry.Retry,
5142
5177
  }));
@@ -5191,7 +5226,9 @@ export const createBucketDomainCustom: API.OperationMethod<
5191
5226
  retry: Retry.Retry,
5192
5227
  }));
5193
5228
 
5194
- export type CreateSuperSlurperJobError = CloudflareOpError;
5229
+ export type CreateSuperSlurperJobError =
5230
+ | SuperSlurperPreconnectivityFailed
5231
+ | CloudflareOpError;
5195
5232
  /** Creates a new R2 Super Slurper migration job to transfer objects from a source bucket (e.g. S3, GCS, R2) to R2. */
5196
5233
  export const createSuperSlurperJob: API.OperationMethod<
5197
5234
  CreateSuperSlurperJobRequest,
@@ -5201,7 +5238,11 @@ export const createSuperSlurperJob: API.OperationMethod<
5201
5238
  > = /*@__PURE__*/ API.make(() => ({
5202
5239
  input: CreateSuperSlurperJobRequest,
5203
5240
  output: CreateSuperSlurperJobResponse,
5204
- errors: [CloudflareRateLimited, CloudflareError],
5241
+ errors: [
5242
+ SuperSlurperPreconnectivityFailed,
5243
+ CloudflareRateLimited,
5244
+ CloudflareError,
5245
+ ],
5205
5246
  protocol: CloudflareProtocol,
5206
5247
  retry: Retry.Retry,
5207
5248
  }));
@@ -5558,7 +5599,9 @@ export const getBucketSippy: API.OperationMethod<
5558
5599
  retry: Retry.Retry,
5559
5600
  }));
5560
5601
 
5561
- export type GetSuperSlurperJobError = CloudflareOpError;
5602
+ export type GetSuperSlurperJobError =
5603
+ | SuperSlurperJobOperationFailed
5604
+ | CloudflareOpError;
5562
5605
  /** Retrieves detailed status and configuration for a specific R2 Super Slurper migration job. */
5563
5606
  export const getSuperSlurperJob: API.OperationMethod<
5564
5607
  GetSuperSlurperJobRequest,
@@ -5568,7 +5611,11 @@ export const getSuperSlurperJob: API.OperationMethod<
5568
5611
  > = /*@__PURE__*/ API.make(() => ({
5569
5612
  input: GetSuperSlurperJobRequest,
5570
5613
  output: GetSuperSlurperJobResponse,
5571
- errors: [CloudflareRateLimited, CloudflareError],
5614
+ errors: [
5615
+ SuperSlurperJobOperationFailed,
5616
+ CloudflareRateLimited,
5617
+ CloudflareError,
5618
+ ],
5572
5619
  protocol: CloudflareProtocol,
5573
5620
  retry: Retry.Retry,
5574
5621
  }));
@@ -5747,7 +5794,9 @@ export const patchBucket: API.OperationMethod<
5747
5794
  retry: Retry.Retry,
5748
5795
  }));
5749
5796
 
5750
- export type PauseSuperSlurperJobError = CloudflareOpError;
5797
+ export type PauseSuperSlurperJobError =
5798
+ | SuperSlurperJobOperationFailed
5799
+ | CloudflareOpError;
5751
5800
  /** Pauses a running R2 Super Slurper migration job. The job can be resumed later to continue transferring. */
5752
5801
  export const pauseSuperSlurperJob: API.OperationMethod<
5753
5802
  PauseSuperSlurperJobRequest,
@@ -5757,7 +5806,11 @@ export const pauseSuperSlurperJob: API.OperationMethod<
5757
5806
  > = /*@__PURE__*/ API.make(() => ({
5758
5807
  input: PauseSuperSlurperJobRequest,
5759
5808
  output: PauseSuperSlurperJobResponse,
5760
- errors: [CloudflareRateLimited, CloudflareError],
5809
+ errors: [
5810
+ SuperSlurperJobOperationFailed,
5811
+ CloudflareRateLimited,
5812
+ CloudflareError,
5813
+ ],
5761
5814
  protocol: CloudflareProtocol,
5762
5815
  retry: Retry.Retry,
5763
5816
  }));
@@ -5901,7 +5954,9 @@ export const putBucketSippy: API.OperationMethod<
5901
5954
  retry: Retry.Retry,
5902
5955
  }));
5903
5956
 
5904
- export type ResumeSuperSlurperJobError = CloudflareOpError;
5957
+ export type ResumeSuperSlurperJobError =
5958
+ | SuperSlurperJobOperationFailed
5959
+ | CloudflareOpError;
5905
5960
  /** Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped. */
5906
5961
  export const resumeSuperSlurperJob: API.OperationMethod<
5907
5962
  ResumeSuperSlurperJobRequest,
@@ -5911,7 +5966,11 @@ export const resumeSuperSlurperJob: API.OperationMethod<
5911
5966
  > = /*@__PURE__*/ API.make(() => ({
5912
5967
  input: ResumeSuperSlurperJobRequest,
5913
5968
  output: ResumeSuperSlurperJobResponse,
5914
- errors: [CloudflareRateLimited, CloudflareError],
5969
+ errors: [
5970
+ SuperSlurperJobOperationFailed,
5971
+ CloudflareRateLimited,
5972
+ CloudflareError,
5973
+ ],
5915
5974
  protocol: CloudflareProtocol,
5916
5975
  retry: Retry.Retry,
5917
5976
  }));
@@ -335,6 +335,18 @@ export class ObservabilityDestinationPreflightFailed
335
335
  [{ status: 400, message: "Bad Request" }],
336
336
  ) {}
337
337
 
338
+ export class PreviewAlreadyExists
339
+ extends /*@__PURE__*/ T.applyErrorMatchers(
340
+ /*@__PURE__*/ S.TaggedError<PreviewAlreadyExists>()(
341
+ "PreviewAlreadyExists",
342
+ {
343
+ code: S.Number,
344
+ message: S.String,
345
+ },
346
+ ),
347
+ [{ status: 409, message: { includes: "already exists" } }],
348
+ ) {}
349
+
338
350
  export class PreviewDeploymentNotFound
339
351
  extends /*@__PURE__*/ T.applyErrorMatchers(
340
352
  /*@__PURE__*/ S.TaggedError<PreviewDeploymentNotFound>()(
@@ -36495,7 +36507,10 @@ export const createObservabilitySharedQuery: API.OperationMethod<
36495
36507
  retry: Retry.Retry,
36496
36508
  }));
36497
36509
 
36498
- export type CreatePreviewError = WorkerNotFound | CloudflareOpError;
36510
+ export type CreatePreviewError =
36511
+ | WorkerNotFound
36512
+ | PreviewAlreadyExists
36513
+ | CloudflareOpError;
36499
36514
  /** Create a Worker Preview. Does not deploy code; follow with createPreviewDeployment. */
36500
36515
  export const createPreview: API.OperationMethod<
36501
36516
  CreatePreviewRequest,
@@ -36505,7 +36520,12 @@ export const createPreview: API.OperationMethod<
36505
36520
  > = /*@__PURE__*/ API.make(() => ({
36506
36521
  input: CreatePreviewRequest,
36507
36522
  output: PreviewResource,
36508
- errors: [WorkerNotFound, CloudflareRateLimited, CloudflareError],
36523
+ errors: [
36524
+ WorkerNotFound,
36525
+ PreviewAlreadyExists,
36526
+ CloudflareRateLimited,
36527
+ CloudflareError,
36528
+ ],
36509
36529
  protocol: CloudflareProtocol,
36510
36530
  retry: Retry.Retry,
36511
36531
  }));