@distilled.cloud/cloudflare 0.0.0 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (560) hide show
  1. package/README.md +41 -7
  2. package/lib/auth.d.ts +13 -0
  3. package/lib/auth.d.ts.map +1 -0
  4. package/lib/auth.js +12 -0
  5. package/lib/auth.js.map +1 -0
  6. package/lib/category.d.ts +2 -0
  7. package/lib/category.d.ts.map +1 -0
  8. package/lib/category.js +2 -0
  9. package/lib/category.js.map +1 -0
  10. package/lib/client/api.d.ts +14 -0
  11. package/lib/client/api.d.ts.map +1 -0
  12. package/lib/client/api.js +245 -0
  13. package/lib/client/api.js.map +1 -0
  14. package/lib/client/index.d.ts +8 -0
  15. package/lib/client/index.d.ts.map +1 -0
  16. package/lib/client/index.js +8 -0
  17. package/lib/client/index.js.map +1 -0
  18. package/lib/credentials.d.ts +14 -0
  19. package/lib/credentials.d.ts.map +1 -0
  20. package/lib/credentials.js +17 -0
  21. package/lib/credentials.js.map +1 -0
  22. package/lib/errors.d.ts +37 -0
  23. package/lib/errors.d.ts.map +1 -0
  24. package/lib/errors.js +31 -0
  25. package/lib/errors.js.map +1 -0
  26. package/lib/index.d.ts +10 -0
  27. package/lib/index.d.ts.map +1 -0
  28. package/lib/index.js +10 -0
  29. package/lib/index.js.map +1 -0
  30. package/lib/retry.d.ts +14 -0
  31. package/lib/retry.d.ts.map +1 -0
  32. package/lib/retry.js +14 -0
  33. package/lib/retry.js.map +1 -0
  34. package/lib/schemas.d.ts +29 -0
  35. package/lib/schemas.d.ts.map +1 -0
  36. package/lib/schemas.js +34 -0
  37. package/lib/schemas.js.map +1 -0
  38. package/lib/services/abuse-reports.d.ts +224 -0
  39. package/lib/services/abuse-reports.d.ts.map +1 -0
  40. package/lib/services/abuse-reports.js +353 -0
  41. package/lib/services/abuse-reports.js.map +1 -0
  42. package/lib/services/accounts.d.ts +682 -0
  43. package/lib/services/accounts.d.ts.map +1 -0
  44. package/lib/services/accounts.js +805 -0
  45. package/lib/services/accounts.js.map +1 -0
  46. package/lib/services/acm.d.ts +73 -0
  47. package/lib/services/acm.d.ts.map +1 -0
  48. package/lib/services/acm.js +76 -0
  49. package/lib/services/acm.js.map +1 -0
  50. package/lib/services/addressing.d.ts +1208 -0
  51. package/lib/services/addressing.d.ts.map +1 -0
  52. package/lib/services/addressing.js +1776 -0
  53. package/lib/services/addressing.js.map +1 -0
  54. package/lib/services/ai-gateway.d.ts +956 -0
  55. package/lib/services/ai-gateway.d.ts.map +1 -0
  56. package/lib/services/ai-gateway.js +1706 -0
  57. package/lib/services/ai-gateway.js.map +1 -0
  58. package/lib/services/ai.d.ts +243 -0
  59. package/lib/services/ai.d.ts.map +1 -0
  60. package/lib/services/ai.js +299 -0
  61. package/lib/services/ai.js.map +1 -0
  62. package/lib/services/aisearch.d.ts +915 -0
  63. package/lib/services/aisearch.d.ts.map +1 -0
  64. package/lib/services/aisearch.js +2425 -0
  65. package/lib/services/aisearch.js.map +1 -0
  66. package/lib/services/alerting.d.ts +718 -0
  67. package/lib/services/alerting.d.ts.map +1 -0
  68. package/lib/services/alerting.js +1388 -0
  69. package/lib/services/alerting.js.map +1 -0
  70. package/lib/services/api-gateway.d.ts +830 -0
  71. package/lib/services/api-gateway.d.ts.map +1 -0
  72. package/lib/services/api-gateway.js +1548 -0
  73. package/lib/services/api-gateway.js.map +1 -0
  74. package/lib/services/argo.d.ts +101 -0
  75. package/lib/services/argo.d.ts.map +1 -0
  76. package/lib/services/argo.js +105 -0
  77. package/lib/services/argo.js.map +1 -0
  78. package/lib/services/audit-logs.d.ts +46 -0
  79. package/lib/services/audit-logs.d.ts.map +1 -0
  80. package/lib/services/audit-logs.js +37 -0
  81. package/lib/services/audit-logs.js.map +1 -0
  82. package/lib/services/billing.d.ts +62 -0
  83. package/lib/services/billing.d.ts.map +1 -0
  84. package/lib/services/billing.js +100 -0
  85. package/lib/services/billing.js.map +1 -0
  86. package/lib/services/bot-management.d.ts +124 -0
  87. package/lib/services/bot-management.d.ts.map +1 -0
  88. package/lib/services/bot-management.js +262 -0
  89. package/lib/services/bot-management.js.map +1 -0
  90. package/lib/services/botnet-feed.d.ts +65 -0
  91. package/lib/services/botnet-feed.d.ts.map +1 -0
  92. package/lib/services/botnet-feed.js +84 -0
  93. package/lib/services/botnet-feed.js.map +1 -0
  94. package/lib/services/brand-protection.d.ts +188 -0
  95. package/lib/services/brand-protection.d.ts.map +1 -0
  96. package/lib/services/brand-protection.js +214 -0
  97. package/lib/services/brand-protection.js.map +1 -0
  98. package/lib/services/browser-rendering.d.ts +857 -0
  99. package/lib/services/browser-rendering.d.ts.map +1 -0
  100. package/lib/services/browser-rendering.js +1141 -0
  101. package/lib/services/browser-rendering.js.map +1 -0
  102. package/lib/services/cache.d.ts +287 -0
  103. package/lib/services/cache.d.ts.map +1 -0
  104. package/lib/services/cache.js +330 -0
  105. package/lib/services/cache.js.map +1 -0
  106. package/lib/services/calls.d.ts +202 -0
  107. package/lib/services/calls.d.ts.map +1 -0
  108. package/lib/services/calls.js +175 -0
  109. package/lib/services/calls.js.map +1 -0
  110. package/lib/services/certificate-authorities.d.ts +40 -0
  111. package/lib/services/certificate-authorities.d.ts.map +1 -0
  112. package/lib/services/certificate-authorities.js +49 -0
  113. package/lib/services/certificate-authorities.js.map +1 -0
  114. package/lib/services/client-certificates.d.ts +254 -0
  115. package/lib/services/client-certificates.d.ts.map +1 -0
  116. package/lib/services/client-certificates.js +350 -0
  117. package/lib/services/client-certificates.js.map +1 -0
  118. package/lib/services/cloud-connector.d.ts +59 -0
  119. package/lib/services/cloud-connector.d.ts.map +1 -0
  120. package/lib/services/cloud-connector.js +84 -0
  121. package/lib/services/cloud-connector.js.map +1 -0
  122. package/lib/services/cloudforce-one.d.ts +1318 -0
  123. package/lib/services/cloudforce-one.d.ts.map +1 -0
  124. package/lib/services/cloudforce-one.js +1684 -0
  125. package/lib/services/cloudforce-one.js.map +1 -0
  126. package/lib/services/connectivity.d.ts +248 -0
  127. package/lib/services/connectivity.d.ts.map +1 -0
  128. package/lib/services/connectivity.js +377 -0
  129. package/lib/services/connectivity.js.map +1 -0
  130. package/lib/services/content-scanning.d.ts +131 -0
  131. package/lib/services/content-scanning.d.ts.map +1 -0
  132. package/lib/services/content-scanning.js +156 -0
  133. package/lib/services/content-scanning.js.map +1 -0
  134. package/lib/services/custom-certificates.d.ts +211 -0
  135. package/lib/services/custom-certificates.d.ts.map +1 -0
  136. package/lib/services/custom-certificates.js +309 -0
  137. package/lib/services/custom-certificates.js.map +1 -0
  138. package/lib/services/custom-hostnames.d.ts +525 -0
  139. package/lib/services/custom-hostnames.d.ts.map +1 -0
  140. package/lib/services/custom-hostnames.js +1164 -0
  141. package/lib/services/custom-hostnames.js.map +1 -0
  142. package/lib/services/custom-nameservers.d.ts +67 -0
  143. package/lib/services/custom-nameservers.d.ts.map +1 -0
  144. package/lib/services/custom-nameservers.js +80 -0
  145. package/lib/services/custom-nameservers.js.map +1 -0
  146. package/lib/services/custom-pages.d.ts +74 -0
  147. package/lib/services/custom-pages.d.ts.map +1 -0
  148. package/lib/services/custom-pages.js +125 -0
  149. package/lib/services/custom-pages.js.map +1 -0
  150. package/lib/services/d1.d.ts +326 -0
  151. package/lib/services/d1.d.ts.map +1 -0
  152. package/lib/services/d1.js +448 -0
  153. package/lib/services/d1.js.map +1 -0
  154. package/lib/services/dcv-delegation.d.ts +24 -0
  155. package/lib/services/dcv-delegation.d.ts.map +1 -0
  156. package/lib/services/dcv-delegation.js +24 -0
  157. package/lib/services/dcv-delegation.js.map +1 -0
  158. package/lib/services/diagnostics.d.ts +175 -0
  159. package/lib/services/diagnostics.d.ts.map +1 -0
  160. package/lib/services/diagnostics.js +273 -0
  161. package/lib/services/diagnostics.js.map +1 -0
  162. package/lib/services/dns-firewall.d.ts +288 -0
  163. package/lib/services/dns-firewall.d.ts.map +1 -0
  164. package/lib/services/dns-firewall.js +373 -0
  165. package/lib/services/dns-firewall.js.map +1 -0
  166. package/lib/services/dns.d.ts +2946 -0
  167. package/lib/services/dns.d.ts.map +1 -0
  168. package/lib/services/dns.js +4511 -0
  169. package/lib/services/dns.js.map +1 -0
  170. package/lib/services/durable-objects.d.ts +61 -0
  171. package/lib/services/durable-objects.d.ts.map +1 -0
  172. package/lib/services/durable-objects.js +66 -0
  173. package/lib/services/durable-objects.js.map +1 -0
  174. package/lib/services/email-routing.d.ts +542 -0
  175. package/lib/services/email-routing.d.ts.map +1 -0
  176. package/lib/services/email-routing.js +662 -0
  177. package/lib/services/email-routing.js.map +1 -0
  178. package/lib/services/email-security.d.ts +1131 -0
  179. package/lib/services/email-security.d.ts.map +1 -0
  180. package/lib/services/email-security.js +2065 -0
  181. package/lib/services/email-security.js.map +1 -0
  182. package/lib/services/filters.d.ts +157 -0
  183. package/lib/services/filters.d.ts.map +1 -0
  184. package/lib/services/filters.js +135 -0
  185. package/lib/services/filters.js.map +1 -0
  186. package/lib/services/firewall.d.ts +1080 -0
  187. package/lib/services/firewall.d.ts.map +1 -0
  188. package/lib/services/firewall.js +1881 -0
  189. package/lib/services/firewall.js.map +1 -0
  190. package/lib/services/healthchecks.d.ts +464 -0
  191. package/lib/services/healthchecks.d.ts.map +1 -0
  192. package/lib/services/healthchecks.js +838 -0
  193. package/lib/services/healthchecks.js.map +1 -0
  194. package/lib/services/hostnames.d.ts +74 -0
  195. package/lib/services/hostnames.d.ts.map +1 -0
  196. package/lib/services/hostnames.js +100 -0
  197. package/lib/services/hostnames.js.map +1 -0
  198. package/lib/services/hyperdrive.d.ts +203 -0
  199. package/lib/services/hyperdrive.d.ts.map +1 -0
  200. package/lib/services/hyperdrive.js +299 -0
  201. package/lib/services/hyperdrive.js.map +1 -0
  202. package/lib/services/iam.d.ts +554 -0
  203. package/lib/services/iam.d.ts.map +1 -0
  204. package/lib/services/iam.js +743 -0
  205. package/lib/services/iam.js.map +1 -0
  206. package/lib/services/images.d.ts +403 -0
  207. package/lib/services/images.d.ts.map +1 -0
  208. package/lib/services/images.js +417 -0
  209. package/lib/services/images.js.map +1 -0
  210. package/lib/services/intel.d.ts +768 -0
  211. package/lib/services/intel.d.ts.map +1 -0
  212. package/lib/services/intel.js +1179 -0
  213. package/lib/services/intel.js.map +1 -0
  214. package/lib/services/ips.d.ts +28 -0
  215. package/lib/services/ips.d.ts.map +1 -0
  216. package/lib/services/ips.js +39 -0
  217. package/lib/services/ips.js.map +1 -0
  218. package/lib/services/keyless-certificates.d.ts +177 -0
  219. package/lib/services/keyless-certificates.d.ts.map +1 -0
  220. package/lib/services/keyless-certificates.js +216 -0
  221. package/lib/services/keyless-certificates.js.map +1 -0
  222. package/lib/services/kv.d.ts +339 -0
  223. package/lib/services/kv.d.ts.map +1 -0
  224. package/lib/services/kv.js +402 -0
  225. package/lib/services/kv.js.map +1 -0
  226. package/lib/services/leaked-credential-checks.d.ts +119 -0
  227. package/lib/services/leaked-credential-checks.d.ts.map +1 -0
  228. package/lib/services/leaked-credential-checks.js +130 -0
  229. package/lib/services/leaked-credential-checks.js.map +1 -0
  230. package/lib/services/load-balancers.d.ts +1767 -0
  231. package/lib/services/load-balancers.d.ts.map +1 -0
  232. package/lib/services/load-balancers.js +3068 -0
  233. package/lib/services/load-balancers.js.map +1 -0
  234. package/lib/services/logpush.d.ts +401 -0
  235. package/lib/services/logpush.d.ts.map +1 -0
  236. package/lib/services/logpush.js +724 -0
  237. package/lib/services/logpush.js.map +1 -0
  238. package/lib/services/logs.d.ts +125 -0
  239. package/lib/services/logs.d.ts.map +1 -0
  240. package/lib/services/logs.js +145 -0
  241. package/lib/services/logs.js.map +1 -0
  242. package/lib/services/magic-cloud-networking.d.ts +1599 -0
  243. package/lib/services/magic-cloud-networking.d.ts.map +1 -0
  244. package/lib/services/magic-cloud-networking.js +5205 -0
  245. package/lib/services/magic-cloud-networking.js.map +1 -0
  246. package/lib/services/magic-network-monitoring.d.ts +379 -0
  247. package/lib/services/magic-network-monitoring.d.ts.map +1 -0
  248. package/lib/services/magic-network-monitoring.js +535 -0
  249. package/lib/services/magic-network-monitoring.js.map +1 -0
  250. package/lib/services/magic-transit.d.ts +3650 -0
  251. package/lib/services/magic-transit.d.ts.map +1 -0
  252. package/lib/services/magic-transit.js +6120 -0
  253. package/lib/services/magic-transit.js.map +1 -0
  254. package/lib/services/managed-transforms.d.ts +79 -0
  255. package/lib/services/managed-transforms.d.ts.map +1 -0
  256. package/lib/services/managed-transforms.js +107 -0
  257. package/lib/services/managed-transforms.js.map +1 -0
  258. package/lib/services/memberships.d.ts +172 -0
  259. package/lib/services/memberships.d.ts.map +1 -0
  260. package/lib/services/memberships.js +282 -0
  261. package/lib/services/memberships.js.map +1 -0
  262. package/lib/services/mtls-certificates.d.ts +140 -0
  263. package/lib/services/mtls-certificates.d.ts.map +1 -0
  264. package/lib/services/mtls-certificates.js +173 -0
  265. package/lib/services/mtls-certificates.js.map +1 -0
  266. package/lib/services/network-interconnects.d.ts +410 -0
  267. package/lib/services/network-interconnects.d.ts.map +1 -0
  268. package/lib/services/network-interconnects.js +583 -0
  269. package/lib/services/network-interconnects.js.map +1 -0
  270. package/lib/services/organizations.d.ts +201 -0
  271. package/lib/services/organizations.d.ts.map +1 -0
  272. package/lib/services/organizations.js +355 -0
  273. package/lib/services/organizations.js.map +1 -0
  274. package/lib/services/origin-ca-certificates.d.ts +99 -0
  275. package/lib/services/origin-ca-certificates.d.ts.map +1 -0
  276. package/lib/services/origin-ca-certificates.js +156 -0
  277. package/lib/services/origin-ca-certificates.js.map +1 -0
  278. package/lib/services/origin-post-quantum-encryption.d.ts +50 -0
  279. package/lib/services/origin-post-quantum-encryption.d.ts.map +1 -0
  280. package/lib/services/origin-post-quantum-encryption.js +60 -0
  281. package/lib/services/origin-post-quantum-encryption.js.map +1 -0
  282. package/lib/services/origin-tls-client-auth.d.ts +273 -0
  283. package/lib/services/origin-tls-client-auth.d.ts.map +1 -0
  284. package/lib/services/origin-tls-client-auth.js +401 -0
  285. package/lib/services/origin-tls-client-auth.js.map +1 -0
  286. package/lib/services/page-rules.d.ts +773 -0
  287. package/lib/services/page-rules.d.ts.map +1 -0
  288. package/lib/services/page-rules.js +1365 -0
  289. package/lib/services/page-rules.js.map +1 -0
  290. package/lib/services/page-shield.d.ts +426 -0
  291. package/lib/services/page-shield.d.ts.map +1 -0
  292. package/lib/services/page-shield.js +484 -0
  293. package/lib/services/page-shield.js.map +1 -0
  294. package/lib/services/pages.d.ts +1654 -0
  295. package/lib/services/pages.d.ts.map +1 -0
  296. package/lib/services/pages.js +2954 -0
  297. package/lib/services/pages.js.map +1 -0
  298. package/lib/services/pipelines.d.ts +1461 -0
  299. package/lib/services/pipelines.d.ts.map +1 -0
  300. package/lib/services/pipelines.js +2912 -0
  301. package/lib/services/pipelines.js.map +1 -0
  302. package/lib/services/queues.d.ts +807 -0
  303. package/lib/services/queues.d.ts.map +1 -0
  304. package/lib/services/queues.js +1194 -0
  305. package/lib/services/queues.js.map +1 -0
  306. package/lib/services/r2-data-catalog.d.ts +341 -0
  307. package/lib/services/r2-data-catalog.d.ts.map +1 -0
  308. package/lib/services/r2-data-catalog.js +499 -0
  309. package/lib/services/r2-data-catalog.js.map +1 -0
  310. package/lib/services/r2.d.ts +1041 -0
  311. package/lib/services/r2.d.ts.map +1 -0
  312. package/lib/services/r2.js +1384 -0
  313. package/lib/services/r2.js.map +1 -0
  314. package/lib/services/radar.d.ts +9276 -0
  315. package/lib/services/radar.d.ts.map +1 -0
  316. package/lib/services/radar.js +20491 -0
  317. package/lib/services/radar.js.map +1 -0
  318. package/lib/services/rate-limits.d.ts +315 -0
  319. package/lib/services/rate-limits.d.ts.map +1 -0
  320. package/lib/services/rate-limits.js +521 -0
  321. package/lib/services/rate-limits.js.map +1 -0
  322. package/lib/services/realtime-kit.d.ts +2728 -0
  323. package/lib/services/realtime-kit.d.ts.map +1 -0
  324. package/lib/services/realtime-kit.js +5401 -0
  325. package/lib/services/realtime-kit.js.map +1 -0
  326. package/lib/services/registrar.d.ts +81 -0
  327. package/lib/services/registrar.d.ts.map +1 -0
  328. package/lib/services/registrar.js +154 -0
  329. package/lib/services/registrar.js.map +1 -0
  330. package/lib/services/request-tracers.d.ts +61 -0
  331. package/lib/services/request-tracers.d.ts.map +1 -0
  332. package/lib/services/request-tracers.js +82 -0
  333. package/lib/services/request-tracers.js.map +1 -0
  334. package/lib/services/resource-sharing.d.ts +540 -0
  335. package/lib/services/resource-sharing.d.ts.map +1 -0
  336. package/lib/services/resource-sharing.js +846 -0
  337. package/lib/services/resource-sharing.js.map +1 -0
  338. package/lib/services/rules.d.ts +297 -0
  339. package/lib/services/rules.d.ts.map +1 -0
  340. package/lib/services/rules.js +396 -0
  341. package/lib/services/rules.js.map +1 -0
  342. package/lib/services/rulesets.d.ts +3300 -0
  343. package/lib/services/rulesets.d.ts.map +1 -0
  344. package/lib/services/rulesets.js +7852 -0
  345. package/lib/services/rulesets.js.map +1 -0
  346. package/lib/services/rum.d.ts +289 -0
  347. package/lib/services/rum.d.ts.map +1 -0
  348. package/lib/services/rum.js +409 -0
  349. package/lib/services/rum.js.map +1 -0
  350. package/lib/services/schema-validation.d.ts +240 -0
  351. package/lib/services/schema-validation.d.ts.map +1 -0
  352. package/lib/services/schema-validation.js +306 -0
  353. package/lib/services/schema-validation.js.map +1 -0
  354. package/lib/services/secrets-store.d.ts +321 -0
  355. package/lib/services/secrets-store.d.ts.map +1 -0
  356. package/lib/services/secrets-store.js +385 -0
  357. package/lib/services/secrets-store.js.map +1 -0
  358. package/lib/services/security-center.d.ts +102 -0
  359. package/lib/services/security-center.d.ts.map +1 -0
  360. package/lib/services/security-center.js +170 -0
  361. package/lib/services/security-center.js.map +1 -0
  362. package/lib/services/security-txt.d.ts +105 -0
  363. package/lib/services/security-txt.d.ts.map +1 -0
  364. package/lib/services/security-txt.js +136 -0
  365. package/lib/services/security-txt.js.map +1 -0
  366. package/lib/services/snippets.d.ts +138 -0
  367. package/lib/services/snippets.d.ts.map +1 -0
  368. package/lib/services/snippets.js +178 -0
  369. package/lib/services/snippets.js.map +1 -0
  370. package/lib/services/spectrum.d.ts +316 -0
  371. package/lib/services/spectrum.d.ts.map +1 -0
  372. package/lib/services/spectrum.js +510 -0
  373. package/lib/services/spectrum.js.map +1 -0
  374. package/lib/services/speed.d.ts +227 -0
  375. package/lib/services/speed.d.ts.map +1 -0
  376. package/lib/services/speed.js +444 -0
  377. package/lib/services/speed.js.map +1 -0
  378. package/lib/services/ssl.d.ts +370 -0
  379. package/lib/services/ssl.d.ts.map +1 -0
  380. package/lib/services/ssl.js +732 -0
  381. package/lib/services/ssl.js.map +1 -0
  382. package/lib/services/stream.d.ts +1014 -0
  383. package/lib/services/stream.d.ts.map +1 -0
  384. package/lib/services/stream.js +1049 -0
  385. package/lib/services/stream.js.map +1 -0
  386. package/lib/services/token-validation.d.ts +547 -0
  387. package/lib/services/token-validation.d.ts.map +1 -0
  388. package/lib/services/token-validation.js +768 -0
  389. package/lib/services/token-validation.js.map +1 -0
  390. package/lib/services/turnstile.d.ts +248 -0
  391. package/lib/services/turnstile.d.ts.map +1 -0
  392. package/lib/services/turnstile.js +308 -0
  393. package/lib/services/turnstile.js.map +1 -0
  394. package/lib/services/url-normalization.d.ts +53 -0
  395. package/lib/services/url-normalization.d.ts.map +1 -0
  396. package/lib/services/url-normalization.js +52 -0
  397. package/lib/services/url-normalization.js.map +1 -0
  398. package/lib/services/url-scanner.d.ts +612 -0
  399. package/lib/services/url-scanner.d.ts.map +1 -0
  400. package/lib/services/url-scanner.js +915 -0
  401. package/lib/services/url-scanner.js.map +1 -0
  402. package/lib/services/user.d.ts +441 -0
  403. package/lib/services/user.d.ts.map +1 -0
  404. package/lib/services/user.js +567 -0
  405. package/lib/services/user.js.map +1 -0
  406. package/lib/services/vectorize.d.ts +282 -0
  407. package/lib/services/vectorize.d.ts.map +1 -0
  408. package/lib/services/vectorize.js +340 -0
  409. package/lib/services/vectorize.js.map +1 -0
  410. package/lib/services/waiting-rooms.d.ts +1009 -0
  411. package/lib/services/waiting-rooms.d.ts.map +1 -0
  412. package/lib/services/waiting-rooms.js +1757 -0
  413. package/lib/services/waiting-rooms.js.map +1 -0
  414. package/lib/services/web3.d.ts +274 -0
  415. package/lib/services/web3.d.ts.map +1 -0
  416. package/lib/services/web3.js +362 -0
  417. package/lib/services/web3.js.map +1 -0
  418. package/lib/services/workers-for-platforms.d.ts +1224 -0
  419. package/lib/services/workers-for-platforms.d.ts.map +1 -0
  420. package/lib/services/workers-for-platforms.js +2078 -0
  421. package/lib/services/workers-for-platforms.js.map +1 -0
  422. package/lib/services/workers.d.ts +3498 -0
  423. package/lib/services/workers.d.ts.map +1 -0
  424. package/lib/services/workers.js +5967 -0
  425. package/lib/services/workers.js.map +1 -0
  426. package/lib/services/workflows.d.ts +359 -0
  427. package/lib/services/workflows.d.ts.map +1 -0
  428. package/lib/services/workflows.js +516 -0
  429. package/lib/services/workflows.js.map +1 -0
  430. package/lib/services/zaraz.d.ts +300 -0
  431. package/lib/services/zaraz.d.ts.map +1 -0
  432. package/lib/services/zaraz.js +298 -0
  433. package/lib/services/zaraz.js.map +1 -0
  434. package/lib/services/zero-trust.d.ts +15449 -0
  435. package/lib/services/zero-trust.d.ts.map +1 -0
  436. package/lib/services/zero-trust.js +29194 -0
  437. package/lib/services/zero-trust.js.map +1 -0
  438. package/lib/services/zones.d.ts +1278 -0
  439. package/lib/services/zones.d.ts.map +1 -0
  440. package/lib/services/zones.js +2416 -0
  441. package/lib/services/zones.js.map +1 -0
  442. package/lib/traits.d.ts +28 -0
  443. package/lib/traits.d.ts.map +1 -0
  444. package/lib/traits.js +26 -0
  445. package/lib/traits.js.map +1 -0
  446. package/package.json +68 -5
  447. package/src/auth.ts +14 -0
  448. package/src/category.ts +1 -0
  449. package/src/client/api.ts +329 -0
  450. package/src/client/index.ts +7 -0
  451. package/src/credentials.ts +30 -0
  452. package/src/errors.ts +57 -0
  453. package/src/index.ts +9 -0
  454. package/src/retry.ts +35 -0
  455. package/src/schemas.ts +51 -0
  456. package/src/services/abuse-reports.ts +747 -0
  457. package/src/services/accounts.ts +1947 -0
  458. package/src/services/acm.ts +170 -0
  459. package/src/services/addressing.ts +3947 -0
  460. package/src/services/ai-gateway.ts +3335 -0
  461. package/src/services/ai.ts +727 -0
  462. package/src/services/aisearch.ts +4750 -0
  463. package/src/services/alerting.ts +2947 -0
  464. package/src/services/api-gateway.ts +3391 -0
  465. package/src/services/argo.ts +254 -0
  466. package/src/services/audit-logs.ts +90 -0
  467. package/src/services/billing.ts +172 -0
  468. package/src/services/bot-management.ts +541 -0
  469. package/src/services/botnet-feed.ts +193 -0
  470. package/src/services/brand-protection.ts +553 -0
  471. package/src/services/browser-rendering.ts +2707 -0
  472. package/src/services/cache.ts +827 -0
  473. package/src/services/calls.ts +483 -0
  474. package/src/services/certificate-authorities.ts +110 -0
  475. package/src/services/client-certificates.ts +718 -0
  476. package/src/services/cloud-connector.ts +181 -0
  477. package/src/services/cloudforce-one.ts +3876 -0
  478. package/src/services/connectivity.ts +629 -0
  479. package/src/services/content-scanning.ts +385 -0
  480. package/src/services/custom-certificates.ts +611 -0
  481. package/src/services/custom-hostnames.ts +2453 -0
  482. package/src/services/custom-nameservers.ts +182 -0
  483. package/src/services/custom-pages.ts +264 -0
  484. package/src/services/d1.ts +1034 -0
  485. package/src/services/dcv-delegation.ts +52 -0
  486. package/src/services/diagnostics.ts +603 -0
  487. package/src/services/dns-firewall.ts +823 -0
  488. package/src/services/dns.ts +8897 -0
  489. package/src/services/durable-objects.ts +148 -0
  490. package/src/services/email-routing.ts +1602 -0
  491. package/src/services/email-security.ts +4283 -0
  492. package/src/services/filters.ts +370 -0
  493. package/src/services/firewall.ts +3896 -0
  494. package/src/services/healthchecks.ts +1750 -0
  495. package/src/services/hostnames.ts +218 -0
  496. package/src/services/hyperdrive.ts +592 -0
  497. package/src/services/iam.ts +1668 -0
  498. package/src/services/images.ts +1086 -0
  499. package/src/services/intel.ts +2768 -0
  500. package/src/services/ips.ts +88 -0
  501. package/src/services/keyless-certificates.ts +462 -0
  502. package/src/services/kv.ts +1011 -0
  503. package/src/services/leaked-credential-checks.ts +325 -0
  504. package/src/services/load-balancers.ts +6438 -0
  505. package/src/services/logpush.ts +1667 -0
  506. package/src/services/logs.ts +375 -0
  507. package/src/services/magic-cloud-networking.ts +10020 -0
  508. package/src/services/magic-network-monitoring.ts +1156 -0
  509. package/src/services/magic-transit.ts +13050 -0
  510. package/src/services/managed-transforms.ts +237 -0
  511. package/src/services/memberships.ts +615 -0
  512. package/src/services/mtls-certificates.ts +374 -0
  513. package/src/services/network-interconnects.ts +1253 -0
  514. package/src/services/organizations.ts +674 -0
  515. package/src/services/origin-ca-certificates.ts +303 -0
  516. package/src/services/origin-post-quantum-encryption.ts +128 -0
  517. package/src/services/origin-tls-client-auth.ts +878 -0
  518. package/src/services/page-rules.ts +2612 -0
  519. package/src/services/page-shield.ts +1195 -0
  520. package/src/services/pages.ts +5709 -0
  521. package/src/services/pipelines.ts +6000 -0
  522. package/src/services/queues.ts +2629 -0
  523. package/src/services/r2-data-catalog.ts +1119 -0
  524. package/src/services/r2.ts +3348 -0
  525. package/src/services/radar.ts +42152 -0
  526. package/src/services/rate-limits.ts +1150 -0
  527. package/src/services/realtime-kit.ts +11079 -0
  528. package/src/services/registrar.ts +295 -0
  529. package/src/services/request-tracers.ts +158 -0
  530. package/src/services/resource-sharing.ts +1832 -0
  531. package/src/services/rules.ts +837 -0
  532. package/src/services/rulesets.ts +15144 -0
  533. package/src/services/rum.ts +901 -0
  534. package/src/services/schema-validation.ts +733 -0
  535. package/src/services/secrets-store.ts +860 -0
  536. package/src/services/security-center.ts +397 -0
  537. package/src/services/security-txt.ts +315 -0
  538. package/src/services/snippets.ts +420 -0
  539. package/src/services/spectrum.ts +1103 -0
  540. package/src/services/speed.ts +1056 -0
  541. package/src/services/ssl.ts +1587 -0
  542. package/src/services/stream.ts +2756 -0
  543. package/src/services/token-validation.ts +1585 -0
  544. package/src/services/turnstile.ts +643 -0
  545. package/src/services/url-normalization.ts +129 -0
  546. package/src/services/url-scanner.ts +1851 -0
  547. package/src/services/user.ts +1384 -0
  548. package/src/services/vectorize.ts +816 -0
  549. package/src/services/waiting-rooms.ts +3807 -0
  550. package/src/services/web3.ts +834 -0
  551. package/src/services/workers-for-platforms.ts +3859 -0
  552. package/src/services/workers.ts +11637 -0
  553. package/src/services/workflows.ts +1124 -0
  554. package/src/services/zaraz.ts +797 -0
  555. package/src/services/zero-trust.ts +58929 -0
  556. package/src/services/zones.ts +4875 -0
  557. package/src/traits.ts +47 -0
  558. package/bun.lock +0 -26
  559. package/index.ts +0 -1
  560. package/tsconfig.json +0 -29
@@ -0,0 +1,1034 @@
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 Schema from "effect/Schema";
9
+ import type * as HttpClient from "effect/unstable/http/HttpClient";
10
+ import * as API from "../client/api.ts";
11
+ import * as T from "../traits";
12
+ import type { Credentials } from "../credentials";
13
+ import { type DefaultErrors } from "../errors";
14
+
15
+ // =============================================================================
16
+ // Errors
17
+ // =============================================================================
18
+
19
+ export class DatabaseNotFound extends Schema.TaggedErrorClass<DatabaseNotFound>()(
20
+ "DatabaseNotFound",
21
+ { code: Schema.Number, message: Schema.String },
22
+ ) {}
23
+ T.applyErrorMatchers(DatabaseNotFound, [{ code: 7404 }]);
24
+
25
+ export class InternalError extends Schema.TaggedErrorClass<InternalError>()(
26
+ "InternalError",
27
+ { code: Schema.Number, message: Schema.String },
28
+ ) {}
29
+ T.applyErrorMatchers(InternalError, [{ code: 7500 }]);
30
+
31
+ export class InvalidObjectIdentifier extends Schema.TaggedErrorClass<InvalidObjectIdentifier>()(
32
+ "InvalidObjectIdentifier",
33
+ { code: Schema.Number, message: Schema.String },
34
+ ) {}
35
+ T.applyErrorMatchers(InvalidObjectIdentifier, [{ code: 7003 }]);
36
+
37
+ export class InvalidProperty extends Schema.TaggedErrorClass<InvalidProperty>()(
38
+ "InvalidProperty",
39
+ { code: Schema.Number, message: Schema.String },
40
+ ) {}
41
+ T.applyErrorMatchers(InvalidProperty, [{ code: 7400 }]);
42
+
43
+ export class InvalidRequest extends Schema.TaggedErrorClass<InvalidRequest>()(
44
+ "InvalidRequest",
45
+ { code: Schema.Number, message: Schema.String },
46
+ ) {}
47
+ T.applyErrorMatchers(InvalidRequest, [{ code: 7400 }]);
48
+
49
+ export class NoHistoryAvailable extends Schema.TaggedErrorClass<NoHistoryAvailable>()(
50
+ "NoHistoryAvailable",
51
+ { code: Schema.Number, message: Schema.String },
52
+ ) {}
53
+ T.applyErrorMatchers(NoHistoryAvailable, [{ code: 7500 }]);
54
+
55
+ export class TimestampTooOld extends Schema.TaggedErrorClass<TimestampTooOld>()(
56
+ "TimestampTooOld",
57
+ { code: Schema.Number, message: Schema.String },
58
+ ) {}
59
+ T.applyErrorMatchers(TimestampTooOld, [{ code: 7400 }]);
60
+
61
+ export class UnknownError extends Schema.TaggedErrorClass<UnknownError>()(
62
+ "UnknownError",
63
+ { code: Schema.Number, message: Schema.String },
64
+ ) {}
65
+ T.applyErrorMatchers(UnknownError, [{ code: 0 }]);
66
+
67
+ // =============================================================================
68
+ // BookmarkDatabaseTimeTravel
69
+ // =============================================================================
70
+
71
+ export interface GetBookmarkDatabaseTimeTravelRequest {
72
+ databaseId: string;
73
+ /** Path param: Account identifier tag. */
74
+ accountId: string;
75
+ /** 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. */
76
+ timestamp?: string;
77
+ }
78
+
79
+ export const GetBookmarkDatabaseTimeTravelRequest =
80
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
81
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
82
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
83
+ timestamp: Schema.optional(Schema.String).pipe(T.HttpQuery("timestamp")),
84
+ }).pipe(
85
+ T.Http({
86
+ method: "GET",
87
+ path: "/accounts/{account_id}/d1/database/{databaseId}/time_travel/bookmark",
88
+ }),
89
+ ) as unknown as Schema.Schema<GetBookmarkDatabaseTimeTravelRequest>;
90
+
91
+ export interface GetBookmarkDatabaseTimeTravelResponse {
92
+ /** A bookmark representing a specific state of the database at a specific point in time. */
93
+ bookmark?: string | null;
94
+ }
95
+
96
+ export const GetBookmarkDatabaseTimeTravelResponse =
97
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
98
+ bookmark: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
99
+ }) as unknown as Schema.Schema<GetBookmarkDatabaseTimeTravelResponse>;
100
+
101
+ export type GetBookmarkDatabaseTimeTravelError =
102
+ | DefaultErrors
103
+ | InvalidObjectIdentifier
104
+ | NoHistoryAvailable
105
+ | TimestampTooOld
106
+ | DatabaseNotFound;
107
+
108
+ export const getBookmarkDatabaseTimeTravel: API.OperationMethod<
109
+ GetBookmarkDatabaseTimeTravelRequest,
110
+ GetBookmarkDatabaseTimeTravelResponse,
111
+ GetBookmarkDatabaseTimeTravelError,
112
+ Credentials | HttpClient.HttpClient
113
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
114
+ input: GetBookmarkDatabaseTimeTravelRequest,
115
+ output: GetBookmarkDatabaseTimeTravelResponse,
116
+ errors: [
117
+ InvalidObjectIdentifier,
118
+ NoHistoryAvailable,
119
+ TimestampTooOld,
120
+ DatabaseNotFound,
121
+ ],
122
+ }));
123
+
124
+ // =============================================================================
125
+ // Databas
126
+ // =============================================================================
127
+
128
+ export interface ListDatabasesRequest {
129
+ /** Path param: Account identifier tag. */
130
+ accountId: string;
131
+ /** Query param: a database name to search for. */
132
+ name?: string;
133
+ }
134
+
135
+ export const ListDatabasesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
136
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
137
+ name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
138
+ }).pipe(
139
+ T.Http({ method: "GET", path: "/accounts/{account_id}/d1/database" }),
140
+ ) as unknown as Schema.Schema<ListDatabasesRequest>;
141
+
142
+ export type ListDatabasesResponse = {
143
+ createdAt?: string | null;
144
+ name?: string | null;
145
+ uuid?: string | null;
146
+ version?: string | null;
147
+ }[];
148
+
149
+ export const ListDatabasesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
150
+ Schema.Struct({
151
+ createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
152
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
153
+ uuid: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
154
+ version: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
155
+ }).pipe(
156
+ Schema.encodeKeys({
157
+ createdAt: "created_at",
158
+ name: "name",
159
+ uuid: "uuid",
160
+ version: "version",
161
+ }),
162
+ ),
163
+ ) as unknown as Schema.Schema<ListDatabasesResponse>;
164
+
165
+ export type ListDatabasesError = DefaultErrors;
166
+
167
+ export const listDatabases: API.OperationMethod<
168
+ ListDatabasesRequest,
169
+ ListDatabasesResponse,
170
+ ListDatabasesError,
171
+ Credentials | HttpClient.HttpClient
172
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
173
+ input: ListDatabasesRequest,
174
+ output: ListDatabasesResponse,
175
+ errors: [],
176
+ }));
177
+
178
+ // =============================================================================
179
+ // Database
180
+ // =============================================================================
181
+
182
+ export interface GetDatabaseRequest {
183
+ databaseId: string;
184
+ /** Account identifier tag. */
185
+ accountId: string;
186
+ }
187
+
188
+ export const GetDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
189
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
190
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
191
+ }).pipe(
192
+ T.Http({
193
+ method: "GET",
194
+ path: "/accounts/{account_id}/d1/database/{databaseId}",
195
+ }),
196
+ ) as unknown as Schema.Schema<GetDatabaseRequest>;
197
+
198
+ export type GetDatabaseResponse = unknown;
199
+
200
+ export const GetDatabaseResponse =
201
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<GetDatabaseResponse>;
202
+
203
+ export type GetDatabaseError =
204
+ | DefaultErrors
205
+ | InvalidObjectIdentifier
206
+ | DatabaseNotFound
207
+ | UnknownError;
208
+
209
+ export const getDatabase: API.OperationMethod<
210
+ GetDatabaseRequest,
211
+ GetDatabaseResponse,
212
+ GetDatabaseError,
213
+ Credentials | HttpClient.HttpClient
214
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
215
+ input: GetDatabaseRequest,
216
+ output: GetDatabaseResponse,
217
+ errors: [InvalidObjectIdentifier, DatabaseNotFound, UnknownError],
218
+ }));
219
+
220
+ export interface CreateDatabaseRequest {
221
+ /** Path param: Account identifier tag. */
222
+ accountId: string;
223
+ /** Body param: D1 database name. */
224
+ name: string;
225
+ /** 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. */
226
+ jurisdiction?: "eu" | "fedramp";
227
+ /** 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. */
228
+ primaryLocationHint?: "wnam" | "enam" | "weur" | "eeur" | "apac" | "oc";
229
+ }
230
+
231
+ export const CreateDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
232
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
233
+ name: Schema.String,
234
+ jurisdiction: Schema.optional(Schema.Literals(["eu", "fedramp"])),
235
+ primaryLocationHint: Schema.optional(
236
+ Schema.Literals(["wnam", "enam", "weur", "eeur", "apac", "oc"]),
237
+ ),
238
+ }).pipe(
239
+ Schema.encodeKeys({
240
+ name: "name",
241
+ jurisdiction: "jurisdiction",
242
+ primaryLocationHint: "primary_location_hint",
243
+ }),
244
+ T.Http({ method: "POST", path: "/accounts/{account_id}/d1/database" }),
245
+ ) as unknown as Schema.Schema<CreateDatabaseRequest>;
246
+
247
+ export type CreateDatabaseResponse = unknown;
248
+
249
+ export const CreateDatabaseResponse =
250
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<CreateDatabaseResponse>;
251
+
252
+ export type CreateDatabaseError =
253
+ | DefaultErrors
254
+ | InvalidObjectIdentifier
255
+ | InvalidProperty;
256
+
257
+ export const createDatabase: API.OperationMethod<
258
+ CreateDatabaseRequest,
259
+ CreateDatabaseResponse,
260
+ CreateDatabaseError,
261
+ Credentials | HttpClient.HttpClient
262
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
263
+ input: CreateDatabaseRequest,
264
+ output: CreateDatabaseResponse,
265
+ errors: [InvalidObjectIdentifier, InvalidProperty],
266
+ }));
267
+
268
+ export interface UpdateDatabaseRequest {
269
+ databaseId: string;
270
+ /** Path param: Account identifier tag. */
271
+ accountId: string;
272
+ /** Body param: Configuration for D1 read replication. */
273
+ readReplication: { mode: "auto" | "disabled" };
274
+ }
275
+
276
+ export const UpdateDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
277
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
278
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
279
+ readReplication: Schema.Struct({
280
+ mode: Schema.Literals(["auto", "disabled"]),
281
+ }),
282
+ }).pipe(
283
+ Schema.encodeKeys({ readReplication: "read_replication" }),
284
+ T.Http({
285
+ method: "PUT",
286
+ path: "/accounts/{account_id}/d1/database/{databaseId}",
287
+ }),
288
+ ) as unknown as Schema.Schema<UpdateDatabaseRequest>;
289
+
290
+ export type UpdateDatabaseResponse = unknown;
291
+
292
+ export const UpdateDatabaseResponse =
293
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<UpdateDatabaseResponse>;
294
+
295
+ export type UpdateDatabaseError =
296
+ | DefaultErrors
297
+ | InvalidObjectIdentifier
298
+ | InternalError
299
+ | DatabaseNotFound;
300
+
301
+ export const updateDatabase: API.OperationMethod<
302
+ UpdateDatabaseRequest,
303
+ UpdateDatabaseResponse,
304
+ UpdateDatabaseError,
305
+ Credentials | HttpClient.HttpClient
306
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
307
+ input: UpdateDatabaseRequest,
308
+ output: UpdateDatabaseResponse,
309
+ errors: [InvalidObjectIdentifier, InternalError, DatabaseNotFound],
310
+ }));
311
+
312
+ export interface PatchDatabaseRequest {
313
+ databaseId: string;
314
+ /** Path param: Account identifier tag. */
315
+ accountId: string;
316
+ /** Body param: Configuration for D1 read replication. */
317
+ readReplication?: { mode: "auto" | "disabled" };
318
+ }
319
+
320
+ export const PatchDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
321
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
322
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
323
+ readReplication: Schema.optional(
324
+ Schema.Struct({
325
+ mode: Schema.Literals(["auto", "disabled"]),
326
+ }),
327
+ ),
328
+ }).pipe(
329
+ Schema.encodeKeys({ readReplication: "read_replication" }),
330
+ T.Http({
331
+ method: "PATCH",
332
+ path: "/accounts/{account_id}/d1/database/{databaseId}",
333
+ }),
334
+ ) as unknown as Schema.Schema<PatchDatabaseRequest>;
335
+
336
+ export type PatchDatabaseResponse = unknown;
337
+
338
+ export const PatchDatabaseResponse =
339
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<PatchDatabaseResponse>;
340
+
341
+ export type PatchDatabaseError =
342
+ | DefaultErrors
343
+ | InvalidObjectIdentifier
344
+ | InternalError
345
+ | DatabaseNotFound;
346
+
347
+ export const patchDatabase: API.OperationMethod<
348
+ PatchDatabaseRequest,
349
+ PatchDatabaseResponse,
350
+ PatchDatabaseError,
351
+ Credentials | HttpClient.HttpClient
352
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
353
+ input: PatchDatabaseRequest,
354
+ output: PatchDatabaseResponse,
355
+ errors: [InvalidObjectIdentifier, InternalError, DatabaseNotFound],
356
+ }));
357
+
358
+ export interface DeleteDatabaseRequest {
359
+ databaseId: string;
360
+ /** Account identifier tag. */
361
+ accountId: string;
362
+ }
363
+
364
+ export const DeleteDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
365
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
366
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
367
+ }).pipe(
368
+ T.Http({
369
+ method: "DELETE",
370
+ path: "/accounts/{account_id}/d1/database/{databaseId}",
371
+ }),
372
+ ) as unknown as Schema.Schema<DeleteDatabaseRequest>;
373
+
374
+ export type DeleteDatabaseResponse = unknown;
375
+
376
+ export const DeleteDatabaseResponse =
377
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<DeleteDatabaseResponse>;
378
+
379
+ export type DeleteDatabaseError =
380
+ | DefaultErrors
381
+ | InvalidObjectIdentifier
382
+ | DatabaseNotFound
383
+ | UnknownError;
384
+
385
+ export const deleteDatabase: API.OperationMethod<
386
+ DeleteDatabaseRequest,
387
+ DeleteDatabaseResponse,
388
+ DeleteDatabaseError,
389
+ Credentials | HttpClient.HttpClient
390
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
391
+ input: DeleteDatabaseRequest,
392
+ output: DeleteDatabaseResponse,
393
+ errors: [InvalidObjectIdentifier, DatabaseNotFound, UnknownError],
394
+ }));
395
+
396
+ export interface ExportDatabaseRequest {
397
+ databaseId: string;
398
+ /** Path param: Account identifier tag. */
399
+ accountId: string;
400
+ /** Body param: Specifies that you will poll this endpoint until the export completes */
401
+ outputFormat: "polling";
402
+ /** Body param: To poll an in-progress export, provide the current bookmark (returned by your first polling response) */
403
+ currentBookmark?: string;
404
+ /** Body param: */
405
+ dumpOptions?: { noData?: boolean; noSchema?: boolean; tables?: string[] };
406
+ }
407
+
408
+ export const ExportDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
409
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
410
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
411
+ outputFormat: Schema.Literal("polling"),
412
+ currentBookmark: Schema.optional(Schema.String),
413
+ dumpOptions: Schema.optional(
414
+ Schema.Struct({
415
+ noData: Schema.optional(Schema.Boolean),
416
+ noSchema: Schema.optional(Schema.Boolean),
417
+ tables: Schema.optional(Schema.Array(Schema.String)),
418
+ }).pipe(
419
+ Schema.encodeKeys({
420
+ noData: "no_data",
421
+ noSchema: "no_schema",
422
+ tables: "tables",
423
+ }),
424
+ ),
425
+ ),
426
+ }).pipe(
427
+ Schema.encodeKeys({
428
+ outputFormat: "output_format",
429
+ currentBookmark: "current_bookmark",
430
+ dumpOptions: "dump_options",
431
+ }),
432
+ T.Http({
433
+ method: "POST",
434
+ path: "/accounts/{account_id}/d1/database/{databaseId}/export",
435
+ }),
436
+ ) as unknown as Schema.Schema<ExportDatabaseRequest>;
437
+
438
+ export interface ExportDatabaseResponse {
439
+ /** The current time-travel bookmark for your D1, used to poll for updates. Will not change for the duration of the export task. */
440
+ atBookmark?: string | null;
441
+ /** Only present when status = 'error'. Contains the error message. */
442
+ error?: string | null;
443
+ /** Logs since the last time you polled */
444
+ messages?: string[] | null;
445
+ /** Only present when status = 'complete' */
446
+ result?: { filename?: string | null; signedUrl?: string | null } | null;
447
+ status?: "complete" | "error" | "active" | null;
448
+ success?: boolean | null;
449
+ type?: "export" | null;
450
+ }
451
+
452
+ export const ExportDatabaseResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
453
+ {
454
+ atBookmark: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
455
+ error: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
456
+ messages: Schema.optional(
457
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
458
+ ),
459
+ result: Schema.optional(
460
+ Schema.Union([
461
+ Schema.Struct({
462
+ filename: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
463
+ signedUrl: Schema.optional(
464
+ Schema.Union([Schema.String, Schema.Null]),
465
+ ),
466
+ }).pipe(
467
+ Schema.encodeKeys({ filename: "filename", signedUrl: "signed_url" }),
468
+ ),
469
+ Schema.Null,
470
+ ]),
471
+ ),
472
+ status: Schema.optional(
473
+ Schema.Union([
474
+ Schema.Literals(["complete", "error", "active"]),
475
+ Schema.Null,
476
+ ]),
477
+ ),
478
+ success: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
479
+ type: Schema.optional(
480
+ Schema.Union([Schema.Literal("export"), Schema.Null]),
481
+ ),
482
+ },
483
+ ).pipe(
484
+ Schema.encodeKeys({
485
+ atBookmark: "at_bookmark",
486
+ error: "error",
487
+ messages: "messages",
488
+ result: "result",
489
+ status: "status",
490
+ success: "success",
491
+ type: "type",
492
+ }),
493
+ ) as unknown as Schema.Schema<ExportDatabaseResponse>;
494
+
495
+ export type ExportDatabaseError =
496
+ | DefaultErrors
497
+ | InvalidObjectIdentifier
498
+ | InvalidRequest
499
+ | DatabaseNotFound;
500
+
501
+ export const exportDatabase: API.OperationMethod<
502
+ ExportDatabaseRequest,
503
+ ExportDatabaseResponse,
504
+ ExportDatabaseError,
505
+ Credentials | HttpClient.HttpClient
506
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
507
+ input: ExportDatabaseRequest,
508
+ output: ExportDatabaseResponse,
509
+ errors: [InvalidObjectIdentifier, InvalidRequest, DatabaseNotFound],
510
+ }));
511
+
512
+ export interface ImportDatabaseRequest {
513
+ databaseId: string;
514
+ /** Path param: Account identifier tag. */
515
+ accountId: string;
516
+ /** Body param: Indicates you have a new SQL file to upload. */
517
+ action: "init";
518
+ /** 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. */
519
+ etag: string;
520
+ }
521
+
522
+ export const ImportDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
523
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
524
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
525
+ action: Schema.Literal("init"),
526
+ etag: Schema.String,
527
+ }).pipe(
528
+ T.Http({
529
+ method: "POST",
530
+ path: "/accounts/{account_id}/d1/database/{databaseId}/import",
531
+ }),
532
+ ) as unknown as Schema.Schema<ImportDatabaseRequest>;
533
+
534
+ export interface ImportDatabaseResponse {
535
+ /** 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. */
536
+ atBookmark?: string | null;
537
+ /** Only present when status = 'error'. Contains the error message that prevented the import from succeeding. */
538
+ error?: string | null;
539
+ /** Derived from the database ID and etag, to use in avoiding repeated uploads. Only returned when for the 'init' action. */
540
+ filename?: string | null;
541
+ /** Logs since the last time you polled */
542
+ messages?: string[] | null;
543
+ /** Only present when status = 'complete' */
544
+ result?: {
545
+ finalBookmark?: string | null;
546
+ meta?: {
547
+ changedDb?: boolean | null;
548
+ changes?: number | null;
549
+ duration?: number | null;
550
+ lastRowId?: number | null;
551
+ rowsRead?: number | null;
552
+ rowsWritten?: number | null;
553
+ servedByColo?: string | null;
554
+ servedByPrimary?: boolean | null;
555
+ servedByRegion?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | null;
556
+ sizeAfter?: number | null;
557
+ timings?: { sqlDurationMs?: number | null } | null;
558
+ } | null;
559
+ numQueries?: number | null;
560
+ } | null;
561
+ status?: "complete" | "error" | null;
562
+ success?: boolean | null;
563
+ type?: "import" | null;
564
+ /** The R2 presigned URL to use for uploading. Only returned when for the 'init' action. */
565
+ uploadUrl?: string | null;
566
+ }
567
+
568
+ export const ImportDatabaseResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
569
+ {
570
+ atBookmark: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
571
+ error: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
572
+ filename: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
573
+ messages: Schema.optional(
574
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
575
+ ),
576
+ result: Schema.optional(
577
+ Schema.Union([
578
+ Schema.Struct({
579
+ finalBookmark: Schema.optional(
580
+ Schema.Union([Schema.String, Schema.Null]),
581
+ ),
582
+ meta: Schema.optional(
583
+ Schema.Union([
584
+ Schema.Struct({
585
+ changedDb: Schema.optional(
586
+ Schema.Union([Schema.Boolean, Schema.Null]),
587
+ ),
588
+ changes: Schema.optional(
589
+ Schema.Union([Schema.Number, Schema.Null]),
590
+ ),
591
+ duration: Schema.optional(
592
+ Schema.Union([Schema.Number, Schema.Null]),
593
+ ),
594
+ lastRowId: Schema.optional(
595
+ Schema.Union([Schema.Number, Schema.Null]),
596
+ ),
597
+ rowsRead: Schema.optional(
598
+ Schema.Union([Schema.Number, Schema.Null]),
599
+ ),
600
+ rowsWritten: Schema.optional(
601
+ Schema.Union([Schema.Number, Schema.Null]),
602
+ ),
603
+ servedByColo: Schema.optional(
604
+ Schema.Union([Schema.String, Schema.Null]),
605
+ ),
606
+ servedByPrimary: Schema.optional(
607
+ Schema.Union([Schema.Boolean, Schema.Null]),
608
+ ),
609
+ servedByRegion: Schema.optional(
610
+ Schema.Union([
611
+ Schema.Literals([
612
+ "WNAM",
613
+ "ENAM",
614
+ "WEUR",
615
+ "EEUR",
616
+ "APAC",
617
+ "OC",
618
+ ]),
619
+ Schema.Null,
620
+ ]),
621
+ ),
622
+ sizeAfter: Schema.optional(
623
+ Schema.Union([Schema.Number, Schema.Null]),
624
+ ),
625
+ timings: Schema.optional(
626
+ Schema.Union([
627
+ Schema.Struct({
628
+ sqlDurationMs: Schema.optional(
629
+ Schema.Union([Schema.Number, Schema.Null]),
630
+ ),
631
+ }).pipe(
632
+ Schema.encodeKeys({ sqlDurationMs: "sql_duration_ms" }),
633
+ ),
634
+ Schema.Null,
635
+ ]),
636
+ ),
637
+ }).pipe(
638
+ Schema.encodeKeys({
639
+ changedDb: "changed_db",
640
+ changes: "changes",
641
+ duration: "duration",
642
+ lastRowId: "last_row_id",
643
+ rowsRead: "rows_read",
644
+ rowsWritten: "rows_written",
645
+ servedByColo: "served_by_colo",
646
+ servedByPrimary: "served_by_primary",
647
+ servedByRegion: "served_by_region",
648
+ sizeAfter: "size_after",
649
+ timings: "timings",
650
+ }),
651
+ ),
652
+ Schema.Null,
653
+ ]),
654
+ ),
655
+ numQueries: Schema.optional(
656
+ Schema.Union([Schema.Number, Schema.Null]),
657
+ ),
658
+ }).pipe(
659
+ Schema.encodeKeys({
660
+ finalBookmark: "final_bookmark",
661
+ meta: "meta",
662
+ numQueries: "num_queries",
663
+ }),
664
+ ),
665
+ Schema.Null,
666
+ ]),
667
+ ),
668
+ status: Schema.optional(
669
+ Schema.Union([Schema.Literals(["complete", "error"]), Schema.Null]),
670
+ ),
671
+ success: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
672
+ type: Schema.optional(
673
+ Schema.Union([Schema.Literal("import"), Schema.Null]),
674
+ ),
675
+ uploadUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
676
+ },
677
+ ).pipe(
678
+ Schema.encodeKeys({
679
+ atBookmark: "at_bookmark",
680
+ error: "error",
681
+ filename: "filename",
682
+ messages: "messages",
683
+ result: "result",
684
+ status: "status",
685
+ success: "success",
686
+ type: "type",
687
+ uploadUrl: "upload_url",
688
+ }),
689
+ ) as unknown as Schema.Schema<ImportDatabaseResponse>;
690
+
691
+ export type ImportDatabaseError = DefaultErrors | InvalidObjectIdentifier;
692
+
693
+ export const importDatabase: API.OperationMethod<
694
+ ImportDatabaseRequest,
695
+ ImportDatabaseResponse,
696
+ ImportDatabaseError,
697
+ Credentials | HttpClient.HttpClient
698
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
699
+ input: ImportDatabaseRequest,
700
+ output: ImportDatabaseResponse,
701
+ errors: [InvalidObjectIdentifier],
702
+ }));
703
+
704
+ export interface QueryDatabaseRequest {
705
+ databaseId: string;
706
+ /** Path param: Account identifier tag. */
707
+ accountId: string;
708
+ /** Body param: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. */
709
+ sql: string;
710
+ /** Body param: */
711
+ params?: string[];
712
+ }
713
+
714
+ export const QueryDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
715
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
716
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
717
+ sql: Schema.String,
718
+ params: Schema.optional(Schema.Array(Schema.String)),
719
+ }).pipe(
720
+ T.Http({
721
+ method: "POST",
722
+ path: "/accounts/{account_id}/d1/database/{databaseId}/query",
723
+ }),
724
+ ) as unknown as Schema.Schema<QueryDatabaseRequest>;
725
+
726
+ export type QueryDatabaseResponse = {
727
+ meta?: {
728
+ changedDb?: boolean | null;
729
+ changes?: number | null;
730
+ duration?: number | null;
731
+ lastRowId?: number | null;
732
+ rowsRead?: number | null;
733
+ rowsWritten?: number | null;
734
+ servedByColo?: string | null;
735
+ servedByPrimary?: boolean | null;
736
+ servedByRegion?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | null;
737
+ sizeAfter?: number | null;
738
+ timings?: { sqlDurationMs?: number | null } | null;
739
+ } | null;
740
+ results?: unknown[] | null;
741
+ success?: boolean | null;
742
+ }[];
743
+
744
+ export const QueryDatabaseResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
745
+ Schema.Struct({
746
+ meta: Schema.optional(
747
+ Schema.Union([
748
+ Schema.Struct({
749
+ changedDb: Schema.optional(
750
+ Schema.Union([Schema.Boolean, Schema.Null]),
751
+ ),
752
+ changes: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
753
+ duration: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
754
+ lastRowId: Schema.optional(
755
+ Schema.Union([Schema.Number, Schema.Null]),
756
+ ),
757
+ rowsRead: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
758
+ rowsWritten: Schema.optional(
759
+ Schema.Union([Schema.Number, Schema.Null]),
760
+ ),
761
+ servedByColo: Schema.optional(
762
+ Schema.Union([Schema.String, Schema.Null]),
763
+ ),
764
+ servedByPrimary: Schema.optional(
765
+ Schema.Union([Schema.Boolean, Schema.Null]),
766
+ ),
767
+ servedByRegion: Schema.optional(
768
+ Schema.Union([
769
+ Schema.Literals(["WNAM", "ENAM", "WEUR", "EEUR", "APAC", "OC"]),
770
+ Schema.Null,
771
+ ]),
772
+ ),
773
+ sizeAfter: Schema.optional(
774
+ Schema.Union([Schema.Number, Schema.Null]),
775
+ ),
776
+ timings: Schema.optional(
777
+ Schema.Union([
778
+ Schema.Struct({
779
+ sqlDurationMs: Schema.optional(
780
+ Schema.Union([Schema.Number, Schema.Null]),
781
+ ),
782
+ }).pipe(Schema.encodeKeys({ sqlDurationMs: "sql_duration_ms" })),
783
+ Schema.Null,
784
+ ]),
785
+ ),
786
+ }).pipe(
787
+ Schema.encodeKeys({
788
+ changedDb: "changed_db",
789
+ changes: "changes",
790
+ duration: "duration",
791
+ lastRowId: "last_row_id",
792
+ rowsRead: "rows_read",
793
+ rowsWritten: "rows_written",
794
+ servedByColo: "served_by_colo",
795
+ servedByPrimary: "served_by_primary",
796
+ servedByRegion: "served_by_region",
797
+ sizeAfter: "size_after",
798
+ timings: "timings",
799
+ }),
800
+ ),
801
+ Schema.Null,
802
+ ]),
803
+ ),
804
+ results: Schema.optional(
805
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
806
+ ),
807
+ success: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
808
+ }),
809
+ ) as unknown as Schema.Schema<QueryDatabaseResponse>;
810
+
811
+ export type QueryDatabaseError = DefaultErrors;
812
+
813
+ export const queryDatabase: API.OperationMethod<
814
+ QueryDatabaseRequest,
815
+ QueryDatabaseResponse,
816
+ QueryDatabaseError,
817
+ Credentials | HttpClient.HttpClient
818
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
819
+ input: QueryDatabaseRequest,
820
+ output: QueryDatabaseResponse,
821
+ errors: [],
822
+ }));
823
+
824
+ export interface RawDatabaseRequest {
825
+ databaseId: string;
826
+ /** Path param: Account identifier tag. */
827
+ accountId: string;
828
+ /** Body param: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. */
829
+ sql: string;
830
+ /** Body param: */
831
+ params?: string[];
832
+ }
833
+
834
+ export const RawDatabaseRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
835
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
836
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
837
+ sql: Schema.String,
838
+ params: Schema.optional(Schema.Array(Schema.String)),
839
+ }).pipe(
840
+ T.Http({
841
+ method: "POST",
842
+ path: "/accounts/{account_id}/d1/database/{databaseId}/raw",
843
+ }),
844
+ ) as unknown as Schema.Schema<RawDatabaseRequest>;
845
+
846
+ export type RawDatabaseResponse = {
847
+ meta?: {
848
+ changedDb?: boolean | null;
849
+ changes?: number | null;
850
+ duration?: number | null;
851
+ lastRowId?: number | null;
852
+ rowsRead?: number | null;
853
+ rowsWritten?: number | null;
854
+ servedByColo?: string | null;
855
+ servedByPrimary?: boolean | null;
856
+ servedByRegion?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | null;
857
+ sizeAfter?: number | null;
858
+ timings?: { sqlDurationMs?: number | null } | null;
859
+ } | null;
860
+ results?: {
861
+ columns?: string[] | null;
862
+ rows?: (number | string)[][] | null;
863
+ } | null;
864
+ success?: boolean | null;
865
+ }[];
866
+
867
+ export const RawDatabaseResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
868
+ Schema.Struct({
869
+ meta: Schema.optional(
870
+ Schema.Union([
871
+ Schema.Struct({
872
+ changedDb: Schema.optional(
873
+ Schema.Union([Schema.Boolean, Schema.Null]),
874
+ ),
875
+ changes: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
876
+ duration: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
877
+ lastRowId: Schema.optional(
878
+ Schema.Union([Schema.Number, Schema.Null]),
879
+ ),
880
+ rowsRead: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
881
+ rowsWritten: Schema.optional(
882
+ Schema.Union([Schema.Number, Schema.Null]),
883
+ ),
884
+ servedByColo: Schema.optional(
885
+ Schema.Union([Schema.String, Schema.Null]),
886
+ ),
887
+ servedByPrimary: Schema.optional(
888
+ Schema.Union([Schema.Boolean, Schema.Null]),
889
+ ),
890
+ servedByRegion: Schema.optional(
891
+ Schema.Union([
892
+ Schema.Literals(["WNAM", "ENAM", "WEUR", "EEUR", "APAC", "OC"]),
893
+ Schema.Null,
894
+ ]),
895
+ ),
896
+ sizeAfter: Schema.optional(
897
+ Schema.Union([Schema.Number, Schema.Null]),
898
+ ),
899
+ timings: Schema.optional(
900
+ Schema.Union([
901
+ Schema.Struct({
902
+ sqlDurationMs: Schema.optional(
903
+ Schema.Union([Schema.Number, Schema.Null]),
904
+ ),
905
+ }).pipe(Schema.encodeKeys({ sqlDurationMs: "sql_duration_ms" })),
906
+ Schema.Null,
907
+ ]),
908
+ ),
909
+ }).pipe(
910
+ Schema.encodeKeys({
911
+ changedDb: "changed_db",
912
+ changes: "changes",
913
+ duration: "duration",
914
+ lastRowId: "last_row_id",
915
+ rowsRead: "rows_read",
916
+ rowsWritten: "rows_written",
917
+ servedByColo: "served_by_colo",
918
+ servedByPrimary: "served_by_primary",
919
+ servedByRegion: "served_by_region",
920
+ sizeAfter: "size_after",
921
+ timings: "timings",
922
+ }),
923
+ ),
924
+ Schema.Null,
925
+ ]),
926
+ ),
927
+ results: Schema.optional(
928
+ Schema.Union([
929
+ Schema.Struct({
930
+ columns: Schema.optional(
931
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
932
+ ),
933
+ rows: Schema.optional(
934
+ Schema.Union([
935
+ Schema.Array(
936
+ Schema.Array(Schema.Union([Schema.Number, Schema.String])),
937
+ ),
938
+ Schema.Null,
939
+ ]),
940
+ ),
941
+ }),
942
+ Schema.Null,
943
+ ]),
944
+ ),
945
+ success: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
946
+ }),
947
+ ) as unknown as Schema.Schema<RawDatabaseResponse>;
948
+
949
+ export type RawDatabaseError = DefaultErrors;
950
+
951
+ export const rawDatabase: API.OperationMethod<
952
+ RawDatabaseRequest,
953
+ RawDatabaseResponse,
954
+ RawDatabaseError,
955
+ Credentials | HttpClient.HttpClient
956
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
957
+ input: RawDatabaseRequest,
958
+ output: RawDatabaseResponse,
959
+ errors: [],
960
+ }));
961
+
962
+ // =============================================================================
963
+ // DatabaseTimeTravel
964
+ // =============================================================================
965
+
966
+ export interface RestoreDatabaseTimeTravelRequest {
967
+ databaseId: string;
968
+ /** Path param: Account identifier tag. */
969
+ accountId: string;
970
+ /** Query param: A bookmark to restore the database to. Required if `timestamp` is not provided. */
971
+ bookmark?: string;
972
+ /** Query param: An ISO 8601 timestamp to restore the database to. Required if `bookmark` is not provided. */
973
+ timestamp?: string;
974
+ }
975
+
976
+ export const RestoreDatabaseTimeTravelRequest =
977
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
978
+ databaseId: Schema.String.pipe(T.HttpPath("databaseId")),
979
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
980
+ bookmark: Schema.optional(Schema.String).pipe(T.HttpQuery("bookmark")),
981
+ timestamp: Schema.optional(Schema.String).pipe(T.HttpQuery("timestamp")),
982
+ }).pipe(
983
+ T.Http({
984
+ method: "POST",
985
+ path: "/accounts/{account_id}/d1/database/{databaseId}/time_travel/restore",
986
+ }),
987
+ ) as unknown as Schema.Schema<RestoreDatabaseTimeTravelRequest>;
988
+
989
+ export interface RestoreDatabaseTimeTravelResponse {
990
+ /** The new bookmark representing the state of the database after the restore operation. */
991
+ bookmark?: string | null;
992
+ /** A message describing the result of the restore operation. */
993
+ message?: string | null;
994
+ /** The bookmark representing the state of the database before the restore operation. Can be used to undo the restore if needed. */
995
+ previousBookmark?: string | null;
996
+ }
997
+
998
+ export const RestoreDatabaseTimeTravelResponse =
999
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1000
+ bookmark: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1001
+ message: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1002
+ previousBookmark: Schema.optional(
1003
+ Schema.Union([Schema.String, Schema.Null]),
1004
+ ),
1005
+ }).pipe(
1006
+ Schema.encodeKeys({
1007
+ bookmark: "bookmark",
1008
+ message: "message",
1009
+ previousBookmark: "previous_bookmark",
1010
+ }),
1011
+ ) as unknown as Schema.Schema<RestoreDatabaseTimeTravelResponse>;
1012
+
1013
+ export type RestoreDatabaseTimeTravelError =
1014
+ | DefaultErrors
1015
+ | InvalidObjectIdentifier
1016
+ | NoHistoryAvailable
1017
+ | DatabaseNotFound
1018
+ | InvalidProperty;
1019
+
1020
+ export const restoreDatabaseTimeTravel: API.OperationMethod<
1021
+ RestoreDatabaseTimeTravelRequest,
1022
+ RestoreDatabaseTimeTravelResponse,
1023
+ RestoreDatabaseTimeTravelError,
1024
+ Credentials | HttpClient.HttpClient
1025
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1026
+ input: RestoreDatabaseTimeTravelRequest,
1027
+ output: RestoreDatabaseTimeTravelResponse,
1028
+ errors: [
1029
+ InvalidObjectIdentifier,
1030
+ NoHistoryAvailable,
1031
+ DatabaseNotFound,
1032
+ InvalidProperty,
1033
+ ],
1034
+ }));