@distilled.cloud/cloudflare 0.28.1 → 0.29.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/lib/traits.d.ts CHANGED
@@ -9,7 +9,8 @@ export interface ErrorMatcher {
9
9
  code?: number;
10
10
  status?: number;
11
11
  message?: string | {
12
- includes: string;
12
+ includes?: string;
13
+ matches?: string;
13
14
  };
14
15
  }
15
16
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,8BAA8B,CAAC;AAG7C,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAMxC,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,eAE/B,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS;IAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAA;CAAE,OACtD,CAAC,YACI,YAAY,EAAE,KACvB,CAIF,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAS,GAAG,CAAC,GAAG,+BACY,CAAC;AAE1D,yDAAyD;AACzD,eAAO,MAAM,iBAAiB,eAAiD,CAAC;AAEhF,eAAO,MAAM,WAAW,SAAU,MAAM,sDACC,CAAC;AAE1C,eAAO,MAAM,cAAc,QAAS,GAAG,CAAC,GAAG,uBACI,CAAC"}
1
+ {"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,8BAA8B,CAAC;AAG7C,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAMxC,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,eAE/B,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS;IAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAA;CAAE,EAC3D,KAAK,CAAC,EACN,UAAU,YAAY,EAAE,KACvB,CAIF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,KAAK,GAAG,CAAC,GAAG,+BACY,CAAC;AAE1D,yDAAyD;AACzD,eAAO,MAAM,iBAAiB,eAAiD,CAAC;AAEhF,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,sDACC,CAAC;AAE1C,eAAO,MAAM,cAAc,GAAI,KAAK,GAAG,CAAC,GAAG,uBACI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/cloudflare",
3
- "version": "0.28.1",
3
+ "version": "0.29.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -51,12 +51,12 @@
51
51
  }
52
52
  },
53
53
  "scripts": {
54
- "typecheck": "tsgo",
55
- "build": "tsgo -b",
54
+ "typecheck": "tsc",
55
+ "build": "tsc -b",
56
56
  "download:env": "doppler secrets download --no-file --format env > .env",
57
57
  "fmt": "oxfmt --write src",
58
58
  "lint": "oxlint --fix src",
59
- "check": "tsgo && oxlint src && oxfmt --check src",
59
+ "check": "tsc && oxlint src && oxfmt --check src",
60
60
  "test": "vitest run --exclude specs --passWithNoTests",
61
61
  "publish:npm": "bun run build && bun publish --access public",
62
62
  "generate": "bun run scripts/generate.ts && oxlint --fix src && oxfmt --write src && oxfmt --write src",
@@ -64,18 +64,18 @@
64
64
  "specs:update": "git -C specs/cloudflare-typescript fetch && git -C specs/cloudflare-typescript checkout main && git -C specs/cloudflare-typescript pull"
65
65
  },
66
66
  "dependencies": {
67
- "@distilled.cloud/core": "0.28.1"
67
+ "@distilled.cloud/core": "0.29.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@effect/platform-node": ">=4.0.0-beta.66 || >=4.0.0",
71
- "@effect/vitest": ">=4.0.0-beta.66 || >=4.0.0",
70
+ "@effect/platform-node": ">=4.0.0-beta.97 || >=4.0.0",
71
+ "@effect/vitest": ">=4.0.0-beta.97 || >=4.0.0",
72
72
  "@types/bun": "^1.3.0",
73
73
  "@types/node": "^25.3.5",
74
74
  "dotenv": "^16.5.0",
75
- "typescript": "^5.9.3",
75
+ "typescript-5": "npm:typescript@^5.9.3",
76
76
  "vitest": "^3.2.3"
77
77
  },
78
78
  "peerDependencies": {
79
- "effect": ">=4.0.0-beta.66 || >=4.0.0"
79
+ "effect": ">=4.0.0-beta.97 || >=4.0.0"
80
80
  }
81
81
  }
package/src/client/api.ts CHANGED
@@ -222,8 +222,15 @@ function matchesExpression(
222
222
  if (matcher.message !== undefined) {
223
223
  if (typeof matcher.message === "string") {
224
224
  if (matcher.message !== message) return false;
225
- } else if (matcher.message.includes !== undefined) {
226
- if (!message.includes(matcher.message.includes)) return false;
225
+ } else {
226
+ const { includes, matches } = matcher.message;
227
+ // An empty message-object constrains nothing and would otherwise
228
+ // match every error — reject it like the fully-empty matcher above.
229
+ if (includes === undefined && matches === undefined) return false;
230
+ if (includes !== undefined && !message.includes(includes)) return false;
231
+ if (matches !== undefined && !new RegExp(matches).test(message)) {
232
+ return false;
233
+ }
227
234
  }
228
235
  }
229
236
  return true;
@@ -17,6 +17,14 @@ import { UploadableSchema } from "../schemas.ts";
17
17
  // Errors
18
18
  // =============================================================================
19
19
 
20
+ export class D1DatabaseNotFound extends T.applyErrorMatchers(
21
+ Schema.TaggedErrorClass<D1DatabaseNotFound>()("D1DatabaseNotFound", {
22
+ code: Schema.Number,
23
+ message: Schema.String,
24
+ }),
25
+ [{ code: 10181 }],
26
+ ) {}
27
+
20
28
  export class DispatchNamespaceAlreadyExists extends T.applyErrorMatchers(
21
29
  Schema.TaggedErrorClass<DispatchNamespaceAlreadyExists>()(
22
30
  "DispatchNamespaceAlreadyExists",
@@ -41,6 +49,14 @@ export class DispatchNamespaceScriptNotFound extends T.applyErrorMatchers(
41
49
  [{ code: 10007 }],
42
50
  ) {}
43
51
 
52
+ export class DurableObjectClassNotFound extends T.applyErrorMatchers(
53
+ Schema.TaggedErrorClass<DurableObjectClassNotFound>()(
54
+ "DurableObjectClassNotFound",
55
+ { code: Schema.Number, message: Schema.String },
56
+ ),
57
+ [{ code: 10061 }],
58
+ ) {}
59
+
44
60
  export class Forbidden extends T.applyErrorMatchers(
45
61
  Schema.TaggedErrorClass<Forbidden>()("Forbidden", {
46
62
  code: Schema.Number,
@@ -49,6 +65,70 @@ export class Forbidden extends T.applyErrorMatchers(
49
65
  [{ status: 403 }],
50
66
  ) {}
51
67
 
68
+ export class HyperdriveConfigNotFound extends T.applyErrorMatchers(
69
+ Schema.TaggedErrorClass<HyperdriveConfigNotFound>()(
70
+ "HyperdriveConfigNotFound",
71
+ { code: Schema.Number, message: Schema.String },
72
+ ),
73
+ [{ code: 10157 }],
74
+ ) {}
75
+
76
+ export class KVNamespaceNotFound extends T.applyErrorMatchers(
77
+ Schema.TaggedErrorClass<KVNamespaceNotFound>()("KVNamespaceNotFound", {
78
+ code: Schema.Number,
79
+ message: Schema.String,
80
+ }),
81
+ [{ code: 10041 }],
82
+ ) {}
83
+
84
+ export class MtlsCertificateNotFound extends T.applyErrorMatchers(
85
+ Schema.TaggedErrorClass<MtlsCertificateNotFound>()(
86
+ "MtlsCertificateNotFound",
87
+ { code: Schema.Number, message: Schema.String },
88
+ ),
89
+ [{ code: 100143 }],
90
+ ) {}
91
+
92
+ export class QueueNotFound extends T.applyErrorMatchers(
93
+ Schema.TaggedErrorClass<QueueNotFound>()("QueueNotFound", {
94
+ code: Schema.Number,
95
+ message: Schema.String,
96
+ }),
97
+ [{ code: 11000 }],
98
+ ) {}
99
+
100
+ export class R2BucketNotFound extends T.applyErrorMatchers(
101
+ Schema.TaggedErrorClass<R2BucketNotFound>()("R2BucketNotFound", {
102
+ code: Schema.Number,
103
+ message: Schema.String,
104
+ }),
105
+ [{ code: 10085 }],
106
+ ) {}
107
+
108
+ export class SecretsStoreBindingNotFound extends T.applyErrorMatchers(
109
+ Schema.TaggedErrorClass<SecretsStoreBindingNotFound>()(
110
+ "SecretsStoreBindingNotFound",
111
+ { code: Schema.Number, message: Schema.String },
112
+ ),
113
+ [{ code: 10182 }],
114
+ ) {}
115
+
116
+ export class ServiceBindingNotFound extends T.applyErrorMatchers(
117
+ Schema.TaggedErrorClass<ServiceBindingNotFound>()("ServiceBindingNotFound", {
118
+ code: Schema.Number,
119
+ message: Schema.String,
120
+ }),
121
+ [{ code: 10144 }],
122
+ ) {}
123
+
124
+ export class VectorizeIndexNotFound extends T.applyErrorMatchers(
125
+ Schema.TaggedErrorClass<VectorizeIndexNotFound>()("VectorizeIndexNotFound", {
126
+ code: Schema.Number,
127
+ message: Schema.String,
128
+ }),
129
+ [{ code: 10159 }],
130
+ ) {}
131
+
52
132
  // =============================================================================
53
133
  // Shared nested schemas (hoisted, module-private)
54
134
  // =============================================================================
@@ -3963,7 +4043,17 @@ export const PutDispatchNamespaceScriptResponse =
3963
4043
  export type PutDispatchNamespaceScriptError =
3964
4044
  | DefaultErrors
3965
4045
  | DispatchNamespaceNotFound
3966
- | Forbidden;
4046
+ | Forbidden
4047
+ | SecretsStoreBindingNotFound
4048
+ | KVNamespaceNotFound
4049
+ | R2BucketNotFound
4050
+ | D1DatabaseNotFound
4051
+ | QueueNotFound
4052
+ | ServiceBindingNotFound
4053
+ | DurableObjectClassNotFound
4054
+ | HyperdriveConfigNotFound
4055
+ | VectorizeIndexNotFound
4056
+ | MtlsCertificateNotFound;
3967
4057
 
3968
4058
  export const putDispatchNamespaceScript: API.OperationMethod<
3969
4059
  PutDispatchNamespaceScriptRequest,
@@ -3973,7 +4063,20 @@ export const putDispatchNamespaceScript: API.OperationMethod<
3973
4063
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3974
4064
  input: PutDispatchNamespaceScriptRequest,
3975
4065
  output: PutDispatchNamespaceScriptResponse,
3976
- errors: [DispatchNamespaceNotFound, Forbidden],
4066
+ errors: [
4067
+ DispatchNamespaceNotFound,
4068
+ Forbidden,
4069
+ SecretsStoreBindingNotFound,
4070
+ KVNamespaceNotFound,
4071
+ R2BucketNotFound,
4072
+ D1DatabaseNotFound,
4073
+ QueueNotFound,
4074
+ ServiceBindingNotFound,
4075
+ DurableObjectClassNotFound,
4076
+ HyperdriveConfigNotFound,
4077
+ VectorizeIndexNotFound,
4078
+ MtlsCertificateNotFound,
4079
+ ],
3977
4080
  }));
3978
4081
 
3979
4082
  export interface DeleteDispatchNamespaceScriptRequest {
@@ -25,6 +25,14 @@ export class ContentTypeRequired extends T.applyErrorMatchers(
25
25
  [{ code: 10001 }],
26
26
  ) {}
27
27
 
28
+ export class D1DatabaseNotFound extends T.applyErrorMatchers(
29
+ Schema.TaggedErrorClass<D1DatabaseNotFound>()("D1DatabaseNotFound", {
30
+ code: Schema.Number,
31
+ message: Schema.String,
32
+ }),
33
+ [{ code: 10181 }],
34
+ ) {}
35
+
28
36
  export class DeploymentNotFound extends T.applyErrorMatchers(
29
37
  Schema.TaggedErrorClass<DeploymentNotFound>()("DeploymentNotFound", {
30
38
  code: Schema.Number,
@@ -33,6 +41,14 @@ export class DeploymentNotFound extends T.applyErrorMatchers(
33
41
  [{ code: 10336 }],
34
42
  ) {}
35
43
 
44
+ export class DispatchNamespaceNotFound extends T.applyErrorMatchers(
45
+ Schema.TaggedErrorClass<DispatchNamespaceNotFound>()(
46
+ "DispatchNamespaceNotFound",
47
+ { code: Schema.Number, message: Schema.String },
48
+ ),
49
+ [{ code: 100119 }],
50
+ ) {}
51
+
36
52
  export class DomainNotFound extends T.applyErrorMatchers(
37
53
  Schema.TaggedErrorClass<DomainNotFound>()("DomainNotFound", {
38
54
  code: Schema.Number,
@@ -54,6 +70,14 @@ export class DuplicateMigrationTarget extends T.applyErrorMatchers(
54
70
  ],
55
71
  ) {}
56
72
 
73
+ export class DurableObjectClassNotFound extends T.applyErrorMatchers(
74
+ Schema.TaggedErrorClass<DurableObjectClassNotFound>()(
75
+ "DurableObjectClassNotFound",
76
+ { code: Schema.Number, message: Schema.String },
77
+ ),
78
+ [{ code: 10061 }],
79
+ ) {}
80
+
57
81
  export class DurableObjectMustBeSqlite extends T.applyErrorMatchers(
58
82
  Schema.TaggedErrorClass<DurableObjectMustBeSqlite>()(
59
83
  "DurableObjectMustBeSqlite",
@@ -78,6 +102,14 @@ export class HostnameAlreadyInUse extends T.applyErrorMatchers(
78
102
  [{ code: 100116 }],
79
103
  ) {}
80
104
 
105
+ export class HyperdriveConfigNotFound extends T.applyErrorMatchers(
106
+ Schema.TaggedErrorClass<HyperdriveConfigNotFound>()(
107
+ "HyperdriveConfigNotFound",
108
+ { code: Schema.Number, message: Schema.String },
109
+ ),
110
+ [{ code: 10157 }],
111
+ ) {}
112
+
81
113
  T.applyErrorMatchers(InternalServerError, [
82
114
  { code: 10002, message: { includes: "An unknown error has occurred" } },
83
115
  ]);
@@ -106,6 +138,22 @@ export class InvalidWorkerScript extends T.applyErrorMatchers(
106
138
  [{ code: 10068 }],
107
139
  ) {}
108
140
 
141
+ export class KVNamespaceNotFound extends T.applyErrorMatchers(
142
+ Schema.TaggedErrorClass<KVNamespaceNotFound>()("KVNamespaceNotFound", {
143
+ code: Schema.Number,
144
+ message: Schema.String,
145
+ }),
146
+ [{ code: 10041 }],
147
+ ) {}
148
+
149
+ export class MtlsCertificateNotFound extends T.applyErrorMatchers(
150
+ Schema.TaggedErrorClass<MtlsCertificateNotFound>()(
151
+ "MtlsCertificateNotFound",
152
+ { code: Schema.Number, message: Schema.String },
153
+ ),
154
+ [{ code: 100143 }],
155
+ ) {}
156
+
109
157
  export class ObservabilityDestinationCreateFailed extends T.applyErrorMatchers(
110
158
  Schema.TaggedErrorClass<ObservabilityDestinationCreateFailed>()(
111
159
  "ObservabilityDestinationCreateFailed",
@@ -138,6 +186,22 @@ export class QueueConsumerConflict extends T.applyErrorMatchers(
138
186
  [{ code: 10064 }],
139
187
  ) {}
140
188
 
189
+ export class QueueNotFound extends T.applyErrorMatchers(
190
+ Schema.TaggedErrorClass<QueueNotFound>()("QueueNotFound", {
191
+ code: Schema.Number,
192
+ message: Schema.String,
193
+ }),
194
+ [{ code: 11000 }],
195
+ ) {}
196
+
197
+ export class R2BucketNotFound extends T.applyErrorMatchers(
198
+ Schema.TaggedErrorClass<R2BucketNotFound>()("R2BucketNotFound", {
199
+ code: Schema.Number,
200
+ message: Schema.String,
201
+ }),
202
+ [{ code: 10085 }],
203
+ ) {}
204
+
141
205
  export class RouteNotFound extends T.applyErrorMatchers(
142
206
  Schema.TaggedErrorClass<RouteNotFound>()("RouteNotFound", {
143
207
  code: Schema.Number,
@@ -146,6 +210,14 @@ export class RouteNotFound extends T.applyErrorMatchers(
146
210
  [{ code: 10009 }, { status: 404 }],
147
211
  ) {}
148
212
 
213
+ export class RouteScriptNotFound extends T.applyErrorMatchers(
214
+ Schema.TaggedErrorClass<RouteScriptNotFound>()("RouteScriptNotFound", {
215
+ code: Schema.Number,
216
+ message: Schema.String,
217
+ }),
218
+ [{ code: 10019 }],
219
+ ) {}
220
+
149
221
  export class ScriptModuleNotFound extends T.applyErrorMatchers(
150
222
  Schema.TaggedErrorClass<ScriptModuleNotFound>()("ScriptModuleNotFound", {
151
223
  code: Schema.Number,
@@ -170,6 +242,14 @@ export class SecretNotFound extends T.applyErrorMatchers(
170
242
  [{ code: 10056 }],
171
243
  ) {}
172
244
 
245
+ export class SecretsStoreBindingNotFound extends T.applyErrorMatchers(
246
+ Schema.TaggedErrorClass<SecretsStoreBindingNotFound>()(
247
+ "SecretsStoreBindingNotFound",
248
+ { code: Schema.Number, message: Schema.String },
249
+ ),
250
+ [{ code: 10182 }],
251
+ ) {}
252
+
173
253
  export class ServiceBindingConflict extends T.applyErrorMatchers(
174
254
  Schema.TaggedErrorClass<ServiceBindingConflict>()("ServiceBindingConflict", {
175
255
  code: Schema.Number,
@@ -178,6 +258,14 @@ export class ServiceBindingConflict extends T.applyErrorMatchers(
178
258
  [{ code: 10142 }],
179
259
  ) {}
180
260
 
261
+ export class ServiceBindingNotFound extends T.applyErrorMatchers(
262
+ Schema.TaggedErrorClass<ServiceBindingNotFound>()("ServiceBindingNotFound", {
263
+ code: Schema.Number,
264
+ message: Schema.String,
265
+ }),
266
+ [{ code: 10144 }],
267
+ ) {}
268
+
181
269
  export class SubdomainAlreadyExists extends T.applyErrorMatchers(
182
270
  Schema.TaggedErrorClass<SubdomainAlreadyExists>()("SubdomainAlreadyExists", {
183
271
  code: Schema.Number,
@@ -194,6 +282,14 @@ export class SubdomainNotFound extends T.applyErrorMatchers(
194
282
  [{ status: 404 }],
195
283
  ) {}
196
284
 
285
+ export class VectorizeIndexNotFound extends T.applyErrorMatchers(
286
+ Schema.TaggedErrorClass<VectorizeIndexNotFound>()("VectorizeIndexNotFound", {
287
+ code: Schema.Number,
288
+ message: Schema.String,
289
+ }),
290
+ [{ code: 10159 }],
291
+ ) {}
292
+
197
293
  export class VersionNotFound extends T.applyErrorMatchers(
198
294
  Schema.TaggedErrorClass<VersionNotFound>()("VersionNotFound", {
199
295
  code: Schema.Number,
@@ -6479,6 +6575,25 @@ const PutScriptRequestMetadataBinding37 =
6479
6575
  ),
6480
6576
  ) as unknown as Schema.Codec<PutScriptRequestMetadataBinding37>;
6481
6577
 
6578
+ interface PutScriptRequestMetadataCache {
6579
+ enabled?: boolean | null;
6580
+ crossVersionCache?: boolean | null;
6581
+ }
6582
+ const PutScriptRequestMetadataCache =
6583
+ /*@__PURE__*/ /*#__PURE__*/ Schema.suspend(() =>
6584
+ Schema.Struct({
6585
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
6586
+ crossVersionCache: Schema.optional(
6587
+ Schema.Union([Schema.Boolean, Schema.Null]),
6588
+ ),
6589
+ }).pipe(
6590
+ Schema.encodeKeys({
6591
+ enabled: "enabled",
6592
+ crossVersionCache: "cross_version_cache",
6593
+ }),
6594
+ ),
6595
+ ) as unknown as Schema.Codec<PutScriptRequestMetadataCache>;
6596
+
6482
6597
  interface Metadata2 {
6483
6598
  /** Annotations for the version created by this upload. */
6484
6599
  annotations?: {
@@ -6756,6 +6871,10 @@ interface Metadata2 {
6756
6871
  /** Usage model for the Worker invocations. */
6757
6872
  usageModel?: "standard" | "bundled" | "unbound" | (string & {}) | null;
6758
6873
  containers?: { className: string }[] | null;
6874
+ cache?: {
6875
+ enabled?: boolean | null;
6876
+ crossVersionCache?: boolean | null;
6877
+ } | null;
6759
6878
  }
6760
6879
  const Metadata2 = /*@__PURE__*/ /*#__PURE__*/ Schema.suspend(() =>
6761
6880
  Schema.Struct({
@@ -6862,6 +6981,9 @@ const Metadata2 = /*@__PURE__*/ /*#__PURE__*/ Schema.suspend(() =>
6862
6981
  containers: Schema.optional(
6863
6982
  Schema.Union([Schema.Array(Container), Schema.Null]),
6864
6983
  ),
6984
+ cache: Schema.optional(
6985
+ Schema.Union([PutScriptRequestMetadataCache, Schema.Null]),
6986
+ ),
6865
6987
  }).pipe(
6866
6988
  Schema.encodeKeys({
6867
6989
  annotations: "annotations",
@@ -6882,6 +7004,7 @@ const Metadata2 = /*@__PURE__*/ /*#__PURE__*/ Schema.suspend(() =>
6882
7004
  tailConsumers: "tail_consumers",
6883
7005
  usageModel: "usage_model",
6884
7006
  containers: "containers",
7007
+ cache: "cache_options",
6885
7008
  }),
6886
7009
  ),
6887
7010
  ) as unknown as Schema.Codec<Metadata2>;
@@ -9093,6 +9216,10 @@ interface Metadata5 {
9093
9216
  keepBindings?: string[] | null;
9094
9217
  /** Usage model for the Worker invocations. */
9095
9218
  usageModel?: "standard" | "bundled" | "unbound" | (string & {}) | null;
9219
+ cache?: {
9220
+ enabled?: boolean | null;
9221
+ crossVersionCache?: boolean | null;
9222
+ } | null;
9096
9223
  }
9097
9224
  const Metadata5 = /*@__PURE__*/ /*#__PURE__*/ Schema.suspend(() =>
9098
9225
  Schema.Struct({
@@ -9162,6 +9289,9 @@ const Metadata5 = /*@__PURE__*/ /*#__PURE__*/ Schema.suspend(() =>
9162
9289
  Schema.Null,
9163
9290
  ]),
9164
9291
  ),
9292
+ cache: Schema.optional(
9293
+ Schema.Union([PutScriptRequestMetadataCache, Schema.Null]),
9294
+ ),
9165
9295
  }).pipe(
9166
9296
  Schema.encodeKeys({
9167
9297
  mainModule: "main_module",
@@ -9171,6 +9301,7 @@ const Metadata5 = /*@__PURE__*/ /*#__PURE__*/ Schema.suspend(() =>
9171
9301
  compatibilityFlags: "compatibility_flags",
9172
9302
  keepBindings: "keep_bindings",
9173
9303
  usageModel: "usage_model",
9304
+ cache: "cache_options",
9174
9305
  }),
9175
9306
  ),
9176
9307
  ) as unknown as Schema.Codec<Metadata5>;
@@ -14236,6 +14367,7 @@ export const CreateRouteResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.suspend(
14236
14367
 
14237
14368
  export type CreateRouteError =
14238
14369
  | DefaultErrors
14370
+ | RouteScriptNotFound
14239
14371
  | InvalidRoutePattern
14240
14372
  | InvalidRoute
14241
14373
  | Forbidden;
@@ -14248,7 +14380,7 @@ export const createRoute: API.OperationMethod<
14248
14380
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
14249
14381
  input: CreateRouteRequest,
14250
14382
  output: CreateRouteResponse,
14251
- errors: [InvalidRoutePattern, InvalidRoute, Forbidden],
14383
+ errors: [RouteScriptNotFound, InvalidRoutePattern, InvalidRoute, Forbidden],
14252
14384
  }));
14253
14385
 
14254
14386
  export interface UpdateRouteRequest {
@@ -14814,6 +14946,7 @@ export interface PutScriptRequest {
14814
14946
  | null;
14815
14947
  usageModel?: "standard" | "bundled" | "unbound" | (string & {});
14816
14948
  containers?: { className: string }[];
14949
+ cache?: { enabled?: boolean; crossVersionCache?: boolean };
14817
14950
  };
14818
14951
  /** Body param: An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.<br/ */
14819
14952
  files?: (File | Blob)[];
@@ -15124,7 +15257,18 @@ export type PutScriptError =
15124
15257
  | DurableObjectMustBeSqlite
15125
15258
  | DuplicateMigrationTarget
15126
15259
  | ScriptStartupError
15127
- | ScriptModuleNotFound;
15260
+ | ScriptModuleNotFound
15261
+ | SecretsStoreBindingNotFound
15262
+ | KVNamespaceNotFound
15263
+ | R2BucketNotFound
15264
+ | D1DatabaseNotFound
15265
+ | QueueNotFound
15266
+ | ServiceBindingNotFound
15267
+ | DurableObjectClassNotFound
15268
+ | HyperdriveConfigNotFound
15269
+ | VectorizeIndexNotFound
15270
+ | DispatchNamespaceNotFound
15271
+ | MtlsCertificateNotFound;
15128
15272
 
15129
15273
  export const putScript: API.OperationMethod<
15130
15274
  PutScriptRequest,
@@ -15142,6 +15286,17 @@ export const putScript: API.OperationMethod<
15142
15286
  DuplicateMigrationTarget,
15143
15287
  ScriptStartupError,
15144
15288
  ScriptModuleNotFound,
15289
+ SecretsStoreBindingNotFound,
15290
+ KVNamespaceNotFound,
15291
+ R2BucketNotFound,
15292
+ D1DatabaseNotFound,
15293
+ QueueNotFound,
15294
+ ServiceBindingNotFound,
15295
+ DurableObjectClassNotFound,
15296
+ HyperdriveConfigNotFound,
15297
+ VectorizeIndexNotFound,
15298
+ DispatchNamespaceNotFound,
15299
+ MtlsCertificateNotFound,
15145
15300
  ],
15146
15301
  }));
15147
15302
 
@@ -17624,7 +17779,10 @@ export const GetScriptSettingResponse =
17624
17779
  .pipe(T.ResponsePath("result")),
17625
17780
  ) as unknown as Schema.Codec<GetScriptSettingResponse>;
17626
17781
 
17627
- export type GetScriptSettingError = DefaultErrors | WorkerNotFound;
17782
+ export type GetScriptSettingError =
17783
+ | DefaultErrors
17784
+ | WorkerNotFound
17785
+ | WorkerHasNoVersions;
17628
17786
 
17629
17787
  export const getScriptSetting: API.OperationMethod<
17630
17788
  GetScriptSettingRequest,
@@ -17634,7 +17792,7 @@ export const getScriptSetting: API.OperationMethod<
17634
17792
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
17635
17793
  input: GetScriptSettingRequest,
17636
17794
  output: GetScriptSettingResponse,
17637
- errors: [WorkerNotFound],
17795
+ errors: [WorkerNotFound, WorkerHasNoVersions],
17638
17796
  }));
17639
17797
 
17640
17798
  export interface PatchScriptSettingRequest {
@@ -18580,6 +18738,7 @@ export interface CreateScriptVersionRequest {
18580
18738
  compatibilityFlags?: string[];
18581
18739
  keepBindings?: string[];
18582
18740
  usageModel?: "standard" | "bundled" | "unbound" | (string & {});
18741
+ cache?: { enabled?: boolean; crossVersionCache?: boolean };
18583
18742
  };
18584
18743
  /** Body param: An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.<br/ */
18585
18744
  files?: (File | Blob)[];
package/src/traits.ts CHANGED
@@ -18,7 +18,7 @@ export const errorMatchersSymbol = Symbol.for(
18
18
  export interface ErrorMatcher {
19
19
  code?: number;
20
20
  status?: number;
21
- message?: string | { includes: string };
21
+ message?: string | { includes?: string; matches?: string };
22
22
  }
23
23
 
24
24
  /**