@distilled.cloud/cloudflare 0.0.0 → 0.2.3

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 (560) hide show
  1. package/README.md +41 -7
  2. package/lib/auth.d.ts +13 -0
  3. package/lib/auth.d.ts.map +1 -0
  4. package/lib/auth.js +12 -0
  5. package/lib/auth.js.map +1 -0
  6. package/lib/category.d.ts +2 -0
  7. package/lib/category.d.ts.map +1 -0
  8. package/lib/category.js +2 -0
  9. package/lib/category.js.map +1 -0
  10. package/lib/client/api.d.ts +14 -0
  11. package/lib/client/api.d.ts.map +1 -0
  12. package/lib/client/api.js +245 -0
  13. package/lib/client/api.js.map +1 -0
  14. package/lib/client/index.d.ts +8 -0
  15. package/lib/client/index.d.ts.map +1 -0
  16. package/lib/client/index.js +8 -0
  17. package/lib/client/index.js.map +1 -0
  18. package/lib/credentials.d.ts +14 -0
  19. package/lib/credentials.d.ts.map +1 -0
  20. package/lib/credentials.js +17 -0
  21. package/lib/credentials.js.map +1 -0
  22. package/lib/errors.d.ts +37 -0
  23. package/lib/errors.d.ts.map +1 -0
  24. package/lib/errors.js +31 -0
  25. package/lib/errors.js.map +1 -0
  26. package/lib/index.d.ts +10 -0
  27. package/lib/index.d.ts.map +1 -0
  28. package/lib/index.js +10 -0
  29. package/lib/index.js.map +1 -0
  30. package/lib/retry.d.ts +14 -0
  31. package/lib/retry.d.ts.map +1 -0
  32. package/lib/retry.js +14 -0
  33. package/lib/retry.js.map +1 -0
  34. package/lib/schemas.d.ts +29 -0
  35. package/lib/schemas.d.ts.map +1 -0
  36. package/lib/schemas.js +34 -0
  37. package/lib/schemas.js.map +1 -0
  38. package/lib/services/abuse-reports.d.ts +224 -0
  39. package/lib/services/abuse-reports.d.ts.map +1 -0
  40. package/lib/services/abuse-reports.js +353 -0
  41. package/lib/services/abuse-reports.js.map +1 -0
  42. package/lib/services/accounts.d.ts +682 -0
  43. package/lib/services/accounts.d.ts.map +1 -0
  44. package/lib/services/accounts.js +805 -0
  45. package/lib/services/accounts.js.map +1 -0
  46. package/lib/services/acm.d.ts +73 -0
  47. package/lib/services/acm.d.ts.map +1 -0
  48. package/lib/services/acm.js +76 -0
  49. package/lib/services/acm.js.map +1 -0
  50. package/lib/services/addressing.d.ts +1208 -0
  51. package/lib/services/addressing.d.ts.map +1 -0
  52. package/lib/services/addressing.js +1776 -0
  53. package/lib/services/addressing.js.map +1 -0
  54. package/lib/services/ai-gateway.d.ts +956 -0
  55. package/lib/services/ai-gateway.d.ts.map +1 -0
  56. package/lib/services/ai-gateway.js +1706 -0
  57. package/lib/services/ai-gateway.js.map +1 -0
  58. package/lib/services/ai.d.ts +243 -0
  59. package/lib/services/ai.d.ts.map +1 -0
  60. package/lib/services/ai.js +299 -0
  61. package/lib/services/ai.js.map +1 -0
  62. package/lib/services/aisearch.d.ts +915 -0
  63. package/lib/services/aisearch.d.ts.map +1 -0
  64. package/lib/services/aisearch.js +2425 -0
  65. package/lib/services/aisearch.js.map +1 -0
  66. package/lib/services/alerting.d.ts +718 -0
  67. package/lib/services/alerting.d.ts.map +1 -0
  68. package/lib/services/alerting.js +1388 -0
  69. package/lib/services/alerting.js.map +1 -0
  70. package/lib/services/api-gateway.d.ts +830 -0
  71. package/lib/services/api-gateway.d.ts.map +1 -0
  72. package/lib/services/api-gateway.js +1548 -0
  73. package/lib/services/api-gateway.js.map +1 -0
  74. package/lib/services/argo.d.ts +101 -0
  75. package/lib/services/argo.d.ts.map +1 -0
  76. package/lib/services/argo.js +105 -0
  77. package/lib/services/argo.js.map +1 -0
  78. package/lib/services/audit-logs.d.ts +46 -0
  79. package/lib/services/audit-logs.d.ts.map +1 -0
  80. package/lib/services/audit-logs.js +37 -0
  81. package/lib/services/audit-logs.js.map +1 -0
  82. package/lib/services/billing.d.ts +62 -0
  83. package/lib/services/billing.d.ts.map +1 -0
  84. package/lib/services/billing.js +100 -0
  85. package/lib/services/billing.js.map +1 -0
  86. package/lib/services/bot-management.d.ts +124 -0
  87. package/lib/services/bot-management.d.ts.map +1 -0
  88. package/lib/services/bot-management.js +262 -0
  89. package/lib/services/bot-management.js.map +1 -0
  90. package/lib/services/botnet-feed.d.ts +65 -0
  91. package/lib/services/botnet-feed.d.ts.map +1 -0
  92. package/lib/services/botnet-feed.js +84 -0
  93. package/lib/services/botnet-feed.js.map +1 -0
  94. package/lib/services/brand-protection.d.ts +188 -0
  95. package/lib/services/brand-protection.d.ts.map +1 -0
  96. package/lib/services/brand-protection.js +214 -0
  97. package/lib/services/brand-protection.js.map +1 -0
  98. package/lib/services/browser-rendering.d.ts +857 -0
  99. package/lib/services/browser-rendering.d.ts.map +1 -0
  100. package/lib/services/browser-rendering.js +1141 -0
  101. package/lib/services/browser-rendering.js.map +1 -0
  102. package/lib/services/cache.d.ts +287 -0
  103. package/lib/services/cache.d.ts.map +1 -0
  104. package/lib/services/cache.js +330 -0
  105. package/lib/services/cache.js.map +1 -0
  106. package/lib/services/calls.d.ts +202 -0
  107. package/lib/services/calls.d.ts.map +1 -0
  108. package/lib/services/calls.js +175 -0
  109. package/lib/services/calls.js.map +1 -0
  110. package/lib/services/certificate-authorities.d.ts +40 -0
  111. package/lib/services/certificate-authorities.d.ts.map +1 -0
  112. package/lib/services/certificate-authorities.js +49 -0
  113. package/lib/services/certificate-authorities.js.map +1 -0
  114. package/lib/services/client-certificates.d.ts +254 -0
  115. package/lib/services/client-certificates.d.ts.map +1 -0
  116. package/lib/services/client-certificates.js +350 -0
  117. package/lib/services/client-certificates.js.map +1 -0
  118. package/lib/services/cloud-connector.d.ts +59 -0
  119. package/lib/services/cloud-connector.d.ts.map +1 -0
  120. package/lib/services/cloud-connector.js +84 -0
  121. package/lib/services/cloud-connector.js.map +1 -0
  122. package/lib/services/cloudforce-one.d.ts +1318 -0
  123. package/lib/services/cloudforce-one.d.ts.map +1 -0
  124. package/lib/services/cloudforce-one.js +1684 -0
  125. package/lib/services/cloudforce-one.js.map +1 -0
  126. package/lib/services/connectivity.d.ts +248 -0
  127. package/lib/services/connectivity.d.ts.map +1 -0
  128. package/lib/services/connectivity.js +377 -0
  129. package/lib/services/connectivity.js.map +1 -0
  130. package/lib/services/content-scanning.d.ts +131 -0
  131. package/lib/services/content-scanning.d.ts.map +1 -0
  132. package/lib/services/content-scanning.js +156 -0
  133. package/lib/services/content-scanning.js.map +1 -0
  134. package/lib/services/custom-certificates.d.ts +211 -0
  135. package/lib/services/custom-certificates.d.ts.map +1 -0
  136. package/lib/services/custom-certificates.js +309 -0
  137. package/lib/services/custom-certificates.js.map +1 -0
  138. package/lib/services/custom-hostnames.d.ts +525 -0
  139. package/lib/services/custom-hostnames.d.ts.map +1 -0
  140. package/lib/services/custom-hostnames.js +1164 -0
  141. package/lib/services/custom-hostnames.js.map +1 -0
  142. package/lib/services/custom-nameservers.d.ts +67 -0
  143. package/lib/services/custom-nameservers.d.ts.map +1 -0
  144. package/lib/services/custom-nameservers.js +80 -0
  145. package/lib/services/custom-nameservers.js.map +1 -0
  146. package/lib/services/custom-pages.d.ts +74 -0
  147. package/lib/services/custom-pages.d.ts.map +1 -0
  148. package/lib/services/custom-pages.js +125 -0
  149. package/lib/services/custom-pages.js.map +1 -0
  150. package/lib/services/d1.d.ts +326 -0
  151. package/lib/services/d1.d.ts.map +1 -0
  152. package/lib/services/d1.js +448 -0
  153. package/lib/services/d1.js.map +1 -0
  154. package/lib/services/dcv-delegation.d.ts +24 -0
  155. package/lib/services/dcv-delegation.d.ts.map +1 -0
  156. package/lib/services/dcv-delegation.js +24 -0
  157. package/lib/services/dcv-delegation.js.map +1 -0
  158. package/lib/services/diagnostics.d.ts +175 -0
  159. package/lib/services/diagnostics.d.ts.map +1 -0
  160. package/lib/services/diagnostics.js +273 -0
  161. package/lib/services/diagnostics.js.map +1 -0
  162. package/lib/services/dns-firewall.d.ts +288 -0
  163. package/lib/services/dns-firewall.d.ts.map +1 -0
  164. package/lib/services/dns-firewall.js +373 -0
  165. package/lib/services/dns-firewall.js.map +1 -0
  166. package/lib/services/dns.d.ts +2946 -0
  167. package/lib/services/dns.d.ts.map +1 -0
  168. package/lib/services/dns.js +4511 -0
  169. package/lib/services/dns.js.map +1 -0
  170. package/lib/services/durable-objects.d.ts +61 -0
  171. package/lib/services/durable-objects.d.ts.map +1 -0
  172. package/lib/services/durable-objects.js +66 -0
  173. package/lib/services/durable-objects.js.map +1 -0
  174. package/lib/services/email-routing.d.ts +542 -0
  175. package/lib/services/email-routing.d.ts.map +1 -0
  176. package/lib/services/email-routing.js +662 -0
  177. package/lib/services/email-routing.js.map +1 -0
  178. package/lib/services/email-security.d.ts +1131 -0
  179. package/lib/services/email-security.d.ts.map +1 -0
  180. package/lib/services/email-security.js +2065 -0
  181. package/lib/services/email-security.js.map +1 -0
  182. package/lib/services/filters.d.ts +157 -0
  183. package/lib/services/filters.d.ts.map +1 -0
  184. package/lib/services/filters.js +135 -0
  185. package/lib/services/filters.js.map +1 -0
  186. package/lib/services/firewall.d.ts +1080 -0
  187. package/lib/services/firewall.d.ts.map +1 -0
  188. package/lib/services/firewall.js +1881 -0
  189. package/lib/services/firewall.js.map +1 -0
  190. package/lib/services/healthchecks.d.ts +464 -0
  191. package/lib/services/healthchecks.d.ts.map +1 -0
  192. package/lib/services/healthchecks.js +838 -0
  193. package/lib/services/healthchecks.js.map +1 -0
  194. package/lib/services/hostnames.d.ts +74 -0
  195. package/lib/services/hostnames.d.ts.map +1 -0
  196. package/lib/services/hostnames.js +100 -0
  197. package/lib/services/hostnames.js.map +1 -0
  198. package/lib/services/hyperdrive.d.ts +203 -0
  199. package/lib/services/hyperdrive.d.ts.map +1 -0
  200. package/lib/services/hyperdrive.js +299 -0
  201. package/lib/services/hyperdrive.js.map +1 -0
  202. package/lib/services/iam.d.ts +554 -0
  203. package/lib/services/iam.d.ts.map +1 -0
  204. package/lib/services/iam.js +743 -0
  205. package/lib/services/iam.js.map +1 -0
  206. package/lib/services/images.d.ts +403 -0
  207. package/lib/services/images.d.ts.map +1 -0
  208. package/lib/services/images.js +417 -0
  209. package/lib/services/images.js.map +1 -0
  210. package/lib/services/intel.d.ts +768 -0
  211. package/lib/services/intel.d.ts.map +1 -0
  212. package/lib/services/intel.js +1179 -0
  213. package/lib/services/intel.js.map +1 -0
  214. package/lib/services/ips.d.ts +28 -0
  215. package/lib/services/ips.d.ts.map +1 -0
  216. package/lib/services/ips.js +39 -0
  217. package/lib/services/ips.js.map +1 -0
  218. package/lib/services/keyless-certificates.d.ts +177 -0
  219. package/lib/services/keyless-certificates.d.ts.map +1 -0
  220. package/lib/services/keyless-certificates.js +216 -0
  221. package/lib/services/keyless-certificates.js.map +1 -0
  222. package/lib/services/kv.d.ts +339 -0
  223. package/lib/services/kv.d.ts.map +1 -0
  224. package/lib/services/kv.js +402 -0
  225. package/lib/services/kv.js.map +1 -0
  226. package/lib/services/leaked-credential-checks.d.ts +119 -0
  227. package/lib/services/leaked-credential-checks.d.ts.map +1 -0
  228. package/lib/services/leaked-credential-checks.js +130 -0
  229. package/lib/services/leaked-credential-checks.js.map +1 -0
  230. package/lib/services/load-balancers.d.ts +1767 -0
  231. package/lib/services/load-balancers.d.ts.map +1 -0
  232. package/lib/services/load-balancers.js +3068 -0
  233. package/lib/services/load-balancers.js.map +1 -0
  234. package/lib/services/logpush.d.ts +401 -0
  235. package/lib/services/logpush.d.ts.map +1 -0
  236. package/lib/services/logpush.js +724 -0
  237. package/lib/services/logpush.js.map +1 -0
  238. package/lib/services/logs.d.ts +125 -0
  239. package/lib/services/logs.d.ts.map +1 -0
  240. package/lib/services/logs.js +145 -0
  241. package/lib/services/logs.js.map +1 -0
  242. package/lib/services/magic-cloud-networking.d.ts +1599 -0
  243. package/lib/services/magic-cloud-networking.d.ts.map +1 -0
  244. package/lib/services/magic-cloud-networking.js +5205 -0
  245. package/lib/services/magic-cloud-networking.js.map +1 -0
  246. package/lib/services/magic-network-monitoring.d.ts +379 -0
  247. package/lib/services/magic-network-monitoring.d.ts.map +1 -0
  248. package/lib/services/magic-network-monitoring.js +535 -0
  249. package/lib/services/magic-network-monitoring.js.map +1 -0
  250. package/lib/services/magic-transit.d.ts +3650 -0
  251. package/lib/services/magic-transit.d.ts.map +1 -0
  252. package/lib/services/magic-transit.js +6120 -0
  253. package/lib/services/magic-transit.js.map +1 -0
  254. package/lib/services/managed-transforms.d.ts +79 -0
  255. package/lib/services/managed-transforms.d.ts.map +1 -0
  256. package/lib/services/managed-transforms.js +107 -0
  257. package/lib/services/managed-transforms.js.map +1 -0
  258. package/lib/services/memberships.d.ts +172 -0
  259. package/lib/services/memberships.d.ts.map +1 -0
  260. package/lib/services/memberships.js +282 -0
  261. package/lib/services/memberships.js.map +1 -0
  262. package/lib/services/mtls-certificates.d.ts +140 -0
  263. package/lib/services/mtls-certificates.d.ts.map +1 -0
  264. package/lib/services/mtls-certificates.js +173 -0
  265. package/lib/services/mtls-certificates.js.map +1 -0
  266. package/lib/services/network-interconnects.d.ts +410 -0
  267. package/lib/services/network-interconnects.d.ts.map +1 -0
  268. package/lib/services/network-interconnects.js +583 -0
  269. package/lib/services/network-interconnects.js.map +1 -0
  270. package/lib/services/organizations.d.ts +201 -0
  271. package/lib/services/organizations.d.ts.map +1 -0
  272. package/lib/services/organizations.js +355 -0
  273. package/lib/services/organizations.js.map +1 -0
  274. package/lib/services/origin-ca-certificates.d.ts +99 -0
  275. package/lib/services/origin-ca-certificates.d.ts.map +1 -0
  276. package/lib/services/origin-ca-certificates.js +156 -0
  277. package/lib/services/origin-ca-certificates.js.map +1 -0
  278. package/lib/services/origin-post-quantum-encryption.d.ts +50 -0
  279. package/lib/services/origin-post-quantum-encryption.d.ts.map +1 -0
  280. package/lib/services/origin-post-quantum-encryption.js +60 -0
  281. package/lib/services/origin-post-quantum-encryption.js.map +1 -0
  282. package/lib/services/origin-tls-client-auth.d.ts +273 -0
  283. package/lib/services/origin-tls-client-auth.d.ts.map +1 -0
  284. package/lib/services/origin-tls-client-auth.js +401 -0
  285. package/lib/services/origin-tls-client-auth.js.map +1 -0
  286. package/lib/services/page-rules.d.ts +773 -0
  287. package/lib/services/page-rules.d.ts.map +1 -0
  288. package/lib/services/page-rules.js +1365 -0
  289. package/lib/services/page-rules.js.map +1 -0
  290. package/lib/services/page-shield.d.ts +426 -0
  291. package/lib/services/page-shield.d.ts.map +1 -0
  292. package/lib/services/page-shield.js +484 -0
  293. package/lib/services/page-shield.js.map +1 -0
  294. package/lib/services/pages.d.ts +1654 -0
  295. package/lib/services/pages.d.ts.map +1 -0
  296. package/lib/services/pages.js +2954 -0
  297. package/lib/services/pages.js.map +1 -0
  298. package/lib/services/pipelines.d.ts +1461 -0
  299. package/lib/services/pipelines.d.ts.map +1 -0
  300. package/lib/services/pipelines.js +2912 -0
  301. package/lib/services/pipelines.js.map +1 -0
  302. package/lib/services/queues.d.ts +807 -0
  303. package/lib/services/queues.d.ts.map +1 -0
  304. package/lib/services/queues.js +1194 -0
  305. package/lib/services/queues.js.map +1 -0
  306. package/lib/services/r2-data-catalog.d.ts +341 -0
  307. package/lib/services/r2-data-catalog.d.ts.map +1 -0
  308. package/lib/services/r2-data-catalog.js +499 -0
  309. package/lib/services/r2-data-catalog.js.map +1 -0
  310. package/lib/services/r2.d.ts +1041 -0
  311. package/lib/services/r2.d.ts.map +1 -0
  312. package/lib/services/r2.js +1384 -0
  313. package/lib/services/r2.js.map +1 -0
  314. package/lib/services/radar.d.ts +9276 -0
  315. package/lib/services/radar.d.ts.map +1 -0
  316. package/lib/services/radar.js +20491 -0
  317. package/lib/services/radar.js.map +1 -0
  318. package/lib/services/rate-limits.d.ts +315 -0
  319. package/lib/services/rate-limits.d.ts.map +1 -0
  320. package/lib/services/rate-limits.js +521 -0
  321. package/lib/services/rate-limits.js.map +1 -0
  322. package/lib/services/realtime-kit.d.ts +2728 -0
  323. package/lib/services/realtime-kit.d.ts.map +1 -0
  324. package/lib/services/realtime-kit.js +5401 -0
  325. package/lib/services/realtime-kit.js.map +1 -0
  326. package/lib/services/registrar.d.ts +81 -0
  327. package/lib/services/registrar.d.ts.map +1 -0
  328. package/lib/services/registrar.js +154 -0
  329. package/lib/services/registrar.js.map +1 -0
  330. package/lib/services/request-tracers.d.ts +61 -0
  331. package/lib/services/request-tracers.d.ts.map +1 -0
  332. package/lib/services/request-tracers.js +82 -0
  333. package/lib/services/request-tracers.js.map +1 -0
  334. package/lib/services/resource-sharing.d.ts +540 -0
  335. package/lib/services/resource-sharing.d.ts.map +1 -0
  336. package/lib/services/resource-sharing.js +846 -0
  337. package/lib/services/resource-sharing.js.map +1 -0
  338. package/lib/services/rules.d.ts +297 -0
  339. package/lib/services/rules.d.ts.map +1 -0
  340. package/lib/services/rules.js +396 -0
  341. package/lib/services/rules.js.map +1 -0
  342. package/lib/services/rulesets.d.ts +3300 -0
  343. package/lib/services/rulesets.d.ts.map +1 -0
  344. package/lib/services/rulesets.js +7852 -0
  345. package/lib/services/rulesets.js.map +1 -0
  346. package/lib/services/rum.d.ts +289 -0
  347. package/lib/services/rum.d.ts.map +1 -0
  348. package/lib/services/rum.js +409 -0
  349. package/lib/services/rum.js.map +1 -0
  350. package/lib/services/schema-validation.d.ts +240 -0
  351. package/lib/services/schema-validation.d.ts.map +1 -0
  352. package/lib/services/schema-validation.js +306 -0
  353. package/lib/services/schema-validation.js.map +1 -0
  354. package/lib/services/secrets-store.d.ts +321 -0
  355. package/lib/services/secrets-store.d.ts.map +1 -0
  356. package/lib/services/secrets-store.js +385 -0
  357. package/lib/services/secrets-store.js.map +1 -0
  358. package/lib/services/security-center.d.ts +102 -0
  359. package/lib/services/security-center.d.ts.map +1 -0
  360. package/lib/services/security-center.js +170 -0
  361. package/lib/services/security-center.js.map +1 -0
  362. package/lib/services/security-txt.d.ts +105 -0
  363. package/lib/services/security-txt.d.ts.map +1 -0
  364. package/lib/services/security-txt.js +136 -0
  365. package/lib/services/security-txt.js.map +1 -0
  366. package/lib/services/snippets.d.ts +138 -0
  367. package/lib/services/snippets.d.ts.map +1 -0
  368. package/lib/services/snippets.js +178 -0
  369. package/lib/services/snippets.js.map +1 -0
  370. package/lib/services/spectrum.d.ts +316 -0
  371. package/lib/services/spectrum.d.ts.map +1 -0
  372. package/lib/services/spectrum.js +510 -0
  373. package/lib/services/spectrum.js.map +1 -0
  374. package/lib/services/speed.d.ts +227 -0
  375. package/lib/services/speed.d.ts.map +1 -0
  376. package/lib/services/speed.js +444 -0
  377. package/lib/services/speed.js.map +1 -0
  378. package/lib/services/ssl.d.ts +370 -0
  379. package/lib/services/ssl.d.ts.map +1 -0
  380. package/lib/services/ssl.js +732 -0
  381. package/lib/services/ssl.js.map +1 -0
  382. package/lib/services/stream.d.ts +1014 -0
  383. package/lib/services/stream.d.ts.map +1 -0
  384. package/lib/services/stream.js +1049 -0
  385. package/lib/services/stream.js.map +1 -0
  386. package/lib/services/token-validation.d.ts +547 -0
  387. package/lib/services/token-validation.d.ts.map +1 -0
  388. package/lib/services/token-validation.js +768 -0
  389. package/lib/services/token-validation.js.map +1 -0
  390. package/lib/services/turnstile.d.ts +248 -0
  391. package/lib/services/turnstile.d.ts.map +1 -0
  392. package/lib/services/turnstile.js +308 -0
  393. package/lib/services/turnstile.js.map +1 -0
  394. package/lib/services/url-normalization.d.ts +53 -0
  395. package/lib/services/url-normalization.d.ts.map +1 -0
  396. package/lib/services/url-normalization.js +52 -0
  397. package/lib/services/url-normalization.js.map +1 -0
  398. package/lib/services/url-scanner.d.ts +612 -0
  399. package/lib/services/url-scanner.d.ts.map +1 -0
  400. package/lib/services/url-scanner.js +915 -0
  401. package/lib/services/url-scanner.js.map +1 -0
  402. package/lib/services/user.d.ts +441 -0
  403. package/lib/services/user.d.ts.map +1 -0
  404. package/lib/services/user.js +567 -0
  405. package/lib/services/user.js.map +1 -0
  406. package/lib/services/vectorize.d.ts +282 -0
  407. package/lib/services/vectorize.d.ts.map +1 -0
  408. package/lib/services/vectorize.js +340 -0
  409. package/lib/services/vectorize.js.map +1 -0
  410. package/lib/services/waiting-rooms.d.ts +1009 -0
  411. package/lib/services/waiting-rooms.d.ts.map +1 -0
  412. package/lib/services/waiting-rooms.js +1757 -0
  413. package/lib/services/waiting-rooms.js.map +1 -0
  414. package/lib/services/web3.d.ts +274 -0
  415. package/lib/services/web3.d.ts.map +1 -0
  416. package/lib/services/web3.js +362 -0
  417. package/lib/services/web3.js.map +1 -0
  418. package/lib/services/workers-for-platforms.d.ts +1224 -0
  419. package/lib/services/workers-for-platforms.d.ts.map +1 -0
  420. package/lib/services/workers-for-platforms.js +2078 -0
  421. package/lib/services/workers-for-platforms.js.map +1 -0
  422. package/lib/services/workers.d.ts +3498 -0
  423. package/lib/services/workers.d.ts.map +1 -0
  424. package/lib/services/workers.js +5967 -0
  425. package/lib/services/workers.js.map +1 -0
  426. package/lib/services/workflows.d.ts +359 -0
  427. package/lib/services/workflows.d.ts.map +1 -0
  428. package/lib/services/workflows.js +516 -0
  429. package/lib/services/workflows.js.map +1 -0
  430. package/lib/services/zaraz.d.ts +300 -0
  431. package/lib/services/zaraz.d.ts.map +1 -0
  432. package/lib/services/zaraz.js +298 -0
  433. package/lib/services/zaraz.js.map +1 -0
  434. package/lib/services/zero-trust.d.ts +15449 -0
  435. package/lib/services/zero-trust.d.ts.map +1 -0
  436. package/lib/services/zero-trust.js +29194 -0
  437. package/lib/services/zero-trust.js.map +1 -0
  438. package/lib/services/zones.d.ts +1278 -0
  439. package/lib/services/zones.d.ts.map +1 -0
  440. package/lib/services/zones.js +2416 -0
  441. package/lib/services/zones.js.map +1 -0
  442. package/lib/traits.d.ts +28 -0
  443. package/lib/traits.d.ts.map +1 -0
  444. package/lib/traits.js +26 -0
  445. package/lib/traits.js.map +1 -0
  446. package/package.json +68 -5
  447. package/src/auth.ts +14 -0
  448. package/src/category.ts +1 -0
  449. package/src/client/api.ts +329 -0
  450. package/src/client/index.ts +7 -0
  451. package/src/credentials.ts +30 -0
  452. package/src/errors.ts +57 -0
  453. package/src/index.ts +9 -0
  454. package/src/retry.ts +35 -0
  455. package/src/schemas.ts +51 -0
  456. package/src/services/abuse-reports.ts +747 -0
  457. package/src/services/accounts.ts +1947 -0
  458. package/src/services/acm.ts +170 -0
  459. package/src/services/addressing.ts +3947 -0
  460. package/src/services/ai-gateway.ts +3335 -0
  461. package/src/services/ai.ts +727 -0
  462. package/src/services/aisearch.ts +4750 -0
  463. package/src/services/alerting.ts +2947 -0
  464. package/src/services/api-gateway.ts +3391 -0
  465. package/src/services/argo.ts +254 -0
  466. package/src/services/audit-logs.ts +90 -0
  467. package/src/services/billing.ts +172 -0
  468. package/src/services/bot-management.ts +541 -0
  469. package/src/services/botnet-feed.ts +193 -0
  470. package/src/services/brand-protection.ts +553 -0
  471. package/src/services/browser-rendering.ts +2707 -0
  472. package/src/services/cache.ts +827 -0
  473. package/src/services/calls.ts +483 -0
  474. package/src/services/certificate-authorities.ts +110 -0
  475. package/src/services/client-certificates.ts +718 -0
  476. package/src/services/cloud-connector.ts +181 -0
  477. package/src/services/cloudforce-one.ts +3876 -0
  478. package/src/services/connectivity.ts +629 -0
  479. package/src/services/content-scanning.ts +385 -0
  480. package/src/services/custom-certificates.ts +611 -0
  481. package/src/services/custom-hostnames.ts +2453 -0
  482. package/src/services/custom-nameservers.ts +182 -0
  483. package/src/services/custom-pages.ts +264 -0
  484. package/src/services/d1.ts +1034 -0
  485. package/src/services/dcv-delegation.ts +52 -0
  486. package/src/services/diagnostics.ts +603 -0
  487. package/src/services/dns-firewall.ts +823 -0
  488. package/src/services/dns.ts +8897 -0
  489. package/src/services/durable-objects.ts +148 -0
  490. package/src/services/email-routing.ts +1602 -0
  491. package/src/services/email-security.ts +4283 -0
  492. package/src/services/filters.ts +370 -0
  493. package/src/services/firewall.ts +3896 -0
  494. package/src/services/healthchecks.ts +1750 -0
  495. package/src/services/hostnames.ts +218 -0
  496. package/src/services/hyperdrive.ts +592 -0
  497. package/src/services/iam.ts +1668 -0
  498. package/src/services/images.ts +1086 -0
  499. package/src/services/intel.ts +2768 -0
  500. package/src/services/ips.ts +88 -0
  501. package/src/services/keyless-certificates.ts +462 -0
  502. package/src/services/kv.ts +1011 -0
  503. package/src/services/leaked-credential-checks.ts +325 -0
  504. package/src/services/load-balancers.ts +6438 -0
  505. package/src/services/logpush.ts +1667 -0
  506. package/src/services/logs.ts +375 -0
  507. package/src/services/magic-cloud-networking.ts +10020 -0
  508. package/src/services/magic-network-monitoring.ts +1156 -0
  509. package/src/services/magic-transit.ts +13050 -0
  510. package/src/services/managed-transforms.ts +237 -0
  511. package/src/services/memberships.ts +615 -0
  512. package/src/services/mtls-certificates.ts +374 -0
  513. package/src/services/network-interconnects.ts +1253 -0
  514. package/src/services/organizations.ts +674 -0
  515. package/src/services/origin-ca-certificates.ts +303 -0
  516. package/src/services/origin-post-quantum-encryption.ts +128 -0
  517. package/src/services/origin-tls-client-auth.ts +878 -0
  518. package/src/services/page-rules.ts +2612 -0
  519. package/src/services/page-shield.ts +1195 -0
  520. package/src/services/pages.ts +5709 -0
  521. package/src/services/pipelines.ts +6000 -0
  522. package/src/services/queues.ts +2629 -0
  523. package/src/services/r2-data-catalog.ts +1119 -0
  524. package/src/services/r2.ts +3348 -0
  525. package/src/services/radar.ts +42152 -0
  526. package/src/services/rate-limits.ts +1150 -0
  527. package/src/services/realtime-kit.ts +11079 -0
  528. package/src/services/registrar.ts +295 -0
  529. package/src/services/request-tracers.ts +158 -0
  530. package/src/services/resource-sharing.ts +1832 -0
  531. package/src/services/rules.ts +837 -0
  532. package/src/services/rulesets.ts +15144 -0
  533. package/src/services/rum.ts +901 -0
  534. package/src/services/schema-validation.ts +733 -0
  535. package/src/services/secrets-store.ts +860 -0
  536. package/src/services/security-center.ts +397 -0
  537. package/src/services/security-txt.ts +315 -0
  538. package/src/services/snippets.ts +420 -0
  539. package/src/services/spectrum.ts +1103 -0
  540. package/src/services/speed.ts +1056 -0
  541. package/src/services/ssl.ts +1587 -0
  542. package/src/services/stream.ts +2756 -0
  543. package/src/services/token-validation.ts +1585 -0
  544. package/src/services/turnstile.ts +643 -0
  545. package/src/services/url-normalization.ts +129 -0
  546. package/src/services/url-scanner.ts +1851 -0
  547. package/src/services/user.ts +1384 -0
  548. package/src/services/vectorize.ts +816 -0
  549. package/src/services/waiting-rooms.ts +3807 -0
  550. package/src/services/web3.ts +834 -0
  551. package/src/services/workers-for-platforms.ts +3859 -0
  552. package/src/services/workers.ts +11637 -0
  553. package/src/services/workflows.ts +1124 -0
  554. package/src/services/zaraz.ts +797 -0
  555. package/src/services/zero-trust.ts +58929 -0
  556. package/src/services/zones.ts +4875 -0
  557. package/src/traits.ts +47 -0
  558. package/bun.lock +0 -26
  559. package/index.ts +0 -1
  560. package/tsconfig.json +0 -29
@@ -0,0 +1,2612 @@
1
+ /**
2
+ * Cloudflare PAGE-RULES API
3
+ *
4
+ * Generated from Cloudflare TypeScript SDK.
5
+ * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service page-rules
6
+ */
7
+
8
+ import * as Schema from "effect/Schema";
9
+ import type * as HttpClient from "effect/unstable/http/HttpClient";
10
+ import * as API from "../client/api.ts";
11
+ import * as T from "../traits";
12
+ import type { Credentials } from "../credentials";
13
+ import { type DefaultErrors } from "../errors";
14
+
15
+ // =============================================================================
16
+ // PageRule
17
+ // =============================================================================
18
+
19
+ export interface GetPageRuleRequest {
20
+ pageruleId: string;
21
+ /** Identifier. */
22
+ zoneId: string;
23
+ }
24
+
25
+ export const GetPageRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
26
+ pageruleId: Schema.String.pipe(T.HttpPath("pageruleId")),
27
+ zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
28
+ }).pipe(
29
+ T.Http({ method: "GET", path: "/zones/{zone_id}/pagerules/{pageruleId}" }),
30
+ ) as unknown as Schema.Schema<GetPageRuleRequest>;
31
+
32
+ export interface GetPageRuleResponse {
33
+ /** Identifier. */
34
+ id: string;
35
+ /** The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. */
36
+ actions: (
37
+ | unknown
38
+ | { id?: "bypass_cache_on_cookie" | null; value?: string | null }
39
+ | { id?: "cache_by_device_type" | null; value?: "on" | "off" | null }
40
+ | { id?: "cache_deception_armor" | null; value?: "on" | "off" | null }
41
+ | {
42
+ id?: "cache_key_fields" | null;
43
+ value?: {
44
+ cookie?: {
45
+ checkPresence?: string[] | null;
46
+ include?: string[] | null;
47
+ } | null;
48
+ header?: {
49
+ checkPresence?: string[] | null;
50
+ exclude?: string[] | null;
51
+ include?: string[] | null;
52
+ } | null;
53
+ host?: { resolved?: boolean | null } | null;
54
+ queryString?: {
55
+ exclude?: "*" | string[] | null;
56
+ include?: "*" | string[] | null;
57
+ } | null;
58
+ user?: {
59
+ deviceType?: boolean | null;
60
+ geo?: boolean | null;
61
+ lang?: boolean | null;
62
+ } | null;
63
+ } | null;
64
+ }
65
+ | { id?: "cache_on_cookie" | null; value?: string | null }
66
+ | {
67
+ id?: "cache_ttl_by_status" | null;
68
+ value?: Record<string, unknown> | null;
69
+ }
70
+ | { id?: "disable_apps" | null }
71
+ | { id?: "disable_performance" | null }
72
+ | { id?: "disable_security" | null }
73
+ | { id?: "disable_zaraz" | null }
74
+ | { id?: "edge_cache_ttl" | null; value?: number | null }
75
+ | { id?: "explicit_cache_control" | null; value?: "on" | "off" | null }
76
+ | {
77
+ id?: "forwarding_url" | null;
78
+ value?: {
79
+ statusCode?: "301" | "302" | null;
80
+ url?: string | null;
81
+ } | null;
82
+ }
83
+ | { id?: "host_header_override" | null; value?: string | null }
84
+ | { id?: "resolve_override" | null; value?: string | null }
85
+ | { id?: "respect_strong_etag" | null; value?: "on" | "off" | null }
86
+ )[];
87
+ /** The timestamp of when the Page Rule was created. */
88
+ createdOn: string;
89
+ /** The timestamp of when the Page Rule was last modified. */
90
+ modifiedOn: string;
91
+ /** The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: `/images/ `) bu */
92
+ priority: number;
93
+ /** The status of the Page Rule. */
94
+ status: "active" | "disabled";
95
+ /** The rule targets to evaluate on each request. */
96
+ targets: {
97
+ constraint?: {
98
+ operator: "matches" | "contains" | "equals" | "not_equal" | "not_contain";
99
+ value: string;
100
+ } | null;
101
+ target?: "url" | null;
102
+ }[];
103
+ }
104
+
105
+ export const GetPageRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
106
+ id: Schema.String,
107
+ actions: Schema.Array(
108
+ Schema.Union([
109
+ Schema.Unknown,
110
+ Schema.Struct({
111
+ id: Schema.optional(
112
+ Schema.Union([Schema.Literal("bypass_cache_on_cookie"), Schema.Null]),
113
+ ),
114
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
115
+ }),
116
+ Schema.Struct({
117
+ id: Schema.optional(
118
+ Schema.Union([Schema.Literal("cache_by_device_type"), Schema.Null]),
119
+ ),
120
+ value: Schema.optional(
121
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
122
+ ),
123
+ }),
124
+ Schema.Struct({
125
+ id: Schema.optional(
126
+ Schema.Union([Schema.Literal("cache_deception_armor"), Schema.Null]),
127
+ ),
128
+ value: Schema.optional(
129
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
130
+ ),
131
+ }),
132
+ Schema.Struct({
133
+ id: Schema.optional(
134
+ Schema.Union([Schema.Literal("cache_key_fields"), Schema.Null]),
135
+ ),
136
+ value: Schema.optional(
137
+ Schema.Union([
138
+ Schema.Struct({
139
+ cookie: Schema.optional(
140
+ Schema.Union([
141
+ Schema.Struct({
142
+ checkPresence: Schema.optional(
143
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
144
+ ),
145
+ include: Schema.optional(
146
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
147
+ ),
148
+ }).pipe(
149
+ Schema.encodeKeys({
150
+ checkPresence: "check_presence",
151
+ include: "include",
152
+ }),
153
+ ),
154
+ Schema.Null,
155
+ ]),
156
+ ),
157
+ header: Schema.optional(
158
+ Schema.Union([
159
+ Schema.Struct({
160
+ checkPresence: Schema.optional(
161
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
162
+ ),
163
+ exclude: Schema.optional(
164
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
165
+ ),
166
+ include: Schema.optional(
167
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
168
+ ),
169
+ }).pipe(
170
+ Schema.encodeKeys({
171
+ checkPresence: "check_presence",
172
+ exclude: "exclude",
173
+ include: "include",
174
+ }),
175
+ ),
176
+ Schema.Null,
177
+ ]),
178
+ ),
179
+ host: Schema.optional(
180
+ Schema.Union([
181
+ Schema.Struct({
182
+ resolved: Schema.optional(
183
+ Schema.Union([Schema.Boolean, Schema.Null]),
184
+ ),
185
+ }),
186
+ Schema.Null,
187
+ ]),
188
+ ),
189
+ queryString: Schema.optional(
190
+ Schema.Union([
191
+ Schema.Struct({
192
+ exclude: Schema.optional(
193
+ Schema.Union([
194
+ Schema.Union([
195
+ Schema.Literal("*"),
196
+ Schema.Array(Schema.String),
197
+ ]),
198
+ Schema.Null,
199
+ ]),
200
+ ),
201
+ include: Schema.optional(
202
+ Schema.Union([
203
+ Schema.Union([
204
+ Schema.Literal("*"),
205
+ Schema.Array(Schema.String),
206
+ ]),
207
+ Schema.Null,
208
+ ]),
209
+ ),
210
+ }),
211
+ Schema.Null,
212
+ ]),
213
+ ),
214
+ user: Schema.optional(
215
+ Schema.Union([
216
+ Schema.Struct({
217
+ deviceType: Schema.optional(
218
+ Schema.Union([Schema.Boolean, Schema.Null]),
219
+ ),
220
+ geo: Schema.optional(
221
+ Schema.Union([Schema.Boolean, Schema.Null]),
222
+ ),
223
+ lang: Schema.optional(
224
+ Schema.Union([Schema.Boolean, Schema.Null]),
225
+ ),
226
+ }).pipe(
227
+ Schema.encodeKeys({
228
+ deviceType: "device_type",
229
+ geo: "geo",
230
+ lang: "lang",
231
+ }),
232
+ ),
233
+ Schema.Null,
234
+ ]),
235
+ ),
236
+ }).pipe(
237
+ Schema.encodeKeys({
238
+ cookie: "cookie",
239
+ header: "header",
240
+ host: "host",
241
+ queryString: "query_string",
242
+ user: "user",
243
+ }),
244
+ ),
245
+ Schema.Null,
246
+ ]),
247
+ ),
248
+ }),
249
+ Schema.Struct({
250
+ id: Schema.optional(
251
+ Schema.Union([Schema.Literal("cache_on_cookie"), Schema.Null]),
252
+ ),
253
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
254
+ }),
255
+ Schema.Struct({
256
+ id: Schema.optional(
257
+ Schema.Union([Schema.Literal("cache_ttl_by_status"), Schema.Null]),
258
+ ),
259
+ value: Schema.optional(Schema.Union([Schema.Struct({}), Schema.Null])),
260
+ }),
261
+ Schema.Struct({
262
+ id: Schema.optional(
263
+ Schema.Union([Schema.Literal("disable_apps"), Schema.Null]),
264
+ ),
265
+ }),
266
+ Schema.Struct({
267
+ id: Schema.optional(
268
+ Schema.Union([Schema.Literal("disable_performance"), Schema.Null]),
269
+ ),
270
+ }),
271
+ Schema.Struct({
272
+ id: Schema.optional(
273
+ Schema.Union([Schema.Literal("disable_security"), Schema.Null]),
274
+ ),
275
+ }),
276
+ Schema.Struct({
277
+ id: Schema.optional(
278
+ Schema.Union([Schema.Literal("disable_zaraz"), Schema.Null]),
279
+ ),
280
+ }),
281
+ Schema.Struct({
282
+ id: Schema.optional(
283
+ Schema.Union([Schema.Literal("edge_cache_ttl"), Schema.Null]),
284
+ ),
285
+ value: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
286
+ }),
287
+ Schema.Struct({
288
+ id: Schema.optional(
289
+ Schema.Union([Schema.Literal("explicit_cache_control"), Schema.Null]),
290
+ ),
291
+ value: Schema.optional(
292
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
293
+ ),
294
+ }),
295
+ Schema.Struct({
296
+ id: Schema.optional(
297
+ Schema.Union([Schema.Literal("forwarding_url"), Schema.Null]),
298
+ ),
299
+ value: Schema.optional(
300
+ Schema.Union([
301
+ Schema.Struct({
302
+ statusCode: Schema.optional(
303
+ Schema.Union([Schema.Literals(["301", "302"]), Schema.Null]),
304
+ ),
305
+ url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
306
+ }).pipe(
307
+ Schema.encodeKeys({ statusCode: "status_code", url: "url" }),
308
+ ),
309
+ Schema.Null,
310
+ ]),
311
+ ),
312
+ }),
313
+ Schema.Struct({
314
+ id: Schema.optional(
315
+ Schema.Union([Schema.Literal("host_header_override"), Schema.Null]),
316
+ ),
317
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
318
+ }),
319
+ Schema.Struct({
320
+ id: Schema.optional(
321
+ Schema.Union([Schema.Literal("resolve_override"), Schema.Null]),
322
+ ),
323
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
324
+ }),
325
+ Schema.Struct({
326
+ id: Schema.optional(
327
+ Schema.Union([Schema.Literal("respect_strong_etag"), Schema.Null]),
328
+ ),
329
+ value: Schema.optional(
330
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
331
+ ),
332
+ }),
333
+ ]),
334
+ ),
335
+ createdOn: Schema.String,
336
+ modifiedOn: Schema.String,
337
+ priority: Schema.Number,
338
+ status: Schema.Literals(["active", "disabled"]),
339
+ targets: Schema.Array(
340
+ Schema.Struct({
341
+ constraint: Schema.optional(
342
+ Schema.Union([
343
+ Schema.Struct({
344
+ operator: Schema.Literals([
345
+ "matches",
346
+ "contains",
347
+ "equals",
348
+ "not_equal",
349
+ "not_contain",
350
+ ]),
351
+ value: Schema.String,
352
+ }),
353
+ Schema.Null,
354
+ ]),
355
+ ),
356
+ target: Schema.optional(
357
+ Schema.Union([Schema.Literal("url"), Schema.Null]),
358
+ ),
359
+ }),
360
+ ),
361
+ }).pipe(
362
+ Schema.encodeKeys({
363
+ id: "id",
364
+ actions: "actions",
365
+ createdOn: "created_on",
366
+ modifiedOn: "modified_on",
367
+ priority: "priority",
368
+ status: "status",
369
+ targets: "targets",
370
+ }),
371
+ ) as unknown as Schema.Schema<GetPageRuleResponse>;
372
+
373
+ export type GetPageRuleError = DefaultErrors;
374
+
375
+ export const getPageRule: API.OperationMethod<
376
+ GetPageRuleRequest,
377
+ GetPageRuleResponse,
378
+ GetPageRuleError,
379
+ Credentials | HttpClient.HttpClient
380
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
381
+ input: GetPageRuleRequest,
382
+ output: GetPageRuleResponse,
383
+ errors: [],
384
+ }));
385
+
386
+ export interface ListPageRulesRequest {
387
+ /** Path param: Identifier. */
388
+ zoneId: string;
389
+ /** Query param: The direction used to sort returned Page Rules. */
390
+ direction?: "asc" | "desc";
391
+ /** Query param: When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match. */
392
+ match?: "any" | "all";
393
+ /** Query param: The field used to sort returned Page Rules. */
394
+ order?: "status" | "priority";
395
+ /** Query param: The status of the Page Rule. */
396
+ status?: "active" | "disabled";
397
+ }
398
+
399
+ export const ListPageRulesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
400
+ zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
401
+ direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
402
+ T.HttpQuery("direction"),
403
+ ),
404
+ match: Schema.optional(Schema.Literals(["any", "all"])).pipe(
405
+ T.HttpQuery("match"),
406
+ ),
407
+ order: Schema.optional(Schema.Literals(["status", "priority"])).pipe(
408
+ T.HttpQuery("order"),
409
+ ),
410
+ status: Schema.optional(Schema.Literals(["active", "disabled"])).pipe(
411
+ T.HttpQuery("status"),
412
+ ),
413
+ }).pipe(
414
+ T.Http({ method: "GET", path: "/zones/{zone_id}/pagerules" }),
415
+ ) as unknown as Schema.Schema<ListPageRulesRequest>;
416
+
417
+ export type ListPageRulesResponse = {
418
+ id: string;
419
+ actions: (
420
+ | unknown
421
+ | { id?: "bypass_cache_on_cookie" | null; value?: string | null }
422
+ | { id?: "cache_by_device_type" | null; value?: "on" | "off" | null }
423
+ | { id?: "cache_deception_armor" | null; value?: "on" | "off" | null }
424
+ | {
425
+ id?: "cache_key_fields" | null;
426
+ value?: {
427
+ cookie?: {
428
+ checkPresence?: string[] | null;
429
+ include?: string[] | null;
430
+ } | null;
431
+ header?: {
432
+ checkPresence?: string[] | null;
433
+ exclude?: string[] | null;
434
+ include?: string[] | null;
435
+ } | null;
436
+ host?: { resolved?: boolean | null } | null;
437
+ queryString?: {
438
+ exclude?: "*" | string[] | null;
439
+ include?: "*" | string[] | null;
440
+ } | null;
441
+ user?: {
442
+ deviceType?: boolean | null;
443
+ geo?: boolean | null;
444
+ lang?: boolean | null;
445
+ } | null;
446
+ } | null;
447
+ }
448
+ | { id?: "cache_on_cookie" | null; value?: string | null }
449
+ | {
450
+ id?: "cache_ttl_by_status" | null;
451
+ value?: Record<string, unknown> | null;
452
+ }
453
+ | { id?: "disable_apps" | null }
454
+ | { id?: "disable_performance" | null }
455
+ | { id?: "disable_security" | null }
456
+ | { id?: "disable_zaraz" | null }
457
+ | { id?: "edge_cache_ttl" | null; value?: number | null }
458
+ | { id?: "explicit_cache_control" | null; value?: "on" | "off" | null }
459
+ | {
460
+ id?: "forwarding_url" | null;
461
+ value?: {
462
+ statusCode?: "301" | "302" | null;
463
+ url?: string | null;
464
+ } | null;
465
+ }
466
+ | { id?: "host_header_override" | null; value?: string | null }
467
+ | { id?: "resolve_override" | null; value?: string | null }
468
+ | { id?: "respect_strong_etag" | null; value?: "on" | "off" | null }
469
+ )[];
470
+ createdOn: string;
471
+ modifiedOn: string;
472
+ priority: number;
473
+ status: "active" | "disabled";
474
+ targets: {
475
+ constraint?: {
476
+ operator: "matches" | "contains" | "equals" | "not_equal" | "not_contain";
477
+ value: string;
478
+ } | null;
479
+ target?: "url" | null;
480
+ }[];
481
+ }[];
482
+
483
+ export const ListPageRulesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
484
+ Schema.Struct({
485
+ id: Schema.String,
486
+ actions: Schema.Array(
487
+ Schema.Union([
488
+ Schema.Unknown,
489
+ Schema.Struct({
490
+ id: Schema.optional(
491
+ Schema.Union([
492
+ Schema.Literal("bypass_cache_on_cookie"),
493
+ Schema.Null,
494
+ ]),
495
+ ),
496
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
497
+ }),
498
+ Schema.Struct({
499
+ id: Schema.optional(
500
+ Schema.Union([Schema.Literal("cache_by_device_type"), Schema.Null]),
501
+ ),
502
+ value: Schema.optional(
503
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
504
+ ),
505
+ }),
506
+ Schema.Struct({
507
+ id: Schema.optional(
508
+ Schema.Union([
509
+ Schema.Literal("cache_deception_armor"),
510
+ Schema.Null,
511
+ ]),
512
+ ),
513
+ value: Schema.optional(
514
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
515
+ ),
516
+ }),
517
+ Schema.Struct({
518
+ id: Schema.optional(
519
+ Schema.Union([Schema.Literal("cache_key_fields"), Schema.Null]),
520
+ ),
521
+ value: Schema.optional(
522
+ Schema.Union([
523
+ Schema.Struct({
524
+ cookie: Schema.optional(
525
+ Schema.Union([
526
+ Schema.Struct({
527
+ checkPresence: Schema.optional(
528
+ Schema.Union([
529
+ Schema.Array(Schema.String),
530
+ Schema.Null,
531
+ ]),
532
+ ),
533
+ include: Schema.optional(
534
+ Schema.Union([
535
+ Schema.Array(Schema.String),
536
+ Schema.Null,
537
+ ]),
538
+ ),
539
+ }).pipe(
540
+ Schema.encodeKeys({
541
+ checkPresence: "check_presence",
542
+ include: "include",
543
+ }),
544
+ ),
545
+ Schema.Null,
546
+ ]),
547
+ ),
548
+ header: Schema.optional(
549
+ Schema.Union([
550
+ Schema.Struct({
551
+ checkPresence: Schema.optional(
552
+ Schema.Union([
553
+ Schema.Array(Schema.String),
554
+ Schema.Null,
555
+ ]),
556
+ ),
557
+ exclude: Schema.optional(
558
+ Schema.Union([
559
+ Schema.Array(Schema.String),
560
+ Schema.Null,
561
+ ]),
562
+ ),
563
+ include: Schema.optional(
564
+ Schema.Union([
565
+ Schema.Array(Schema.String),
566
+ Schema.Null,
567
+ ]),
568
+ ),
569
+ }).pipe(
570
+ Schema.encodeKeys({
571
+ checkPresence: "check_presence",
572
+ exclude: "exclude",
573
+ include: "include",
574
+ }),
575
+ ),
576
+ Schema.Null,
577
+ ]),
578
+ ),
579
+ host: Schema.optional(
580
+ Schema.Union([
581
+ Schema.Struct({
582
+ resolved: Schema.optional(
583
+ Schema.Union([Schema.Boolean, Schema.Null]),
584
+ ),
585
+ }),
586
+ Schema.Null,
587
+ ]),
588
+ ),
589
+ queryString: Schema.optional(
590
+ Schema.Union([
591
+ Schema.Struct({
592
+ exclude: Schema.optional(
593
+ Schema.Union([
594
+ Schema.Union([
595
+ Schema.Literal("*"),
596
+ Schema.Array(Schema.String),
597
+ ]),
598
+ Schema.Null,
599
+ ]),
600
+ ),
601
+ include: Schema.optional(
602
+ Schema.Union([
603
+ Schema.Union([
604
+ Schema.Literal("*"),
605
+ Schema.Array(Schema.String),
606
+ ]),
607
+ Schema.Null,
608
+ ]),
609
+ ),
610
+ }),
611
+ Schema.Null,
612
+ ]),
613
+ ),
614
+ user: Schema.optional(
615
+ Schema.Union([
616
+ Schema.Struct({
617
+ deviceType: Schema.optional(
618
+ Schema.Union([Schema.Boolean, Schema.Null]),
619
+ ),
620
+ geo: Schema.optional(
621
+ Schema.Union([Schema.Boolean, Schema.Null]),
622
+ ),
623
+ lang: Schema.optional(
624
+ Schema.Union([Schema.Boolean, Schema.Null]),
625
+ ),
626
+ }).pipe(
627
+ Schema.encodeKeys({
628
+ deviceType: "device_type",
629
+ geo: "geo",
630
+ lang: "lang",
631
+ }),
632
+ ),
633
+ Schema.Null,
634
+ ]),
635
+ ),
636
+ }).pipe(
637
+ Schema.encodeKeys({
638
+ cookie: "cookie",
639
+ header: "header",
640
+ host: "host",
641
+ queryString: "query_string",
642
+ user: "user",
643
+ }),
644
+ ),
645
+ Schema.Null,
646
+ ]),
647
+ ),
648
+ }),
649
+ Schema.Struct({
650
+ id: Schema.optional(
651
+ Schema.Union([Schema.Literal("cache_on_cookie"), Schema.Null]),
652
+ ),
653
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
654
+ }),
655
+ Schema.Struct({
656
+ id: Schema.optional(
657
+ Schema.Union([Schema.Literal("cache_ttl_by_status"), Schema.Null]),
658
+ ),
659
+ value: Schema.optional(
660
+ Schema.Union([Schema.Struct({}), Schema.Null]),
661
+ ),
662
+ }),
663
+ Schema.Struct({
664
+ id: Schema.optional(
665
+ Schema.Union([Schema.Literal("disable_apps"), Schema.Null]),
666
+ ),
667
+ }),
668
+ Schema.Struct({
669
+ id: Schema.optional(
670
+ Schema.Union([Schema.Literal("disable_performance"), Schema.Null]),
671
+ ),
672
+ }),
673
+ Schema.Struct({
674
+ id: Schema.optional(
675
+ Schema.Union([Schema.Literal("disable_security"), Schema.Null]),
676
+ ),
677
+ }),
678
+ Schema.Struct({
679
+ id: Schema.optional(
680
+ Schema.Union([Schema.Literal("disable_zaraz"), Schema.Null]),
681
+ ),
682
+ }),
683
+ Schema.Struct({
684
+ id: Schema.optional(
685
+ Schema.Union([Schema.Literal("edge_cache_ttl"), Schema.Null]),
686
+ ),
687
+ value: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
688
+ }),
689
+ Schema.Struct({
690
+ id: Schema.optional(
691
+ Schema.Union([
692
+ Schema.Literal("explicit_cache_control"),
693
+ Schema.Null,
694
+ ]),
695
+ ),
696
+ value: Schema.optional(
697
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
698
+ ),
699
+ }),
700
+ Schema.Struct({
701
+ id: Schema.optional(
702
+ Schema.Union([Schema.Literal("forwarding_url"), Schema.Null]),
703
+ ),
704
+ value: Schema.optional(
705
+ Schema.Union([
706
+ Schema.Struct({
707
+ statusCode: Schema.optional(
708
+ Schema.Union([Schema.Literals(["301", "302"]), Schema.Null]),
709
+ ),
710
+ url: Schema.optional(
711
+ Schema.Union([Schema.String, Schema.Null]),
712
+ ),
713
+ }).pipe(
714
+ Schema.encodeKeys({ statusCode: "status_code", url: "url" }),
715
+ ),
716
+ Schema.Null,
717
+ ]),
718
+ ),
719
+ }),
720
+ Schema.Struct({
721
+ id: Schema.optional(
722
+ Schema.Union([Schema.Literal("host_header_override"), Schema.Null]),
723
+ ),
724
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
725
+ }),
726
+ Schema.Struct({
727
+ id: Schema.optional(
728
+ Schema.Union([Schema.Literal("resolve_override"), Schema.Null]),
729
+ ),
730
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
731
+ }),
732
+ Schema.Struct({
733
+ id: Schema.optional(
734
+ Schema.Union([Schema.Literal("respect_strong_etag"), Schema.Null]),
735
+ ),
736
+ value: Schema.optional(
737
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
738
+ ),
739
+ }),
740
+ ]),
741
+ ),
742
+ createdOn: Schema.String,
743
+ modifiedOn: Schema.String,
744
+ priority: Schema.Number,
745
+ status: Schema.Literals(["active", "disabled"]),
746
+ targets: Schema.Array(
747
+ Schema.Struct({
748
+ constraint: Schema.optional(
749
+ Schema.Union([
750
+ Schema.Struct({
751
+ operator: Schema.Literals([
752
+ "matches",
753
+ "contains",
754
+ "equals",
755
+ "not_equal",
756
+ "not_contain",
757
+ ]),
758
+ value: Schema.String,
759
+ }),
760
+ Schema.Null,
761
+ ]),
762
+ ),
763
+ target: Schema.optional(
764
+ Schema.Union([Schema.Literal("url"), Schema.Null]),
765
+ ),
766
+ }),
767
+ ),
768
+ }).pipe(
769
+ Schema.encodeKeys({
770
+ id: "id",
771
+ actions: "actions",
772
+ createdOn: "created_on",
773
+ modifiedOn: "modified_on",
774
+ priority: "priority",
775
+ status: "status",
776
+ targets: "targets",
777
+ }),
778
+ ),
779
+ ) as unknown as Schema.Schema<ListPageRulesResponse>;
780
+
781
+ export type ListPageRulesError = DefaultErrors;
782
+
783
+ export const listPageRules: API.OperationMethod<
784
+ ListPageRulesRequest,
785
+ ListPageRulesResponse,
786
+ ListPageRulesError,
787
+ Credentials | HttpClient.HttpClient
788
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
789
+ input: ListPageRulesRequest,
790
+ output: ListPageRulesResponse,
791
+ errors: [],
792
+ }));
793
+
794
+ export interface CreatePageRuleRequest {
795
+ /** Path param: Identifier. */
796
+ zoneId: string;
797
+ /** Body param: The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. */
798
+ actions: (
799
+ | unknown
800
+ | { id?: "bypass_cache_on_cookie"; value?: string }
801
+ | { id?: "cache_by_device_type"; value?: "on" | "off" }
802
+ | { id?: "cache_deception_armor"; value?: "on" | "off" }
803
+ | {
804
+ id?: "cache_key_fields";
805
+ value?: {
806
+ cookie?: { checkPresence?: string[]; include?: string[] };
807
+ header?: {
808
+ checkPresence?: string[];
809
+ exclude?: string[];
810
+ include?: string[];
811
+ };
812
+ host?: { resolved?: boolean };
813
+ queryString?: { exclude?: "*" | string[]; include?: "*" | string[] };
814
+ user?: { deviceType?: boolean; geo?: boolean; lang?: boolean };
815
+ };
816
+ }
817
+ | { id?: "cache_on_cookie"; value?: string }
818
+ | { id?: "cache_ttl_by_status"; value?: Record<string, unknown> }
819
+ | { id?: "disable_apps" }
820
+ | { id?: "disable_performance" }
821
+ | { id?: "disable_security" }
822
+ | { id?: "disable_zaraz" }
823
+ | { id?: "edge_cache_ttl"; value?: number }
824
+ | { id?: "explicit_cache_control"; value?: "on" | "off" }
825
+ | {
826
+ id?: "forwarding_url";
827
+ value?: { statusCode?: "301" | "302"; url?: string };
828
+ }
829
+ | { id?: "host_header_override"; value?: string }
830
+ | { id?: "resolve_override"; value?: string }
831
+ | { id?: "respect_strong_etag"; value?: "on" | "off" }
832
+ )[];
833
+ /** Body param: The rule targets to evaluate on each request. */
834
+ targets: {
835
+ constraint?: {
836
+ operator: "matches" | "contains" | "equals" | "not_equal" | "not_contain";
837
+ value: string;
838
+ };
839
+ target?: "url";
840
+ }[];
841
+ /** Body param: The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: `/i */
842
+ priority?: number;
843
+ /** Body param: The status of the Page Rule. */
844
+ status?: "active" | "disabled";
845
+ }
846
+
847
+ export const CreatePageRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
848
+ zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
849
+ actions: Schema.Array(
850
+ Schema.Union([
851
+ Schema.Unknown,
852
+ Schema.Struct({
853
+ id: Schema.optional(Schema.Literal("bypass_cache_on_cookie")),
854
+ value: Schema.optional(Schema.String),
855
+ }),
856
+ Schema.Struct({
857
+ id: Schema.optional(Schema.Literal("cache_by_device_type")),
858
+ value: Schema.optional(Schema.Literals(["on", "off"])),
859
+ }),
860
+ Schema.Struct({
861
+ id: Schema.optional(Schema.Literal("cache_deception_armor")),
862
+ value: Schema.optional(Schema.Literals(["on", "off"])),
863
+ }),
864
+ Schema.Struct({
865
+ id: Schema.optional(Schema.Literal("cache_key_fields")),
866
+ value: Schema.optional(
867
+ Schema.Struct({
868
+ cookie: Schema.optional(
869
+ Schema.Struct({
870
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
871
+ include: Schema.optional(Schema.Array(Schema.String)),
872
+ }).pipe(
873
+ Schema.encodeKeys({
874
+ checkPresence: "check_presence",
875
+ include: "include",
876
+ }),
877
+ ),
878
+ ),
879
+ header: Schema.optional(
880
+ Schema.Struct({
881
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
882
+ exclude: Schema.optional(Schema.Array(Schema.String)),
883
+ include: Schema.optional(Schema.Array(Schema.String)),
884
+ }).pipe(
885
+ Schema.encodeKeys({
886
+ checkPresence: "check_presence",
887
+ exclude: "exclude",
888
+ include: "include",
889
+ }),
890
+ ),
891
+ ),
892
+ host: Schema.optional(
893
+ Schema.Struct({
894
+ resolved: Schema.optional(Schema.Boolean),
895
+ }),
896
+ ),
897
+ queryString: Schema.optional(
898
+ Schema.Struct({
899
+ exclude: Schema.optional(
900
+ Schema.Union([
901
+ Schema.Literal("*"),
902
+ Schema.Array(Schema.String),
903
+ ]),
904
+ ),
905
+ include: Schema.optional(
906
+ Schema.Union([
907
+ Schema.Literal("*"),
908
+ Schema.Array(Schema.String),
909
+ ]),
910
+ ),
911
+ }),
912
+ ),
913
+ user: Schema.optional(
914
+ Schema.Struct({
915
+ deviceType: Schema.optional(Schema.Boolean),
916
+ geo: Schema.optional(Schema.Boolean),
917
+ lang: Schema.optional(Schema.Boolean),
918
+ }).pipe(
919
+ Schema.encodeKeys({
920
+ deviceType: "device_type",
921
+ geo: "geo",
922
+ lang: "lang",
923
+ }),
924
+ ),
925
+ ),
926
+ }).pipe(
927
+ Schema.encodeKeys({
928
+ cookie: "cookie",
929
+ header: "header",
930
+ host: "host",
931
+ queryString: "query_string",
932
+ user: "user",
933
+ }),
934
+ ),
935
+ ),
936
+ }),
937
+ Schema.Struct({
938
+ id: Schema.optional(Schema.Literal("cache_on_cookie")),
939
+ value: Schema.optional(Schema.String),
940
+ }),
941
+ Schema.Struct({
942
+ id: Schema.optional(Schema.Literal("cache_ttl_by_status")),
943
+ value: Schema.optional(Schema.Struct({})),
944
+ }),
945
+ Schema.Struct({
946
+ id: Schema.optional(Schema.Literal("disable_apps")),
947
+ }),
948
+ Schema.Struct({
949
+ id: Schema.optional(Schema.Literal("disable_performance")),
950
+ }),
951
+ Schema.Struct({
952
+ id: Schema.optional(Schema.Literal("disable_security")),
953
+ }),
954
+ Schema.Struct({
955
+ id: Schema.optional(Schema.Literal("disable_zaraz")),
956
+ }),
957
+ Schema.Struct({
958
+ id: Schema.optional(Schema.Literal("edge_cache_ttl")),
959
+ value: Schema.optional(Schema.Number),
960
+ }),
961
+ Schema.Struct({
962
+ id: Schema.optional(Schema.Literal("explicit_cache_control")),
963
+ value: Schema.optional(Schema.Literals(["on", "off"])),
964
+ }),
965
+ Schema.Struct({
966
+ id: Schema.optional(Schema.Literal("forwarding_url")),
967
+ value: Schema.optional(
968
+ Schema.Struct({
969
+ statusCode: Schema.optional(Schema.Literals(["301", "302"])),
970
+ url: Schema.optional(Schema.String),
971
+ }).pipe(Schema.encodeKeys({ statusCode: "status_code", url: "url" })),
972
+ ),
973
+ }),
974
+ Schema.Struct({
975
+ id: Schema.optional(Schema.Literal("host_header_override")),
976
+ value: Schema.optional(Schema.String),
977
+ }),
978
+ Schema.Struct({
979
+ id: Schema.optional(Schema.Literal("resolve_override")),
980
+ value: Schema.optional(Schema.String),
981
+ }),
982
+ Schema.Struct({
983
+ id: Schema.optional(Schema.Literal("respect_strong_etag")),
984
+ value: Schema.optional(Schema.Literals(["on", "off"])),
985
+ }),
986
+ ]),
987
+ ),
988
+ targets: Schema.Array(
989
+ Schema.Struct({
990
+ constraint: Schema.optional(
991
+ Schema.Struct({
992
+ operator: Schema.Literals([
993
+ "matches",
994
+ "contains",
995
+ "equals",
996
+ "not_equal",
997
+ "not_contain",
998
+ ]),
999
+ value: Schema.String,
1000
+ }),
1001
+ ),
1002
+ target: Schema.optional(Schema.Literal("url")),
1003
+ }),
1004
+ ),
1005
+ priority: Schema.optional(Schema.Number),
1006
+ status: Schema.optional(Schema.Literals(["active", "disabled"])),
1007
+ }).pipe(
1008
+ T.Http({ method: "POST", path: "/zones/{zone_id}/pagerules" }),
1009
+ ) as unknown as Schema.Schema<CreatePageRuleRequest>;
1010
+
1011
+ export interface CreatePageRuleResponse {
1012
+ /** Identifier. */
1013
+ id: string;
1014
+ /** The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. */
1015
+ actions: (
1016
+ | unknown
1017
+ | { id?: "bypass_cache_on_cookie" | null; value?: string | null }
1018
+ | { id?: "cache_by_device_type" | null; value?: "on" | "off" | null }
1019
+ | { id?: "cache_deception_armor" | null; value?: "on" | "off" | null }
1020
+ | {
1021
+ id?: "cache_key_fields" | null;
1022
+ value?: {
1023
+ cookie?: {
1024
+ checkPresence?: string[] | null;
1025
+ include?: string[] | null;
1026
+ } | null;
1027
+ header?: {
1028
+ checkPresence?: string[] | null;
1029
+ exclude?: string[] | null;
1030
+ include?: string[] | null;
1031
+ } | null;
1032
+ host?: { resolved?: boolean | null } | null;
1033
+ queryString?: {
1034
+ exclude?: "*" | string[] | null;
1035
+ include?: "*" | string[] | null;
1036
+ } | null;
1037
+ user?: {
1038
+ deviceType?: boolean | null;
1039
+ geo?: boolean | null;
1040
+ lang?: boolean | null;
1041
+ } | null;
1042
+ } | null;
1043
+ }
1044
+ | { id?: "cache_on_cookie" | null; value?: string | null }
1045
+ | {
1046
+ id?: "cache_ttl_by_status" | null;
1047
+ value?: Record<string, unknown> | null;
1048
+ }
1049
+ | { id?: "disable_apps" | null }
1050
+ | { id?: "disable_performance" | null }
1051
+ | { id?: "disable_security" | null }
1052
+ | { id?: "disable_zaraz" | null }
1053
+ | { id?: "edge_cache_ttl" | null; value?: number | null }
1054
+ | { id?: "explicit_cache_control" | null; value?: "on" | "off" | null }
1055
+ | {
1056
+ id?: "forwarding_url" | null;
1057
+ value?: {
1058
+ statusCode?: "301" | "302" | null;
1059
+ url?: string | null;
1060
+ } | null;
1061
+ }
1062
+ | { id?: "host_header_override" | null; value?: string | null }
1063
+ | { id?: "resolve_override" | null; value?: string | null }
1064
+ | { id?: "respect_strong_etag" | null; value?: "on" | "off" | null }
1065
+ )[];
1066
+ /** The timestamp of when the Page Rule was created. */
1067
+ createdOn: string;
1068
+ /** The timestamp of when the Page Rule was last modified. */
1069
+ modifiedOn: string;
1070
+ /** The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: `/images/ `) bu */
1071
+ priority: number;
1072
+ /** The status of the Page Rule. */
1073
+ status: "active" | "disabled";
1074
+ /** The rule targets to evaluate on each request. */
1075
+ targets: {
1076
+ constraint?: {
1077
+ operator: "matches" | "contains" | "equals" | "not_equal" | "not_contain";
1078
+ value: string;
1079
+ } | null;
1080
+ target?: "url" | null;
1081
+ }[];
1082
+ }
1083
+
1084
+ export const CreatePageRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
1085
+ {
1086
+ id: Schema.String,
1087
+ actions: Schema.Array(
1088
+ Schema.Union([
1089
+ Schema.Unknown,
1090
+ Schema.Struct({
1091
+ id: Schema.optional(
1092
+ Schema.Union([
1093
+ Schema.Literal("bypass_cache_on_cookie"),
1094
+ Schema.Null,
1095
+ ]),
1096
+ ),
1097
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1098
+ }),
1099
+ Schema.Struct({
1100
+ id: Schema.optional(
1101
+ Schema.Union([Schema.Literal("cache_by_device_type"), Schema.Null]),
1102
+ ),
1103
+ value: Schema.optional(
1104
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
1105
+ ),
1106
+ }),
1107
+ Schema.Struct({
1108
+ id: Schema.optional(
1109
+ Schema.Union([
1110
+ Schema.Literal("cache_deception_armor"),
1111
+ Schema.Null,
1112
+ ]),
1113
+ ),
1114
+ value: Schema.optional(
1115
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
1116
+ ),
1117
+ }),
1118
+ Schema.Struct({
1119
+ id: Schema.optional(
1120
+ Schema.Union([Schema.Literal("cache_key_fields"), Schema.Null]),
1121
+ ),
1122
+ value: Schema.optional(
1123
+ Schema.Union([
1124
+ Schema.Struct({
1125
+ cookie: Schema.optional(
1126
+ Schema.Union([
1127
+ Schema.Struct({
1128
+ checkPresence: Schema.optional(
1129
+ Schema.Union([
1130
+ Schema.Array(Schema.String),
1131
+ Schema.Null,
1132
+ ]),
1133
+ ),
1134
+ include: Schema.optional(
1135
+ Schema.Union([
1136
+ Schema.Array(Schema.String),
1137
+ Schema.Null,
1138
+ ]),
1139
+ ),
1140
+ }).pipe(
1141
+ Schema.encodeKeys({
1142
+ checkPresence: "check_presence",
1143
+ include: "include",
1144
+ }),
1145
+ ),
1146
+ Schema.Null,
1147
+ ]),
1148
+ ),
1149
+ header: Schema.optional(
1150
+ Schema.Union([
1151
+ Schema.Struct({
1152
+ checkPresence: Schema.optional(
1153
+ Schema.Union([
1154
+ Schema.Array(Schema.String),
1155
+ Schema.Null,
1156
+ ]),
1157
+ ),
1158
+ exclude: Schema.optional(
1159
+ Schema.Union([
1160
+ Schema.Array(Schema.String),
1161
+ Schema.Null,
1162
+ ]),
1163
+ ),
1164
+ include: Schema.optional(
1165
+ Schema.Union([
1166
+ Schema.Array(Schema.String),
1167
+ Schema.Null,
1168
+ ]),
1169
+ ),
1170
+ }).pipe(
1171
+ Schema.encodeKeys({
1172
+ checkPresence: "check_presence",
1173
+ exclude: "exclude",
1174
+ include: "include",
1175
+ }),
1176
+ ),
1177
+ Schema.Null,
1178
+ ]),
1179
+ ),
1180
+ host: Schema.optional(
1181
+ Schema.Union([
1182
+ Schema.Struct({
1183
+ resolved: Schema.optional(
1184
+ Schema.Union([Schema.Boolean, Schema.Null]),
1185
+ ),
1186
+ }),
1187
+ Schema.Null,
1188
+ ]),
1189
+ ),
1190
+ queryString: Schema.optional(
1191
+ Schema.Union([
1192
+ Schema.Struct({
1193
+ exclude: Schema.optional(
1194
+ Schema.Union([
1195
+ Schema.Union([
1196
+ Schema.Literal("*"),
1197
+ Schema.Array(Schema.String),
1198
+ ]),
1199
+ Schema.Null,
1200
+ ]),
1201
+ ),
1202
+ include: Schema.optional(
1203
+ Schema.Union([
1204
+ Schema.Union([
1205
+ Schema.Literal("*"),
1206
+ Schema.Array(Schema.String),
1207
+ ]),
1208
+ Schema.Null,
1209
+ ]),
1210
+ ),
1211
+ }),
1212
+ Schema.Null,
1213
+ ]),
1214
+ ),
1215
+ user: Schema.optional(
1216
+ Schema.Union([
1217
+ Schema.Struct({
1218
+ deviceType: Schema.optional(
1219
+ Schema.Union([Schema.Boolean, Schema.Null]),
1220
+ ),
1221
+ geo: Schema.optional(
1222
+ Schema.Union([Schema.Boolean, Schema.Null]),
1223
+ ),
1224
+ lang: Schema.optional(
1225
+ Schema.Union([Schema.Boolean, Schema.Null]),
1226
+ ),
1227
+ }).pipe(
1228
+ Schema.encodeKeys({
1229
+ deviceType: "device_type",
1230
+ geo: "geo",
1231
+ lang: "lang",
1232
+ }),
1233
+ ),
1234
+ Schema.Null,
1235
+ ]),
1236
+ ),
1237
+ }).pipe(
1238
+ Schema.encodeKeys({
1239
+ cookie: "cookie",
1240
+ header: "header",
1241
+ host: "host",
1242
+ queryString: "query_string",
1243
+ user: "user",
1244
+ }),
1245
+ ),
1246
+ Schema.Null,
1247
+ ]),
1248
+ ),
1249
+ }),
1250
+ Schema.Struct({
1251
+ id: Schema.optional(
1252
+ Schema.Union([Schema.Literal("cache_on_cookie"), Schema.Null]),
1253
+ ),
1254
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1255
+ }),
1256
+ Schema.Struct({
1257
+ id: Schema.optional(
1258
+ Schema.Union([Schema.Literal("cache_ttl_by_status"), Schema.Null]),
1259
+ ),
1260
+ value: Schema.optional(
1261
+ Schema.Union([Schema.Struct({}), Schema.Null]),
1262
+ ),
1263
+ }),
1264
+ Schema.Struct({
1265
+ id: Schema.optional(
1266
+ Schema.Union([Schema.Literal("disable_apps"), Schema.Null]),
1267
+ ),
1268
+ }),
1269
+ Schema.Struct({
1270
+ id: Schema.optional(
1271
+ Schema.Union([Schema.Literal("disable_performance"), Schema.Null]),
1272
+ ),
1273
+ }),
1274
+ Schema.Struct({
1275
+ id: Schema.optional(
1276
+ Schema.Union([Schema.Literal("disable_security"), Schema.Null]),
1277
+ ),
1278
+ }),
1279
+ Schema.Struct({
1280
+ id: Schema.optional(
1281
+ Schema.Union([Schema.Literal("disable_zaraz"), Schema.Null]),
1282
+ ),
1283
+ }),
1284
+ Schema.Struct({
1285
+ id: Schema.optional(
1286
+ Schema.Union([Schema.Literal("edge_cache_ttl"), Schema.Null]),
1287
+ ),
1288
+ value: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1289
+ }),
1290
+ Schema.Struct({
1291
+ id: Schema.optional(
1292
+ Schema.Union([
1293
+ Schema.Literal("explicit_cache_control"),
1294
+ Schema.Null,
1295
+ ]),
1296
+ ),
1297
+ value: Schema.optional(
1298
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
1299
+ ),
1300
+ }),
1301
+ Schema.Struct({
1302
+ id: Schema.optional(
1303
+ Schema.Union([Schema.Literal("forwarding_url"), Schema.Null]),
1304
+ ),
1305
+ value: Schema.optional(
1306
+ Schema.Union([
1307
+ Schema.Struct({
1308
+ statusCode: Schema.optional(
1309
+ Schema.Union([Schema.Literals(["301", "302"]), Schema.Null]),
1310
+ ),
1311
+ url: Schema.optional(
1312
+ Schema.Union([Schema.String, Schema.Null]),
1313
+ ),
1314
+ }).pipe(
1315
+ Schema.encodeKeys({ statusCode: "status_code", url: "url" }),
1316
+ ),
1317
+ Schema.Null,
1318
+ ]),
1319
+ ),
1320
+ }),
1321
+ Schema.Struct({
1322
+ id: Schema.optional(
1323
+ Schema.Union([Schema.Literal("host_header_override"), Schema.Null]),
1324
+ ),
1325
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1326
+ }),
1327
+ Schema.Struct({
1328
+ id: Schema.optional(
1329
+ Schema.Union([Schema.Literal("resolve_override"), Schema.Null]),
1330
+ ),
1331
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1332
+ }),
1333
+ Schema.Struct({
1334
+ id: Schema.optional(
1335
+ Schema.Union([Schema.Literal("respect_strong_etag"), Schema.Null]),
1336
+ ),
1337
+ value: Schema.optional(
1338
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
1339
+ ),
1340
+ }),
1341
+ ]),
1342
+ ),
1343
+ createdOn: Schema.String,
1344
+ modifiedOn: Schema.String,
1345
+ priority: Schema.Number,
1346
+ status: Schema.Literals(["active", "disabled"]),
1347
+ targets: Schema.Array(
1348
+ Schema.Struct({
1349
+ constraint: Schema.optional(
1350
+ Schema.Union([
1351
+ Schema.Struct({
1352
+ operator: Schema.Literals([
1353
+ "matches",
1354
+ "contains",
1355
+ "equals",
1356
+ "not_equal",
1357
+ "not_contain",
1358
+ ]),
1359
+ value: Schema.String,
1360
+ }),
1361
+ Schema.Null,
1362
+ ]),
1363
+ ),
1364
+ target: Schema.optional(
1365
+ Schema.Union([Schema.Literal("url"), Schema.Null]),
1366
+ ),
1367
+ }),
1368
+ ),
1369
+ },
1370
+ ).pipe(
1371
+ Schema.encodeKeys({
1372
+ id: "id",
1373
+ actions: "actions",
1374
+ createdOn: "created_on",
1375
+ modifiedOn: "modified_on",
1376
+ priority: "priority",
1377
+ status: "status",
1378
+ targets: "targets",
1379
+ }),
1380
+ ) as unknown as Schema.Schema<CreatePageRuleResponse>;
1381
+
1382
+ export type CreatePageRuleError = DefaultErrors;
1383
+
1384
+ export const createPageRule: API.OperationMethod<
1385
+ CreatePageRuleRequest,
1386
+ CreatePageRuleResponse,
1387
+ CreatePageRuleError,
1388
+ Credentials | HttpClient.HttpClient
1389
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1390
+ input: CreatePageRuleRequest,
1391
+ output: CreatePageRuleResponse,
1392
+ errors: [],
1393
+ }));
1394
+
1395
+ export interface UpdatePageRuleRequest {
1396
+ pageruleId: string;
1397
+ /** Path param: Identifier. */
1398
+ zoneId: string;
1399
+ /** Body param: The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. */
1400
+ actions: (
1401
+ | unknown
1402
+ | { id?: "bypass_cache_on_cookie"; value?: string }
1403
+ | { id?: "cache_by_device_type"; value?: "on" | "off" }
1404
+ | { id?: "cache_deception_armor"; value?: "on" | "off" }
1405
+ | {
1406
+ id?: "cache_key_fields";
1407
+ value?: {
1408
+ cookie?: { checkPresence?: string[]; include?: string[] };
1409
+ header?: {
1410
+ checkPresence?: string[];
1411
+ exclude?: string[];
1412
+ include?: string[];
1413
+ };
1414
+ host?: { resolved?: boolean };
1415
+ queryString?: { exclude?: "*" | string[]; include?: "*" | string[] };
1416
+ user?: { deviceType?: boolean; geo?: boolean; lang?: boolean };
1417
+ };
1418
+ }
1419
+ | { id?: "cache_on_cookie"; value?: string }
1420
+ | { id?: "cache_ttl_by_status"; value?: Record<string, unknown> }
1421
+ | { id?: "disable_apps" }
1422
+ | { id?: "disable_performance" }
1423
+ | { id?: "disable_security" }
1424
+ | { id?: "disable_zaraz" }
1425
+ | { id?: "edge_cache_ttl"; value?: number }
1426
+ | { id?: "explicit_cache_control"; value?: "on" | "off" }
1427
+ | {
1428
+ id?: "forwarding_url";
1429
+ value?: { statusCode?: "301" | "302"; url?: string };
1430
+ }
1431
+ | { id?: "host_header_override"; value?: string }
1432
+ | { id?: "resolve_override"; value?: string }
1433
+ | { id?: "respect_strong_etag"; value?: "on" | "off" }
1434
+ )[];
1435
+ /** Body param: The rule targets to evaluate on each request. */
1436
+ targets: {
1437
+ constraint?: {
1438
+ operator: "matches" | "contains" | "equals" | "not_equal" | "not_contain";
1439
+ value: string;
1440
+ };
1441
+ target?: "url";
1442
+ }[];
1443
+ /** Body param: The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: `/i */
1444
+ priority?: number;
1445
+ /** Body param: The status of the Page Rule. */
1446
+ status?: "active" | "disabled";
1447
+ }
1448
+
1449
+ export const UpdatePageRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1450
+ pageruleId: Schema.String.pipe(T.HttpPath("pageruleId")),
1451
+ zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
1452
+ actions: Schema.Array(
1453
+ Schema.Union([
1454
+ Schema.Unknown,
1455
+ Schema.Struct({
1456
+ id: Schema.optional(Schema.Literal("bypass_cache_on_cookie")),
1457
+ value: Schema.optional(Schema.String),
1458
+ }),
1459
+ Schema.Struct({
1460
+ id: Schema.optional(Schema.Literal("cache_by_device_type")),
1461
+ value: Schema.optional(Schema.Literals(["on", "off"])),
1462
+ }),
1463
+ Schema.Struct({
1464
+ id: Schema.optional(Schema.Literal("cache_deception_armor")),
1465
+ value: Schema.optional(Schema.Literals(["on", "off"])),
1466
+ }),
1467
+ Schema.Struct({
1468
+ id: Schema.optional(Schema.Literal("cache_key_fields")),
1469
+ value: Schema.optional(
1470
+ Schema.Struct({
1471
+ cookie: Schema.optional(
1472
+ Schema.Struct({
1473
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
1474
+ include: Schema.optional(Schema.Array(Schema.String)),
1475
+ }).pipe(
1476
+ Schema.encodeKeys({
1477
+ checkPresence: "check_presence",
1478
+ include: "include",
1479
+ }),
1480
+ ),
1481
+ ),
1482
+ header: Schema.optional(
1483
+ Schema.Struct({
1484
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
1485
+ exclude: Schema.optional(Schema.Array(Schema.String)),
1486
+ include: Schema.optional(Schema.Array(Schema.String)),
1487
+ }).pipe(
1488
+ Schema.encodeKeys({
1489
+ checkPresence: "check_presence",
1490
+ exclude: "exclude",
1491
+ include: "include",
1492
+ }),
1493
+ ),
1494
+ ),
1495
+ host: Schema.optional(
1496
+ Schema.Struct({
1497
+ resolved: Schema.optional(Schema.Boolean),
1498
+ }),
1499
+ ),
1500
+ queryString: Schema.optional(
1501
+ Schema.Struct({
1502
+ exclude: Schema.optional(
1503
+ Schema.Union([
1504
+ Schema.Literal("*"),
1505
+ Schema.Array(Schema.String),
1506
+ ]),
1507
+ ),
1508
+ include: Schema.optional(
1509
+ Schema.Union([
1510
+ Schema.Literal("*"),
1511
+ Schema.Array(Schema.String),
1512
+ ]),
1513
+ ),
1514
+ }),
1515
+ ),
1516
+ user: Schema.optional(
1517
+ Schema.Struct({
1518
+ deviceType: Schema.optional(Schema.Boolean),
1519
+ geo: Schema.optional(Schema.Boolean),
1520
+ lang: Schema.optional(Schema.Boolean),
1521
+ }).pipe(
1522
+ Schema.encodeKeys({
1523
+ deviceType: "device_type",
1524
+ geo: "geo",
1525
+ lang: "lang",
1526
+ }),
1527
+ ),
1528
+ ),
1529
+ }).pipe(
1530
+ Schema.encodeKeys({
1531
+ cookie: "cookie",
1532
+ header: "header",
1533
+ host: "host",
1534
+ queryString: "query_string",
1535
+ user: "user",
1536
+ }),
1537
+ ),
1538
+ ),
1539
+ }),
1540
+ Schema.Struct({
1541
+ id: Schema.optional(Schema.Literal("cache_on_cookie")),
1542
+ value: Schema.optional(Schema.String),
1543
+ }),
1544
+ Schema.Struct({
1545
+ id: Schema.optional(Schema.Literal("cache_ttl_by_status")),
1546
+ value: Schema.optional(Schema.Struct({})),
1547
+ }),
1548
+ Schema.Struct({
1549
+ id: Schema.optional(Schema.Literal("disable_apps")),
1550
+ }),
1551
+ Schema.Struct({
1552
+ id: Schema.optional(Schema.Literal("disable_performance")),
1553
+ }),
1554
+ Schema.Struct({
1555
+ id: Schema.optional(Schema.Literal("disable_security")),
1556
+ }),
1557
+ Schema.Struct({
1558
+ id: Schema.optional(Schema.Literal("disable_zaraz")),
1559
+ }),
1560
+ Schema.Struct({
1561
+ id: Schema.optional(Schema.Literal("edge_cache_ttl")),
1562
+ value: Schema.optional(Schema.Number),
1563
+ }),
1564
+ Schema.Struct({
1565
+ id: Schema.optional(Schema.Literal("explicit_cache_control")),
1566
+ value: Schema.optional(Schema.Literals(["on", "off"])),
1567
+ }),
1568
+ Schema.Struct({
1569
+ id: Schema.optional(Schema.Literal("forwarding_url")),
1570
+ value: Schema.optional(
1571
+ Schema.Struct({
1572
+ statusCode: Schema.optional(Schema.Literals(["301", "302"])),
1573
+ url: Schema.optional(Schema.String),
1574
+ }).pipe(Schema.encodeKeys({ statusCode: "status_code", url: "url" })),
1575
+ ),
1576
+ }),
1577
+ Schema.Struct({
1578
+ id: Schema.optional(Schema.Literal("host_header_override")),
1579
+ value: Schema.optional(Schema.String),
1580
+ }),
1581
+ Schema.Struct({
1582
+ id: Schema.optional(Schema.Literal("resolve_override")),
1583
+ value: Schema.optional(Schema.String),
1584
+ }),
1585
+ Schema.Struct({
1586
+ id: Schema.optional(Schema.Literal("respect_strong_etag")),
1587
+ value: Schema.optional(Schema.Literals(["on", "off"])),
1588
+ }),
1589
+ ]),
1590
+ ),
1591
+ targets: Schema.Array(
1592
+ Schema.Struct({
1593
+ constraint: Schema.optional(
1594
+ Schema.Struct({
1595
+ operator: Schema.Literals([
1596
+ "matches",
1597
+ "contains",
1598
+ "equals",
1599
+ "not_equal",
1600
+ "not_contain",
1601
+ ]),
1602
+ value: Schema.String,
1603
+ }),
1604
+ ),
1605
+ target: Schema.optional(Schema.Literal("url")),
1606
+ }),
1607
+ ),
1608
+ priority: Schema.optional(Schema.Number),
1609
+ status: Schema.optional(Schema.Literals(["active", "disabled"])),
1610
+ }).pipe(
1611
+ T.Http({ method: "PUT", path: "/zones/{zone_id}/pagerules/{pageruleId}" }),
1612
+ ) as unknown as Schema.Schema<UpdatePageRuleRequest>;
1613
+
1614
+ export interface UpdatePageRuleResponse {
1615
+ /** Identifier. */
1616
+ id: string;
1617
+ /** The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. */
1618
+ actions: (
1619
+ | unknown
1620
+ | { id?: "bypass_cache_on_cookie" | null; value?: string | null }
1621
+ | { id?: "cache_by_device_type" | null; value?: "on" | "off" | null }
1622
+ | { id?: "cache_deception_armor" | null; value?: "on" | "off" | null }
1623
+ | {
1624
+ id?: "cache_key_fields" | null;
1625
+ value?: {
1626
+ cookie?: {
1627
+ checkPresence?: string[] | null;
1628
+ include?: string[] | null;
1629
+ } | null;
1630
+ header?: {
1631
+ checkPresence?: string[] | null;
1632
+ exclude?: string[] | null;
1633
+ include?: string[] | null;
1634
+ } | null;
1635
+ host?: { resolved?: boolean | null } | null;
1636
+ queryString?: {
1637
+ exclude?: "*" | string[] | null;
1638
+ include?: "*" | string[] | null;
1639
+ } | null;
1640
+ user?: {
1641
+ deviceType?: boolean | null;
1642
+ geo?: boolean | null;
1643
+ lang?: boolean | null;
1644
+ } | null;
1645
+ } | null;
1646
+ }
1647
+ | { id?: "cache_on_cookie" | null; value?: string | null }
1648
+ | {
1649
+ id?: "cache_ttl_by_status" | null;
1650
+ value?: Record<string, unknown> | null;
1651
+ }
1652
+ | { id?: "disable_apps" | null }
1653
+ | { id?: "disable_performance" | null }
1654
+ | { id?: "disable_security" | null }
1655
+ | { id?: "disable_zaraz" | null }
1656
+ | { id?: "edge_cache_ttl" | null; value?: number | null }
1657
+ | { id?: "explicit_cache_control" | null; value?: "on" | "off" | null }
1658
+ | {
1659
+ id?: "forwarding_url" | null;
1660
+ value?: {
1661
+ statusCode?: "301" | "302" | null;
1662
+ url?: string | null;
1663
+ } | null;
1664
+ }
1665
+ | { id?: "host_header_override" | null; value?: string | null }
1666
+ | { id?: "resolve_override" | null; value?: string | null }
1667
+ | { id?: "respect_strong_etag" | null; value?: "on" | "off" | null }
1668
+ )[];
1669
+ /** The timestamp of when the Page Rule was created. */
1670
+ createdOn: string;
1671
+ /** The timestamp of when the Page Rule was last modified. */
1672
+ modifiedOn: string;
1673
+ /** The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: `/images/ `) bu */
1674
+ priority: number;
1675
+ /** The status of the Page Rule. */
1676
+ status: "active" | "disabled";
1677
+ /** The rule targets to evaluate on each request. */
1678
+ targets: {
1679
+ constraint?: {
1680
+ operator: "matches" | "contains" | "equals" | "not_equal" | "not_contain";
1681
+ value: string;
1682
+ } | null;
1683
+ target?: "url" | null;
1684
+ }[];
1685
+ }
1686
+
1687
+ export const UpdatePageRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
1688
+ {
1689
+ id: Schema.String,
1690
+ actions: Schema.Array(
1691
+ Schema.Union([
1692
+ Schema.Unknown,
1693
+ Schema.Struct({
1694
+ id: Schema.optional(
1695
+ Schema.Union([
1696
+ Schema.Literal("bypass_cache_on_cookie"),
1697
+ Schema.Null,
1698
+ ]),
1699
+ ),
1700
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1701
+ }),
1702
+ Schema.Struct({
1703
+ id: Schema.optional(
1704
+ Schema.Union([Schema.Literal("cache_by_device_type"), Schema.Null]),
1705
+ ),
1706
+ value: Schema.optional(
1707
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
1708
+ ),
1709
+ }),
1710
+ Schema.Struct({
1711
+ id: Schema.optional(
1712
+ Schema.Union([
1713
+ Schema.Literal("cache_deception_armor"),
1714
+ Schema.Null,
1715
+ ]),
1716
+ ),
1717
+ value: Schema.optional(
1718
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
1719
+ ),
1720
+ }),
1721
+ Schema.Struct({
1722
+ id: Schema.optional(
1723
+ Schema.Union([Schema.Literal("cache_key_fields"), Schema.Null]),
1724
+ ),
1725
+ value: Schema.optional(
1726
+ Schema.Union([
1727
+ Schema.Struct({
1728
+ cookie: Schema.optional(
1729
+ Schema.Union([
1730
+ Schema.Struct({
1731
+ checkPresence: Schema.optional(
1732
+ Schema.Union([
1733
+ Schema.Array(Schema.String),
1734
+ Schema.Null,
1735
+ ]),
1736
+ ),
1737
+ include: Schema.optional(
1738
+ Schema.Union([
1739
+ Schema.Array(Schema.String),
1740
+ Schema.Null,
1741
+ ]),
1742
+ ),
1743
+ }).pipe(
1744
+ Schema.encodeKeys({
1745
+ checkPresence: "check_presence",
1746
+ include: "include",
1747
+ }),
1748
+ ),
1749
+ Schema.Null,
1750
+ ]),
1751
+ ),
1752
+ header: Schema.optional(
1753
+ Schema.Union([
1754
+ Schema.Struct({
1755
+ checkPresence: Schema.optional(
1756
+ Schema.Union([
1757
+ Schema.Array(Schema.String),
1758
+ Schema.Null,
1759
+ ]),
1760
+ ),
1761
+ exclude: Schema.optional(
1762
+ Schema.Union([
1763
+ Schema.Array(Schema.String),
1764
+ Schema.Null,
1765
+ ]),
1766
+ ),
1767
+ include: Schema.optional(
1768
+ Schema.Union([
1769
+ Schema.Array(Schema.String),
1770
+ Schema.Null,
1771
+ ]),
1772
+ ),
1773
+ }).pipe(
1774
+ Schema.encodeKeys({
1775
+ checkPresence: "check_presence",
1776
+ exclude: "exclude",
1777
+ include: "include",
1778
+ }),
1779
+ ),
1780
+ Schema.Null,
1781
+ ]),
1782
+ ),
1783
+ host: Schema.optional(
1784
+ Schema.Union([
1785
+ Schema.Struct({
1786
+ resolved: Schema.optional(
1787
+ Schema.Union([Schema.Boolean, Schema.Null]),
1788
+ ),
1789
+ }),
1790
+ Schema.Null,
1791
+ ]),
1792
+ ),
1793
+ queryString: Schema.optional(
1794
+ Schema.Union([
1795
+ Schema.Struct({
1796
+ exclude: Schema.optional(
1797
+ Schema.Union([
1798
+ Schema.Union([
1799
+ Schema.Literal("*"),
1800
+ Schema.Array(Schema.String),
1801
+ ]),
1802
+ Schema.Null,
1803
+ ]),
1804
+ ),
1805
+ include: Schema.optional(
1806
+ Schema.Union([
1807
+ Schema.Union([
1808
+ Schema.Literal("*"),
1809
+ Schema.Array(Schema.String),
1810
+ ]),
1811
+ Schema.Null,
1812
+ ]),
1813
+ ),
1814
+ }),
1815
+ Schema.Null,
1816
+ ]),
1817
+ ),
1818
+ user: Schema.optional(
1819
+ Schema.Union([
1820
+ Schema.Struct({
1821
+ deviceType: Schema.optional(
1822
+ Schema.Union([Schema.Boolean, Schema.Null]),
1823
+ ),
1824
+ geo: Schema.optional(
1825
+ Schema.Union([Schema.Boolean, Schema.Null]),
1826
+ ),
1827
+ lang: Schema.optional(
1828
+ Schema.Union([Schema.Boolean, Schema.Null]),
1829
+ ),
1830
+ }).pipe(
1831
+ Schema.encodeKeys({
1832
+ deviceType: "device_type",
1833
+ geo: "geo",
1834
+ lang: "lang",
1835
+ }),
1836
+ ),
1837
+ Schema.Null,
1838
+ ]),
1839
+ ),
1840
+ }).pipe(
1841
+ Schema.encodeKeys({
1842
+ cookie: "cookie",
1843
+ header: "header",
1844
+ host: "host",
1845
+ queryString: "query_string",
1846
+ user: "user",
1847
+ }),
1848
+ ),
1849
+ Schema.Null,
1850
+ ]),
1851
+ ),
1852
+ }),
1853
+ Schema.Struct({
1854
+ id: Schema.optional(
1855
+ Schema.Union([Schema.Literal("cache_on_cookie"), Schema.Null]),
1856
+ ),
1857
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1858
+ }),
1859
+ Schema.Struct({
1860
+ id: Schema.optional(
1861
+ Schema.Union([Schema.Literal("cache_ttl_by_status"), Schema.Null]),
1862
+ ),
1863
+ value: Schema.optional(
1864
+ Schema.Union([Schema.Struct({}), Schema.Null]),
1865
+ ),
1866
+ }),
1867
+ Schema.Struct({
1868
+ id: Schema.optional(
1869
+ Schema.Union([Schema.Literal("disable_apps"), Schema.Null]),
1870
+ ),
1871
+ }),
1872
+ Schema.Struct({
1873
+ id: Schema.optional(
1874
+ Schema.Union([Schema.Literal("disable_performance"), Schema.Null]),
1875
+ ),
1876
+ }),
1877
+ Schema.Struct({
1878
+ id: Schema.optional(
1879
+ Schema.Union([Schema.Literal("disable_security"), Schema.Null]),
1880
+ ),
1881
+ }),
1882
+ Schema.Struct({
1883
+ id: Schema.optional(
1884
+ Schema.Union([Schema.Literal("disable_zaraz"), Schema.Null]),
1885
+ ),
1886
+ }),
1887
+ Schema.Struct({
1888
+ id: Schema.optional(
1889
+ Schema.Union([Schema.Literal("edge_cache_ttl"), Schema.Null]),
1890
+ ),
1891
+ value: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1892
+ }),
1893
+ Schema.Struct({
1894
+ id: Schema.optional(
1895
+ Schema.Union([
1896
+ Schema.Literal("explicit_cache_control"),
1897
+ Schema.Null,
1898
+ ]),
1899
+ ),
1900
+ value: Schema.optional(
1901
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
1902
+ ),
1903
+ }),
1904
+ Schema.Struct({
1905
+ id: Schema.optional(
1906
+ Schema.Union([Schema.Literal("forwarding_url"), Schema.Null]),
1907
+ ),
1908
+ value: Schema.optional(
1909
+ Schema.Union([
1910
+ Schema.Struct({
1911
+ statusCode: Schema.optional(
1912
+ Schema.Union([Schema.Literals(["301", "302"]), Schema.Null]),
1913
+ ),
1914
+ url: Schema.optional(
1915
+ Schema.Union([Schema.String, Schema.Null]),
1916
+ ),
1917
+ }).pipe(
1918
+ Schema.encodeKeys({ statusCode: "status_code", url: "url" }),
1919
+ ),
1920
+ Schema.Null,
1921
+ ]),
1922
+ ),
1923
+ }),
1924
+ Schema.Struct({
1925
+ id: Schema.optional(
1926
+ Schema.Union([Schema.Literal("host_header_override"), Schema.Null]),
1927
+ ),
1928
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1929
+ }),
1930
+ Schema.Struct({
1931
+ id: Schema.optional(
1932
+ Schema.Union([Schema.Literal("resolve_override"), Schema.Null]),
1933
+ ),
1934
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1935
+ }),
1936
+ Schema.Struct({
1937
+ id: Schema.optional(
1938
+ Schema.Union([Schema.Literal("respect_strong_etag"), Schema.Null]),
1939
+ ),
1940
+ value: Schema.optional(
1941
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
1942
+ ),
1943
+ }),
1944
+ ]),
1945
+ ),
1946
+ createdOn: Schema.String,
1947
+ modifiedOn: Schema.String,
1948
+ priority: Schema.Number,
1949
+ status: Schema.Literals(["active", "disabled"]),
1950
+ targets: Schema.Array(
1951
+ Schema.Struct({
1952
+ constraint: Schema.optional(
1953
+ Schema.Union([
1954
+ Schema.Struct({
1955
+ operator: Schema.Literals([
1956
+ "matches",
1957
+ "contains",
1958
+ "equals",
1959
+ "not_equal",
1960
+ "not_contain",
1961
+ ]),
1962
+ value: Schema.String,
1963
+ }),
1964
+ Schema.Null,
1965
+ ]),
1966
+ ),
1967
+ target: Schema.optional(
1968
+ Schema.Union([Schema.Literal("url"), Schema.Null]),
1969
+ ),
1970
+ }),
1971
+ ),
1972
+ },
1973
+ ).pipe(
1974
+ Schema.encodeKeys({
1975
+ id: "id",
1976
+ actions: "actions",
1977
+ createdOn: "created_on",
1978
+ modifiedOn: "modified_on",
1979
+ priority: "priority",
1980
+ status: "status",
1981
+ targets: "targets",
1982
+ }),
1983
+ ) as unknown as Schema.Schema<UpdatePageRuleResponse>;
1984
+
1985
+ export type UpdatePageRuleError = DefaultErrors;
1986
+
1987
+ export const updatePageRule: API.OperationMethod<
1988
+ UpdatePageRuleRequest,
1989
+ UpdatePageRuleResponse,
1990
+ UpdatePageRuleError,
1991
+ Credentials | HttpClient.HttpClient
1992
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1993
+ input: UpdatePageRuleRequest,
1994
+ output: UpdatePageRuleResponse,
1995
+ errors: [],
1996
+ }));
1997
+
1998
+ export interface PatchPageRuleRequest {
1999
+ pageruleId: string;
2000
+ /** Path param: Identifier. */
2001
+ zoneId: string;
2002
+ /** Body param: The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. */
2003
+ actions?: (
2004
+ | unknown
2005
+ | { id?: "bypass_cache_on_cookie"; value?: string }
2006
+ | { id?: "cache_by_device_type"; value?: "on" | "off" }
2007
+ | { id?: "cache_deception_armor"; value?: "on" | "off" }
2008
+ | {
2009
+ id?: "cache_key_fields";
2010
+ value?: {
2011
+ cookie?: { checkPresence?: string[]; include?: string[] };
2012
+ header?: {
2013
+ checkPresence?: string[];
2014
+ exclude?: string[];
2015
+ include?: string[];
2016
+ };
2017
+ host?: { resolved?: boolean };
2018
+ queryString?: { exclude?: "*" | string[]; include?: "*" | string[] };
2019
+ user?: { deviceType?: boolean; geo?: boolean; lang?: boolean };
2020
+ };
2021
+ }
2022
+ | { id?: "cache_on_cookie"; value?: string }
2023
+ | { id?: "cache_ttl_by_status"; value?: Record<string, unknown> }
2024
+ | { id?: "disable_apps" }
2025
+ | { id?: "disable_performance" }
2026
+ | { id?: "disable_security" }
2027
+ | { id?: "disable_zaraz" }
2028
+ | { id?: "edge_cache_ttl"; value?: number }
2029
+ | { id?: "explicit_cache_control"; value?: "on" | "off" }
2030
+ | {
2031
+ id?: "forwarding_url";
2032
+ value?: { statusCode?: "301" | "302"; url?: string };
2033
+ }
2034
+ | { id?: "host_header_override"; value?: string }
2035
+ | { id?: "resolve_override"; value?: string }
2036
+ | { id?: "respect_strong_etag"; value?: "on" | "off" }
2037
+ )[];
2038
+ /** Body param: The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: `/i */
2039
+ priority?: number;
2040
+ /** Body param: The status of the Page Rule. */
2041
+ status?: "active" | "disabled";
2042
+ /** Body param: The rule targets to evaluate on each request. */
2043
+ targets?: {
2044
+ constraint?: {
2045
+ operator: "matches" | "contains" | "equals" | "not_equal" | "not_contain";
2046
+ value: string;
2047
+ };
2048
+ target?: "url";
2049
+ }[];
2050
+ }
2051
+
2052
+ export const PatchPageRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2053
+ pageruleId: Schema.String.pipe(T.HttpPath("pageruleId")),
2054
+ zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
2055
+ actions: Schema.optional(
2056
+ Schema.Array(
2057
+ Schema.Union([
2058
+ Schema.Unknown,
2059
+ Schema.Struct({
2060
+ id: Schema.optional(Schema.Literal("bypass_cache_on_cookie")),
2061
+ value: Schema.optional(Schema.String),
2062
+ }),
2063
+ Schema.Struct({
2064
+ id: Schema.optional(Schema.Literal("cache_by_device_type")),
2065
+ value: Schema.optional(Schema.Literals(["on", "off"])),
2066
+ }),
2067
+ Schema.Struct({
2068
+ id: Schema.optional(Schema.Literal("cache_deception_armor")),
2069
+ value: Schema.optional(Schema.Literals(["on", "off"])),
2070
+ }),
2071
+ Schema.Struct({
2072
+ id: Schema.optional(Schema.Literal("cache_key_fields")),
2073
+ value: Schema.optional(
2074
+ Schema.Struct({
2075
+ cookie: Schema.optional(
2076
+ Schema.Struct({
2077
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
2078
+ include: Schema.optional(Schema.Array(Schema.String)),
2079
+ }).pipe(
2080
+ Schema.encodeKeys({
2081
+ checkPresence: "check_presence",
2082
+ include: "include",
2083
+ }),
2084
+ ),
2085
+ ),
2086
+ header: Schema.optional(
2087
+ Schema.Struct({
2088
+ checkPresence: Schema.optional(Schema.Array(Schema.String)),
2089
+ exclude: Schema.optional(Schema.Array(Schema.String)),
2090
+ include: Schema.optional(Schema.Array(Schema.String)),
2091
+ }).pipe(
2092
+ Schema.encodeKeys({
2093
+ checkPresence: "check_presence",
2094
+ exclude: "exclude",
2095
+ include: "include",
2096
+ }),
2097
+ ),
2098
+ ),
2099
+ host: Schema.optional(
2100
+ Schema.Struct({
2101
+ resolved: Schema.optional(Schema.Boolean),
2102
+ }),
2103
+ ),
2104
+ queryString: Schema.optional(
2105
+ Schema.Struct({
2106
+ exclude: Schema.optional(
2107
+ Schema.Union([
2108
+ Schema.Literal("*"),
2109
+ Schema.Array(Schema.String),
2110
+ ]),
2111
+ ),
2112
+ include: Schema.optional(
2113
+ Schema.Union([
2114
+ Schema.Literal("*"),
2115
+ Schema.Array(Schema.String),
2116
+ ]),
2117
+ ),
2118
+ }),
2119
+ ),
2120
+ user: Schema.optional(
2121
+ Schema.Struct({
2122
+ deviceType: Schema.optional(Schema.Boolean),
2123
+ geo: Schema.optional(Schema.Boolean),
2124
+ lang: Schema.optional(Schema.Boolean),
2125
+ }).pipe(
2126
+ Schema.encodeKeys({
2127
+ deviceType: "device_type",
2128
+ geo: "geo",
2129
+ lang: "lang",
2130
+ }),
2131
+ ),
2132
+ ),
2133
+ }).pipe(
2134
+ Schema.encodeKeys({
2135
+ cookie: "cookie",
2136
+ header: "header",
2137
+ host: "host",
2138
+ queryString: "query_string",
2139
+ user: "user",
2140
+ }),
2141
+ ),
2142
+ ),
2143
+ }),
2144
+ Schema.Struct({
2145
+ id: Schema.optional(Schema.Literal("cache_on_cookie")),
2146
+ value: Schema.optional(Schema.String),
2147
+ }),
2148
+ Schema.Struct({
2149
+ id: Schema.optional(Schema.Literal("cache_ttl_by_status")),
2150
+ value: Schema.optional(Schema.Struct({})),
2151
+ }),
2152
+ Schema.Struct({
2153
+ id: Schema.optional(Schema.Literal("disable_apps")),
2154
+ }),
2155
+ Schema.Struct({
2156
+ id: Schema.optional(Schema.Literal("disable_performance")),
2157
+ }),
2158
+ Schema.Struct({
2159
+ id: Schema.optional(Schema.Literal("disable_security")),
2160
+ }),
2161
+ Schema.Struct({
2162
+ id: Schema.optional(Schema.Literal("disable_zaraz")),
2163
+ }),
2164
+ Schema.Struct({
2165
+ id: Schema.optional(Schema.Literal("edge_cache_ttl")),
2166
+ value: Schema.optional(Schema.Number),
2167
+ }),
2168
+ Schema.Struct({
2169
+ id: Schema.optional(Schema.Literal("explicit_cache_control")),
2170
+ value: Schema.optional(Schema.Literals(["on", "off"])),
2171
+ }),
2172
+ Schema.Struct({
2173
+ id: Schema.optional(Schema.Literal("forwarding_url")),
2174
+ value: Schema.optional(
2175
+ Schema.Struct({
2176
+ statusCode: Schema.optional(Schema.Literals(["301", "302"])),
2177
+ url: Schema.optional(Schema.String),
2178
+ }).pipe(
2179
+ Schema.encodeKeys({ statusCode: "status_code", url: "url" }),
2180
+ ),
2181
+ ),
2182
+ }),
2183
+ Schema.Struct({
2184
+ id: Schema.optional(Schema.Literal("host_header_override")),
2185
+ value: Schema.optional(Schema.String),
2186
+ }),
2187
+ Schema.Struct({
2188
+ id: Schema.optional(Schema.Literal("resolve_override")),
2189
+ value: Schema.optional(Schema.String),
2190
+ }),
2191
+ Schema.Struct({
2192
+ id: Schema.optional(Schema.Literal("respect_strong_etag")),
2193
+ value: Schema.optional(Schema.Literals(["on", "off"])),
2194
+ }),
2195
+ ]),
2196
+ ),
2197
+ ),
2198
+ priority: Schema.optional(Schema.Number),
2199
+ status: Schema.optional(Schema.Literals(["active", "disabled"])),
2200
+ targets: Schema.optional(
2201
+ Schema.Array(
2202
+ Schema.Struct({
2203
+ constraint: Schema.optional(
2204
+ Schema.Struct({
2205
+ operator: Schema.Literals([
2206
+ "matches",
2207
+ "contains",
2208
+ "equals",
2209
+ "not_equal",
2210
+ "not_contain",
2211
+ ]),
2212
+ value: Schema.String,
2213
+ }),
2214
+ ),
2215
+ target: Schema.optional(Schema.Literal("url")),
2216
+ }),
2217
+ ),
2218
+ ),
2219
+ }).pipe(
2220
+ T.Http({ method: "PATCH", path: "/zones/{zone_id}/pagerules/{pageruleId}" }),
2221
+ ) as unknown as Schema.Schema<PatchPageRuleRequest>;
2222
+
2223
+ export interface PatchPageRuleResponse {
2224
+ /** Identifier. */
2225
+ id: string;
2226
+ /** The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. */
2227
+ actions: (
2228
+ | unknown
2229
+ | { id?: "bypass_cache_on_cookie" | null; value?: string | null }
2230
+ | { id?: "cache_by_device_type" | null; value?: "on" | "off" | null }
2231
+ | { id?: "cache_deception_armor" | null; value?: "on" | "off" | null }
2232
+ | {
2233
+ id?: "cache_key_fields" | null;
2234
+ value?: {
2235
+ cookie?: {
2236
+ checkPresence?: string[] | null;
2237
+ include?: string[] | null;
2238
+ } | null;
2239
+ header?: {
2240
+ checkPresence?: string[] | null;
2241
+ exclude?: string[] | null;
2242
+ include?: string[] | null;
2243
+ } | null;
2244
+ host?: { resolved?: boolean | null } | null;
2245
+ queryString?: {
2246
+ exclude?: "*" | string[] | null;
2247
+ include?: "*" | string[] | null;
2248
+ } | null;
2249
+ user?: {
2250
+ deviceType?: boolean | null;
2251
+ geo?: boolean | null;
2252
+ lang?: boolean | null;
2253
+ } | null;
2254
+ } | null;
2255
+ }
2256
+ | { id?: "cache_on_cookie" | null; value?: string | null }
2257
+ | {
2258
+ id?: "cache_ttl_by_status" | null;
2259
+ value?: Record<string, unknown> | null;
2260
+ }
2261
+ | { id?: "disable_apps" | null }
2262
+ | { id?: "disable_performance" | null }
2263
+ | { id?: "disable_security" | null }
2264
+ | { id?: "disable_zaraz" | null }
2265
+ | { id?: "edge_cache_ttl" | null; value?: number | null }
2266
+ | { id?: "explicit_cache_control" | null; value?: "on" | "off" | null }
2267
+ | {
2268
+ id?: "forwarding_url" | null;
2269
+ value?: {
2270
+ statusCode?: "301" | "302" | null;
2271
+ url?: string | null;
2272
+ } | null;
2273
+ }
2274
+ | { id?: "host_header_override" | null; value?: string | null }
2275
+ | { id?: "resolve_override" | null; value?: string | null }
2276
+ | { id?: "respect_strong_etag" | null; value?: "on" | "off" | null }
2277
+ )[];
2278
+ /** The timestamp of when the Page Rule was created. */
2279
+ createdOn: string;
2280
+ /** The timestamp of when the Page Rule was last modified. */
2281
+ modifiedOn: string;
2282
+ /** The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: `/images/ `) bu */
2283
+ priority: number;
2284
+ /** The status of the Page Rule. */
2285
+ status: "active" | "disabled";
2286
+ /** The rule targets to evaluate on each request. */
2287
+ targets: {
2288
+ constraint?: {
2289
+ operator: "matches" | "contains" | "equals" | "not_equal" | "not_contain";
2290
+ value: string;
2291
+ } | null;
2292
+ target?: "url" | null;
2293
+ }[];
2294
+ }
2295
+
2296
+ export const PatchPageRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2297
+ id: Schema.String,
2298
+ actions: Schema.Array(
2299
+ Schema.Union([
2300
+ Schema.Unknown,
2301
+ Schema.Struct({
2302
+ id: Schema.optional(
2303
+ Schema.Union([Schema.Literal("bypass_cache_on_cookie"), Schema.Null]),
2304
+ ),
2305
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2306
+ }),
2307
+ Schema.Struct({
2308
+ id: Schema.optional(
2309
+ Schema.Union([Schema.Literal("cache_by_device_type"), Schema.Null]),
2310
+ ),
2311
+ value: Schema.optional(
2312
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
2313
+ ),
2314
+ }),
2315
+ Schema.Struct({
2316
+ id: Schema.optional(
2317
+ Schema.Union([Schema.Literal("cache_deception_armor"), Schema.Null]),
2318
+ ),
2319
+ value: Schema.optional(
2320
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
2321
+ ),
2322
+ }),
2323
+ Schema.Struct({
2324
+ id: Schema.optional(
2325
+ Schema.Union([Schema.Literal("cache_key_fields"), Schema.Null]),
2326
+ ),
2327
+ value: Schema.optional(
2328
+ Schema.Union([
2329
+ Schema.Struct({
2330
+ cookie: Schema.optional(
2331
+ Schema.Union([
2332
+ Schema.Struct({
2333
+ checkPresence: Schema.optional(
2334
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2335
+ ),
2336
+ include: Schema.optional(
2337
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2338
+ ),
2339
+ }).pipe(
2340
+ Schema.encodeKeys({
2341
+ checkPresence: "check_presence",
2342
+ include: "include",
2343
+ }),
2344
+ ),
2345
+ Schema.Null,
2346
+ ]),
2347
+ ),
2348
+ header: Schema.optional(
2349
+ Schema.Union([
2350
+ Schema.Struct({
2351
+ checkPresence: Schema.optional(
2352
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2353
+ ),
2354
+ exclude: Schema.optional(
2355
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2356
+ ),
2357
+ include: Schema.optional(
2358
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2359
+ ),
2360
+ }).pipe(
2361
+ Schema.encodeKeys({
2362
+ checkPresence: "check_presence",
2363
+ exclude: "exclude",
2364
+ include: "include",
2365
+ }),
2366
+ ),
2367
+ Schema.Null,
2368
+ ]),
2369
+ ),
2370
+ host: Schema.optional(
2371
+ Schema.Union([
2372
+ Schema.Struct({
2373
+ resolved: Schema.optional(
2374
+ Schema.Union([Schema.Boolean, Schema.Null]),
2375
+ ),
2376
+ }),
2377
+ Schema.Null,
2378
+ ]),
2379
+ ),
2380
+ queryString: Schema.optional(
2381
+ Schema.Union([
2382
+ Schema.Struct({
2383
+ exclude: Schema.optional(
2384
+ Schema.Union([
2385
+ Schema.Union([
2386
+ Schema.Literal("*"),
2387
+ Schema.Array(Schema.String),
2388
+ ]),
2389
+ Schema.Null,
2390
+ ]),
2391
+ ),
2392
+ include: Schema.optional(
2393
+ Schema.Union([
2394
+ Schema.Union([
2395
+ Schema.Literal("*"),
2396
+ Schema.Array(Schema.String),
2397
+ ]),
2398
+ Schema.Null,
2399
+ ]),
2400
+ ),
2401
+ }),
2402
+ Schema.Null,
2403
+ ]),
2404
+ ),
2405
+ user: Schema.optional(
2406
+ Schema.Union([
2407
+ Schema.Struct({
2408
+ deviceType: Schema.optional(
2409
+ Schema.Union([Schema.Boolean, Schema.Null]),
2410
+ ),
2411
+ geo: Schema.optional(
2412
+ Schema.Union([Schema.Boolean, Schema.Null]),
2413
+ ),
2414
+ lang: Schema.optional(
2415
+ Schema.Union([Schema.Boolean, Schema.Null]),
2416
+ ),
2417
+ }).pipe(
2418
+ Schema.encodeKeys({
2419
+ deviceType: "device_type",
2420
+ geo: "geo",
2421
+ lang: "lang",
2422
+ }),
2423
+ ),
2424
+ Schema.Null,
2425
+ ]),
2426
+ ),
2427
+ }).pipe(
2428
+ Schema.encodeKeys({
2429
+ cookie: "cookie",
2430
+ header: "header",
2431
+ host: "host",
2432
+ queryString: "query_string",
2433
+ user: "user",
2434
+ }),
2435
+ ),
2436
+ Schema.Null,
2437
+ ]),
2438
+ ),
2439
+ }),
2440
+ Schema.Struct({
2441
+ id: Schema.optional(
2442
+ Schema.Union([Schema.Literal("cache_on_cookie"), Schema.Null]),
2443
+ ),
2444
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2445
+ }),
2446
+ Schema.Struct({
2447
+ id: Schema.optional(
2448
+ Schema.Union([Schema.Literal("cache_ttl_by_status"), Schema.Null]),
2449
+ ),
2450
+ value: Schema.optional(Schema.Union([Schema.Struct({}), Schema.Null])),
2451
+ }),
2452
+ Schema.Struct({
2453
+ id: Schema.optional(
2454
+ Schema.Union([Schema.Literal("disable_apps"), Schema.Null]),
2455
+ ),
2456
+ }),
2457
+ Schema.Struct({
2458
+ id: Schema.optional(
2459
+ Schema.Union([Schema.Literal("disable_performance"), Schema.Null]),
2460
+ ),
2461
+ }),
2462
+ Schema.Struct({
2463
+ id: Schema.optional(
2464
+ Schema.Union([Schema.Literal("disable_security"), Schema.Null]),
2465
+ ),
2466
+ }),
2467
+ Schema.Struct({
2468
+ id: Schema.optional(
2469
+ Schema.Union([Schema.Literal("disable_zaraz"), Schema.Null]),
2470
+ ),
2471
+ }),
2472
+ Schema.Struct({
2473
+ id: Schema.optional(
2474
+ Schema.Union([Schema.Literal("edge_cache_ttl"), Schema.Null]),
2475
+ ),
2476
+ value: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2477
+ }),
2478
+ Schema.Struct({
2479
+ id: Schema.optional(
2480
+ Schema.Union([Schema.Literal("explicit_cache_control"), Schema.Null]),
2481
+ ),
2482
+ value: Schema.optional(
2483
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
2484
+ ),
2485
+ }),
2486
+ Schema.Struct({
2487
+ id: Schema.optional(
2488
+ Schema.Union([Schema.Literal("forwarding_url"), Schema.Null]),
2489
+ ),
2490
+ value: Schema.optional(
2491
+ Schema.Union([
2492
+ Schema.Struct({
2493
+ statusCode: Schema.optional(
2494
+ Schema.Union([Schema.Literals(["301", "302"]), Schema.Null]),
2495
+ ),
2496
+ url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2497
+ }).pipe(
2498
+ Schema.encodeKeys({ statusCode: "status_code", url: "url" }),
2499
+ ),
2500
+ Schema.Null,
2501
+ ]),
2502
+ ),
2503
+ }),
2504
+ Schema.Struct({
2505
+ id: Schema.optional(
2506
+ Schema.Union([Schema.Literal("host_header_override"), Schema.Null]),
2507
+ ),
2508
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2509
+ }),
2510
+ Schema.Struct({
2511
+ id: Schema.optional(
2512
+ Schema.Union([Schema.Literal("resolve_override"), Schema.Null]),
2513
+ ),
2514
+ value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2515
+ }),
2516
+ Schema.Struct({
2517
+ id: Schema.optional(
2518
+ Schema.Union([Schema.Literal("respect_strong_etag"), Schema.Null]),
2519
+ ),
2520
+ value: Schema.optional(
2521
+ Schema.Union([Schema.Literals(["on", "off"]), Schema.Null]),
2522
+ ),
2523
+ }),
2524
+ ]),
2525
+ ),
2526
+ createdOn: Schema.String,
2527
+ modifiedOn: Schema.String,
2528
+ priority: Schema.Number,
2529
+ status: Schema.Literals(["active", "disabled"]),
2530
+ targets: Schema.Array(
2531
+ Schema.Struct({
2532
+ constraint: Schema.optional(
2533
+ Schema.Union([
2534
+ Schema.Struct({
2535
+ operator: Schema.Literals([
2536
+ "matches",
2537
+ "contains",
2538
+ "equals",
2539
+ "not_equal",
2540
+ "not_contain",
2541
+ ]),
2542
+ value: Schema.String,
2543
+ }),
2544
+ Schema.Null,
2545
+ ]),
2546
+ ),
2547
+ target: Schema.optional(
2548
+ Schema.Union([Schema.Literal("url"), Schema.Null]),
2549
+ ),
2550
+ }),
2551
+ ),
2552
+ }).pipe(
2553
+ Schema.encodeKeys({
2554
+ id: "id",
2555
+ actions: "actions",
2556
+ createdOn: "created_on",
2557
+ modifiedOn: "modified_on",
2558
+ priority: "priority",
2559
+ status: "status",
2560
+ targets: "targets",
2561
+ }),
2562
+ ) as unknown as Schema.Schema<PatchPageRuleResponse>;
2563
+
2564
+ export type PatchPageRuleError = DefaultErrors;
2565
+
2566
+ export const patchPageRule: API.OperationMethod<
2567
+ PatchPageRuleRequest,
2568
+ PatchPageRuleResponse,
2569
+ PatchPageRuleError,
2570
+ Credentials | HttpClient.HttpClient
2571
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2572
+ input: PatchPageRuleRequest,
2573
+ output: PatchPageRuleResponse,
2574
+ errors: [],
2575
+ }));
2576
+
2577
+ export interface DeletePageRuleRequest {
2578
+ pageruleId: string;
2579
+ /** Identifier. */
2580
+ zoneId: string;
2581
+ }
2582
+
2583
+ export const DeletePageRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2584
+ pageruleId: Schema.String.pipe(T.HttpPath("pageruleId")),
2585
+ zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
2586
+ }).pipe(
2587
+ T.Http({ method: "DELETE", path: "/zones/{zone_id}/pagerules/{pageruleId}" }),
2588
+ ) as unknown as Schema.Schema<DeletePageRuleRequest>;
2589
+
2590
+ export interface DeletePageRuleResponse {
2591
+ /** Identifier. */
2592
+ id: string;
2593
+ }
2594
+
2595
+ export const DeletePageRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
2596
+ {
2597
+ id: Schema.String,
2598
+ },
2599
+ ) as unknown as Schema.Schema<DeletePageRuleResponse>;
2600
+
2601
+ export type DeletePageRuleError = DefaultErrors;
2602
+
2603
+ export const deletePageRule: API.OperationMethod<
2604
+ DeletePageRuleRequest,
2605
+ DeletePageRuleResponse,
2606
+ DeletePageRuleError,
2607
+ Credentials | HttpClient.HttpClient
2608
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2609
+ input: DeletePageRuleRequest,
2610
+ output: DeletePageRuleResponse,
2611
+ errors: [],
2612
+ }));