@distilled.cloud/cloudflare 0.22.3 → 0.22.4

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 (101) hide show
  1. package/lib/services/abuse-reports.d.ts +39 -11
  2. package/lib/services/abuse-reports.d.ts.map +1 -1
  3. package/lib/services/abuse-reports.js +89 -11
  4. package/lib/services/abuse-reports.js.map +1 -1
  5. package/lib/services/accounts.d.ts +21 -1
  6. package/lib/services/accounts.d.ts.map +1 -1
  7. package/lib/services/accounts.js +33 -1
  8. package/lib/services/accounts.js.map +1 -1
  9. package/lib/services/ai.d.ts +97 -1
  10. package/lib/services/ai.d.ts.map +1 -1
  11. package/lib/services/ai.js +119 -2
  12. package/lib/services/ai.js.map +1 -1
  13. package/lib/services/bot-management.d.ts +16 -0
  14. package/lib/services/bot-management.d.ts.map +1 -1
  15. package/lib/services/bot-management.js +22 -0
  16. package/lib/services/bot-management.js.map +1 -1
  17. package/lib/services/browser-rendering.d.ts +25 -9
  18. package/lib/services/browser-rendering.d.ts.map +1 -1
  19. package/lib/services/browser-rendering.js +18 -9
  20. package/lib/services/browser-rendering.js.map +1 -1
  21. package/lib/services/cache.d.ts +11 -0
  22. package/lib/services/cache.d.ts.map +1 -1
  23. package/lib/services/cache.js +17 -1
  24. package/lib/services/cache.js.map +1 -1
  25. package/lib/services/connectivity.d.ts +18 -32
  26. package/lib/services/connectivity.d.ts.map +1 -1
  27. package/lib/services/connectivity.js +56 -66
  28. package/lib/services/connectivity.js.map +1 -1
  29. package/lib/services/d1.d.ts +18 -4
  30. package/lib/services/d1.d.ts.map +1 -1
  31. package/lib/services/d1.js +23 -5
  32. package/lib/services/d1.js.map +1 -1
  33. package/lib/services/dns.d.ts +129 -3
  34. package/lib/services/dns.d.ts.map +1 -1
  35. package/lib/services/dns.js +330 -6
  36. package/lib/services/dns.js.map +1 -1
  37. package/lib/services/magic-transit.d.ts +7 -1
  38. package/lib/services/magic-transit.d.ts.map +1 -1
  39. package/lib/services/magic-transit.js +7 -1
  40. package/lib/services/magic-transit.js.map +1 -1
  41. package/lib/services/network-interconnects.d.ts +5 -1
  42. package/lib/services/network-interconnects.d.ts.map +1 -1
  43. package/lib/services/network-interconnects.js +21 -1
  44. package/lib/services/network-interconnects.js.map +1 -1
  45. package/lib/services/queues.d.ts +6 -4
  46. package/lib/services/queues.d.ts.map +1 -1
  47. package/lib/services/queues.js +8 -4
  48. package/lib/services/queues.js.map +1 -1
  49. package/lib/services/r2.d.ts +11 -4
  50. package/lib/services/r2.d.ts.map +1 -1
  51. package/lib/services/r2.js +13 -4
  52. package/lib/services/r2.js.map +1 -1
  53. package/lib/services/resource-tagging.d.ts +4 -2
  54. package/lib/services/resource-tagging.d.ts.map +1 -1
  55. package/lib/services/resource-tagging.js +4 -1
  56. package/lib/services/resource-tagging.js.map +1 -1
  57. package/lib/services/rulesets.d.ts +510 -6
  58. package/lib/services/rulesets.d.ts.map +1 -1
  59. package/lib/services/rulesets.js +1298 -36
  60. package/lib/services/rulesets.js.map +1 -1
  61. package/lib/services/spectrum.d.ts +4 -8
  62. package/lib/services/spectrum.d.ts.map +1 -1
  63. package/lib/services/spectrum.js +12 -34
  64. package/lib/services/spectrum.js.map +1 -1
  65. package/lib/services/workers-for-platforms.d.ts +12 -2
  66. package/lib/services/workers-for-platforms.d.ts.map +1 -1
  67. package/lib/services/workers-for-platforms.js +35 -3
  68. package/lib/services/workers-for-platforms.js.map +1 -1
  69. package/lib/services/workers.d.ts +12 -2
  70. package/lib/services/workers.d.ts.map +1 -1
  71. package/lib/services/workers.js +35 -3
  72. package/lib/services/workers.js.map +1 -1
  73. package/lib/services/zero-trust.d.ts +1463 -557
  74. package/lib/services/zero-trust.d.ts.map +1 -1
  75. package/lib/services/zero-trust.js +1654 -93
  76. package/lib/services/zero-trust.js.map +1 -1
  77. package/lib/services/zones.d.ts +2 -0
  78. package/lib/services/zones.d.ts.map +1 -1
  79. package/lib/services/zones.js +1 -0
  80. package/lib/services/zones.js.map +1 -1
  81. package/package.json +2 -2
  82. package/src/services/abuse-reports.ts +173 -22
  83. package/src/services/accounts.ts +66 -2
  84. package/src/services/ai.ts +235 -2
  85. package/src/services/bot-management.ts +48 -0
  86. package/src/services/browser-rendering.ts +43 -18
  87. package/src/services/cache.ts +31 -0
  88. package/src/services/connectivity.ts +78 -70
  89. package/src/services/d1.ts +43 -8
  90. package/src/services/dns.ts +549 -12
  91. package/src/services/magic-transit.ts +14 -2
  92. package/src/services/network-interconnects.ts +41 -2
  93. package/src/services/queues.ts +16 -8
  94. package/src/services/r2.ts +30 -7
  95. package/src/services/resource-tagging.ts +8 -2
  96. package/src/services/rulesets.ts +3283 -963
  97. package/src/services/spectrum.ts +36 -52
  98. package/src/services/workers-for-platforms.ts +63 -4
  99. package/src/services/workers.ts +63 -4
  100. package/src/services/zero-trust.ts +3071 -478
  101. package/src/services/zones.ts +3 -0
@@ -1027,16 +1027,15 @@ export interface CreateAppRequest {
1027
1027
  /** Body param: The port configuration at Cloudflare's edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. */
1028
1028
  protocol: string;
1029
1029
  /** Body param: Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol */
1030
- trafficType: "direct" | "http" | "https" | (string & {});
1030
+ trafficType?: "direct" | "http" | "https" | (string & {});
1031
1031
  /** Body param: Enables Argo Smart Routing for this application. Notes: Only available for TCP applications with traffic_type set to "direct". */
1032
1032
  argoSmartRouting?: boolean;
1033
1033
  /** Body param: The anycast edge IP configuration for the hostname of this application. */
1034
- edgeIps?:
1035
- | {
1036
- connectivity?: "all" | "ipv4" | "ipv6" | (string & {});
1037
- type?: "dynamic";
1038
- }
1039
- | { ips?: string[]; type?: "static" };
1034
+ edgeIps?: {
1035
+ connectivity?: "all" | "ipv4" | "ipv6" | (string & {});
1036
+ type?: "dynamic" | "static" | (string & {});
1037
+ ips?: string[];
1038
+ };
1040
1039
  /** Body param: Enables IP Access Rules for this application. Notes: Only available for TCP applications. */
1041
1040
  ipFirewall?: boolean;
1042
1041
  /** Body param: List of origin IP addresses. Array may contain multiple IP addresses for load balancing. */
@@ -1066,27 +1065,20 @@ export const CreateAppRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1066
1065
  ),
1067
1066
  }),
1068
1067
  protocol: Schema.String,
1069
- trafficType: Schema.Union([
1070
- Schema.Literals(["direct", "http", "https"]),
1071
- Schema.String,
1072
- ]),
1068
+ trafficType: Schema.optional(
1069
+ Schema.Union([Schema.Literals(["direct", "http", "https"]), Schema.String]),
1070
+ ),
1073
1071
  argoSmartRouting: Schema.optional(Schema.Boolean),
1074
1072
  edgeIps: Schema.optional(
1075
- Schema.Union([
1076
- Schema.Struct({
1077
- connectivity: Schema.optional(
1078
- Schema.Union([
1079
- Schema.Literals(["all", "ipv4", "ipv6"]),
1080
- Schema.String,
1081
- ]),
1082
- ),
1083
- type: Schema.optional(Schema.Literal("dynamic")),
1084
- }),
1085
- Schema.Struct({
1086
- ips: Schema.optional(Schema.Array(Schema.String)),
1087
- type: Schema.optional(Schema.Literal("static")),
1088
- }),
1089
- ]),
1073
+ Schema.Struct({
1074
+ connectivity: Schema.optional(
1075
+ Schema.Union([Schema.Literals(["all", "ipv4", "ipv6"]), Schema.String]),
1076
+ ),
1077
+ type: Schema.optional(
1078
+ Schema.Union([Schema.Literals(["dynamic", "static"]), Schema.String]),
1079
+ ),
1080
+ ips: Schema.optional(Schema.Array(Schema.String)),
1081
+ }),
1090
1082
  ),
1091
1083
  ipFirewall: Schema.optional(Schema.Boolean),
1092
1084
  originDirect: Schema.optional(Schema.Array(Schema.String)),
@@ -1346,16 +1338,15 @@ export interface UpdateAppRequest {
1346
1338
  /** Body param: The port configuration at Cloudflare's edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. */
1347
1339
  protocol: string;
1348
1340
  /** Body param: Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol */
1349
- trafficType: "direct" | "http" | "https" | (string & {});
1341
+ trafficType?: "direct" | "http" | "https" | (string & {});
1350
1342
  /** Body param: Enables Argo Smart Routing for this application. Notes: Only available for TCP applications with traffic_type set to "direct". */
1351
1343
  argoSmartRouting?: boolean;
1352
1344
  /** Body param: The anycast edge IP configuration for the hostname of this application. */
1353
- edgeIps?:
1354
- | {
1355
- connectivity?: "all" | "ipv4" | "ipv6" | (string & {});
1356
- type?: "dynamic";
1357
- }
1358
- | { ips?: string[]; type?: "static" };
1345
+ edgeIps?: {
1346
+ connectivity?: "all" | "ipv4" | "ipv6" | (string & {});
1347
+ type?: "dynamic" | "static" | (string & {});
1348
+ ips?: string[];
1349
+ };
1359
1350
  /** Body param: Enables IP Access Rules for this application. Notes: Only available for TCP applications. */
1360
1351
  ipFirewall?: boolean;
1361
1352
  /** Body param: List of origin IP addresses. Array may contain multiple IP addresses for load balancing. */
@@ -1386,27 +1377,20 @@ export const UpdateAppRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1386
1377
  ),
1387
1378
  }),
1388
1379
  protocol: Schema.String,
1389
- trafficType: Schema.Union([
1390
- Schema.Literals(["direct", "http", "https"]),
1391
- Schema.String,
1392
- ]),
1380
+ trafficType: Schema.optional(
1381
+ Schema.Union([Schema.Literals(["direct", "http", "https"]), Schema.String]),
1382
+ ),
1393
1383
  argoSmartRouting: Schema.optional(Schema.Boolean),
1394
1384
  edgeIps: Schema.optional(
1395
- Schema.Union([
1396
- Schema.Struct({
1397
- connectivity: Schema.optional(
1398
- Schema.Union([
1399
- Schema.Literals(["all", "ipv4", "ipv6"]),
1400
- Schema.String,
1401
- ]),
1402
- ),
1403
- type: Schema.optional(Schema.Literal("dynamic")),
1404
- }),
1405
- Schema.Struct({
1406
- ips: Schema.optional(Schema.Array(Schema.String)),
1407
- type: Schema.optional(Schema.Literal("static")),
1408
- }),
1409
- ]),
1385
+ Schema.Struct({
1386
+ connectivity: Schema.optional(
1387
+ Schema.Union([Schema.Literals(["all", "ipv4", "ipv6"]), Schema.String]),
1388
+ ),
1389
+ type: Schema.optional(
1390
+ Schema.Union([Schema.Literals(["dynamic", "static"]), Schema.String]),
1391
+ ),
1392
+ ips: Schema.optional(Schema.Array(Schema.String)),
1393
+ }),
1410
1394
  ),
1411
1395
  ipFirewall: Schema.optional(Schema.Boolean),
1412
1396
  originDirect: Schema.optional(Schema.Array(Schema.String)),
@@ -4009,9 +4009,29 @@ export interface PutDispatchNamespaceScriptSecretRequest {
4009
4009
  /** Body param: A JavaScript variable name for the binding. */
4010
4010
  name: string;
4011
4011
  /** Body param: The secret value to use. */
4012
- text: string;
4012
+ text?: string;
4013
4013
  /** Body param: The kind of resource that the binding provides. */
4014
- type: "secret_text";
4014
+ type: "secret_text" | "secret_key" | (string & {});
4015
+ /** Body param: Algorithm-specific key parameters. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). */
4016
+ algorithm?: unknown;
4017
+ /** Body param: Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format). */
4018
+ format?: "raw" | "pkcs8" | "spki" | "jwk" | (string & {});
4019
+ /** Body param: Allowed operations with the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages). */
4020
+ usages?: (
4021
+ | "encrypt"
4022
+ | "decrypt"
4023
+ | "sign"
4024
+ | "verify"
4025
+ | "deriveKey"
4026
+ | "deriveBits"
4027
+ | "wrapKey"
4028
+ | "unwrapKey"
4029
+ | (string & {})
4030
+ )[];
4031
+ /** Body param: Base64-encoded key data. Required if `format` is "raw", "pkcs8", or "spki". */
4032
+ keyBase64?: string;
4033
+ /** Body param: Key data in [JSON Web Key](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#json_web_key) format. Required if `format` is "jwk". */
4034
+ keyJwk?: unknown;
4015
4035
  }
4016
4036
 
4017
4037
  export const PutDispatchNamespaceScriptSecretRequest =
@@ -4020,9 +4040,48 @@ export const PutDispatchNamespaceScriptSecretRequest =
4020
4040
  scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
4021
4041
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
4022
4042
  name: Schema.String,
4023
- text: Schema.String,
4024
- type: Schema.Literal("secret_text"),
4043
+ text: Schema.optional(Schema.String),
4044
+ type: Schema.Union([
4045
+ Schema.Literals(["secret_text", "secret_key"]),
4046
+ Schema.String,
4047
+ ]),
4048
+ algorithm: Schema.optional(Schema.Unknown),
4049
+ format: Schema.optional(
4050
+ Schema.Union([
4051
+ Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
4052
+ Schema.String,
4053
+ ]),
4054
+ ),
4055
+ usages: Schema.optional(
4056
+ Schema.Array(
4057
+ Schema.Union([
4058
+ Schema.Literals([
4059
+ "encrypt",
4060
+ "decrypt",
4061
+ "sign",
4062
+ "verify",
4063
+ "deriveKey",
4064
+ "deriveBits",
4065
+ "wrapKey",
4066
+ "unwrapKey",
4067
+ ]),
4068
+ Schema.String,
4069
+ ]),
4070
+ ),
4071
+ ),
4072
+ keyBase64: Schema.optional(Schema.String),
4073
+ keyJwk: Schema.optional(Schema.Unknown),
4025
4074
  }).pipe(
4075
+ Schema.encodeKeys({
4076
+ name: "name",
4077
+ text: "text",
4078
+ type: "type",
4079
+ algorithm: "algorithm",
4080
+ format: "format",
4081
+ usages: "usages",
4082
+ keyBase64: "key_base64",
4083
+ keyJwk: "key_jwk",
4084
+ }),
4026
4085
  T.Http({
4027
4086
  method: "PUT",
4028
4087
  path: "/accounts/{account_id}/workers/dispatch/namespaces/{dispatchNamespace}/scripts/{scriptName}/secrets",
@@ -16559,9 +16559,29 @@ export interface PutScriptSecretRequest {
16559
16559
  /** Body param: A JavaScript variable name for the binding. */
16560
16560
  name: string;
16561
16561
  /** Body param: The secret value to use. */
16562
- text: string;
16562
+ text?: string;
16563
16563
  /** Body param: The kind of resource that the binding provides. */
16564
- type: "secret_text";
16564
+ type: "secret_text" | "secret_key" | (string & {});
16565
+ /** Body param: Algorithm-specific key parameters. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). */
16566
+ algorithm?: unknown;
16567
+ /** Body param: Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format). */
16568
+ format?: "raw" | "pkcs8" | "spki" | "jwk" | (string & {});
16569
+ /** Body param: Allowed operations with the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages). */
16570
+ usages?: (
16571
+ | "encrypt"
16572
+ | "decrypt"
16573
+ | "sign"
16574
+ | "verify"
16575
+ | "deriveKey"
16576
+ | "deriveBits"
16577
+ | "wrapKey"
16578
+ | "unwrapKey"
16579
+ | (string & {})
16580
+ )[];
16581
+ /** Body param: Base64-encoded key data. Required if `format` is "raw", "pkcs8", or "spki". */
16582
+ keyBase64?: string;
16583
+ /** Body param: Key data in [JSON Web Key](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#json_web_key) format. Required if `format` is "jwk". */
16584
+ keyJwk?: unknown;
16565
16585
  }
16566
16586
 
16567
16587
  export const PutScriptSecretRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
@@ -16569,10 +16589,49 @@ export const PutScriptSecretRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
16569
16589
  scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
16570
16590
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
16571
16591
  name: Schema.String,
16572
- text: Schema.String,
16573
- type: Schema.Literal("secret_text"),
16592
+ text: Schema.optional(Schema.String),
16593
+ type: Schema.Union([
16594
+ Schema.Literals(["secret_text", "secret_key"]),
16595
+ Schema.String,
16596
+ ]),
16597
+ algorithm: Schema.optional(Schema.Unknown),
16598
+ format: Schema.optional(
16599
+ Schema.Union([
16600
+ Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
16601
+ Schema.String,
16602
+ ]),
16603
+ ),
16604
+ usages: Schema.optional(
16605
+ Schema.Array(
16606
+ Schema.Union([
16607
+ Schema.Literals([
16608
+ "encrypt",
16609
+ "decrypt",
16610
+ "sign",
16611
+ "verify",
16612
+ "deriveKey",
16613
+ "deriveBits",
16614
+ "wrapKey",
16615
+ "unwrapKey",
16616
+ ]),
16617
+ Schema.String,
16618
+ ]),
16619
+ ),
16620
+ ),
16621
+ keyBase64: Schema.optional(Schema.String),
16622
+ keyJwk: Schema.optional(Schema.Unknown),
16574
16623
  },
16575
16624
  ).pipe(
16625
+ Schema.encodeKeys({
16626
+ name: "name",
16627
+ text: "text",
16628
+ type: "type",
16629
+ algorithm: "algorithm",
16630
+ format: "format",
16631
+ usages: "usages",
16632
+ keyBase64: "key_base64",
16633
+ keyJwk: "key_jwk",
16634
+ }),
16576
16635
  T.Http({
16577
16636
  method: "PUT",
16578
16637
  path: "/accounts/{account_id}/workers/scripts/{scriptName}/secrets",