@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
@@ -8548,18 +8548,655 @@ export const listPhasVersionsForZone = /*@__PURE__*/ /*#__PURE__*/ API.makePagin
8548
8548
  const CreateRuleBaseFields = {
8549
8549
  rulesetId: Schema.String.pipe(T.HttpPath("rulesetId")),
8550
8550
  id: Schema.optional(Schema.String),
8551
- action: Schema.optional(Schema.Literal("block")),
8552
- actionParameters: Schema.optional(Schema.Struct({
8553
- response: Schema.optional(Schema.Struct({
8551
+ action: Schema.optional(Schema.Union([
8552
+ Schema.Literals([
8553
+ "block",
8554
+ "challenge",
8555
+ "compress_response",
8556
+ "ddos_dynamic",
8557
+ "execute",
8558
+ "force_connection_close",
8559
+ "js_challenge",
8560
+ "log",
8561
+ "log_custom_field",
8562
+ "managed_challenge",
8563
+ "redirect",
8564
+ "rewrite",
8565
+ "route",
8566
+ "score",
8567
+ "serve_error",
8568
+ "set_cache_control",
8569
+ "set_cache_settings",
8570
+ "set_cache_tags",
8571
+ "set_config",
8572
+ "skip",
8573
+ ]),
8574
+ Schema.String,
8575
+ ])),
8576
+ actionParameters: Schema.optional(Schema.Union([
8577
+ Schema.Struct({
8578
+ operation: Schema.Union([
8579
+ Schema.Literals(["add", "remove", "set"]),
8580
+ Schema.String,
8581
+ ]),
8582
+ values: Schema.Array(Schema.String),
8583
+ }),
8584
+ Schema.Struct({
8585
+ expression: Schema.String,
8586
+ operation: Schema.Union([
8587
+ Schema.Literals(["add", "remove", "set"]),
8588
+ Schema.String,
8589
+ ]),
8590
+ }),
8591
+ Schema.Struct({
8592
+ algorithms: Schema.Array(Schema.Struct({
8593
+ name: Schema.optional(Schema.Union([
8594
+ Schema.Literals([
8595
+ "none",
8596
+ "auto",
8597
+ "default",
8598
+ "gzip",
8599
+ "brotli",
8600
+ "zstd",
8601
+ ]),
8602
+ Schema.String,
8603
+ ])),
8604
+ })),
8605
+ }),
8606
+ Schema.Struct({
8607
+ id: Schema.String,
8608
+ matchedData: Schema.optional(Schema.Struct({
8609
+ publicKey: Schema.String,
8610
+ }).pipe(Schema.encodeKeys({ publicKey: "public_key" }))),
8611
+ overrides: Schema.optional(Schema.Struct({
8612
+ action: Schema.optional(Schema.String),
8613
+ categories: Schema.optional(Schema.Array(Schema.Struct({
8614
+ category: Schema.String,
8615
+ action: Schema.optional(Schema.String),
8616
+ enabled: Schema.optional(Schema.Boolean),
8617
+ sensitivityLevel: Schema.optional(Schema.Union([
8618
+ Schema.Literals(["default", "medium", "low", "eoff"]),
8619
+ Schema.String,
8620
+ ])),
8621
+ }).pipe(Schema.encodeKeys({
8622
+ category: "category",
8623
+ action: "action",
8624
+ enabled: "enabled",
8625
+ sensitivityLevel: "sensitivity_level",
8626
+ })))),
8627
+ enabled: Schema.optional(Schema.Boolean),
8628
+ rules: Schema.optional(Schema.Array(Schema.Struct({
8629
+ id: Schema.String,
8630
+ action: Schema.optional(Schema.String),
8631
+ enabled: Schema.optional(Schema.Boolean),
8632
+ scoreThreshold: Schema.optional(Schema.Number),
8633
+ sensitivityLevel: Schema.optional(Schema.Union([
8634
+ Schema.Literals(["default", "medium", "low", "eoff"]),
8635
+ Schema.String,
8636
+ ])),
8637
+ }).pipe(Schema.encodeKeys({
8638
+ id: "id",
8639
+ action: "action",
8640
+ enabled: "enabled",
8641
+ scoreThreshold: "score_threshold",
8642
+ sensitivityLevel: "sensitivity_level",
8643
+ })))),
8644
+ sensitivityLevel: Schema.optional(Schema.Union([
8645
+ Schema.Literals(["default", "medium", "low", "eoff"]),
8646
+ Schema.String,
8647
+ ])),
8648
+ }).pipe(Schema.encodeKeys({
8649
+ action: "action",
8650
+ categories: "categories",
8651
+ enabled: "enabled",
8652
+ rules: "rules",
8653
+ sensitivityLevel: "sensitivity_level",
8654
+ }))),
8655
+ }).pipe(Schema.encodeKeys({
8656
+ id: "id",
8657
+ matchedData: "matched_data",
8658
+ overrides: "overrides",
8659
+ })),
8660
+ Schema.Struct({
8661
+ increment: Schema.Number,
8662
+ }),
8663
+ Schema.Struct({
8554
8664
  content: Schema.String,
8555
- contentType: Schema.String,
8556
- statusCode: Schema.Number,
8665
+ contentType: Schema.optional(Schema.Union([
8666
+ Schema.Literals([
8667
+ "application/json",
8668
+ "text/html",
8669
+ "text/plain",
8670
+ "text/xml",
8671
+ ]),
8672
+ Schema.String,
8673
+ ])),
8674
+ statusCode: Schema.optional(Schema.Number),
8557
8675
  }).pipe(Schema.encodeKeys({
8558
8676
  content: "content",
8559
8677
  contentType: "content_type",
8560
8678
  statusCode: "status_code",
8561
- }))),
8562
- })),
8679
+ })),
8680
+ Schema.Struct({
8681
+ assetName: Schema.String,
8682
+ contentType: Schema.optional(Schema.Union([
8683
+ Schema.Literals([
8684
+ "application/json",
8685
+ "text/html",
8686
+ "text/plain",
8687
+ "text/xml",
8688
+ ]),
8689
+ Schema.String,
8690
+ ])),
8691
+ statusCode: Schema.optional(Schema.Number),
8692
+ }).pipe(Schema.encodeKeys({
8693
+ assetName: "asset_name",
8694
+ contentType: "content_type",
8695
+ statusCode: "status_code",
8696
+ })),
8697
+ Schema.Struct({
8698
+ response: Schema.optional(Schema.Struct({
8699
+ content: Schema.String,
8700
+ contentType: Schema.String,
8701
+ statusCode: Schema.Number,
8702
+ }).pipe(Schema.encodeKeys({
8703
+ content: "content",
8704
+ contentType: "content_type",
8705
+ statusCode: "status_code",
8706
+ }))),
8707
+ }),
8708
+ Schema.Struct({
8709
+ cookieFields: Schema.optional(Schema.Array(Schema.Struct({
8710
+ name: Schema.String,
8711
+ }))),
8712
+ rawResponseFields: Schema.optional(Schema.Array(Schema.Struct({
8713
+ name: Schema.String,
8714
+ preserveDuplicates: Schema.optional(Schema.Boolean),
8715
+ }).pipe(Schema.encodeKeys({
8716
+ name: "name",
8717
+ preserveDuplicates: "preserve_duplicates",
8718
+ })))),
8719
+ requestFields: Schema.optional(Schema.Array(Schema.Struct({
8720
+ name: Schema.String,
8721
+ }))),
8722
+ responseFields: Schema.optional(Schema.Array(Schema.Struct({
8723
+ name: Schema.String,
8724
+ preserveDuplicates: Schema.optional(Schema.Boolean),
8725
+ }).pipe(Schema.encodeKeys({
8726
+ name: "name",
8727
+ preserveDuplicates: "preserve_duplicates",
8728
+ })))),
8729
+ transformedRequestFields: Schema.optional(Schema.Array(Schema.Struct({
8730
+ name: Schema.String,
8731
+ }))),
8732
+ }).pipe(Schema.encodeKeys({
8733
+ cookieFields: "cookie_fields",
8734
+ rawResponseFields: "raw_response_fields",
8735
+ requestFields: "request_fields",
8736
+ responseFields: "response_fields",
8737
+ transformedRequestFields: "transformed_request_fields",
8738
+ })),
8739
+ Schema.Struct({
8740
+ fromList: Schema.optional(Schema.Struct({
8741
+ key: Schema.String,
8742
+ name: Schema.String,
8743
+ })),
8744
+ fromValue: Schema.optional(Schema.Struct({
8745
+ targetUrl: Schema.Struct({
8746
+ expression: Schema.optional(Schema.String),
8747
+ value: Schema.optional(Schema.String),
8748
+ }),
8749
+ preserveQueryString: Schema.optional(Schema.Boolean),
8750
+ statusCode: Schema.optional(Schema.Union([
8751
+ Schema.Literals(["301", "302", "303", "307", "308"]),
8752
+ Schema.String,
8753
+ ])),
8754
+ }).pipe(Schema.encodeKeys({
8755
+ targetUrl: "target_url",
8756
+ preserveQueryString: "preserve_query_string",
8757
+ statusCode: "status_code",
8758
+ }))),
8759
+ }).pipe(Schema.encodeKeys({ fromList: "from_list", fromValue: "from_value" })),
8760
+ Schema.Struct({
8761
+ headers: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
8762
+ uri: Schema.optional(Schema.Union([
8763
+ Schema.Struct({
8764
+ path: Schema.Struct({
8765
+ expression: Schema.optional(Schema.String),
8766
+ value: Schema.optional(Schema.String),
8767
+ }),
8768
+ }),
8769
+ Schema.Struct({
8770
+ query: Schema.Struct({
8771
+ expression: Schema.optional(Schema.String),
8772
+ value: Schema.optional(Schema.String),
8773
+ }),
8774
+ }),
8775
+ ])),
8776
+ }),
8777
+ Schema.Struct({
8778
+ hostHeader: Schema.optional(Schema.String),
8779
+ origin: Schema.optional(Schema.Struct({
8780
+ host: Schema.optional(Schema.String),
8781
+ port: Schema.optional(Schema.Number),
8782
+ })),
8783
+ sni: Schema.optional(Schema.Struct({
8784
+ value: Schema.String,
8785
+ })),
8786
+ }).pipe(Schema.encodeKeys({
8787
+ hostHeader: "host_header",
8788
+ origin: "origin",
8789
+ sni: "sni",
8790
+ })),
8791
+ Schema.Struct({
8792
+ immutable: Schema.optional(Schema.Struct({
8793
+ operation: Schema.Union([
8794
+ Schema.Literals(["set", "remove"]),
8795
+ Schema.String,
8796
+ ]),
8797
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8798
+ }).pipe(Schema.encodeKeys({
8799
+ operation: "operation",
8800
+ cloudflareOnly: "cloudflare_only",
8801
+ }))),
8802
+ maxAge: Schema.optional(Schema.Struct({
8803
+ operation: Schema.Union([
8804
+ Schema.Literals(["set", "remove"]),
8805
+ Schema.String,
8806
+ ]),
8807
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8808
+ }).pipe(Schema.encodeKeys({
8809
+ operation: "operation",
8810
+ cloudflareOnly: "cloudflare_only",
8811
+ }))),
8812
+ mustRevalidate: Schema.optional(Schema.Struct({
8813
+ operation: Schema.Union([
8814
+ Schema.Literals(["set", "remove"]),
8815
+ Schema.String,
8816
+ ]),
8817
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8818
+ }).pipe(Schema.encodeKeys({
8819
+ operation: "operation",
8820
+ cloudflareOnly: "cloudflare_only",
8821
+ }))),
8822
+ mustUnderstand: Schema.optional(Schema.Struct({
8823
+ operation: Schema.Union([
8824
+ Schema.Literals(["set", "remove"]),
8825
+ Schema.String,
8826
+ ]),
8827
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8828
+ }).pipe(Schema.encodeKeys({
8829
+ operation: "operation",
8830
+ cloudflareOnly: "cloudflare_only",
8831
+ }))),
8832
+ noCache: Schema.optional(Schema.Struct({
8833
+ operation: Schema.Union([
8834
+ Schema.Literals(["set", "remove"]),
8835
+ Schema.String,
8836
+ ]),
8837
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8838
+ }).pipe(Schema.encodeKeys({
8839
+ operation: "operation",
8840
+ cloudflareOnly: "cloudflare_only",
8841
+ }))),
8842
+ noStore: Schema.optional(Schema.Struct({
8843
+ operation: Schema.Union([
8844
+ Schema.Literals(["set", "remove"]),
8845
+ Schema.String,
8846
+ ]),
8847
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8848
+ }).pipe(Schema.encodeKeys({
8849
+ operation: "operation",
8850
+ cloudflareOnly: "cloudflare_only",
8851
+ }))),
8852
+ noTransform: Schema.optional(Schema.Struct({
8853
+ operation: Schema.Union([
8854
+ Schema.Literals(["set", "remove"]),
8855
+ Schema.String,
8856
+ ]),
8857
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8858
+ }).pipe(Schema.encodeKeys({
8859
+ operation: "operation",
8860
+ cloudflareOnly: "cloudflare_only",
8861
+ }))),
8862
+ private: Schema.optional(Schema.Struct({
8863
+ operation: Schema.Union([
8864
+ Schema.Literals(["set", "remove"]),
8865
+ Schema.String,
8866
+ ]),
8867
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8868
+ }).pipe(Schema.encodeKeys({
8869
+ operation: "operation",
8870
+ cloudflareOnly: "cloudflare_only",
8871
+ }))),
8872
+ proxyRevalidate: Schema.optional(Schema.Struct({
8873
+ operation: Schema.Union([
8874
+ Schema.Literals(["set", "remove"]),
8875
+ Schema.String,
8876
+ ]),
8877
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8878
+ }).pipe(Schema.encodeKeys({
8879
+ operation: "operation",
8880
+ cloudflareOnly: "cloudflare_only",
8881
+ }))),
8882
+ public: Schema.optional(Schema.Struct({
8883
+ operation: Schema.Union([
8884
+ Schema.Literals(["set", "remove"]),
8885
+ Schema.String,
8886
+ ]),
8887
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8888
+ }).pipe(Schema.encodeKeys({
8889
+ operation: "operation",
8890
+ cloudflareOnly: "cloudflare_only",
8891
+ }))),
8892
+ sMaxage: Schema.optional(Schema.Struct({
8893
+ operation: Schema.Union([
8894
+ Schema.Literals(["set", "remove"]),
8895
+ Schema.String,
8896
+ ]),
8897
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8898
+ }).pipe(Schema.encodeKeys({
8899
+ operation: "operation",
8900
+ cloudflareOnly: "cloudflare_only",
8901
+ }))),
8902
+ staleIfError: Schema.optional(Schema.Struct({
8903
+ operation: Schema.Union([
8904
+ Schema.Literals(["set", "remove"]),
8905
+ Schema.String,
8906
+ ]),
8907
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8908
+ }).pipe(Schema.encodeKeys({
8909
+ operation: "operation",
8910
+ cloudflareOnly: "cloudflare_only",
8911
+ }))),
8912
+ staleWhileRevalidate: Schema.optional(Schema.Struct({
8913
+ operation: Schema.Union([
8914
+ Schema.Literals(["set", "remove"]),
8915
+ Schema.String,
8916
+ ]),
8917
+ cloudflareOnly: Schema.optional(Schema.Boolean),
8918
+ }).pipe(Schema.encodeKeys({
8919
+ operation: "operation",
8920
+ cloudflareOnly: "cloudflare_only",
8921
+ }))),
8922
+ }).pipe(Schema.encodeKeys({
8923
+ immutable: "immutable",
8924
+ maxAge: "max-age",
8925
+ mustRevalidate: "must-revalidate",
8926
+ mustUnderstand: "must-understand",
8927
+ noCache: "no-cache",
8928
+ noStore: "no-store",
8929
+ noTransform: "no-transform",
8930
+ private: "private",
8931
+ proxyRevalidate: "proxy-revalidate",
8932
+ public: "public",
8933
+ sMaxage: "s-maxage",
8934
+ staleIfError: "stale-if-error",
8935
+ staleWhileRevalidate: "stale-while-revalidate",
8936
+ })),
8937
+ Schema.Struct({
8938
+ additionalCacheablePorts: Schema.optional(Schema.Array(Schema.Number)),
8939
+ browserTtl: Schema.optional(Schema.Struct({
8940
+ mode: Schema.Union([
8941
+ Schema.Literals([
8942
+ "respect_origin",
8943
+ "bypass_by_default",
8944
+ "override_origin",
8945
+ "bypass",
8946
+ ]),
8947
+ Schema.String,
8948
+ ]),
8949
+ default: Schema.optional(Schema.Number),
8950
+ })),
8951
+ cache: Schema.optional(Schema.Boolean),
8952
+ cacheKey: Schema.optional(Schema.Struct({
8953
+ cacheByDeviceType: Schema.optional(Schema.Boolean),
8954
+ cacheDeceptionArmor: Schema.optional(Schema.Boolean),
8955
+ customKey: Schema.optional(Schema.Struct({
8956
+ cookie: Schema.optional(Schema.Struct({
8957
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
8958
+ include: Schema.optional(Schema.Array(Schema.String)),
8959
+ }).pipe(Schema.encodeKeys({
8960
+ checkPresence: "check_presence",
8961
+ include: "include",
8962
+ }))),
8963
+ header: Schema.optional(Schema.Struct({
8964
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
8965
+ contains: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
8966
+ excludeOrigin: Schema.optional(Schema.Boolean),
8967
+ include: Schema.optional(Schema.Array(Schema.String)),
8968
+ }).pipe(Schema.encodeKeys({
8969
+ checkPresence: "check_presence",
8970
+ contains: "contains",
8971
+ excludeOrigin: "exclude_origin",
8972
+ include: "include",
8973
+ }))),
8974
+ host: Schema.optional(Schema.Struct({
8975
+ resolved: Schema.optional(Schema.Boolean),
8976
+ })),
8977
+ queryString: Schema.optional(Schema.Struct({
8978
+ exclude: Schema.optional(Schema.Struct({
8979
+ all: Schema.optional(Schema.Literal(true)),
8980
+ list: Schema.optional(Schema.Array(Schema.String)),
8981
+ })),
8982
+ include: Schema.optional(Schema.Struct({
8983
+ all: Schema.optional(Schema.Literal(true)),
8984
+ list: Schema.optional(Schema.Array(Schema.String)),
8985
+ })),
8986
+ })),
8987
+ user: Schema.optional(Schema.Struct({
8988
+ deviceType: Schema.optional(Schema.Boolean),
8989
+ geo: Schema.optional(Schema.Boolean),
8990
+ lang: Schema.optional(Schema.Boolean),
8991
+ }).pipe(Schema.encodeKeys({
8992
+ deviceType: "device_type",
8993
+ geo: "geo",
8994
+ lang: "lang",
8995
+ }))),
8996
+ }).pipe(Schema.encodeKeys({
8997
+ cookie: "cookie",
8998
+ header: "header",
8999
+ host: "host",
9000
+ queryString: "query_string",
9001
+ user: "user",
9002
+ }))),
9003
+ ignoreQueryStringsOrder: Schema.optional(Schema.Boolean),
9004
+ }).pipe(Schema.encodeKeys({
9005
+ cacheByDeviceType: "cache_by_device_type",
9006
+ cacheDeceptionArmor: "cache_deception_armor",
9007
+ customKey: "custom_key",
9008
+ ignoreQueryStringsOrder: "ignore_query_strings_order",
9009
+ }))),
9010
+ cacheReserve: Schema.optional(Schema.Struct({
9011
+ eligible: Schema.Boolean,
9012
+ minimumFileSize: Schema.optional(Schema.Number),
9013
+ }).pipe(Schema.encodeKeys({
9014
+ eligible: "eligible",
9015
+ minimumFileSize: "minimum_file_size",
9016
+ }))),
9017
+ edgeTtl: Schema.optional(Schema.Struct({
9018
+ mode: Schema.Union([
9019
+ Schema.Literals([
9020
+ "respect_origin",
9021
+ "bypass_by_default",
9022
+ "override_origin",
9023
+ ]),
9024
+ Schema.String,
9025
+ ]),
9026
+ default: Schema.optional(Schema.Number),
9027
+ statusCodeTtl: Schema.optional(Schema.Array(Schema.Struct({
9028
+ value: Schema.Number,
9029
+ statusCode: Schema.optional(Schema.Number),
9030
+ statusCodeRange: Schema.optional(Schema.Struct({
9031
+ from: Schema.optional(Schema.Number),
9032
+ to: Schema.optional(Schema.Number),
9033
+ })),
9034
+ }).pipe(Schema.encodeKeys({
9035
+ value: "value",
9036
+ statusCode: "status_code",
9037
+ statusCodeRange: "status_code_range",
9038
+ })))),
9039
+ }).pipe(Schema.encodeKeys({
9040
+ mode: "mode",
9041
+ default: "default",
9042
+ statusCodeTtl: "status_code_ttl",
9043
+ }))),
9044
+ originCacheControl: Schema.optional(Schema.Boolean),
9045
+ originErrorPagePassthru: Schema.optional(Schema.Boolean),
9046
+ readTimeout: Schema.optional(Schema.Number),
9047
+ respectStrongEtags: Schema.optional(Schema.Boolean),
9048
+ serveStale: Schema.optional(Schema.Struct({
9049
+ disableStaleWhileUpdating: Schema.optional(Schema.Boolean),
9050
+ }).pipe(Schema.encodeKeys({
9051
+ disableStaleWhileUpdating: "disable_stale_while_updating",
9052
+ }))),
9053
+ sharedDictionary: Schema.optional(Schema.Struct({
9054
+ matchPattern: Schema.String,
9055
+ }).pipe(Schema.encodeKeys({ matchPattern: "match_pattern" }))),
9056
+ stripEtags: Schema.optional(Schema.Boolean),
9057
+ stripLastModified: Schema.optional(Schema.Boolean),
9058
+ stripSetCookie: Schema.optional(Schema.Boolean),
9059
+ }).pipe(Schema.encodeKeys({
9060
+ additionalCacheablePorts: "additional_cacheable_ports",
9061
+ browserTtl: "browser_ttl",
9062
+ cache: "cache",
9063
+ cacheKey: "cache_key",
9064
+ cacheReserve: "cache_reserve",
9065
+ edgeTtl: "edge_ttl",
9066
+ originCacheControl: "origin_cache_control",
9067
+ originErrorPagePassthru: "origin_error_page_passthru",
9068
+ readTimeout: "read_timeout",
9069
+ respectStrongEtags: "respect_strong_etags",
9070
+ serveStale: "serve_stale",
9071
+ sharedDictionary: "shared_dictionary",
9072
+ stripEtags: "strip_etags",
9073
+ stripLastModified: "strip_last_modified",
9074
+ stripSetCookie: "strip_set_cookie",
9075
+ })),
9076
+ Schema.Struct({
9077
+ automaticHttpsRewrites: Schema.optional(Schema.Boolean),
9078
+ autominify: Schema.optional(Schema.Struct({
9079
+ css: Schema.optional(Schema.Boolean),
9080
+ html: Schema.optional(Schema.Boolean),
9081
+ js: Schema.optional(Schema.Boolean),
9082
+ })),
9083
+ bic: Schema.optional(Schema.Boolean),
9084
+ contentConverter: Schema.optional(Schema.Boolean),
9085
+ disableApps: Schema.optional(Schema.Literal(true)),
9086
+ disablePayPerCrawl: Schema.optional(Schema.Literal(true)),
9087
+ disableRum: Schema.optional(Schema.Literal(true)),
9088
+ disableZaraz: Schema.optional(Schema.Literal(true)),
9089
+ emailObfuscation: Schema.optional(Schema.Boolean),
9090
+ fonts: Schema.optional(Schema.Boolean),
9091
+ hotlinkProtection: Schema.optional(Schema.Boolean),
9092
+ mirage: Schema.optional(Schema.Boolean),
9093
+ opportunisticEncryption: Schema.optional(Schema.Boolean),
9094
+ polish: Schema.optional(Schema.Union([
9095
+ Schema.Literals(["off", "lossless", "lossy", "webp"]),
9096
+ Schema.String,
9097
+ ])),
9098
+ redirectsForAiTraining: Schema.optional(Schema.Boolean),
9099
+ requestBodyBuffering: Schema.optional(Schema.Union([
9100
+ Schema.Literals(["none", "standard", "full"]),
9101
+ Schema.String,
9102
+ ])),
9103
+ responseBodyBuffering: Schema.optional(Schema.Union([Schema.Literals(["none", "standard"]), Schema.String])),
9104
+ rocketLoader: Schema.optional(Schema.Boolean),
9105
+ securityLevel: Schema.optional(Schema.Union([
9106
+ Schema.Literals([
9107
+ "off",
9108
+ "essentially_off",
9109
+ "low",
9110
+ "medium",
9111
+ "high",
9112
+ "under_attack",
9113
+ ]),
9114
+ Schema.String,
9115
+ ])),
9116
+ serverSideExcludes: Schema.optional(Schema.Boolean),
9117
+ ssl: Schema.optional(Schema.Union([
9118
+ Schema.Literals([
9119
+ "off",
9120
+ "flexible",
9121
+ "full",
9122
+ "strict",
9123
+ "origin_pull",
9124
+ ]),
9125
+ Schema.String,
9126
+ ])),
9127
+ sxg: Schema.optional(Schema.Boolean),
9128
+ }).pipe(Schema.encodeKeys({
9129
+ automaticHttpsRewrites: "automatic_https_rewrites",
9130
+ autominify: "autominify",
9131
+ bic: "bic",
9132
+ contentConverter: "content_converter",
9133
+ disableApps: "disable_apps",
9134
+ disablePayPerCrawl: "disable_pay_per_crawl",
9135
+ disableRum: "disable_rum",
9136
+ disableZaraz: "disable_zaraz",
9137
+ emailObfuscation: "email_obfuscation",
9138
+ fonts: "fonts",
9139
+ hotlinkProtection: "hotlink_protection",
9140
+ mirage: "mirage",
9141
+ opportunisticEncryption: "opportunistic_encryption",
9142
+ polish: "polish",
9143
+ redirectsForAiTraining: "redirects_for_ai_training",
9144
+ requestBodyBuffering: "request_body_buffering",
9145
+ responseBodyBuffering: "response_body_buffering",
9146
+ rocketLoader: "rocket_loader",
9147
+ securityLevel: "security_level",
9148
+ serverSideExcludes: "server_side_excludes",
9149
+ ssl: "ssl",
9150
+ sxg: "sxg",
9151
+ })),
9152
+ Schema.Struct({
9153
+ phase: Schema.optional(Schema.Literal("current")),
9154
+ phases: Schema.optional(Schema.Array(Schema.Union([
9155
+ Schema.Literals([
9156
+ "ddos_l4",
9157
+ "ddos_l7",
9158
+ "http_config_settings",
9159
+ "http_custom_errors",
9160
+ "http_log_custom_fields",
9161
+ "http_ratelimit",
9162
+ "http_request_cache_settings",
9163
+ "http_request_dynamic_redirect",
9164
+ "http_request_firewall_custom",
9165
+ "http_request_firewall_managed",
9166
+ "http_request_late_transform",
9167
+ "http_request_origin",
9168
+ "http_request_redirect",
9169
+ "http_request_sanitize",
9170
+ "http_request_sbfm",
9171
+ "http_request_transform",
9172
+ "http_response_cache_settings",
9173
+ "http_response_compression",
9174
+ "http_response_firewall_managed",
9175
+ "http_response_headers_transform",
9176
+ "magic_transit",
9177
+ "magic_transit_ids_managed",
9178
+ "magic_transit_managed",
9179
+ "magic_transit_ratelimit",
9180
+ ]),
9181
+ Schema.String,
9182
+ ]))),
9183
+ products: Schema.optional(Schema.Array(Schema.Union([
9184
+ Schema.Literals([
9185
+ "bic",
9186
+ "hot",
9187
+ "rateLimit",
9188
+ "securityLevel",
9189
+ "uaBlock",
9190
+ "waf",
9191
+ "zoneLockdown",
9192
+ ]),
9193
+ Schema.String,
9194
+ ]))),
9195
+ rules: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
9196
+ ruleset: Schema.optional(Schema.Literal("current")),
9197
+ rulesets: Schema.optional(Schema.Array(Schema.String)),
9198
+ }),
9199
+ ])),
8563
9200
  description: Schema.optional(Schema.String),
8564
9201
  enabled: Schema.optional(Schema.Boolean),
8565
9202
  exposedCredentialCheck: Schema.optional(Schema.Struct({
@@ -8573,17 +9210,11 @@ const CreateRuleBaseFields = {
8573
9210
  logging: Schema.optional(Schema.Struct({
8574
9211
  enabled: Schema.Boolean,
8575
9212
  })),
8576
- position: Schema.optional(Schema.Union([
8577
- Schema.Struct({
8578
- before: Schema.optional(Schema.String),
8579
- }),
8580
- Schema.Struct({
8581
- after: Schema.optional(Schema.String),
8582
- }),
8583
- Schema.Struct({
8584
- index: Schema.optional(Schema.Number),
8585
- }),
8586
- ])),
9213
+ position: Schema.optional(Schema.Struct({
9214
+ before: Schema.optional(Schema.String),
9215
+ after: Schema.optional(Schema.String),
9216
+ index: Schema.optional(Schema.Number),
9217
+ })),
8587
9218
  ratelimit: Schema.optional(Schema.Struct({
8588
9219
  characteristics: Schema.Array(Schema.String),
8589
9220
  period: Schema.Number,
@@ -10874,18 +11505,655 @@ const PatchRuleBaseFields = {
10874
11505
  rulesetId: Schema.String.pipe(T.HttpPath("rulesetId")),
10875
11506
  ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
10876
11507
  id: Schema.optional(Schema.String),
10877
- action: Schema.optional(Schema.Literal("block")),
10878
- actionParameters: Schema.optional(Schema.Struct({
10879
- response: Schema.optional(Schema.Struct({
11508
+ action: Schema.optional(Schema.Union([
11509
+ Schema.Literals([
11510
+ "block",
11511
+ "challenge",
11512
+ "compress_response",
11513
+ "ddos_dynamic",
11514
+ "execute",
11515
+ "force_connection_close",
11516
+ "js_challenge",
11517
+ "log",
11518
+ "log_custom_field",
11519
+ "managed_challenge",
11520
+ "redirect",
11521
+ "rewrite",
11522
+ "route",
11523
+ "score",
11524
+ "serve_error",
11525
+ "set_cache_control",
11526
+ "set_cache_settings",
11527
+ "set_cache_tags",
11528
+ "set_config",
11529
+ "skip",
11530
+ ]),
11531
+ Schema.String,
11532
+ ])),
11533
+ actionParameters: Schema.optional(Schema.Union([
11534
+ Schema.Struct({
11535
+ operation: Schema.Union([
11536
+ Schema.Literals(["add", "remove", "set"]),
11537
+ Schema.String,
11538
+ ]),
11539
+ values: Schema.Array(Schema.String),
11540
+ }),
11541
+ Schema.Struct({
11542
+ expression: Schema.String,
11543
+ operation: Schema.Union([
11544
+ Schema.Literals(["add", "remove", "set"]),
11545
+ Schema.String,
11546
+ ]),
11547
+ }),
11548
+ Schema.Struct({
11549
+ algorithms: Schema.Array(Schema.Struct({
11550
+ name: Schema.optional(Schema.Union([
11551
+ Schema.Literals([
11552
+ "none",
11553
+ "auto",
11554
+ "default",
11555
+ "gzip",
11556
+ "brotli",
11557
+ "zstd",
11558
+ ]),
11559
+ Schema.String,
11560
+ ])),
11561
+ })),
11562
+ }),
11563
+ Schema.Struct({
11564
+ id: Schema.String,
11565
+ matchedData: Schema.optional(Schema.Struct({
11566
+ publicKey: Schema.String,
11567
+ }).pipe(Schema.encodeKeys({ publicKey: "public_key" }))),
11568
+ overrides: Schema.optional(Schema.Struct({
11569
+ action: Schema.optional(Schema.String),
11570
+ categories: Schema.optional(Schema.Array(Schema.Struct({
11571
+ category: Schema.String,
11572
+ action: Schema.optional(Schema.String),
11573
+ enabled: Schema.optional(Schema.Boolean),
11574
+ sensitivityLevel: Schema.optional(Schema.Union([
11575
+ Schema.Literals(["default", "medium", "low", "eoff"]),
11576
+ Schema.String,
11577
+ ])),
11578
+ }).pipe(Schema.encodeKeys({
11579
+ category: "category",
11580
+ action: "action",
11581
+ enabled: "enabled",
11582
+ sensitivityLevel: "sensitivity_level",
11583
+ })))),
11584
+ enabled: Schema.optional(Schema.Boolean),
11585
+ rules: Schema.optional(Schema.Array(Schema.Struct({
11586
+ id: Schema.String,
11587
+ action: Schema.optional(Schema.String),
11588
+ enabled: Schema.optional(Schema.Boolean),
11589
+ scoreThreshold: Schema.optional(Schema.Number),
11590
+ sensitivityLevel: Schema.optional(Schema.Union([
11591
+ Schema.Literals(["default", "medium", "low", "eoff"]),
11592
+ Schema.String,
11593
+ ])),
11594
+ }).pipe(Schema.encodeKeys({
11595
+ id: "id",
11596
+ action: "action",
11597
+ enabled: "enabled",
11598
+ scoreThreshold: "score_threshold",
11599
+ sensitivityLevel: "sensitivity_level",
11600
+ })))),
11601
+ sensitivityLevel: Schema.optional(Schema.Union([
11602
+ Schema.Literals(["default", "medium", "low", "eoff"]),
11603
+ Schema.String,
11604
+ ])),
11605
+ }).pipe(Schema.encodeKeys({
11606
+ action: "action",
11607
+ categories: "categories",
11608
+ enabled: "enabled",
11609
+ rules: "rules",
11610
+ sensitivityLevel: "sensitivity_level",
11611
+ }))),
11612
+ }).pipe(Schema.encodeKeys({
11613
+ id: "id",
11614
+ matchedData: "matched_data",
11615
+ overrides: "overrides",
11616
+ })),
11617
+ Schema.Struct({
11618
+ increment: Schema.Number,
11619
+ }),
11620
+ Schema.Struct({
10880
11621
  content: Schema.String,
10881
- contentType: Schema.String,
10882
- statusCode: Schema.Number,
11622
+ contentType: Schema.optional(Schema.Union([
11623
+ Schema.Literals([
11624
+ "application/json",
11625
+ "text/html",
11626
+ "text/plain",
11627
+ "text/xml",
11628
+ ]),
11629
+ Schema.String,
11630
+ ])),
11631
+ statusCode: Schema.optional(Schema.Number),
10883
11632
  }).pipe(Schema.encodeKeys({
10884
11633
  content: "content",
10885
11634
  contentType: "content_type",
10886
11635
  statusCode: "status_code",
10887
- }))),
10888
- })),
11636
+ })),
11637
+ Schema.Struct({
11638
+ assetName: Schema.String,
11639
+ contentType: Schema.optional(Schema.Union([
11640
+ Schema.Literals([
11641
+ "application/json",
11642
+ "text/html",
11643
+ "text/plain",
11644
+ "text/xml",
11645
+ ]),
11646
+ Schema.String,
11647
+ ])),
11648
+ statusCode: Schema.optional(Schema.Number),
11649
+ }).pipe(Schema.encodeKeys({
11650
+ assetName: "asset_name",
11651
+ contentType: "content_type",
11652
+ statusCode: "status_code",
11653
+ })),
11654
+ Schema.Struct({
11655
+ response: Schema.optional(Schema.Struct({
11656
+ content: Schema.String,
11657
+ contentType: Schema.String,
11658
+ statusCode: Schema.Number,
11659
+ }).pipe(Schema.encodeKeys({
11660
+ content: "content",
11661
+ contentType: "content_type",
11662
+ statusCode: "status_code",
11663
+ }))),
11664
+ }),
11665
+ Schema.Struct({
11666
+ cookieFields: Schema.optional(Schema.Array(Schema.Struct({
11667
+ name: Schema.String,
11668
+ }))),
11669
+ rawResponseFields: Schema.optional(Schema.Array(Schema.Struct({
11670
+ name: Schema.String,
11671
+ preserveDuplicates: Schema.optional(Schema.Boolean),
11672
+ }).pipe(Schema.encodeKeys({
11673
+ name: "name",
11674
+ preserveDuplicates: "preserve_duplicates",
11675
+ })))),
11676
+ requestFields: Schema.optional(Schema.Array(Schema.Struct({
11677
+ name: Schema.String,
11678
+ }))),
11679
+ responseFields: Schema.optional(Schema.Array(Schema.Struct({
11680
+ name: Schema.String,
11681
+ preserveDuplicates: Schema.optional(Schema.Boolean),
11682
+ }).pipe(Schema.encodeKeys({
11683
+ name: "name",
11684
+ preserveDuplicates: "preserve_duplicates",
11685
+ })))),
11686
+ transformedRequestFields: Schema.optional(Schema.Array(Schema.Struct({
11687
+ name: Schema.String,
11688
+ }))),
11689
+ }).pipe(Schema.encodeKeys({
11690
+ cookieFields: "cookie_fields",
11691
+ rawResponseFields: "raw_response_fields",
11692
+ requestFields: "request_fields",
11693
+ responseFields: "response_fields",
11694
+ transformedRequestFields: "transformed_request_fields",
11695
+ })),
11696
+ Schema.Struct({
11697
+ fromList: Schema.optional(Schema.Struct({
11698
+ key: Schema.String,
11699
+ name: Schema.String,
11700
+ })),
11701
+ fromValue: Schema.optional(Schema.Struct({
11702
+ targetUrl: Schema.Struct({
11703
+ expression: Schema.optional(Schema.String),
11704
+ value: Schema.optional(Schema.String),
11705
+ }),
11706
+ preserveQueryString: Schema.optional(Schema.Boolean),
11707
+ statusCode: Schema.optional(Schema.Union([
11708
+ Schema.Literals(["301", "302", "303", "307", "308"]),
11709
+ Schema.String,
11710
+ ])),
11711
+ }).pipe(Schema.encodeKeys({
11712
+ targetUrl: "target_url",
11713
+ preserveQueryString: "preserve_query_string",
11714
+ statusCode: "status_code",
11715
+ }))),
11716
+ }).pipe(Schema.encodeKeys({ fromList: "from_list", fromValue: "from_value" })),
11717
+ Schema.Struct({
11718
+ headers: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
11719
+ uri: Schema.optional(Schema.Union([
11720
+ Schema.Struct({
11721
+ path: Schema.Struct({
11722
+ expression: Schema.optional(Schema.String),
11723
+ value: Schema.optional(Schema.String),
11724
+ }),
11725
+ }),
11726
+ Schema.Struct({
11727
+ query: Schema.Struct({
11728
+ expression: Schema.optional(Schema.String),
11729
+ value: Schema.optional(Schema.String),
11730
+ }),
11731
+ }),
11732
+ ])),
11733
+ }),
11734
+ Schema.Struct({
11735
+ hostHeader: Schema.optional(Schema.String),
11736
+ origin: Schema.optional(Schema.Struct({
11737
+ host: Schema.optional(Schema.String),
11738
+ port: Schema.optional(Schema.Number),
11739
+ })),
11740
+ sni: Schema.optional(Schema.Struct({
11741
+ value: Schema.String,
11742
+ })),
11743
+ }).pipe(Schema.encodeKeys({
11744
+ hostHeader: "host_header",
11745
+ origin: "origin",
11746
+ sni: "sni",
11747
+ })),
11748
+ Schema.Struct({
11749
+ immutable: Schema.optional(Schema.Struct({
11750
+ operation: Schema.Union([
11751
+ Schema.Literals(["set", "remove"]),
11752
+ Schema.String,
11753
+ ]),
11754
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11755
+ }).pipe(Schema.encodeKeys({
11756
+ operation: "operation",
11757
+ cloudflareOnly: "cloudflare_only",
11758
+ }))),
11759
+ maxAge: Schema.optional(Schema.Struct({
11760
+ operation: Schema.Union([
11761
+ Schema.Literals(["set", "remove"]),
11762
+ Schema.String,
11763
+ ]),
11764
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11765
+ }).pipe(Schema.encodeKeys({
11766
+ operation: "operation",
11767
+ cloudflareOnly: "cloudflare_only",
11768
+ }))),
11769
+ mustRevalidate: Schema.optional(Schema.Struct({
11770
+ operation: Schema.Union([
11771
+ Schema.Literals(["set", "remove"]),
11772
+ Schema.String,
11773
+ ]),
11774
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11775
+ }).pipe(Schema.encodeKeys({
11776
+ operation: "operation",
11777
+ cloudflareOnly: "cloudflare_only",
11778
+ }))),
11779
+ mustUnderstand: Schema.optional(Schema.Struct({
11780
+ operation: Schema.Union([
11781
+ Schema.Literals(["set", "remove"]),
11782
+ Schema.String,
11783
+ ]),
11784
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11785
+ }).pipe(Schema.encodeKeys({
11786
+ operation: "operation",
11787
+ cloudflareOnly: "cloudflare_only",
11788
+ }))),
11789
+ noCache: Schema.optional(Schema.Struct({
11790
+ operation: Schema.Union([
11791
+ Schema.Literals(["set", "remove"]),
11792
+ Schema.String,
11793
+ ]),
11794
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11795
+ }).pipe(Schema.encodeKeys({
11796
+ operation: "operation",
11797
+ cloudflareOnly: "cloudflare_only",
11798
+ }))),
11799
+ noStore: Schema.optional(Schema.Struct({
11800
+ operation: Schema.Union([
11801
+ Schema.Literals(["set", "remove"]),
11802
+ Schema.String,
11803
+ ]),
11804
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11805
+ }).pipe(Schema.encodeKeys({
11806
+ operation: "operation",
11807
+ cloudflareOnly: "cloudflare_only",
11808
+ }))),
11809
+ noTransform: Schema.optional(Schema.Struct({
11810
+ operation: Schema.Union([
11811
+ Schema.Literals(["set", "remove"]),
11812
+ Schema.String,
11813
+ ]),
11814
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11815
+ }).pipe(Schema.encodeKeys({
11816
+ operation: "operation",
11817
+ cloudflareOnly: "cloudflare_only",
11818
+ }))),
11819
+ private: Schema.optional(Schema.Struct({
11820
+ operation: Schema.Union([
11821
+ Schema.Literals(["set", "remove"]),
11822
+ Schema.String,
11823
+ ]),
11824
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11825
+ }).pipe(Schema.encodeKeys({
11826
+ operation: "operation",
11827
+ cloudflareOnly: "cloudflare_only",
11828
+ }))),
11829
+ proxyRevalidate: Schema.optional(Schema.Struct({
11830
+ operation: Schema.Union([
11831
+ Schema.Literals(["set", "remove"]),
11832
+ Schema.String,
11833
+ ]),
11834
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11835
+ }).pipe(Schema.encodeKeys({
11836
+ operation: "operation",
11837
+ cloudflareOnly: "cloudflare_only",
11838
+ }))),
11839
+ public: Schema.optional(Schema.Struct({
11840
+ operation: Schema.Union([
11841
+ Schema.Literals(["set", "remove"]),
11842
+ Schema.String,
11843
+ ]),
11844
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11845
+ }).pipe(Schema.encodeKeys({
11846
+ operation: "operation",
11847
+ cloudflareOnly: "cloudflare_only",
11848
+ }))),
11849
+ sMaxage: Schema.optional(Schema.Struct({
11850
+ operation: Schema.Union([
11851
+ Schema.Literals(["set", "remove"]),
11852
+ Schema.String,
11853
+ ]),
11854
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11855
+ }).pipe(Schema.encodeKeys({
11856
+ operation: "operation",
11857
+ cloudflareOnly: "cloudflare_only",
11858
+ }))),
11859
+ staleIfError: Schema.optional(Schema.Struct({
11860
+ operation: Schema.Union([
11861
+ Schema.Literals(["set", "remove"]),
11862
+ Schema.String,
11863
+ ]),
11864
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11865
+ }).pipe(Schema.encodeKeys({
11866
+ operation: "operation",
11867
+ cloudflareOnly: "cloudflare_only",
11868
+ }))),
11869
+ staleWhileRevalidate: Schema.optional(Schema.Struct({
11870
+ operation: Schema.Union([
11871
+ Schema.Literals(["set", "remove"]),
11872
+ Schema.String,
11873
+ ]),
11874
+ cloudflareOnly: Schema.optional(Schema.Boolean),
11875
+ }).pipe(Schema.encodeKeys({
11876
+ operation: "operation",
11877
+ cloudflareOnly: "cloudflare_only",
11878
+ }))),
11879
+ }).pipe(Schema.encodeKeys({
11880
+ immutable: "immutable",
11881
+ maxAge: "max-age",
11882
+ mustRevalidate: "must-revalidate",
11883
+ mustUnderstand: "must-understand",
11884
+ noCache: "no-cache",
11885
+ noStore: "no-store",
11886
+ noTransform: "no-transform",
11887
+ private: "private",
11888
+ proxyRevalidate: "proxy-revalidate",
11889
+ public: "public",
11890
+ sMaxage: "s-maxage",
11891
+ staleIfError: "stale-if-error",
11892
+ staleWhileRevalidate: "stale-while-revalidate",
11893
+ })),
11894
+ Schema.Struct({
11895
+ additionalCacheablePorts: Schema.optional(Schema.Array(Schema.Number)),
11896
+ browserTtl: Schema.optional(Schema.Struct({
11897
+ mode: Schema.Union([
11898
+ Schema.Literals([
11899
+ "respect_origin",
11900
+ "bypass_by_default",
11901
+ "override_origin",
11902
+ "bypass",
11903
+ ]),
11904
+ Schema.String,
11905
+ ]),
11906
+ default: Schema.optional(Schema.Number),
11907
+ })),
11908
+ cache: Schema.optional(Schema.Boolean),
11909
+ cacheKey: Schema.optional(Schema.Struct({
11910
+ cacheByDeviceType: Schema.optional(Schema.Boolean),
11911
+ cacheDeceptionArmor: Schema.optional(Schema.Boolean),
11912
+ customKey: Schema.optional(Schema.Struct({
11913
+ cookie: Schema.optional(Schema.Struct({
11914
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
11915
+ include: Schema.optional(Schema.Array(Schema.String)),
11916
+ }).pipe(Schema.encodeKeys({
11917
+ checkPresence: "check_presence",
11918
+ include: "include",
11919
+ }))),
11920
+ header: Schema.optional(Schema.Struct({
11921
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
11922
+ contains: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
11923
+ excludeOrigin: Schema.optional(Schema.Boolean),
11924
+ include: Schema.optional(Schema.Array(Schema.String)),
11925
+ }).pipe(Schema.encodeKeys({
11926
+ checkPresence: "check_presence",
11927
+ contains: "contains",
11928
+ excludeOrigin: "exclude_origin",
11929
+ include: "include",
11930
+ }))),
11931
+ host: Schema.optional(Schema.Struct({
11932
+ resolved: Schema.optional(Schema.Boolean),
11933
+ })),
11934
+ queryString: Schema.optional(Schema.Struct({
11935
+ exclude: Schema.optional(Schema.Struct({
11936
+ all: Schema.optional(Schema.Literal(true)),
11937
+ list: Schema.optional(Schema.Array(Schema.String)),
11938
+ })),
11939
+ include: Schema.optional(Schema.Struct({
11940
+ all: Schema.optional(Schema.Literal(true)),
11941
+ list: Schema.optional(Schema.Array(Schema.String)),
11942
+ })),
11943
+ })),
11944
+ user: Schema.optional(Schema.Struct({
11945
+ deviceType: Schema.optional(Schema.Boolean),
11946
+ geo: Schema.optional(Schema.Boolean),
11947
+ lang: Schema.optional(Schema.Boolean),
11948
+ }).pipe(Schema.encodeKeys({
11949
+ deviceType: "device_type",
11950
+ geo: "geo",
11951
+ lang: "lang",
11952
+ }))),
11953
+ }).pipe(Schema.encodeKeys({
11954
+ cookie: "cookie",
11955
+ header: "header",
11956
+ host: "host",
11957
+ queryString: "query_string",
11958
+ user: "user",
11959
+ }))),
11960
+ ignoreQueryStringsOrder: Schema.optional(Schema.Boolean),
11961
+ }).pipe(Schema.encodeKeys({
11962
+ cacheByDeviceType: "cache_by_device_type",
11963
+ cacheDeceptionArmor: "cache_deception_armor",
11964
+ customKey: "custom_key",
11965
+ ignoreQueryStringsOrder: "ignore_query_strings_order",
11966
+ }))),
11967
+ cacheReserve: Schema.optional(Schema.Struct({
11968
+ eligible: Schema.Boolean,
11969
+ minimumFileSize: Schema.optional(Schema.Number),
11970
+ }).pipe(Schema.encodeKeys({
11971
+ eligible: "eligible",
11972
+ minimumFileSize: "minimum_file_size",
11973
+ }))),
11974
+ edgeTtl: Schema.optional(Schema.Struct({
11975
+ mode: Schema.Union([
11976
+ Schema.Literals([
11977
+ "respect_origin",
11978
+ "bypass_by_default",
11979
+ "override_origin",
11980
+ ]),
11981
+ Schema.String,
11982
+ ]),
11983
+ default: Schema.optional(Schema.Number),
11984
+ statusCodeTtl: Schema.optional(Schema.Array(Schema.Struct({
11985
+ value: Schema.Number,
11986
+ statusCode: Schema.optional(Schema.Number),
11987
+ statusCodeRange: Schema.optional(Schema.Struct({
11988
+ from: Schema.optional(Schema.Number),
11989
+ to: Schema.optional(Schema.Number),
11990
+ })),
11991
+ }).pipe(Schema.encodeKeys({
11992
+ value: "value",
11993
+ statusCode: "status_code",
11994
+ statusCodeRange: "status_code_range",
11995
+ })))),
11996
+ }).pipe(Schema.encodeKeys({
11997
+ mode: "mode",
11998
+ default: "default",
11999
+ statusCodeTtl: "status_code_ttl",
12000
+ }))),
12001
+ originCacheControl: Schema.optional(Schema.Boolean),
12002
+ originErrorPagePassthru: Schema.optional(Schema.Boolean),
12003
+ readTimeout: Schema.optional(Schema.Number),
12004
+ respectStrongEtags: Schema.optional(Schema.Boolean),
12005
+ serveStale: Schema.optional(Schema.Struct({
12006
+ disableStaleWhileUpdating: Schema.optional(Schema.Boolean),
12007
+ }).pipe(Schema.encodeKeys({
12008
+ disableStaleWhileUpdating: "disable_stale_while_updating",
12009
+ }))),
12010
+ sharedDictionary: Schema.optional(Schema.Struct({
12011
+ matchPattern: Schema.String,
12012
+ }).pipe(Schema.encodeKeys({ matchPattern: "match_pattern" }))),
12013
+ stripEtags: Schema.optional(Schema.Boolean),
12014
+ stripLastModified: Schema.optional(Schema.Boolean),
12015
+ stripSetCookie: Schema.optional(Schema.Boolean),
12016
+ }).pipe(Schema.encodeKeys({
12017
+ additionalCacheablePorts: "additional_cacheable_ports",
12018
+ browserTtl: "browser_ttl",
12019
+ cache: "cache",
12020
+ cacheKey: "cache_key",
12021
+ cacheReserve: "cache_reserve",
12022
+ edgeTtl: "edge_ttl",
12023
+ originCacheControl: "origin_cache_control",
12024
+ originErrorPagePassthru: "origin_error_page_passthru",
12025
+ readTimeout: "read_timeout",
12026
+ respectStrongEtags: "respect_strong_etags",
12027
+ serveStale: "serve_stale",
12028
+ sharedDictionary: "shared_dictionary",
12029
+ stripEtags: "strip_etags",
12030
+ stripLastModified: "strip_last_modified",
12031
+ stripSetCookie: "strip_set_cookie",
12032
+ })),
12033
+ Schema.Struct({
12034
+ automaticHttpsRewrites: Schema.optional(Schema.Boolean),
12035
+ autominify: Schema.optional(Schema.Struct({
12036
+ css: Schema.optional(Schema.Boolean),
12037
+ html: Schema.optional(Schema.Boolean),
12038
+ js: Schema.optional(Schema.Boolean),
12039
+ })),
12040
+ bic: Schema.optional(Schema.Boolean),
12041
+ contentConverter: Schema.optional(Schema.Boolean),
12042
+ disableApps: Schema.optional(Schema.Literal(true)),
12043
+ disablePayPerCrawl: Schema.optional(Schema.Literal(true)),
12044
+ disableRum: Schema.optional(Schema.Literal(true)),
12045
+ disableZaraz: Schema.optional(Schema.Literal(true)),
12046
+ emailObfuscation: Schema.optional(Schema.Boolean),
12047
+ fonts: Schema.optional(Schema.Boolean),
12048
+ hotlinkProtection: Schema.optional(Schema.Boolean),
12049
+ mirage: Schema.optional(Schema.Boolean),
12050
+ opportunisticEncryption: Schema.optional(Schema.Boolean),
12051
+ polish: Schema.optional(Schema.Union([
12052
+ Schema.Literals(["off", "lossless", "lossy", "webp"]),
12053
+ Schema.String,
12054
+ ])),
12055
+ redirectsForAiTraining: Schema.optional(Schema.Boolean),
12056
+ requestBodyBuffering: Schema.optional(Schema.Union([
12057
+ Schema.Literals(["none", "standard", "full"]),
12058
+ Schema.String,
12059
+ ])),
12060
+ responseBodyBuffering: Schema.optional(Schema.Union([Schema.Literals(["none", "standard"]), Schema.String])),
12061
+ rocketLoader: Schema.optional(Schema.Boolean),
12062
+ securityLevel: Schema.optional(Schema.Union([
12063
+ Schema.Literals([
12064
+ "off",
12065
+ "essentially_off",
12066
+ "low",
12067
+ "medium",
12068
+ "high",
12069
+ "under_attack",
12070
+ ]),
12071
+ Schema.String,
12072
+ ])),
12073
+ serverSideExcludes: Schema.optional(Schema.Boolean),
12074
+ ssl: Schema.optional(Schema.Union([
12075
+ Schema.Literals([
12076
+ "off",
12077
+ "flexible",
12078
+ "full",
12079
+ "strict",
12080
+ "origin_pull",
12081
+ ]),
12082
+ Schema.String,
12083
+ ])),
12084
+ sxg: Schema.optional(Schema.Boolean),
12085
+ }).pipe(Schema.encodeKeys({
12086
+ automaticHttpsRewrites: "automatic_https_rewrites",
12087
+ autominify: "autominify",
12088
+ bic: "bic",
12089
+ contentConverter: "content_converter",
12090
+ disableApps: "disable_apps",
12091
+ disablePayPerCrawl: "disable_pay_per_crawl",
12092
+ disableRum: "disable_rum",
12093
+ disableZaraz: "disable_zaraz",
12094
+ emailObfuscation: "email_obfuscation",
12095
+ fonts: "fonts",
12096
+ hotlinkProtection: "hotlink_protection",
12097
+ mirage: "mirage",
12098
+ opportunisticEncryption: "opportunistic_encryption",
12099
+ polish: "polish",
12100
+ redirectsForAiTraining: "redirects_for_ai_training",
12101
+ requestBodyBuffering: "request_body_buffering",
12102
+ responseBodyBuffering: "response_body_buffering",
12103
+ rocketLoader: "rocket_loader",
12104
+ securityLevel: "security_level",
12105
+ serverSideExcludes: "server_side_excludes",
12106
+ ssl: "ssl",
12107
+ sxg: "sxg",
12108
+ })),
12109
+ Schema.Struct({
12110
+ phase: Schema.optional(Schema.Literal("current")),
12111
+ phases: Schema.optional(Schema.Array(Schema.Union([
12112
+ Schema.Literals([
12113
+ "ddos_l4",
12114
+ "ddos_l7",
12115
+ "http_config_settings",
12116
+ "http_custom_errors",
12117
+ "http_log_custom_fields",
12118
+ "http_ratelimit",
12119
+ "http_request_cache_settings",
12120
+ "http_request_dynamic_redirect",
12121
+ "http_request_firewall_custom",
12122
+ "http_request_firewall_managed",
12123
+ "http_request_late_transform",
12124
+ "http_request_origin",
12125
+ "http_request_redirect",
12126
+ "http_request_sanitize",
12127
+ "http_request_sbfm",
12128
+ "http_request_transform",
12129
+ "http_response_cache_settings",
12130
+ "http_response_compression",
12131
+ "http_response_firewall_managed",
12132
+ "http_response_headers_transform",
12133
+ "magic_transit",
12134
+ "magic_transit_ids_managed",
12135
+ "magic_transit_managed",
12136
+ "magic_transit_ratelimit",
12137
+ ]),
12138
+ Schema.String,
12139
+ ]))),
12140
+ products: Schema.optional(Schema.Array(Schema.Union([
12141
+ Schema.Literals([
12142
+ "bic",
12143
+ "hot",
12144
+ "rateLimit",
12145
+ "securityLevel",
12146
+ "uaBlock",
12147
+ "waf",
12148
+ "zoneLockdown",
12149
+ ]),
12150
+ Schema.String,
12151
+ ]))),
12152
+ rules: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
12153
+ ruleset: Schema.optional(Schema.Literal("current")),
12154
+ rulesets: Schema.optional(Schema.Array(Schema.String)),
12155
+ }),
12156
+ ])),
10889
12157
  description: Schema.optional(Schema.String),
10890
12158
  enabled: Schema.optional(Schema.Boolean),
10891
12159
  exposedCredentialCheck: Schema.optional(Schema.Struct({
@@ -10899,17 +12167,11 @@ const PatchRuleBaseFields = {
10899
12167
  logging: Schema.optional(Schema.Struct({
10900
12168
  enabled: Schema.Boolean,
10901
12169
  })),
10902
- position: Schema.optional(Schema.Union([
10903
- Schema.Struct({
10904
- before: Schema.optional(Schema.String),
10905
- }),
10906
- Schema.Struct({
10907
- after: Schema.optional(Schema.String),
10908
- }),
10909
- Schema.Struct({
10910
- index: Schema.optional(Schema.Number),
10911
- }),
10912
- ])),
12170
+ position: Schema.optional(Schema.Struct({
12171
+ before: Schema.optional(Schema.String),
12172
+ after: Schema.optional(Schema.String),
12173
+ index: Schema.optional(Schema.Number),
12174
+ })),
10913
12175
  ratelimit: Schema.optional(Schema.Struct({
10914
12176
  characteristics: Schema.Array(Schema.String),
10915
12177
  period: Schema.Number,