@distilled.cloud/cloudflare 0.0.0 → 0.2.0-alpha

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