@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,1208 @@
1
+ /**
2
+ * Cloudflare D1 API
3
+ *
4
+ * Generated from Cloudflare TypeScript SDK.
5
+ * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service d1
6
+ */
7
+
8
+ import * as stream from "effect/Stream";
9
+ import * as Schema from "effect/Schema";
10
+ import type * as HttpClient from "effect/unstable/http/HttpClient";
11
+ import * as API from "../client/api.ts";
12
+ import * as T from "../traits.ts";
13
+ import type { Credentials } from "../credentials.ts";
14
+ import { type DefaultErrors } from "../errors.ts";
15
+
16
+ // =============================================================================
17
+ // Errors
18
+ // =============================================================================
19
+
20
+ export class DatabaseNotFound extends Schema.TaggedErrorClass<DatabaseNotFound>()(
21
+ "DatabaseNotFound",
22
+ { code: Schema.Number, message: Schema.String },
23
+ ) {}
24
+ T.applyErrorMatchers(DatabaseNotFound, [{ code: 7404 }]);
25
+
26
+ export class InternalError extends Schema.TaggedErrorClass<InternalError>()(
27
+ "InternalError",
28
+ { code: Schema.Number, message: Schema.String },
29
+ ) {}
30
+ T.applyErrorMatchers(InternalError, [{ code: 7500 }]);
31
+
32
+ export class InvalidObjectIdentifier extends Schema.TaggedErrorClass<InvalidObjectIdentifier>()(
33
+ "InvalidObjectIdentifier",
34
+ { code: Schema.Number, message: Schema.String },
35
+ ) {}
36
+ T.applyErrorMatchers(InvalidObjectIdentifier, [{ code: 7003 }]);
37
+
38
+ export class InvalidProperty extends Schema.TaggedErrorClass<InvalidProperty>()(
39
+ "InvalidProperty",
40
+ { code: Schema.Number, message: Schema.String },
41
+ ) {}
42
+ T.applyErrorMatchers(InvalidProperty, [{ code: 7400 }]);
43
+
44
+ export class InvalidRequest extends Schema.TaggedErrorClass<InvalidRequest>()(
45
+ "InvalidRequest",
46
+ { code: Schema.Number, message: Schema.String },
47
+ ) {}
48
+ T.applyErrorMatchers(InvalidRequest, [{ code: 7400 }]);
49
+
50
+ export class NoHistoryAvailable extends Schema.TaggedErrorClass<NoHistoryAvailable>()(
51
+ "NoHistoryAvailable",
52
+ { code: Schema.Number, message: Schema.String },
53
+ ) {}
54
+ T.applyErrorMatchers(NoHistoryAvailable, [{ code: 7500 }]);
55
+
56
+ export class TimestampTooOld extends Schema.TaggedErrorClass<TimestampTooOld>()(
57
+ "TimestampTooOld",
58
+ { code: Schema.Number, message: Schema.String },
59
+ ) {}
60
+ T.applyErrorMatchers(TimestampTooOld, [{ code: 7400 }]);
61
+
62
+ export class UnknownError extends Schema.TaggedErrorClass<UnknownError>()(
63
+ "UnknownError",
64
+ { code: Schema.Number, message: Schema.String },
65
+ ) {}
66
+ T.applyErrorMatchers(UnknownError, [{ code: 0 }]);
67
+
68
+ // =============================================================================
69
+ // BookmarkDatabaseTimeTravel
70
+ // =============================================================================
71
+
72
+ export interface GetBookmarkDatabaseTimeTravelRequest {
73
+ databaseId: string;
74
+ /** Path param: Account identifier tag. */
75
+ accountId: string;
76
+ /** Query param: An optional ISO 8601 timestamp. If provided, returns the nearest available bookmark at or before this timestamp. If omitted, returns the current bookmark. */
77
+ timestamp?: string;
78
+ }
79
+
80
+ export const GetBookmarkDatabaseTimeTravelRequest =
81
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
82
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
83
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
84
+ timestamp: Schema.optional(Schema.String).pipe(T.HttpQuery("timestamp")),
85
+ }).pipe(
86
+ T.Http({
87
+ method: "GET",
88
+ path: "/accounts/{account_id}/d1/database/{databaseId}/time_travel/bookmark",
89
+ }),
90
+ ) as unknown as Schema.Schema<GetBookmarkDatabaseTimeTravelRequest>;
91
+
92
+ export interface GetBookmarkDatabaseTimeTravelResponse {
93
+ /** A bookmark representing a specific state of the database at a specific point in time. */
94
+ bookmark?: string | null;
95
+ }
96
+
97
+ export const GetBookmarkDatabaseTimeTravelResponse =
98
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
99
+ bookmark: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
100
+ }).pipe(
101
+ T.ResponsePath("result"),
102
+ ) as unknown as Schema.Schema<GetBookmarkDatabaseTimeTravelResponse>;
103
+
104
+ export type GetBookmarkDatabaseTimeTravelError =
105
+ | DefaultErrors
106
+ | InvalidObjectIdentifier
107
+ | NoHistoryAvailable
108
+ | TimestampTooOld
109
+ | DatabaseNotFound;
110
+
111
+ export const getBookmarkDatabaseTimeTravel: API.OperationMethod<
112
+ GetBookmarkDatabaseTimeTravelRequest,
113
+ GetBookmarkDatabaseTimeTravelResponse,
114
+ GetBookmarkDatabaseTimeTravelError,
115
+ Credentials | HttpClient.HttpClient
116
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
117
+ input: GetBookmarkDatabaseTimeTravelRequest,
118
+ output: GetBookmarkDatabaseTimeTravelResponse,
119
+ errors: [
120
+ InvalidObjectIdentifier,
121
+ NoHistoryAvailable,
122
+ TimestampTooOld,
123
+ DatabaseNotFound,
124
+ ],
125
+ }));
126
+
127
+ // =============================================================================
128
+ // Databas
129
+ // =============================================================================
130
+
131
+ export interface ListDatabasesRequest {
132
+ /** Path param: Account identifier tag. */
133
+ accountId: string;
134
+ /** Query param: a database name to search for. */
135
+ name?: string;
136
+ }
137
+
138
+ export const ListDatabasesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
139
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
140
+ name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
141
+ }).pipe(
142
+ T.Http({ method: "GET", path: "/accounts/{account_id}/d1/database" }),
143
+ ) as unknown as Schema.Schema<ListDatabasesRequest>;
144
+
145
+ export interface ListDatabasesResponse {
146
+ result: {
147
+ createdAt?: string | null;
148
+ name?: string | null;
149
+ uuid?: string | null;
150
+ version?: string | null;
151
+ }[];
152
+ resultInfo: {
153
+ count?: number | null;
154
+ page?: number | null;
155
+ perPage?: number | null;
156
+ totalCount?: number | null;
157
+ };
158
+ }
159
+
160
+ export const ListDatabasesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
161
+ result: Schema.Array(
162
+ Schema.Struct({
163
+ createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
164
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
165
+ uuid: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
166
+ version: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
167
+ }).pipe(
168
+ Schema.encodeKeys({
169
+ createdAt: "created_at",
170
+ name: "name",
171
+ uuid: "uuid",
172
+ version: "version",
173
+ }),
174
+ ),
175
+ ),
176
+ resultInfo: Schema.Struct({
177
+ count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
178
+ page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
179
+ perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
180
+ totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
181
+ }).pipe(
182
+ Schema.encodeKeys({
183
+ count: "count",
184
+ page: "page",
185
+ perPage: "per_page",
186
+ totalCount: "total_count",
187
+ }),
188
+ ),
189
+ }).pipe(
190
+ Schema.encodeKeys({ result: "result", resultInfo: "result_info" }),
191
+ ) as unknown as Schema.Schema<ListDatabasesResponse>;
192
+
193
+ export type ListDatabasesError = DefaultErrors;
194
+
195
+ export const listDatabases: API.PaginatedOperationMethod<
196
+ ListDatabasesRequest,
197
+ ListDatabasesResponse,
198
+ ListDatabasesError,
199
+ Credentials | HttpClient.HttpClient
200
+ > & {
201
+ pages: (
202
+ input: ListDatabasesRequest,
203
+ ) => stream.Stream<
204
+ ListDatabasesResponse,
205
+ ListDatabasesError,
206
+ Credentials | HttpClient.HttpClient
207
+ >;
208
+ items: (input: ListDatabasesRequest) => stream.Stream<
209
+ {
210
+ createdAt?: string | null;
211
+ name?: string | null;
212
+ uuid?: string | null;
213
+ version?: string | null;
214
+ },
215
+ ListDatabasesError,
216
+ Credentials | HttpClient.HttpClient
217
+ >;
218
+ } = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
219
+ input: ListDatabasesRequest,
220
+ output: ListDatabasesResponse,
221
+ errors: [],
222
+ pagination: {
223
+ mode: "page",
224
+ inputToken: "page",
225
+ outputToken: "resultInfo.page",
226
+ items: "result",
227
+ pageSize: "perPage",
228
+ } as const,
229
+ }));
230
+
231
+ // =============================================================================
232
+ // Database
233
+ // =============================================================================
234
+
235
+ export interface GetDatabaseRequest {
236
+ databaseId: string;
237
+ /** Account identifier tag. */
238
+ accountId: string;
239
+ }
240
+
241
+ export const GetDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
242
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
243
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
244
+ }).pipe(
245
+ T.Http({
246
+ method: "GET",
247
+ path: "/accounts/{account_id}/d1/database/{databaseId}",
248
+ }),
249
+ ) as unknown as Schema.Schema<GetDatabaseRequest>;
250
+
251
+ export type GetDatabaseResponse = unknown;
252
+
253
+ export const GetDatabaseResponse =
254
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<GetDatabaseResponse>;
255
+
256
+ export type GetDatabaseError =
257
+ | DefaultErrors
258
+ | InvalidObjectIdentifier
259
+ | DatabaseNotFound
260
+ | UnknownError;
261
+
262
+ export const getDatabase: API.OperationMethod<
263
+ GetDatabaseRequest,
264
+ GetDatabaseResponse,
265
+ GetDatabaseError,
266
+ Credentials | HttpClient.HttpClient
267
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
268
+ input: GetDatabaseRequest,
269
+ output: GetDatabaseResponse,
270
+ errors: [InvalidObjectIdentifier, DatabaseNotFound, UnknownError],
271
+ }));
272
+
273
+ export interface CreateDatabaseRequest {
274
+ /** Path param: Account identifier tag. */
275
+ accountId: string;
276
+ /** Body param: D1 database name. */
277
+ name: string;
278
+ /** Body param: Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored. */
279
+ jurisdiction?: "eu" | "fedramp";
280
+ /** Body param: Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user. */
281
+ primaryLocationHint?: "wnam" | "enam" | "weur" | "eeur" | "apac" | "oc";
282
+ }
283
+
284
+ export const CreateDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
285
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
286
+ name: Schema.String,
287
+ jurisdiction: Schema.optional(Schema.Literals(["eu", "fedramp"])),
288
+ primaryLocationHint: Schema.optional(
289
+ Schema.Literals(["wnam", "enam", "weur", "eeur", "apac", "oc"]),
290
+ ),
291
+ }).pipe(
292
+ Schema.encodeKeys({
293
+ name: "name",
294
+ jurisdiction: "jurisdiction",
295
+ primaryLocationHint: "primary_location_hint",
296
+ }),
297
+ T.Http({ method: "POST", path: "/accounts/{account_id}/d1/database" }),
298
+ ) as unknown as Schema.Schema<CreateDatabaseRequest>;
299
+
300
+ export type CreateDatabaseResponse = unknown;
301
+
302
+ export const CreateDatabaseResponse =
303
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<CreateDatabaseResponse>;
304
+
305
+ export type CreateDatabaseError =
306
+ | DefaultErrors
307
+ | InvalidObjectIdentifier
308
+ | InvalidProperty;
309
+
310
+ export const createDatabase: API.OperationMethod<
311
+ CreateDatabaseRequest,
312
+ CreateDatabaseResponse,
313
+ CreateDatabaseError,
314
+ Credentials | HttpClient.HttpClient
315
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
316
+ input: CreateDatabaseRequest,
317
+ output: CreateDatabaseResponse,
318
+ errors: [InvalidObjectIdentifier, InvalidProperty],
319
+ }));
320
+
321
+ export interface UpdateDatabaseRequest {
322
+ databaseId: string;
323
+ /** Path param: Account identifier tag. */
324
+ accountId: string;
325
+ /** Body param: Configuration for D1 read replication. */
326
+ readReplication: { mode: "auto" | "disabled" };
327
+ }
328
+
329
+ export const UpdateDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
330
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
331
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
332
+ readReplication: Schema.Struct({
333
+ mode: Schema.Literals(["auto", "disabled"]),
334
+ }),
335
+ }).pipe(
336
+ Schema.encodeKeys({ readReplication: "read_replication" }),
337
+ T.Http({
338
+ method: "PUT",
339
+ path: "/accounts/{account_id}/d1/database/{databaseId}",
340
+ }),
341
+ ) as unknown as Schema.Schema<UpdateDatabaseRequest>;
342
+
343
+ export type UpdateDatabaseResponse = unknown;
344
+
345
+ export const UpdateDatabaseResponse =
346
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<UpdateDatabaseResponse>;
347
+
348
+ export type UpdateDatabaseError =
349
+ | DefaultErrors
350
+ | InvalidObjectIdentifier
351
+ | InternalError
352
+ | DatabaseNotFound;
353
+
354
+ export const updateDatabase: API.OperationMethod<
355
+ UpdateDatabaseRequest,
356
+ UpdateDatabaseResponse,
357
+ UpdateDatabaseError,
358
+ Credentials | HttpClient.HttpClient
359
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
360
+ input: UpdateDatabaseRequest,
361
+ output: UpdateDatabaseResponse,
362
+ errors: [InvalidObjectIdentifier, InternalError, DatabaseNotFound],
363
+ }));
364
+
365
+ export interface PatchDatabaseRequest {
366
+ databaseId: string;
367
+ /** Path param: Account identifier tag. */
368
+ accountId: string;
369
+ /** Body param: Configuration for D1 read replication. */
370
+ readReplication?: { mode: "auto" | "disabled" };
371
+ }
372
+
373
+ export const PatchDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
374
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
375
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
376
+ readReplication: Schema.optional(
377
+ Schema.Struct({
378
+ mode: Schema.Literals(["auto", "disabled"]),
379
+ }),
380
+ ),
381
+ }).pipe(
382
+ Schema.encodeKeys({ readReplication: "read_replication" }),
383
+ T.Http({
384
+ method: "PATCH",
385
+ path: "/accounts/{account_id}/d1/database/{databaseId}",
386
+ }),
387
+ ) as unknown as Schema.Schema<PatchDatabaseRequest>;
388
+
389
+ export type PatchDatabaseResponse = unknown;
390
+
391
+ export const PatchDatabaseResponse =
392
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<PatchDatabaseResponse>;
393
+
394
+ export type PatchDatabaseError =
395
+ | DefaultErrors
396
+ | InvalidObjectIdentifier
397
+ | InternalError
398
+ | DatabaseNotFound;
399
+
400
+ export const patchDatabase: API.OperationMethod<
401
+ PatchDatabaseRequest,
402
+ PatchDatabaseResponse,
403
+ PatchDatabaseError,
404
+ Credentials | HttpClient.HttpClient
405
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
406
+ input: PatchDatabaseRequest,
407
+ output: PatchDatabaseResponse,
408
+ errors: [InvalidObjectIdentifier, InternalError, DatabaseNotFound],
409
+ }));
410
+
411
+ export interface DeleteDatabaseRequest {
412
+ databaseId: string;
413
+ /** Account identifier tag. */
414
+ accountId: string;
415
+ }
416
+
417
+ export const DeleteDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
418
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
419
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
420
+ }).pipe(
421
+ T.Http({
422
+ method: "DELETE",
423
+ path: "/accounts/{account_id}/d1/database/{databaseId}",
424
+ }),
425
+ ) as unknown as Schema.Schema<DeleteDatabaseRequest>;
426
+
427
+ export type DeleteDatabaseResponse = unknown;
428
+
429
+ export const DeleteDatabaseResponse =
430
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(
431
+ T.ResponsePath("result"),
432
+ ) as unknown as Schema.Schema<DeleteDatabaseResponse>;
433
+
434
+ export type DeleteDatabaseError =
435
+ | DefaultErrors
436
+ | InvalidObjectIdentifier
437
+ | DatabaseNotFound
438
+ | UnknownError;
439
+
440
+ export const deleteDatabase: API.OperationMethod<
441
+ DeleteDatabaseRequest,
442
+ DeleteDatabaseResponse,
443
+ DeleteDatabaseError,
444
+ Credentials | HttpClient.HttpClient
445
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
446
+ input: DeleteDatabaseRequest,
447
+ output: DeleteDatabaseResponse,
448
+ errors: [InvalidObjectIdentifier, DatabaseNotFound, UnknownError],
449
+ }));
450
+
451
+ export interface ExportDatabaseRequest {
452
+ databaseId: string;
453
+ /** Path param: Account identifier tag. */
454
+ accountId: string;
455
+ /** Body param: Specifies that you will poll this endpoint until the export completes */
456
+ outputFormat: "polling";
457
+ /** Body param: To poll an in-progress export, provide the current bookmark (returned by your first polling response) */
458
+ currentBookmark?: string;
459
+ /** Body param: */
460
+ dumpOptions?: { noData?: boolean; noSchema?: boolean; tables?: string[] };
461
+ }
462
+
463
+ export const ExportDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
464
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
465
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
466
+ outputFormat: Schema.Literal("polling"),
467
+ currentBookmark: Schema.optional(Schema.String),
468
+ dumpOptions: Schema.optional(
469
+ Schema.Struct({
470
+ noData: Schema.optional(Schema.Boolean),
471
+ noSchema: Schema.optional(Schema.Boolean),
472
+ tables: Schema.optional(Schema.Array(Schema.String)),
473
+ }).pipe(
474
+ Schema.encodeKeys({
475
+ noData: "no_data",
476
+ noSchema: "no_schema",
477
+ tables: "tables",
478
+ }),
479
+ ),
480
+ ),
481
+ }).pipe(
482
+ Schema.encodeKeys({
483
+ outputFormat: "output_format",
484
+ currentBookmark: "current_bookmark",
485
+ dumpOptions: "dump_options",
486
+ }),
487
+ T.Http({
488
+ method: "POST",
489
+ path: "/accounts/{account_id}/d1/database/{databaseId}/export",
490
+ }),
491
+ ) as unknown as Schema.Schema<ExportDatabaseRequest>;
492
+
493
+ export interface ExportDatabaseResponse {
494
+ /** The current time-travel bookmark for your D1, used to poll for updates. Will not change for the duration of the export task. */
495
+ atBookmark?: string | null;
496
+ /** Only present when status = 'error'. Contains the error message. */
497
+ error?: string | null;
498
+ /** Logs since the last time you polled */
499
+ messages?: string[] | null;
500
+ /** Only present when status = 'complete' */
501
+ result?: { filename?: string | null; signedUrl?: string | null } | null;
502
+ status?: "complete" | "error" | "active" | null;
503
+ success?: boolean | null;
504
+ type?: "export" | null;
505
+ }
506
+
507
+ export const ExportDatabaseResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
508
+ {
509
+ atBookmark: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
510
+ error: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
511
+ messages: Schema.optional(
512
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
513
+ ),
514
+ result: Schema.optional(
515
+ Schema.Union([
516
+ Schema.Struct({
517
+ filename: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
518
+ signedUrl: Schema.optional(
519
+ Schema.Union([Schema.String, Schema.Null]),
520
+ ),
521
+ }).pipe(
522
+ Schema.encodeKeys({ filename: "filename", signedUrl: "signed_url" }),
523
+ ),
524
+ Schema.Null,
525
+ ]),
526
+ ),
527
+ status: Schema.optional(
528
+ Schema.Union([
529
+ Schema.Literals(["complete", "error", "active"]),
530
+ Schema.Null,
531
+ ]),
532
+ ),
533
+ success: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
534
+ type: Schema.optional(
535
+ Schema.Union([Schema.Literal("export"), Schema.Null]),
536
+ ),
537
+ },
538
+ )
539
+ .pipe(
540
+ Schema.encodeKeys({
541
+ atBookmark: "at_bookmark",
542
+ error: "error",
543
+ messages: "messages",
544
+ result: "result",
545
+ status: "status",
546
+ success: "success",
547
+ type: "type",
548
+ }),
549
+ )
550
+ .pipe(
551
+ T.ResponsePath("result"),
552
+ ) as unknown as Schema.Schema<ExportDatabaseResponse>;
553
+
554
+ export type ExportDatabaseError =
555
+ | DefaultErrors
556
+ | InvalidObjectIdentifier
557
+ | InvalidRequest
558
+ | DatabaseNotFound;
559
+
560
+ export const exportDatabase: API.OperationMethod<
561
+ ExportDatabaseRequest,
562
+ ExportDatabaseResponse,
563
+ ExportDatabaseError,
564
+ Credentials | HttpClient.HttpClient
565
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
566
+ input: ExportDatabaseRequest,
567
+ output: ExportDatabaseResponse,
568
+ errors: [InvalidObjectIdentifier, InvalidRequest, DatabaseNotFound],
569
+ }));
570
+
571
+ export interface ImportDatabaseRequest {
572
+ databaseId: string;
573
+ /** Path param: Account identifier tag. */
574
+ accountId: string;
575
+ /** Body param: Indicates you have a new SQL file to upload. */
576
+ action: "init";
577
+ /** Body param: Required when action is 'init' or 'ingest'. An md5 hash of the file you're uploading. Used to check if it already exists, and validate its contents before ingesting. */
578
+ etag: string;
579
+ }
580
+
581
+ export const ImportDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
582
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
583
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
584
+ action: Schema.Literal("init"),
585
+ etag: Schema.String,
586
+ }).pipe(
587
+ T.Http({
588
+ method: "POST",
589
+ path: "/accounts/{account_id}/d1/database/{databaseId}/import",
590
+ }),
591
+ ) as unknown as Schema.Schema<ImportDatabaseRequest>;
592
+
593
+ export interface ImportDatabaseResponse {
594
+ /** The current time-travel bookmark for your D1, used to poll for updates. Will not change for the duration of the import. Only returned if an import process is currently running or recently finished. */
595
+ atBookmark?: string | null;
596
+ /** Only present when status = 'error'. Contains the error message that prevented the import from succeeding. */
597
+ error?: string | null;
598
+ /** Derived from the database ID and etag, to use in avoiding repeated uploads. Only returned when for the 'init' action. */
599
+ filename?: string | null;
600
+ /** Logs since the last time you polled */
601
+ messages?: string[] | null;
602
+ /** Only present when status = 'complete' */
603
+ result?: {
604
+ finalBookmark?: string | null;
605
+ meta?: {
606
+ changedDb?: boolean | null;
607
+ changes?: number | null;
608
+ duration?: number | null;
609
+ lastRowId?: number | null;
610
+ rowsRead?: number | null;
611
+ rowsWritten?: number | null;
612
+ servedByColo?: string | null;
613
+ servedByPrimary?: boolean | null;
614
+ servedByRegion?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | null;
615
+ sizeAfter?: number | null;
616
+ timings?: { sqlDurationMs?: number | null } | null;
617
+ } | null;
618
+ numQueries?: number | null;
619
+ } | null;
620
+ status?: "complete" | "error" | null;
621
+ success?: boolean | null;
622
+ type?: "import" | null;
623
+ /** The R2 presigned URL to use for uploading. Only returned when for the 'init' action. */
624
+ uploadUrl?: string | null;
625
+ }
626
+
627
+ export const ImportDatabaseResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
628
+ {
629
+ atBookmark: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
630
+ error: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
631
+ filename: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
632
+ messages: Schema.optional(
633
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
634
+ ),
635
+ result: Schema.optional(
636
+ Schema.Union([
637
+ Schema.Struct({
638
+ finalBookmark: Schema.optional(
639
+ Schema.Union([Schema.String, Schema.Null]),
640
+ ),
641
+ meta: Schema.optional(
642
+ Schema.Union([
643
+ Schema.Struct({
644
+ changedDb: Schema.optional(
645
+ Schema.Union([Schema.Boolean, Schema.Null]),
646
+ ),
647
+ changes: Schema.optional(
648
+ Schema.Union([Schema.Number, Schema.Null]),
649
+ ),
650
+ duration: Schema.optional(
651
+ Schema.Union([Schema.Number, Schema.Null]),
652
+ ),
653
+ lastRowId: Schema.optional(
654
+ Schema.Union([Schema.Number, Schema.Null]),
655
+ ),
656
+ rowsRead: Schema.optional(
657
+ Schema.Union([Schema.Number, Schema.Null]),
658
+ ),
659
+ rowsWritten: Schema.optional(
660
+ Schema.Union([Schema.Number, Schema.Null]),
661
+ ),
662
+ servedByColo: Schema.optional(
663
+ Schema.Union([Schema.String, Schema.Null]),
664
+ ),
665
+ servedByPrimary: Schema.optional(
666
+ Schema.Union([Schema.Boolean, Schema.Null]),
667
+ ),
668
+ servedByRegion: Schema.optional(
669
+ Schema.Union([
670
+ Schema.Literals([
671
+ "WNAM",
672
+ "ENAM",
673
+ "WEUR",
674
+ "EEUR",
675
+ "APAC",
676
+ "OC",
677
+ ]),
678
+ Schema.Null,
679
+ ]),
680
+ ),
681
+ sizeAfter: Schema.optional(
682
+ Schema.Union([Schema.Number, Schema.Null]),
683
+ ),
684
+ timings: Schema.optional(
685
+ Schema.Union([
686
+ Schema.Struct({
687
+ sqlDurationMs: Schema.optional(
688
+ Schema.Union([Schema.Number, Schema.Null]),
689
+ ),
690
+ }).pipe(
691
+ Schema.encodeKeys({ sqlDurationMs: "sql_duration_ms" }),
692
+ ),
693
+ Schema.Null,
694
+ ]),
695
+ ),
696
+ }).pipe(
697
+ Schema.encodeKeys({
698
+ changedDb: "changed_db",
699
+ changes: "changes",
700
+ duration: "duration",
701
+ lastRowId: "last_row_id",
702
+ rowsRead: "rows_read",
703
+ rowsWritten: "rows_written",
704
+ servedByColo: "served_by_colo",
705
+ servedByPrimary: "served_by_primary",
706
+ servedByRegion: "served_by_region",
707
+ sizeAfter: "size_after",
708
+ timings: "timings",
709
+ }),
710
+ ),
711
+ Schema.Null,
712
+ ]),
713
+ ),
714
+ numQueries: Schema.optional(
715
+ Schema.Union([Schema.Number, Schema.Null]),
716
+ ),
717
+ }).pipe(
718
+ Schema.encodeKeys({
719
+ finalBookmark: "final_bookmark",
720
+ meta: "meta",
721
+ numQueries: "num_queries",
722
+ }),
723
+ ),
724
+ Schema.Null,
725
+ ]),
726
+ ),
727
+ status: Schema.optional(
728
+ Schema.Union([Schema.Literals(["complete", "error"]), Schema.Null]),
729
+ ),
730
+ success: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
731
+ type: Schema.optional(
732
+ Schema.Union([Schema.Literal("import"), Schema.Null]),
733
+ ),
734
+ uploadUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
735
+ },
736
+ )
737
+ .pipe(
738
+ Schema.encodeKeys({
739
+ atBookmark: "at_bookmark",
740
+ error: "error",
741
+ filename: "filename",
742
+ messages: "messages",
743
+ result: "result",
744
+ status: "status",
745
+ success: "success",
746
+ type: "type",
747
+ uploadUrl: "upload_url",
748
+ }),
749
+ )
750
+ .pipe(
751
+ T.ResponsePath("result"),
752
+ ) as unknown as Schema.Schema<ImportDatabaseResponse>;
753
+
754
+ export type ImportDatabaseError = DefaultErrors | InvalidObjectIdentifier;
755
+
756
+ export const importDatabase: API.OperationMethod<
757
+ ImportDatabaseRequest,
758
+ ImportDatabaseResponse,
759
+ ImportDatabaseError,
760
+ Credentials | HttpClient.HttpClient
761
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
762
+ input: ImportDatabaseRequest,
763
+ output: ImportDatabaseResponse,
764
+ errors: [InvalidObjectIdentifier],
765
+ }));
766
+
767
+ export interface QueryDatabaseRequest {
768
+ databaseId: string;
769
+ /** Path param: Account identifier tag. */
770
+ accountId: string;
771
+ /** Body param: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. */
772
+ sql: string;
773
+ /** Body param: */
774
+ params?: string[];
775
+ }
776
+
777
+ export const QueryDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
778
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
779
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
780
+ sql: Schema.String,
781
+ params: Schema.optional(Schema.Array(Schema.String)),
782
+ }).pipe(
783
+ T.Http({
784
+ method: "POST",
785
+ path: "/accounts/{account_id}/d1/database/{databaseId}/query",
786
+ }),
787
+ ) as unknown as Schema.Schema<QueryDatabaseRequest>;
788
+
789
+ export interface QueryDatabaseResponse {
790
+ result: {
791
+ meta?: {
792
+ changedDb?: boolean | null;
793
+ changes?: number | null;
794
+ duration?: number | null;
795
+ lastRowId?: number | null;
796
+ rowsRead?: number | null;
797
+ rowsWritten?: number | null;
798
+ servedByColo?: string | null;
799
+ servedByPrimary?: boolean | null;
800
+ servedByRegion?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | null;
801
+ sizeAfter?: number | null;
802
+ timings?: { sqlDurationMs?: number | null } | null;
803
+ } | null;
804
+ results?: unknown[] | null;
805
+ success?: boolean | null;
806
+ }[];
807
+ }
808
+
809
+ export const QueryDatabaseResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
810
+ result: Schema.Array(
811
+ Schema.Struct({
812
+ meta: Schema.optional(
813
+ Schema.Union([
814
+ Schema.Struct({
815
+ changedDb: Schema.optional(
816
+ Schema.Union([Schema.Boolean, Schema.Null]),
817
+ ),
818
+ changes: Schema.optional(
819
+ Schema.Union([Schema.Number, Schema.Null]),
820
+ ),
821
+ duration: Schema.optional(
822
+ Schema.Union([Schema.Number, Schema.Null]),
823
+ ),
824
+ lastRowId: Schema.optional(
825
+ Schema.Union([Schema.Number, Schema.Null]),
826
+ ),
827
+ rowsRead: Schema.optional(
828
+ Schema.Union([Schema.Number, Schema.Null]),
829
+ ),
830
+ rowsWritten: Schema.optional(
831
+ Schema.Union([Schema.Number, Schema.Null]),
832
+ ),
833
+ servedByColo: Schema.optional(
834
+ Schema.Union([Schema.String, Schema.Null]),
835
+ ),
836
+ servedByPrimary: Schema.optional(
837
+ Schema.Union([Schema.Boolean, Schema.Null]),
838
+ ),
839
+ servedByRegion: Schema.optional(
840
+ Schema.Union([
841
+ Schema.Literals(["WNAM", "ENAM", "WEUR", "EEUR", "APAC", "OC"]),
842
+ Schema.Null,
843
+ ]),
844
+ ),
845
+ sizeAfter: Schema.optional(
846
+ Schema.Union([Schema.Number, Schema.Null]),
847
+ ),
848
+ timings: Schema.optional(
849
+ Schema.Union([
850
+ Schema.Struct({
851
+ sqlDurationMs: Schema.optional(
852
+ Schema.Union([Schema.Number, Schema.Null]),
853
+ ),
854
+ }).pipe(
855
+ Schema.encodeKeys({ sqlDurationMs: "sql_duration_ms" }),
856
+ ),
857
+ Schema.Null,
858
+ ]),
859
+ ),
860
+ }).pipe(
861
+ Schema.encodeKeys({
862
+ changedDb: "changed_db",
863
+ changes: "changes",
864
+ duration: "duration",
865
+ lastRowId: "last_row_id",
866
+ rowsRead: "rows_read",
867
+ rowsWritten: "rows_written",
868
+ servedByColo: "served_by_colo",
869
+ servedByPrimary: "served_by_primary",
870
+ servedByRegion: "served_by_region",
871
+ sizeAfter: "size_after",
872
+ timings: "timings",
873
+ }),
874
+ ),
875
+ Schema.Null,
876
+ ]),
877
+ ),
878
+ results: Schema.optional(
879
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
880
+ ),
881
+ success: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
882
+ }),
883
+ ),
884
+ }) as unknown as Schema.Schema<QueryDatabaseResponse>;
885
+
886
+ export type QueryDatabaseError = DefaultErrors;
887
+
888
+ export const queryDatabase: API.PaginatedOperationMethod<
889
+ QueryDatabaseRequest,
890
+ QueryDatabaseResponse,
891
+ QueryDatabaseError,
892
+ Credentials | HttpClient.HttpClient
893
+ > & {
894
+ pages: (
895
+ input: QueryDatabaseRequest,
896
+ ) => stream.Stream<
897
+ QueryDatabaseResponse,
898
+ QueryDatabaseError,
899
+ Credentials | HttpClient.HttpClient
900
+ >;
901
+ items: (input: QueryDatabaseRequest) => stream.Stream<
902
+ {
903
+ meta?: {
904
+ changedDb?: boolean | null;
905
+ changes?: number | null;
906
+ duration?: number | null;
907
+ lastRowId?: number | null;
908
+ rowsRead?: number | null;
909
+ rowsWritten?: number | null;
910
+ servedByColo?: string | null;
911
+ servedByPrimary?: boolean | null;
912
+ servedByRegion?:
913
+ | "WNAM"
914
+ | "ENAM"
915
+ | "WEUR"
916
+ | "EEUR"
917
+ | "APAC"
918
+ | "OC"
919
+ | null;
920
+ sizeAfter?: number | null;
921
+ timings?: { sqlDurationMs?: number | null } | null;
922
+ } | null;
923
+ results?: unknown[] | null;
924
+ success?: boolean | null;
925
+ },
926
+ QueryDatabaseError,
927
+ Credentials | HttpClient.HttpClient
928
+ >;
929
+ } = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
930
+ input: QueryDatabaseRequest,
931
+ output: QueryDatabaseResponse,
932
+ errors: [],
933
+ pagination: {
934
+ mode: "single",
935
+ items: "result",
936
+ } as const,
937
+ }));
938
+
939
+ export interface RawDatabaseRequest {
940
+ databaseId: string;
941
+ /** Path param: Account identifier tag. */
942
+ accountId: string;
943
+ /** Body param: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. */
944
+ sql: string;
945
+ /** Body param: */
946
+ params?: string[];
947
+ }
948
+
949
+ export const RawDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
950
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
951
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
952
+ sql: Schema.String,
953
+ params: Schema.optional(Schema.Array(Schema.String)),
954
+ }).pipe(
955
+ T.Http({
956
+ method: "POST",
957
+ path: "/accounts/{account_id}/d1/database/{databaseId}/raw",
958
+ }),
959
+ ) as unknown as Schema.Schema<RawDatabaseRequest>;
960
+
961
+ export interface RawDatabaseResponse {
962
+ result: {
963
+ meta?: {
964
+ changedDb?: boolean | null;
965
+ changes?: number | null;
966
+ duration?: number | null;
967
+ lastRowId?: number | null;
968
+ rowsRead?: number | null;
969
+ rowsWritten?: number | null;
970
+ servedByColo?: string | null;
971
+ servedByPrimary?: boolean | null;
972
+ servedByRegion?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | null;
973
+ sizeAfter?: number | null;
974
+ timings?: { sqlDurationMs?: number | null } | null;
975
+ } | null;
976
+ results?: {
977
+ columns?: string[] | null;
978
+ rows?: (number | string)[][] | null;
979
+ } | null;
980
+ success?: boolean | null;
981
+ }[];
982
+ }
983
+
984
+ export const RawDatabaseResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
985
+ result: Schema.Array(
986
+ Schema.Struct({
987
+ meta: Schema.optional(
988
+ Schema.Union([
989
+ Schema.Struct({
990
+ changedDb: Schema.optional(
991
+ Schema.Union([Schema.Boolean, Schema.Null]),
992
+ ),
993
+ changes: Schema.optional(
994
+ Schema.Union([Schema.Number, Schema.Null]),
995
+ ),
996
+ duration: Schema.optional(
997
+ Schema.Union([Schema.Number, Schema.Null]),
998
+ ),
999
+ lastRowId: Schema.optional(
1000
+ Schema.Union([Schema.Number, Schema.Null]),
1001
+ ),
1002
+ rowsRead: Schema.optional(
1003
+ Schema.Union([Schema.Number, Schema.Null]),
1004
+ ),
1005
+ rowsWritten: Schema.optional(
1006
+ Schema.Union([Schema.Number, Schema.Null]),
1007
+ ),
1008
+ servedByColo: Schema.optional(
1009
+ Schema.Union([Schema.String, Schema.Null]),
1010
+ ),
1011
+ servedByPrimary: Schema.optional(
1012
+ Schema.Union([Schema.Boolean, Schema.Null]),
1013
+ ),
1014
+ servedByRegion: Schema.optional(
1015
+ Schema.Union([
1016
+ Schema.Literals(["WNAM", "ENAM", "WEUR", "EEUR", "APAC", "OC"]),
1017
+ Schema.Null,
1018
+ ]),
1019
+ ),
1020
+ sizeAfter: Schema.optional(
1021
+ Schema.Union([Schema.Number, Schema.Null]),
1022
+ ),
1023
+ timings: Schema.optional(
1024
+ Schema.Union([
1025
+ Schema.Struct({
1026
+ sqlDurationMs: Schema.optional(
1027
+ Schema.Union([Schema.Number, Schema.Null]),
1028
+ ),
1029
+ }).pipe(
1030
+ Schema.encodeKeys({ sqlDurationMs: "sql_duration_ms" }),
1031
+ ),
1032
+ Schema.Null,
1033
+ ]),
1034
+ ),
1035
+ }).pipe(
1036
+ Schema.encodeKeys({
1037
+ changedDb: "changed_db",
1038
+ changes: "changes",
1039
+ duration: "duration",
1040
+ lastRowId: "last_row_id",
1041
+ rowsRead: "rows_read",
1042
+ rowsWritten: "rows_written",
1043
+ servedByColo: "served_by_colo",
1044
+ servedByPrimary: "served_by_primary",
1045
+ servedByRegion: "served_by_region",
1046
+ sizeAfter: "size_after",
1047
+ timings: "timings",
1048
+ }),
1049
+ ),
1050
+ Schema.Null,
1051
+ ]),
1052
+ ),
1053
+ results: Schema.optional(
1054
+ Schema.Union([
1055
+ Schema.Struct({
1056
+ columns: Schema.optional(
1057
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1058
+ ),
1059
+ rows: Schema.optional(
1060
+ Schema.Union([
1061
+ Schema.Array(
1062
+ Schema.Array(Schema.Union([Schema.Number, Schema.String])),
1063
+ ),
1064
+ Schema.Null,
1065
+ ]),
1066
+ ),
1067
+ }),
1068
+ Schema.Null,
1069
+ ]),
1070
+ ),
1071
+ success: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1072
+ }),
1073
+ ),
1074
+ }) as unknown as Schema.Schema<RawDatabaseResponse>;
1075
+
1076
+ export type RawDatabaseError = DefaultErrors;
1077
+
1078
+ export const rawDatabase: API.PaginatedOperationMethod<
1079
+ RawDatabaseRequest,
1080
+ RawDatabaseResponse,
1081
+ RawDatabaseError,
1082
+ Credentials | HttpClient.HttpClient
1083
+ > & {
1084
+ pages: (
1085
+ input: RawDatabaseRequest,
1086
+ ) => stream.Stream<
1087
+ RawDatabaseResponse,
1088
+ RawDatabaseError,
1089
+ Credentials | HttpClient.HttpClient
1090
+ >;
1091
+ items: (input: RawDatabaseRequest) => stream.Stream<
1092
+ {
1093
+ meta?: {
1094
+ changedDb?: boolean | null;
1095
+ changes?: number | null;
1096
+ duration?: number | null;
1097
+ lastRowId?: number | null;
1098
+ rowsRead?: number | null;
1099
+ rowsWritten?: number | null;
1100
+ servedByColo?: string | null;
1101
+ servedByPrimary?: boolean | null;
1102
+ servedByRegion?:
1103
+ | "WNAM"
1104
+ | "ENAM"
1105
+ | "WEUR"
1106
+ | "EEUR"
1107
+ | "APAC"
1108
+ | "OC"
1109
+ | null;
1110
+ sizeAfter?: number | null;
1111
+ timings?: { sqlDurationMs?: number | null } | null;
1112
+ } | null;
1113
+ results?: {
1114
+ columns?: string[] | null;
1115
+ rows?: (number | string)[][] | null;
1116
+ } | null;
1117
+ success?: boolean | null;
1118
+ },
1119
+ RawDatabaseError,
1120
+ Credentials | HttpClient.HttpClient
1121
+ >;
1122
+ } = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
1123
+ input: RawDatabaseRequest,
1124
+ output: RawDatabaseResponse,
1125
+ errors: [],
1126
+ pagination: {
1127
+ mode: "single",
1128
+ items: "result",
1129
+ } as const,
1130
+ }));
1131
+
1132
+ // =============================================================================
1133
+ // DatabaseTimeTravel
1134
+ // =============================================================================
1135
+
1136
+ export interface RestoreDatabaseTimeTravelRequest {
1137
+ databaseId: string;
1138
+ /** Path param: Account identifier tag. */
1139
+ accountId: string;
1140
+ /** Query param: A bookmark to restore the database to. Required if `timestamp` is not provided. */
1141
+ bookmark?: string;
1142
+ /** Query param: An ISO 8601 timestamp to restore the database to. Required if `bookmark` is not provided. */
1143
+ timestamp?: string;
1144
+ }
1145
+
1146
+ export const RestoreDatabaseTimeTravelRequest =
1147
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1148
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
1149
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1150
+ bookmark: Schema.optional(Schema.String).pipe(T.HttpQuery("bookmark")),
1151
+ timestamp: Schema.optional(Schema.String).pipe(T.HttpQuery("timestamp")),
1152
+ }).pipe(
1153
+ T.Http({
1154
+ method: "POST",
1155
+ path: "/accounts/{account_id}/d1/database/{databaseId}/time_travel/restore",
1156
+ }),
1157
+ ) as unknown as Schema.Schema<RestoreDatabaseTimeTravelRequest>;
1158
+
1159
+ export interface RestoreDatabaseTimeTravelResponse {
1160
+ /** The new bookmark representing the state of the database after the restore operation. */
1161
+ bookmark?: string | null;
1162
+ /** A message describing the result of the restore operation. */
1163
+ message?: string | null;
1164
+ /** The bookmark representing the state of the database before the restore operation. Can be used to undo the restore if needed. */
1165
+ previousBookmark?: string | null;
1166
+ }
1167
+
1168
+ export const RestoreDatabaseTimeTravelResponse =
1169
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1170
+ bookmark: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1171
+ message: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1172
+ previousBookmark: Schema.optional(
1173
+ Schema.Union([Schema.String, Schema.Null]),
1174
+ ),
1175
+ })
1176
+ .pipe(
1177
+ Schema.encodeKeys({
1178
+ bookmark: "bookmark",
1179
+ message: "message",
1180
+ previousBookmark: "previous_bookmark",
1181
+ }),
1182
+ )
1183
+ .pipe(
1184
+ T.ResponsePath("result"),
1185
+ ) as unknown as Schema.Schema<RestoreDatabaseTimeTravelResponse>;
1186
+
1187
+ export type RestoreDatabaseTimeTravelError =
1188
+ | DefaultErrors
1189
+ | InvalidObjectIdentifier
1190
+ | NoHistoryAvailable
1191
+ | DatabaseNotFound
1192
+ | InvalidProperty;
1193
+
1194
+ export const restoreDatabaseTimeTravel: API.OperationMethod<
1195
+ RestoreDatabaseTimeTravelRequest,
1196
+ RestoreDatabaseTimeTravelResponse,
1197
+ RestoreDatabaseTimeTravelError,
1198
+ Credentials | HttpClient.HttpClient
1199
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1200
+ input: RestoreDatabaseTimeTravelRequest,
1201
+ output: RestoreDatabaseTimeTravelResponse,
1202
+ errors: [
1203
+ InvalidObjectIdentifier,
1204
+ NoHistoryAvailable,
1205
+ DatabaseNotFound,
1206
+ InvalidProperty,
1207
+ ],
1208
+ }));