@distilled.cloud/cloudflare 0.0.0-john

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