@distilled.cloud/cloudflare 0.19.0 → 0.19.1
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/schemas.d.ts +7 -8
- package/lib/schemas.d.ts.map +1 -1
- package/lib/schemas.js +9 -12
- package/lib/schemas.js.map +1 -1
- package/lib/services/custom-pages.d.ts +40 -13
- package/lib/services/custom-pages.d.ts.map +1 -1
- package/lib/services/custom-pages.js +68 -15
- package/lib/services/custom-pages.js.map +1 -1
- package/lib/services/firewall.d.ts +66 -23
- package/lib/services/firewall.d.ts.map +1 -1
- package/lib/services/firewall.js +120 -26
- package/lib/services/firewall.js.map +1 -1
- package/lib/services/intel.d.ts +2 -0
- package/lib/services/intel.d.ts.map +1 -1
- package/lib/services/intel.js +2 -0
- package/lib/services/intel.js.map +1 -1
- package/lib/services/logpush.d.ts +157 -64
- package/lib/services/logpush.d.ts.map +1 -1
- package/lib/services/logpush.js +292 -63
- package/lib/services/logpush.js.map +1 -1
- package/lib/services/r2.d.ts +29 -2
- package/lib/services/r2.d.ts.map +1 -1
- package/lib/services/r2.js +20 -6
- package/lib/services/r2.js.map +1 -1
- package/lib/services/rulesets.d.ts +200 -65
- package/lib/services/rulesets.d.ts.map +1 -1
- package/lib/services/rulesets.js +371 -75
- package/lib/services/rulesets.js.map +1 -1
- package/lib/services/security-center.d.ts +66 -19
- package/lib/services/security-center.d.ts.map +1 -1
- package/lib/services/security-center.js +128 -22
- package/lib/services/security-center.js.map +1 -1
- package/lib/services/waiting-rooms.d.ts +14 -3
- package/lib/services/waiting-rooms.d.ts.map +1 -1
- package/lib/services/waiting-rooms.js +25 -7
- package/lib/services/waiting-rooms.js.map +1 -1
- package/lib/services/zero-trust.d.ts +579 -204
- package/lib/services/zero-trust.d.ts.map +1 -1
- package/lib/services/zero-trust.js +1159 -268
- package/lib/services/zero-trust.js.map +1 -1
- package/package.json +2 -2
- package/src/schemas.ts +19 -17
- package/src/services/custom-pages.ts +170 -66
- package/src/services/firewall.ts +300 -121
- package/src/services/intel.ts +4 -0
- package/src/services/logpush.ts +798 -372
- package/src/services/r2.ts +66 -9
- package/src/services/rulesets.ts +3991 -3426
- package/src/services/security-center.ts +247 -63
- package/src/services/waiting-rooms.ts +49 -11
- package/src/services/zero-trust.ts +4097 -2417
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distilled.cloud/cloudflare",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/alchemy-run/distilled",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"specs:update": "git -C specs/cloudflare-typescript fetch && git -C specs/cloudflare-typescript checkout main && git -C specs/cloudflare-typescript pull"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@distilled.cloud/core": "0.19.
|
|
66
|
+
"@distilled.cloud/core": "0.19.1"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@effect/platform-node": ">=4.0.0-beta.60 || >=4.0.0",
|
package/src/schemas.ts
CHANGED
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Common schemas for Cloudflare API types.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Cloudflare-specific schemas live here. The cloud-agnostic raw-binary HTTP
|
|
5
|
+
* body schemas (`BinaryBodySchema`, `BinaryStreamResponseSchema`,
|
|
6
|
+
* `Uint8ArraySchema`, etc.) live in `@distilled.cloud/core/schemas` and are
|
|
7
|
+
* re-exported below for convenience.
|
|
5
8
|
*/
|
|
6
9
|
|
|
7
10
|
import * as Schema from "effect/Schema";
|
|
11
|
+
import { BlobSchema } from "@distilled.cloud/core/schemas";
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
ArrayBufferSchema,
|
|
15
|
+
BinaryBodySchema,
|
|
16
|
+
BinaryStreamResponseSchema,
|
|
17
|
+
BlobSchema,
|
|
18
|
+
ReadableStreamSchema,
|
|
19
|
+
StreamSchema,
|
|
20
|
+
Uint8ArraySchema,
|
|
21
|
+
type BinaryBody,
|
|
22
|
+
} from "@distilled.cloud/core/schemas";
|
|
8
23
|
|
|
9
24
|
// =============================================================================
|
|
10
|
-
// File Upload Schemas
|
|
25
|
+
// File Upload Schemas (multipart form-data)
|
|
11
26
|
// =============================================================================
|
|
12
27
|
|
|
13
28
|
/**
|
|
14
29
|
* Schema for File objects (browser File API).
|
|
15
30
|
*
|
|
16
|
-
* Used for multipart form-data file uploads.
|
|
31
|
+
* Used for multipart form-data file uploads (e.g. Workers script bundles,
|
|
32
|
+
* Pages assets, brand-protection submissions).
|
|
17
33
|
*/
|
|
18
34
|
export const FileSchema = Schema.declare(
|
|
19
35
|
(input): input is File =>
|
|
@@ -24,20 +40,6 @@ export const FileSchema = Schema.declare(
|
|
|
24
40
|
},
|
|
25
41
|
);
|
|
26
42
|
|
|
27
|
-
/**
|
|
28
|
-
* Schema for Blob objects.
|
|
29
|
-
*
|
|
30
|
-
* Used for binary data uploads.
|
|
31
|
-
*/
|
|
32
|
-
export const BlobSchema = Schema.declare(
|
|
33
|
-
(input): input is Blob =>
|
|
34
|
-
typeof Blob !== "undefined" && input instanceof Blob,
|
|
35
|
-
{
|
|
36
|
-
identifier: "Blob",
|
|
37
|
-
description: "A Blob object for upload",
|
|
38
|
-
},
|
|
39
|
-
);
|
|
40
|
-
|
|
41
43
|
/**
|
|
42
44
|
* Schema for uploadable content (File or Blob).
|
|
43
45
|
*
|
|
@@ -16,7 +16,22 @@ import { type DefaultErrors } from "../errors.ts";
|
|
|
16
16
|
// CustomPage
|
|
17
17
|
// =============================================================================
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const GetCustomPageBaseFields = {
|
|
20
|
+
identifier: Schema.Literals([
|
|
21
|
+
"1000_errors",
|
|
22
|
+
"500_errors",
|
|
23
|
+
"basic_challenge",
|
|
24
|
+
"country_challenge",
|
|
25
|
+
"ip_block",
|
|
26
|
+
"managed_challenge",
|
|
27
|
+
"ratelimit_block",
|
|
28
|
+
"under_attack",
|
|
29
|
+
"waf_block",
|
|
30
|
+
"waf_challenge",
|
|
31
|
+
]).pipe(T.HttpPath("identifier")),
|
|
32
|
+
} as const;
|
|
33
|
+
|
|
34
|
+
interface GetCustomPageBaseRequest {
|
|
20
35
|
identifier:
|
|
21
36
|
| "1000_errors"
|
|
22
37
|
| "500_errors"
|
|
@@ -30,25 +45,37 @@ export interface GetCustomPageRequest {
|
|
|
30
45
|
| "waf_challenge";
|
|
31
46
|
}
|
|
32
47
|
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
)
|
|
48
|
+
export interface GetCustomPageForAccountRequest extends GetCustomPageBaseRequest {
|
|
49
|
+
/** Path param: The Account ID to use for this endpoint. */
|
|
50
|
+
accountId: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface GetCustomPageForZoneRequest extends GetCustomPageBaseRequest {
|
|
54
|
+
/** Path param: The Zone ID to use for this endpoint. */
|
|
55
|
+
zoneId: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const GetCustomPageForAccountRequest =
|
|
59
|
+
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
60
|
+
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
61
|
+
...GetCustomPageBaseFields,
|
|
62
|
+
}).pipe(
|
|
63
|
+
T.Http({
|
|
64
|
+
method: "GET",
|
|
65
|
+
path: "/accounts/{account_id}/custom_pages/{identifier}",
|
|
66
|
+
}),
|
|
67
|
+
) as unknown as Schema.Schema<GetCustomPageForAccountRequest>;
|
|
68
|
+
|
|
69
|
+
export const GetCustomPageForZoneRequest =
|
|
70
|
+
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
71
|
+
zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
|
|
72
|
+
...GetCustomPageBaseFields,
|
|
73
|
+
}).pipe(
|
|
74
|
+
T.Http({
|
|
75
|
+
method: "GET",
|
|
76
|
+
path: "/zones/{zone_id}/custom_pages/{identifier}",
|
|
77
|
+
}),
|
|
78
|
+
) as unknown as Schema.Schema<GetCustomPageForZoneRequest>;
|
|
52
79
|
|
|
53
80
|
export interface GetCustomPageResponse {
|
|
54
81
|
id?: string | null;
|
|
@@ -95,27 +122,57 @@ export const GetCustomPageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
|
95
122
|
|
|
96
123
|
export type GetCustomPageError = DefaultErrors;
|
|
97
124
|
|
|
98
|
-
export const
|
|
99
|
-
|
|
125
|
+
export const getCustomPageForAccount: API.OperationMethod<
|
|
126
|
+
GetCustomPageForAccountRequest,
|
|
100
127
|
GetCustomPageResponse,
|
|
101
128
|
GetCustomPageError,
|
|
102
129
|
Credentials | HttpClient.HttpClient
|
|
103
130
|
> = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
|
|
104
|
-
input:
|
|
131
|
+
input: GetCustomPageForAccountRequest,
|
|
105
132
|
output: GetCustomPageResponse,
|
|
106
133
|
errors: [],
|
|
107
134
|
}));
|
|
108
135
|
|
|
109
|
-
export
|
|
136
|
+
export const getCustomPageForZone: API.OperationMethod<
|
|
137
|
+
GetCustomPageForZoneRequest,
|
|
138
|
+
GetCustomPageResponse,
|
|
139
|
+
GetCustomPageError,
|
|
140
|
+
Credentials | HttpClient.HttpClient
|
|
141
|
+
> = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
|
|
142
|
+
input: GetCustomPageForZoneRequest,
|
|
143
|
+
output: GetCustomPageResponse,
|
|
144
|
+
errors: [],
|
|
145
|
+
}));
|
|
110
146
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
147
|
+
const ListCustomPagesBaseFields = {} as const;
|
|
148
|
+
|
|
149
|
+
interface ListCustomPagesBaseRequest {}
|
|
150
|
+
|
|
151
|
+
export interface ListCustomPagesForAccountRequest extends ListCustomPagesBaseRequest {
|
|
152
|
+
/** Path param: The Account ID to use for this endpoint. */
|
|
153
|
+
accountId: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface ListCustomPagesForZoneRequest extends ListCustomPagesBaseRequest {
|
|
157
|
+
/** Path param: The Zone ID to use for this endpoint. */
|
|
158
|
+
zoneId: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const ListCustomPagesForAccountRequest =
|
|
162
|
+
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
163
|
+
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
164
|
+
...ListCustomPagesBaseFields,
|
|
165
|
+
}).pipe(
|
|
166
|
+
T.Http({ method: "GET", path: "/accounts/{account_id}/custom_pages" }),
|
|
167
|
+
) as unknown as Schema.Schema<ListCustomPagesForAccountRequest>;
|
|
168
|
+
|
|
169
|
+
export const ListCustomPagesForZoneRequest =
|
|
170
|
+
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
171
|
+
zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
|
|
172
|
+
...ListCustomPagesBaseFields,
|
|
173
|
+
}).pipe(
|
|
174
|
+
T.Http({ method: "GET", path: "/zones/{zone_id}/custom_pages" }),
|
|
175
|
+
) as unknown as Schema.Schema<ListCustomPagesForZoneRequest>;
|
|
119
176
|
|
|
120
177
|
export interface ListCustomPagesResponse {
|
|
121
178
|
result: {
|
|
@@ -170,13 +227,28 @@ export const ListCustomPagesResponse =
|
|
|
170
227
|
|
|
171
228
|
export type ListCustomPagesError = DefaultErrors;
|
|
172
229
|
|
|
173
|
-
export const
|
|
174
|
-
|
|
230
|
+
export const listCustomPagesForAccount: API.PaginatedOperationMethod<
|
|
231
|
+
ListCustomPagesForAccountRequest,
|
|
232
|
+
ListCustomPagesResponse,
|
|
233
|
+
ListCustomPagesError,
|
|
234
|
+
Credentials | HttpClient.HttpClient
|
|
235
|
+
> = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
|
|
236
|
+
input: ListCustomPagesForAccountRequest,
|
|
237
|
+
output: ListCustomPagesResponse,
|
|
238
|
+
errors: [],
|
|
239
|
+
pagination: {
|
|
240
|
+
mode: "single",
|
|
241
|
+
items: "result",
|
|
242
|
+
} as const,
|
|
243
|
+
}));
|
|
244
|
+
|
|
245
|
+
export const listCustomPagesForZone: API.PaginatedOperationMethod<
|
|
246
|
+
ListCustomPagesForZoneRequest,
|
|
175
247
|
ListCustomPagesResponse,
|
|
176
248
|
ListCustomPagesError,
|
|
177
249
|
Credentials | HttpClient.HttpClient
|
|
178
250
|
> = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
|
|
179
|
-
input:
|
|
251
|
+
input: ListCustomPagesForZoneRequest,
|
|
180
252
|
output: ListCustomPagesResponse,
|
|
181
253
|
errors: [],
|
|
182
254
|
pagination: {
|
|
@@ -185,7 +257,24 @@ export const listCustomPages: API.PaginatedOperationMethod<
|
|
|
185
257
|
} as const,
|
|
186
258
|
}));
|
|
187
259
|
|
|
188
|
-
|
|
260
|
+
const PutCustomPageBaseFields = {
|
|
261
|
+
identifier: Schema.Literals([
|
|
262
|
+
"1000_errors",
|
|
263
|
+
"500_errors",
|
|
264
|
+
"basic_challenge",
|
|
265
|
+
"country_challenge",
|
|
266
|
+
"ip_block",
|
|
267
|
+
"managed_challenge",
|
|
268
|
+
"ratelimit_block",
|
|
269
|
+
"under_attack",
|
|
270
|
+
"waf_block",
|
|
271
|
+
"waf_challenge",
|
|
272
|
+
]).pipe(T.HttpPath("identifier")),
|
|
273
|
+
state: Schema.Literals(["default", "customized"]),
|
|
274
|
+
url: Schema.String,
|
|
275
|
+
} as const;
|
|
276
|
+
|
|
277
|
+
interface PutCustomPageBaseRequest {
|
|
189
278
|
identifier:
|
|
190
279
|
| "1000_errors"
|
|
191
280
|
| "500_errors"
|
|
@@ -197,39 +286,43 @@ export interface PutCustomPageRequest {
|
|
|
197
286
|
| "under_attack"
|
|
198
287
|
| "waf_block"
|
|
199
288
|
| "waf_challenge";
|
|
200
|
-
/** Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */
|
|
201
|
-
accountId?: string;
|
|
202
|
-
/** Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */
|
|
203
|
-
zoneId?: string;
|
|
204
289
|
/** Body param: The custom page state. */
|
|
205
290
|
state: "default" | "customized";
|
|
206
291
|
/** Body param: The URL associated with the custom page. */
|
|
207
292
|
url: string;
|
|
208
293
|
}
|
|
209
294
|
|
|
210
|
-
export
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
295
|
+
export interface PutCustomPageForAccountRequest extends PutCustomPageBaseRequest {
|
|
296
|
+
/** Path param: The Account ID to use for this endpoint. */
|
|
297
|
+
accountId: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface PutCustomPageForZoneRequest extends PutCustomPageBaseRequest {
|
|
301
|
+
/** Path param: The Zone ID to use for this endpoint. */
|
|
302
|
+
zoneId: string;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export const PutCustomPageForAccountRequest =
|
|
306
|
+
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
307
|
+
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
308
|
+
...PutCustomPageBaseFields,
|
|
309
|
+
}).pipe(
|
|
310
|
+
T.Http({
|
|
311
|
+
method: "PUT",
|
|
312
|
+
path: "/accounts/{account_id}/custom_pages/{identifier}",
|
|
313
|
+
}),
|
|
314
|
+
) as unknown as Schema.Schema<PutCustomPageForAccountRequest>;
|
|
315
|
+
|
|
316
|
+
export const PutCustomPageForZoneRequest =
|
|
317
|
+
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
318
|
+
zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
|
|
319
|
+
...PutCustomPageBaseFields,
|
|
320
|
+
}).pipe(
|
|
321
|
+
T.Http({
|
|
322
|
+
method: "PUT",
|
|
323
|
+
path: "/zones/{zone_id}/custom_pages/{identifier}",
|
|
324
|
+
}),
|
|
325
|
+
) as unknown as Schema.Schema<PutCustomPageForZoneRequest>;
|
|
233
326
|
|
|
234
327
|
export interface PutCustomPageResponse {
|
|
235
328
|
id?: string | null;
|
|
@@ -276,13 +369,24 @@ export const PutCustomPageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
|
276
369
|
|
|
277
370
|
export type PutCustomPageError = DefaultErrors;
|
|
278
371
|
|
|
279
|
-
export const
|
|
280
|
-
|
|
372
|
+
export const putCustomPageForAccount: API.OperationMethod<
|
|
373
|
+
PutCustomPageForAccountRequest,
|
|
374
|
+
PutCustomPageResponse,
|
|
375
|
+
PutCustomPageError,
|
|
376
|
+
Credentials | HttpClient.HttpClient
|
|
377
|
+
> = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
|
|
378
|
+
input: PutCustomPageForAccountRequest,
|
|
379
|
+
output: PutCustomPageResponse,
|
|
380
|
+
errors: [],
|
|
381
|
+
}));
|
|
382
|
+
|
|
383
|
+
export const putCustomPageForZone: API.OperationMethod<
|
|
384
|
+
PutCustomPageForZoneRequest,
|
|
281
385
|
PutCustomPageResponse,
|
|
282
386
|
PutCustomPageError,
|
|
283
387
|
Credentials | HttpClient.HttpClient
|
|
284
388
|
> = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
|
|
285
|
-
input:
|
|
389
|
+
input: PutCustomPageForZoneRequest,
|
|
286
390
|
output: PutCustomPageResponse,
|
|
287
391
|
errors: [],
|
|
288
392
|
}));
|