my personal site
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update gymtracker-ads-api: Add @cloudflare/workers-types dependency and enhance admin HTML layout

- Added @cloudflare/workers-types as a dev dependency in package.json and package-lock.json.
- Updated admin HTML to include Flatpickr styles and restructured the layout for better organization and usability, including a new schedule page and calendar integration.

+13466 -932
+6
workers/gymtracker-ads-api/env.d.ts
··· 1 + // Secrets (wrangler secret put) — not in wrangler.jsonc; augment generated Env 2 + 3 + interface Env { 4 + ADMIN_API_KEY?: string; 5 + POSTHOG_PERSONAL_API_KEY?: string; 6 + }
+549 -601
workers/gymtracker-ads-api/package-lock.json
··· 8 8 "name": "gymtracker-ads-api", 9 9 "version": "1.0.0", 10 10 "devDependencies": { 11 + "@types/node": "^25.5.0", 11 12 "typescript": "^5.0.0", 12 - "wrangler": "^3.0.0" 13 + "wrangler": "^4.76.0" 13 14 } 14 15 }, 15 16 "node_modules/@cloudflare/kv-asset-handler": { 16 - "version": "0.3.4", 17 - "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.3.4.tgz", 18 - "integrity": "sha512-YLPHc8yASwjNkmcDMQMY35yiWjoKAKnhUbPRszBRS0YgH+IXtsMp61j+yTcnCE3oO2DgP0U3iejLC8FTtKDC8Q==", 17 + "version": "0.4.2", 18 + "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.4.2.tgz", 19 + "integrity": "sha512-SIOD2DxrRRwQ+jgzlXCqoEFiKOFqaPjhnNTGKXSRLvp1HiOvapLaFG2kEr9dYQTYe8rKrd9uvDUzmAITeNyaHQ==", 19 20 "dev": true, 20 21 "license": "MIT OR Apache-2.0", 21 - "dependencies": { 22 - "mime": "^3.0.0" 23 - }, 24 22 "engines": { 25 - "node": ">=16.13" 23 + "node": ">=18.0.0" 26 24 } 27 25 }, 28 26 "node_modules/@cloudflare/unenv-preset": { 29 - "version": "2.0.2", 30 - "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.0.2.tgz", 31 - "integrity": "sha512-nyzYnlZjjV5xT3LizahG1Iu6mnrCaxglJ04rZLpDwlDVDZ7v46lNsfxhV3A/xtfgQuSHmLnc6SVI+KwBpc3Lwg==", 27 + "version": "2.16.0", 28 + "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.0.tgz", 29 + "integrity": "sha512-8ovsRpwzPoEqPUzoErAYVv8l3FMZNeBVQfJTvtzP4AgLSRGZISRfuChFxHWUQd3n6cnrwkuTGxT+2cGo8EsyYg==", 32 30 "dev": true, 33 31 "license": "MIT OR Apache-2.0", 34 32 "peerDependencies": { 35 - "unenv": "2.0.0-rc.14", 36 - "workerd": "^1.20250124.0" 33 + "unenv": "2.0.0-rc.24", 34 + "workerd": "1.20260301.1 || ~1.20260302.1 || ~1.20260303.1 || ~1.20260304.1 || >1.20260305.0 <2.0.0-0" 37 35 }, 38 36 "peerDependenciesMeta": { 39 37 "workerd": { ··· 42 40 } 43 41 }, 44 42 "node_modules/@cloudflare/workerd-darwin-64": { 45 - "version": "1.20250718.0", 46 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250718.0.tgz", 47 - "integrity": "sha512-FHf4t7zbVN8yyXgQ/r/GqLPaYZSGUVzeR7RnL28Mwj2djyw2ZergvytVc7fdGcczl6PQh+VKGfZCfUqpJlbi9g==", 43 + "version": "1.20260317.1", 44 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260317.1.tgz", 45 + "integrity": "sha512-8hjh3sPMwY8M/zedq3/sXoA2Q4BedlGufn3KOOleIG+5a4ReQKLlUah140D7J6zlKmYZAFMJ4tWC7hCuI/s79g==", 48 46 "cpu": [ 49 47 "x64" 50 48 ], ··· 59 57 } 60 58 }, 61 59 "node_modules/@cloudflare/workerd-darwin-arm64": { 62 - "version": "1.20250718.0", 63 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250718.0.tgz", 64 - "integrity": "sha512-fUiyUJYyqqp4NqJ0YgGtp4WJh/II/YZsUnEb6vVy5Oeas8lUOxnN+ZOJ8N/6/5LQCVAtYCChRiIrBbfhTn5Z8Q==", 60 + "version": "1.20260317.1", 61 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260317.1.tgz", 62 + "integrity": "sha512-M/MnNyvO5HMgoIdr3QHjdCj2T1ki9gt0vIUnxYxBu9ISXS/jgtMl6chUVPJ7zHYBn9MyYr8ByeN6frjYxj0MGg==", 65 63 "cpu": [ 66 64 "arm64" 67 65 ], ··· 76 74 } 77 75 }, 78 76 "node_modules/@cloudflare/workerd-linux-64": { 79 - "version": "1.20250718.0", 80 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250718.0.tgz", 81 - "integrity": "sha512-5+eb3rtJMiEwp08Kryqzzu8d1rUcK+gdE442auo5eniMpT170Dz0QxBrqkg2Z48SFUPYbj+6uknuA5tzdRSUSg==", 77 + "version": "1.20260317.1", 78 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260317.1.tgz", 79 + "integrity": "sha512-1ltuEjkRcS3fsVF7CxsKlWiRmzq2ZqMfqDN0qUOgbUwkpXsLVJsXmoblaLf5OP00ELlcgF0QsN0p2xPEua4Uug==", 82 80 "cpu": [ 83 81 "x64" 84 82 ], ··· 93 91 } 94 92 }, 95 93 "node_modules/@cloudflare/workerd-linux-arm64": { 96 - "version": "1.20250718.0", 97 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250718.0.tgz", 98 - "integrity": "sha512-Aa2M/DVBEBQDdATMbn217zCSFKE+ud/teS+fFS+OQqKABLn0azO2qq6ANAHYOIE6Q3Sq4CxDIQr8lGdaJHwUog==", 94 + "version": "1.20260317.1", 95 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260317.1.tgz", 96 + "integrity": "sha512-3QrNnPF1xlaNwkHpasvRvAMidOvQs2NhXQmALJrEfpIJ/IDL2la8g499yXp3eqhG3hVMCB07XVY149GTs42Xtw==", 99 97 "cpu": [ 100 98 "arm64" 101 99 ], ··· 110 108 } 111 109 }, 112 110 "node_modules/@cloudflare/workerd-windows-64": { 113 - "version": "1.20250718.0", 114 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250718.0.tgz", 115 - "integrity": "sha512-dY16RXKffmugnc67LTbyjdDHZn5NoTF1yHEf2fN4+OaOnoGSp3N1x77QubTDwqZ9zECWxgQfDLjddcH8dWeFhg==", 111 + "version": "1.20260317.1", 112 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260317.1.tgz", 113 + "integrity": "sha512-MfZTz+7LfuIpMGTa3RLXHX8Z/pnycZLItn94WRdHr8LPVet+C5/1Nzei399w/jr3+kzT4pDKk26JF/tlI5elpQ==", 116 114 "cpu": [ 117 115 "x64" 118 116 ], ··· 126 124 "node": ">=16" 127 125 } 128 126 }, 127 + "node_modules/@cloudflare/workers-types": { 128 + "version": "4.20260317.1", 129 + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20260317.1.tgz", 130 + "integrity": "sha512-+G4eVwyCpm8Au1ex8vQBCuA9wnwqetz4tPNRoB/53qvktERWBRMQnrtvC1k584yRE3emMThtuY0gWshvSJ++PQ==", 131 + "dev": true, 132 + "license": "MIT OR Apache-2.0", 133 + "optional": true, 134 + "peer": true 135 + }, 129 136 "node_modules/@cspotcode/source-map-support": { 130 137 "version": "0.8.1", 131 138 "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", ··· 150 157 "tslib": "^2.4.0" 151 158 } 152 159 }, 153 - "node_modules/@esbuild-plugins/node-globals-polyfill": { 154 - "version": "0.2.3", 155 - "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.2.3.tgz", 156 - "integrity": "sha512-r3MIryXDeXDOZh7ih1l/yE9ZLORCd5e8vWg02azWRGj5SPTuoh69A2AIyn0Z31V/kHBfZ4HgWJ+OK3GTTwLmnw==", 157 - "dev": true, 158 - "license": "ISC", 159 - "peerDependencies": { 160 - "esbuild": "*" 161 - } 162 - }, 163 - "node_modules/@esbuild-plugins/node-modules-polyfill": { 164 - "version": "0.2.2", 165 - "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.2.2.tgz", 166 - "integrity": "sha512-LXV7QsWJxRuMYvKbiznh+U1ilIop3g2TeKRzUxOG5X3YITc8JyyTa90BmLwqqv0YnX4v32CSlG+vsziZp9dMvA==", 160 + "node_modules/@esbuild/aix-ppc64": { 161 + "version": "0.27.3", 162 + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", 163 + "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", 164 + "cpu": [ 165 + "ppc64" 166 + ], 167 167 "dev": true, 168 - "license": "ISC", 169 - "dependencies": { 170 - "escape-string-regexp": "^4.0.0", 171 - "rollup-plugin-node-polyfills": "^0.2.1" 172 - }, 173 - "peerDependencies": { 174 - "esbuild": "*" 168 + "license": "MIT", 169 + "optional": true, 170 + "os": [ 171 + "aix" 172 + ], 173 + "engines": { 174 + "node": ">=18" 175 175 } 176 176 }, 177 177 "node_modules/@esbuild/android-arm": { 178 - "version": "0.17.19", 179 - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", 180 - "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", 178 + "version": "0.27.3", 179 + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", 180 + "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", 181 181 "cpu": [ 182 182 "arm" 183 183 ], ··· 188 188 "android" 189 189 ], 190 190 "engines": { 191 - "node": ">=12" 191 + "node": ">=18" 192 192 } 193 193 }, 194 194 "node_modules/@esbuild/android-arm64": { 195 - "version": "0.17.19", 196 - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", 197 - "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", 195 + "version": "0.27.3", 196 + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", 197 + "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", 198 198 "cpu": [ 199 199 "arm64" 200 200 ], ··· 205 205 "android" 206 206 ], 207 207 "engines": { 208 - "node": ">=12" 208 + "node": ">=18" 209 209 } 210 210 }, 211 211 "node_modules/@esbuild/android-x64": { 212 - "version": "0.17.19", 213 - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", 214 - "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", 212 + "version": "0.27.3", 213 + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", 214 + "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", 215 215 "cpu": [ 216 216 "x64" 217 217 ], ··· 222 222 "android" 223 223 ], 224 224 "engines": { 225 - "node": ">=12" 225 + "node": ">=18" 226 226 } 227 227 }, 228 228 "node_modules/@esbuild/darwin-arm64": { 229 - "version": "0.17.19", 230 - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", 231 - "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", 229 + "version": "0.27.3", 230 + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", 231 + "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", 232 232 "cpu": [ 233 233 "arm64" 234 234 ], ··· 239 239 "darwin" 240 240 ], 241 241 "engines": { 242 - "node": ">=12" 242 + "node": ">=18" 243 243 } 244 244 }, 245 245 "node_modules/@esbuild/darwin-x64": { 246 - "version": "0.17.19", 247 - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", 248 - "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", 246 + "version": "0.27.3", 247 + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", 248 + "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", 249 249 "cpu": [ 250 250 "x64" 251 251 ], ··· 256 256 "darwin" 257 257 ], 258 258 "engines": { 259 - "node": ">=12" 259 + "node": ">=18" 260 260 } 261 261 }, 262 262 "node_modules/@esbuild/freebsd-arm64": { 263 - "version": "0.17.19", 264 - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", 265 - "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", 263 + "version": "0.27.3", 264 + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", 265 + "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", 266 266 "cpu": [ 267 267 "arm64" 268 268 ], ··· 273 273 "freebsd" 274 274 ], 275 275 "engines": { 276 - "node": ">=12" 276 + "node": ">=18" 277 277 } 278 278 }, 279 279 "node_modules/@esbuild/freebsd-x64": { 280 - "version": "0.17.19", 281 - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", 282 - "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", 280 + "version": "0.27.3", 281 + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", 282 + "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", 283 283 "cpu": [ 284 284 "x64" 285 285 ], ··· 290 290 "freebsd" 291 291 ], 292 292 "engines": { 293 - "node": ">=12" 293 + "node": ">=18" 294 294 } 295 295 }, 296 296 "node_modules/@esbuild/linux-arm": { 297 - "version": "0.17.19", 298 - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", 299 - "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", 297 + "version": "0.27.3", 298 + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", 299 + "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", 300 300 "cpu": [ 301 301 "arm" 302 302 ], ··· 307 307 "linux" 308 308 ], 309 309 "engines": { 310 - "node": ">=12" 310 + "node": ">=18" 311 311 } 312 312 }, 313 313 "node_modules/@esbuild/linux-arm64": { 314 - "version": "0.17.19", 315 - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", 316 - "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", 314 + "version": "0.27.3", 315 + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", 316 + "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", 317 317 "cpu": [ 318 318 "arm64" 319 319 ], ··· 324 324 "linux" 325 325 ], 326 326 "engines": { 327 - "node": ">=12" 327 + "node": ">=18" 328 328 } 329 329 }, 330 330 "node_modules/@esbuild/linux-ia32": { 331 - "version": "0.17.19", 332 - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", 333 - "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", 331 + "version": "0.27.3", 332 + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", 333 + "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", 334 334 "cpu": [ 335 335 "ia32" 336 336 ], ··· 341 341 "linux" 342 342 ], 343 343 "engines": { 344 - "node": ">=12" 344 + "node": ">=18" 345 345 } 346 346 }, 347 347 "node_modules/@esbuild/linux-loong64": { 348 - "version": "0.17.19", 349 - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", 350 - "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", 348 + "version": "0.27.3", 349 + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", 350 + "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", 351 351 "cpu": [ 352 352 "loong64" 353 353 ], ··· 358 358 "linux" 359 359 ], 360 360 "engines": { 361 - "node": ">=12" 361 + "node": ">=18" 362 362 } 363 363 }, 364 364 "node_modules/@esbuild/linux-mips64el": { 365 - "version": "0.17.19", 366 - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", 367 - "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", 365 + "version": "0.27.3", 366 + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", 367 + "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", 368 368 "cpu": [ 369 369 "mips64el" 370 370 ], ··· 375 375 "linux" 376 376 ], 377 377 "engines": { 378 - "node": ">=12" 378 + "node": ">=18" 379 379 } 380 380 }, 381 381 "node_modules/@esbuild/linux-ppc64": { 382 - "version": "0.17.19", 383 - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", 384 - "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", 382 + "version": "0.27.3", 383 + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", 384 + "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", 385 385 "cpu": [ 386 386 "ppc64" 387 387 ], ··· 392 392 "linux" 393 393 ], 394 394 "engines": { 395 - "node": ">=12" 395 + "node": ">=18" 396 396 } 397 397 }, 398 398 "node_modules/@esbuild/linux-riscv64": { 399 - "version": "0.17.19", 400 - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", 401 - "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", 399 + "version": "0.27.3", 400 + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", 401 + "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", 402 402 "cpu": [ 403 403 "riscv64" 404 404 ], ··· 409 409 "linux" 410 410 ], 411 411 "engines": { 412 - "node": ">=12" 412 + "node": ">=18" 413 413 } 414 414 }, 415 415 "node_modules/@esbuild/linux-s390x": { 416 - "version": "0.17.19", 417 - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", 418 - "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", 416 + "version": "0.27.3", 417 + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", 418 + "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", 419 419 "cpu": [ 420 420 "s390x" 421 421 ], ··· 426 426 "linux" 427 427 ], 428 428 "engines": { 429 - "node": ">=12" 429 + "node": ">=18" 430 430 } 431 431 }, 432 432 "node_modules/@esbuild/linux-x64": { 433 - "version": "0.17.19", 434 - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", 435 - "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", 433 + "version": "0.27.3", 434 + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", 435 + "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", 436 436 "cpu": [ 437 437 "x64" 438 438 ], ··· 443 443 "linux" 444 444 ], 445 445 "engines": { 446 - "node": ">=12" 446 + "node": ">=18" 447 + } 448 + }, 449 + "node_modules/@esbuild/netbsd-arm64": { 450 + "version": "0.27.3", 451 + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", 452 + "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", 453 + "cpu": [ 454 + "arm64" 455 + ], 456 + "dev": true, 457 + "license": "MIT", 458 + "optional": true, 459 + "os": [ 460 + "netbsd" 461 + ], 462 + "engines": { 463 + "node": ">=18" 447 464 } 448 465 }, 449 466 "node_modules/@esbuild/netbsd-x64": { 450 - "version": "0.17.19", 451 - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", 452 - "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", 467 + "version": "0.27.3", 468 + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", 469 + "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", 453 470 "cpu": [ 454 471 "x64" 455 472 ], ··· 460 477 "netbsd" 461 478 ], 462 479 "engines": { 463 - "node": ">=12" 480 + "node": ">=18" 481 + } 482 + }, 483 + "node_modules/@esbuild/openbsd-arm64": { 484 + "version": "0.27.3", 485 + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", 486 + "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", 487 + "cpu": [ 488 + "arm64" 489 + ], 490 + "dev": true, 491 + "license": "MIT", 492 + "optional": true, 493 + "os": [ 494 + "openbsd" 495 + ], 496 + "engines": { 497 + "node": ">=18" 464 498 } 465 499 }, 466 500 "node_modules/@esbuild/openbsd-x64": { 467 - "version": "0.17.19", 468 - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", 469 - "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", 501 + "version": "0.27.3", 502 + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", 503 + "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", 470 504 "cpu": [ 471 505 "x64" 472 506 ], ··· 477 511 "openbsd" 478 512 ], 479 513 "engines": { 480 - "node": ">=12" 514 + "node": ">=18" 515 + } 516 + }, 517 + "node_modules/@esbuild/openharmony-arm64": { 518 + "version": "0.27.3", 519 + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", 520 + "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", 521 + "cpu": [ 522 + "arm64" 523 + ], 524 + "dev": true, 525 + "license": "MIT", 526 + "optional": true, 527 + "os": [ 528 + "openharmony" 529 + ], 530 + "engines": { 531 + "node": ">=18" 481 532 } 482 533 }, 483 534 "node_modules/@esbuild/sunos-x64": { 484 - "version": "0.17.19", 485 - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", 486 - "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", 535 + "version": "0.27.3", 536 + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", 537 + "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", 487 538 "cpu": [ 488 539 "x64" 489 540 ], ··· 494 545 "sunos" 495 546 ], 496 547 "engines": { 497 - "node": ">=12" 548 + "node": ">=18" 498 549 } 499 550 }, 500 551 "node_modules/@esbuild/win32-arm64": { 501 - "version": "0.17.19", 502 - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", 503 - "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", 552 + "version": "0.27.3", 553 + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", 554 + "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", 504 555 "cpu": [ 505 556 "arm64" 506 557 ], ··· 511 562 "win32" 512 563 ], 513 564 "engines": { 514 - "node": ">=12" 565 + "node": ">=18" 515 566 } 516 567 }, 517 568 "node_modules/@esbuild/win32-ia32": { 518 - "version": "0.17.19", 519 - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", 520 - "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", 569 + "version": "0.27.3", 570 + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", 571 + "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", 521 572 "cpu": [ 522 573 "ia32" 523 574 ], ··· 528 579 "win32" 529 580 ], 530 581 "engines": { 531 - "node": ">=12" 582 + "node": ">=18" 532 583 } 533 584 }, 534 585 "node_modules/@esbuild/win32-x64": { 535 - "version": "0.17.19", 536 - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", 537 - "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", 586 + "version": "0.27.3", 587 + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", 588 + "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", 538 589 "cpu": [ 539 590 "x64" 540 591 ], ··· 545 596 "win32" 546 597 ], 547 598 "engines": { 548 - "node": ">=12" 599 + "node": ">=18" 549 600 } 550 601 }, 551 - "node_modules/@fastify/busboy": { 552 - "version": "2.1.1", 553 - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", 554 - "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", 602 + "node_modules/@img/colour": { 603 + "version": "1.1.0", 604 + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", 605 + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", 555 606 "dev": true, 556 607 "license": "MIT", 557 608 "engines": { 558 - "node": ">=14" 609 + "node": ">=18" 559 610 } 560 611 }, 561 612 "node_modules/@img/sharp-darwin-arm64": { 562 - "version": "0.33.5", 563 - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", 564 - "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", 613 + "version": "0.34.5", 614 + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", 615 + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", 565 616 "cpu": [ 566 617 "arm64" 567 618 ], ··· 578 629 "url": "https://opencollective.com/libvips" 579 630 }, 580 631 "optionalDependencies": { 581 - "@img/sharp-libvips-darwin-arm64": "1.0.4" 632 + "@img/sharp-libvips-darwin-arm64": "1.2.4" 582 633 } 583 634 }, 584 635 "node_modules/@img/sharp-darwin-x64": { 585 - "version": "0.33.5", 586 - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", 587 - "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", 636 + "version": "0.34.5", 637 + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", 638 + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", 588 639 "cpu": [ 589 640 "x64" 590 641 ], ··· 601 652 "url": "https://opencollective.com/libvips" 602 653 }, 603 654 "optionalDependencies": { 604 - "@img/sharp-libvips-darwin-x64": "1.0.4" 655 + "@img/sharp-libvips-darwin-x64": "1.2.4" 605 656 } 606 657 }, 607 658 "node_modules/@img/sharp-libvips-darwin-arm64": { 608 - "version": "1.0.4", 609 - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", 610 - "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", 659 + "version": "1.2.4", 660 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", 661 + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", 611 662 "cpu": [ 612 663 "arm64" 613 664 ], ··· 622 673 } 623 674 }, 624 675 "node_modules/@img/sharp-libvips-darwin-x64": { 625 - "version": "1.0.4", 626 - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", 627 - "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", 676 + "version": "1.2.4", 677 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", 678 + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", 628 679 "cpu": [ 629 680 "x64" 630 681 ], ··· 639 690 } 640 691 }, 641 692 "node_modules/@img/sharp-libvips-linux-arm": { 642 - "version": "1.0.5", 643 - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", 644 - "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", 693 + "version": "1.2.4", 694 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", 695 + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", 645 696 "cpu": [ 646 697 "arm" 647 698 ], ··· 656 707 } 657 708 }, 658 709 "node_modules/@img/sharp-libvips-linux-arm64": { 659 - "version": "1.0.4", 660 - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", 661 - "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", 710 + "version": "1.2.4", 711 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", 712 + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", 662 713 "cpu": [ 663 714 "arm64" 664 715 ], ··· 672 723 "url": "https://opencollective.com/libvips" 673 724 } 674 725 }, 726 + "node_modules/@img/sharp-libvips-linux-ppc64": { 727 + "version": "1.2.4", 728 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", 729 + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", 730 + "cpu": [ 731 + "ppc64" 732 + ], 733 + "dev": true, 734 + "license": "LGPL-3.0-or-later", 735 + "optional": true, 736 + "os": [ 737 + "linux" 738 + ], 739 + "funding": { 740 + "url": "https://opencollective.com/libvips" 741 + } 742 + }, 743 + "node_modules/@img/sharp-libvips-linux-riscv64": { 744 + "version": "1.2.4", 745 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", 746 + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", 747 + "cpu": [ 748 + "riscv64" 749 + ], 750 + "dev": true, 751 + "license": "LGPL-3.0-or-later", 752 + "optional": true, 753 + "os": [ 754 + "linux" 755 + ], 756 + "funding": { 757 + "url": "https://opencollective.com/libvips" 758 + } 759 + }, 675 760 "node_modules/@img/sharp-libvips-linux-s390x": { 676 - "version": "1.0.4", 677 - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", 678 - "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", 761 + "version": "1.2.4", 762 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", 763 + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", 679 764 "cpu": [ 680 765 "s390x" 681 766 ], ··· 690 775 } 691 776 }, 692 777 "node_modules/@img/sharp-libvips-linux-x64": { 693 - "version": "1.0.4", 694 - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", 695 - "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", 778 + "version": "1.2.4", 779 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", 780 + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", 696 781 "cpu": [ 697 782 "x64" 698 783 ], ··· 707 792 } 708 793 }, 709 794 "node_modules/@img/sharp-libvips-linuxmusl-arm64": { 710 - "version": "1.0.4", 711 - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", 712 - "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", 795 + "version": "1.2.4", 796 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", 797 + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", 713 798 "cpu": [ 714 799 "arm64" 715 800 ], ··· 724 809 } 725 810 }, 726 811 "node_modules/@img/sharp-libvips-linuxmusl-x64": { 727 - "version": "1.0.4", 728 - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", 729 - "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", 812 + "version": "1.2.4", 813 + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", 814 + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", 730 815 "cpu": [ 731 816 "x64" 732 817 ], ··· 741 826 } 742 827 }, 743 828 "node_modules/@img/sharp-linux-arm": { 744 - "version": "0.33.5", 745 - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", 746 - "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", 829 + "version": "0.34.5", 830 + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", 831 + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", 747 832 "cpu": [ 748 833 "arm" 749 834 ], ··· 760 845 "url": "https://opencollective.com/libvips" 761 846 }, 762 847 "optionalDependencies": { 763 - "@img/sharp-libvips-linux-arm": "1.0.5" 848 + "@img/sharp-libvips-linux-arm": "1.2.4" 764 849 } 765 850 }, 766 851 "node_modules/@img/sharp-linux-arm64": { 767 - "version": "0.33.5", 768 - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", 769 - "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", 852 + "version": "0.34.5", 853 + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", 854 + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", 770 855 "cpu": [ 771 856 "arm64" 772 857 ], ··· 783 868 "url": "https://opencollective.com/libvips" 784 869 }, 785 870 "optionalDependencies": { 786 - "@img/sharp-libvips-linux-arm64": "1.0.4" 871 + "@img/sharp-libvips-linux-arm64": "1.2.4" 872 + } 873 + }, 874 + "node_modules/@img/sharp-linux-ppc64": { 875 + "version": "0.34.5", 876 + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", 877 + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", 878 + "cpu": [ 879 + "ppc64" 880 + ], 881 + "dev": true, 882 + "license": "Apache-2.0", 883 + "optional": true, 884 + "os": [ 885 + "linux" 886 + ], 887 + "engines": { 888 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 889 + }, 890 + "funding": { 891 + "url": "https://opencollective.com/libvips" 892 + }, 893 + "optionalDependencies": { 894 + "@img/sharp-libvips-linux-ppc64": "1.2.4" 895 + } 896 + }, 897 + "node_modules/@img/sharp-linux-riscv64": { 898 + "version": "0.34.5", 899 + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", 900 + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", 901 + "cpu": [ 902 + "riscv64" 903 + ], 904 + "dev": true, 905 + "license": "Apache-2.0", 906 + "optional": true, 907 + "os": [ 908 + "linux" 909 + ], 910 + "engines": { 911 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 912 + }, 913 + "funding": { 914 + "url": "https://opencollective.com/libvips" 915 + }, 916 + "optionalDependencies": { 917 + "@img/sharp-libvips-linux-riscv64": "1.2.4" 787 918 } 788 919 }, 789 920 "node_modules/@img/sharp-linux-s390x": { 790 - "version": "0.33.5", 791 - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", 792 - "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", 921 + "version": "0.34.5", 922 + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", 923 + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", 793 924 "cpu": [ 794 925 "s390x" 795 926 ], ··· 806 937 "url": "https://opencollective.com/libvips" 807 938 }, 808 939 "optionalDependencies": { 809 - "@img/sharp-libvips-linux-s390x": "1.0.4" 940 + "@img/sharp-libvips-linux-s390x": "1.2.4" 810 941 } 811 942 }, 812 943 "node_modules/@img/sharp-linux-x64": { 813 - "version": "0.33.5", 814 - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", 815 - "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", 944 + "version": "0.34.5", 945 + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", 946 + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", 816 947 "cpu": [ 817 948 "x64" 818 949 ], ··· 829 960 "url": "https://opencollective.com/libvips" 830 961 }, 831 962 "optionalDependencies": { 832 - "@img/sharp-libvips-linux-x64": "1.0.4" 963 + "@img/sharp-libvips-linux-x64": "1.2.4" 833 964 } 834 965 }, 835 966 "node_modules/@img/sharp-linuxmusl-arm64": { 836 - "version": "0.33.5", 837 - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", 838 - "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", 967 + "version": "0.34.5", 968 + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", 969 + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", 839 970 "cpu": [ 840 971 "arm64" 841 972 ], ··· 852 983 "url": "https://opencollective.com/libvips" 853 984 }, 854 985 "optionalDependencies": { 855 - "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" 986 + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" 856 987 } 857 988 }, 858 989 "node_modules/@img/sharp-linuxmusl-x64": { 859 - "version": "0.33.5", 860 - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", 861 - "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", 990 + "version": "0.34.5", 991 + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", 992 + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", 862 993 "cpu": [ 863 994 "x64" 864 995 ], ··· 875 1006 "url": "https://opencollective.com/libvips" 876 1007 }, 877 1008 "optionalDependencies": { 878 - "@img/sharp-libvips-linuxmusl-x64": "1.0.4" 1009 + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" 879 1010 } 880 1011 }, 881 1012 "node_modules/@img/sharp-wasm32": { 882 - "version": "0.33.5", 883 - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", 884 - "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", 1013 + "version": "0.34.5", 1014 + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", 1015 + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", 885 1016 "cpu": [ 886 1017 "wasm32" 887 1018 ], ··· 889 1020 "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", 890 1021 "optional": true, 891 1022 "dependencies": { 892 - "@emnapi/runtime": "^1.2.0" 1023 + "@emnapi/runtime": "^1.7.0" 893 1024 }, 894 1025 "engines": { 895 1026 "node": "^18.17.0 || ^20.3.0 || >=21.0.0" ··· 898 1029 "url": "https://opencollective.com/libvips" 899 1030 } 900 1031 }, 1032 + "node_modules/@img/sharp-win32-arm64": { 1033 + "version": "0.34.5", 1034 + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", 1035 + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", 1036 + "cpu": [ 1037 + "arm64" 1038 + ], 1039 + "dev": true, 1040 + "license": "Apache-2.0 AND LGPL-3.0-or-later", 1041 + "optional": true, 1042 + "os": [ 1043 + "win32" 1044 + ], 1045 + "engines": { 1046 + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 1047 + }, 1048 + "funding": { 1049 + "url": "https://opencollective.com/libvips" 1050 + } 1051 + }, 901 1052 "node_modules/@img/sharp-win32-ia32": { 902 - "version": "0.33.5", 903 - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", 904 - "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", 1053 + "version": "0.34.5", 1054 + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", 1055 + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", 905 1056 "cpu": [ 906 1057 "ia32" 907 1058 ], ··· 919 1070 } 920 1071 }, 921 1072 "node_modules/@img/sharp-win32-x64": { 922 - "version": "0.33.5", 923 - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", 924 - "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", 1073 + "version": "0.34.5", 1074 + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", 1075 + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", 925 1076 "cpu": [ 926 1077 "x64" 927 1078 ], ··· 966 1117 "@jridgewell/sourcemap-codec": "^1.4.10" 967 1118 } 968 1119 }, 969 - "node_modules/acorn": { 970 - "version": "8.14.0", 971 - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", 972 - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", 973 - "dev": true, 974 - "license": "MIT", 975 - "bin": { 976 - "acorn": "bin/acorn" 977 - }, 978 - "engines": { 979 - "node": ">=0.4.0" 980 - } 981 - }, 982 - "node_modules/acorn-walk": { 983 - "version": "8.3.2", 984 - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", 985 - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", 1120 + "node_modules/@poppinss/colors": { 1121 + "version": "4.1.6", 1122 + "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", 1123 + "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", 986 1124 "dev": true, 987 1125 "license": "MIT", 988 - "engines": { 989 - "node": ">=0.4.0" 1126 + "dependencies": { 1127 + "kleur": "^4.1.5" 990 1128 } 991 1129 }, 992 - "node_modules/as-table": { 993 - "version": "1.0.55", 994 - "resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz", 995 - "integrity": "sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==", 1130 + "node_modules/@poppinss/dumper": { 1131 + "version": "0.6.5", 1132 + "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz", 1133 + "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==", 996 1134 "dev": true, 997 1135 "license": "MIT", 998 1136 "dependencies": { 999 - "printable-characters": "^1.0.42" 1137 + "@poppinss/colors": "^4.1.5", 1138 + "@sindresorhus/is": "^7.0.2", 1139 + "supports-color": "^10.0.0" 1000 1140 } 1001 1141 }, 1002 - "node_modules/blake3-wasm": { 1003 - "version": "2.1.5", 1004 - "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", 1005 - "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", 1142 + "node_modules/@poppinss/exception": { 1143 + "version": "1.2.3", 1144 + "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", 1145 + "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", 1006 1146 "dev": true, 1007 1147 "license": "MIT" 1008 1148 }, 1009 - "node_modules/color": { 1010 - "version": "4.2.3", 1011 - "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", 1012 - "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", 1149 + "node_modules/@sindresorhus/is": { 1150 + "version": "7.2.0", 1151 + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz", 1152 + "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==", 1013 1153 "dev": true, 1014 1154 "license": "MIT", 1015 - "optional": true, 1016 - "dependencies": { 1017 - "color-convert": "^2.0.1", 1018 - "color-string": "^1.9.0" 1019 - }, 1020 1155 "engines": { 1021 - "node": ">=12.5.0" 1022 - } 1023 - }, 1024 - "node_modules/color-convert": { 1025 - "version": "2.0.1", 1026 - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 1027 - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 1028 - "dev": true, 1029 - "license": "MIT", 1030 - "optional": true, 1031 - "dependencies": { 1032 - "color-name": "~1.1.4" 1156 + "node": ">=18" 1033 1157 }, 1034 - "engines": { 1035 - "node": ">=7.0.0" 1158 + "funding": { 1159 + "url": "https://github.com/sindresorhus/is?sponsor=1" 1036 1160 } 1037 1161 }, 1038 - "node_modules/color-name": { 1039 - "version": "1.1.4", 1040 - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 1041 - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 1162 + "node_modules/@speed-highlight/core": { 1163 + "version": "1.2.15", 1164 + "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.15.tgz", 1165 + "integrity": "sha512-BMq1K3DsElxDWawkX6eLg9+CKJrTVGCBAWVuHXVUV2u0s2711qiChLSId6ikYPfxhdYocLNt3wWwSvDiTvFabw==", 1042 1166 "dev": true, 1043 - "license": "MIT", 1044 - "optional": true 1167 + "license": "CC0-1.0" 1045 1168 }, 1046 - "node_modules/color-string": { 1047 - "version": "1.9.1", 1048 - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", 1049 - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", 1169 + "node_modules/@types/node": { 1170 + "version": "25.5.0", 1171 + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz", 1172 + "integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==", 1050 1173 "dev": true, 1051 1174 "license": "MIT", 1052 - "optional": true, 1053 1175 "dependencies": { 1054 - "color-name": "^1.0.0", 1055 - "simple-swizzle": "^0.2.2" 1176 + "undici-types": "~7.18.0" 1056 1177 } 1057 1178 }, 1179 + "node_modules/blake3-wasm": { 1180 + "version": "2.1.5", 1181 + "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", 1182 + "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", 1183 + "dev": true, 1184 + "license": "MIT" 1185 + }, 1058 1186 "node_modules/cookie": { 1059 - "version": "0.7.2", 1060 - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", 1061 - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", 1187 + "version": "1.1.1", 1188 + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", 1189 + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", 1062 1190 "dev": true, 1063 1191 "license": "MIT", 1064 1192 "engines": { 1065 - "node": ">= 0.6" 1193 + "node": ">=18" 1194 + }, 1195 + "funding": { 1196 + "type": "opencollective", 1197 + "url": "https://opencollective.com/express" 1066 1198 } 1067 1199 }, 1068 - "node_modules/data-uri-to-buffer": { 1069 - "version": "2.0.2", 1070 - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-2.0.2.tgz", 1071 - "integrity": "sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==", 1072 - "dev": true, 1073 - "license": "MIT" 1074 - }, 1075 - "node_modules/defu": { 1076 - "version": "6.1.4", 1077 - "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", 1078 - "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", 1079 - "dev": true, 1080 - "license": "MIT" 1081 - }, 1082 1200 "node_modules/detect-libc": { 1083 1201 "version": "2.1.2", 1084 1202 "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", 1085 1203 "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", 1086 1204 "dev": true, 1087 1205 "license": "Apache-2.0", 1088 - "optional": true, 1089 1206 "engines": { 1090 1207 "node": ">=8" 1091 1208 } 1092 1209 }, 1210 + "node_modules/error-stack-parser-es": { 1211 + "version": "1.0.5", 1212 + "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz", 1213 + "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==", 1214 + "dev": true, 1215 + "license": "MIT", 1216 + "funding": { 1217 + "url": "https://github.com/sponsors/antfu" 1218 + } 1219 + }, 1093 1220 "node_modules/esbuild": { 1094 - "version": "0.17.19", 1095 - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", 1096 - "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", 1221 + "version": "0.27.3", 1222 + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", 1223 + "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", 1097 1224 "dev": true, 1098 1225 "hasInstallScript": true, 1099 1226 "license": "MIT", ··· 1101 1228 "esbuild": "bin/esbuild" 1102 1229 }, 1103 1230 "engines": { 1104 - "node": ">=12" 1231 + "node": ">=18" 1105 1232 }, 1106 1233 "optionalDependencies": { 1107 - "@esbuild/android-arm": "0.17.19", 1108 - "@esbuild/android-arm64": "0.17.19", 1109 - "@esbuild/android-x64": "0.17.19", 1110 - "@esbuild/darwin-arm64": "0.17.19", 1111 - "@esbuild/darwin-x64": "0.17.19", 1112 - "@esbuild/freebsd-arm64": "0.17.19", 1113 - "@esbuild/freebsd-x64": "0.17.19", 1114 - "@esbuild/linux-arm": "0.17.19", 1115 - "@esbuild/linux-arm64": "0.17.19", 1116 - "@esbuild/linux-ia32": "0.17.19", 1117 - "@esbuild/linux-loong64": "0.17.19", 1118 - "@esbuild/linux-mips64el": "0.17.19", 1119 - "@esbuild/linux-ppc64": "0.17.19", 1120 - "@esbuild/linux-riscv64": "0.17.19", 1121 - "@esbuild/linux-s390x": "0.17.19", 1122 - "@esbuild/linux-x64": "0.17.19", 1123 - "@esbuild/netbsd-x64": "0.17.19", 1124 - "@esbuild/openbsd-x64": "0.17.19", 1125 - "@esbuild/sunos-x64": "0.17.19", 1126 - "@esbuild/win32-arm64": "0.17.19", 1127 - "@esbuild/win32-ia32": "0.17.19", 1128 - "@esbuild/win32-x64": "0.17.19" 1129 - } 1130 - }, 1131 - "node_modules/escape-string-regexp": { 1132 - "version": "4.0.0", 1133 - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 1134 - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 1135 - "dev": true, 1136 - "license": "MIT", 1137 - "engines": { 1138 - "node": ">=10" 1139 - }, 1140 - "funding": { 1141 - "url": "https://github.com/sponsors/sindresorhus" 1142 - } 1143 - }, 1144 - "node_modules/estree-walker": { 1145 - "version": "0.6.1", 1146 - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", 1147 - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", 1148 - "dev": true, 1149 - "license": "MIT" 1150 - }, 1151 - "node_modules/exit-hook": { 1152 - "version": "2.2.1", 1153 - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.2.1.tgz", 1154 - "integrity": "sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==", 1155 - "dev": true, 1156 - "license": "MIT", 1157 - "engines": { 1158 - "node": ">=6" 1159 - }, 1160 - "funding": { 1161 - "url": "https://github.com/sponsors/sindresorhus" 1234 + "@esbuild/aix-ppc64": "0.27.3", 1235 + "@esbuild/android-arm": "0.27.3", 1236 + "@esbuild/android-arm64": "0.27.3", 1237 + "@esbuild/android-x64": "0.27.3", 1238 + "@esbuild/darwin-arm64": "0.27.3", 1239 + "@esbuild/darwin-x64": "0.27.3", 1240 + "@esbuild/freebsd-arm64": "0.27.3", 1241 + "@esbuild/freebsd-x64": "0.27.3", 1242 + "@esbuild/linux-arm": "0.27.3", 1243 + "@esbuild/linux-arm64": "0.27.3", 1244 + "@esbuild/linux-ia32": "0.27.3", 1245 + "@esbuild/linux-loong64": "0.27.3", 1246 + "@esbuild/linux-mips64el": "0.27.3", 1247 + "@esbuild/linux-ppc64": "0.27.3", 1248 + "@esbuild/linux-riscv64": "0.27.3", 1249 + "@esbuild/linux-s390x": "0.27.3", 1250 + "@esbuild/linux-x64": "0.27.3", 1251 + "@esbuild/netbsd-arm64": "0.27.3", 1252 + "@esbuild/netbsd-x64": "0.27.3", 1253 + "@esbuild/openbsd-arm64": "0.27.3", 1254 + "@esbuild/openbsd-x64": "0.27.3", 1255 + "@esbuild/openharmony-arm64": "0.27.3", 1256 + "@esbuild/sunos-x64": "0.27.3", 1257 + "@esbuild/win32-arm64": "0.27.3", 1258 + "@esbuild/win32-ia32": "0.27.3", 1259 + "@esbuild/win32-x64": "0.27.3" 1162 1260 } 1163 - }, 1164 - "node_modules/exsolve": { 1165 - "version": "1.0.8", 1166 - "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz", 1167 - "integrity": "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==", 1168 - "dev": true, 1169 - "license": "MIT" 1170 1261 }, 1171 1262 "node_modules/fsevents": { 1172 1263 "version": "2.3.3", ··· 1183 1274 "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 1184 1275 } 1185 1276 }, 1186 - "node_modules/get-source": { 1187 - "version": "2.0.12", 1188 - "resolved": "https://registry.npmjs.org/get-source/-/get-source-2.0.12.tgz", 1189 - "integrity": "sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w==", 1190 - "dev": true, 1191 - "license": "Unlicense", 1192 - "dependencies": { 1193 - "data-uri-to-buffer": "^2.0.0", 1194 - "source-map": "^0.6.1" 1195 - } 1196 - }, 1197 - "node_modules/glob-to-regexp": { 1198 - "version": "0.4.1", 1199 - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", 1200 - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", 1201 - "dev": true, 1202 - "license": "BSD-2-Clause" 1203 - }, 1204 - "node_modules/is-arrayish": { 1205 - "version": "0.3.4", 1206 - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", 1207 - "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", 1208 - "dev": true, 1209 - "license": "MIT", 1210 - "optional": true 1211 - }, 1212 - "node_modules/magic-string": { 1213 - "version": "0.25.9", 1214 - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", 1215 - "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", 1216 - "dev": true, 1217 - "license": "MIT", 1218 - "dependencies": { 1219 - "sourcemap-codec": "^1.4.8" 1220 - } 1221 - }, 1222 - "node_modules/mime": { 1223 - "version": "3.0.0", 1224 - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", 1225 - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", 1277 + "node_modules/kleur": { 1278 + "version": "4.1.5", 1279 + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", 1280 + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", 1226 1281 "dev": true, 1227 1282 "license": "MIT", 1228 - "bin": { 1229 - "mime": "cli.js" 1230 - }, 1231 1283 "engines": { 1232 - "node": ">=10.0.0" 1284 + "node": ">=6" 1233 1285 } 1234 1286 }, 1235 1287 "node_modules/miniflare": { 1236 - "version": "3.20250718.3", 1237 - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20250718.3.tgz", 1238 - "integrity": "sha512-JuPrDJhwLrNLEJiNLWO7ZzJrv/Vv9kZuwMYCfv0LskQDM6Eonw4OvywO3CH/wCGjgHzha/qyjUh8JQ068TjDgQ==", 1288 + "version": "4.20260317.1", 1289 + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260317.1.tgz", 1290 + "integrity": "sha512-A3csI1HXEIfqe3oscgpoRMHdYlkReQKPH/g5JE53vFSjoM6YIAOGAzyDNeYffwd9oQkPWDj9xER8+vpxei8klA==", 1239 1291 "dev": true, 1240 1292 "license": "MIT", 1241 1293 "dependencies": { 1242 1294 "@cspotcode/source-map-support": "0.8.1", 1243 - "acorn": "8.14.0", 1244 - "acorn-walk": "8.3.2", 1245 - "exit-hook": "2.2.1", 1246 - "glob-to-regexp": "0.4.1", 1247 - "stoppable": "1.1.0", 1248 - "undici": "^5.28.5", 1249 - "workerd": "1.20250718.0", 1295 + "sharp": "^0.34.5", 1296 + "undici": "7.24.4", 1297 + "workerd": "1.20260317.1", 1250 1298 "ws": "8.18.0", 1251 - "youch": "3.3.4", 1252 - "zod": "3.22.3" 1299 + "youch": "4.1.0-beta.10" 1253 1300 }, 1254 1301 "bin": { 1255 1302 "miniflare": "bootstrap.js" 1256 1303 }, 1257 1304 "engines": { 1258 - "node": ">=16.13" 1259 - } 1260 - }, 1261 - "node_modules/mustache": { 1262 - "version": "4.2.0", 1263 - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", 1264 - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", 1265 - "dev": true, 1266 - "license": "MIT", 1267 - "bin": { 1268 - "mustache": "bin/mustache" 1305 + "node": ">=18.0.0" 1269 1306 } 1270 1307 }, 1271 - "node_modules/ohash": { 1272 - "version": "2.0.11", 1273 - "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", 1274 - "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", 1275 - "dev": true, 1276 - "license": "MIT" 1277 - }, 1278 1308 "node_modules/path-to-regexp": { 1279 1309 "version": "6.3.0", 1280 1310 "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", ··· 1289 1319 "dev": true, 1290 1320 "license": "MIT" 1291 1321 }, 1292 - "node_modules/printable-characters": { 1293 - "version": "1.0.42", 1294 - "resolved": "https://registry.npmjs.org/printable-characters/-/printable-characters-1.0.42.tgz", 1295 - "integrity": "sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==", 1296 - "dev": true, 1297 - "license": "Unlicense" 1298 - }, 1299 - "node_modules/rollup-plugin-inject": { 1300 - "version": "3.0.2", 1301 - "resolved": "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz", 1302 - "integrity": "sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==", 1303 - "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.", 1304 - "dev": true, 1305 - "license": "MIT", 1306 - "dependencies": { 1307 - "estree-walker": "^0.6.1", 1308 - "magic-string": "^0.25.3", 1309 - "rollup-pluginutils": "^2.8.1" 1310 - } 1311 - }, 1312 - "node_modules/rollup-plugin-node-polyfills": { 1313 - "version": "0.2.1", 1314 - "resolved": "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz", 1315 - "integrity": "sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==", 1316 - "dev": true, 1317 - "license": "MIT", 1318 - "dependencies": { 1319 - "rollup-plugin-inject": "^3.0.0" 1320 - } 1321 - }, 1322 - "node_modules/rollup-pluginutils": { 1323 - "version": "2.8.2", 1324 - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", 1325 - "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", 1326 - "dev": true, 1327 - "license": "MIT", 1328 - "dependencies": { 1329 - "estree-walker": "^0.6.1" 1330 - } 1331 - }, 1332 1322 "node_modules/semver": { 1333 1323 "version": "7.7.4", 1334 1324 "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", 1335 1325 "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", 1336 1326 "dev": true, 1337 1327 "license": "ISC", 1338 - "optional": true, 1339 1328 "bin": { 1340 1329 "semver": "bin/semver.js" 1341 1330 }, ··· 1344 1333 } 1345 1334 }, 1346 1335 "node_modules/sharp": { 1347 - "version": "0.33.5", 1348 - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", 1349 - "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", 1336 + "version": "0.34.5", 1337 + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", 1338 + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", 1350 1339 "dev": true, 1351 1340 "hasInstallScript": true, 1352 1341 "license": "Apache-2.0", 1353 - "optional": true, 1354 1342 "dependencies": { 1355 - "color": "^4.2.3", 1356 - "detect-libc": "^2.0.3", 1357 - "semver": "^7.6.3" 1343 + "@img/colour": "^1.0.0", 1344 + "detect-libc": "^2.1.2", 1345 + "semver": "^7.7.3" 1358 1346 }, 1359 1347 "engines": { 1360 1348 "node": "^18.17.0 || ^20.3.0 || >=21.0.0" ··· 1363 1351 "url": "https://opencollective.com/libvips" 1364 1352 }, 1365 1353 "optionalDependencies": { 1366 - "@img/sharp-darwin-arm64": "0.33.5", 1367 - "@img/sharp-darwin-x64": "0.33.5", 1368 - "@img/sharp-libvips-darwin-arm64": "1.0.4", 1369 - "@img/sharp-libvips-darwin-x64": "1.0.4", 1370 - "@img/sharp-libvips-linux-arm": "1.0.5", 1371 - "@img/sharp-libvips-linux-arm64": "1.0.4", 1372 - "@img/sharp-libvips-linux-s390x": "1.0.4", 1373 - "@img/sharp-libvips-linux-x64": "1.0.4", 1374 - "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", 1375 - "@img/sharp-libvips-linuxmusl-x64": "1.0.4", 1376 - "@img/sharp-linux-arm": "0.33.5", 1377 - "@img/sharp-linux-arm64": "0.33.5", 1378 - "@img/sharp-linux-s390x": "0.33.5", 1379 - "@img/sharp-linux-x64": "0.33.5", 1380 - "@img/sharp-linuxmusl-arm64": "0.33.5", 1381 - "@img/sharp-linuxmusl-x64": "0.33.5", 1382 - "@img/sharp-wasm32": "0.33.5", 1383 - "@img/sharp-win32-ia32": "0.33.5", 1384 - "@img/sharp-win32-x64": "0.33.5" 1354 + "@img/sharp-darwin-arm64": "0.34.5", 1355 + "@img/sharp-darwin-x64": "0.34.5", 1356 + "@img/sharp-libvips-darwin-arm64": "1.2.4", 1357 + "@img/sharp-libvips-darwin-x64": "1.2.4", 1358 + "@img/sharp-libvips-linux-arm": "1.2.4", 1359 + "@img/sharp-libvips-linux-arm64": "1.2.4", 1360 + "@img/sharp-libvips-linux-ppc64": "1.2.4", 1361 + "@img/sharp-libvips-linux-riscv64": "1.2.4", 1362 + "@img/sharp-libvips-linux-s390x": "1.2.4", 1363 + "@img/sharp-libvips-linux-x64": "1.2.4", 1364 + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", 1365 + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", 1366 + "@img/sharp-linux-arm": "0.34.5", 1367 + "@img/sharp-linux-arm64": "0.34.5", 1368 + "@img/sharp-linux-ppc64": "0.34.5", 1369 + "@img/sharp-linux-riscv64": "0.34.5", 1370 + "@img/sharp-linux-s390x": "0.34.5", 1371 + "@img/sharp-linux-x64": "0.34.5", 1372 + "@img/sharp-linuxmusl-arm64": "0.34.5", 1373 + "@img/sharp-linuxmusl-x64": "0.34.5", 1374 + "@img/sharp-wasm32": "0.34.5", 1375 + "@img/sharp-win32-arm64": "0.34.5", 1376 + "@img/sharp-win32-ia32": "0.34.5", 1377 + "@img/sharp-win32-x64": "0.34.5" 1385 1378 } 1386 1379 }, 1387 - "node_modules/simple-swizzle": { 1388 - "version": "0.2.4", 1389 - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", 1390 - "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", 1380 + "node_modules/supports-color": { 1381 + "version": "10.2.2", 1382 + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", 1383 + "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", 1391 1384 "dev": true, 1392 1385 "license": "MIT", 1393 - "optional": true, 1394 - "dependencies": { 1395 - "is-arrayish": "^0.3.1" 1396 - } 1397 - }, 1398 - "node_modules/source-map": { 1399 - "version": "0.6.1", 1400 - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 1401 - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 1402 - "dev": true, 1403 - "license": "BSD-3-Clause", 1404 1386 "engines": { 1405 - "node": ">=0.10.0" 1406 - } 1407 - }, 1408 - "node_modules/sourcemap-codec": { 1409 - "version": "1.4.8", 1410 - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", 1411 - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", 1412 - "deprecated": "Please use @jridgewell/sourcemap-codec instead", 1413 - "dev": true, 1414 - "license": "MIT" 1415 - }, 1416 - "node_modules/stacktracey": { 1417 - "version": "2.2.0", 1418 - "resolved": "https://registry.npmjs.org/stacktracey/-/stacktracey-2.2.0.tgz", 1419 - "integrity": "sha512-ETyQEz+CzXiLjEbyJqpbp+/T79RQD/6wqFucRBIlVNZfYq2Ay7wbretD4cxpbymZlaPWx58aIhPEY1Cr8DlVvg==", 1420 - "dev": true, 1421 - "license": "Unlicense", 1422 - "dependencies": { 1423 - "as-table": "^1.0.36", 1424 - "get-source": "^2.0.12" 1425 - } 1426 - }, 1427 - "node_modules/stoppable": { 1428 - "version": "1.1.0", 1429 - "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", 1430 - "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", 1431 - "dev": true, 1432 - "license": "MIT", 1433 - "engines": { 1434 - "node": ">=4", 1435 - "npm": ">=6" 1387 + "node": ">=18" 1388 + }, 1389 + "funding": { 1390 + "url": "https://github.com/chalk/supports-color?sponsor=1" 1436 1391 } 1437 1392 }, 1438 1393 "node_modules/tslib": { ··· 1457 1412 "node": ">=14.17" 1458 1413 } 1459 1414 }, 1460 - "node_modules/ufo": { 1461 - "version": "1.6.3", 1462 - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz", 1463 - "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==", 1464 - "dev": true, 1465 - "license": "MIT" 1466 - }, 1467 1415 "node_modules/undici": { 1468 - "version": "5.29.0", 1469 - "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", 1470 - "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", 1416 + "version": "7.24.4", 1417 + "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.4.tgz", 1418 + "integrity": "sha512-BM/JzwwaRXxrLdElV2Uo6cTLEjhSb3WXboncJamZ15NgUURmvlXvxa6xkwIOILIjPNo9i8ku136ZvWV0Uly8+w==", 1471 1419 "dev": true, 1472 1420 "license": "MIT", 1473 - "dependencies": { 1474 - "@fastify/busboy": "^2.0.0" 1475 - }, 1476 1421 "engines": { 1477 - "node": ">=14.0" 1422 + "node": ">=20.18.1" 1478 1423 } 1479 1424 }, 1425 + "node_modules/undici-types": { 1426 + "version": "7.18.2", 1427 + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", 1428 + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", 1429 + "dev": true, 1430 + "license": "MIT" 1431 + }, 1480 1432 "node_modules/unenv": { 1481 - "version": "2.0.0-rc.14", 1482 - "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.14.tgz", 1483 - "integrity": "sha512-od496pShMen7nOy5VmVJCnq8rptd45vh6Nx/r2iPbrba6pa6p+tS2ywuIHRZ/OBvSbQZB0kWvpO9XBNVFXHD3Q==", 1433 + "version": "2.0.0-rc.24", 1434 + "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz", 1435 + "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", 1484 1436 "dev": true, 1485 1437 "license": "MIT", 1486 1438 "dependencies": { 1487 - "defu": "^6.1.4", 1488 - "exsolve": "^1.0.1", 1489 - "ohash": "^2.0.10", 1490 - "pathe": "^2.0.3", 1491 - "ufo": "^1.5.4" 1439 + "pathe": "^2.0.3" 1492 1440 } 1493 1441 }, 1494 1442 "node_modules/workerd": { 1495 - "version": "1.20250718.0", 1496 - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250718.0.tgz", 1497 - "integrity": "sha512-kqkIJP/eOfDlUyBzU7joBg+tl8aB25gEAGqDap+nFWb+WHhnooxjGHgxPBy3ipw2hnShPFNOQt5lFRxbwALirg==", 1443 + "version": "1.20260317.1", 1444 + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260317.1.tgz", 1445 + "integrity": "sha512-ZuEq1OdrJBS+NV+L5HMYPCzVn49a2O60slQiiLpG44jqtlOo+S167fWC76kEXteXLLLydeuRrluRel7WdOUa4g==", 1498 1446 "dev": true, 1499 1447 "hasInstallScript": true, 1500 1448 "license": "Apache-2.0", ··· 1505 1453 "node": ">=16" 1506 1454 }, 1507 1455 "optionalDependencies": { 1508 - "@cloudflare/workerd-darwin-64": "1.20250718.0", 1509 - "@cloudflare/workerd-darwin-arm64": "1.20250718.0", 1510 - "@cloudflare/workerd-linux-64": "1.20250718.0", 1511 - "@cloudflare/workerd-linux-arm64": "1.20250718.0", 1512 - "@cloudflare/workerd-windows-64": "1.20250718.0" 1456 + "@cloudflare/workerd-darwin-64": "1.20260317.1", 1457 + "@cloudflare/workerd-darwin-arm64": "1.20260317.1", 1458 + "@cloudflare/workerd-linux-64": "1.20260317.1", 1459 + "@cloudflare/workerd-linux-arm64": "1.20260317.1", 1460 + "@cloudflare/workerd-windows-64": "1.20260317.1" 1513 1461 } 1514 1462 }, 1515 1463 "node_modules/wrangler": { 1516 - "version": "3.114.17", 1517 - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.114.17.tgz", 1518 - "integrity": "sha512-tAvf7ly+tB+zwwrmjsCyJ2pJnnc7SZhbnNwXbH+OIdVas3zTSmjcZOjmLKcGGptssAA3RyTKhcF9BvKZzMUycA==", 1464 + "version": "4.76.0", 1465 + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.76.0.tgz", 1466 + "integrity": "sha512-Wan+CU5a0tu4HIxGOrzjNbkmxCT27HUmzrMj6kc7aoAnjSLv50Ggcn2Ant7wNQrD6xW3g31phKupZJgTZ8wZfQ==", 1519 1467 "dev": true, 1520 1468 "license": "MIT OR Apache-2.0", 1521 1469 "dependencies": { 1522 - "@cloudflare/kv-asset-handler": "0.3.4", 1523 - "@cloudflare/unenv-preset": "2.0.2", 1524 - "@esbuild-plugins/node-globals-polyfill": "0.2.3", 1525 - "@esbuild-plugins/node-modules-polyfill": "0.2.2", 1470 + "@cloudflare/kv-asset-handler": "0.4.2", 1471 + "@cloudflare/unenv-preset": "2.16.0", 1526 1472 "blake3-wasm": "2.1.5", 1527 - "esbuild": "0.17.19", 1528 - "miniflare": "3.20250718.3", 1473 + "esbuild": "0.27.3", 1474 + "miniflare": "4.20260317.1", 1529 1475 "path-to-regexp": "6.3.0", 1530 - "unenv": "2.0.0-rc.14", 1531 - "workerd": "1.20250718.0" 1476 + "unenv": "2.0.0-rc.24", 1477 + "workerd": "1.20260317.1" 1532 1478 }, 1533 1479 "bin": { 1534 1480 "wrangler": "bin/wrangler.js", 1535 1481 "wrangler2": "bin/wrangler.js" 1536 1482 }, 1537 1483 "engines": { 1538 - "node": ">=16.17.0" 1484 + "node": ">=20.0.0" 1539 1485 }, 1540 1486 "optionalDependencies": { 1541 - "fsevents": "~2.3.2", 1542 - "sharp": "^0.33.5" 1487 + "fsevents": "~2.3.2" 1543 1488 }, 1544 1489 "peerDependencies": { 1545 - "@cloudflare/workers-types": "^4.20250408.0" 1490 + "@cloudflare/workers-types": "^4.20260317.1" 1546 1491 }, 1547 1492 "peerDependenciesMeta": { 1548 1493 "@cloudflare/workers-types": { ··· 1573 1518 } 1574 1519 }, 1575 1520 "node_modules/youch": { 1576 - "version": "3.3.4", 1577 - "resolved": "https://registry.npmjs.org/youch/-/youch-3.3.4.tgz", 1578 - "integrity": "sha512-UeVBXie8cA35DS6+nBkls68xaBBXCye0CNznrhszZjTbRVnJKQuNsyLKBTTL4ln1o1rh2PKtv35twV7irj5SEg==", 1521 + "version": "4.1.0-beta.10", 1522 + "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", 1523 + "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==", 1579 1524 "dev": true, 1580 1525 "license": "MIT", 1581 1526 "dependencies": { 1582 - "cookie": "^0.7.1", 1583 - "mustache": "^4.2.0", 1584 - "stacktracey": "^2.1.8" 1527 + "@poppinss/colors": "^4.1.5", 1528 + "@poppinss/dumper": "^0.6.4", 1529 + "@speed-highlight/core": "^1.2.7", 1530 + "cookie": "^1.0.2", 1531 + "youch-core": "^0.3.3" 1585 1532 } 1586 1533 }, 1587 - "node_modules/zod": { 1588 - "version": "3.22.3", 1589 - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.3.tgz", 1590 - "integrity": "sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug==", 1534 + "node_modules/youch-core": { 1535 + "version": "0.3.3", 1536 + "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz", 1537 + "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==", 1591 1538 "dev": true, 1592 1539 "license": "MIT", 1593 - "funding": { 1594 - "url": "https://github.com/sponsors/colinhacks" 1540 + "dependencies": { 1541 + "@poppinss/exception": "^1.2.2", 1542 + "error-stack-parser-es": "^1.0.5" 1595 1543 } 1596 1544 } 1597 1545 }
+3 -2
workers/gymtracker-ads-api/package.json
··· 7 7 "deploy": "wrangler deploy" 8 8 }, 9 9 "devDependencies": { 10 - "wrangler": "^3.0.0", 11 - "typescript": "^5.0.0" 10 + "@types/node": "^25.5.0", 11 + "typescript": "^5.0.0", 12 + "wrangler": "^4.76.0" 12 13 } 13 14 }
+851 -321
workers/gymtracker-ads-api/src/admin-html.ts
··· 5 5 <meta charset="utf-8"> 6 6 <meta name="viewport" content="width=device-width, initial-scale=1"> 7 7 <title>Gym Tracker Ads Admin</title> 8 - <style>@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap');</style> 8 + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.css"> 9 + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/themes/dark.css"> 10 + <style>@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');</style> 9 11 </head> 10 12 <body> 11 13 <div class="dashboard-wrap"> ··· 30 32 <button type="button" id="newAdBtn" class="primary">New ad</button> 31 33 </div> 32 34 <div class="main"> 33 - <div class="tabs"> 34 - <button type="button" class="tab active" id="tabBtnOverview">overview</button> 35 - <button type="button" class="tab" id="tabBtnSchedule">schedule <span class="badge" id="tabScheduleBadge">0</span></button> 36 - </div> 37 - <div class="panel active" id="tab-overview"> 38 - <div class="overview-status-banner" id="overviewStatusBanner"> 39 - <div class="status-banner-dot pending" id="overviewStatusDot"></div> 40 - <div> 41 - <div class="status-banner-text" id="overviewStatusText">Loading…</div> 42 - <div class="status-banner-sub" id="overviewStatusSub">Fetching ads</div> 43 - </div> 44 - </div> 45 - <div id="calendarWrap" class="calendar-wrap" hidden> 46 - <div class="calendar-header"> 47 - <button type="button" id="calPrev" class="cal-nav" title="Previous month">◀</button> 48 - <h3 class="cal-month-label" id="calMonthLabel"></h3> 49 - <button type="button" id="calNext" class="cal-nav" title="Next month">▶</button> 50 - </div> 51 - <div class="calendar-grid"> 52 - <div class="cal-weekdays"> 53 - <span>Sun</span><span>Mon</span><span>Tue</span><span>Wed</span><span>Thu</span><span>Fri</span><span>Sat</span> 35 + <div class="schedule-page"> 36 + <div class="schedule-grid"> 37 + <div class="schedule-ads"> 38 + <div class="main-toolbar" id="mainToolbar" hidden> 39 + <input type="text" id="adsSearch" placeholder="Search sponsor or ID" class="toolbar-search"> 40 + <div class="toolbar-filters"> 41 + <button type="button" class="status-filter active" data-filter="all">All</button> 42 + <button type="button" class="status-filter" data-filter="live">Live</button> 43 + <button type="button" class="status-filter" data-filter="scheduled">Scheduled</button> 44 + <button type="button" class="status-filter" data-filter="paused">Paused</button> 45 + <button type="button" class="status-filter" data-filter="ended">Ended</button> 46 + </div> 54 47 </div> 55 - <div id="calDays" class="cal-days"></div> 48 + <div class="group-label" id="adsHeader">Ads</div> 49 + <div id="adCards" class="ad-cards"></div> 56 50 </div> 57 - <div class="cal-legend"> 58 - <span class="cal-legend-item"><span class="cal-legend-dot live"></span> live</span> 59 - <span class="cal-legend-item"><span class="cal-legend-dot scheduled"></span> scheduled</span> 60 - <span class="cal-legend-item"><span class="cal-legend-dot ended"></span> ended</span> 61 - <span class="cal-legend-item"><span class="cal-legend-dot paused"></span> paused</span> 51 + <div class="schedule-calendar"> 52 + <div id="calendarEmpty" class="calendar-empty" hidden> 53 + <p class="calendar-empty-text">Use the sidebar to create one</p> 54 + </div> 55 + <div id="calendarWrap" class="calendar-wrap" hidden> 56 + <div class="calendar-header"> 57 + <button type="button" id="calPrev" class="cal-nav" title="Previous month">◀</button> 58 + <h3 class="cal-month-label" id="calMonthLabel"></h3> 59 + <button type="button" id="calNext" class="cal-nav" title="Next month">▶</button> 60 + <button type="button" id="calToday" class="cal-nav cal-today" title="Go to today">Today</button> 61 + </div> 62 + <div class="calendar-grid"> 63 + <div class="cal-weekdays"> 64 + <span>Sun</span><span>Mon</span><span>Tue</span><span>Wed</span><span>Thu</span><span>Fri</span><span>Sat</span> 65 + </div> 66 + <div id="calDays" class="cal-days"></div> 67 + </div> 68 + <div class="cal-legend"> 69 + <span class="cal-legend-item"><span class="cal-legend-dot live"></span> live</span> 70 + <span class="cal-legend-item"><span class="cal-legend-dot scheduled"></span> scheduled</span> 71 + <span class="cal-legend-item"><span class="cal-legend-dot ended"></span> ended</span> 72 + <span class="cal-legend-item"><span class="cal-legend-dot paused"></span> paused</span> 73 + </div> 74 + </div> 62 75 </div> 63 76 </div> 64 - <div class="overview-actions"> 65 - <button type="button" id="overviewRefreshBtn">Refresh</button> 66 - <button type="button" id="overviewNewAdBtn" class="btn-as-link">New ad</button> 67 - </div> 68 77 </div> 69 - <div class="panel" id="tab-schedule"> 70 - <section class="admin-section"> 71 - <div class="group-label" id="adsHeader">Ads</div> 72 - <div id="adCards" class="ad-cards"></div> 73 - </section> 78 + <p class="footer"><a href="https://jackhannon.net/">Back to jackhannon.net</a></p> 79 + </div> 80 + </div> 74 81 75 - <div class="admin-editor-grid"> 76 - <form id="adForm" class="admin-form"> 77 - <div class="group"> 78 - <div class="group-label">Identity</div> 79 - <div class="field-label">ID (unique, e.g. sponsor-2025-q1)</div> 80 - <input type="text" id="id" name="id" required> 81 - <div class="field-label">Tier</div> 82 - <select id="tier" name="tier"> 83 - <option value="text">text</option> 84 - <option value="banner">banner</option> 85 - <option value="feature">feature</option> 86 - </select> 87 - <label class="checkbox-label"><input type="checkbox" id="active" name="active" checked> Active</label> 88 - </div> 89 - <div class="group"> 90 - <div class="group-label">Creative</div> 91 - <div class="field-label">Sponsor</div> 92 - <input type="text" id="sponsor" name="sponsor" required> 93 - <div class="field-label">Headline</div> 94 - <input type="text" id="headline" name="headline" required> 95 - <div class="field-label">Subline (optional)</div> 96 - <input type="text" id="subline" name="subline"> 97 - <div class="field-label">CTA</div> 98 - <input type="text" id="cta" name="cta" required> 99 - <div class="field-label">Image URL (required for banner/feature)</div> 100 - <input type="url" id="image_url" name="image_url" placeholder="https://"> 101 - <div class="field-label">Logo URL (optional)</div> 102 - <input type="url" id="logo_url" name="logo_url" placeholder="https://"> 103 - </div> 104 - <div class="group"> 105 - <div class="group-label">Schedule</div> 106 - <div class="date-presets"> 107 - <button type="button" data-preset="7d">Next 7 days</button> 108 - <button type="button" data-preset="30d">Next 30 days</button> 82 + <div id="formOverlay" class="form-overlay" hidden aria-modal="true" role="dialog" aria-labelledby="formOverlayTitle"> 83 + <div class="form-overlay-backdrop"></div> 84 + <div class="form-overlay-panel"> 85 + <header class="form-overlay-header"> 86 + <h2 id="formOverlayTitle">New ad</h2> 87 + <div class="active-inactive-toggle active-inactive-header"> 88 + <input type="hidden" id="active" name="active" form="adForm" value="true"> 89 + <button type="button" class="active-inactive-btn active" id="activeBtn" data-value="true">Active</button> 90 + <button type="button" class="active-inactive-btn" id="inactiveBtn" data-value="false">Inactive</button> 91 + </div> 92 + <button type="button" id="formOverlayClose" aria-label="Close">×</button> 93 + </header> 94 + <div class="form-overlay-body"> 95 + <div class="admin-editor-grid"> 96 + <form id="adForm" class="admin-form"> 97 + <div class="group"> 98 + <div class="id-version-row"> 99 + <input type="text" id="id" name="id" required placeholder="ID (e.g. sponsor-2025-q1)"> 100 + <input type="text" id="creative_version" name="creative_version" placeholder="v1" class="version-input"> 101 + </div> 102 + <span class="field-error" id="err-id"></span> 103 + </div> 104 + <div class="group schedule-group"> 105 + <div class="group-label">Schedule</div> 106 + <div class="field-label">Start at (optional)</div> 107 + <input type="text" id="start_at" name="start_at" placeholder="Pick date & time" readonly> 108 + <div id="endAtWrap" class="end-at-wrap" hidden> 109 + <div class="field-label">End at (optional)</div> 110 + <input type="text" id="end_at" name="end_at" placeholder="Pick date & time" readonly> 111 + </div> 112 + <div class="date-presets"> 113 + <button type="button" data-preset="today">Today</button> 114 + <button type="button" data-preset="week">This week</button> 115 + <button type="button" data-preset="7d">Next 7 days</button> 116 + <button type="button" data-preset="30d">Next 30 days</button> 117 + </div> 118 + <div id="clearDatesWrap" class="clear-dates-wrap" hidden> 119 + <button type="button" id="clearDatesBtn" class="clear-dates-btn">Clear</button> 120 + </div> 121 + </div> 122 + <div class="group"> 123 + <div class="group-label">Creative</div> 124 + <div class="field"> 125 + <div class="field-label">Sponsor</div> 126 + <input type="text" id="sponsor" name="sponsor" required placeholder="e.g. Acme Corp"> 127 + <span class="field-error" id="err-sponsor"></span> 128 + </div> 129 + <div class="field"> 130 + <div class="field-label">Headline</div> 131 + <input type="text" id="headline" name="headline" required placeholder="e.g. Your headline here"> 132 + <span class="field-error" id="err-headline"></span> 133 + </div> 134 + <div class="field"> 135 + <div class="field-label">Subline (optional)</div> 136 + <input type="text" id="subline" name="subline" placeholder="e.g. 123 Main St · Open 7am–10pm"> 137 + </div> 138 + <div class="field"> 139 + <div class="field-label">CTA</div> 140 + <input type="text" id="cta" name="cta" required placeholder="e.g. Learn more"> 141 + <span class="field-error" id="err-cta"></span> 142 + </div> 143 + <div class="field"> 144 + <div class="field-label">Destination URL (HTTPS)</div> 145 + <input type="url" id="destination_url" name="destination_url" required placeholder="https://"> 146 + <span class="field-error" id="err-destination_url"></span> 147 + </div> 148 + <div class="field" id="imageUrlWrap"> 149 + <div class="field-label">Image URL (required for banner/feature)</div> 150 + <input type="url" id="image_url" name="image_url" placeholder="https://"> 151 + <span class="field-error" id="err-image_url"></span> 152 + </div> 153 + <div class="field"> 154 + <div class="field-label">Logo URL (optional)</div> 155 + <input type="url" id="logo_url" name="logo_url" placeholder="https://"> 156 + </div> 157 + <div id="placementWrap" class="placement-wrap" hidden> 158 + <div class="field-label">Placement</div> 159 + <select id="placement" name="placement"> 160 + <option value="home_feed">Main feed</option> 161 + </select> 162 + </div> 163 + <input type="hidden" id="tier" name="tier" value="banner"> 109 164 </div> 110 - <div class="field-label">Start at (optional)</div> 111 - <input type="datetime-local" id="start_at" name="start_at"> 112 - <div class="field-label">End at (optional)</div> 113 - <input type="datetime-local" id="end_at" name="end_at"> 114 - <div id="clearDatesWrap" class="clear-dates-wrap" hidden> 115 - <button type="button" id="clearDatesBtn" class="clear-dates-btn">Clear</button> 165 + </form> 166 + <aside class="preview-pane"> 167 + <div id="adKpiBox" class="ad-kpi-box" hidden> 168 + <div class="group-label">KPI (last 7d)</div> 169 + <div class="kpi-grid" id="adKpiGrid"></div> 116 170 </div> 117 - </div> 118 - <div class="group"> 119 - <div class="group-label">Advanced</div> 120 - <div class="field-label">Destination URL (HTTPS)</div> 121 - <input type="url" id="destination_url" name="destination_url" required placeholder="https://"> 122 - <div class="field-label">Placement</div> 123 - <input type="text" id="placement" name="placement" value="home_feed"> 124 - <div class="field-label">Creative version (optional)</div> 125 - <input type="text" id="creative_version" name="creative_version"> 126 - </div> 127 - <div class="form-actions"> 128 - <button type="submit" id="saveBtn" class="primary">Save</button> 171 + <div id="adPreview" class="ad-preview"></div> 172 + <div class="tier-toggle"> 173 + <button type="button" class="tier-btn" data-tier="text">Text</button> 174 + <button type="button" class="tier-btn active" data-tier="banner">Banner</button> 175 + <button type="button" class="tier-btn" data-tier="feature">Feature</button> 176 + </div> 177 + </aside> 178 + </div> 179 + </div> 180 + <footer class="form-overlay-footer"> 181 + <div class="form-actions"> 182 + <button type="button" id="deleteBtn" class="delete-btn" disabled>Delete</button> 183 + <span id="unsavedIndicator" class="unsaved-indicator" hidden>Unsaved changes</span> 184 + <div class="form-actions-right"> 129 185 <button type="button" id="cloneBtn">Clone</button> 130 - <button type="button" id="deleteBtn" class="delete-btn" disabled>Delete</button> 186 + <button type="submit" id="saveBtn" class="primary" form="adForm">Save</button> 131 187 <span id="saveStatus" class="save-status"></span> 132 188 </div> 133 - </form> 134 - <aside class="preview-pane"> 135 - <div id="adKpiBox" class="ad-kpi-box" hidden> 136 - <div class="group-label">KPI (last 7d)</div> 137 - <div class="kpi-grid" id="adKpiGrid"></div> 138 - </div> 139 - <div class="group-label">Preview</div> 140 - <div id="adPreview" class="ad-preview"></div> 141 - </aside> 142 - </div> 143 - 144 - <p class="footer"><a href="https://jackhannon.net/">Back to jackhannon.net</a></p> 189 + </div> 190 + </footer> 145 191 </div> 146 - </div> 147 192 </div> 148 193 194 + <script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.js"></script> 195 + <script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/plugins/rangePlugin.js"></script> 149 196 <script> 150 197 const API_URL = '/api/admin/ads'; 151 198 199 + const fpDefaults = { 200 + enableTime: true, 201 + time_24hr: true, 202 + dateFormat: 'Y-m-d\\TH:i', 203 + minuteIncrement: 5, 204 + plugins: [rangePlugin({ input: '#end_at' })], 205 + onChange: () => { updateClearDatesVisibility(); markDirty(); debouncePreview(); }, 206 + }; 207 + let fpRange; 208 + 209 + function mapErrorToField(errorStr) { 210 + if (!errorStr || typeof errorStr !== 'string') return null; 211 + const s = errorStr.toLowerCase(); 212 + if (s.includes('id')) return 'id'; 213 + if (s.includes('sponsor')) return 'sponsor'; 214 + if (s.includes('headline')) return 'headline'; 215 + if (s.includes('cta')) return 'cta'; 216 + if (s.includes('destination_url') || s.includes('destination url')) return 'destination_url'; 217 + if (s.includes('image_url') || s.includes('image url')) return 'image_url'; 218 + if (s.includes('logo_url') || s.includes('logo url')) return 'logo_url'; 219 + return null; 220 + } 221 + 222 + async function fetchWithRetry(url, opts, retries = 1) { 223 + const timeout = 15000; 224 + const ctrl = new AbortController(); 225 + const to = setTimeout(() => ctrl.abort(), timeout); 226 + const merged = { ...opts, signal: ctrl.signal }; 227 + try { 228 + const res = await fetch(url, merged); 229 + clearTimeout(to); 230 + return res; 231 + } catch (err) { 232 + clearTimeout(to); 233 + if (retries > 0) { 234 + await new Promise(r => setTimeout(r, 500)); 235 + return fetchWithRetry(url, opts, retries - 1); 236 + } 237 + throw err; 238 + } 239 + } 240 + 241 + function parseAdsResponse(data) { 242 + let raw = []; 243 + if (Array.isArray(data.ads)) raw = data.ads; 244 + else if (data.id != null) raw = [data]; 245 + const result = []; 246 + raw.forEach((item, i) => { 247 + if (!item || typeof item !== 'object') { console.warn('Admin: skipping malformed ad at index', i); return; } 248 + const id = item.id; 249 + if (!id || typeof id !== 'string') { console.warn('Admin: skipping ad without valid id at index', i); return; } 250 + if (typeof item.sponsor !== 'string' || typeof item.headline !== 'string' || typeof item.cta !== 'string') { 251 + console.warn('Admin: skipping ad with missing required fields at index', i); 252 + return; 253 + } 254 + result.push(item); 255 + }); 256 + return result; 257 + } 258 + 259 + function clearErrorBanner() { 260 + const existing = document.getElementById('errorBanner'); 261 + if (existing) existing.remove(); 262 + } 263 + 264 + function showErrorBanner(title, subHtml) { 265 + clearErrorBanner(); 266 + const main = document.querySelector('.main'); 267 + if (!main) return; 268 + const banner = document.createElement('div'); 269 + banner.id = 'errorBanner'; 270 + banner.className = 'overview-status-banner error'; 271 + banner.innerHTML = '<div class="status-banner-dot err"></div><div><div class="status-banner-text"></div><div class="status-banner-sub"' + (subHtml ? '' : ' hidden') + '></div></div>'; 272 + const textEl = banner.querySelector('.status-banner-text'); 273 + const sub = banner.querySelector('.status-banner-sub'); 274 + if (textEl) textEl.textContent = title || ''; 275 + if (sub && subHtml) { sub.innerHTML = subHtml; sub.hidden = false; } 276 + main.insertBefore(banner, main.firstChild); 277 + } 278 + 279 + function show401Banner() { 280 + showErrorBanner('Session expired', '<a href="#" id="reauthLink">Refresh to sign in</a>'); 281 + document.getElementById('reauthLink')?.addEventListener('click', (e) => { e.preventDefault(); location.reload(); }); 282 + setStatus(fetchStatus, 'Session expired', false); 283 + } 284 + 152 285 const refreshBtn = document.getElementById('refreshBtn'); 153 286 const fetchStatus = document.getElementById('fetchStatus'); 154 287 const adCards = document.getElementById('adCards'); ··· 165 298 const form = document.getElementById('adForm'); 166 299 const adPreview = document.getElementById('adPreview'); 167 300 301 + fpRange = flatpickr(document.getElementById('start_at'), { ...fpDefaults }); 302 + 168 303 let scheduledAds = []; 169 304 let selectedIndex = -1; 170 305 let formDirty = false; 171 306 let previewDebounce = null; 172 307 let perAdStats = []; 308 + let adsFilterStatus = 'all'; 309 + let adsSearchQuery = ''; 173 310 174 311 function setStatus(el, msg, ok) { 175 312 el.textContent = msg; ··· 236 373 if (liveEl) liveEl.textContent = String(c.live); 237 374 if (scheduledEl) scheduledEl.textContent = String(c.scheduled); 238 375 if (endedEl) endedEl.textContent = String(c.ended); 239 - const badge = document.getElementById('tabScheduleBadge'); 240 - if (badge) badge.textContent = String(c.total); 241 - const banner = document.getElementById('overviewStatusBanner'); 242 - const bannerText = document.getElementById('overviewStatusText'); 243 - const bannerSub = document.getElementById('overviewStatusSub'); 244 - const bannerDot = document.getElementById('overviewStatusDot'); 245 - if (banner && bannerText && bannerSub && bannerDot) { 246 - banner.className = 'overview-status-banner operational'; 247 - bannerText.textContent = formatStatusSummary(c); 248 - bannerSub.textContent = ''; 249 - bannerSub.hidden = true; 250 - bannerDot.className = 'status-banner-dot ok'; 251 - } 376 + clearErrorBanner(); 252 377 } 253 378 254 379 function formatCompact(n) { ··· 282 407 } 283 408 284 409 async function loadPostHogStats() { 285 - const bannerText = document.getElementById('overviewStatusText'); 286 - const bannerSub = document.getElementById('overviewStatusSub'); 287 - if (!bannerText || !bannerSub) return; 288 410 try { 289 - const res = await fetch('/api/admin/stats', { credentials: 'include' }); 411 + const res = await fetchWithRetry('/api/admin/stats', { credentials: 'include' }); 412 + if (res.status === 401) { show401Banner(); return; } 290 413 const data = await res.json(); 291 414 perAdStats = Array.isArray(data.per_ad) ? data.per_ad : []; 292 - if (data.configured && typeof data.impressions === 'number' && typeof data.clicks === 'number') { 293 - const ctr = typeof data.ctr_percent === 'number' ? data.ctr_percent.toFixed(1) : '0'; 294 - bannerText.textContent = 'Last 7d: ' + data.impressions + ' impressions · ' + data.clicks + ' clicks · ' + ctr + '% CTR'; 295 - bannerSub.textContent = ''; 296 - bannerSub.hidden = true; 297 - } 298 415 renderAdCards(); 299 416 updateAdKpiBox(); 300 417 } catch (_) { 301 418 perAdStats = []; 302 - bannerSub.textContent = 'Analytics unavailable'; 303 - bannerSub.hidden = false; 304 419 } 305 420 } 306 421 307 - function switchTab(name, btn) { 308 - document.querySelectorAll('.tabs > .tab').forEach(t => t.classList.remove('active')); 309 - document.querySelectorAll('.main > .panel').forEach(p => p.classList.remove('active')); 310 - if (btn) btn.classList.add('active'); 311 - const panel = document.getElementById('tab-' + name); 312 - if (panel) panel.classList.add('active'); 422 + let lastOverlayTrigger = null; 423 + 424 + function openFormOverlay(title) { 425 + const overlay = document.getElementById('formOverlay'); 426 + const titleEl = document.getElementById('formOverlayTitle'); 427 + if (titleEl) titleEl.textContent = title; 428 + overlay.hidden = false; 429 + lastOverlayTrigger = document.activeElement; 430 + const closeBtn = document.getElementById('formOverlayClose'); 431 + const firstInput = document.querySelector('#formOverlay input, #formOverlay select'); 432 + (firstInput || closeBtn)?.focus(); 433 + document.body.style.overflow = 'hidden'; 434 + } 435 + 436 + function closeFormOverlay() { 437 + if (formDirty && !confirm('Discard unsaved changes?')) return; 438 + const overlay = document.getElementById('formOverlay'); 439 + overlay.hidden = true; 440 + document.body.style.overflow = ''; 441 + lastOverlayTrigger?.focus(); 442 + lastOverlayTrigger = null; 443 + } 444 + 445 + async function toggleAdActive(idx) { 446 + if (idx < 0 || idx >= scheduledAds.length) return; 447 + const ad = scheduledAds[idx]; 448 + const nextActive = !ad.active; 449 + try { 450 + const payload = { ...ad, active: nextActive }; 451 + const res = await fetchWithRetry(API_URL, { 452 + method: 'PUT', 453 + credentials: 'include', 454 + headers: { 'Content-Type': 'application/json' }, 455 + body: JSON.stringify(payload), 456 + }); 457 + if (res.status === 401) { show401Banner(); return; } 458 + if (!res.ok) return; 459 + scheduledAds[idx] = { ...ad, active: nextActive }; 460 + renderAdCards(); 461 + renderCalendar(); 462 + renderOverview(); 463 + if (selectedIndex === idx) populateForm(scheduledAds[idx]); 464 + } catch (_) {} 313 465 } 314 466 315 467 function goToNewAd() { 316 468 if (formDirty && !confirm('Discard unsaved changes?')) return; 317 469 selectAd(-1); 318 - switchTab('schedule', document.getElementById('tabBtnSchedule')); 470 + openFormOverlay('New ad'); 471 + } 472 + 473 + function sortKeyForGroup(ad, status) { 474 + const start = ad.start_at ? new Date(ad.start_at).getTime() : 0; 475 + const end = ad.end_at ? new Date(ad.end_at).getTime() : 0; 476 + if (status === 'ended') return -end; 477 + return start || end || 0; 478 + } 479 + 480 + function filterAdsForDisplay() { 481 + return scheduledAds.map((ad, i) => ({ ad, i })).filter(({ ad }) => { 482 + const status = adStatus(ad); 483 + if (adsFilterStatus !== 'all' && status !== adsFilterStatus) return false; 484 + if (adsSearchQuery) { 485 + const q = adsSearchQuery.toLowerCase().trim(); 486 + const sponsor = (ad.sponsor || '').toLowerCase(); 487 + const id = (ad.id || '').toLowerCase(); 488 + if (!sponsor.includes(q) && !id.includes(q)) return false; 489 + } 490 + return true; 491 + }); 319 492 } 320 493 321 494 function renderAdCards() { 322 495 const adsHeader = document.getElementById('adsHeader'); 496 + const mainToolbar = document.getElementById('mainToolbar'); 323 497 if (adsHeader) adsHeader.hidden = scheduledAds.length === 0; 498 + if (mainToolbar) mainToolbar.hidden = scheduledAds.length === 0; 324 499 adCards.innerHTML = ''; 325 - scheduledAds.forEach((ad, i) => { 500 + 501 + const filtered = filterAdsForDisplay(); 502 + const groups = { live: [], scheduled: [], paused: [], ended: [] }; 503 + filtered.forEach(({ ad, i }) => { 326 504 const status = adStatus(ad); 327 - const stats = getAdStats(ad.id); 328 - const statsLine = stats 329 - ? '<span class="ad-card-stats">' + formatCompact(stats.impressions) + ' imp · ' + formatCompact(stats.clicks) + ' clk · ' + stats.ctr_percent.toFixed(1) + '% CTR</span>' 330 - : ''; 331 - const card = document.createElement('button'); 332 - card.type = 'button'; 333 - card.className = 'ad-card' + (selectedIndex === i ? ' selected' : ''); 334 - card.innerHTML = '<span class="ad-card-head">' + escapeHtml(ad.sponsor) + ' — ' + escapeHtml(ad.id) + '</span>' + 335 - '<span class="chip ' + statusClass(status) + '">' + status + '</span>' + 336 - '<span class="ad-card-dates">' + formatDateRange(ad) + '</span>' + 337 - (statsLine ? statsLine : '') + 338 - '<span class="ad-card-tier">' + (ad.tier || 'banner') + '</span>'; 339 - card.addEventListener('click', () => selectAd(i)); 340 - adCards.appendChild(card); 505 + if (groups[status]) groups[status].push({ ad, i }); 506 + }); 507 + 508 + const order = ['live', 'scheduled', 'paused', 'ended']; 509 + order.forEach((status) => { 510 + const list = groups[status]; 511 + if (list.length === 0) return; 512 + list.sort((a, b) => sortKeyForGroup(a.ad, status) - sortKeyForGroup(b.ad, status)); 513 + const section = document.createElement('div'); 514 + section.className = 'ad-cards-group'; 515 + section.innerHTML = '<div class="ad-cards-group-label">' + status + '</div>'; 516 + const cardWrap = document.createElement('div'); 517 + cardWrap.className = 'ad-cards'; 518 + list.forEach(({ ad, i }) => { 519 + const s = adStatus(ad); 520 + const stats = getAdStats(ad.id); 521 + const statsLine = stats 522 + ? '<span class="ad-card-stats">' + formatCompact(stats.impressions) + ' imp · ' + formatCompact(stats.clicks) + ' clk · ' + stats.ctr_percent.toFixed(1) + '% CTR</span>' 523 + : ''; 524 + const card = document.createElement('div'); 525 + card.className = 'ad-card-wrap'; 526 + const canToggle = s === 'live' || s === 'paused'; 527 + const toggleLabel = s === 'paused' ? 'Resume' : 'Pause'; 528 + card.innerHTML = '<button type="button" class="ad-card' + (selectedIndex === i ? ' selected' : '') + '" data-ad-idx="' + i + '">' + 529 + '<span class="ad-card-head">' + escapeHtml(ad.sponsor) + ' — ' + escapeHtml(ad.id) + '</span>' + 530 + '<span class="chip ' + statusClass(s) + '">' + s + '</span>' + 531 + '<span class="ad-card-dates">' + formatDateRange(ad) + '</span>' + 532 + (statsLine ? statsLine : '') + 533 + '<span class="ad-card-tier">' + (ad.tier || 'banner') + '</span>' + 534 + '</button>' + 535 + (canToggle ? '<button type="button" class="ad-card-action" data-ad-idx="' + i + '" data-action="toggle" title="' + toggleLabel + '">' + (s === 'paused' ? '▶' : '⏸') + '</button>' : ''); 536 + card.querySelector('.ad-card').addEventListener('click', () => { 537 + selectAd(i); 538 + openFormOverlay('Edit: ' + (ad.sponsor || ad.id)); 539 + }); 540 + const actionBtn = card.querySelector('.ad-card-action'); 541 + if (actionBtn) actionBtn.addEventListener('click', (e) => { e.stopPropagation(); toggleAdActive(parseInt(actionBtn.dataset.adIdx, 10)); }); 542 + cardWrap.appendChild(card); 543 + }); 544 + section.appendChild(cardWrap); 545 + adCards.appendChild(section); 341 546 }); 342 547 } 343 548 ··· 361 566 } 362 567 363 568 function renderCalendar() { 569 + const empty = document.getElementById('calendarEmpty'); 570 + if (empty) empty.hidden = true; 364 571 calendarWrap.hidden = false; 365 572 calMonthLabel.textContent = new Date(calViewYear, calViewMonth).toLocaleDateString(undefined, { month: 'long', year: 'numeric' }); 366 573 ··· 398 605 const isToday = (y === now.getFullYear() && m === now.getMonth() && dayNum === now.getDate()); 399 606 400 607 const ads = getAdsForDay(y, m, dayNum); 401 - const cellClass = 'cal-cell' + (isCurrentMonth ? '' : ' other-month') + (isToday ? ' today' : ''); 608 + const hasConflict = ads.length > 1; 609 + const cellClass = 'cal-cell' + (isCurrentMonth ? '' : ' other-month') + (isToday ? ' today' : '') + (hasConflict ? ' has-conflict' : ''); 402 610 403 611 html += '<div class="' + cellClass + '" data-year="' + y + '" data-month="' + m + '" data-day="' + dayNum + '">'; 404 612 html += '<div class="cal-cell-num">' + dayNum + '</div>'; ··· 419 627 calDays.querySelectorAll('.cal-ad-pill').forEach(btn => { 420 628 btn.addEventListener('click', (e) => { 421 629 e.stopPropagation(); 422 - selectAd(parseInt(btn.dataset.adIndex, 10)); 423 - switchTab('schedule', document.getElementById('tabBtnSchedule')); 630 + const idx = parseInt(btn.dataset.adIndex, 10); 631 + const ad = scheduledAds[idx]; 632 + selectAd(idx); 633 + if (ad) openFormOverlay('Edit: ' + (ad.sponsor || ad.id)); 424 634 }); 425 635 }); 426 636 } ··· 433 643 renderCalendar(); 434 644 if (index === -1) { 435 645 clearForm(); 646 + clearFieldErrors(); 436 647 setStatus(saveStatus, '', undefined); 648 + const ind = document.getElementById('unsavedIndicator'); 649 + if (ind) ind.hidden = true; 437 650 } else { 438 651 populateForm(scheduledAds[index]); 652 + const ind = document.getElementById('unsavedIndicator'); 653 + if (ind) ind.hidden = !formDirty; 439 654 } 440 655 updateClearDatesVisibility(); 656 + updateImageUrlVisibility(); 441 657 updateDeleteButton(); 442 658 updatePreview(); 443 659 updateAdKpiBox(); 444 660 } 445 661 446 - function markDirty() { formDirty = true; } 662 + function markDirty() { 663 + formDirty = true; 664 + const ind = document.getElementById('unsavedIndicator'); 665 + if (ind) ind.hidden = false; 666 + } 667 + 668 + function clearFieldErrors() { 669 + ['id', 'sponsor', 'headline', 'cta', 'destination_url', 'image_url', 'logo_url'].forEach(f => { 670 + const errEl = document.getElementById('err-' + f); 671 + const input = document.getElementById(f); 672 + if (errEl) errEl.textContent = ''; 673 + if (input) input.classList.remove('input-error'); 674 + }); 675 + } 676 + 677 + function setFieldError(fieldId, msg) { 678 + const el = document.getElementById('err-' + fieldId); 679 + const input = document.getElementById(fieldId); 680 + if (el) el.textContent = msg || ''; 681 + if (input) input.classList.toggle('input-error', !!msg); 682 + } 683 + 684 + function isValidHttpsUrl(s) { 685 + if (!s || !s.trim()) return false; 686 + try { return new URL(s.trim()).protocol === 'https:'; } catch { return false; } 687 + } 688 + 689 + function validateForm() { 690 + clearFieldErrors(); 691 + const id = document.getElementById('id').value.trim(); 692 + const sponsor = document.getElementById('sponsor').value.trim(); 693 + const headline = document.getElementById('headline').value.trim(); 694 + const cta = document.getElementById('cta').value.trim(); 695 + const destination_url = document.getElementById('destination_url').value.trim(); 696 + const tier = document.getElementById('tier').value; 697 + const image_url = document.getElementById('image_url').value.trim(); 698 + const logo_url = document.getElementById('logo_url').value.trim(); 699 + 700 + if (!id) { setFieldError('id', 'ID is required'); return false; } 701 + if (!sponsor) { setFieldError('sponsor', 'Sponsor is required'); return false; } 702 + if (!headline) { setFieldError('headline', 'Headline is required'); return false; } 703 + if (!cta) { setFieldError('cta', 'CTA is required'); return false; } 704 + if (!destination_url) { setFieldError('destination_url', 'Destination URL is required'); return false; } 705 + if (!isValidHttpsUrl(destination_url)) { setFieldError('destination_url', 'Must be a valid HTTPS URL'); return false; } 706 + 707 + if (tier === 'banner' || tier === 'feature') { 708 + if (!image_url) { setFieldError('image_url', 'Image URL is required for banner/feature tier'); return false; } 709 + if (!isValidHttpsUrl(image_url)) { setFieldError('image_url', 'Must be a valid HTTPS URL'); return false; } 710 + } 711 + if (logo_url && !isValidHttpsUrl(logo_url)) { setFieldError('logo_url', 'Must be a valid HTTPS URL or empty'); return false; } 712 + 713 + return true; 714 + } 447 715 448 716 function clearForm() { 449 717 document.getElementById('id').value = ''; 450 718 document.getElementById('tier').value = 'banner'; 451 - document.getElementById('active').checked = true; 719 + updateTierButtons(); 720 + document.getElementById('active').value = 'true'; 721 + updateActiveInactiveButtons(); 452 722 document.getElementById('sponsor').value = ''; 453 723 document.getElementById('headline').value = ''; 454 724 document.getElementById('subline').value = ''; ··· 458 728 document.getElementById('logo_url').value = ''; 459 729 document.getElementById('placement').value = 'home_feed'; 460 730 document.getElementById('creative_version').value = ''; 461 - document.getElementById('start_at').value = ''; 462 - document.getElementById('end_at').value = ''; 731 + if (fpRange) fpRange.clear(); 463 732 } 464 733 465 734 function isoToDatetimeLocal(iso) { ··· 479 748 function populateForm(data) { 480 749 document.getElementById('id').value = data.id || ''; 481 750 document.getElementById('tier').value = (data.tier || 'banner').toLowerCase(); 482 - document.getElementById('active').checked = !!data.active; 751 + updateTierButtons(); 752 + document.getElementById('active').value = data.active ? 'true' : 'false'; 753 + updateActiveInactiveButtons(); 483 754 document.getElementById('sponsor').value = data.sponsor || ''; 484 755 document.getElementById('headline').value = data.headline || ''; 485 756 document.getElementById('subline').value = data.subline || ''; ··· 489 760 document.getElementById('logo_url').value = data.logo_url || ''; 490 761 document.getElementById('placement').value = data.placement || 'home_feed'; 491 762 document.getElementById('creative_version').value = data.creative_version || ''; 492 - document.getElementById('start_at').value = isoToDatetimeLocal(data.start_at); 493 - document.getElementById('end_at').value = isoToDatetimeLocal(data.end_at); 763 + if (fpRange) { 764 + const start = data.start_at ? new Date(data.start_at) : null; 765 + const end = data.end_at ? new Date(data.end_at) : null; 766 + fpRange.setDate(start && end ? [start, end] : start ? [start] : []); 767 + } 494 768 } 495 769 496 770 function getFormData() { ··· 505 779 }; 506 780 } 507 781 782 + function getPlaceholder(id) { 783 + const el = document.getElementById(id); 784 + const p = (el && el.placeholder) || ''; 785 + return p.replace(/^e\.g\.\s*/i, ''); 786 + } 787 + 508 788 function updatePreview() { 509 789 const d = getFormData(); 510 790 const tier = d.tier || 'banner'; 791 + const sponsor = d.sponsor || getPlaceholder('sponsor'); 792 + const headline = d.headline || getPlaceholder('headline'); 793 + const subline = d.subline || getPlaceholder('subline'); 794 + const cta = d.cta || getPlaceholder('cta'); 795 + const image_url = d.image_url || null; 796 + const logo_url = d.logo_url || null; 797 + const usesImageLayout = tier !== 'text'; 798 + const sponsorLine = '<div class="preview-sponsor-line">' + 799 + (logo_url ? '<img src="' + escapeHtml(logo_url) + '" alt="" class="preview-logo" onerror="this.style.display=\\'none\\'">' : '') + 800 + '<span class="preview-sponsor">' + escapeHtml(sponsor) + '</span></div>'; 801 + const copyContent = '<div class="preview-copy">' + 802 + sponsorLine + 803 + '<strong class="preview-headline">' + escapeHtml(headline) + '</strong>' + 804 + '<span class="preview-subline">' + escapeHtml(subline) + '</span>' + 805 + '</div>'; 806 + const ctaBtn = '<div class="preview-cta-wrap"><span class="preview-cta-text">' + escapeHtml(cta) + '</span><span class="preview-cta-arrow">↗</span></div>'; 511 807 let html = '<div class="preview preview-' + tier + '">'; 512 - if (tier === 'text') { 513 - html += '<span class="preview-sponsor">' + escapeHtml(d.sponsor) + '</span>'; 514 - html += '<strong class="preview-headline">' + escapeHtml(d.headline) + '</strong>'; 515 - if (d.subline) html += '<span class="preview-subline">' + escapeHtml(d.subline) + '</span>'; 516 - html += '<button type="button" class="preview-cta" disabled>' + escapeHtml(d.cta || 'CTA') + '</button>'; 517 - } else if (tier === 'banner') { 518 - if (d.image_url) html += '<img src="' + escapeHtml(d.image_url) + '" alt="" class="preview-img" onerror="this.style.display=\\'none\\'">'; 519 - else html += '<div class="preview-img-placeholder">Image</div>'; 520 - html += '<div class="preview-content"><strong>' + escapeHtml(d.headline) + '</strong><button type="button" class="preview-cta preview-cta-sm" disabled>' + escapeHtml(d.cta || 'CTA') + '</button></div>'; 808 + if (usesImageLayout) { 809 + const imgHeight = tier === 'feature' ? 220 : 140; 810 + if (image_url) { 811 + html += '<div class="preview-img-wrap" style="height:' + imgHeight + 'px">'; 812 + html += '<img src="' + escapeHtml(image_url) + '" alt="" class="preview-img" onerror="this.parentElement.classList.add(\\'preview-img-error\\')">'; 813 + html += '</div>'; 814 + } else { 815 + html += '<div class="preview-img-placeholder" style="height:' + imgHeight + 'px">Image</div>'; 816 + } 817 + html += '<div class="preview-copy-block">' + copyContent + ctaBtn + '</div>'; 521 818 } else { 522 - if (d.image_url) html += '<img src="' + escapeHtml(d.image_url) + '" alt="" class="preview-img preview-img-lg" onerror="this.style.display=\\'none\\'">'; 523 - else html += '<div class="preview-img-placeholder preview-img-placeholder-lg">Image</div>'; 524 - if (d.logo_url) html += '<img src="' + escapeHtml(d.logo_url) + '" alt="" class="preview-logo" onerror="this.style.display=\\'none\\'">'; 525 - html += '<span class="preview-sponsor">' + escapeHtml(d.sponsor) + '</span>'; 526 - html += '<strong class="preview-headline">' + escapeHtml(d.headline) + '</strong>'; 527 - if (d.subline) html += '<span class="preview-subline">' + escapeHtml(d.subline) + '</span>'; 528 - html += '<button type="button" class="preview-cta" disabled>' + escapeHtml(d.cta || 'CTA') + '</button>'; 819 + html += copyContent + ctaBtn; 529 820 } 530 821 html += '</div>'; 531 822 adPreview.innerHTML = html; ··· 533 824 534 825 function debouncePreview() { 535 826 clearTimeout(previewDebounce); 536 - previewDebounce = setTimeout(updatePreview, 300); 827 + previewDebounce = setTimeout(updatePreview, 50); 537 828 } 538 829 539 830 function updateClearDatesVisibility() { 540 831 const startVal = document.getElementById('start_at').value; 541 832 const endVal = document.getElementById('end_at').value; 833 + const endAtWrap = document.getElementById('endAtWrap'); 542 834 const wrap = document.getElementById('clearDatesWrap'); 835 + endAtWrap.hidden = !startVal; 543 836 wrap.hidden = !startVal && !endVal; 544 837 } 545 838 ··· 548 841 } 549 842 550 843 function clearDates() { 551 - document.getElementById('start_at').value = ''; 552 - document.getElementById('end_at').value = ''; 844 + if (fpRange) fpRange.clear(); 553 845 updateClearDatesVisibility(); 554 846 markDirty(); 555 847 updatePreview(); ··· 559 851 btn.addEventListener('click', () => { 560 852 const preset = btn.dataset.preset; 561 853 const now = new Date(); 562 - if (preset === '7d') { 563 - document.getElementById('start_at').value = isoToDatetimeLocal(now.toISOString()); 564 - const end = new Date(now); 854 + let start, end; 855 + if (preset === 'today') { 856 + start = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes()); 857 + end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59); 858 + } else if (preset === 'week') { 859 + start = new Date(now); 860 + end = new Date(now); 861 + end.setDate(end.getDate() + (7 - now.getDay())); 862 + end.setHours(23, 59, 0, 0); 863 + } else if (preset === '7d') { 864 + start = new Date(now); 865 + end = new Date(now); 565 866 end.setDate(end.getDate() + 7); 566 - document.getElementById('end_at').value = isoToDatetimeLocal(end.toISOString()); 567 867 } else if (preset === '30d') { 568 - document.getElementById('start_at').value = isoToDatetimeLocal(now.toISOString()); 569 - const end = new Date(now); 868 + start = new Date(now); 869 + end = new Date(now); 570 870 end.setDate(end.getDate() + 30); 571 - document.getElementById('end_at').value = isoToDatetimeLocal(end.toISOString()); 572 871 } 872 + if (start && end && fpRange) fpRange.setDate([start, end]); 573 873 updateClearDatesVisibility(); 574 874 markDirty(); 575 875 updatePreview(); ··· 594 894 start.setMonth(start.getMonth() + 1); 595 895 const end = new Date(start); 596 896 end.setMonth(end.getMonth() + 1); 597 - document.getElementById('start_at').value = isoToDatetimeLocal(start.toISOString()); 598 - document.getElementById('end_at').value = isoToDatetimeLocal(end.toISOString()); 599 - document.getElementById('active').checked = false; 897 + if (fpRange) fpRange.setDate([start, end]); 898 + document.getElementById('active').value = 'false'; 899 + updateActiveInactiveButtons(); 600 900 selectedIndex = -1; 601 901 renderAdCards(); 602 902 updateClearDatesVisibility(); ··· 610 910 const ad = scheduledAds[selectedIndex]; 611 911 if (!ad || !confirm('Delete ad "' + (ad.sponsor || ad.id) + '"?')) return; 612 912 setStatus(saveStatus, 'Deleting…', true); 913 + deleteBtn.disabled = true; 613 914 try { 614 - const res = await fetch(API_URL + '?id=' + encodeURIComponent(ad.id), { 915 + const res = await fetchWithRetry(API_URL + '?id=' + encodeURIComponent(ad.id), { 615 916 method: 'DELETE', 616 917 credentials: 'include', 617 918 }); 618 - const data = await res.json(); 919 + let data = {}; 920 + try { data = await res.json(); } catch (_) {} 921 + if (res.status === 401) { show401Banner(); setStatus(saveStatus, 'Session expired', false); return; } 619 922 if (!res.ok) { 620 923 setStatus(saveStatus, data.error || res.statusText, false); 621 924 return; ··· 624 927 formDirty = false; 625 928 selectedIndex = -1; 626 929 loadSchedule(); 930 + closeFormOverlay(); 931 + document.getElementById('newAdBtn')?.focus(); 627 932 } catch (err) { 628 - setStatus(saveStatus, err.message || 'Network error', false); 933 + setStatus(saveStatus, 'Check connection, then Refresh', false); 934 + } finally { 935 + deleteBtn.disabled = selectedIndex < 0; 629 936 } 630 937 }); 631 938 939 + function suggestIdFromSponsor() { 940 + if (selectedIndex >= 0) return; 941 + const sponsor = document.getElementById('sponsor').value.trim(); 942 + const idEl = document.getElementById('id'); 943 + if (!sponsor || idEl.value.trim()) return; 944 + const slug = sponsor.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, ''); 945 + if (!slug) return; 946 + const now = new Date(); 947 + const pad = (n) => String(n).padStart(2, '0'); 948 + const suggested = slug + '-' + now.getFullYear() + '-' + pad(now.getMonth() + 1); 949 + idEl.placeholder = 'e.g. ' + suggested; 950 + } 951 + 632 952 form.querySelectorAll('input, select').forEach(el => { 633 - el.addEventListener('input', () => { markDirty(); debouncePreview(); }); 634 - el.addEventListener('change', () => { markDirty(); debouncePreview(); }); 953 + el.addEventListener('input', () => { markDirty(); debouncePreview(); if (el.id === 'sponsor') suggestIdFromSponsor(); }); 954 + el.addEventListener('change', () => { markDirty(); debouncePreview(); if (el.id === 'sponsor') suggestIdFromSponsor(); }); 955 + }); 956 + [document.getElementById('id'), document.getElementById('creative_version')].forEach(el => { 957 + if (el) { 958 + el.addEventListener('input', () => { markDirty(); debouncePreview(); }); 959 + el.addEventListener('change', () => { markDirty(); debouncePreview(); }); 960 + } 961 + }); 962 + function updateActiveInactiveButtons() { 963 + const isActive = document.getElementById('active').value === 'true'; 964 + document.getElementById('activeBtn').classList.toggle('active', isActive); 965 + document.getElementById('inactiveBtn').classList.toggle('active', !isActive); 966 + } 967 + document.getElementById('activeBtn').addEventListener('click', () => { 968 + document.getElementById('active').value = 'true'; 969 + updateActiveInactiveButtons(); 970 + markDirty(); 971 + debouncePreview(); 972 + }); 973 + document.getElementById('inactiveBtn').addEventListener('click', () => { 974 + document.getElementById('active').value = 'false'; 975 + updateActiveInactiveButtons(); 976 + markDirty(); 977 + debouncePreview(); 978 + }); 979 + 980 + function updateTierButtons() { 981 + const tier = document.getElementById('tier').value; 982 + document.querySelectorAll('.tier-btn').forEach(btn => { 983 + btn.classList.toggle('active', btn.dataset.tier === tier); 984 + }); 985 + updateImageUrlVisibility(); 986 + } 987 + function updateImageUrlVisibility() { 988 + const tier = document.getElementById('tier').value; 989 + const wrap = document.getElementById('imageUrlWrap'); 990 + wrap.classList.toggle('image-url-hidden', tier === 'text'); 991 + } 992 + document.querySelectorAll('.tier-btn').forEach(btn => { 993 + btn.addEventListener('click', () => { 994 + document.getElementById('tier').value = btn.dataset.tier; 995 + updateTierButtons(); 996 + markDirty(); 997 + debouncePreview(); 998 + }); 635 999 }); 636 1000 637 1001 window.addEventListener('beforeunload', (e) => { if (formDirty) e.preventDefault(); }); 638 1002 1003 + document.addEventListener('keydown', (e) => { 1004 + if (e.key === 'Escape') { 1005 + const overlay = document.getElementById('formOverlay'); 1006 + if (overlay && !overlay.hidden) { 1007 + e.preventDefault(); 1008 + closeFormOverlay(); 1009 + } 1010 + } 1011 + }); 1012 + 1013 + document.getElementById('formOverlayClose').addEventListener('click', closeFormOverlay); 1014 + document.querySelector('.form-overlay-backdrop').addEventListener('click', closeFormOverlay); 1015 + 639 1016 refreshBtn.addEventListener('click', loadSchedule); 640 - document.getElementById('overviewRefreshBtn').addEventListener('click', loadSchedule); 641 1017 document.getElementById('newAdBtn').addEventListener('click', goToNewAd); 642 - document.getElementById('overviewNewAdBtn').addEventListener('click', goToNewAd); 643 - document.getElementById('tabBtnOverview').addEventListener('click', () => switchTab('overview', document.getElementById('tabBtnOverview'))); 644 - document.getElementById('tabBtnSchedule').addEventListener('click', () => switchTab('schedule', document.getElementById('tabBtnSchedule'))); 1018 + 1019 + document.getElementById('adsSearch').addEventListener('input', (e) => { 1020 + adsSearchQuery = (e.target.value || '').trim(); 1021 + renderAdCards(); 1022 + }); 1023 + document.querySelectorAll('.status-filter').forEach(btn => { 1024 + btn.addEventListener('click', () => { 1025 + document.querySelectorAll('.status-filter').forEach(b => b.classList.remove('active')); 1026 + btn.classList.add('active'); 1027 + adsFilterStatus = btn.dataset.filter || 'all'; 1028 + renderAdCards(); 1029 + }); 1030 + }); 645 1031 646 1032 document.getElementById('calPrev').addEventListener('click', () => { 647 1033 if (calViewMonth === 0) { calViewMonth = 11; calViewYear--; } else calViewMonth--; ··· 649 1035 }); 650 1036 document.getElementById('calNext').addEventListener('click', () => { 651 1037 if (calViewMonth === 11) { calViewMonth = 0; calViewYear++; } else calViewMonth++; 1038 + renderCalendar(); 1039 + }); 1040 + document.getElementById('calToday').addEventListener('click', () => { 1041 + const now = new Date(); 1042 + calViewYear = now.getFullYear(); 1043 + calViewMonth = now.getMonth(); 652 1044 renderCalendar(); 653 1045 }); 654 1046 655 1047 async function loadSchedule() { 656 1048 setStatus(fetchStatus, 'Connecting…', true); 657 - const banner = document.getElementById('overviewStatusBanner'); 658 - const bannerText = document.getElementById('overviewStatusText'); 659 - const bannerSub = document.getElementById('overviewStatusSub'); 660 - const bannerDot = document.getElementById('overviewStatusDot'); 661 - if (banner && bannerText && bannerSub && bannerDot) { 662 - banner.className = 'overview-status-banner loading'; 663 - bannerText.textContent = 'Loading…'; 664 - bannerSub.textContent = 'Fetching ads'; 665 - bannerDot.className = 'status-banner-dot pending'; 666 - } 1049 + document.getElementById('adCards').classList.add('loading'); 1050 + document.getElementById('calendarWrap').classList.add('loading'); 667 1051 try { 668 - const res = await fetch(API_URL, { credentials: 'include' }); 669 - const data = await res.json(); 1052 + const res = await fetchWithRetry(API_URL, { credentials: 'include' }); 1053 + let data; 1054 + try { data = await res.json(); } catch (_) { data = {}; } 1055 + if (res.status === 401) { 1056 + document.getElementById('adCards').classList.remove('loading'); 1057 + document.getElementById('calendarWrap').classList.remove('loading'); 1058 + show401Banner(); 1059 + return; 1060 + } 670 1061 if (!res.ok) { 1062 + document.getElementById('adCards').classList.remove('loading'); 1063 + document.getElementById('calendarWrap').classList.remove('loading'); 671 1064 setStatus(fetchStatus, 'Not connected', false); 1065 + showErrorBanner('Failed to load', (data.error || res.statusText || 'Unknown error')); 672 1066 return; 673 1067 } 674 - scheduledAds = Array.isArray(data.ads) ? data.ads : data.id != null ? [data] : []; 1068 + scheduledAds = parseAdsResponse(data); 1069 + document.getElementById('adCards').classList.remove('loading'); 1070 + document.getElementById('calendarWrap').classList.remove('loading'); 675 1071 renderAdCards(); 676 1072 renderCalendar(); 677 1073 renderOverview(); ··· 684 1080 loadPostHogStats(); 685 1081 } catch (err) { 686 1082 setStatus(fetchStatus, 'Not connected', false); 687 - const banner = document.getElementById('overviewStatusBanner'); 688 - const bannerText = document.getElementById('overviewStatusText'); 689 - const bannerSub = document.getElementById('overviewStatusSub'); 690 - const bannerDot = document.getElementById('overviewStatusDot'); 691 - if (banner && bannerText && bannerSub && bannerDot) { 692 - banner.className = 'overview-status-banner error'; 693 - bannerText.textContent = 'Failed to load'; 694 - bannerSub.textContent = err.message || 'Network error'; 695 - bannerDot.className = 'status-banner-dot err'; 696 - } 1083 + document.getElementById('adCards').classList.remove('loading'); 1084 + document.getElementById('calendarWrap').classList.remove('loading'); 1085 + showErrorBanner('Failed to load', 'Check connection, then <button type="button" class="btn-as-link" id="retryAfterError">Refresh</button>'); 1086 + document.getElementById('retryAfterError')?.addEventListener('click', loadSchedule); 697 1087 } 698 1088 } 699 1089 700 1090 form.addEventListener('submit', async (e) => { 701 1091 e.preventDefault(); 1092 + if (!validateForm()) { 1093 + const firstErr = form.querySelector('.input-error'); 1094 + if (firstErr) firstErr.scrollIntoView({ behavior: 'smooth', block: 'center' }); 1095 + return; 1096 + } 702 1097 const tier = document.getElementById('tier').value; 703 1098 const payload = { 704 1099 id: document.getElementById('id').value.trim(), 705 1100 tier, 706 - active: document.getElementById('active').checked, 1101 + active: document.getElementById('active').value === 'true', 707 1102 sponsor: document.getElementById('sponsor').value.trim(), 708 1103 headline: document.getElementById('headline').value.trim(), 709 1104 subline: document.getElementById('subline').value.trim() || null, 710 1105 cta: document.getElementById('cta').value.trim(), 711 1106 destination_url: document.getElementById('destination_url').value.trim(), 712 - image_url: document.getElementById('image_url').value.trim() || null, 1107 + image_url: (tier === 'banner' || tier === 'feature') ? (document.getElementById('image_url').value.trim() || null) : null, 713 1108 logo_url: document.getElementById('logo_url').value.trim() || null, 714 1109 placement: document.getElementById('placement').value.trim() || 'home_feed', 715 1110 creative_version: document.getElementById('creative_version').value.trim() || '', ··· 721 1116 return; 722 1117 } 723 1118 setStatus(saveStatus, 'Saving…', true); 1119 + saveBtn.disabled = true; 724 1120 try { 725 - const res = await fetch(API_URL, { 1121 + const res = await fetchWithRetry(API_URL, { 726 1122 method: 'PUT', 727 1123 credentials: 'include', 728 1124 headers: { 'Content-Type': 'application/json' }, 729 1125 body: JSON.stringify(payload), 730 1126 }); 731 - const data = await res.json(); 1127 + let data = {}; 1128 + try { data = await res.json(); } catch (_) {} 1129 + if (res.status === 401) { show401Banner(); setStatus(saveStatus, 'Session expired', false); return; } 1130 + if (res.status === 400) { 1131 + const field = mapErrorToField(data.error); 1132 + if (field) { clearFieldErrors(); setFieldError(field, data.error); document.getElementById(field)?.scrollIntoView({ behavior: 'smooth', block: 'center' }); } 1133 + setStatus(saveStatus, data.error || res.statusText, false); 1134 + return; 1135 + } 732 1136 if (!res.ok) { 733 1137 setStatus(saveStatus, data.error || res.statusText, false); 734 1138 return; 735 1139 } 736 1140 setStatus(saveStatus, 'Saved', true); 737 1141 formDirty = false; 1142 + const ind = document.getElementById('unsavedIndicator'); 1143 + if (ind) ind.hidden = true; 738 1144 loadSchedule(); 1145 + closeFormOverlay(); 1146 + saveBtn.focus(); 739 1147 } catch (err) { 740 - setStatus(saveStatus, err.message || 'Network error', false); 1148 + setStatus(saveStatus, 'Check connection, then Refresh', false); 1149 + } finally { 1150 + saveBtn.disabled = false; 741 1151 } 742 1152 }); 743 1153 ··· 747 1157 <style> 748 1158 *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } 749 1159 :root { 750 - --bg: #0f0f0f; 751 - --surface: #161616; 752 - --border: #2a2a2a; 753 - --text: #e0e0e0; 754 - --muted: #666; 755 - --accent: #7c6bff; 756 - --green: #4ade80; 757 - --red: #f87171; 758 - --yellow: #fbbf24; 759 - --font: 'IBM Plex Mono', monospace; 1160 + --bg: #0d0d0d; 1161 + --surface: #141414; 1162 + --border: #262626; 1163 + --text: #e5e5e5; 1164 + --muted: #737373; 1165 + --accent: #14b8a6; 1166 + --accent-filled: #0d9488; 1167 + --green: #22c55e; 1168 + --red: #ef4444; 1169 + --yellow: #eab308; 1170 + --font: 'DM Sans', system-ui, sans-serif; 1171 + --font-mono: 'JetBrains Mono', monospace; 1172 + --cta-orange: #E87722; 760 1173 } 761 - html { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 12px; line-height: 1.5; -webkit-text-size-adjust: 100%; } 1174 + html { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; line-height: 1.5; -webkit-text-size-adjust: 100%; } 762 1175 body { height: 100vh; margin: 0; overflow: hidden; min-width: 0; } 763 1176 764 1177 .dashboard-wrap { ··· 807 1220 .kv-k { color: var(--muted); white-space: nowrap; } 808 1221 .kv-v { color: var(--accent); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; } 809 1222 810 - .main { display: grid; grid-template-rows: auto 1fr; overflow: hidden; min-width: 0; min-height: 0; } 811 - .tabs { 812 - display: flex; 813 - border-bottom: 1px solid var(--border); 814 - background: var(--surface); 815 - padding: 0 12px; 816 - gap: 2px; 817 - align-items: stretch; 818 - } 819 - .tab { 820 - padding: 10px 14px; 821 - font-family: var(--font); 822 - font-size: 11px; 823 - color: var(--muted); 824 - cursor: pointer; 825 - border: none; 826 - background: none; 827 - border-bottom: 2px solid transparent; 828 - margin-bottom: -1px; 829 - width: auto; 830 - transition: color 0.1s, border-color 0.1s; 831 - display: flex; 832 - align-items: center; 833 - gap: 6px; 834 - } 835 - .tab:hover:not(:disabled) { color: var(--text); } 836 - .tab.active { color: var(--text); border-bottom-color: var(--accent); } 837 - .badge { 838 - background: var(--border); 839 - color: var(--muted); 840 - font-size: 9px; 841 - padding: 1px 5px; 842 - min-width: 16px; 843 - text-align: center; 844 - } 845 - .panel { display: none; overflow-y: auto; overflow-x: hidden; height: 100%; padding: 16px 20px; min-width: 0; } 846 - .panel.active { display: block; } 1223 + .main { display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; min-width: 0; padding: 16px 20px; } 1224 + .schedule-page { flex: 1; min-height: 0; } 1225 + .schedule-grid { display: grid; grid-template-columns: 1fr; gap: 20px; } 1226 + .schedule-calendar { min-width: 0; } 1227 + .schedule-ads { min-width: 0; display: flex; flex-direction: column; gap: 12px; } 847 1228 848 1229 .overview-status-banner { 849 1230 padding: 12px 16px; ··· 863 1244 .status-banner-dot.err { background: var(--red); } 864 1245 .status-banner-text { font-size: 13px; font-weight: 500; } 865 1246 .status-banner-sub { color: var(--muted); font-size: 11px; margin-top: 2px; } 866 - .overview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; } 867 1247 .btn-as-link { 868 1248 padding: 7px 12px; 869 1249 font-size: 12px; 870 1250 font-family: var(--font); 1251 + border-radius: 4px; 871 1252 border: 1px solid var(--accent); 872 1253 color: var(--accent); 873 1254 background: transparent; ··· 875 1256 width: auto; 876 1257 transition: color 0.1s, border-color 0.1s, background 0.1s; 877 1258 } 878 - .btn-as-link:hover { background: var(--accent); color: #fff; } 1259 + .btn-as-link:hover { background: var(--accent-filled); color: #fff; } 1260 + 1261 + .form-overlay { 1262 + position: fixed; inset: 0; z-index: 100; 1263 + display: flex; align-items: center; justify-content: center; 1264 + padding: 16px; 1265 + } 1266 + .form-overlay[hidden] { display: none; } 1267 + .form-overlay-backdrop { 1268 + position: absolute; inset: 0; 1269 + background: rgba(0,0,0,0.6); 1270 + cursor: pointer; 1271 + } 1272 + .form-overlay-panel { 1273 + position: relative; 1274 + background: var(--surface); 1275 + border: 1px solid var(--border); 1276 + max-width: 900px; 1277 + width: 100%; 1278 + max-height: 90vh; 1279 + overflow: hidden; 1280 + display: flex; 1281 + flex-direction: column; 1282 + } 1283 + .form-overlay-header { 1284 + display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; 1285 + padding: 12px 16px; 1286 + border-bottom: 1px solid var(--border); 1287 + flex-shrink: 0; 1288 + } 1289 + .form-overlay-header h2 { font-size: 14px; font-weight: 500; margin: 0; min-width: 0; } 1290 + .active-inactive-toggle.active-inactive-header { justify-self: center; width: auto; min-width: 180px; margin-top: 0; } 1291 + .form-overlay-header > button { 1292 + padding: 4px 8px; 1293 + font-size: 18px; 1294 + line-height: 1; 1295 + border: none; 1296 + background: none; 1297 + color: var(--muted); 1298 + cursor: pointer; 1299 + justify-self: end; 1300 + } 1301 + .form-overlay-header > button:hover { color: var(--text); } 1302 + .form-overlay-body { 1303 + overflow-y: auto; 1304 + scrollbar-gutter: stable; 1305 + padding: 16px 12px; 1306 + flex: 1; 1307 + min-height: 0; 1308 + } 1309 + .form-overlay-footer { 1310 + flex-shrink: 0; 1311 + padding: 16px 12px; 1312 + border-top: 1px solid var(--border); 1313 + background: var(--surface); 1314 + } 879 1315 880 1316 .admin-section { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; min-width: 0; } 881 1317 882 - .group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; } 883 - .group-label { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; } 884 - .field-label { color: var(--muted); font-size: 10px; margin-bottom: 3px; } 1318 + .admin-form { display: flex; flex-direction: column; gap: 24px; } 1319 + .admin-form .group { margin-bottom: 0; } 1320 + .group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; } 1321 + .group-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; padding: 0 0 6px; cursor: pointer; color: inherit; font: inherit; } 1322 + .group-toggle .group-label { margin-bottom: 0; } 1323 + .group-toggle-icon { font-size: 10px; color: var(--muted); } 1324 + .group-label { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0; } 1325 + .field { display: flex; flex-direction: column; gap: 4px; } 1326 + .field-label { color: var(--muted); font-size: 11px; margin: 0; } 1327 + .field-error { display: block; font-size: 11px; color: var(--red); margin: 0; min-height: 0; } 885 1328 .checkbox-label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 12px; cursor: pointer; } 886 1329 .checkbox-label input { width: auto; margin: 0; } 887 1330 888 1331 input, select { 889 1332 width: 100%; 890 1333 min-width: 0; 1334 + min-height: 40px; 891 1335 background: var(--bg); 892 1336 border: 1px solid var(--border); 893 1337 color: var(--text); 894 - font-family: var(--font); 895 - font-size: 12px; 896 - padding: 7px 10px; 1338 + font-family: var(--font-mono); 1339 + font-size: 14px; 1340 + padding: 10px 12px; 897 1341 outline: none; 898 1342 transition: border-color 0.15s; 899 - margin-bottom: 4px; 1343 + margin-bottom: 0; 900 1344 } 901 1345 input:focus, select:focus { border-color: var(--accent); } 1346 + input.input-error { border-color: var(--red); } 902 1347 903 1348 button { 904 1349 font-family: var(--font); 905 1350 font-size: 12px; 1351 + transition: color 0.15s, border-color 0.15s, background 0.15s; 906 1352 padding: 7px 12px; 907 1353 cursor: pointer; 908 1354 border: 1px solid var(--border); ··· 912 1358 } 913 1359 button:hover:not(:disabled) { color: var(--text); border-color: var(--text); } 914 1360 button.primary { border-color: var(--accent); color: var(--accent); } 915 - button.primary:hover:not(:disabled) { background: var(--accent); color: #fff; } 1361 + button.primary:hover:not(:disabled) { background: var(--accent-filled); color: #fff; } 916 1362 button.delete-btn { border-color: var(--red); color: var(--red); margin-left: auto; } 917 1363 button.delete-btn:hover:not(:disabled) { background: var(--red); color: #fff; } 918 1364 .date-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; } 919 1365 .date-presets button { width: auto; } 1366 + .end-at-wrap { margin-top: 6px; } 1367 + #imageUrlWrap { 1368 + overflow: hidden; 1369 + max-height: 100px; 1370 + opacity: 1; 1371 + transition: opacity 0.2s ease, max-height 0.25s ease; 1372 + } 1373 + #imageUrlWrap.image-url-hidden { 1374 + opacity: 0; 1375 + max-height: 0; 1376 + pointer-events: none; 1377 + } 920 1378 .clear-dates-wrap { margin-top: 6px; } 921 1379 .clear-dates-btn { padding: 2px 0; font-size: 10px; color: var(--muted); border: none; background: none; cursor: pointer; text-decoration: underline; } 922 1380 .clear-dates-btn:hover { color: var(--text); } 923 1381 924 - .form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); } 1382 + .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0; padding: 0; position: relative; } 1383 + .form-actions .delete-btn { margin-left: 0; } 1384 + .form-actions-right { display: flex; align-items: center; gap: 12px; margin-left: auto; } 1385 + .active-inactive-toggle { 1386 + display: flex; width: 100%; margin-top: 12px; border: 1px solid var(--border); 1387 + } 1388 + .active-inactive-btn { 1389 + flex: 1; padding: 10px 16px; font-size: 13px; font-weight: 500; 1390 + border: none; background: transparent; color: var(--muted); 1391 + cursor: pointer; transition: color 0.15s, background 0.15s; 1392 + } 1393 + .active-inactive-btn:first-child { border-right: none; } 1394 + .active-inactive-btn:hover { color: var(--text); } 1395 + .active-inactive-btn.active { background: rgba(34,197,94,0.12); color: var(--green); } 1396 + .active-inactive-btn:last-child.active { background: rgba(115,115,115,0.15); color: var(--muted); } 1397 + 1398 + .tier-toggle { 1399 + display: flex; width: 100%; margin-top: 12px; border: 1px solid var(--border); 1400 + } 1401 + .schedule-group { gap: 8px; } 1402 + .schedule-group .date-presets { margin-top: 8px; margin-bottom: 0; } 1403 + .tier-btn { 1404 + flex: 1; padding: 10px 16px; font-size: 13px; font-weight: 500; 1405 + border: none; background: transparent; color: var(--muted); 1406 + cursor: pointer; transition: color 0.15s, background 0.15s; 1407 + } 1408 + .tier-btn:not(:last-child) { border-right: none; } 1409 + .tier-btn:hover { color: var(--text); } 1410 + .tier-btn.active { background: rgba(20,184,166,0.12); color: var(--accent); } 1411 + .unsaved-indicator { font-size: 11px; color: var(--yellow); position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; } 925 1412 .save-status { font-size: 11px; color: var(--muted); } 926 1413 .save-status.status-ok { color: var(--green); } 927 1414 .save-status.status-err { color: var(--red); } 928 1415 1416 + #adCards { display: flex; flex-direction: column; gap: 4px; } 929 1417 .ad-cards { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; } 1418 + .ad-cards-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; } 1419 + .main-toolbar { 1420 + display: flex; align-items: center; gap: 12px; flex-wrap: wrap; 1421 + margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); 1422 + } 1423 + .toolbar-search { width: 180px; max-width: 100%; margin: 0; } 1424 + .toolbar-filters { display: flex; flex-wrap: wrap; gap: 4px; } 1425 + .ads-status-filters { display: flex; flex-wrap: wrap; gap: 4px; } 1426 + .status-filter { padding: 4px 8px; font-size: 10px; } 1427 + .status-filter.active { border-color: var(--accent); color: var(--accent); } 1428 + .ad-cards-group:last-child { margin-bottom: 0; } 1429 + .ad-cards-group-label { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; } 1430 + .ad-card-wrap { display: flex; align-items: flex-start; gap: 4px; width: 100%; } 1431 + .ad-card-wrap .ad-card { flex: 1; min-width: 0; } 1432 + .ad-card-action { flex-shrink: 0; width: 28px; height: 28px; min-width: 28px; padding: 0; font-size: 11px; display: flex; align-items: center; justify-content: center; } 930 1433 .ad-card { 931 1434 display: flex; flex-direction: column; align-items: flex-start; gap: 4px; 932 1435 padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); 933 1436 color: var(--text); font: inherit; text-align: left; cursor: pointer; 934 - transition: border-color 0.1s, background 0.1s; 1437 + transition: border-color 0.15s, background 0.15s; 935 1438 } 936 1439 .ad-card:hover { border-color: var(--text); } 937 - .ad-card.selected { border-color: var(--accent); background: rgba(124,107,255,0.08); } 1440 + .ad-card.selected { border-color: var(--accent); background: rgba(20,184,166,0.08); } 938 1441 .ad-card-head { font-weight: 500; font-size: 11px; } 939 1442 .ad-card-dates { font-size: 10px; color: var(--muted); } 940 1443 .ad-card-stats { font-size: 10px; color: var(--green); display: block; margin-top: 2px; } ··· 945 1448 .kpi-item { display: flex; flex-direction: column; gap: 2px; } 946 1449 .kpi-label { font-size: 9px; color: var(--muted); text-transform: uppercase; } 947 1450 .kpi-value { font-size: 13px; font-weight: 500; color: var(--green); } 948 - .chip { font-size: 9px; padding: 1px 5px; border: 1px solid var(--border); color: var(--muted); line-height: 1.6; } 949 - .chip-live { color: var(--green); border-color: rgba(74,222,128,0.4); } 950 - .chip-scheduled { color: var(--accent); border-color: rgba(124,107,255,0.4); } 951 - .chip-ended { color: var(--muted); opacity: 0.8; } 952 - .chip-paused { color: var(--yellow); border-color: rgba(251,191,36,0.4); } 1451 + .chip { font-size: 10px; font-weight: 500; padding: 2px 6px; border: 1px solid transparent; border-radius: 3px; line-height: 1.5; } 1452 + .chip-live { color: var(--green); background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); } 1453 + .chip-scheduled { color: var(--accent); background: rgba(20,184,166,0.15); border-color: rgba(20,184,166,0.3); } 1454 + .chip-ended { color: var(--muted); background: rgba(115,115,115,0.1); opacity: 0.9; } 1455 + .chip-paused { color: var(--yellow); background: rgba(234,179,8,0.15); border-color: rgba(234,179,8,0.3); } 953 1456 954 - .calendar-wrap { margin-top: 16px; border: 1px solid var(--border); background: var(--surface); padding: 12px 16px; width: 100%; max-width: 420px; } 955 - .calendar-header { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; } 956 - .cal-month-label { font-size: 13px; font-weight: 500; color: var(--text); margin: 0; } 1457 + #adCards.loading, #calendarWrap.loading { opacity: 0.6; pointer-events: none; } 1458 + .calendar-empty { margin-top: 16px; padding: 24px; border: 1px dashed var(--border); background: var(--surface); text-align: center; max-width: 240px; } 1459 + .calendar-empty-text { color: var(--muted); font-size: 13px; margin: 0; } 1460 + .calendar-wrap { margin-top: 16px; border: 1px solid var(--border); background: var(--surface); padding: 16px 20px; width: 100%; max-width: 100%; } 1461 + .calendar-header { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 14px; } 1462 + .cal-month-label { font-size: 15px; font-weight: 500; color: var(--text); margin: 0; } 957 1463 .cal-nav { padding: 4px 10px; font-size: 11px; background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer; } 1464 + .cal-nav.cal-today { margin-left: 8px; } 958 1465 .cal-nav:hover { color: var(--text); border-color: var(--text); } 959 1466 .calendar-grid { display: flex; flex-direction: column; gap: 0; } 960 - .cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 6px; border-bottom: 1px solid var(--border); } 1467 + .cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 8px; border-bottom: 1px solid var(--border); } 961 1468 .cal-weekdays span { text-align: center; } 962 1469 .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); } 963 - .cal-cell { height: 52px; min-height: 52px; padding: 4px; background: var(--surface); display: flex; flex-direction: column; font-size: 10px; } 1470 + .cal-cell { height: 72px; min-height: 72px; padding: 8px; background: var(--surface); display: flex; flex-direction: column; font-size: 11px; } 964 1471 .cal-cell.other-month { background: var(--bg); } 965 1472 .cal-cell.other-month .cal-cell-num { color: var(--muted); opacity: 0.6; } 966 1473 .cal-cell.today { outline: 1px solid var(--accent); outline-offset: -1px; z-index: 1; } 967 1474 .cal-cell.today .cal-cell-num { color: var(--accent); font-weight: 500; } 968 - .cal-cell-num { font-size: 11px; color: var(--text); margin-bottom: 4px; } 1475 + .cal-cell.has-conflict { outline: 1px dashed var(--yellow); outline-offset: -1px; } 1476 + .cal-cell-num { font-size: 12px; color: var(--text); margin-bottom: 4px; } 969 1477 .cal-cell-ads { display: flex; flex-wrap: wrap; gap: 2px; align-content: flex-start; overflow: hidden; } 970 - .cal-ad-pill { font-size: 9px; padding: 1px 4px; border: none; border-radius: 2px; cursor: pointer; font-family: var(--font); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } 971 - .cal-ad-pill.chip-live { background: rgba(74,222,128,0.2); color: var(--green); } 972 - .cal-ad-pill.chip-scheduled { background: rgba(124,107,255,0.2); color: var(--accent); } 1478 + .cal-ad-pill { font-size: 10px; padding: 5px 8px; min-height: 28px; border: none; border-radius: 3px; cursor: pointer; font-family: var(--font); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } 1479 + .cal-ad-pill.chip-live { background: rgba(34,197,94,0.2); color: var(--green); } 1480 + .cal-ad-pill.chip-scheduled { background: rgba(20,184,166,0.2); color: var(--accent); } 973 1481 .cal-ad-pill.chip-ended { background: rgba(102,102,102,0.2); color: var(--muted); } 974 1482 .cal-ad-pill.chip-paused { background: rgba(251,191,36,0.2); color: var(--yellow); } 975 1483 .cal-ad-pill:hover { opacity: 0.9; } ··· 981 1489 .cal-legend-dot.ended { background: var(--muted); } 982 1490 .cal-legend-dot.paused { background: var(--yellow); } 983 1491 984 - .admin-editor-grid { display: grid; grid-template-columns: 1fr minmax(200px, 18rem); gap: 20px; min-width: 0; } 985 - .preview-pane { position: sticky; top: 20px; align-self: start; } 986 - .ad-preview { border: 1px solid var(--border); padding: 12px; background: var(--surface); min-height: 8rem; } 987 - .preview { display: flex; flex-direction: column; gap: 6px; font-size: 11px; } 988 - .preview-sponsor { font-size: 9px; text-transform: uppercase; color: var(--muted); } 989 - .preview-headline { font-weight: 500; } 990 - .preview-subline { font-size: 10px; color: var(--muted); } 991 - .preview-cta { padding: 4px 8px; background: var(--accent); color: #fff; border: none; font-size: 10px; cursor: default; width: auto; } 992 - .preview-cta-sm { padding: 2px 6px; font-size: 9px; } 993 - .preview-img { max-width: 100%; height: auto; max-height: 4rem; object-fit: cover; } 994 - .preview-img-lg { max-height: 6rem; } 995 - .preview-img-placeholder { width: 100%; height: 3rem; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); } 996 - .preview-img-placeholder-lg { height: 5rem; } 997 - .preview-logo { width: 24px; height: 24px; object-fit: contain; } 998 - .preview-content { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; } 1492 + .admin-editor-grid { display: grid; grid-template-columns: 1fr minmax(280px, 393px); gap: 20px; min-width: 0; } 1493 + .preview-pane { position: sticky; top: 0; align-self: start; padding-top: 0; } 1494 + .preview-pane > :first-child { margin-top: 0; } 1495 + .id-version-row { display: flex; flex-direction: row; gap: 8px; } 1496 + .id-version-row input:first-child { flex: 1; min-width: 0; } 1497 + .id-version-row .version-input { width: 64px; min-width: 64px; flex-shrink: 0; } 1498 + .id-version-header { min-width: 0; max-width: 320px; justify-self: center; } 1499 + .id-version-header input { min-height: 36px; padding: 6px 10px; font-size: 13px; } 1500 + .ad-preview { border: 1px solid var(--border); padding: 0; background: var(--surface); min-height: 8rem; overflow: hidden; } 1501 + .preview { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; font-size: 14px; text-align: left; width: 100%; max-width: 100%; } 1502 + .preview.preview-text { padding: 16px; } 1503 + .preview.preview-banner .preview-copy-block, 1504 + .preview.preview-feature .preview-copy-block { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; width: 100%; } 1505 + .preview-sponsor-line { display: flex; align-items: center; gap: 8px; } 1506 + .preview-sponsor { font-size: 13px; color: var(--muted); } 1507 + .preview-logo { width: 24px; height: 24px; object-fit: contain; border-radius: 6px; flex-shrink: 0; } 1508 + .preview-copy { display: flex; flex-direction: column; gap: 10px; width: 100%; } 1509 + .preview-headline { font-size: 17px; font-weight: 600; line-height: 1.3; } 1510 + .preview-subline { font-size: 14px; color: var(--muted); line-height: 1.4; } 1511 + .preview-cta-wrap { 1512 + display: flex; align-items: center; justify-content: center; gap: 6px; 1513 + width: 100%; padding: 10px 0; 1514 + color: var(--cta-orange); background: rgba(232, 119, 34, 0.12); 1515 + border-radius: 8px; font-size: 14px; font-weight: 500; cursor: default; border: none; 1516 + } 1517 + .preview-cta-arrow { font-size: 12px; opacity: 0.9; } 1518 + .preview-img-wrap { width: 100%; overflow: hidden; position: relative; background: var(--border); } 1519 + .preview-img { width: 100%; height: 100%; object-fit: cover; display: block; } 1520 + .preview-img-wrap.preview-img-error { background: var(--border); } 1521 + .preview-img-wrap.preview-img-error .preview-img { display: none; } 1522 + .preview-img-placeholder { width: 100%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); } 999 1523 1000 1524 .footer { margin-top: 20px; font-size: 11px; color: var(--muted); } 1001 1525 .footer a { color: var(--accent); text-decoration: none; } ··· 1004 1528 ::-webkit-scrollbar { width: 4px; height: 4px; } 1005 1529 ::-webkit-scrollbar-thumb { background: var(--border); } 1006 1530 1531 + .flatpickr-calendar { z-index: 99999; } 1532 + .flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange { background: var(--accent) !important; border-color: var(--accent) !important; } 1533 + .flatpickr-day:hover { background: var(--border) !important; border-color: var(--border) !important; } 1534 + #start_at[readonly], #end_at[readonly] { cursor: pointer; } 1535 + 1007 1536 @media (min-width: 900px) { 1008 1537 .dashboard-wrap { grid-template-columns: 260px 1fr; } 1538 + .schedule-grid { grid-template-columns: 1fr 420px; } 1009 1539 } 1010 1540 @media (min-width: 1200px) { 1011 1541 .dashboard-wrap { grid-template-columns: 280px 1fr; } 1012 - .calendar-wrap { max-width: 480px; } 1542 + .schedule-grid { grid-template-columns: 1fr 480px; } 1543 + .cal-cell { height: 80px; min-height: 80px; } 1544 + .cal-ad-pill { font-size: 11px; min-height: 30px; } 1013 1545 } 1014 1546 1015 1547 @media (max-width: 768px) { ··· 1032 1564 .sidebar .group { min-width: 0; } 1033 1565 .sidebar .kv { font-size: 11px; } 1034 1566 .sidebar button { width: 100%; } 1035 - .panel { padding: 12px 16px; } 1036 - .tabs { padding: 0 8px; overflow-x: auto; } 1037 - .tab { padding: 8px 10px; font-size: 11px; } 1567 + .main { padding: 12px 16px; } 1038 1568 .overview-status-banner { padding: 10px 12px; margin-bottom: 12px; } 1039 1569 .status-banner-text { font-size: 12px; } 1040 1570 .status-banner-sub { font-size: 10px; } ··· 1043 1573 .cal-legend { margin-top: 10px; padding-top: 10px; gap: 8px; font-size: 9px; } 1044 1574 .ad-card { padding: 8px 10px; min-width: 0; } 1045 1575 .ad-card-head { font-size: 10px; } 1046 - .form-actions { margin-top: 16px; padding-top: 16px; gap: 8px; } 1576 + .form-actions, .form-actions-right { gap: 8px; } 1047 1577 } 1048 1578 @media (max-width: 400px) { 1049 1579 .topbar { padding: 0 8px; gap: 6px; }
-8
workers/gymtracker-ads-api/src/index.ts
··· 17 17 * GET /admin — serve admin page (Access protected) 18 18 */ 19 19 20 - interface Env { 21 - AD_CONFIG: KVNamespace; 22 - ADMIN_API_KEY?: string; 23 - POSTHOG_PERSONAL_API_KEY?: string; 24 - POSTHOG_PROJECT_ID?: string; 25 - POSTHOG_HOST?: string; 26 - } 27 - 28 20 interface AdConfig { 29 21 id: string; 30 22 active: boolean;
+12
workers/gymtracker-ads-api/tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "target": "ES2022", 4 + "module": "ESNext", 5 + "moduleResolution": "bundler", 6 + "lib": ["ES2022"], 7 + "strict": true, 8 + "noEmit": true, 9 + "skipLibCheck": true 10 + }, 11 + "include": ["src/**/*", "worker-configuration.d.ts", "env.d.ts"] 12 + }
+12045
workers/gymtracker-ads-api/worker-configuration.d.ts
··· 1 + /* eslint-disable */ 2 + // Generated by Wrangler by running `wrangler types` (hash: 8c99578df02c89c9f0ebc90f133e1438) 3 + // Runtime types generated with workerd@1.20260317.1 2025-03-07 nodejs_compat 4 + declare namespace Cloudflare { 5 + interface GlobalProps { 6 + mainModule: typeof import("./src/index"); 7 + } 8 + interface Env { 9 + AD_CONFIG: KVNamespace; 10 + POSTHOG_PROJECT_ID: "352692"; 11 + POSTHOG_HOST: "https://us.posthog.com"; 12 + } 13 + } 14 + interface Env extends Cloudflare.Env {} 15 + 16 + // Begin runtime types 17 + /*! ***************************************************************************** 18 + Copyright (c) Cloudflare. All rights reserved. 19 + Copyright (c) Microsoft Corporation. All rights reserved. 20 + 21 + Licensed under the Apache License, Version 2.0 (the "License"); you may not use 22 + this file except in compliance with the License. You may obtain a copy of the 23 + License at http://www.apache.org/licenses/LICENSE-2.0 24 + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 25 + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 26 + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 27 + MERCHANTABLITY OR NON-INFRINGEMENT. 28 + See the Apache Version 2.0 License for specific language governing permissions 29 + and limitations under the License. 30 + ***************************************************************************** */ 31 + /* eslint-disable */ 32 + // noinspection JSUnusedGlobalSymbols 33 + declare var onmessage: never; 34 + /** 35 + * The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API. 36 + * 37 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) 38 + */ 39 + declare class DOMException extends Error { 40 + constructor(message?: string, name?: string); 41 + /** 42 + * The **`message`** read-only property of the a message or description associated with the given error name. 43 + * 44 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) 45 + */ 46 + readonly message: string; 47 + /** 48 + * The **`name`** read-only property of the one of the strings associated with an error name. 49 + * 50 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) 51 + */ 52 + readonly name: string; 53 + /** 54 + * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match. 55 + * @deprecated 56 + * 57 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code) 58 + */ 59 + readonly code: number; 60 + static readonly INDEX_SIZE_ERR: number; 61 + static readonly DOMSTRING_SIZE_ERR: number; 62 + static readonly HIERARCHY_REQUEST_ERR: number; 63 + static readonly WRONG_DOCUMENT_ERR: number; 64 + static readonly INVALID_CHARACTER_ERR: number; 65 + static readonly NO_DATA_ALLOWED_ERR: number; 66 + static readonly NO_MODIFICATION_ALLOWED_ERR: number; 67 + static readonly NOT_FOUND_ERR: number; 68 + static readonly NOT_SUPPORTED_ERR: number; 69 + static readonly INUSE_ATTRIBUTE_ERR: number; 70 + static readonly INVALID_STATE_ERR: number; 71 + static readonly SYNTAX_ERR: number; 72 + static readonly INVALID_MODIFICATION_ERR: number; 73 + static readonly NAMESPACE_ERR: number; 74 + static readonly INVALID_ACCESS_ERR: number; 75 + static readonly VALIDATION_ERR: number; 76 + static readonly TYPE_MISMATCH_ERR: number; 77 + static readonly SECURITY_ERR: number; 78 + static readonly NETWORK_ERR: number; 79 + static readonly ABORT_ERR: number; 80 + static readonly URL_MISMATCH_ERR: number; 81 + static readonly QUOTA_EXCEEDED_ERR: number; 82 + static readonly TIMEOUT_ERR: number; 83 + static readonly INVALID_NODE_TYPE_ERR: number; 84 + static readonly DATA_CLONE_ERR: number; 85 + get stack(): any; 86 + set stack(value: any); 87 + } 88 + type WorkerGlobalScopeEventMap = { 89 + fetch: FetchEvent; 90 + scheduled: ScheduledEvent; 91 + queue: QueueEvent; 92 + unhandledrejection: PromiseRejectionEvent; 93 + rejectionhandled: PromiseRejectionEvent; 94 + }; 95 + declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> { 96 + EventTarget: typeof EventTarget; 97 + } 98 + /* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). * 99 + * The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). 100 + * 101 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) 102 + */ 103 + interface Console { 104 + "assert"(condition?: boolean, ...data: any[]): void; 105 + /** 106 + * The **`console.clear()`** static method clears the console if possible. 107 + * 108 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) 109 + */ 110 + clear(): void; 111 + /** 112 + * The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called. 113 + * 114 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) 115 + */ 116 + count(label?: string): void; 117 + /** 118 + * The **`console.countReset()`** static method resets counter used with console/count_static. 119 + * 120 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) 121 + */ 122 + countReset(label?: string): void; 123 + /** 124 + * The **`console.debug()`** static method outputs a message to the console at the 'debug' log level. 125 + * 126 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) 127 + */ 128 + debug(...data: any[]): void; 129 + /** 130 + * The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object. 131 + * 132 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) 133 + */ 134 + dir(item?: any, options?: any): void; 135 + /** 136 + * The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element. 137 + * 138 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) 139 + */ 140 + dirxml(...data: any[]): void; 141 + /** 142 + * The **`console.error()`** static method outputs a message to the console at the 'error' log level. 143 + * 144 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) 145 + */ 146 + error(...data: any[]): void; 147 + /** 148 + * The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called. 149 + * 150 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) 151 + */ 152 + group(...data: any[]): void; 153 + /** 154 + * The **`console.groupCollapsed()`** static method creates a new inline group in the console. 155 + * 156 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) 157 + */ 158 + groupCollapsed(...data: any[]): void; 159 + /** 160 + * The **`console.groupEnd()`** static method exits the current inline group in the console. 161 + * 162 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) 163 + */ 164 + groupEnd(): void; 165 + /** 166 + * The **`console.info()`** static method outputs a message to the console at the 'info' log level. 167 + * 168 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) 169 + */ 170 + info(...data: any[]): void; 171 + /** 172 + * The **`console.log()`** static method outputs a message to the console. 173 + * 174 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) 175 + */ 176 + log(...data: any[]): void; 177 + /** 178 + * The **`console.table()`** static method displays tabular data as a table. 179 + * 180 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) 181 + */ 182 + table(tabularData?: any, properties?: string[]): void; 183 + /** 184 + * The **`console.time()`** static method starts a timer you can use to track how long an operation takes. 185 + * 186 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) 187 + */ 188 + time(label?: string): void; 189 + /** 190 + * The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static. 191 + * 192 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) 193 + */ 194 + timeEnd(label?: string): void; 195 + /** 196 + * The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static. 197 + * 198 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) 199 + */ 200 + timeLog(label?: string, ...data: any[]): void; 201 + timeStamp(label?: string): void; 202 + /** 203 + * The **`console.trace()`** static method outputs a stack trace to the console. 204 + * 205 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) 206 + */ 207 + trace(...data: any[]): void; 208 + /** 209 + * The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level. 210 + * 211 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) 212 + */ 213 + warn(...data: any[]): void; 214 + } 215 + declare const console: Console; 216 + type BufferSource = ArrayBufferView | ArrayBuffer; 217 + type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; 218 + declare namespace WebAssembly { 219 + class CompileError extends Error { 220 + constructor(message?: string); 221 + } 222 + class RuntimeError extends Error { 223 + constructor(message?: string); 224 + } 225 + type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128"; 226 + interface GlobalDescriptor { 227 + value: ValueType; 228 + mutable?: boolean; 229 + } 230 + class Global { 231 + constructor(descriptor: GlobalDescriptor, value?: any); 232 + value: any; 233 + valueOf(): any; 234 + } 235 + type ImportValue = ExportValue | number; 236 + type ModuleImports = Record<string, ImportValue>; 237 + type Imports = Record<string, ModuleImports>; 238 + type ExportValue = Function | Global | Memory | Table; 239 + type Exports = Record<string, ExportValue>; 240 + class Instance { 241 + constructor(module: Module, imports?: Imports); 242 + readonly exports: Exports; 243 + } 244 + interface MemoryDescriptor { 245 + initial: number; 246 + maximum?: number; 247 + shared?: boolean; 248 + } 249 + class Memory { 250 + constructor(descriptor: MemoryDescriptor); 251 + readonly buffer: ArrayBuffer; 252 + grow(delta: number): number; 253 + } 254 + type ImportExportKind = "function" | "global" | "memory" | "table"; 255 + interface ModuleExportDescriptor { 256 + kind: ImportExportKind; 257 + name: string; 258 + } 259 + interface ModuleImportDescriptor { 260 + kind: ImportExportKind; 261 + module: string; 262 + name: string; 263 + } 264 + abstract class Module { 265 + static customSections(module: Module, sectionName: string): ArrayBuffer[]; 266 + static exports(module: Module): ModuleExportDescriptor[]; 267 + static imports(module: Module): ModuleImportDescriptor[]; 268 + } 269 + type TableKind = "anyfunc" | "externref"; 270 + interface TableDescriptor { 271 + element: TableKind; 272 + initial: number; 273 + maximum?: number; 274 + } 275 + class Table { 276 + constructor(descriptor: TableDescriptor, value?: any); 277 + readonly length: number; 278 + get(index: number): any; 279 + grow(delta: number, value?: any): number; 280 + set(index: number, value?: any): void; 281 + } 282 + function instantiate(module: Module, imports?: Imports): Promise<Instance>; 283 + function validate(bytes: BufferSource): boolean; 284 + } 285 + /** 286 + * The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a service worker. 287 + * Available only in secure contexts. 288 + * 289 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope) 290 + */ 291 + interface ServiceWorkerGlobalScope extends WorkerGlobalScope { 292 + DOMException: typeof DOMException; 293 + WorkerGlobalScope: typeof WorkerGlobalScope; 294 + btoa(data: string): string; 295 + atob(data: string): string; 296 + setTimeout(callback: (...args: any[]) => void, msDelay?: number): number; 297 + setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number; 298 + clearTimeout(timeoutId: number | null): void; 299 + setInterval(callback: (...args: any[]) => void, msDelay?: number): number; 300 + setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number; 301 + clearInterval(timeoutId: number | null): void; 302 + queueMicrotask(task: Function): void; 303 + structuredClone<T>(value: T, options?: StructuredSerializeOptions): T; 304 + reportError(error: any): void; 305 + fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>; 306 + self: ServiceWorkerGlobalScope; 307 + crypto: Crypto; 308 + caches: CacheStorage; 309 + scheduler: Scheduler; 310 + performance: Performance; 311 + Cloudflare: Cloudflare; 312 + readonly origin: string; 313 + Event: typeof Event; 314 + ExtendableEvent: typeof ExtendableEvent; 315 + CustomEvent: typeof CustomEvent; 316 + PromiseRejectionEvent: typeof PromiseRejectionEvent; 317 + FetchEvent: typeof FetchEvent; 318 + TailEvent: typeof TailEvent; 319 + TraceEvent: typeof TailEvent; 320 + ScheduledEvent: typeof ScheduledEvent; 321 + MessageEvent: typeof MessageEvent; 322 + CloseEvent: typeof CloseEvent; 323 + ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader; 324 + ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader; 325 + ReadableStream: typeof ReadableStream; 326 + WritableStream: typeof WritableStream; 327 + WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter; 328 + TransformStream: typeof TransformStream; 329 + ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy; 330 + CountQueuingStrategy: typeof CountQueuingStrategy; 331 + ErrorEvent: typeof ErrorEvent; 332 + EventSource: typeof EventSource; 333 + ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest; 334 + ReadableStreamDefaultController: typeof ReadableStreamDefaultController; 335 + ReadableByteStreamController: typeof ReadableByteStreamController; 336 + WritableStreamDefaultController: typeof WritableStreamDefaultController; 337 + TransformStreamDefaultController: typeof TransformStreamDefaultController; 338 + CompressionStream: typeof CompressionStream; 339 + DecompressionStream: typeof DecompressionStream; 340 + TextEncoderStream: typeof TextEncoderStream; 341 + TextDecoderStream: typeof TextDecoderStream; 342 + Headers: typeof Headers; 343 + Body: typeof Body; 344 + Request: typeof Request; 345 + Response: typeof Response; 346 + WebSocket: typeof WebSocket; 347 + WebSocketPair: typeof WebSocketPair; 348 + WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair; 349 + AbortController: typeof AbortController; 350 + AbortSignal: typeof AbortSignal; 351 + TextDecoder: typeof TextDecoder; 352 + TextEncoder: typeof TextEncoder; 353 + navigator: Navigator; 354 + Navigator: typeof Navigator; 355 + URL: typeof URL; 356 + URLSearchParams: typeof URLSearchParams; 357 + URLPattern: typeof URLPattern; 358 + Blob: typeof Blob; 359 + File: typeof File; 360 + FormData: typeof FormData; 361 + Crypto: typeof Crypto; 362 + SubtleCrypto: typeof SubtleCrypto; 363 + CryptoKey: typeof CryptoKey; 364 + CacheStorage: typeof CacheStorage; 365 + Cache: typeof Cache; 366 + FixedLengthStream: typeof FixedLengthStream; 367 + IdentityTransformStream: typeof IdentityTransformStream; 368 + HTMLRewriter: typeof HTMLRewriter; 369 + } 370 + declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void; 371 + declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void; 372 + /** 373 + * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. 374 + * 375 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) 376 + */ 377 + declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean; 378 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */ 379 + declare function btoa(data: string): string; 380 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */ 381 + declare function atob(data: string): string; 382 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */ 383 + declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number; 384 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */ 385 + declare function setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number; 386 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */ 387 + declare function clearTimeout(timeoutId: number | null): void; 388 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */ 389 + declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number; 390 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */ 391 + declare function setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number; 392 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */ 393 + declare function clearInterval(timeoutId: number | null): void; 394 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */ 395 + declare function queueMicrotask(task: Function): void; 396 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */ 397 + declare function structuredClone<T>(value: T, options?: StructuredSerializeOptions): T; 398 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */ 399 + declare function reportError(error: any): void; 400 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */ 401 + declare function fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>; 402 + declare const self: ServiceWorkerGlobalScope; 403 + /** 404 + * The Web Crypto API provides a set of low-level functions for common cryptographic tasks. 405 + * The Workers runtime implements the full surface of this API, but with some differences in 406 + * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms) 407 + * compared to those implemented in most browsers. 408 + * 409 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/) 410 + */ 411 + declare const crypto: Crypto; 412 + /** 413 + * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache. 414 + * 415 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/) 416 + */ 417 + declare const caches: CacheStorage; 418 + declare const scheduler: Scheduler; 419 + /** 420 + * The Workers runtime supports a subset of the Performance API, used to measure timing and performance, 421 + * as well as timing of subrequests and other operations. 422 + * 423 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/) 424 + */ 425 + declare const performance: Performance; 426 + declare const Cloudflare: Cloudflare; 427 + declare const origin: string; 428 + declare const navigator: Navigator; 429 + interface TestController { 430 + } 431 + interface ExecutionContext<Props = unknown> { 432 + waitUntil(promise: Promise<any>): void; 433 + passThroughOnException(): void; 434 + readonly props: Props; 435 + } 436 + type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>; 437 + type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (events: TraceItem[], env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>; 438 + type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (traces: TraceItem[], env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>; 439 + type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (event: TailStream.TailEvent<TailStream.Onset>, env: Env, ctx: ExecutionContext<Props>) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>; 440 + type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (controller: ScheduledController, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>; 441 + type ExportedHandlerQueueHandler<Env = unknown, Message = unknown, Props = unknown> = (batch: MessageBatch<Message>, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>; 442 + type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (controller: TestController, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>; 443 + interface ExportedHandler<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown, Props = unknown> { 444 + fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>; 445 + tail?: ExportedHandlerTailHandler<Env, Props>; 446 + trace?: ExportedHandlerTraceHandler<Env, Props>; 447 + tailStream?: ExportedHandlerTailStreamHandler<Env, Props>; 448 + scheduled?: ExportedHandlerScheduledHandler<Env, Props>; 449 + test?: ExportedHandlerTestHandler<Env, Props>; 450 + email?: EmailExportedHandler<Env, Props>; 451 + queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>; 452 + } 453 + interface StructuredSerializeOptions { 454 + transfer?: any[]; 455 + } 456 + declare abstract class Navigator { 457 + sendBeacon(url: string, body?: BodyInit): boolean; 458 + readonly userAgent: string; 459 + readonly hardwareConcurrency: number; 460 + } 461 + interface AlarmInvocationInfo { 462 + readonly isRetry: boolean; 463 + readonly retryCount: number; 464 + } 465 + interface Cloudflare { 466 + readonly compatibilityFlags: Record<string, boolean>; 467 + } 468 + interface DurableObject { 469 + fetch(request: Request): Response | Promise<Response>; 470 + alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>; 471 + webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>; 472 + webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>; 473 + webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>; 474 + } 475 + type DurableObjectStub<T extends Rpc.DurableObjectBranded | undefined = undefined> = Fetcher<T, "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"> & { 476 + readonly id: DurableObjectId; 477 + readonly name?: string; 478 + }; 479 + interface DurableObjectId { 480 + toString(): string; 481 + equals(other: DurableObjectId): boolean; 482 + readonly name?: string; 483 + } 484 + declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> { 485 + newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId; 486 + idFromName(name: string): DurableObjectId; 487 + idFromString(id: string): DurableObjectId; 488 + get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>; 489 + getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>; 490 + jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>; 491 + } 492 + type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high"; 493 + interface DurableObjectNamespaceNewUniqueIdOptions { 494 + jurisdiction?: DurableObjectJurisdiction; 495 + } 496 + type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me"; 497 + type DurableObjectRoutingMode = "primary-only"; 498 + interface DurableObjectNamespaceGetDurableObjectOptions { 499 + locationHint?: DurableObjectLocationHint; 500 + routingMode?: DurableObjectRoutingMode; 501 + } 502 + interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> { 503 + } 504 + interface DurableObjectState<Props = unknown> { 505 + waitUntil(promise: Promise<any>): void; 506 + readonly props: Props; 507 + readonly id: DurableObjectId; 508 + readonly storage: DurableObjectStorage; 509 + container?: Container; 510 + blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>; 511 + acceptWebSocket(ws: WebSocket, tags?: string[]): void; 512 + getWebSockets(tag?: string): WebSocket[]; 513 + setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void; 514 + getWebSocketAutoResponse(): WebSocketRequestResponsePair | null; 515 + getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null; 516 + setHibernatableWebSocketEventTimeout(timeoutMs?: number): void; 517 + getHibernatableWebSocketEventTimeout(): number | null; 518 + getTags(ws: WebSocket): string[]; 519 + abort(reason?: string): void; 520 + } 521 + interface DurableObjectTransaction { 522 + get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>; 523 + get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>; 524 + list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>; 525 + put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>; 526 + put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>; 527 + delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>; 528 + delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>; 529 + rollback(): void; 530 + getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>; 531 + setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>; 532 + deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>; 533 + } 534 + interface DurableObjectStorage { 535 + get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>; 536 + get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>; 537 + list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>; 538 + put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>; 539 + put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>; 540 + delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>; 541 + delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>; 542 + deleteAll(options?: DurableObjectPutOptions): Promise<void>; 543 + transaction<T>(closure: (txn: DurableObjectTransaction) => Promise<T>): Promise<T>; 544 + getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>; 545 + setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>; 546 + deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>; 547 + sync(): Promise<void>; 548 + sql: SqlStorage; 549 + kv: SyncKvStorage; 550 + transactionSync<T>(closure: () => T): T; 551 + getCurrentBookmark(): Promise<string>; 552 + getBookmarkForTime(timestamp: number | Date): Promise<string>; 553 + onNextSessionRestoreBookmark(bookmark: string): Promise<string>; 554 + } 555 + interface DurableObjectListOptions { 556 + start?: string; 557 + startAfter?: string; 558 + end?: string; 559 + prefix?: string; 560 + reverse?: boolean; 561 + limit?: number; 562 + allowConcurrency?: boolean; 563 + noCache?: boolean; 564 + } 565 + interface DurableObjectGetOptions { 566 + allowConcurrency?: boolean; 567 + noCache?: boolean; 568 + } 569 + interface DurableObjectGetAlarmOptions { 570 + allowConcurrency?: boolean; 571 + } 572 + interface DurableObjectPutOptions { 573 + allowConcurrency?: boolean; 574 + allowUnconfirmed?: boolean; 575 + noCache?: boolean; 576 + } 577 + interface DurableObjectSetAlarmOptions { 578 + allowConcurrency?: boolean; 579 + allowUnconfirmed?: boolean; 580 + } 581 + declare class WebSocketRequestResponsePair { 582 + constructor(request: string, response: string); 583 + get request(): string; 584 + get response(): string; 585 + } 586 + interface AnalyticsEngineDataset { 587 + writeDataPoint(event?: AnalyticsEngineDataPoint): void; 588 + } 589 + interface AnalyticsEngineDataPoint { 590 + indexes?: ((ArrayBuffer | string) | null)[]; 591 + doubles?: number[]; 592 + blobs?: ((ArrayBuffer | string) | null)[]; 593 + } 594 + /** 595 + * The **`Event`** interface represents an event which takes place on an `EventTarget`. 596 + * 597 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event) 598 + */ 599 + declare class Event { 600 + constructor(type: string, init?: EventInit); 601 + /** 602 + * The **`type`** read-only property of the Event interface returns a string containing the event's type. 603 + * 604 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type) 605 + */ 606 + get type(): string; 607 + /** 608 + * The **`eventPhase`** read-only property of the being evaluated. 609 + * 610 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase) 611 + */ 612 + get eventPhase(): number; 613 + /** 614 + * The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM. 615 + * 616 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed) 617 + */ 618 + get composed(): boolean; 619 + /** 620 + * The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not. 621 + * 622 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles) 623 + */ 624 + get bubbles(): boolean; 625 + /** 626 + * The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened. 627 + * 628 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable) 629 + */ 630 + get cancelable(): boolean; 631 + /** 632 + * The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event. 633 + * 634 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented) 635 + */ 636 + get defaultPrevented(): boolean; 637 + /** 638 + * The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not. 639 + * @deprecated 640 + * 641 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue) 642 + */ 643 + get returnValue(): boolean; 644 + /** 645 + * The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached. 646 + * 647 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget) 648 + */ 649 + get currentTarget(): EventTarget | undefined; 650 + /** 651 + * The read-only **`target`** property of the dispatched. 652 + * 653 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target) 654 + */ 655 + get target(): EventTarget | undefined; 656 + /** 657 + * The deprecated **`Event.srcElement`** is an alias for the Event.target property. 658 + * @deprecated 659 + * 660 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement) 661 + */ 662 + get srcElement(): EventTarget | undefined; 663 + /** 664 + * The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created. 665 + * 666 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp) 667 + */ 668 + get timeStamp(): number; 669 + /** 670 + * The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents. 671 + * 672 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted) 673 + */ 674 + get isTrusted(): boolean; 675 + /** 676 + * The **`cancelBubble`** property of the Event interface is deprecated. 677 + * @deprecated 678 + * 679 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble) 680 + */ 681 + get cancelBubble(): boolean; 682 + /** 683 + * The **`cancelBubble`** property of the Event interface is deprecated. 684 + * @deprecated 685 + * 686 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble) 687 + */ 688 + set cancelBubble(value: boolean); 689 + /** 690 + * The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added. 691 + * 692 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) 693 + */ 694 + stopImmediatePropagation(): void; 695 + /** 696 + * The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be. 697 + * 698 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) 699 + */ 700 + preventDefault(): void; 701 + /** 702 + * The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. 703 + * 704 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) 705 + */ 706 + stopPropagation(): void; 707 + /** 708 + * The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. 709 + * 710 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath) 711 + */ 712 + composedPath(): EventTarget[]; 713 + static readonly NONE: number; 714 + static readonly CAPTURING_PHASE: number; 715 + static readonly AT_TARGET: number; 716 + static readonly BUBBLING_PHASE: number; 717 + } 718 + interface EventInit { 719 + bubbles?: boolean; 720 + cancelable?: boolean; 721 + composed?: boolean; 722 + } 723 + type EventListener<EventType extends Event = Event> = (event: EventType) => void; 724 + interface EventListenerObject<EventType extends Event = Event> { 725 + handleEvent(event: EventType): void; 726 + } 727 + type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>; 728 + /** 729 + * The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them. 730 + * 731 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget) 732 + */ 733 + declare class EventTarget<EventMap extends Record<string, Event> = Record<string, Event>> { 734 + constructor(); 735 + /** 736 + * The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. 737 + * 738 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) 739 + */ 740 + addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void; 741 + /** 742 + * The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. 743 + * 744 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) 745 + */ 746 + removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void; 747 + /** 748 + * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. 749 + * 750 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) 751 + */ 752 + dispatchEvent(event: EventMap[keyof EventMap]): boolean; 753 + } 754 + interface EventTargetEventListenerOptions { 755 + capture?: boolean; 756 + } 757 + interface EventTargetAddEventListenerOptions { 758 + capture?: boolean; 759 + passive?: boolean; 760 + once?: boolean; 761 + signal?: AbortSignal; 762 + } 763 + interface EventTargetHandlerObject { 764 + handleEvent: (event: Event) => any | undefined; 765 + } 766 + /** 767 + * The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired. 768 + * 769 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController) 770 + */ 771 + declare class AbortController { 772 + constructor(); 773 + /** 774 + * The **`signal`** read-only property of the AbortController interface returns an AbortSignal object instance, which can be used to communicate with/abort an asynchronous operation as desired. 775 + * 776 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal) 777 + */ 778 + get signal(): AbortSignal; 779 + /** 780 + * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. 781 + * 782 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort) 783 + */ 784 + abort(reason?: any): void; 785 + } 786 + /** 787 + * The **`AbortSignal`** interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object. 788 + * 789 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal) 790 + */ 791 + declare abstract class AbortSignal extends EventTarget { 792 + /** 793 + * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event). 794 + * 795 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) 796 + */ 797 + static abort(reason?: any): AbortSignal; 798 + /** 799 + * The **`AbortSignal.timeout()`** static method returns an AbortSignal that will automatically abort after a specified time. 800 + * 801 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) 802 + */ 803 + static timeout(delay: number): AbortSignal; 804 + /** 805 + * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. 806 + * 807 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) 808 + */ 809 + static any(signals: AbortSignal[]): AbortSignal; 810 + /** 811 + * The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`). 812 + * 813 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted) 814 + */ 815 + get aborted(): boolean; 816 + /** 817 + * The **`reason`** read-only property returns a JavaScript value that indicates the abort reason. 818 + * 819 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) 820 + */ 821 + get reason(): any; 822 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */ 823 + get onabort(): any | null; 824 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */ 825 + set onabort(value: any | null); 826 + /** 827 + * The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing. 828 + * 829 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) 830 + */ 831 + throwIfAborted(): void; 832 + } 833 + interface Scheduler { 834 + wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>; 835 + } 836 + interface SchedulerWaitOptions { 837 + signal?: AbortSignal; 838 + } 839 + /** 840 + * The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle. 841 + * 842 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent) 843 + */ 844 + declare abstract class ExtendableEvent extends Event { 845 + /** 846 + * The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing. 847 + * 848 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) 849 + */ 850 + waitUntil(promise: Promise<any>): void; 851 + } 852 + /** 853 + * The **`CustomEvent`** interface represents events initialized by an application for any purpose. 854 + * 855 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) 856 + */ 857 + declare class CustomEvent<T = any> extends Event { 858 + constructor(type: string, init?: CustomEventCustomEventInit); 859 + /** 860 + * The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event. 861 + * 862 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail) 863 + */ 864 + get detail(): T; 865 + } 866 + interface CustomEventCustomEventInit { 867 + bubbles?: boolean; 868 + cancelable?: boolean; 869 + composed?: boolean; 870 + detail?: any; 871 + } 872 + /** 873 + * The **`Blob`** interface represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a ReadableStream so its methods can be used for processing the data. 874 + * 875 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob) 876 + */ 877 + declare class Blob { 878 + constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions); 879 + /** 880 + * The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes. 881 + * 882 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) 883 + */ 884 + get size(): number; 885 + /** 886 + * The **`type`** read-only property of the Blob interface returns the MIME type of the file. 887 + * 888 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) 889 + */ 890 + get type(): string; 891 + /** 892 + * The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called. 893 + * 894 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) 895 + */ 896 + slice(start?: number, end?: number, type?: string): Blob; 897 + /** 898 + * The **`arrayBuffer()`** method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer. 899 + * 900 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) 901 + */ 902 + arrayBuffer(): Promise<ArrayBuffer>; 903 + /** 904 + * The **`bytes()`** method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes. 905 + * 906 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) 907 + */ 908 + bytes(): Promise<Uint8Array>; 909 + /** 910 + * The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8. 911 + * 912 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) 913 + */ 914 + text(): Promise<string>; 915 + /** 916 + * The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`. 917 + * 918 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) 919 + */ 920 + stream(): ReadableStream; 921 + } 922 + interface BlobOptions { 923 + type?: string; 924 + } 925 + /** 926 + * The **`File`** interface provides information about files and allows JavaScript in a web page to access their content. 927 + * 928 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File) 929 + */ 930 + declare class File extends Blob { 931 + constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions); 932 + /** 933 + * The **`name`** read-only property of the File interface returns the name of the file represented by a File object. 934 + * 935 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) 936 + */ 937 + get name(): string; 938 + /** 939 + * The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). 940 + * 941 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) 942 + */ 943 + get lastModified(): number; 944 + } 945 + interface FileOptions { 946 + type?: string; 947 + lastModified?: number; 948 + } 949 + /** 950 + * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache. 951 + * 952 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/) 953 + */ 954 + declare abstract class CacheStorage { 955 + /** 956 + * The **`open()`** method of the the Cache object matching the `cacheName`. 957 + * 958 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) 959 + */ 960 + open(cacheName: string): Promise<Cache>; 961 + readonly default: Cache; 962 + } 963 + /** 964 + * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache. 965 + * 966 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/) 967 + */ 968 + declare abstract class Cache { 969 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */ 970 + delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>; 971 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */ 972 + match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>; 973 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */ 974 + put(request: RequestInfo | URL, response: Response): Promise<void>; 975 + } 976 + interface CacheQueryOptions { 977 + ignoreMethod?: boolean; 978 + } 979 + /** 980 + * The Web Crypto API provides a set of low-level functions for common cryptographic tasks. 981 + * The Workers runtime implements the full surface of this API, but with some differences in 982 + * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms) 983 + * compared to those implemented in most browsers. 984 + * 985 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/) 986 + */ 987 + declare abstract class Crypto { 988 + /** 989 + * The **`Crypto.subtle`** read-only property returns a cryptographic operations. 990 + * Available only in secure contexts. 991 + * 992 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle) 993 + */ 994 + get subtle(): SubtleCrypto; 995 + /** 996 + * The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. 997 + * 998 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) 999 + */ 1000 + getRandomValues<T extends Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array>(buffer: T): T; 1001 + /** 1002 + * The **`randomUUID()`** method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator. 1003 + * Available only in secure contexts. 1004 + * 1005 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID) 1006 + */ 1007 + randomUUID(): string; 1008 + DigestStream: typeof DigestStream; 1009 + } 1010 + /** 1011 + * The **`SubtleCrypto`** interface of the Web Crypto API provides a number of low-level cryptographic functions. 1012 + * Available only in secure contexts. 1013 + * 1014 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto) 1015 + */ 1016 + declare abstract class SubtleCrypto { 1017 + /** 1018 + * The **`encrypt()`** method of the SubtleCrypto interface encrypts data. 1019 + * 1020 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) 1021 + */ 1022 + encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>; 1023 + /** 1024 + * The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data. 1025 + * 1026 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) 1027 + */ 1028 + decrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, cipherText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>; 1029 + /** 1030 + * The **`sign()`** method of the SubtleCrypto interface generates a digital signature. 1031 + * 1032 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) 1033 + */ 1034 + sign(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>; 1035 + /** 1036 + * The **`verify()`** method of the SubtleCrypto interface verifies a digital signature. 1037 + * 1038 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) 1039 + */ 1040 + verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>; 1041 + /** 1042 + * The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function. 1043 + * 1044 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) 1045 + */ 1046 + digest(algorithm: string | SubtleCryptoHashAlgorithm, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>; 1047 + /** 1048 + * The **`generateKey()`** method of the SubtleCrypto interface is used to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms). 1049 + * 1050 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) 1051 + */ 1052 + generateKey(algorithm: string | SubtleCryptoGenerateKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey | CryptoKeyPair>; 1053 + /** 1054 + * The **`deriveKey()`** method of the SubtleCrypto interface can be used to derive a secret key from a master key. 1055 + * 1056 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) 1057 + */ 1058 + deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>; 1059 + /** 1060 + * The **`deriveBits()`** method of the key. 1061 + * 1062 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) 1063 + */ 1064 + deriveBits(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>; 1065 + /** 1066 + * The **`importKey()`** method of the SubtleCrypto interface imports a key: that is, it takes as input a key in an external, portable format and gives you a CryptoKey object that you can use in the Web Crypto API. 1067 + * 1068 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) 1069 + */ 1070 + importKey(format: string, keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey, algorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>; 1071 + /** 1072 + * The **`exportKey()`** method of the SubtleCrypto interface exports a key: that is, it takes as input a CryptoKey object and gives you the key in an external, portable format. 1073 + * 1074 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) 1075 + */ 1076 + exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>; 1077 + /** 1078 + * The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key. 1079 + * 1080 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) 1081 + */ 1082 + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>; 1083 + /** 1084 + * The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key. 1085 + * 1086 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) 1087 + */ 1088 + unwrapKey(format: string, wrappedKey: ArrayBuffer | ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm, unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>; 1089 + timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean; 1090 + } 1091 + /** 1092 + * The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.importKey, or SubtleCrypto.unwrapKey. 1093 + * Available only in secure contexts. 1094 + * 1095 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey) 1096 + */ 1097 + declare abstract class CryptoKey { 1098 + /** 1099 + * The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object. 1100 + * 1101 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) 1102 + */ 1103 + readonly type: string; 1104 + /** 1105 + * The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`. 1106 + * 1107 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) 1108 + */ 1109 + readonly extractable: boolean; 1110 + /** 1111 + * The read-only **`algorithm`** property of the CryptoKey interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. 1112 + * 1113 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) 1114 + */ 1115 + readonly algorithm: CryptoKeyKeyAlgorithm | CryptoKeyAesKeyAlgorithm | CryptoKeyHmacKeyAlgorithm | CryptoKeyRsaKeyAlgorithm | CryptoKeyEllipticKeyAlgorithm | CryptoKeyArbitraryKeyAlgorithm; 1116 + /** 1117 + * The read-only **`usages`** property of the CryptoKey interface indicates what can be done with the key. 1118 + * 1119 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) 1120 + */ 1121 + readonly usages: string[]; 1122 + } 1123 + interface CryptoKeyPair { 1124 + publicKey: CryptoKey; 1125 + privateKey: CryptoKey; 1126 + } 1127 + interface JsonWebKey { 1128 + kty: string; 1129 + use?: string; 1130 + key_ops?: string[]; 1131 + alg?: string; 1132 + ext?: boolean; 1133 + crv?: string; 1134 + x?: string; 1135 + y?: string; 1136 + d?: string; 1137 + n?: string; 1138 + e?: string; 1139 + p?: string; 1140 + q?: string; 1141 + dp?: string; 1142 + dq?: string; 1143 + qi?: string; 1144 + oth?: RsaOtherPrimesInfo[]; 1145 + k?: string; 1146 + } 1147 + interface RsaOtherPrimesInfo { 1148 + r?: string; 1149 + d?: string; 1150 + t?: string; 1151 + } 1152 + interface SubtleCryptoDeriveKeyAlgorithm { 1153 + name: string; 1154 + salt?: (ArrayBuffer | ArrayBufferView); 1155 + iterations?: number; 1156 + hash?: (string | SubtleCryptoHashAlgorithm); 1157 + $public?: CryptoKey; 1158 + info?: (ArrayBuffer | ArrayBufferView); 1159 + } 1160 + interface SubtleCryptoEncryptAlgorithm { 1161 + name: string; 1162 + iv?: (ArrayBuffer | ArrayBufferView); 1163 + additionalData?: (ArrayBuffer | ArrayBufferView); 1164 + tagLength?: number; 1165 + counter?: (ArrayBuffer | ArrayBufferView); 1166 + length?: number; 1167 + label?: (ArrayBuffer | ArrayBufferView); 1168 + } 1169 + interface SubtleCryptoGenerateKeyAlgorithm { 1170 + name: string; 1171 + hash?: (string | SubtleCryptoHashAlgorithm); 1172 + modulusLength?: number; 1173 + publicExponent?: (ArrayBuffer | ArrayBufferView); 1174 + length?: number; 1175 + namedCurve?: string; 1176 + } 1177 + interface SubtleCryptoHashAlgorithm { 1178 + name: string; 1179 + } 1180 + interface SubtleCryptoImportKeyAlgorithm { 1181 + name: string; 1182 + hash?: (string | SubtleCryptoHashAlgorithm); 1183 + length?: number; 1184 + namedCurve?: string; 1185 + compressed?: boolean; 1186 + } 1187 + interface SubtleCryptoSignAlgorithm { 1188 + name: string; 1189 + hash?: (string | SubtleCryptoHashAlgorithm); 1190 + dataLength?: number; 1191 + saltLength?: number; 1192 + } 1193 + interface CryptoKeyKeyAlgorithm { 1194 + name: string; 1195 + } 1196 + interface CryptoKeyAesKeyAlgorithm { 1197 + name: string; 1198 + length: number; 1199 + } 1200 + interface CryptoKeyHmacKeyAlgorithm { 1201 + name: string; 1202 + hash: CryptoKeyKeyAlgorithm; 1203 + length: number; 1204 + } 1205 + interface CryptoKeyRsaKeyAlgorithm { 1206 + name: string; 1207 + modulusLength: number; 1208 + publicExponent: ArrayBuffer | ArrayBufferView; 1209 + hash?: CryptoKeyKeyAlgorithm; 1210 + } 1211 + interface CryptoKeyEllipticKeyAlgorithm { 1212 + name: string; 1213 + namedCurve: string; 1214 + } 1215 + interface CryptoKeyArbitraryKeyAlgorithm { 1216 + name: string; 1217 + hash?: CryptoKeyKeyAlgorithm; 1218 + namedCurve?: string; 1219 + length?: number; 1220 + } 1221 + declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> { 1222 + constructor(algorithm: string | SubtleCryptoHashAlgorithm); 1223 + readonly digest: Promise<ArrayBuffer>; 1224 + get bytesWritten(): number | bigint; 1225 + } 1226 + /** 1227 + * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc. 1228 + * 1229 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder) 1230 + */ 1231 + declare class TextDecoder { 1232 + constructor(label?: string, options?: TextDecoderConstructorOptions); 1233 + /** 1234 + * The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. 1235 + * 1236 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode) 1237 + */ 1238 + decode(input?: (ArrayBuffer | ArrayBufferView), options?: TextDecoderDecodeOptions): string; 1239 + get encoding(): string; 1240 + get fatal(): boolean; 1241 + get ignoreBOM(): boolean; 1242 + } 1243 + /** 1244 + * The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes. 1245 + * 1246 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder) 1247 + */ 1248 + declare class TextEncoder { 1249 + constructor(); 1250 + /** 1251 + * The **`TextEncoder.encode()`** method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object. 1252 + * 1253 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) 1254 + */ 1255 + encode(input?: string): Uint8Array; 1256 + /** 1257 + * The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding. 1258 + * 1259 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto) 1260 + */ 1261 + encodeInto(input: string, buffer: Uint8Array): TextEncoderEncodeIntoResult; 1262 + get encoding(): string; 1263 + } 1264 + interface TextDecoderConstructorOptions { 1265 + fatal: boolean; 1266 + ignoreBOM: boolean; 1267 + } 1268 + interface TextDecoderDecodeOptions { 1269 + stream: boolean; 1270 + } 1271 + interface TextEncoderEncodeIntoResult { 1272 + read: number; 1273 + written: number; 1274 + } 1275 + /** 1276 + * The **`ErrorEvent`** interface represents events providing information related to errors in scripts or in files. 1277 + * 1278 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent) 1279 + */ 1280 + declare class ErrorEvent extends Event { 1281 + constructor(type: string, init?: ErrorEventErrorEventInit); 1282 + /** 1283 + * The **`filename`** read-only property of the ErrorEvent interface returns a string containing the name of the script file in which the error occurred. 1284 + * 1285 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) 1286 + */ 1287 + get filename(): string; 1288 + /** 1289 + * The **`message`** read-only property of the ErrorEvent interface returns a string containing a human-readable error message describing the problem. 1290 + * 1291 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) 1292 + */ 1293 + get message(): string; 1294 + /** 1295 + * The **`lineno`** read-only property of the ErrorEvent interface returns an integer containing the line number of the script file on which the error occurred. 1296 + * 1297 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) 1298 + */ 1299 + get lineno(): number; 1300 + /** 1301 + * The **`colno`** read-only property of the ErrorEvent interface returns an integer containing the column number of the script file on which the error occurred. 1302 + * 1303 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) 1304 + */ 1305 + get colno(): number; 1306 + /** 1307 + * The **`error`** read-only property of the ErrorEvent interface returns a JavaScript value, such as an Error or DOMException, representing the error associated with this event. 1308 + * 1309 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) 1310 + */ 1311 + get error(): any; 1312 + } 1313 + interface ErrorEventErrorEventInit { 1314 + message?: string; 1315 + filename?: string; 1316 + lineno?: number; 1317 + colno?: number; 1318 + error?: any; 1319 + } 1320 + /** 1321 + * The **`MessageEvent`** interface represents a message received by a target object. 1322 + * 1323 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent) 1324 + */ 1325 + declare class MessageEvent extends Event { 1326 + constructor(type: string, initializer: MessageEventInit); 1327 + /** 1328 + * The **`data`** read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event. 1329 + * 1330 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data) 1331 + */ 1332 + readonly data: any; 1333 + /** 1334 + * The **`origin`** read-only property of the origin of the message emitter. 1335 + * 1336 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin) 1337 + */ 1338 + readonly origin: string | null; 1339 + /** 1340 + * The **`lastEventId`** read-only property of the unique ID for the event. 1341 + * 1342 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId) 1343 + */ 1344 + readonly lastEventId: string; 1345 + /** 1346 + * The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter. 1347 + * 1348 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source) 1349 + */ 1350 + readonly source: MessagePort | null; 1351 + /** 1352 + * The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order. 1353 + * 1354 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports) 1355 + */ 1356 + readonly ports: MessagePort[]; 1357 + } 1358 + interface MessageEventInit { 1359 + data: ArrayBuffer | string; 1360 + } 1361 + /** 1362 + * The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected. 1363 + * 1364 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) 1365 + */ 1366 + declare abstract class PromiseRejectionEvent extends Event { 1367 + /** 1368 + * The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected. 1369 + * 1370 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) 1371 + */ 1372 + readonly promise: Promise<any>; 1373 + /** 1374 + * The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). 1375 + * 1376 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) 1377 + */ 1378 + readonly reason: any; 1379 + } 1380 + /** 1381 + * The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the Window/fetch, XMLHttpRequest.send() or navigator.sendBeacon() methods. 1382 + * 1383 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData) 1384 + */ 1385 + declare class FormData { 1386 + constructor(); 1387 + /** 1388 + * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist. 1389 + * 1390 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) 1391 + */ 1392 + append(name: string, value: string | Blob): void; 1393 + /** 1394 + * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist. 1395 + * 1396 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) 1397 + */ 1398 + append(name: string, value: string): void; 1399 + /** 1400 + * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist. 1401 + * 1402 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) 1403 + */ 1404 + append(name: string, value: Blob, filename?: string): void; 1405 + /** 1406 + * The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object. 1407 + * 1408 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) 1409 + */ 1410 + delete(name: string): void; 1411 + /** 1412 + * The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object. 1413 + * 1414 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) 1415 + */ 1416 + get(name: string): (File | string) | null; 1417 + /** 1418 + * The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object. 1419 + * 1420 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) 1421 + */ 1422 + getAll(name: string): (File | string)[]; 1423 + /** 1424 + * The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key. 1425 + * 1426 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) 1427 + */ 1428 + has(name: string): boolean; 1429 + /** 1430 + * The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist. 1431 + * 1432 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) 1433 + */ 1434 + set(name: string, value: string | Blob): void; 1435 + /** 1436 + * The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist. 1437 + * 1438 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) 1439 + */ 1440 + set(name: string, value: string): void; 1441 + /** 1442 + * The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist. 1443 + * 1444 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) 1445 + */ 1446 + set(name: string, value: Blob, filename?: string): void; 1447 + /* Returns an array of key, value pairs for every entry in the list. */ 1448 + entries(): IterableIterator<[ 1449 + key: string, 1450 + value: File | string 1451 + ]>; 1452 + /* Returns a list of keys in the list. */ 1453 + keys(): IterableIterator<string>; 1454 + /* Returns a list of values in the list. */ 1455 + values(): IterableIterator<(File | string)>; 1456 + forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void; 1457 + [Symbol.iterator](): IterableIterator<[ 1458 + key: string, 1459 + value: File | string 1460 + ]>; 1461 + } 1462 + interface ContentOptions { 1463 + html?: boolean; 1464 + } 1465 + declare class HTMLRewriter { 1466 + constructor(); 1467 + on(selector: string, handlers: HTMLRewriterElementContentHandlers): HTMLRewriter; 1468 + onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter; 1469 + transform(response: Response): Response; 1470 + } 1471 + interface HTMLRewriterElementContentHandlers { 1472 + element?(element: Element): void | Promise<void>; 1473 + comments?(comment: Comment): void | Promise<void>; 1474 + text?(element: Text): void | Promise<void>; 1475 + } 1476 + interface HTMLRewriterDocumentContentHandlers { 1477 + doctype?(doctype: Doctype): void | Promise<void>; 1478 + comments?(comment: Comment): void | Promise<void>; 1479 + text?(text: Text): void | Promise<void>; 1480 + end?(end: DocumentEnd): void | Promise<void>; 1481 + } 1482 + interface Doctype { 1483 + readonly name: string | null; 1484 + readonly publicId: string | null; 1485 + readonly systemId: string | null; 1486 + } 1487 + interface Element { 1488 + tagName: string; 1489 + readonly attributes: IterableIterator<string[]>; 1490 + readonly removed: boolean; 1491 + readonly namespaceURI: string; 1492 + getAttribute(name: string): string | null; 1493 + hasAttribute(name: string): boolean; 1494 + setAttribute(name: string, value: string): Element; 1495 + removeAttribute(name: string): Element; 1496 + before(content: string | ReadableStream | Response, options?: ContentOptions): Element; 1497 + after(content: string | ReadableStream | Response, options?: ContentOptions): Element; 1498 + prepend(content: string | ReadableStream | Response, options?: ContentOptions): Element; 1499 + append(content: string | ReadableStream | Response, options?: ContentOptions): Element; 1500 + replace(content: string | ReadableStream | Response, options?: ContentOptions): Element; 1501 + remove(): Element; 1502 + removeAndKeepContent(): Element; 1503 + setInnerContent(content: string | ReadableStream | Response, options?: ContentOptions): Element; 1504 + onEndTag(handler: (tag: EndTag) => void | Promise<void>): void; 1505 + } 1506 + interface EndTag { 1507 + name: string; 1508 + before(content: string | ReadableStream | Response, options?: ContentOptions): EndTag; 1509 + after(content: string | ReadableStream | Response, options?: ContentOptions): EndTag; 1510 + remove(): EndTag; 1511 + } 1512 + interface Comment { 1513 + text: string; 1514 + readonly removed: boolean; 1515 + before(content: string, options?: ContentOptions): Comment; 1516 + after(content: string, options?: ContentOptions): Comment; 1517 + replace(content: string, options?: ContentOptions): Comment; 1518 + remove(): Comment; 1519 + } 1520 + interface Text { 1521 + readonly text: string; 1522 + readonly lastInTextNode: boolean; 1523 + readonly removed: boolean; 1524 + before(content: string | ReadableStream | Response, options?: ContentOptions): Text; 1525 + after(content: string | ReadableStream | Response, options?: ContentOptions): Text; 1526 + replace(content: string | ReadableStream | Response, options?: ContentOptions): Text; 1527 + remove(): Text; 1528 + } 1529 + interface DocumentEnd { 1530 + append(content: string, options?: ContentOptions): DocumentEnd; 1531 + } 1532 + /** 1533 + * This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope. 1534 + * 1535 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent) 1536 + */ 1537 + declare abstract class FetchEvent extends ExtendableEvent { 1538 + /** 1539 + * The **`request`** read-only property of the the event handler. 1540 + * 1541 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) 1542 + */ 1543 + readonly request: Request; 1544 + /** 1545 + * The **`respondWith()`** method of allows you to provide a promise for a Response yourself. 1546 + * 1547 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) 1548 + */ 1549 + respondWith(promise: Response | Promise<Response>): void; 1550 + passThroughOnException(): void; 1551 + } 1552 + type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>; 1553 + /** 1554 + * The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers. 1555 + * 1556 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers) 1557 + */ 1558 + declare class Headers { 1559 + constructor(init?: HeadersInit); 1560 + /** 1561 + * The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a `Headers` object with a given name. 1562 + * 1563 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) 1564 + */ 1565 + get(name: string): string | null; 1566 + getAll(name: string): string[]; 1567 + /** 1568 + * The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response. 1569 + * 1570 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) 1571 + */ 1572 + getSetCookie(): string[]; 1573 + /** 1574 + * The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header. 1575 + * 1576 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) 1577 + */ 1578 + has(name: string): boolean; 1579 + /** 1580 + * The **`set()`** method of the Headers interface sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist. 1581 + * 1582 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) 1583 + */ 1584 + set(name: string, value: string): void; 1585 + /** 1586 + * The **`append()`** method of the Headers interface appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist. 1587 + * 1588 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) 1589 + */ 1590 + append(name: string, value: string): void; 1591 + /** 1592 + * The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object. 1593 + * 1594 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) 1595 + */ 1596 + delete(name: string): void; 1597 + forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void; 1598 + /* Returns an iterator allowing to go through all key/value pairs contained in this object. */ 1599 + entries(): IterableIterator<[ 1600 + key: string, 1601 + value: string 1602 + ]>; 1603 + /* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */ 1604 + keys(): IterableIterator<string>; 1605 + /* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */ 1606 + values(): IterableIterator<string>; 1607 + [Symbol.iterator](): IterableIterator<[ 1608 + key: string, 1609 + value: string 1610 + ]>; 1611 + } 1612 + type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData; 1613 + declare abstract class Body { 1614 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */ 1615 + get body(): ReadableStream | null; 1616 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ 1617 + get bodyUsed(): boolean; 1618 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */ 1619 + arrayBuffer(): Promise<ArrayBuffer>; 1620 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */ 1621 + bytes(): Promise<Uint8Array>; 1622 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */ 1623 + text(): Promise<string>; 1624 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */ 1625 + json<T>(): Promise<T>; 1626 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */ 1627 + formData(): Promise<FormData>; 1628 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ 1629 + blob(): Promise<Blob>; 1630 + } 1631 + /** 1632 + * The **`Response`** interface of the Fetch API represents the response to a request. 1633 + * 1634 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response) 1635 + */ 1636 + declare var Response: { 1637 + prototype: Response; 1638 + new (body?: BodyInit | null, init?: ResponseInit): Response; 1639 + error(): Response; 1640 + redirect(url: string, status?: number): Response; 1641 + json(any: any, maybeInit?: (ResponseInit | Response)): Response; 1642 + }; 1643 + /** 1644 + * The **`Response`** interface of the Fetch API represents the response to a request. 1645 + * 1646 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response) 1647 + */ 1648 + interface Response extends Body { 1649 + /** 1650 + * The **`clone()`** method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable. 1651 + * 1652 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) 1653 + */ 1654 + clone(): Response; 1655 + /** 1656 + * The **`status`** read-only property of the Response interface contains the HTTP status codes of the response. 1657 + * 1658 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) 1659 + */ 1660 + status: number; 1661 + /** 1662 + * The **`statusText`** read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status. 1663 + * 1664 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) 1665 + */ 1666 + statusText: string; 1667 + /** 1668 + * The **`headers`** read-only property of the with the response. 1669 + * 1670 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) 1671 + */ 1672 + headers: Headers; 1673 + /** 1674 + * The **`ok`** read-only property of the Response interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. 1675 + * 1676 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) 1677 + */ 1678 + ok: boolean; 1679 + /** 1680 + * The **`redirected`** read-only property of the Response interface indicates whether or not the response is the result of a request you made which was redirected. 1681 + * 1682 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) 1683 + */ 1684 + redirected: boolean; 1685 + /** 1686 + * The **`url`** read-only property of the Response interface contains the URL of the response. 1687 + * 1688 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) 1689 + */ 1690 + url: string; 1691 + webSocket: WebSocket | null; 1692 + cf: any | undefined; 1693 + /** 1694 + * The **`type`** read-only property of the Response interface contains the type of the response. 1695 + * 1696 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type) 1697 + */ 1698 + type: "default" | "error"; 1699 + } 1700 + interface ResponseInit { 1701 + status?: number; 1702 + statusText?: string; 1703 + headers?: HeadersInit; 1704 + cf?: any; 1705 + webSocket?: (WebSocket | null); 1706 + encodeBody?: "automatic" | "manual"; 1707 + } 1708 + type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> = Request<CfHostMetadata, Cf> | string; 1709 + /** 1710 + * The **`Request`** interface of the Fetch API represents a resource request. 1711 + * 1712 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request) 1713 + */ 1714 + declare var Request: { 1715 + prototype: Request; 1716 + new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(input: RequestInfo<CfProperties> | URL, init?: RequestInit<Cf>): Request<CfHostMetadata, Cf>; 1717 + }; 1718 + /** 1719 + * The **`Request`** interface of the Fetch API represents a resource request. 1720 + * 1721 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request) 1722 + */ 1723 + interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body { 1724 + /** 1725 + * The **`clone()`** method of the Request interface creates a copy of the current `Request` object. 1726 + * 1727 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) 1728 + */ 1729 + clone(): Request<CfHostMetadata, Cf>; 1730 + /** 1731 + * The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request. 1732 + * 1733 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method) 1734 + */ 1735 + method: string; 1736 + /** 1737 + * The **`url`** read-only property of the Request interface contains the URL of the request. 1738 + * 1739 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url) 1740 + */ 1741 + url: string; 1742 + /** 1743 + * The **`headers`** read-only property of the with the request. 1744 + * 1745 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers) 1746 + */ 1747 + headers: Headers; 1748 + /** 1749 + * The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled. 1750 + * 1751 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect) 1752 + */ 1753 + redirect: string; 1754 + fetcher: Fetcher | null; 1755 + /** 1756 + * The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request. 1757 + * 1758 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal) 1759 + */ 1760 + signal: AbortSignal; 1761 + cf?: Cf; 1762 + /** 1763 + * The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request. 1764 + * 1765 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity) 1766 + */ 1767 + integrity: string; 1768 + /** 1769 + * The **`keepalive`** read-only property of the Request interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete. 1770 + * 1771 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive) 1772 + */ 1773 + keepalive: boolean; 1774 + /** 1775 + * The **`cache`** read-only property of the Request interface contains the cache mode of the request. 1776 + * 1777 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache) 1778 + */ 1779 + cache?: "no-store"; 1780 + } 1781 + interface RequestInit<Cf = CfProperties> { 1782 + /* A string to set request's method. */ 1783 + method?: string; 1784 + /* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */ 1785 + headers?: HeadersInit; 1786 + /* A BodyInit object or null to set request's body. */ 1787 + body?: BodyInit | null; 1788 + /* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */ 1789 + redirect?: string; 1790 + fetcher?: (Fetcher | null); 1791 + cf?: Cf; 1792 + /* A string indicating how the request will interact with the browser's cache to set request's cache. */ 1793 + cache?: "no-store"; 1794 + /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */ 1795 + integrity?: string; 1796 + /* An AbortSignal to set request's signal. */ 1797 + signal?: (AbortSignal | null); 1798 + encodeResponseBody?: "automatic" | "manual"; 1799 + } 1800 + type Service<T extends (new (...args: any[]) => Rpc.WorkerEntrypointBranded) | Rpc.WorkerEntrypointBranded | ExportedHandler<any, any, any> | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? Fetcher<InstanceType<T>> : T extends Rpc.WorkerEntrypointBranded ? Fetcher<T> : T extends Exclude<Rpc.EntrypointBranded, Rpc.WorkerEntrypointBranded> ? never : Fetcher<undefined>; 1801 + type Fetcher<T extends Rpc.EntrypointBranded | undefined = undefined, Reserved extends string = never> = (T extends Rpc.EntrypointBranded ? Rpc.Provider<T, Reserved | "fetch" | "connect"> : unknown) & { 1802 + fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>; 1803 + connect(address: SocketAddress | string, options?: SocketOptions): Socket; 1804 + }; 1805 + interface KVNamespaceListKey<Metadata, Key extends string = string> { 1806 + name: Key; 1807 + expiration?: number; 1808 + metadata?: Metadata; 1809 + } 1810 + type KVNamespaceListResult<Metadata, Key extends string = string> = { 1811 + list_complete: false; 1812 + keys: KVNamespaceListKey<Metadata, Key>[]; 1813 + cursor: string; 1814 + cacheStatus: string | null; 1815 + } | { 1816 + list_complete: true; 1817 + keys: KVNamespaceListKey<Metadata, Key>[]; 1818 + cacheStatus: string | null; 1819 + }; 1820 + interface KVNamespace<Key extends string = string> { 1821 + get(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<string | null>; 1822 + get(key: Key, type: "text"): Promise<string | null>; 1823 + get<ExpectedValue = unknown>(key: Key, type: "json"): Promise<ExpectedValue | null>; 1824 + get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>; 1825 + get(key: Key, type: "stream"): Promise<ReadableStream | null>; 1826 + get(key: Key, options?: KVNamespaceGetOptions<"text">): Promise<string | null>; 1827 + get<ExpectedValue = unknown>(key: Key, options?: KVNamespaceGetOptions<"json">): Promise<ExpectedValue | null>; 1828 + get(key: Key, options?: KVNamespaceGetOptions<"arrayBuffer">): Promise<ArrayBuffer | null>; 1829 + get(key: Key, options?: KVNamespaceGetOptions<"stream">): Promise<ReadableStream | null>; 1830 + get(key: Array<Key>, type: "text"): Promise<Map<string, string | null>>; 1831 + get<ExpectedValue = unknown>(key: Array<Key>, type: "json"): Promise<Map<string, ExpectedValue | null>>; 1832 + get(key: Array<Key>, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<Map<string, string | null>>; 1833 + get(key: Array<Key>, options?: KVNamespaceGetOptions<"text">): Promise<Map<string, string | null>>; 1834 + get<ExpectedValue = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"json">): Promise<Map<string, ExpectedValue | null>>; 1835 + list<Metadata = unknown>(options?: KVNamespaceListOptions): Promise<KVNamespaceListResult<Metadata, Key>>; 1836 + put(key: Key, value: string | ArrayBuffer | ArrayBufferView | ReadableStream, options?: KVNamespacePutOptions): Promise<void>; 1837 + getWithMetadata<Metadata = unknown>(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>; 1838 + getWithMetadata<Metadata = unknown>(key: Key, type: "text"): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>; 1839 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, type: "json"): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>; 1840 + getWithMetadata<Metadata = unknown>(key: Key, type: "arrayBuffer"): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>; 1841 + getWithMetadata<Metadata = unknown>(key: Key, type: "stream"): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>; 1842 + getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"text">): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>; 1843 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"json">): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>; 1844 + getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"arrayBuffer">): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>; 1845 + getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"stream">): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>; 1846 + getWithMetadata<Metadata = unknown>(key: Array<Key>, type: "text"): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>; 1847 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Array<Key>, type: "json"): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>; 1848 + getWithMetadata<Metadata = unknown>(key: Array<Key>, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>; 1849 + getWithMetadata<Metadata = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"text">): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>; 1850 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"json">): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>; 1851 + delete(key: Key): Promise<void>; 1852 + } 1853 + interface KVNamespaceListOptions { 1854 + limit?: number; 1855 + prefix?: (string | null); 1856 + cursor?: (string | null); 1857 + } 1858 + interface KVNamespaceGetOptions<Type> { 1859 + type: Type; 1860 + cacheTtl?: number; 1861 + } 1862 + interface KVNamespacePutOptions { 1863 + expiration?: number; 1864 + expirationTtl?: number; 1865 + metadata?: (any | null); 1866 + } 1867 + interface KVNamespaceGetWithMetadataResult<Value, Metadata> { 1868 + value: Value | null; 1869 + metadata: Metadata | null; 1870 + cacheStatus: string | null; 1871 + } 1872 + type QueueContentType = "text" | "bytes" | "json" | "v8"; 1873 + interface Queue<Body = unknown> { 1874 + send(message: Body, options?: QueueSendOptions): Promise<void>; 1875 + sendBatch(messages: Iterable<MessageSendRequest<Body>>, options?: QueueSendBatchOptions): Promise<void>; 1876 + } 1877 + interface QueueSendOptions { 1878 + contentType?: QueueContentType; 1879 + delaySeconds?: number; 1880 + } 1881 + interface QueueSendBatchOptions { 1882 + delaySeconds?: number; 1883 + } 1884 + interface MessageSendRequest<Body = unknown> { 1885 + body: Body; 1886 + contentType?: QueueContentType; 1887 + delaySeconds?: number; 1888 + } 1889 + interface QueueRetryOptions { 1890 + delaySeconds?: number; 1891 + } 1892 + interface Message<Body = unknown> { 1893 + readonly id: string; 1894 + readonly timestamp: Date; 1895 + readonly body: Body; 1896 + readonly attempts: number; 1897 + retry(options?: QueueRetryOptions): void; 1898 + ack(): void; 1899 + } 1900 + interface QueueEvent<Body = unknown> extends ExtendableEvent { 1901 + readonly messages: readonly Message<Body>[]; 1902 + readonly queue: string; 1903 + retryAll(options?: QueueRetryOptions): void; 1904 + ackAll(): void; 1905 + } 1906 + interface MessageBatch<Body = unknown> { 1907 + readonly messages: readonly Message<Body>[]; 1908 + readonly queue: string; 1909 + retryAll(options?: QueueRetryOptions): void; 1910 + ackAll(): void; 1911 + } 1912 + interface R2Error extends Error { 1913 + readonly name: string; 1914 + readonly code: number; 1915 + readonly message: string; 1916 + readonly action: string; 1917 + readonly stack: any; 1918 + } 1919 + interface R2ListOptions { 1920 + limit?: number; 1921 + prefix?: string; 1922 + cursor?: string; 1923 + delimiter?: string; 1924 + startAfter?: string; 1925 + include?: ("httpMetadata" | "customMetadata")[]; 1926 + } 1927 + declare abstract class R2Bucket { 1928 + head(key: string): Promise<R2Object | null>; 1929 + get(key: string, options: R2GetOptions & { 1930 + onlyIf: R2Conditional | Headers; 1931 + }): Promise<R2ObjectBody | R2Object | null>; 1932 + get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>; 1933 + put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions & { 1934 + onlyIf: R2Conditional | Headers; 1935 + }): Promise<R2Object | null>; 1936 + put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions): Promise<R2Object>; 1937 + createMultipartUpload(key: string, options?: R2MultipartOptions): Promise<R2MultipartUpload>; 1938 + resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload; 1939 + delete(keys: string | string[]): Promise<void>; 1940 + list(options?: R2ListOptions): Promise<R2Objects>; 1941 + } 1942 + interface R2MultipartUpload { 1943 + readonly key: string; 1944 + readonly uploadId: string; 1945 + uploadPart(partNumber: number, value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob, options?: R2UploadPartOptions): Promise<R2UploadedPart>; 1946 + abort(): Promise<void>; 1947 + complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>; 1948 + } 1949 + interface R2UploadedPart { 1950 + partNumber: number; 1951 + etag: string; 1952 + } 1953 + declare abstract class R2Object { 1954 + readonly key: string; 1955 + readonly version: string; 1956 + readonly size: number; 1957 + readonly etag: string; 1958 + readonly httpEtag: string; 1959 + readonly checksums: R2Checksums; 1960 + readonly uploaded: Date; 1961 + readonly httpMetadata?: R2HTTPMetadata; 1962 + readonly customMetadata?: Record<string, string>; 1963 + readonly range?: R2Range; 1964 + readonly storageClass: string; 1965 + readonly ssecKeyMd5?: string; 1966 + writeHttpMetadata(headers: Headers): void; 1967 + } 1968 + interface R2ObjectBody extends R2Object { 1969 + get body(): ReadableStream; 1970 + get bodyUsed(): boolean; 1971 + arrayBuffer(): Promise<ArrayBuffer>; 1972 + bytes(): Promise<Uint8Array>; 1973 + text(): Promise<string>; 1974 + json<T>(): Promise<T>; 1975 + blob(): Promise<Blob>; 1976 + } 1977 + type R2Range = { 1978 + offset: number; 1979 + length?: number; 1980 + } | { 1981 + offset?: number; 1982 + length: number; 1983 + } | { 1984 + suffix: number; 1985 + }; 1986 + interface R2Conditional { 1987 + etagMatches?: string; 1988 + etagDoesNotMatch?: string; 1989 + uploadedBefore?: Date; 1990 + uploadedAfter?: Date; 1991 + secondsGranularity?: boolean; 1992 + } 1993 + interface R2GetOptions { 1994 + onlyIf?: (R2Conditional | Headers); 1995 + range?: (R2Range | Headers); 1996 + ssecKey?: (ArrayBuffer | string); 1997 + } 1998 + interface R2PutOptions { 1999 + onlyIf?: (R2Conditional | Headers); 2000 + httpMetadata?: (R2HTTPMetadata | Headers); 2001 + customMetadata?: Record<string, string>; 2002 + md5?: ((ArrayBuffer | ArrayBufferView) | string); 2003 + sha1?: ((ArrayBuffer | ArrayBufferView) | string); 2004 + sha256?: ((ArrayBuffer | ArrayBufferView) | string); 2005 + sha384?: ((ArrayBuffer | ArrayBufferView) | string); 2006 + sha512?: ((ArrayBuffer | ArrayBufferView) | string); 2007 + storageClass?: string; 2008 + ssecKey?: (ArrayBuffer | string); 2009 + } 2010 + interface R2MultipartOptions { 2011 + httpMetadata?: (R2HTTPMetadata | Headers); 2012 + customMetadata?: Record<string, string>; 2013 + storageClass?: string; 2014 + ssecKey?: (ArrayBuffer | string); 2015 + } 2016 + interface R2Checksums { 2017 + readonly md5?: ArrayBuffer; 2018 + readonly sha1?: ArrayBuffer; 2019 + readonly sha256?: ArrayBuffer; 2020 + readonly sha384?: ArrayBuffer; 2021 + readonly sha512?: ArrayBuffer; 2022 + toJSON(): R2StringChecksums; 2023 + } 2024 + interface R2StringChecksums { 2025 + md5?: string; 2026 + sha1?: string; 2027 + sha256?: string; 2028 + sha384?: string; 2029 + sha512?: string; 2030 + } 2031 + interface R2HTTPMetadata { 2032 + contentType?: string; 2033 + contentLanguage?: string; 2034 + contentDisposition?: string; 2035 + contentEncoding?: string; 2036 + cacheControl?: string; 2037 + cacheExpiry?: Date; 2038 + } 2039 + type R2Objects = { 2040 + objects: R2Object[]; 2041 + delimitedPrefixes: string[]; 2042 + } & ({ 2043 + truncated: true; 2044 + cursor: string; 2045 + } | { 2046 + truncated: false; 2047 + }); 2048 + interface R2UploadPartOptions { 2049 + ssecKey?: (ArrayBuffer | string); 2050 + } 2051 + declare abstract class ScheduledEvent extends ExtendableEvent { 2052 + readonly scheduledTime: number; 2053 + readonly cron: string; 2054 + noRetry(): void; 2055 + } 2056 + interface ScheduledController { 2057 + readonly scheduledTime: number; 2058 + readonly cron: string; 2059 + noRetry(): void; 2060 + } 2061 + interface QueuingStrategy<T = any> { 2062 + highWaterMark?: (number | bigint); 2063 + size?: (chunk: T) => number | bigint; 2064 + } 2065 + interface UnderlyingSink<W = any> { 2066 + type?: string; 2067 + start?: (controller: WritableStreamDefaultController) => void | Promise<void>; 2068 + write?: (chunk: W, controller: WritableStreamDefaultController) => void | Promise<void>; 2069 + abort?: (reason: any) => void | Promise<void>; 2070 + close?: () => void | Promise<void>; 2071 + } 2072 + interface UnderlyingByteSource { 2073 + type: "bytes"; 2074 + autoAllocateChunkSize?: number; 2075 + start?: (controller: ReadableByteStreamController) => void | Promise<void>; 2076 + pull?: (controller: ReadableByteStreamController) => void | Promise<void>; 2077 + cancel?: (reason: any) => void | Promise<void>; 2078 + } 2079 + interface UnderlyingSource<R = any> { 2080 + type?: "" | undefined; 2081 + start?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>; 2082 + pull?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>; 2083 + cancel?: (reason: any) => void | Promise<void>; 2084 + expectedLength?: (number | bigint); 2085 + } 2086 + interface Transformer<I = any, O = any> { 2087 + readableType?: string; 2088 + writableType?: string; 2089 + start?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>; 2090 + transform?: (chunk: I, controller: TransformStreamDefaultController<O>) => void | Promise<void>; 2091 + flush?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>; 2092 + cancel?: (reason: any) => void | Promise<void>; 2093 + expectedLength?: number; 2094 + } 2095 + interface StreamPipeOptions { 2096 + preventAbort?: boolean; 2097 + preventCancel?: boolean; 2098 + /** 2099 + * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. 2100 + * 2101 + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. 2102 + * 2103 + * Errors and closures of the source and destination streams propagate as follows: 2104 + * 2105 + * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. 2106 + * 2107 + * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. 2108 + * 2109 + * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. 2110 + * 2111 + * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. 2112 + * 2113 + * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. 2114 + */ 2115 + preventClose?: boolean; 2116 + signal?: AbortSignal; 2117 + } 2118 + type ReadableStreamReadResult<R = any> = { 2119 + done: false; 2120 + value: R; 2121 + } | { 2122 + done: true; 2123 + value?: undefined; 2124 + }; 2125 + /** 2126 + * The `ReadableStream` interface of the Streams API represents a readable stream of byte data. 2127 + * 2128 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream) 2129 + */ 2130 + interface ReadableStream<R = any> { 2131 + /** 2132 + * The **`locked`** read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader. 2133 + * 2134 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) 2135 + */ 2136 + get locked(): boolean; 2137 + /** 2138 + * The **`cancel()`** method of the ReadableStream interface returns a Promise that resolves when the stream is canceled. 2139 + * 2140 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) 2141 + */ 2142 + cancel(reason?: any): Promise<void>; 2143 + /** 2144 + * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. 2145 + * 2146 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) 2147 + */ 2148 + getReader(): ReadableStreamDefaultReader<R>; 2149 + /** 2150 + * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. 2151 + * 2152 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) 2153 + */ 2154 + getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader; 2155 + /** 2156 + * The **`pipeThrough()`** method of the ReadableStream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. 2157 + * 2158 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) 2159 + */ 2160 + pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>; 2161 + /** 2162 + * The **`pipeTo()`** method of the ReadableStream interface pipes the current `ReadableStream` to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. 2163 + * 2164 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) 2165 + */ 2166 + pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>; 2167 + /** 2168 + * The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances. 2169 + * 2170 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) 2171 + */ 2172 + tee(): [ 2173 + ReadableStream<R>, 2174 + ReadableStream<R> 2175 + ]; 2176 + values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>; 2177 + [Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>; 2178 + } 2179 + /** 2180 + * The `ReadableStream` interface of the Streams API represents a readable stream of byte data. 2181 + * 2182 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream) 2183 + */ 2184 + declare const ReadableStream: { 2185 + prototype: ReadableStream; 2186 + new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>; 2187 + new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>; 2188 + }; 2189 + /** 2190 + * The **`ReadableStreamDefaultReader`** interface of the Streams API represents a default reader that can be used to read stream data supplied from a network (such as a fetch request). 2191 + * 2192 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) 2193 + */ 2194 + declare class ReadableStreamDefaultReader<R = any> { 2195 + constructor(stream: ReadableStream); 2196 + get closed(): Promise<void>; 2197 + cancel(reason?: any): Promise<void>; 2198 + /** 2199 + * The **`read()`** method of the ReadableStreamDefaultReader interface returns a Promise providing access to the next chunk in the stream's internal queue. 2200 + * 2201 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) 2202 + */ 2203 + read(): Promise<ReadableStreamReadResult<R>>; 2204 + /** 2205 + * The **`releaseLock()`** method of the ReadableStreamDefaultReader interface releases the reader's lock on the stream. 2206 + * 2207 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) 2208 + */ 2209 + releaseLock(): void; 2210 + } 2211 + /** 2212 + * The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source. 2213 + * 2214 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) 2215 + */ 2216 + declare class ReadableStreamBYOBReader { 2217 + constructor(stream: ReadableStream); 2218 + get closed(): Promise<void>; 2219 + cancel(reason?: any): Promise<void>; 2220 + /** 2221 + * The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. 2222 + * 2223 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) 2224 + */ 2225 + read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>; 2226 + /** 2227 + * The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream. 2228 + * 2229 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) 2230 + */ 2231 + releaseLock(): void; 2232 + readAtLeast<T extends ArrayBufferView>(minElements: number, view: T): Promise<ReadableStreamReadResult<T>>; 2233 + } 2234 + interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions { 2235 + min?: number; 2236 + } 2237 + interface ReadableStreamGetReaderOptions { 2238 + /** 2239 + * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. 2240 + * 2241 + * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation. 2242 + */ 2243 + mode: "byob"; 2244 + } 2245 + /** 2246 + * The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues). 2247 + * 2248 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) 2249 + */ 2250 + declare abstract class ReadableStreamBYOBRequest { 2251 + /** 2252 + * The **`view`** getter property of the ReadableStreamBYOBRequest interface returns the current view. 2253 + * 2254 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) 2255 + */ 2256 + get view(): Uint8Array | null; 2257 + /** 2258 + * The **`respond()`** method of the ReadableStreamBYOBRequest interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the ReadableStreamBYOBRequest.view. 2259 + * 2260 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) 2261 + */ 2262 + respond(bytesWritten: number): void; 2263 + /** 2264 + * The **`respondWithNewView()`** method of the ReadableStreamBYOBRequest interface specifies a new view that the consumer of the associated readable byte stream should write to instead of ReadableStreamBYOBRequest.view. 2265 + * 2266 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) 2267 + */ 2268 + respondWithNewView(view: ArrayBuffer | ArrayBufferView): void; 2269 + get atLeast(): number | null; 2270 + } 2271 + /** 2272 + * The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. 2273 + * 2274 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) 2275 + */ 2276 + declare abstract class ReadableStreamDefaultController<R = any> { 2277 + /** 2278 + * The **`desiredSize`** read-only property of the required to fill the stream's internal queue. 2279 + * 2280 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) 2281 + */ 2282 + get desiredSize(): number | null; 2283 + /** 2284 + * The **`close()`** method of the ReadableStreamDefaultController interface closes the associated stream. 2285 + * 2286 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) 2287 + */ 2288 + close(): void; 2289 + /** 2290 + * The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue. 2291 + * 2292 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) 2293 + */ 2294 + enqueue(chunk?: R): void; 2295 + /** 2296 + * The **`error()`** method of the with the associated stream to error. 2297 + * 2298 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) 2299 + */ 2300 + error(reason: any): void; 2301 + } 2302 + /** 2303 + * The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream. 2304 + * 2305 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) 2306 + */ 2307 + declare abstract class ReadableByteStreamController { 2308 + /** 2309 + * The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests. 2310 + * 2311 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) 2312 + */ 2313 + get byobRequest(): ReadableStreamBYOBRequest | null; 2314 + /** 2315 + * The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its 'desired size'. 2316 + * 2317 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) 2318 + */ 2319 + get desiredSize(): number | null; 2320 + /** 2321 + * The **`close()`** method of the ReadableByteStreamController interface closes the associated stream. 2322 + * 2323 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) 2324 + */ 2325 + close(): void; 2326 + /** 2327 + * The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). 2328 + * 2329 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) 2330 + */ 2331 + enqueue(chunk: ArrayBuffer | ArrayBufferView): void; 2332 + /** 2333 + * The **`error()`** method of the ReadableByteStreamController interface causes any future interactions with the associated stream to error with the specified reason. 2334 + * 2335 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) 2336 + */ 2337 + error(reason: any): void; 2338 + } 2339 + /** 2340 + * The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state. 2341 + * 2342 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController) 2343 + */ 2344 + declare abstract class WritableStreamDefaultController { 2345 + /** 2346 + * The read-only **`signal`** property of the WritableStreamDefaultController interface returns the AbortSignal associated with the controller. 2347 + * 2348 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) 2349 + */ 2350 + get signal(): AbortSignal; 2351 + /** 2352 + * The **`error()`** method of the with the associated stream to error. 2353 + * 2354 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) 2355 + */ 2356 + error(reason?: any): void; 2357 + } 2358 + /** 2359 + * The **`TransformStreamDefaultController`** interface of the Streams API provides methods to manipulate the associated ReadableStream and WritableStream. 2360 + * 2361 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) 2362 + */ 2363 + declare abstract class TransformStreamDefaultController<O = any> { 2364 + /** 2365 + * The **`desiredSize`** read-only property of the TransformStreamDefaultController interface returns the desired size to fill the queue of the associated ReadableStream. 2366 + * 2367 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) 2368 + */ 2369 + get desiredSize(): number | null; 2370 + /** 2371 + * The **`enqueue()`** method of the TransformStreamDefaultController interface enqueues the given chunk in the readable side of the stream. 2372 + * 2373 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) 2374 + */ 2375 + enqueue(chunk?: O): void; 2376 + /** 2377 + * The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream. 2378 + * 2379 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) 2380 + */ 2381 + error(reason: any): void; 2382 + /** 2383 + * The **`terminate()`** method of the TransformStreamDefaultController interface closes the readable side and errors the writable side of the stream. 2384 + * 2385 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) 2386 + */ 2387 + terminate(): void; 2388 + } 2389 + interface ReadableWritablePair<R = any, W = any> { 2390 + readable: ReadableStream<R>; 2391 + /** 2392 + * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. 2393 + * 2394 + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. 2395 + */ 2396 + writable: WritableStream<W>; 2397 + } 2398 + /** 2399 + * The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. 2400 + * 2401 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream) 2402 + */ 2403 + declare class WritableStream<W = any> { 2404 + constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy); 2405 + /** 2406 + * The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer. 2407 + * 2408 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) 2409 + */ 2410 + get locked(): boolean; 2411 + /** 2412 + * The **`abort()`** method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. 2413 + * 2414 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) 2415 + */ 2416 + abort(reason?: any): Promise<void>; 2417 + /** 2418 + * The **`close()`** method of the WritableStream interface closes the associated stream. 2419 + * 2420 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) 2421 + */ 2422 + close(): Promise<void>; 2423 + /** 2424 + * The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. 2425 + * 2426 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) 2427 + */ 2428 + getWriter(): WritableStreamDefaultWriter<W>; 2429 + } 2430 + /** 2431 + * The **`WritableStreamDefaultWriter`** interface of the Streams API is the object returned by WritableStream.getWriter() and once created locks the writer to the `WritableStream` ensuring that no other streams can write to the underlying sink. 2432 + * 2433 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter) 2434 + */ 2435 + declare class WritableStreamDefaultWriter<W = any> { 2436 + constructor(stream: WritableStream); 2437 + /** 2438 + * The **`closed`** read-only property of the the stream errors or the writer's lock is released. 2439 + * 2440 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) 2441 + */ 2442 + get closed(): Promise<void>; 2443 + /** 2444 + * The **`ready`** read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure. 2445 + * 2446 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) 2447 + */ 2448 + get ready(): Promise<void>; 2449 + /** 2450 + * The **`desiredSize`** read-only property of the to fill the stream's internal queue. 2451 + * 2452 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) 2453 + */ 2454 + get desiredSize(): number | null; 2455 + /** 2456 + * The **`abort()`** method of the the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. 2457 + * 2458 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) 2459 + */ 2460 + abort(reason?: any): Promise<void>; 2461 + /** 2462 + * The **`close()`** method of the stream. 2463 + * 2464 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) 2465 + */ 2466 + close(): Promise<void>; 2467 + /** 2468 + * The **`write()`** method of the operation. 2469 + * 2470 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) 2471 + */ 2472 + write(chunk?: W): Promise<void>; 2473 + /** 2474 + * The **`releaseLock()`** method of the corresponding stream. 2475 + * 2476 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) 2477 + */ 2478 + releaseLock(): void; 2479 + } 2480 + /** 2481 + * The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept. 2482 + * 2483 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) 2484 + */ 2485 + declare class TransformStream<I = any, O = any> { 2486 + constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>); 2487 + /** 2488 + * The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`. 2489 + * 2490 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) 2491 + */ 2492 + get readable(): ReadableStream<O>; 2493 + /** 2494 + * The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`. 2495 + * 2496 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) 2497 + */ 2498 + get writable(): WritableStream<I>; 2499 + } 2500 + declare class FixedLengthStream extends IdentityTransformStream { 2501 + constructor(expectedLength: number | bigint, queuingStrategy?: IdentityTransformStreamQueuingStrategy); 2502 + } 2503 + declare class IdentityTransformStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> { 2504 + constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy); 2505 + } 2506 + interface IdentityTransformStreamQueuingStrategy { 2507 + highWaterMark?: (number | bigint); 2508 + } 2509 + interface ReadableStreamValuesOptions { 2510 + preventCancel?: boolean; 2511 + } 2512 + /** 2513 + * The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data. 2514 + * 2515 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) 2516 + */ 2517 + declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> { 2518 + constructor(format: "gzip" | "deflate" | "deflate-raw"); 2519 + } 2520 + /** 2521 + * The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data. 2522 + * 2523 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) 2524 + */ 2525 + declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> { 2526 + constructor(format: "gzip" | "deflate" | "deflate-raw"); 2527 + } 2528 + /** 2529 + * The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. 2530 + * 2531 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) 2532 + */ 2533 + declare class TextEncoderStream extends TransformStream<string, Uint8Array> { 2534 + constructor(); 2535 + get encoding(): string; 2536 + } 2537 + /** 2538 + * The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings. 2539 + * 2540 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) 2541 + */ 2542 + declare class TextDecoderStream extends TransformStream<ArrayBuffer | ArrayBufferView, string> { 2543 + constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit); 2544 + get encoding(): string; 2545 + get fatal(): boolean; 2546 + get ignoreBOM(): boolean; 2547 + } 2548 + interface TextDecoderStreamTextDecoderStreamInit { 2549 + fatal?: boolean; 2550 + ignoreBOM?: boolean; 2551 + } 2552 + /** 2553 + * The **`ByteLengthQueuingStrategy`** interface of the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams. 2554 + * 2555 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy) 2556 + */ 2557 + declare class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> { 2558 + constructor(init: QueuingStrategyInit); 2559 + /** 2560 + * The read-only **`ByteLengthQueuingStrategy.highWaterMark`** property returns the total number of bytes that can be contained in the internal queue before backpressure is applied. 2561 + * 2562 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) 2563 + */ 2564 + get highWaterMark(): number; 2565 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */ 2566 + get size(): (chunk?: any) => number; 2567 + } 2568 + /** 2569 + * The **`CountQueuingStrategy`** interface of the Streams API provides a built-in chunk counting queuing strategy that can be used when constructing streams. 2570 + * 2571 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy) 2572 + */ 2573 + declare class CountQueuingStrategy implements QueuingStrategy { 2574 + constructor(init: QueuingStrategyInit); 2575 + /** 2576 + * The read-only **`CountQueuingStrategy.highWaterMark`** property returns the total number of chunks that can be contained in the internal queue before backpressure is applied. 2577 + * 2578 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) 2579 + */ 2580 + get highWaterMark(): number; 2581 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */ 2582 + get size(): (chunk?: any) => number; 2583 + } 2584 + interface QueuingStrategyInit { 2585 + /** 2586 + * Creates a new ByteLengthQueuingStrategy with the provided high water mark. 2587 + * 2588 + * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw. 2589 + */ 2590 + highWaterMark: number; 2591 + } 2592 + interface ScriptVersion { 2593 + id?: string; 2594 + tag?: string; 2595 + message?: string; 2596 + } 2597 + declare abstract class TailEvent extends ExtendableEvent { 2598 + readonly events: TraceItem[]; 2599 + readonly traces: TraceItem[]; 2600 + } 2601 + interface TraceItem { 2602 + readonly event: (TraceItemFetchEventInfo | TraceItemJsRpcEventInfo | TraceItemScheduledEventInfo | TraceItemAlarmEventInfo | TraceItemQueueEventInfo | TraceItemEmailEventInfo | TraceItemTailEventInfo | TraceItemCustomEventInfo | TraceItemHibernatableWebSocketEventInfo) | null; 2603 + readonly eventTimestamp: number | null; 2604 + readonly logs: TraceLog[]; 2605 + readonly exceptions: TraceException[]; 2606 + readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[]; 2607 + readonly scriptName: string | null; 2608 + readonly entrypoint?: string; 2609 + readonly scriptVersion?: ScriptVersion; 2610 + readonly dispatchNamespace?: string; 2611 + readonly scriptTags?: string[]; 2612 + readonly durableObjectId?: string; 2613 + readonly outcome: string; 2614 + readonly executionModel: string; 2615 + readonly truncated: boolean; 2616 + readonly cpuTime: number; 2617 + readonly wallTime: number; 2618 + } 2619 + interface TraceItemAlarmEventInfo { 2620 + readonly scheduledTime: Date; 2621 + } 2622 + interface TraceItemCustomEventInfo { 2623 + } 2624 + interface TraceItemScheduledEventInfo { 2625 + readonly scheduledTime: number; 2626 + readonly cron: string; 2627 + } 2628 + interface TraceItemQueueEventInfo { 2629 + readonly queue: string; 2630 + readonly batchSize: number; 2631 + } 2632 + interface TraceItemEmailEventInfo { 2633 + readonly mailFrom: string; 2634 + readonly rcptTo: string; 2635 + readonly rawSize: number; 2636 + } 2637 + interface TraceItemTailEventInfo { 2638 + readonly consumedEvents: TraceItemTailEventInfoTailItem[]; 2639 + } 2640 + interface TraceItemTailEventInfoTailItem { 2641 + readonly scriptName: string | null; 2642 + } 2643 + interface TraceItemFetchEventInfo { 2644 + readonly response?: TraceItemFetchEventInfoResponse; 2645 + readonly request: TraceItemFetchEventInfoRequest; 2646 + } 2647 + interface TraceItemFetchEventInfoRequest { 2648 + readonly cf?: any; 2649 + readonly headers: Record<string, string>; 2650 + readonly method: string; 2651 + readonly url: string; 2652 + getUnredacted(): TraceItemFetchEventInfoRequest; 2653 + } 2654 + interface TraceItemFetchEventInfoResponse { 2655 + readonly status: number; 2656 + } 2657 + interface TraceItemJsRpcEventInfo { 2658 + readonly rpcMethod: string; 2659 + } 2660 + interface TraceItemHibernatableWebSocketEventInfo { 2661 + readonly getWebSocketEvent: TraceItemHibernatableWebSocketEventInfoMessage | TraceItemHibernatableWebSocketEventInfoClose | TraceItemHibernatableWebSocketEventInfoError; 2662 + } 2663 + interface TraceItemHibernatableWebSocketEventInfoMessage { 2664 + readonly webSocketEventType: string; 2665 + } 2666 + interface TraceItemHibernatableWebSocketEventInfoClose { 2667 + readonly webSocketEventType: string; 2668 + readonly code: number; 2669 + readonly wasClean: boolean; 2670 + } 2671 + interface TraceItemHibernatableWebSocketEventInfoError { 2672 + readonly webSocketEventType: string; 2673 + } 2674 + interface TraceLog { 2675 + readonly timestamp: number; 2676 + readonly level: string; 2677 + readonly message: any; 2678 + } 2679 + interface TraceException { 2680 + readonly timestamp: number; 2681 + readonly message: string; 2682 + readonly name: string; 2683 + readonly stack?: string; 2684 + } 2685 + interface TraceDiagnosticChannelEvent { 2686 + readonly timestamp: number; 2687 + readonly channel: string; 2688 + readonly message: any; 2689 + } 2690 + interface TraceMetrics { 2691 + readonly cpuTime: number; 2692 + readonly wallTime: number; 2693 + } 2694 + interface UnsafeTraceMetrics { 2695 + fromTrace(item: TraceItem): TraceMetrics; 2696 + } 2697 + /** 2698 + * The **`URL`** interface is used to parse, construct, normalize, and encode URL. 2699 + * 2700 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL) 2701 + */ 2702 + declare class URL { 2703 + constructor(url: string | URL, base?: string | URL); 2704 + /** 2705 + * The **`origin`** read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL. 2706 + * 2707 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) 2708 + */ 2709 + get origin(): string; 2710 + /** 2711 + * The **`href`** property of the URL interface is a string containing the whole URL. 2712 + * 2713 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) 2714 + */ 2715 + get href(): string; 2716 + /** 2717 + * The **`href`** property of the URL interface is a string containing the whole URL. 2718 + * 2719 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) 2720 + */ 2721 + set href(value: string); 2722 + /** 2723 + * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`. 2724 + * 2725 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) 2726 + */ 2727 + get protocol(): string; 2728 + /** 2729 + * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`. 2730 + * 2731 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) 2732 + */ 2733 + set protocol(value: string); 2734 + /** 2735 + * The **`username`** property of the URL interface is a string containing the username component of the URL. 2736 + * 2737 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) 2738 + */ 2739 + get username(): string; 2740 + /** 2741 + * The **`username`** property of the URL interface is a string containing the username component of the URL. 2742 + * 2743 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) 2744 + */ 2745 + set username(value: string); 2746 + /** 2747 + * The **`password`** property of the URL interface is a string containing the password component of the URL. 2748 + * 2749 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) 2750 + */ 2751 + get password(): string; 2752 + /** 2753 + * The **`password`** property of the URL interface is a string containing the password component of the URL. 2754 + * 2755 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) 2756 + */ 2757 + set password(value: string); 2758 + /** 2759 + * The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL. 2760 + * 2761 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) 2762 + */ 2763 + get host(): string; 2764 + /** 2765 + * The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL. 2766 + * 2767 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) 2768 + */ 2769 + set host(value: string); 2770 + /** 2771 + * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. 2772 + * 2773 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) 2774 + */ 2775 + get hostname(): string; 2776 + /** 2777 + * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. 2778 + * 2779 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) 2780 + */ 2781 + set hostname(value: string); 2782 + /** 2783 + * The **`port`** property of the URL interface is a string containing the port number of the URL. 2784 + * 2785 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) 2786 + */ 2787 + get port(): string; 2788 + /** 2789 + * The **`port`** property of the URL interface is a string containing the port number of the URL. 2790 + * 2791 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) 2792 + */ 2793 + set port(value: string); 2794 + /** 2795 + * The **`pathname`** property of the URL interface represents a location in a hierarchical structure. 2796 + * 2797 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) 2798 + */ 2799 + get pathname(): string; 2800 + /** 2801 + * The **`pathname`** property of the URL interface represents a location in a hierarchical structure. 2802 + * 2803 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) 2804 + */ 2805 + set pathname(value: string); 2806 + /** 2807 + * The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL. 2808 + * 2809 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) 2810 + */ 2811 + get search(): string; 2812 + /** 2813 + * The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL. 2814 + * 2815 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) 2816 + */ 2817 + set search(value: string); 2818 + /** 2819 + * The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL. 2820 + * 2821 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) 2822 + */ 2823 + get hash(): string; 2824 + /** 2825 + * The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL. 2826 + * 2827 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) 2828 + */ 2829 + set hash(value: string); 2830 + /** 2831 + * The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL. 2832 + * 2833 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) 2834 + */ 2835 + get searchParams(): URLSearchParams; 2836 + /** 2837 + * The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as ```js-nolint toJSON() ``` None. 2838 + * 2839 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) 2840 + */ 2841 + toJSON(): string; 2842 + /*function toString() { [native code] }*/ 2843 + toString(): string; 2844 + /** 2845 + * The **`URL.canParse()`** static method of the URL interface returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid. 2846 + * 2847 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) 2848 + */ 2849 + static canParse(url: string, base?: string): boolean; 2850 + /** 2851 + * The **`URL.parse()`** static method of the URL interface returns a newly created URL object representing the URL defined by the parameters. 2852 + * 2853 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) 2854 + */ 2855 + static parse(url: string, base?: string): URL | null; 2856 + /** 2857 + * The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter. 2858 + * 2859 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) 2860 + */ 2861 + static createObjectURL(object: File | Blob): string; 2862 + /** 2863 + * The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer. 2864 + * 2865 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) 2866 + */ 2867 + static revokeObjectURL(object_url: string): void; 2868 + } 2869 + /** 2870 + * The **`URLSearchParams`** interface defines utility methods to work with the query string of a URL. 2871 + * 2872 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) 2873 + */ 2874 + declare class URLSearchParams { 2875 + constructor(init?: (Iterable<Iterable<string>> | Record<string, string> | string)); 2876 + /** 2877 + * The **`size`** read-only property of the URLSearchParams interface indicates the total number of search parameter entries. 2878 + * 2879 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) 2880 + */ 2881 + get size(): number; 2882 + /** 2883 + * The **`append()`** method of the URLSearchParams interface appends a specified key/value pair as a new search parameter. 2884 + * 2885 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append) 2886 + */ 2887 + append(name: string, value: string): void; 2888 + /** 2889 + * The **`delete()`** method of the URLSearchParams interface deletes specified parameters and their associated value(s) from the list of all search parameters. 2890 + * 2891 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete) 2892 + */ 2893 + delete(name: string, value?: string): void; 2894 + /** 2895 + * The **`get()`** method of the URLSearchParams interface returns the first value associated to the given search parameter. 2896 + * 2897 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get) 2898 + */ 2899 + get(name: string): string | null; 2900 + /** 2901 + * The **`getAll()`** method of the URLSearchParams interface returns all the values associated with a given search parameter as an array. 2902 + * 2903 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll) 2904 + */ 2905 + getAll(name: string): string[]; 2906 + /** 2907 + * The **`has()`** method of the URLSearchParams interface returns a boolean value that indicates whether the specified parameter is in the search parameters. 2908 + * 2909 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has) 2910 + */ 2911 + has(name: string, value?: string): boolean; 2912 + /** 2913 + * The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. 2914 + * 2915 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set) 2916 + */ 2917 + set(name: string, value: string): void; 2918 + /** 2919 + * The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`. 2920 + * 2921 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) 2922 + */ 2923 + sort(): void; 2924 + /* Returns an array of key, value pairs for every entry in the search params. */ 2925 + entries(): IterableIterator<[ 2926 + key: string, 2927 + value: string 2928 + ]>; 2929 + /* Returns a list of keys in the search params. */ 2930 + keys(): IterableIterator<string>; 2931 + /* Returns a list of values in the search params. */ 2932 + values(): IterableIterator<string>; 2933 + forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void; 2934 + /*function toString() { [native code] }*/ 2935 + toString(): string; 2936 + [Symbol.iterator](): IterableIterator<[ 2937 + key: string, 2938 + value: string 2939 + ]>; 2940 + } 2941 + declare class URLPattern { 2942 + constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions); 2943 + get protocol(): string; 2944 + get username(): string; 2945 + get password(): string; 2946 + get hostname(): string; 2947 + get port(): string; 2948 + get pathname(): string; 2949 + get search(): string; 2950 + get hash(): string; 2951 + test(input?: (string | URLPatternInit), baseURL?: string): boolean; 2952 + exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null; 2953 + } 2954 + interface URLPatternInit { 2955 + protocol?: string; 2956 + username?: string; 2957 + password?: string; 2958 + hostname?: string; 2959 + port?: string; 2960 + pathname?: string; 2961 + search?: string; 2962 + hash?: string; 2963 + baseURL?: string; 2964 + } 2965 + interface URLPatternComponentResult { 2966 + input: string; 2967 + groups: Record<string, string>; 2968 + } 2969 + interface URLPatternResult { 2970 + inputs: (string | URLPatternInit)[]; 2971 + protocol: URLPatternComponentResult; 2972 + username: URLPatternComponentResult; 2973 + password: URLPatternComponentResult; 2974 + hostname: URLPatternComponentResult; 2975 + port: URLPatternComponentResult; 2976 + pathname: URLPatternComponentResult; 2977 + search: URLPatternComponentResult; 2978 + hash: URLPatternComponentResult; 2979 + } 2980 + interface URLPatternOptions { 2981 + ignoreCase?: boolean; 2982 + } 2983 + /** 2984 + * A `CloseEvent` is sent to clients using WebSockets when the connection is closed. 2985 + * 2986 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent) 2987 + */ 2988 + declare class CloseEvent extends Event { 2989 + constructor(type: string, initializer?: CloseEventInit); 2990 + /** 2991 + * The **`code`** read-only property of the CloseEvent interface returns a WebSocket connection close code indicating the reason the connection was closed. 2992 + * 2993 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code) 2994 + */ 2995 + readonly code: number; 2996 + /** 2997 + * The **`reason`** read-only property of the CloseEvent interface returns the WebSocket connection close reason the server gave for closing the connection; that is, a concise human-readable prose explanation for the closure. 2998 + * 2999 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason) 3000 + */ 3001 + readonly reason: string; 3002 + /** 3003 + * The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly. 3004 + * 3005 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean) 3006 + */ 3007 + readonly wasClean: boolean; 3008 + } 3009 + interface CloseEventInit { 3010 + code?: number; 3011 + reason?: string; 3012 + wasClean?: boolean; 3013 + } 3014 + type WebSocketEventMap = { 3015 + close: CloseEvent; 3016 + message: MessageEvent; 3017 + open: Event; 3018 + error: ErrorEvent; 3019 + }; 3020 + /** 3021 + * The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. 3022 + * 3023 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket) 3024 + */ 3025 + declare var WebSocket: { 3026 + prototype: WebSocket; 3027 + new (url: string, protocols?: (string[] | string)): WebSocket; 3028 + readonly READY_STATE_CONNECTING: number; 3029 + readonly CONNECTING: number; 3030 + readonly READY_STATE_OPEN: number; 3031 + readonly OPEN: number; 3032 + readonly READY_STATE_CLOSING: number; 3033 + readonly CLOSING: number; 3034 + readonly READY_STATE_CLOSED: number; 3035 + readonly CLOSED: number; 3036 + }; 3037 + /** 3038 + * The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. 3039 + * 3040 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket) 3041 + */ 3042 + interface WebSocket extends EventTarget<WebSocketEventMap> { 3043 + accept(options?: WebSocketAcceptOptions): void; 3044 + /** 3045 + * The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data. 3046 + * 3047 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send) 3048 + */ 3049 + send(message: (ArrayBuffer | ArrayBufferView) | string): void; 3050 + /** 3051 + * The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing. 3052 + * 3053 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close) 3054 + */ 3055 + close(code?: number, reason?: string): void; 3056 + serializeAttachment(attachment: any): void; 3057 + deserializeAttachment(): any | null; 3058 + /** 3059 + * The **`WebSocket.readyState`** read-only property returns the current state of the WebSocket connection. 3060 + * 3061 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState) 3062 + */ 3063 + readyState: number; 3064 + /** 3065 + * The **`WebSocket.url`** read-only property returns the absolute URL of the WebSocket as resolved by the constructor. 3066 + * 3067 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url) 3068 + */ 3069 + url: string | null; 3070 + /** 3071 + * The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the `protocols` parameter when creating the WebSocket object, or the empty string if no connection is established. 3072 + * 3073 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol) 3074 + */ 3075 + protocol: string | null; 3076 + /** 3077 + * The **`WebSocket.extensions`** read-only property returns the extensions selected by the server. 3078 + * 3079 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions) 3080 + */ 3081 + extensions: string | null; 3082 + /** 3083 + * The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection. 3084 + * 3085 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType) 3086 + */ 3087 + binaryType: "blob" | "arraybuffer"; 3088 + } 3089 + interface WebSocketAcceptOptions { 3090 + /** 3091 + * When set to `true`, receiving a server-initiated WebSocket Close frame will not 3092 + * automatically send a reciprocal Close frame, leaving the connection in a half-open 3093 + * state. This is useful for proxying scenarios where you need to coordinate closing 3094 + * both sides independently. Defaults to `false` when the 3095 + * `no_web_socket_half_open_by_default` compatibility flag is enabled. 3096 + */ 3097 + allowHalfOpen?: boolean; 3098 + } 3099 + declare const WebSocketPair: { 3100 + new (): { 3101 + 0: WebSocket; 3102 + 1: WebSocket; 3103 + }; 3104 + }; 3105 + interface SqlStorage { 3106 + exec<T extends Record<string, SqlStorageValue>>(query: string, ...bindings: any[]): SqlStorageCursor<T>; 3107 + get databaseSize(): number; 3108 + Cursor: typeof SqlStorageCursor; 3109 + Statement: typeof SqlStorageStatement; 3110 + } 3111 + declare abstract class SqlStorageStatement { 3112 + } 3113 + type SqlStorageValue = ArrayBuffer | string | number | null; 3114 + declare abstract class SqlStorageCursor<T extends Record<string, SqlStorageValue>> { 3115 + next(): { 3116 + done?: false; 3117 + value: T; 3118 + } | { 3119 + done: true; 3120 + value?: never; 3121 + }; 3122 + toArray(): T[]; 3123 + one(): T; 3124 + raw<U extends SqlStorageValue[]>(): IterableIterator<U>; 3125 + columnNames: string[]; 3126 + get rowsRead(): number; 3127 + get rowsWritten(): number; 3128 + [Symbol.iterator](): IterableIterator<T>; 3129 + } 3130 + interface Socket { 3131 + get readable(): ReadableStream; 3132 + get writable(): WritableStream; 3133 + get closed(): Promise<void>; 3134 + get opened(): Promise<SocketInfo>; 3135 + get upgraded(): boolean; 3136 + get secureTransport(): "on" | "off" | "starttls"; 3137 + close(): Promise<void>; 3138 + startTls(options?: TlsOptions): Socket; 3139 + } 3140 + interface SocketOptions { 3141 + secureTransport?: string; 3142 + allowHalfOpen: boolean; 3143 + highWaterMark?: (number | bigint); 3144 + } 3145 + interface SocketAddress { 3146 + hostname: string; 3147 + port: number; 3148 + } 3149 + interface TlsOptions { 3150 + expectedServerHostname?: string; 3151 + } 3152 + interface SocketInfo { 3153 + remoteAddress?: string; 3154 + localAddress?: string; 3155 + } 3156 + /** 3157 + * The **`EventSource`** interface is web content's interface to server-sent events. 3158 + * 3159 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) 3160 + */ 3161 + declare class EventSource extends EventTarget { 3162 + constructor(url: string, init?: EventSourceEventSourceInit); 3163 + /** 3164 + * The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None. 3165 + * 3166 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close) 3167 + */ 3168 + close(): void; 3169 + /** 3170 + * The **`url`** read-only property of the URL of the source. 3171 + * 3172 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url) 3173 + */ 3174 + get url(): string; 3175 + /** 3176 + * The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set. 3177 + * 3178 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials) 3179 + */ 3180 + get withCredentials(): boolean; 3181 + /** 3182 + * The **`readyState`** read-only property of the connection. 3183 + * 3184 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState) 3185 + */ 3186 + get readyState(): number; 3187 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */ 3188 + get onopen(): any | null; 3189 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */ 3190 + set onopen(value: any | null); 3191 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */ 3192 + get onmessage(): any | null; 3193 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */ 3194 + set onmessage(value: any | null); 3195 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */ 3196 + get onerror(): any | null; 3197 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */ 3198 + set onerror(value: any | null); 3199 + static readonly CONNECTING: number; 3200 + static readonly OPEN: number; 3201 + static readonly CLOSED: number; 3202 + static from(stream: ReadableStream): EventSource; 3203 + } 3204 + interface EventSourceEventSourceInit { 3205 + withCredentials?: boolean; 3206 + fetcher?: Fetcher; 3207 + } 3208 + interface Container { 3209 + get running(): boolean; 3210 + start(options?: ContainerStartupOptions): void; 3211 + monitor(): Promise<void>; 3212 + destroy(error?: any): Promise<void>; 3213 + signal(signo: number): void; 3214 + getTcpPort(port: number): Fetcher; 3215 + setInactivityTimeout(durationMs: number | bigint): Promise<void>; 3216 + interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>; 3217 + interceptAllOutboundHttp(binding: Fetcher): Promise<void>; 3218 + } 3219 + interface ContainerStartupOptions { 3220 + entrypoint?: string[]; 3221 + enableInternet: boolean; 3222 + env?: Record<string, string>; 3223 + hardTimeout?: (number | bigint); 3224 + } 3225 + /** 3226 + * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. 3227 + * 3228 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort) 3229 + */ 3230 + declare abstract class MessagePort extends EventTarget { 3231 + /** 3232 + * The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts. 3233 + * 3234 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage) 3235 + */ 3236 + postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void; 3237 + /** 3238 + * The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. 3239 + * 3240 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close) 3241 + */ 3242 + close(): void; 3243 + /** 3244 + * The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. 3245 + * 3246 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start) 3247 + */ 3248 + start(): void; 3249 + get onmessage(): any | null; 3250 + set onmessage(value: any | null); 3251 + } 3252 + interface MessagePortPostMessageOptions { 3253 + transfer?: any[]; 3254 + } 3255 + type LoopbackForExport<T extends (new (...args: any[]) => Rpc.EntrypointBranded) | ExportedHandler<any, any, any> | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? LoopbackServiceStub<InstanceType<T>> : T extends new (...args: any[]) => Rpc.DurableObjectBranded ? LoopbackDurableObjectClass<InstanceType<T>> : T extends ExportedHandler<any, any, any> ? LoopbackServiceStub<undefined> : undefined; 3256 + type LoopbackServiceStub<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> = Fetcher<T> & (T extends CloudflareWorkersModule.WorkerEntrypoint<any, infer Props> ? (opts: { 3257 + props?: Props; 3258 + }) => Fetcher<T> : (opts: { 3259 + props?: any; 3260 + }) => Fetcher<T>); 3261 + type LoopbackDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined = undefined> = DurableObjectClass<T> & (T extends CloudflareWorkersModule.DurableObject<any, infer Props> ? (opts: { 3262 + props?: Props; 3263 + }) => DurableObjectClass<T> : (opts: { 3264 + props?: any; 3265 + }) => DurableObjectClass<T>); 3266 + interface SyncKvStorage { 3267 + get<T = unknown>(key: string): T | undefined; 3268 + list<T = unknown>(options?: SyncKvListOptions): Iterable<[ 3269 + string, 3270 + T 3271 + ]>; 3272 + put<T>(key: string, value: T): void; 3273 + delete(key: string): boolean; 3274 + } 3275 + interface SyncKvListOptions { 3276 + start?: string; 3277 + startAfter?: string; 3278 + end?: string; 3279 + prefix?: string; 3280 + reverse?: boolean; 3281 + limit?: number; 3282 + } 3283 + interface WorkerStub { 3284 + getEntrypoint<T extends Rpc.WorkerEntrypointBranded | undefined>(name?: string, options?: WorkerStubEntrypointOptions): Fetcher<T>; 3285 + } 3286 + interface WorkerStubEntrypointOptions { 3287 + props?: any; 3288 + } 3289 + interface WorkerLoader { 3290 + get(name: string | null, getCode: () => WorkerLoaderWorkerCode | Promise<WorkerLoaderWorkerCode>): WorkerStub; 3291 + load(code: WorkerLoaderWorkerCode): WorkerStub; 3292 + } 3293 + interface WorkerLoaderModule { 3294 + js?: string; 3295 + cjs?: string; 3296 + text?: string; 3297 + data?: ArrayBuffer; 3298 + json?: any; 3299 + py?: string; 3300 + wasm?: ArrayBuffer; 3301 + } 3302 + interface WorkerLoaderWorkerCode { 3303 + compatibilityDate: string; 3304 + compatibilityFlags?: string[]; 3305 + allowExperimental?: boolean; 3306 + mainModule: string; 3307 + modules: Record<string, WorkerLoaderModule | string>; 3308 + env?: any; 3309 + globalOutbound?: (Fetcher | null); 3310 + tails?: Fetcher[]; 3311 + streamingTails?: Fetcher[]; 3312 + } 3313 + /** 3314 + * The Workers runtime supports a subset of the Performance API, used to measure timing and performance, 3315 + * as well as timing of subrequests and other operations. 3316 + * 3317 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/) 3318 + */ 3319 + declare abstract class Performance { 3320 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */ 3321 + get timeOrigin(): number; 3322 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */ 3323 + now(): number; 3324 + /** 3325 + * The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object. 3326 + * 3327 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON) 3328 + */ 3329 + toJSON(): object; 3330 + } 3331 + // AI Search V2 API Error Interfaces 3332 + interface AiSearchInternalError extends Error { 3333 + } 3334 + interface AiSearchNotFoundError extends Error { 3335 + } 3336 + interface AiSearchNameNotSetError extends Error { 3337 + } 3338 + // AI Search V2 Request Types 3339 + type AiSearchSearchRequest = { 3340 + messages: Array<{ 3341 + role: 'system' | 'developer' | 'user' | 'assistant' | 'tool'; 3342 + content: string | null; 3343 + }>; 3344 + ai_search_options?: { 3345 + retrieval?: { 3346 + retrieval_type?: 'vector' | 'keyword' | 'hybrid'; 3347 + /** Match threshold (0-1, default 0.4) */ 3348 + match_threshold?: number; 3349 + /** Maximum number of results (1-50, default 10) */ 3350 + max_num_results?: number; 3351 + filters?: VectorizeVectorMetadataFilter; 3352 + /** Context expansion (0-3, default 0) */ 3353 + context_expansion?: number; 3354 + [key: string]: unknown; 3355 + }; 3356 + query_rewrite?: { 3357 + enabled?: boolean; 3358 + model?: string; 3359 + rewrite_prompt?: string; 3360 + [key: string]: unknown; 3361 + }; 3362 + reranking?: { 3363 + /** Enable reranking (default false) */ 3364 + enabled?: boolean; 3365 + model?: '@cf/baai/bge-reranker-base' | ''; 3366 + /** Match threshold (0-1, default 0.4) */ 3367 + match_threshold?: number; 3368 + [key: string]: unknown; 3369 + }; 3370 + [key: string]: unknown; 3371 + }; 3372 + }; 3373 + type AiSearchChatCompletionsRequest = { 3374 + messages: Array<{ 3375 + role: 'system' | 'developer' | 'user' | 'assistant' | 'tool'; 3376 + content: string | null; 3377 + }>; 3378 + model?: string; 3379 + stream?: boolean; 3380 + ai_search_options?: { 3381 + retrieval?: { 3382 + retrieval_type?: 'vector' | 'keyword' | 'hybrid'; 3383 + match_threshold?: number; 3384 + max_num_results?: number; 3385 + filters?: VectorizeVectorMetadataFilter; 3386 + context_expansion?: number; 3387 + [key: string]: unknown; 3388 + }; 3389 + query_rewrite?: { 3390 + enabled?: boolean; 3391 + model?: string; 3392 + rewrite_prompt?: string; 3393 + [key: string]: unknown; 3394 + }; 3395 + reranking?: { 3396 + enabled?: boolean; 3397 + model?: '@cf/baai/bge-reranker-base' | ''; 3398 + match_threshold?: number; 3399 + [key: string]: unknown; 3400 + }; 3401 + [key: string]: unknown; 3402 + }; 3403 + [key: string]: unknown; 3404 + }; 3405 + // AI Search V2 Response Types 3406 + type AiSearchSearchResponse = { 3407 + search_query: string; 3408 + chunks: Array<{ 3409 + id: string; 3410 + type: string; 3411 + /** Match score (0-1) */ 3412 + score: number; 3413 + text: string; 3414 + item: { 3415 + timestamp?: number; 3416 + key: string; 3417 + metadata?: Record<string, unknown>; 3418 + }; 3419 + scoring_details?: { 3420 + /** Keyword match score (0-1) */ 3421 + keyword_score?: number; 3422 + /** Vector similarity score (0-1) */ 3423 + vector_score?: number; 3424 + }; 3425 + }>; 3426 + }; 3427 + type AiSearchListResponse = Array<{ 3428 + id: string; 3429 + internal_id?: string; 3430 + account_id?: string; 3431 + account_tag?: string; 3432 + /** Whether the instance is enabled (default true) */ 3433 + enable?: boolean; 3434 + type?: 'r2' | 'web-crawler'; 3435 + source?: string; 3436 + [key: string]: unknown; 3437 + }>; 3438 + type AiSearchConfig = { 3439 + /** Instance ID (1-32 chars, pattern: ^[a-z0-9_]+(?:-[a-z0-9_]+)*$) */ 3440 + id: string; 3441 + type: 'r2' | 'web-crawler'; 3442 + source: string; 3443 + source_params?: object; 3444 + /** Token ID (UUID format) */ 3445 + token_id?: string; 3446 + ai_gateway_id?: string; 3447 + /** Enable query rewriting (default false) */ 3448 + rewrite_query?: boolean; 3449 + /** Enable reranking (default false) */ 3450 + reranking?: boolean; 3451 + embedding_model?: string; 3452 + ai_search_model?: string; 3453 + }; 3454 + type AiSearchInstance = { 3455 + id: string; 3456 + enable?: boolean; 3457 + type?: 'r2' | 'web-crawler'; 3458 + source?: string; 3459 + [key: string]: unknown; 3460 + }; 3461 + // AI Search Instance Service - Instance-level operations 3462 + declare abstract class AiSearchInstanceService { 3463 + /** 3464 + * Search the AI Search instance for relevant chunks. 3465 + * @param params Search request with messages and AI search options 3466 + * @returns Search response with matching chunks 3467 + */ 3468 + search(params: AiSearchSearchRequest): Promise<AiSearchSearchResponse>; 3469 + /** 3470 + * Generate chat completions with AI Search context. 3471 + * @param params Chat completions request with optional streaming 3472 + * @returns Response object (if streaming) or chat completion result 3473 + */ 3474 + chatCompletions(params: AiSearchChatCompletionsRequest): Promise<Response | object>; 3475 + /** 3476 + * Delete this AI Search instance. 3477 + */ 3478 + delete(): Promise<void>; 3479 + } 3480 + // AI Search Account Service - Account-level operations 3481 + declare abstract class AiSearchAccountService { 3482 + /** 3483 + * List all AI Search instances in the account. 3484 + * @returns Array of AI Search instances 3485 + */ 3486 + list(): Promise<AiSearchListResponse>; 3487 + /** 3488 + * Get an AI Search instance by ID. 3489 + * @param name Instance ID 3490 + * @returns Instance service for performing operations 3491 + */ 3492 + get(name: string): AiSearchInstanceService; 3493 + /** 3494 + * Create a new AI Search instance. 3495 + * @param config Instance configuration 3496 + * @returns Instance service for performing operations 3497 + */ 3498 + create(config: AiSearchConfig): Promise<AiSearchInstanceService>; 3499 + } 3500 + type AiImageClassificationInput = { 3501 + image: number[]; 3502 + }; 3503 + type AiImageClassificationOutput = { 3504 + score?: number; 3505 + label?: string; 3506 + }[]; 3507 + declare abstract class BaseAiImageClassification { 3508 + inputs: AiImageClassificationInput; 3509 + postProcessedOutputs: AiImageClassificationOutput; 3510 + } 3511 + type AiImageToTextInput = { 3512 + image: number[]; 3513 + prompt?: string; 3514 + max_tokens?: number; 3515 + temperature?: number; 3516 + top_p?: number; 3517 + top_k?: number; 3518 + seed?: number; 3519 + repetition_penalty?: number; 3520 + frequency_penalty?: number; 3521 + presence_penalty?: number; 3522 + raw?: boolean; 3523 + messages?: RoleScopedChatInput[]; 3524 + }; 3525 + type AiImageToTextOutput = { 3526 + description: string; 3527 + }; 3528 + declare abstract class BaseAiImageToText { 3529 + inputs: AiImageToTextInput; 3530 + postProcessedOutputs: AiImageToTextOutput; 3531 + } 3532 + type AiImageTextToTextInput = { 3533 + image: string; 3534 + prompt?: string; 3535 + max_tokens?: number; 3536 + temperature?: number; 3537 + ignore_eos?: boolean; 3538 + top_p?: number; 3539 + top_k?: number; 3540 + seed?: number; 3541 + repetition_penalty?: number; 3542 + frequency_penalty?: number; 3543 + presence_penalty?: number; 3544 + raw?: boolean; 3545 + messages?: RoleScopedChatInput[]; 3546 + }; 3547 + type AiImageTextToTextOutput = { 3548 + description: string; 3549 + }; 3550 + declare abstract class BaseAiImageTextToText { 3551 + inputs: AiImageTextToTextInput; 3552 + postProcessedOutputs: AiImageTextToTextOutput; 3553 + } 3554 + type AiMultimodalEmbeddingsInput = { 3555 + image: string; 3556 + text: string[]; 3557 + }; 3558 + type AiIMultimodalEmbeddingsOutput = { 3559 + data: number[][]; 3560 + shape: number[]; 3561 + }; 3562 + declare abstract class BaseAiMultimodalEmbeddings { 3563 + inputs: AiImageTextToTextInput; 3564 + postProcessedOutputs: AiImageTextToTextOutput; 3565 + } 3566 + type AiObjectDetectionInput = { 3567 + image: number[]; 3568 + }; 3569 + type AiObjectDetectionOutput = { 3570 + score?: number; 3571 + label?: string; 3572 + }[]; 3573 + declare abstract class BaseAiObjectDetection { 3574 + inputs: AiObjectDetectionInput; 3575 + postProcessedOutputs: AiObjectDetectionOutput; 3576 + } 3577 + type AiSentenceSimilarityInput = { 3578 + source: string; 3579 + sentences: string[]; 3580 + }; 3581 + type AiSentenceSimilarityOutput = number[]; 3582 + declare abstract class BaseAiSentenceSimilarity { 3583 + inputs: AiSentenceSimilarityInput; 3584 + postProcessedOutputs: AiSentenceSimilarityOutput; 3585 + } 3586 + type AiAutomaticSpeechRecognitionInput = { 3587 + audio: number[]; 3588 + }; 3589 + type AiAutomaticSpeechRecognitionOutput = { 3590 + text?: string; 3591 + words?: { 3592 + word: string; 3593 + start: number; 3594 + end: number; 3595 + }[]; 3596 + vtt?: string; 3597 + }; 3598 + declare abstract class BaseAiAutomaticSpeechRecognition { 3599 + inputs: AiAutomaticSpeechRecognitionInput; 3600 + postProcessedOutputs: AiAutomaticSpeechRecognitionOutput; 3601 + } 3602 + type AiSummarizationInput = { 3603 + input_text: string; 3604 + max_length?: number; 3605 + }; 3606 + type AiSummarizationOutput = { 3607 + summary: string; 3608 + }; 3609 + declare abstract class BaseAiSummarization { 3610 + inputs: AiSummarizationInput; 3611 + postProcessedOutputs: AiSummarizationOutput; 3612 + } 3613 + type AiTextClassificationInput = { 3614 + text: string; 3615 + }; 3616 + type AiTextClassificationOutput = { 3617 + score?: number; 3618 + label?: string; 3619 + }[]; 3620 + declare abstract class BaseAiTextClassification { 3621 + inputs: AiTextClassificationInput; 3622 + postProcessedOutputs: AiTextClassificationOutput; 3623 + } 3624 + type AiTextEmbeddingsInput = { 3625 + text: string | string[]; 3626 + }; 3627 + type AiTextEmbeddingsOutput = { 3628 + shape: number[]; 3629 + data: number[][]; 3630 + }; 3631 + declare abstract class BaseAiTextEmbeddings { 3632 + inputs: AiTextEmbeddingsInput; 3633 + postProcessedOutputs: AiTextEmbeddingsOutput; 3634 + } 3635 + type RoleScopedChatInput = { 3636 + role: "user" | "assistant" | "system" | "tool" | (string & NonNullable<unknown>); 3637 + content: string; 3638 + name?: string; 3639 + }; 3640 + type AiTextGenerationToolLegacyInput = { 3641 + name: string; 3642 + description: string; 3643 + parameters?: { 3644 + type: "object" | (string & NonNullable<unknown>); 3645 + properties: { 3646 + [key: string]: { 3647 + type: string; 3648 + description?: string; 3649 + }; 3650 + }; 3651 + required: string[]; 3652 + }; 3653 + }; 3654 + type AiTextGenerationToolInput = { 3655 + type: "function" | (string & NonNullable<unknown>); 3656 + function: { 3657 + name: string; 3658 + description: string; 3659 + parameters?: { 3660 + type: "object" | (string & NonNullable<unknown>); 3661 + properties: { 3662 + [key: string]: { 3663 + type: string; 3664 + description?: string; 3665 + }; 3666 + }; 3667 + required: string[]; 3668 + }; 3669 + }; 3670 + }; 3671 + type AiTextGenerationFunctionsInput = { 3672 + name: string; 3673 + code: string; 3674 + }; 3675 + type AiTextGenerationResponseFormat = { 3676 + type: string; 3677 + json_schema?: any; 3678 + }; 3679 + type AiTextGenerationInput = { 3680 + prompt?: string; 3681 + raw?: boolean; 3682 + stream?: boolean; 3683 + max_tokens?: number; 3684 + temperature?: number; 3685 + top_p?: number; 3686 + top_k?: number; 3687 + seed?: number; 3688 + repetition_penalty?: number; 3689 + frequency_penalty?: number; 3690 + presence_penalty?: number; 3691 + messages?: RoleScopedChatInput[]; 3692 + response_format?: AiTextGenerationResponseFormat; 3693 + tools?: AiTextGenerationToolInput[] | AiTextGenerationToolLegacyInput[] | (object & NonNullable<unknown>); 3694 + functions?: AiTextGenerationFunctionsInput[]; 3695 + }; 3696 + type AiTextGenerationToolLegacyOutput = { 3697 + name: string; 3698 + arguments: unknown; 3699 + }; 3700 + type AiTextGenerationToolOutput = { 3701 + id: string; 3702 + type: "function"; 3703 + function: { 3704 + name: string; 3705 + arguments: string; 3706 + }; 3707 + }; 3708 + type UsageTags = { 3709 + prompt_tokens: number; 3710 + completion_tokens: number; 3711 + total_tokens: number; 3712 + }; 3713 + type AiTextGenerationOutput = { 3714 + response?: string; 3715 + tool_calls?: AiTextGenerationToolLegacyOutput[] & AiTextGenerationToolOutput[]; 3716 + usage?: UsageTags; 3717 + }; 3718 + declare abstract class BaseAiTextGeneration { 3719 + inputs: AiTextGenerationInput; 3720 + postProcessedOutputs: AiTextGenerationOutput; 3721 + } 3722 + type AiTextToSpeechInput = { 3723 + prompt: string; 3724 + lang?: string; 3725 + }; 3726 + type AiTextToSpeechOutput = Uint8Array | { 3727 + audio: string; 3728 + }; 3729 + declare abstract class BaseAiTextToSpeech { 3730 + inputs: AiTextToSpeechInput; 3731 + postProcessedOutputs: AiTextToSpeechOutput; 3732 + } 3733 + type AiTextToImageInput = { 3734 + prompt: string; 3735 + negative_prompt?: string; 3736 + height?: number; 3737 + width?: number; 3738 + image?: number[]; 3739 + image_b64?: string; 3740 + mask?: number[]; 3741 + num_steps?: number; 3742 + strength?: number; 3743 + guidance?: number; 3744 + seed?: number; 3745 + }; 3746 + type AiTextToImageOutput = ReadableStream<Uint8Array>; 3747 + declare abstract class BaseAiTextToImage { 3748 + inputs: AiTextToImageInput; 3749 + postProcessedOutputs: AiTextToImageOutput; 3750 + } 3751 + type AiTranslationInput = { 3752 + text: string; 3753 + target_lang: string; 3754 + source_lang?: string; 3755 + }; 3756 + type AiTranslationOutput = { 3757 + translated_text?: string; 3758 + }; 3759 + declare abstract class BaseAiTranslation { 3760 + inputs: AiTranslationInput; 3761 + postProcessedOutputs: AiTranslationOutput; 3762 + } 3763 + /** 3764 + * Workers AI support for OpenAI's Responses API 3765 + * Reference: https://github.com/openai/openai-node/blob/master/src/resources/responses/responses.ts 3766 + * 3767 + * It's a stripped down version from its source. 3768 + * It currently supports basic function calling, json mode and accepts images as input. 3769 + * 3770 + * It does not include types for WebSearch, CodeInterpreter, FileInputs, MCP, CustomTools. 3771 + * We plan to add those incrementally as model + platform capabilities evolve. 3772 + */ 3773 + type ResponsesInput = { 3774 + background?: boolean | null; 3775 + conversation?: string | ResponseConversationParam | null; 3776 + include?: Array<ResponseIncludable> | null; 3777 + input?: string | ResponseInput; 3778 + instructions?: string | null; 3779 + max_output_tokens?: number | null; 3780 + parallel_tool_calls?: boolean | null; 3781 + previous_response_id?: string | null; 3782 + prompt_cache_key?: string; 3783 + reasoning?: Reasoning | null; 3784 + safety_identifier?: string; 3785 + service_tier?: "auto" | "default" | "flex" | "scale" | "priority" | null; 3786 + stream?: boolean | null; 3787 + stream_options?: StreamOptions | null; 3788 + temperature?: number | null; 3789 + text?: ResponseTextConfig; 3790 + tool_choice?: ToolChoiceOptions | ToolChoiceFunction; 3791 + tools?: Array<Tool>; 3792 + top_p?: number | null; 3793 + truncation?: "auto" | "disabled" | null; 3794 + }; 3795 + type ResponsesOutput = { 3796 + id?: string; 3797 + created_at?: number; 3798 + output_text?: string; 3799 + error?: ResponseError | null; 3800 + incomplete_details?: ResponseIncompleteDetails | null; 3801 + instructions?: string | Array<ResponseInputItem> | null; 3802 + object?: "response"; 3803 + output?: Array<ResponseOutputItem>; 3804 + parallel_tool_calls?: boolean; 3805 + temperature?: number | null; 3806 + tool_choice?: ToolChoiceOptions | ToolChoiceFunction; 3807 + tools?: Array<Tool>; 3808 + top_p?: number | null; 3809 + max_output_tokens?: number | null; 3810 + previous_response_id?: string | null; 3811 + prompt?: ResponsePrompt | null; 3812 + reasoning?: Reasoning | null; 3813 + safety_identifier?: string; 3814 + service_tier?: "auto" | "default" | "flex" | "scale" | "priority" | null; 3815 + status?: ResponseStatus; 3816 + text?: ResponseTextConfig; 3817 + truncation?: "auto" | "disabled" | null; 3818 + usage?: ResponseUsage; 3819 + }; 3820 + type EasyInputMessage = { 3821 + content: string | ResponseInputMessageContentList; 3822 + role: "user" | "assistant" | "system" | "developer"; 3823 + type?: "message"; 3824 + }; 3825 + type ResponsesFunctionTool = { 3826 + name: string; 3827 + parameters: { 3828 + [key: string]: unknown; 3829 + } | null; 3830 + strict: boolean | null; 3831 + type: "function"; 3832 + description?: string | null; 3833 + }; 3834 + type ResponseIncompleteDetails = { 3835 + reason?: "max_output_tokens" | "content_filter"; 3836 + }; 3837 + type ResponsePrompt = { 3838 + id: string; 3839 + variables?: { 3840 + [key: string]: string | ResponseInputText | ResponseInputImage; 3841 + } | null; 3842 + version?: string | null; 3843 + }; 3844 + type Reasoning = { 3845 + effort?: ReasoningEffort | null; 3846 + generate_summary?: "auto" | "concise" | "detailed" | null; 3847 + summary?: "auto" | "concise" | "detailed" | null; 3848 + }; 3849 + type ResponseContent = ResponseInputText | ResponseInputImage | ResponseOutputText | ResponseOutputRefusal | ResponseContentReasoningText; 3850 + type ResponseContentReasoningText = { 3851 + text: string; 3852 + type: "reasoning_text"; 3853 + }; 3854 + type ResponseConversationParam = { 3855 + id: string; 3856 + }; 3857 + type ResponseCreatedEvent = { 3858 + response: Response; 3859 + sequence_number: number; 3860 + type: "response.created"; 3861 + }; 3862 + type ResponseCustomToolCallOutput = { 3863 + call_id: string; 3864 + output: string | Array<ResponseInputText | ResponseInputImage>; 3865 + type: "custom_tool_call_output"; 3866 + id?: string; 3867 + }; 3868 + type ResponseError = { 3869 + code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | "vector_store_timeout" | "invalid_image" | "invalid_image_format" | "invalid_base64_image" | "invalid_image_url" | "image_too_large" | "image_too_small" | "image_parse_error" | "image_content_policy_violation" | "invalid_image_mode" | "image_file_too_large" | "unsupported_image_media_type" | "empty_image_file" | "failed_to_download_image" | "image_file_not_found"; 3870 + message: string; 3871 + }; 3872 + type ResponseErrorEvent = { 3873 + code: string | null; 3874 + message: string; 3875 + param: string | null; 3876 + sequence_number: number; 3877 + type: "error"; 3878 + }; 3879 + type ResponseFailedEvent = { 3880 + response: Response; 3881 + sequence_number: number; 3882 + type: "response.failed"; 3883 + }; 3884 + type ResponseFormatText = { 3885 + type: "text"; 3886 + }; 3887 + type ResponseFormatJSONObject = { 3888 + type: "json_object"; 3889 + }; 3890 + type ResponseFormatTextConfig = ResponseFormatText | ResponseFormatTextJSONSchemaConfig | ResponseFormatJSONObject; 3891 + type ResponseFormatTextJSONSchemaConfig = { 3892 + name: string; 3893 + schema: { 3894 + [key: string]: unknown; 3895 + }; 3896 + type: "json_schema"; 3897 + description?: string; 3898 + strict?: boolean | null; 3899 + }; 3900 + type ResponseFunctionCallArgumentsDeltaEvent = { 3901 + delta: string; 3902 + item_id: string; 3903 + output_index: number; 3904 + sequence_number: number; 3905 + type: "response.function_call_arguments.delta"; 3906 + }; 3907 + type ResponseFunctionCallArgumentsDoneEvent = { 3908 + arguments: string; 3909 + item_id: string; 3910 + name: string; 3911 + output_index: number; 3912 + sequence_number: number; 3913 + type: "response.function_call_arguments.done"; 3914 + }; 3915 + type ResponseFunctionCallOutputItem = ResponseInputTextContent | ResponseInputImageContent; 3916 + type ResponseFunctionCallOutputItemList = Array<ResponseFunctionCallOutputItem>; 3917 + type ResponseFunctionToolCall = { 3918 + arguments: string; 3919 + call_id: string; 3920 + name: string; 3921 + type: "function_call"; 3922 + id?: string; 3923 + status?: "in_progress" | "completed" | "incomplete"; 3924 + }; 3925 + interface ResponseFunctionToolCallItem extends ResponseFunctionToolCall { 3926 + id: string; 3927 + } 3928 + type ResponseFunctionToolCallOutputItem = { 3929 + id: string; 3930 + call_id: string; 3931 + output: string | Array<ResponseInputText | ResponseInputImage>; 3932 + type: "function_call_output"; 3933 + status?: "in_progress" | "completed" | "incomplete"; 3934 + }; 3935 + type ResponseIncludable = "message.input_image.image_url" | "message.output_text.logprobs"; 3936 + type ResponseIncompleteEvent = { 3937 + response: Response; 3938 + sequence_number: number; 3939 + type: "response.incomplete"; 3940 + }; 3941 + type ResponseInput = Array<ResponseInputItem>; 3942 + type ResponseInputContent = ResponseInputText | ResponseInputImage; 3943 + type ResponseInputImage = { 3944 + detail: "low" | "high" | "auto"; 3945 + type: "input_image"; 3946 + /** 3947 + * Base64 encoded image 3948 + */ 3949 + image_url?: string | null; 3950 + }; 3951 + type ResponseInputImageContent = { 3952 + type: "input_image"; 3953 + detail?: "low" | "high" | "auto" | null; 3954 + /** 3955 + * Base64 encoded image 3956 + */ 3957 + image_url?: string | null; 3958 + }; 3959 + type ResponseInputItem = EasyInputMessage | ResponseInputItemMessage | ResponseOutputMessage | ResponseFunctionToolCall | ResponseInputItemFunctionCallOutput | ResponseReasoningItem; 3960 + type ResponseInputItemFunctionCallOutput = { 3961 + call_id: string; 3962 + output: string | ResponseFunctionCallOutputItemList; 3963 + type: "function_call_output"; 3964 + id?: string | null; 3965 + status?: "in_progress" | "completed" | "incomplete" | null; 3966 + }; 3967 + type ResponseInputItemMessage = { 3968 + content: ResponseInputMessageContentList; 3969 + role: "user" | "system" | "developer"; 3970 + status?: "in_progress" | "completed" | "incomplete"; 3971 + type?: "message"; 3972 + }; 3973 + type ResponseInputMessageContentList = Array<ResponseInputContent>; 3974 + type ResponseInputMessageItem = { 3975 + id: string; 3976 + content: ResponseInputMessageContentList; 3977 + role: "user" | "system" | "developer"; 3978 + status?: "in_progress" | "completed" | "incomplete"; 3979 + type?: "message"; 3980 + }; 3981 + type ResponseInputText = { 3982 + text: string; 3983 + type: "input_text"; 3984 + }; 3985 + type ResponseInputTextContent = { 3986 + text: string; 3987 + type: "input_text"; 3988 + }; 3989 + type ResponseItem = ResponseInputMessageItem | ResponseOutputMessage | ResponseFunctionToolCallItem | ResponseFunctionToolCallOutputItem; 3990 + type ResponseOutputItem = ResponseOutputMessage | ResponseFunctionToolCall | ResponseReasoningItem; 3991 + type ResponseOutputItemAddedEvent = { 3992 + item: ResponseOutputItem; 3993 + output_index: number; 3994 + sequence_number: number; 3995 + type: "response.output_item.added"; 3996 + }; 3997 + type ResponseOutputItemDoneEvent = { 3998 + item: ResponseOutputItem; 3999 + output_index: number; 4000 + sequence_number: number; 4001 + type: "response.output_item.done"; 4002 + }; 4003 + type ResponseOutputMessage = { 4004 + id: string; 4005 + content: Array<ResponseOutputText | ResponseOutputRefusal>; 4006 + role: "assistant"; 4007 + status: "in_progress" | "completed" | "incomplete"; 4008 + type: "message"; 4009 + }; 4010 + type ResponseOutputRefusal = { 4011 + refusal: string; 4012 + type: "refusal"; 4013 + }; 4014 + type ResponseOutputText = { 4015 + text: string; 4016 + type: "output_text"; 4017 + logprobs?: Array<Logprob>; 4018 + }; 4019 + type ResponseReasoningItem = { 4020 + id: string; 4021 + summary: Array<ResponseReasoningSummaryItem>; 4022 + type: "reasoning"; 4023 + content?: Array<ResponseReasoningContentItem>; 4024 + encrypted_content?: string | null; 4025 + status?: "in_progress" | "completed" | "incomplete"; 4026 + }; 4027 + type ResponseReasoningSummaryItem = { 4028 + text: string; 4029 + type: "summary_text"; 4030 + }; 4031 + type ResponseReasoningContentItem = { 4032 + text: string; 4033 + type: "reasoning_text"; 4034 + }; 4035 + type ResponseReasoningTextDeltaEvent = { 4036 + content_index: number; 4037 + delta: string; 4038 + item_id: string; 4039 + output_index: number; 4040 + sequence_number: number; 4041 + type: "response.reasoning_text.delta"; 4042 + }; 4043 + type ResponseReasoningTextDoneEvent = { 4044 + content_index: number; 4045 + item_id: string; 4046 + output_index: number; 4047 + sequence_number: number; 4048 + text: string; 4049 + type: "response.reasoning_text.done"; 4050 + }; 4051 + type ResponseRefusalDeltaEvent = { 4052 + content_index: number; 4053 + delta: string; 4054 + item_id: string; 4055 + output_index: number; 4056 + sequence_number: number; 4057 + type: "response.refusal.delta"; 4058 + }; 4059 + type ResponseRefusalDoneEvent = { 4060 + content_index: number; 4061 + item_id: string; 4062 + output_index: number; 4063 + refusal: string; 4064 + sequence_number: number; 4065 + type: "response.refusal.done"; 4066 + }; 4067 + type ResponseStatus = "completed" | "failed" | "in_progress" | "cancelled" | "queued" | "incomplete"; 4068 + type ResponseStreamEvent = ResponseCompletedEvent | ResponseCreatedEvent | ResponseErrorEvent | ResponseFunctionCallArgumentsDeltaEvent | ResponseFunctionCallArgumentsDoneEvent | ResponseFailedEvent | ResponseIncompleteEvent | ResponseOutputItemAddedEvent | ResponseOutputItemDoneEvent | ResponseReasoningTextDeltaEvent | ResponseReasoningTextDoneEvent | ResponseRefusalDeltaEvent | ResponseRefusalDoneEvent | ResponseTextDeltaEvent | ResponseTextDoneEvent; 4069 + type ResponseCompletedEvent = { 4070 + response: Response; 4071 + sequence_number: number; 4072 + type: "response.completed"; 4073 + }; 4074 + type ResponseTextConfig = { 4075 + format?: ResponseFormatTextConfig; 4076 + verbosity?: "low" | "medium" | "high" | null; 4077 + }; 4078 + type ResponseTextDeltaEvent = { 4079 + content_index: number; 4080 + delta: string; 4081 + item_id: string; 4082 + logprobs: Array<Logprob>; 4083 + output_index: number; 4084 + sequence_number: number; 4085 + type: "response.output_text.delta"; 4086 + }; 4087 + type ResponseTextDoneEvent = { 4088 + content_index: number; 4089 + item_id: string; 4090 + logprobs: Array<Logprob>; 4091 + output_index: number; 4092 + sequence_number: number; 4093 + text: string; 4094 + type: "response.output_text.done"; 4095 + }; 4096 + type Logprob = { 4097 + token: string; 4098 + logprob: number; 4099 + top_logprobs?: Array<TopLogprob>; 4100 + }; 4101 + type TopLogprob = { 4102 + token?: string; 4103 + logprob?: number; 4104 + }; 4105 + type ResponseUsage = { 4106 + input_tokens: number; 4107 + output_tokens: number; 4108 + total_tokens: number; 4109 + }; 4110 + type Tool = ResponsesFunctionTool; 4111 + type ToolChoiceFunction = { 4112 + name: string; 4113 + type: "function"; 4114 + }; 4115 + type ToolChoiceOptions = "none"; 4116 + type ReasoningEffort = "minimal" | "low" | "medium" | "high" | null; 4117 + type StreamOptions = { 4118 + include_obfuscation?: boolean; 4119 + }; 4120 + type Ai_Cf_Baai_Bge_Base_En_V1_5_Input = { 4121 + text: string | string[]; 4122 + /** 4123 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy. 4124 + */ 4125 + pooling?: "mean" | "cls"; 4126 + } | { 4127 + /** 4128 + * Batch of the embeddings requests to run using async-queue 4129 + */ 4130 + requests: { 4131 + text: string | string[]; 4132 + /** 4133 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy. 4134 + */ 4135 + pooling?: "mean" | "cls"; 4136 + }[]; 4137 + }; 4138 + type Ai_Cf_Baai_Bge_Base_En_V1_5_Output = { 4139 + shape?: number[]; 4140 + /** 4141 + * Embeddings of the requested text values 4142 + */ 4143 + data?: number[][]; 4144 + /** 4145 + * The pooling method used in the embedding process. 4146 + */ 4147 + pooling?: "mean" | "cls"; 4148 + } | Ai_Cf_Baai_Bge_Base_En_V1_5_AsyncResponse; 4149 + interface Ai_Cf_Baai_Bge_Base_En_V1_5_AsyncResponse { 4150 + /** 4151 + * The async request id that can be used to obtain the results. 4152 + */ 4153 + request_id?: string; 4154 + } 4155 + declare abstract class Base_Ai_Cf_Baai_Bge_Base_En_V1_5 { 4156 + inputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Input; 4157 + postProcessedOutputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Output; 4158 + } 4159 + type Ai_Cf_Openai_Whisper_Input = string | { 4160 + /** 4161 + * An array of integers that represent the audio data constrained to 8-bit unsigned integer values 4162 + */ 4163 + audio: number[]; 4164 + }; 4165 + interface Ai_Cf_Openai_Whisper_Output { 4166 + /** 4167 + * The transcription 4168 + */ 4169 + text: string; 4170 + word_count?: number; 4171 + words?: { 4172 + word?: string; 4173 + /** 4174 + * The second this word begins in the recording 4175 + */ 4176 + start?: number; 4177 + /** 4178 + * The ending second when the word completes 4179 + */ 4180 + end?: number; 4181 + }[]; 4182 + vtt?: string; 4183 + } 4184 + declare abstract class Base_Ai_Cf_Openai_Whisper { 4185 + inputs: Ai_Cf_Openai_Whisper_Input; 4186 + postProcessedOutputs: Ai_Cf_Openai_Whisper_Output; 4187 + } 4188 + type Ai_Cf_Meta_M2M100_1_2B_Input = { 4189 + /** 4190 + * The text to be translated 4191 + */ 4192 + text: string; 4193 + /** 4194 + * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified 4195 + */ 4196 + source_lang?: string; 4197 + /** 4198 + * The language code to translate the text into (e.g., 'es' for Spanish) 4199 + */ 4200 + target_lang: string; 4201 + } | { 4202 + /** 4203 + * Batch of the embeddings requests to run using async-queue 4204 + */ 4205 + requests: { 4206 + /** 4207 + * The text to be translated 4208 + */ 4209 + text: string; 4210 + /** 4211 + * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified 4212 + */ 4213 + source_lang?: string; 4214 + /** 4215 + * The language code to translate the text into (e.g., 'es' for Spanish) 4216 + */ 4217 + target_lang: string; 4218 + }[]; 4219 + }; 4220 + type Ai_Cf_Meta_M2M100_1_2B_Output = { 4221 + /** 4222 + * The translated text in the target language 4223 + */ 4224 + translated_text?: string; 4225 + } | Ai_Cf_Meta_M2M100_1_2B_AsyncResponse; 4226 + interface Ai_Cf_Meta_M2M100_1_2B_AsyncResponse { 4227 + /** 4228 + * The async request id that can be used to obtain the results. 4229 + */ 4230 + request_id?: string; 4231 + } 4232 + declare abstract class Base_Ai_Cf_Meta_M2M100_1_2B { 4233 + inputs: Ai_Cf_Meta_M2M100_1_2B_Input; 4234 + postProcessedOutputs: Ai_Cf_Meta_M2M100_1_2B_Output; 4235 + } 4236 + type Ai_Cf_Baai_Bge_Small_En_V1_5_Input = { 4237 + text: string | string[]; 4238 + /** 4239 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy. 4240 + */ 4241 + pooling?: "mean" | "cls"; 4242 + } | { 4243 + /** 4244 + * Batch of the embeddings requests to run using async-queue 4245 + */ 4246 + requests: { 4247 + text: string | string[]; 4248 + /** 4249 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy. 4250 + */ 4251 + pooling?: "mean" | "cls"; 4252 + }[]; 4253 + }; 4254 + type Ai_Cf_Baai_Bge_Small_En_V1_5_Output = { 4255 + shape?: number[]; 4256 + /** 4257 + * Embeddings of the requested text values 4258 + */ 4259 + data?: number[][]; 4260 + /** 4261 + * The pooling method used in the embedding process. 4262 + */ 4263 + pooling?: "mean" | "cls"; 4264 + } | Ai_Cf_Baai_Bge_Small_En_V1_5_AsyncResponse; 4265 + interface Ai_Cf_Baai_Bge_Small_En_V1_5_AsyncResponse { 4266 + /** 4267 + * The async request id that can be used to obtain the results. 4268 + */ 4269 + request_id?: string; 4270 + } 4271 + declare abstract class Base_Ai_Cf_Baai_Bge_Small_En_V1_5 { 4272 + inputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Input; 4273 + postProcessedOutputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Output; 4274 + } 4275 + type Ai_Cf_Baai_Bge_Large_En_V1_5_Input = { 4276 + text: string | string[]; 4277 + /** 4278 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy. 4279 + */ 4280 + pooling?: "mean" | "cls"; 4281 + } | { 4282 + /** 4283 + * Batch of the embeddings requests to run using async-queue 4284 + */ 4285 + requests: { 4286 + text: string | string[]; 4287 + /** 4288 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy. 4289 + */ 4290 + pooling?: "mean" | "cls"; 4291 + }[]; 4292 + }; 4293 + type Ai_Cf_Baai_Bge_Large_En_V1_5_Output = { 4294 + shape?: number[]; 4295 + /** 4296 + * Embeddings of the requested text values 4297 + */ 4298 + data?: number[][]; 4299 + /** 4300 + * The pooling method used in the embedding process. 4301 + */ 4302 + pooling?: "mean" | "cls"; 4303 + } | Ai_Cf_Baai_Bge_Large_En_V1_5_AsyncResponse; 4304 + interface Ai_Cf_Baai_Bge_Large_En_V1_5_AsyncResponse { 4305 + /** 4306 + * The async request id that can be used to obtain the results. 4307 + */ 4308 + request_id?: string; 4309 + } 4310 + declare abstract class Base_Ai_Cf_Baai_Bge_Large_En_V1_5 { 4311 + inputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Input; 4312 + postProcessedOutputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Output; 4313 + } 4314 + type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input = string | { 4315 + /** 4316 + * The input text prompt for the model to generate a response. 4317 + */ 4318 + prompt?: string; 4319 + /** 4320 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 4321 + */ 4322 + raw?: boolean; 4323 + /** 4324 + * Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 4325 + */ 4326 + top_p?: number; 4327 + /** 4328 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 4329 + */ 4330 + top_k?: number; 4331 + /** 4332 + * Random seed for reproducibility of the generation. 4333 + */ 4334 + seed?: number; 4335 + /** 4336 + * Penalty for repeated tokens; higher values discourage repetition. 4337 + */ 4338 + repetition_penalty?: number; 4339 + /** 4340 + * Decreases the likelihood of the model repeating the same lines verbatim. 4341 + */ 4342 + frequency_penalty?: number; 4343 + /** 4344 + * Increases the likelihood of the model introducing new topics. 4345 + */ 4346 + presence_penalty?: number; 4347 + image: number[] | (string & NonNullable<unknown>); 4348 + /** 4349 + * The maximum number of tokens to generate in the response. 4350 + */ 4351 + max_tokens?: number; 4352 + }; 4353 + interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output { 4354 + description?: string; 4355 + } 4356 + declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M { 4357 + inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input; 4358 + postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output; 4359 + } 4360 + type Ai_Cf_Openai_Whisper_Tiny_En_Input = string | { 4361 + /** 4362 + * An array of integers that represent the audio data constrained to 8-bit unsigned integer values 4363 + */ 4364 + audio: number[]; 4365 + }; 4366 + interface Ai_Cf_Openai_Whisper_Tiny_En_Output { 4367 + /** 4368 + * The transcription 4369 + */ 4370 + text: string; 4371 + word_count?: number; 4372 + words?: { 4373 + word?: string; 4374 + /** 4375 + * The second this word begins in the recording 4376 + */ 4377 + start?: number; 4378 + /** 4379 + * The ending second when the word completes 4380 + */ 4381 + end?: number; 4382 + }[]; 4383 + vtt?: string; 4384 + } 4385 + declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En { 4386 + inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input; 4387 + postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output; 4388 + } 4389 + interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input { 4390 + /** 4391 + * Base64 encoded value of the audio data. 4392 + */ 4393 + audio: string; 4394 + /** 4395 + * Supported tasks are 'translate' or 'transcribe'. 4396 + */ 4397 + task?: string; 4398 + /** 4399 + * The language of the audio being transcribed or translated. 4400 + */ 4401 + language?: string; 4402 + /** 4403 + * Preprocess the audio with a voice activity detection model. 4404 + */ 4405 + vad_filter?: boolean; 4406 + /** 4407 + * A text prompt to help provide context to the model on the contents of the audio. 4408 + */ 4409 + initial_prompt?: string; 4410 + /** 4411 + * The prefix it appended the the beginning of the output of the transcription and can guide the transcription result. 4412 + */ 4413 + prefix?: string; 4414 + } 4415 + interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output { 4416 + transcription_info?: { 4417 + /** 4418 + * The language of the audio being transcribed or translated. 4419 + */ 4420 + language?: string; 4421 + /** 4422 + * The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1. 4423 + */ 4424 + language_probability?: number; 4425 + /** 4426 + * The total duration of the original audio file, in seconds. 4427 + */ 4428 + duration?: number; 4429 + /** 4430 + * The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds. 4431 + */ 4432 + duration_after_vad?: number; 4433 + }; 4434 + /** 4435 + * The complete transcription of the audio. 4436 + */ 4437 + text: string; 4438 + /** 4439 + * The total number of words in the transcription. 4440 + */ 4441 + word_count?: number; 4442 + segments?: { 4443 + /** 4444 + * The starting time of the segment within the audio, in seconds. 4445 + */ 4446 + start?: number; 4447 + /** 4448 + * The ending time of the segment within the audio, in seconds. 4449 + */ 4450 + end?: number; 4451 + /** 4452 + * The transcription of the segment. 4453 + */ 4454 + text?: string; 4455 + /** 4456 + * The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs. 4457 + */ 4458 + temperature?: number; 4459 + /** 4460 + * The average log probability of the predictions for the words in this segment, indicating overall confidence. 4461 + */ 4462 + avg_logprob?: number; 4463 + /** 4464 + * The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process. 4465 + */ 4466 + compression_ratio?: number; 4467 + /** 4468 + * The probability that the segment contains no speech, represented as a decimal between 0 and 1. 4469 + */ 4470 + no_speech_prob?: number; 4471 + words?: { 4472 + /** 4473 + * The individual word transcribed from the audio. 4474 + */ 4475 + word?: string; 4476 + /** 4477 + * The starting time of the word within the audio, in seconds. 4478 + */ 4479 + start?: number; 4480 + /** 4481 + * The ending time of the word within the audio, in seconds. 4482 + */ 4483 + end?: number; 4484 + }[]; 4485 + }[]; 4486 + /** 4487 + * The transcription in WebVTT format, which includes timing and text information for use in subtitles. 4488 + */ 4489 + vtt?: string; 4490 + } 4491 + declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo { 4492 + inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input; 4493 + postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output; 4494 + } 4495 + type Ai_Cf_Baai_Bge_M3_Input = Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts | Ai_Cf_Baai_Bge_M3_Input_Embedding | { 4496 + /** 4497 + * Batch of the embeddings requests to run using async-queue 4498 + */ 4499 + requests: (Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts_1 | Ai_Cf_Baai_Bge_M3_Input_Embedding_1)[]; 4500 + }; 4501 + interface Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts { 4502 + /** 4503 + * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts 4504 + */ 4505 + query?: string; 4506 + /** 4507 + * List of provided contexts. Note that the index in this array is important, as the response will refer to it. 4508 + */ 4509 + contexts: { 4510 + /** 4511 + * One of the provided context content 4512 + */ 4513 + text?: string; 4514 + }[]; 4515 + /** 4516 + * When provided with too long context should the model error out or truncate the context to fit? 4517 + */ 4518 + truncate_inputs?: boolean; 4519 + } 4520 + interface Ai_Cf_Baai_Bge_M3_Input_Embedding { 4521 + text: string | string[]; 4522 + /** 4523 + * When provided with too long context should the model error out or truncate the context to fit? 4524 + */ 4525 + truncate_inputs?: boolean; 4526 + } 4527 + interface Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts_1 { 4528 + /** 4529 + * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts 4530 + */ 4531 + query?: string; 4532 + /** 4533 + * List of provided contexts. Note that the index in this array is important, as the response will refer to it. 4534 + */ 4535 + contexts: { 4536 + /** 4537 + * One of the provided context content 4538 + */ 4539 + text?: string; 4540 + }[]; 4541 + /** 4542 + * When provided with too long context should the model error out or truncate the context to fit? 4543 + */ 4544 + truncate_inputs?: boolean; 4545 + } 4546 + interface Ai_Cf_Baai_Bge_M3_Input_Embedding_1 { 4547 + text: string | string[]; 4548 + /** 4549 + * When provided with too long context should the model error out or truncate the context to fit? 4550 + */ 4551 + truncate_inputs?: boolean; 4552 + } 4553 + type Ai_Cf_Baai_Bge_M3_Output = Ai_Cf_Baai_Bge_M3_Ouput_Query | Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts | Ai_Cf_Baai_Bge_M3_Ouput_Embedding | Ai_Cf_Baai_Bge_M3_AsyncResponse; 4554 + interface Ai_Cf_Baai_Bge_M3_Ouput_Query { 4555 + response?: { 4556 + /** 4557 + * Index of the context in the request 4558 + */ 4559 + id?: number; 4560 + /** 4561 + * Score of the context under the index. 4562 + */ 4563 + score?: number; 4564 + }[]; 4565 + } 4566 + interface Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts { 4567 + response?: number[][]; 4568 + shape?: number[]; 4569 + /** 4570 + * The pooling method used in the embedding process. 4571 + */ 4572 + pooling?: "mean" | "cls"; 4573 + } 4574 + interface Ai_Cf_Baai_Bge_M3_Ouput_Embedding { 4575 + shape?: number[]; 4576 + /** 4577 + * Embeddings of the requested text values 4578 + */ 4579 + data?: number[][]; 4580 + /** 4581 + * The pooling method used in the embedding process. 4582 + */ 4583 + pooling?: "mean" | "cls"; 4584 + } 4585 + interface Ai_Cf_Baai_Bge_M3_AsyncResponse { 4586 + /** 4587 + * The async request id that can be used to obtain the results. 4588 + */ 4589 + request_id?: string; 4590 + } 4591 + declare abstract class Base_Ai_Cf_Baai_Bge_M3 { 4592 + inputs: Ai_Cf_Baai_Bge_M3_Input; 4593 + postProcessedOutputs: Ai_Cf_Baai_Bge_M3_Output; 4594 + } 4595 + interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input { 4596 + /** 4597 + * A text description of the image you want to generate. 4598 + */ 4599 + prompt: string; 4600 + /** 4601 + * The number of diffusion steps; higher values can improve quality but take longer. 4602 + */ 4603 + steps?: number; 4604 + } 4605 + interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output { 4606 + /** 4607 + * The generated image in Base64 format. 4608 + */ 4609 + image?: string; 4610 + } 4611 + declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell { 4612 + inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input; 4613 + postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output; 4614 + } 4615 + type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Prompt | Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages; 4616 + interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Prompt { 4617 + /** 4618 + * The input text prompt for the model to generate a response. 4619 + */ 4620 + prompt: string; 4621 + image?: number[] | (string & NonNullable<unknown>); 4622 + /** 4623 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 4624 + */ 4625 + raw?: boolean; 4626 + /** 4627 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 4628 + */ 4629 + stream?: boolean; 4630 + /** 4631 + * The maximum number of tokens to generate in the response. 4632 + */ 4633 + max_tokens?: number; 4634 + /** 4635 + * Controls the randomness of the output; higher values produce more random results. 4636 + */ 4637 + temperature?: number; 4638 + /** 4639 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 4640 + */ 4641 + top_p?: number; 4642 + /** 4643 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 4644 + */ 4645 + top_k?: number; 4646 + /** 4647 + * Random seed for reproducibility of the generation. 4648 + */ 4649 + seed?: number; 4650 + /** 4651 + * Penalty for repeated tokens; higher values discourage repetition. 4652 + */ 4653 + repetition_penalty?: number; 4654 + /** 4655 + * Decreases the likelihood of the model repeating the same lines verbatim. 4656 + */ 4657 + frequency_penalty?: number; 4658 + /** 4659 + * Increases the likelihood of the model introducing new topics. 4660 + */ 4661 + presence_penalty?: number; 4662 + /** 4663 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 4664 + */ 4665 + lora?: string; 4666 + } 4667 + interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages { 4668 + /** 4669 + * An array of message objects representing the conversation history. 4670 + */ 4671 + messages: { 4672 + /** 4673 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 4674 + */ 4675 + role?: string; 4676 + /** 4677 + * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001 4678 + */ 4679 + tool_call_id?: string; 4680 + content?: string | { 4681 + /** 4682 + * Type of the content provided 4683 + */ 4684 + type?: string; 4685 + text?: string; 4686 + image_url?: { 4687 + /** 4688 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 4689 + */ 4690 + url?: string; 4691 + }; 4692 + }[] | { 4693 + /** 4694 + * Type of the content provided 4695 + */ 4696 + type?: string; 4697 + text?: string; 4698 + image_url?: { 4699 + /** 4700 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 4701 + */ 4702 + url?: string; 4703 + }; 4704 + }; 4705 + }[]; 4706 + image?: number[] | (string & NonNullable<unknown>); 4707 + functions?: { 4708 + name: string; 4709 + code: string; 4710 + }[]; 4711 + /** 4712 + * A list of tools available for the assistant to use. 4713 + */ 4714 + tools?: ({ 4715 + /** 4716 + * The name of the tool. More descriptive the better. 4717 + */ 4718 + name: string; 4719 + /** 4720 + * A brief description of what the tool does. 4721 + */ 4722 + description: string; 4723 + /** 4724 + * Schema defining the parameters accepted by the tool. 4725 + */ 4726 + parameters: { 4727 + /** 4728 + * The type of the parameters object (usually 'object'). 4729 + */ 4730 + type: string; 4731 + /** 4732 + * List of required parameter names. 4733 + */ 4734 + required?: string[]; 4735 + /** 4736 + * Definitions of each parameter. 4737 + */ 4738 + properties: { 4739 + [k: string]: { 4740 + /** 4741 + * The data type of the parameter. 4742 + */ 4743 + type: string; 4744 + /** 4745 + * A description of the expected parameter. 4746 + */ 4747 + description: string; 4748 + }; 4749 + }; 4750 + }; 4751 + } | { 4752 + /** 4753 + * Specifies the type of tool (e.g., 'function'). 4754 + */ 4755 + type: string; 4756 + /** 4757 + * Details of the function tool. 4758 + */ 4759 + function: { 4760 + /** 4761 + * The name of the function. 4762 + */ 4763 + name: string; 4764 + /** 4765 + * A brief description of what the function does. 4766 + */ 4767 + description: string; 4768 + /** 4769 + * Schema defining the parameters accepted by the function. 4770 + */ 4771 + parameters: { 4772 + /** 4773 + * The type of the parameters object (usually 'object'). 4774 + */ 4775 + type: string; 4776 + /** 4777 + * List of required parameter names. 4778 + */ 4779 + required?: string[]; 4780 + /** 4781 + * Definitions of each parameter. 4782 + */ 4783 + properties: { 4784 + [k: string]: { 4785 + /** 4786 + * The data type of the parameter. 4787 + */ 4788 + type: string; 4789 + /** 4790 + * A description of the expected parameter. 4791 + */ 4792 + description: string; 4793 + }; 4794 + }; 4795 + }; 4796 + }; 4797 + })[]; 4798 + /** 4799 + * If true, the response will be streamed back incrementally. 4800 + */ 4801 + stream?: boolean; 4802 + /** 4803 + * The maximum number of tokens to generate in the response. 4804 + */ 4805 + max_tokens?: number; 4806 + /** 4807 + * Controls the randomness of the output; higher values produce more random results. 4808 + */ 4809 + temperature?: number; 4810 + /** 4811 + * Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 4812 + */ 4813 + top_p?: number; 4814 + /** 4815 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 4816 + */ 4817 + top_k?: number; 4818 + /** 4819 + * Random seed for reproducibility of the generation. 4820 + */ 4821 + seed?: number; 4822 + /** 4823 + * Penalty for repeated tokens; higher values discourage repetition. 4824 + */ 4825 + repetition_penalty?: number; 4826 + /** 4827 + * Decreases the likelihood of the model repeating the same lines verbatim. 4828 + */ 4829 + frequency_penalty?: number; 4830 + /** 4831 + * Increases the likelihood of the model introducing new topics. 4832 + */ 4833 + presence_penalty?: number; 4834 + } 4835 + type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output = { 4836 + /** 4837 + * The generated text response from the model 4838 + */ 4839 + response?: string; 4840 + /** 4841 + * An array of tool calls requests made during the response generation 4842 + */ 4843 + tool_calls?: { 4844 + /** 4845 + * The arguments passed to be passed to the tool call request 4846 + */ 4847 + arguments?: object; 4848 + /** 4849 + * The name of the tool to be called 4850 + */ 4851 + name?: string; 4852 + }[]; 4853 + }; 4854 + declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct { 4855 + inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input; 4856 + postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output; 4857 + } 4858 + type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input = Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Async_Batch; 4859 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt { 4860 + /** 4861 + * The input text prompt for the model to generate a response. 4862 + */ 4863 + prompt: string; 4864 + /** 4865 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 4866 + */ 4867 + lora?: string; 4868 + response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode; 4869 + /** 4870 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 4871 + */ 4872 + raw?: boolean; 4873 + /** 4874 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 4875 + */ 4876 + stream?: boolean; 4877 + /** 4878 + * The maximum number of tokens to generate in the response. 4879 + */ 4880 + max_tokens?: number; 4881 + /** 4882 + * Controls the randomness of the output; higher values produce more random results. 4883 + */ 4884 + temperature?: number; 4885 + /** 4886 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 4887 + */ 4888 + top_p?: number; 4889 + /** 4890 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 4891 + */ 4892 + top_k?: number; 4893 + /** 4894 + * Random seed for reproducibility of the generation. 4895 + */ 4896 + seed?: number; 4897 + /** 4898 + * Penalty for repeated tokens; higher values discourage repetition. 4899 + */ 4900 + repetition_penalty?: number; 4901 + /** 4902 + * Decreases the likelihood of the model repeating the same lines verbatim. 4903 + */ 4904 + frequency_penalty?: number; 4905 + /** 4906 + * Increases the likelihood of the model introducing new topics. 4907 + */ 4908 + presence_penalty?: number; 4909 + } 4910 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode { 4911 + type?: "json_object" | "json_schema"; 4912 + json_schema?: unknown; 4913 + } 4914 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages { 4915 + /** 4916 + * An array of message objects representing the conversation history. 4917 + */ 4918 + messages: { 4919 + /** 4920 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 4921 + */ 4922 + role: string; 4923 + /** 4924 + * The content of the message as a string. 4925 + */ 4926 + content: string; 4927 + }[]; 4928 + functions?: { 4929 + name: string; 4930 + code: string; 4931 + }[]; 4932 + /** 4933 + * A list of tools available for the assistant to use. 4934 + */ 4935 + tools?: ({ 4936 + /** 4937 + * The name of the tool. More descriptive the better. 4938 + */ 4939 + name: string; 4940 + /** 4941 + * A brief description of what the tool does. 4942 + */ 4943 + description: string; 4944 + /** 4945 + * Schema defining the parameters accepted by the tool. 4946 + */ 4947 + parameters: { 4948 + /** 4949 + * The type of the parameters object (usually 'object'). 4950 + */ 4951 + type: string; 4952 + /** 4953 + * List of required parameter names. 4954 + */ 4955 + required?: string[]; 4956 + /** 4957 + * Definitions of each parameter. 4958 + */ 4959 + properties: { 4960 + [k: string]: { 4961 + /** 4962 + * The data type of the parameter. 4963 + */ 4964 + type: string; 4965 + /** 4966 + * A description of the expected parameter. 4967 + */ 4968 + description: string; 4969 + }; 4970 + }; 4971 + }; 4972 + } | { 4973 + /** 4974 + * Specifies the type of tool (e.g., 'function'). 4975 + */ 4976 + type: string; 4977 + /** 4978 + * Details of the function tool. 4979 + */ 4980 + function: { 4981 + /** 4982 + * The name of the function. 4983 + */ 4984 + name: string; 4985 + /** 4986 + * A brief description of what the function does. 4987 + */ 4988 + description: string; 4989 + /** 4990 + * Schema defining the parameters accepted by the function. 4991 + */ 4992 + parameters: { 4993 + /** 4994 + * The type of the parameters object (usually 'object'). 4995 + */ 4996 + type: string; 4997 + /** 4998 + * List of required parameter names. 4999 + */ 5000 + required?: string[]; 5001 + /** 5002 + * Definitions of each parameter. 5003 + */ 5004 + properties: { 5005 + [k: string]: { 5006 + /** 5007 + * The data type of the parameter. 5008 + */ 5009 + type: string; 5010 + /** 5011 + * A description of the expected parameter. 5012 + */ 5013 + description: string; 5014 + }; 5015 + }; 5016 + }; 5017 + }; 5018 + })[]; 5019 + response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_1; 5020 + /** 5021 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5022 + */ 5023 + raw?: boolean; 5024 + /** 5025 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5026 + */ 5027 + stream?: boolean; 5028 + /** 5029 + * The maximum number of tokens to generate in the response. 5030 + */ 5031 + max_tokens?: number; 5032 + /** 5033 + * Controls the randomness of the output; higher values produce more random results. 5034 + */ 5035 + temperature?: number; 5036 + /** 5037 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 5038 + */ 5039 + top_p?: number; 5040 + /** 5041 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 5042 + */ 5043 + top_k?: number; 5044 + /** 5045 + * Random seed for reproducibility of the generation. 5046 + */ 5047 + seed?: number; 5048 + /** 5049 + * Penalty for repeated tokens; higher values discourage repetition. 5050 + */ 5051 + repetition_penalty?: number; 5052 + /** 5053 + * Decreases the likelihood of the model repeating the same lines verbatim. 5054 + */ 5055 + frequency_penalty?: number; 5056 + /** 5057 + * Increases the likelihood of the model introducing new topics. 5058 + */ 5059 + presence_penalty?: number; 5060 + } 5061 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_1 { 5062 + type?: "json_object" | "json_schema"; 5063 + json_schema?: unknown; 5064 + } 5065 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Async_Batch { 5066 + requests?: { 5067 + /** 5068 + * User-supplied reference. This field will be present in the response as well it can be used to reference the request and response. It's NOT validated to be unique. 5069 + */ 5070 + external_reference?: string; 5071 + /** 5072 + * Prompt for the text generation model 5073 + */ 5074 + prompt?: string; 5075 + /** 5076 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5077 + */ 5078 + stream?: boolean; 5079 + /** 5080 + * The maximum number of tokens to generate in the response. 5081 + */ 5082 + max_tokens?: number; 5083 + /** 5084 + * Controls the randomness of the output; higher values produce more random results. 5085 + */ 5086 + temperature?: number; 5087 + /** 5088 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 5089 + */ 5090 + top_p?: number; 5091 + /** 5092 + * Random seed for reproducibility of the generation. 5093 + */ 5094 + seed?: number; 5095 + /** 5096 + * Penalty for repeated tokens; higher values discourage repetition. 5097 + */ 5098 + repetition_penalty?: number; 5099 + /** 5100 + * Decreases the likelihood of the model repeating the same lines verbatim. 5101 + */ 5102 + frequency_penalty?: number; 5103 + /** 5104 + * Increases the likelihood of the model introducing new topics. 5105 + */ 5106 + presence_penalty?: number; 5107 + response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_2; 5108 + }[]; 5109 + } 5110 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_2 { 5111 + type?: "json_object" | "json_schema"; 5112 + json_schema?: unknown; 5113 + } 5114 + type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output = { 5115 + /** 5116 + * The generated text response from the model 5117 + */ 5118 + response: string; 5119 + /** 5120 + * Usage statistics for the inference request 5121 + */ 5122 + usage?: { 5123 + /** 5124 + * Total number of tokens in input 5125 + */ 5126 + prompt_tokens?: number; 5127 + /** 5128 + * Total number of tokens in output 5129 + */ 5130 + completion_tokens?: number; 5131 + /** 5132 + * Total number of input and output tokens 5133 + */ 5134 + total_tokens?: number; 5135 + }; 5136 + /** 5137 + * An array of tool calls requests made during the response generation 5138 + */ 5139 + tool_calls?: { 5140 + /** 5141 + * The arguments passed to be passed to the tool call request 5142 + */ 5143 + arguments?: object; 5144 + /** 5145 + * The name of the tool to be called 5146 + */ 5147 + name?: string; 5148 + }[]; 5149 + } | string | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_AsyncResponse; 5150 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_AsyncResponse { 5151 + /** 5152 + * The async request id that can be used to obtain the results. 5153 + */ 5154 + request_id?: string; 5155 + } 5156 + declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast { 5157 + inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input; 5158 + postProcessedOutputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output; 5159 + } 5160 + interface Ai_Cf_Meta_Llama_Guard_3_8B_Input { 5161 + /** 5162 + * An array of message objects representing the conversation history. 5163 + */ 5164 + messages: { 5165 + /** 5166 + * The role of the message sender must alternate between 'user' and 'assistant'. 5167 + */ 5168 + role: "user" | "assistant"; 5169 + /** 5170 + * The content of the message as a string. 5171 + */ 5172 + content: string; 5173 + }[]; 5174 + /** 5175 + * The maximum number of tokens to generate in the response. 5176 + */ 5177 + max_tokens?: number; 5178 + /** 5179 + * Controls the randomness of the output; higher values produce more random results. 5180 + */ 5181 + temperature?: number; 5182 + /** 5183 + * Dictate the output format of the generated response. 5184 + */ 5185 + response_format?: { 5186 + /** 5187 + * Set to json_object to process and output generated text as JSON. 5188 + */ 5189 + type?: string; 5190 + }; 5191 + } 5192 + interface Ai_Cf_Meta_Llama_Guard_3_8B_Output { 5193 + response?: string | { 5194 + /** 5195 + * Whether the conversation is safe or not. 5196 + */ 5197 + safe?: boolean; 5198 + /** 5199 + * A list of what hazard categories predicted for the conversation, if the conversation is deemed unsafe. 5200 + */ 5201 + categories?: string[]; 5202 + }; 5203 + /** 5204 + * Usage statistics for the inference request 5205 + */ 5206 + usage?: { 5207 + /** 5208 + * Total number of tokens in input 5209 + */ 5210 + prompt_tokens?: number; 5211 + /** 5212 + * Total number of tokens in output 5213 + */ 5214 + completion_tokens?: number; 5215 + /** 5216 + * Total number of input and output tokens 5217 + */ 5218 + total_tokens?: number; 5219 + }; 5220 + } 5221 + declare abstract class Base_Ai_Cf_Meta_Llama_Guard_3_8B { 5222 + inputs: Ai_Cf_Meta_Llama_Guard_3_8B_Input; 5223 + postProcessedOutputs: Ai_Cf_Meta_Llama_Guard_3_8B_Output; 5224 + } 5225 + interface Ai_Cf_Baai_Bge_Reranker_Base_Input { 5226 + /** 5227 + * A query you wish to perform against the provided contexts. 5228 + */ 5229 + /** 5230 + * Number of returned results starting with the best score. 5231 + */ 5232 + top_k?: number; 5233 + /** 5234 + * List of provided contexts. Note that the index in this array is important, as the response will refer to it. 5235 + */ 5236 + contexts: { 5237 + /** 5238 + * One of the provided context content 5239 + */ 5240 + text?: string; 5241 + }[]; 5242 + } 5243 + interface Ai_Cf_Baai_Bge_Reranker_Base_Output { 5244 + response?: { 5245 + /** 5246 + * Index of the context in the request 5247 + */ 5248 + id?: number; 5249 + /** 5250 + * Score of the context under the index. 5251 + */ 5252 + score?: number; 5253 + }[]; 5254 + } 5255 + declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base { 5256 + inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input; 5257 + postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output; 5258 + } 5259 + type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input = Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Prompt | Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Messages; 5260 + interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Prompt { 5261 + /** 5262 + * The input text prompt for the model to generate a response. 5263 + */ 5264 + prompt: string; 5265 + /** 5266 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 5267 + */ 5268 + lora?: string; 5269 + response_format?: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode; 5270 + /** 5271 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5272 + */ 5273 + raw?: boolean; 5274 + /** 5275 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5276 + */ 5277 + stream?: boolean; 5278 + /** 5279 + * The maximum number of tokens to generate in the response. 5280 + */ 5281 + max_tokens?: number; 5282 + /** 5283 + * Controls the randomness of the output; higher values produce more random results. 5284 + */ 5285 + temperature?: number; 5286 + /** 5287 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 5288 + */ 5289 + top_p?: number; 5290 + /** 5291 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 5292 + */ 5293 + top_k?: number; 5294 + /** 5295 + * Random seed for reproducibility of the generation. 5296 + */ 5297 + seed?: number; 5298 + /** 5299 + * Penalty for repeated tokens; higher values discourage repetition. 5300 + */ 5301 + repetition_penalty?: number; 5302 + /** 5303 + * Decreases the likelihood of the model repeating the same lines verbatim. 5304 + */ 5305 + frequency_penalty?: number; 5306 + /** 5307 + * Increases the likelihood of the model introducing new topics. 5308 + */ 5309 + presence_penalty?: number; 5310 + } 5311 + interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode { 5312 + type?: "json_object" | "json_schema"; 5313 + json_schema?: unknown; 5314 + } 5315 + interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Messages { 5316 + /** 5317 + * An array of message objects representing the conversation history. 5318 + */ 5319 + messages: { 5320 + /** 5321 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 5322 + */ 5323 + role: string; 5324 + /** 5325 + * The content of the message as a string. 5326 + */ 5327 + content: string; 5328 + }[]; 5329 + functions?: { 5330 + name: string; 5331 + code: string; 5332 + }[]; 5333 + /** 5334 + * A list of tools available for the assistant to use. 5335 + */ 5336 + tools?: ({ 5337 + /** 5338 + * The name of the tool. More descriptive the better. 5339 + */ 5340 + name: string; 5341 + /** 5342 + * A brief description of what the tool does. 5343 + */ 5344 + description: string; 5345 + /** 5346 + * Schema defining the parameters accepted by the tool. 5347 + */ 5348 + parameters: { 5349 + /** 5350 + * The type of the parameters object (usually 'object'). 5351 + */ 5352 + type: string; 5353 + /** 5354 + * List of required parameter names. 5355 + */ 5356 + required?: string[]; 5357 + /** 5358 + * Definitions of each parameter. 5359 + */ 5360 + properties: { 5361 + [k: string]: { 5362 + /** 5363 + * The data type of the parameter. 5364 + */ 5365 + type: string; 5366 + /** 5367 + * A description of the expected parameter. 5368 + */ 5369 + description: string; 5370 + }; 5371 + }; 5372 + }; 5373 + } | { 5374 + /** 5375 + * Specifies the type of tool (e.g., 'function'). 5376 + */ 5377 + type: string; 5378 + /** 5379 + * Details of the function tool. 5380 + */ 5381 + function: { 5382 + /** 5383 + * The name of the function. 5384 + */ 5385 + name: string; 5386 + /** 5387 + * A brief description of what the function does. 5388 + */ 5389 + description: string; 5390 + /** 5391 + * Schema defining the parameters accepted by the function. 5392 + */ 5393 + parameters: { 5394 + /** 5395 + * The type of the parameters object (usually 'object'). 5396 + */ 5397 + type: string; 5398 + /** 5399 + * List of required parameter names. 5400 + */ 5401 + required?: string[]; 5402 + /** 5403 + * Definitions of each parameter. 5404 + */ 5405 + properties: { 5406 + [k: string]: { 5407 + /** 5408 + * The data type of the parameter. 5409 + */ 5410 + type: string; 5411 + /** 5412 + * A description of the expected parameter. 5413 + */ 5414 + description: string; 5415 + }; 5416 + }; 5417 + }; 5418 + }; 5419 + })[]; 5420 + response_format?: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode_1; 5421 + /** 5422 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5423 + */ 5424 + raw?: boolean; 5425 + /** 5426 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5427 + */ 5428 + stream?: boolean; 5429 + /** 5430 + * The maximum number of tokens to generate in the response. 5431 + */ 5432 + max_tokens?: number; 5433 + /** 5434 + * Controls the randomness of the output; higher values produce more random results. 5435 + */ 5436 + temperature?: number; 5437 + /** 5438 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 5439 + */ 5440 + top_p?: number; 5441 + /** 5442 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 5443 + */ 5444 + top_k?: number; 5445 + /** 5446 + * Random seed for reproducibility of the generation. 5447 + */ 5448 + seed?: number; 5449 + /** 5450 + * Penalty for repeated tokens; higher values discourage repetition. 5451 + */ 5452 + repetition_penalty?: number; 5453 + /** 5454 + * Decreases the likelihood of the model repeating the same lines verbatim. 5455 + */ 5456 + frequency_penalty?: number; 5457 + /** 5458 + * Increases the likelihood of the model introducing new topics. 5459 + */ 5460 + presence_penalty?: number; 5461 + } 5462 + interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode_1 { 5463 + type?: "json_object" | "json_schema"; 5464 + json_schema?: unknown; 5465 + } 5466 + type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output = { 5467 + /** 5468 + * The generated text response from the model 5469 + */ 5470 + response: string; 5471 + /** 5472 + * Usage statistics for the inference request 5473 + */ 5474 + usage?: { 5475 + /** 5476 + * Total number of tokens in input 5477 + */ 5478 + prompt_tokens?: number; 5479 + /** 5480 + * Total number of tokens in output 5481 + */ 5482 + completion_tokens?: number; 5483 + /** 5484 + * Total number of input and output tokens 5485 + */ 5486 + total_tokens?: number; 5487 + }; 5488 + /** 5489 + * An array of tool calls requests made during the response generation 5490 + */ 5491 + tool_calls?: { 5492 + /** 5493 + * The arguments passed to be passed to the tool call request 5494 + */ 5495 + arguments?: object; 5496 + /** 5497 + * The name of the tool to be called 5498 + */ 5499 + name?: string; 5500 + }[]; 5501 + }; 5502 + declare abstract class Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct { 5503 + inputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input; 5504 + postProcessedOutputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output; 5505 + } 5506 + type Ai_Cf_Qwen_Qwq_32B_Input = Ai_Cf_Qwen_Qwq_32B_Prompt | Ai_Cf_Qwen_Qwq_32B_Messages; 5507 + interface Ai_Cf_Qwen_Qwq_32B_Prompt { 5508 + /** 5509 + * The input text prompt for the model to generate a response. 5510 + */ 5511 + prompt: string; 5512 + /** 5513 + * JSON schema that should be fulfilled for the response. 5514 + */ 5515 + guided_json?: object; 5516 + /** 5517 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5518 + */ 5519 + raw?: boolean; 5520 + /** 5521 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5522 + */ 5523 + stream?: boolean; 5524 + /** 5525 + * The maximum number of tokens to generate in the response. 5526 + */ 5527 + max_tokens?: number; 5528 + /** 5529 + * Controls the randomness of the output; higher values produce more random results. 5530 + */ 5531 + temperature?: number; 5532 + /** 5533 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 5534 + */ 5535 + top_p?: number; 5536 + /** 5537 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 5538 + */ 5539 + top_k?: number; 5540 + /** 5541 + * Random seed for reproducibility of the generation. 5542 + */ 5543 + seed?: number; 5544 + /** 5545 + * Penalty for repeated tokens; higher values discourage repetition. 5546 + */ 5547 + repetition_penalty?: number; 5548 + /** 5549 + * Decreases the likelihood of the model repeating the same lines verbatim. 5550 + */ 5551 + frequency_penalty?: number; 5552 + /** 5553 + * Increases the likelihood of the model introducing new topics. 5554 + */ 5555 + presence_penalty?: number; 5556 + } 5557 + interface Ai_Cf_Qwen_Qwq_32B_Messages { 5558 + /** 5559 + * An array of message objects representing the conversation history. 5560 + */ 5561 + messages: { 5562 + /** 5563 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 5564 + */ 5565 + role?: string; 5566 + /** 5567 + * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001 5568 + */ 5569 + tool_call_id?: string; 5570 + content?: string | { 5571 + /** 5572 + * Type of the content provided 5573 + */ 5574 + type?: string; 5575 + text?: string; 5576 + image_url?: { 5577 + /** 5578 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 5579 + */ 5580 + url?: string; 5581 + }; 5582 + }[] | { 5583 + /** 5584 + * Type of the content provided 5585 + */ 5586 + type?: string; 5587 + text?: string; 5588 + image_url?: { 5589 + /** 5590 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 5591 + */ 5592 + url?: string; 5593 + }; 5594 + }; 5595 + }[]; 5596 + functions?: { 5597 + name: string; 5598 + code: string; 5599 + }[]; 5600 + /** 5601 + * A list of tools available for the assistant to use. 5602 + */ 5603 + tools?: ({ 5604 + /** 5605 + * The name of the tool. More descriptive the better. 5606 + */ 5607 + name: string; 5608 + /** 5609 + * A brief description of what the tool does. 5610 + */ 5611 + description: string; 5612 + /** 5613 + * Schema defining the parameters accepted by the tool. 5614 + */ 5615 + parameters: { 5616 + /** 5617 + * The type of the parameters object (usually 'object'). 5618 + */ 5619 + type: string; 5620 + /** 5621 + * List of required parameter names. 5622 + */ 5623 + required?: string[]; 5624 + /** 5625 + * Definitions of each parameter. 5626 + */ 5627 + properties: { 5628 + [k: string]: { 5629 + /** 5630 + * The data type of the parameter. 5631 + */ 5632 + type: string; 5633 + /** 5634 + * A description of the expected parameter. 5635 + */ 5636 + description: string; 5637 + }; 5638 + }; 5639 + }; 5640 + } | { 5641 + /** 5642 + * Specifies the type of tool (e.g., 'function'). 5643 + */ 5644 + type: string; 5645 + /** 5646 + * Details of the function tool. 5647 + */ 5648 + function: { 5649 + /** 5650 + * The name of the function. 5651 + */ 5652 + name: string; 5653 + /** 5654 + * A brief description of what the function does. 5655 + */ 5656 + description: string; 5657 + /** 5658 + * Schema defining the parameters accepted by the function. 5659 + */ 5660 + parameters: { 5661 + /** 5662 + * The type of the parameters object (usually 'object'). 5663 + */ 5664 + type: string; 5665 + /** 5666 + * List of required parameter names. 5667 + */ 5668 + required?: string[]; 5669 + /** 5670 + * Definitions of each parameter. 5671 + */ 5672 + properties: { 5673 + [k: string]: { 5674 + /** 5675 + * The data type of the parameter. 5676 + */ 5677 + type: string; 5678 + /** 5679 + * A description of the expected parameter. 5680 + */ 5681 + description: string; 5682 + }; 5683 + }; 5684 + }; 5685 + }; 5686 + })[]; 5687 + /** 5688 + * JSON schema that should be fulfilled for the response. 5689 + */ 5690 + guided_json?: object; 5691 + /** 5692 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5693 + */ 5694 + raw?: boolean; 5695 + /** 5696 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5697 + */ 5698 + stream?: boolean; 5699 + /** 5700 + * The maximum number of tokens to generate in the response. 5701 + */ 5702 + max_tokens?: number; 5703 + /** 5704 + * Controls the randomness of the output; higher values produce more random results. 5705 + */ 5706 + temperature?: number; 5707 + /** 5708 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 5709 + */ 5710 + top_p?: number; 5711 + /** 5712 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 5713 + */ 5714 + top_k?: number; 5715 + /** 5716 + * Random seed for reproducibility of the generation. 5717 + */ 5718 + seed?: number; 5719 + /** 5720 + * Penalty for repeated tokens; higher values discourage repetition. 5721 + */ 5722 + repetition_penalty?: number; 5723 + /** 5724 + * Decreases the likelihood of the model repeating the same lines verbatim. 5725 + */ 5726 + frequency_penalty?: number; 5727 + /** 5728 + * Increases the likelihood of the model introducing new topics. 5729 + */ 5730 + presence_penalty?: number; 5731 + } 5732 + type Ai_Cf_Qwen_Qwq_32B_Output = { 5733 + /** 5734 + * The generated text response from the model 5735 + */ 5736 + response: string; 5737 + /** 5738 + * Usage statistics for the inference request 5739 + */ 5740 + usage?: { 5741 + /** 5742 + * Total number of tokens in input 5743 + */ 5744 + prompt_tokens?: number; 5745 + /** 5746 + * Total number of tokens in output 5747 + */ 5748 + completion_tokens?: number; 5749 + /** 5750 + * Total number of input and output tokens 5751 + */ 5752 + total_tokens?: number; 5753 + }; 5754 + /** 5755 + * An array of tool calls requests made during the response generation 5756 + */ 5757 + tool_calls?: { 5758 + /** 5759 + * The arguments passed to be passed to the tool call request 5760 + */ 5761 + arguments?: object; 5762 + /** 5763 + * The name of the tool to be called 5764 + */ 5765 + name?: string; 5766 + }[]; 5767 + }; 5768 + declare abstract class Base_Ai_Cf_Qwen_Qwq_32B { 5769 + inputs: Ai_Cf_Qwen_Qwq_32B_Input; 5770 + postProcessedOutputs: Ai_Cf_Qwen_Qwq_32B_Output; 5771 + } 5772 + type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input = Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Prompt | Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages; 5773 + interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Prompt { 5774 + /** 5775 + * The input text prompt for the model to generate a response. 5776 + */ 5777 + prompt: string; 5778 + /** 5779 + * JSON schema that should be fulfilled for the response. 5780 + */ 5781 + guided_json?: object; 5782 + /** 5783 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5784 + */ 5785 + raw?: boolean; 5786 + /** 5787 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5788 + */ 5789 + stream?: boolean; 5790 + /** 5791 + * The maximum number of tokens to generate in the response. 5792 + */ 5793 + max_tokens?: number; 5794 + /** 5795 + * Controls the randomness of the output; higher values produce more random results. 5796 + */ 5797 + temperature?: number; 5798 + /** 5799 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 5800 + */ 5801 + top_p?: number; 5802 + /** 5803 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 5804 + */ 5805 + top_k?: number; 5806 + /** 5807 + * Random seed for reproducibility of the generation. 5808 + */ 5809 + seed?: number; 5810 + /** 5811 + * Penalty for repeated tokens; higher values discourage repetition. 5812 + */ 5813 + repetition_penalty?: number; 5814 + /** 5815 + * Decreases the likelihood of the model repeating the same lines verbatim. 5816 + */ 5817 + frequency_penalty?: number; 5818 + /** 5819 + * Increases the likelihood of the model introducing new topics. 5820 + */ 5821 + presence_penalty?: number; 5822 + } 5823 + interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages { 5824 + /** 5825 + * An array of message objects representing the conversation history. 5826 + */ 5827 + messages: { 5828 + /** 5829 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 5830 + */ 5831 + role?: string; 5832 + /** 5833 + * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001 5834 + */ 5835 + tool_call_id?: string; 5836 + content?: string | { 5837 + /** 5838 + * Type of the content provided 5839 + */ 5840 + type?: string; 5841 + text?: string; 5842 + image_url?: { 5843 + /** 5844 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 5845 + */ 5846 + url?: string; 5847 + }; 5848 + }[] | { 5849 + /** 5850 + * Type of the content provided 5851 + */ 5852 + type?: string; 5853 + text?: string; 5854 + image_url?: { 5855 + /** 5856 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 5857 + */ 5858 + url?: string; 5859 + }; 5860 + }; 5861 + }[]; 5862 + functions?: { 5863 + name: string; 5864 + code: string; 5865 + }[]; 5866 + /** 5867 + * A list of tools available for the assistant to use. 5868 + */ 5869 + tools?: ({ 5870 + /** 5871 + * The name of the tool. More descriptive the better. 5872 + */ 5873 + name: string; 5874 + /** 5875 + * A brief description of what the tool does. 5876 + */ 5877 + description: string; 5878 + /** 5879 + * Schema defining the parameters accepted by the tool. 5880 + */ 5881 + parameters: { 5882 + /** 5883 + * The type of the parameters object (usually 'object'). 5884 + */ 5885 + type: string; 5886 + /** 5887 + * List of required parameter names. 5888 + */ 5889 + required?: string[]; 5890 + /** 5891 + * Definitions of each parameter. 5892 + */ 5893 + properties: { 5894 + [k: string]: { 5895 + /** 5896 + * The data type of the parameter. 5897 + */ 5898 + type: string; 5899 + /** 5900 + * A description of the expected parameter. 5901 + */ 5902 + description: string; 5903 + }; 5904 + }; 5905 + }; 5906 + } | { 5907 + /** 5908 + * Specifies the type of tool (e.g., 'function'). 5909 + */ 5910 + type: string; 5911 + /** 5912 + * Details of the function tool. 5913 + */ 5914 + function: { 5915 + /** 5916 + * The name of the function. 5917 + */ 5918 + name: string; 5919 + /** 5920 + * A brief description of what the function does. 5921 + */ 5922 + description: string; 5923 + /** 5924 + * Schema defining the parameters accepted by the function. 5925 + */ 5926 + parameters: { 5927 + /** 5928 + * The type of the parameters object (usually 'object'). 5929 + */ 5930 + type: string; 5931 + /** 5932 + * List of required parameter names. 5933 + */ 5934 + required?: string[]; 5935 + /** 5936 + * Definitions of each parameter. 5937 + */ 5938 + properties: { 5939 + [k: string]: { 5940 + /** 5941 + * The data type of the parameter. 5942 + */ 5943 + type: string; 5944 + /** 5945 + * A description of the expected parameter. 5946 + */ 5947 + description: string; 5948 + }; 5949 + }; 5950 + }; 5951 + }; 5952 + })[]; 5953 + /** 5954 + * JSON schema that should be fulfilled for the response. 5955 + */ 5956 + guided_json?: object; 5957 + /** 5958 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5959 + */ 5960 + raw?: boolean; 5961 + /** 5962 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5963 + */ 5964 + stream?: boolean; 5965 + /** 5966 + * The maximum number of tokens to generate in the response. 5967 + */ 5968 + max_tokens?: number; 5969 + /** 5970 + * Controls the randomness of the output; higher values produce more random results. 5971 + */ 5972 + temperature?: number; 5973 + /** 5974 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 5975 + */ 5976 + top_p?: number; 5977 + /** 5978 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 5979 + */ 5980 + top_k?: number; 5981 + /** 5982 + * Random seed for reproducibility of the generation. 5983 + */ 5984 + seed?: number; 5985 + /** 5986 + * Penalty for repeated tokens; higher values discourage repetition. 5987 + */ 5988 + repetition_penalty?: number; 5989 + /** 5990 + * Decreases the likelihood of the model repeating the same lines verbatim. 5991 + */ 5992 + frequency_penalty?: number; 5993 + /** 5994 + * Increases the likelihood of the model introducing new topics. 5995 + */ 5996 + presence_penalty?: number; 5997 + } 5998 + type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output = { 5999 + /** 6000 + * The generated text response from the model 6001 + */ 6002 + response: string; 6003 + /** 6004 + * Usage statistics for the inference request 6005 + */ 6006 + usage?: { 6007 + /** 6008 + * Total number of tokens in input 6009 + */ 6010 + prompt_tokens?: number; 6011 + /** 6012 + * Total number of tokens in output 6013 + */ 6014 + completion_tokens?: number; 6015 + /** 6016 + * Total number of input and output tokens 6017 + */ 6018 + total_tokens?: number; 6019 + }; 6020 + /** 6021 + * An array of tool calls requests made during the response generation 6022 + */ 6023 + tool_calls?: { 6024 + /** 6025 + * The arguments passed to be passed to the tool call request 6026 + */ 6027 + arguments?: object; 6028 + /** 6029 + * The name of the tool to be called 6030 + */ 6031 + name?: string; 6032 + }[]; 6033 + }; 6034 + declare abstract class Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct { 6035 + inputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input; 6036 + postProcessedOutputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output; 6037 + } 6038 + type Ai_Cf_Google_Gemma_3_12B_It_Input = Ai_Cf_Google_Gemma_3_12B_It_Prompt | Ai_Cf_Google_Gemma_3_12B_It_Messages; 6039 + interface Ai_Cf_Google_Gemma_3_12B_It_Prompt { 6040 + /** 6041 + * The input text prompt for the model to generate a response. 6042 + */ 6043 + prompt: string; 6044 + /** 6045 + * JSON schema that should be fulfilled for the response. 6046 + */ 6047 + guided_json?: object; 6048 + /** 6049 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6050 + */ 6051 + raw?: boolean; 6052 + /** 6053 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6054 + */ 6055 + stream?: boolean; 6056 + /** 6057 + * The maximum number of tokens to generate in the response. 6058 + */ 6059 + max_tokens?: number; 6060 + /** 6061 + * Controls the randomness of the output; higher values produce more random results. 6062 + */ 6063 + temperature?: number; 6064 + /** 6065 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 6066 + */ 6067 + top_p?: number; 6068 + /** 6069 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 6070 + */ 6071 + top_k?: number; 6072 + /** 6073 + * Random seed for reproducibility of the generation. 6074 + */ 6075 + seed?: number; 6076 + /** 6077 + * Penalty for repeated tokens; higher values discourage repetition. 6078 + */ 6079 + repetition_penalty?: number; 6080 + /** 6081 + * Decreases the likelihood of the model repeating the same lines verbatim. 6082 + */ 6083 + frequency_penalty?: number; 6084 + /** 6085 + * Increases the likelihood of the model introducing new topics. 6086 + */ 6087 + presence_penalty?: number; 6088 + } 6089 + interface Ai_Cf_Google_Gemma_3_12B_It_Messages { 6090 + /** 6091 + * An array of message objects representing the conversation history. 6092 + */ 6093 + messages: { 6094 + /** 6095 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 6096 + */ 6097 + role?: string; 6098 + content?: string | { 6099 + /** 6100 + * Type of the content provided 6101 + */ 6102 + type?: string; 6103 + text?: string; 6104 + image_url?: { 6105 + /** 6106 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6107 + */ 6108 + url?: string; 6109 + }; 6110 + }[]; 6111 + }[]; 6112 + functions?: { 6113 + name: string; 6114 + code: string; 6115 + }[]; 6116 + /** 6117 + * A list of tools available for the assistant to use. 6118 + */ 6119 + tools?: ({ 6120 + /** 6121 + * The name of the tool. More descriptive the better. 6122 + */ 6123 + name: string; 6124 + /** 6125 + * A brief description of what the tool does. 6126 + */ 6127 + description: string; 6128 + /** 6129 + * Schema defining the parameters accepted by the tool. 6130 + */ 6131 + parameters: { 6132 + /** 6133 + * The type of the parameters object (usually 'object'). 6134 + */ 6135 + type: string; 6136 + /** 6137 + * List of required parameter names. 6138 + */ 6139 + required?: string[]; 6140 + /** 6141 + * Definitions of each parameter. 6142 + */ 6143 + properties: { 6144 + [k: string]: { 6145 + /** 6146 + * The data type of the parameter. 6147 + */ 6148 + type: string; 6149 + /** 6150 + * A description of the expected parameter. 6151 + */ 6152 + description: string; 6153 + }; 6154 + }; 6155 + }; 6156 + } | { 6157 + /** 6158 + * Specifies the type of tool (e.g., 'function'). 6159 + */ 6160 + type: string; 6161 + /** 6162 + * Details of the function tool. 6163 + */ 6164 + function: { 6165 + /** 6166 + * The name of the function. 6167 + */ 6168 + name: string; 6169 + /** 6170 + * A brief description of what the function does. 6171 + */ 6172 + description: string; 6173 + /** 6174 + * Schema defining the parameters accepted by the function. 6175 + */ 6176 + parameters: { 6177 + /** 6178 + * The type of the parameters object (usually 'object'). 6179 + */ 6180 + type: string; 6181 + /** 6182 + * List of required parameter names. 6183 + */ 6184 + required?: string[]; 6185 + /** 6186 + * Definitions of each parameter. 6187 + */ 6188 + properties: { 6189 + [k: string]: { 6190 + /** 6191 + * The data type of the parameter. 6192 + */ 6193 + type: string; 6194 + /** 6195 + * A description of the expected parameter. 6196 + */ 6197 + description: string; 6198 + }; 6199 + }; 6200 + }; 6201 + }; 6202 + })[]; 6203 + /** 6204 + * JSON schema that should be fulfilled for the response. 6205 + */ 6206 + guided_json?: object; 6207 + /** 6208 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6209 + */ 6210 + raw?: boolean; 6211 + /** 6212 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6213 + */ 6214 + stream?: boolean; 6215 + /** 6216 + * The maximum number of tokens to generate in the response. 6217 + */ 6218 + max_tokens?: number; 6219 + /** 6220 + * Controls the randomness of the output; higher values produce more random results. 6221 + */ 6222 + temperature?: number; 6223 + /** 6224 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 6225 + */ 6226 + top_p?: number; 6227 + /** 6228 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 6229 + */ 6230 + top_k?: number; 6231 + /** 6232 + * Random seed for reproducibility of the generation. 6233 + */ 6234 + seed?: number; 6235 + /** 6236 + * Penalty for repeated tokens; higher values discourage repetition. 6237 + */ 6238 + repetition_penalty?: number; 6239 + /** 6240 + * Decreases the likelihood of the model repeating the same lines verbatim. 6241 + */ 6242 + frequency_penalty?: number; 6243 + /** 6244 + * Increases the likelihood of the model introducing new topics. 6245 + */ 6246 + presence_penalty?: number; 6247 + } 6248 + type Ai_Cf_Google_Gemma_3_12B_It_Output = { 6249 + /** 6250 + * The generated text response from the model 6251 + */ 6252 + response: string; 6253 + /** 6254 + * Usage statistics for the inference request 6255 + */ 6256 + usage?: { 6257 + /** 6258 + * Total number of tokens in input 6259 + */ 6260 + prompt_tokens?: number; 6261 + /** 6262 + * Total number of tokens in output 6263 + */ 6264 + completion_tokens?: number; 6265 + /** 6266 + * Total number of input and output tokens 6267 + */ 6268 + total_tokens?: number; 6269 + }; 6270 + /** 6271 + * An array of tool calls requests made during the response generation 6272 + */ 6273 + tool_calls?: { 6274 + /** 6275 + * The arguments passed to be passed to the tool call request 6276 + */ 6277 + arguments?: object; 6278 + /** 6279 + * The name of the tool to be called 6280 + */ 6281 + name?: string; 6282 + }[]; 6283 + }; 6284 + declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It { 6285 + inputs: Ai_Cf_Google_Gemma_3_12B_It_Input; 6286 + postProcessedOutputs: Ai_Cf_Google_Gemma_3_12B_It_Output; 6287 + } 6288 + type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input = Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Async_Batch; 6289 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt { 6290 + /** 6291 + * The input text prompt for the model to generate a response. 6292 + */ 6293 + prompt: string; 6294 + /** 6295 + * JSON schema that should be fulfilled for the response. 6296 + */ 6297 + guided_json?: object; 6298 + response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode; 6299 + /** 6300 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6301 + */ 6302 + raw?: boolean; 6303 + /** 6304 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6305 + */ 6306 + stream?: boolean; 6307 + /** 6308 + * The maximum number of tokens to generate in the response. 6309 + */ 6310 + max_tokens?: number; 6311 + /** 6312 + * Controls the randomness of the output; higher values produce more random results. 6313 + */ 6314 + temperature?: number; 6315 + /** 6316 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 6317 + */ 6318 + top_p?: number; 6319 + /** 6320 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 6321 + */ 6322 + top_k?: number; 6323 + /** 6324 + * Random seed for reproducibility of the generation. 6325 + */ 6326 + seed?: number; 6327 + /** 6328 + * Penalty for repeated tokens; higher values discourage repetition. 6329 + */ 6330 + repetition_penalty?: number; 6331 + /** 6332 + * Decreases the likelihood of the model repeating the same lines verbatim. 6333 + */ 6334 + frequency_penalty?: number; 6335 + /** 6336 + * Increases the likelihood of the model introducing new topics. 6337 + */ 6338 + presence_penalty?: number; 6339 + } 6340 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode { 6341 + type?: "json_object" | "json_schema"; 6342 + json_schema?: unknown; 6343 + } 6344 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages { 6345 + /** 6346 + * An array of message objects representing the conversation history. 6347 + */ 6348 + messages: { 6349 + /** 6350 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 6351 + */ 6352 + role?: string; 6353 + /** 6354 + * The tool call id. If you don't know what to put here you can fall back to 000000001 6355 + */ 6356 + tool_call_id?: string; 6357 + content?: string | { 6358 + /** 6359 + * Type of the content provided 6360 + */ 6361 + type?: string; 6362 + text?: string; 6363 + image_url?: { 6364 + /** 6365 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6366 + */ 6367 + url?: string; 6368 + }; 6369 + }[] | { 6370 + /** 6371 + * Type of the content provided 6372 + */ 6373 + type?: string; 6374 + text?: string; 6375 + image_url?: { 6376 + /** 6377 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6378 + */ 6379 + url?: string; 6380 + }; 6381 + }; 6382 + }[]; 6383 + functions?: { 6384 + name: string; 6385 + code: string; 6386 + }[]; 6387 + /** 6388 + * A list of tools available for the assistant to use. 6389 + */ 6390 + tools?: ({ 6391 + /** 6392 + * The name of the tool. More descriptive the better. 6393 + */ 6394 + name: string; 6395 + /** 6396 + * A brief description of what the tool does. 6397 + */ 6398 + description: string; 6399 + /** 6400 + * Schema defining the parameters accepted by the tool. 6401 + */ 6402 + parameters: { 6403 + /** 6404 + * The type of the parameters object (usually 'object'). 6405 + */ 6406 + type: string; 6407 + /** 6408 + * List of required parameter names. 6409 + */ 6410 + required?: string[]; 6411 + /** 6412 + * Definitions of each parameter. 6413 + */ 6414 + properties: { 6415 + [k: string]: { 6416 + /** 6417 + * The data type of the parameter. 6418 + */ 6419 + type: string; 6420 + /** 6421 + * A description of the expected parameter. 6422 + */ 6423 + description: string; 6424 + }; 6425 + }; 6426 + }; 6427 + } | { 6428 + /** 6429 + * Specifies the type of tool (e.g., 'function'). 6430 + */ 6431 + type: string; 6432 + /** 6433 + * Details of the function tool. 6434 + */ 6435 + function: { 6436 + /** 6437 + * The name of the function. 6438 + */ 6439 + name: string; 6440 + /** 6441 + * A brief description of what the function does. 6442 + */ 6443 + description: string; 6444 + /** 6445 + * Schema defining the parameters accepted by the function. 6446 + */ 6447 + parameters: { 6448 + /** 6449 + * The type of the parameters object (usually 'object'). 6450 + */ 6451 + type: string; 6452 + /** 6453 + * List of required parameter names. 6454 + */ 6455 + required?: string[]; 6456 + /** 6457 + * Definitions of each parameter. 6458 + */ 6459 + properties: { 6460 + [k: string]: { 6461 + /** 6462 + * The data type of the parameter. 6463 + */ 6464 + type: string; 6465 + /** 6466 + * A description of the expected parameter. 6467 + */ 6468 + description: string; 6469 + }; 6470 + }; 6471 + }; 6472 + }; 6473 + })[]; 6474 + response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode; 6475 + /** 6476 + * JSON schema that should be fulfilled for the response. 6477 + */ 6478 + guided_json?: object; 6479 + /** 6480 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6481 + */ 6482 + raw?: boolean; 6483 + /** 6484 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6485 + */ 6486 + stream?: boolean; 6487 + /** 6488 + * The maximum number of tokens to generate in the response. 6489 + */ 6490 + max_tokens?: number; 6491 + /** 6492 + * Controls the randomness of the output; higher values produce more random results. 6493 + */ 6494 + temperature?: number; 6495 + /** 6496 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 6497 + */ 6498 + top_p?: number; 6499 + /** 6500 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 6501 + */ 6502 + top_k?: number; 6503 + /** 6504 + * Random seed for reproducibility of the generation. 6505 + */ 6506 + seed?: number; 6507 + /** 6508 + * Penalty for repeated tokens; higher values discourage repetition. 6509 + */ 6510 + repetition_penalty?: number; 6511 + /** 6512 + * Decreases the likelihood of the model repeating the same lines verbatim. 6513 + */ 6514 + frequency_penalty?: number; 6515 + /** 6516 + * Increases the likelihood of the model introducing new topics. 6517 + */ 6518 + presence_penalty?: number; 6519 + } 6520 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Async_Batch { 6521 + requests: (Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt_Inner | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner)[]; 6522 + } 6523 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt_Inner { 6524 + /** 6525 + * The input text prompt for the model to generate a response. 6526 + */ 6527 + prompt: string; 6528 + /** 6529 + * JSON schema that should be fulfilled for the response. 6530 + */ 6531 + guided_json?: object; 6532 + response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode; 6533 + /** 6534 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6535 + */ 6536 + raw?: boolean; 6537 + /** 6538 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6539 + */ 6540 + stream?: boolean; 6541 + /** 6542 + * The maximum number of tokens to generate in the response. 6543 + */ 6544 + max_tokens?: number; 6545 + /** 6546 + * Controls the randomness of the output; higher values produce more random results. 6547 + */ 6548 + temperature?: number; 6549 + /** 6550 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 6551 + */ 6552 + top_p?: number; 6553 + /** 6554 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 6555 + */ 6556 + top_k?: number; 6557 + /** 6558 + * Random seed for reproducibility of the generation. 6559 + */ 6560 + seed?: number; 6561 + /** 6562 + * Penalty for repeated tokens; higher values discourage repetition. 6563 + */ 6564 + repetition_penalty?: number; 6565 + /** 6566 + * Decreases the likelihood of the model repeating the same lines verbatim. 6567 + */ 6568 + frequency_penalty?: number; 6569 + /** 6570 + * Increases the likelihood of the model introducing new topics. 6571 + */ 6572 + presence_penalty?: number; 6573 + } 6574 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner { 6575 + /** 6576 + * An array of message objects representing the conversation history. 6577 + */ 6578 + messages: { 6579 + /** 6580 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 6581 + */ 6582 + role?: string; 6583 + /** 6584 + * The tool call id. If you don't know what to put here you can fall back to 000000001 6585 + */ 6586 + tool_call_id?: string; 6587 + content?: string | { 6588 + /** 6589 + * Type of the content provided 6590 + */ 6591 + type?: string; 6592 + text?: string; 6593 + image_url?: { 6594 + /** 6595 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6596 + */ 6597 + url?: string; 6598 + }; 6599 + }[] | { 6600 + /** 6601 + * Type of the content provided 6602 + */ 6603 + type?: string; 6604 + text?: string; 6605 + image_url?: { 6606 + /** 6607 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6608 + */ 6609 + url?: string; 6610 + }; 6611 + }; 6612 + }[]; 6613 + functions?: { 6614 + name: string; 6615 + code: string; 6616 + }[]; 6617 + /** 6618 + * A list of tools available for the assistant to use. 6619 + */ 6620 + tools?: ({ 6621 + /** 6622 + * The name of the tool. More descriptive the better. 6623 + */ 6624 + name: string; 6625 + /** 6626 + * A brief description of what the tool does. 6627 + */ 6628 + description: string; 6629 + /** 6630 + * Schema defining the parameters accepted by the tool. 6631 + */ 6632 + parameters: { 6633 + /** 6634 + * The type of the parameters object (usually 'object'). 6635 + */ 6636 + type: string; 6637 + /** 6638 + * List of required parameter names. 6639 + */ 6640 + required?: string[]; 6641 + /** 6642 + * Definitions of each parameter. 6643 + */ 6644 + properties: { 6645 + [k: string]: { 6646 + /** 6647 + * The data type of the parameter. 6648 + */ 6649 + type: string; 6650 + /** 6651 + * A description of the expected parameter. 6652 + */ 6653 + description: string; 6654 + }; 6655 + }; 6656 + }; 6657 + } | { 6658 + /** 6659 + * Specifies the type of tool (e.g., 'function'). 6660 + */ 6661 + type: string; 6662 + /** 6663 + * Details of the function tool. 6664 + */ 6665 + function: { 6666 + /** 6667 + * The name of the function. 6668 + */ 6669 + name: string; 6670 + /** 6671 + * A brief description of what the function does. 6672 + */ 6673 + description: string; 6674 + /** 6675 + * Schema defining the parameters accepted by the function. 6676 + */ 6677 + parameters: { 6678 + /** 6679 + * The type of the parameters object (usually 'object'). 6680 + */ 6681 + type: string; 6682 + /** 6683 + * List of required parameter names. 6684 + */ 6685 + required?: string[]; 6686 + /** 6687 + * Definitions of each parameter. 6688 + */ 6689 + properties: { 6690 + [k: string]: { 6691 + /** 6692 + * The data type of the parameter. 6693 + */ 6694 + type: string; 6695 + /** 6696 + * A description of the expected parameter. 6697 + */ 6698 + description: string; 6699 + }; 6700 + }; 6701 + }; 6702 + }; 6703 + })[]; 6704 + response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode; 6705 + /** 6706 + * JSON schema that should be fulfilled for the response. 6707 + */ 6708 + guided_json?: object; 6709 + /** 6710 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6711 + */ 6712 + raw?: boolean; 6713 + /** 6714 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6715 + */ 6716 + stream?: boolean; 6717 + /** 6718 + * The maximum number of tokens to generate in the response. 6719 + */ 6720 + max_tokens?: number; 6721 + /** 6722 + * Controls the randomness of the output; higher values produce more random results. 6723 + */ 6724 + temperature?: number; 6725 + /** 6726 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 6727 + */ 6728 + top_p?: number; 6729 + /** 6730 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 6731 + */ 6732 + top_k?: number; 6733 + /** 6734 + * Random seed for reproducibility of the generation. 6735 + */ 6736 + seed?: number; 6737 + /** 6738 + * Penalty for repeated tokens; higher values discourage repetition. 6739 + */ 6740 + repetition_penalty?: number; 6741 + /** 6742 + * Decreases the likelihood of the model repeating the same lines verbatim. 6743 + */ 6744 + frequency_penalty?: number; 6745 + /** 6746 + * Increases the likelihood of the model introducing new topics. 6747 + */ 6748 + presence_penalty?: number; 6749 + } 6750 + type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = { 6751 + /** 6752 + * The generated text response from the model 6753 + */ 6754 + response: string; 6755 + /** 6756 + * Usage statistics for the inference request 6757 + */ 6758 + usage?: { 6759 + /** 6760 + * Total number of tokens in input 6761 + */ 6762 + prompt_tokens?: number; 6763 + /** 6764 + * Total number of tokens in output 6765 + */ 6766 + completion_tokens?: number; 6767 + /** 6768 + * Total number of input and output tokens 6769 + */ 6770 + total_tokens?: number; 6771 + }; 6772 + /** 6773 + * An array of tool calls requests made during the response generation 6774 + */ 6775 + tool_calls?: { 6776 + /** 6777 + * The tool call id. 6778 + */ 6779 + id?: string; 6780 + /** 6781 + * Specifies the type of tool (e.g., 'function'). 6782 + */ 6783 + type?: string; 6784 + /** 6785 + * Details of the function tool. 6786 + */ 6787 + function?: { 6788 + /** 6789 + * The name of the tool to be called 6790 + */ 6791 + name?: string; 6792 + /** 6793 + * The arguments passed to be passed to the tool call request 6794 + */ 6795 + arguments?: object; 6796 + }; 6797 + }[]; 6798 + }; 6799 + declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct { 6800 + inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input; 6801 + postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output; 6802 + } 6803 + type Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Input = Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Async_Batch; 6804 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt { 6805 + /** 6806 + * The input text prompt for the model to generate a response. 6807 + */ 6808 + prompt: string; 6809 + /** 6810 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 6811 + */ 6812 + lora?: string; 6813 + response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode; 6814 + /** 6815 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6816 + */ 6817 + raw?: boolean; 6818 + /** 6819 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6820 + */ 6821 + stream?: boolean; 6822 + /** 6823 + * The maximum number of tokens to generate in the response. 6824 + */ 6825 + max_tokens?: number; 6826 + /** 6827 + * Controls the randomness of the output; higher values produce more random results. 6828 + */ 6829 + temperature?: number; 6830 + /** 6831 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 6832 + */ 6833 + top_p?: number; 6834 + /** 6835 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 6836 + */ 6837 + top_k?: number; 6838 + /** 6839 + * Random seed for reproducibility of the generation. 6840 + */ 6841 + seed?: number; 6842 + /** 6843 + * Penalty for repeated tokens; higher values discourage repetition. 6844 + */ 6845 + repetition_penalty?: number; 6846 + /** 6847 + * Decreases the likelihood of the model repeating the same lines verbatim. 6848 + */ 6849 + frequency_penalty?: number; 6850 + /** 6851 + * Increases the likelihood of the model introducing new topics. 6852 + */ 6853 + presence_penalty?: number; 6854 + } 6855 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode { 6856 + type?: "json_object" | "json_schema"; 6857 + json_schema?: unknown; 6858 + } 6859 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages { 6860 + /** 6861 + * An array of message objects representing the conversation history. 6862 + */ 6863 + messages: { 6864 + /** 6865 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 6866 + */ 6867 + role: string; 6868 + /** 6869 + * The content of the message as a string. 6870 + */ 6871 + content: string; 6872 + }[]; 6873 + functions?: { 6874 + name: string; 6875 + code: string; 6876 + }[]; 6877 + /** 6878 + * A list of tools available for the assistant to use. 6879 + */ 6880 + tools?: ({ 6881 + /** 6882 + * The name of the tool. More descriptive the better. 6883 + */ 6884 + name: string; 6885 + /** 6886 + * A brief description of what the tool does. 6887 + */ 6888 + description: string; 6889 + /** 6890 + * Schema defining the parameters accepted by the tool. 6891 + */ 6892 + parameters: { 6893 + /** 6894 + * The type of the parameters object (usually 'object'). 6895 + */ 6896 + type: string; 6897 + /** 6898 + * List of required parameter names. 6899 + */ 6900 + required?: string[]; 6901 + /** 6902 + * Definitions of each parameter. 6903 + */ 6904 + properties: { 6905 + [k: string]: { 6906 + /** 6907 + * The data type of the parameter. 6908 + */ 6909 + type: string; 6910 + /** 6911 + * A description of the expected parameter. 6912 + */ 6913 + description: string; 6914 + }; 6915 + }; 6916 + }; 6917 + } | { 6918 + /** 6919 + * Specifies the type of tool (e.g., 'function'). 6920 + */ 6921 + type: string; 6922 + /** 6923 + * Details of the function tool. 6924 + */ 6925 + function: { 6926 + /** 6927 + * The name of the function. 6928 + */ 6929 + name: string; 6930 + /** 6931 + * A brief description of what the function does. 6932 + */ 6933 + description: string; 6934 + /** 6935 + * Schema defining the parameters accepted by the function. 6936 + */ 6937 + parameters: { 6938 + /** 6939 + * The type of the parameters object (usually 'object'). 6940 + */ 6941 + type: string; 6942 + /** 6943 + * List of required parameter names. 6944 + */ 6945 + required?: string[]; 6946 + /** 6947 + * Definitions of each parameter. 6948 + */ 6949 + properties: { 6950 + [k: string]: { 6951 + /** 6952 + * The data type of the parameter. 6953 + */ 6954 + type: string; 6955 + /** 6956 + * A description of the expected parameter. 6957 + */ 6958 + description: string; 6959 + }; 6960 + }; 6961 + }; 6962 + }; 6963 + })[]; 6964 + response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_1; 6965 + /** 6966 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6967 + */ 6968 + raw?: boolean; 6969 + /** 6970 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6971 + */ 6972 + stream?: boolean; 6973 + /** 6974 + * The maximum number of tokens to generate in the response. 6975 + */ 6976 + max_tokens?: number; 6977 + /** 6978 + * Controls the randomness of the output; higher values produce more random results. 6979 + */ 6980 + temperature?: number; 6981 + /** 6982 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 6983 + */ 6984 + top_p?: number; 6985 + /** 6986 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 6987 + */ 6988 + top_k?: number; 6989 + /** 6990 + * Random seed for reproducibility of the generation. 6991 + */ 6992 + seed?: number; 6993 + /** 6994 + * Penalty for repeated tokens; higher values discourage repetition. 6995 + */ 6996 + repetition_penalty?: number; 6997 + /** 6998 + * Decreases the likelihood of the model repeating the same lines verbatim. 6999 + */ 7000 + frequency_penalty?: number; 7001 + /** 7002 + * Increases the likelihood of the model introducing new topics. 7003 + */ 7004 + presence_penalty?: number; 7005 + } 7006 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_1 { 7007 + type?: "json_object" | "json_schema"; 7008 + json_schema?: unknown; 7009 + } 7010 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Async_Batch { 7011 + requests: (Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt_1 | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1)[]; 7012 + } 7013 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt_1 { 7014 + /** 7015 + * The input text prompt for the model to generate a response. 7016 + */ 7017 + prompt: string; 7018 + /** 7019 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 7020 + */ 7021 + lora?: string; 7022 + response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_2; 7023 + /** 7024 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7025 + */ 7026 + raw?: boolean; 7027 + /** 7028 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7029 + */ 7030 + stream?: boolean; 7031 + /** 7032 + * The maximum number of tokens to generate in the response. 7033 + */ 7034 + max_tokens?: number; 7035 + /** 7036 + * Controls the randomness of the output; higher values produce more random results. 7037 + */ 7038 + temperature?: number; 7039 + /** 7040 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 7041 + */ 7042 + top_p?: number; 7043 + /** 7044 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 7045 + */ 7046 + top_k?: number; 7047 + /** 7048 + * Random seed for reproducibility of the generation. 7049 + */ 7050 + seed?: number; 7051 + /** 7052 + * Penalty for repeated tokens; higher values discourage repetition. 7053 + */ 7054 + repetition_penalty?: number; 7055 + /** 7056 + * Decreases the likelihood of the model repeating the same lines verbatim. 7057 + */ 7058 + frequency_penalty?: number; 7059 + /** 7060 + * Increases the likelihood of the model introducing new topics. 7061 + */ 7062 + presence_penalty?: number; 7063 + } 7064 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_2 { 7065 + type?: "json_object" | "json_schema"; 7066 + json_schema?: unknown; 7067 + } 7068 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1 { 7069 + /** 7070 + * An array of message objects representing the conversation history. 7071 + */ 7072 + messages: { 7073 + /** 7074 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 7075 + */ 7076 + role: string; 7077 + /** 7078 + * The content of the message as a string. 7079 + */ 7080 + content: string; 7081 + }[]; 7082 + functions?: { 7083 + name: string; 7084 + code: string; 7085 + }[]; 7086 + /** 7087 + * A list of tools available for the assistant to use. 7088 + */ 7089 + tools?: ({ 7090 + /** 7091 + * The name of the tool. More descriptive the better. 7092 + */ 7093 + name: string; 7094 + /** 7095 + * A brief description of what the tool does. 7096 + */ 7097 + description: string; 7098 + /** 7099 + * Schema defining the parameters accepted by the tool. 7100 + */ 7101 + parameters: { 7102 + /** 7103 + * The type of the parameters object (usually 'object'). 7104 + */ 7105 + type: string; 7106 + /** 7107 + * List of required parameter names. 7108 + */ 7109 + required?: string[]; 7110 + /** 7111 + * Definitions of each parameter. 7112 + */ 7113 + properties: { 7114 + [k: string]: { 7115 + /** 7116 + * The data type of the parameter. 7117 + */ 7118 + type: string; 7119 + /** 7120 + * A description of the expected parameter. 7121 + */ 7122 + description: string; 7123 + }; 7124 + }; 7125 + }; 7126 + } | { 7127 + /** 7128 + * Specifies the type of tool (e.g., 'function'). 7129 + */ 7130 + type: string; 7131 + /** 7132 + * Details of the function tool. 7133 + */ 7134 + function: { 7135 + /** 7136 + * The name of the function. 7137 + */ 7138 + name: string; 7139 + /** 7140 + * A brief description of what the function does. 7141 + */ 7142 + description: string; 7143 + /** 7144 + * Schema defining the parameters accepted by the function. 7145 + */ 7146 + parameters: { 7147 + /** 7148 + * The type of the parameters object (usually 'object'). 7149 + */ 7150 + type: string; 7151 + /** 7152 + * List of required parameter names. 7153 + */ 7154 + required?: string[]; 7155 + /** 7156 + * Definitions of each parameter. 7157 + */ 7158 + properties: { 7159 + [k: string]: { 7160 + /** 7161 + * The data type of the parameter. 7162 + */ 7163 + type: string; 7164 + /** 7165 + * A description of the expected parameter. 7166 + */ 7167 + description: string; 7168 + }; 7169 + }; 7170 + }; 7171 + }; 7172 + })[]; 7173 + response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_3; 7174 + /** 7175 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7176 + */ 7177 + raw?: boolean; 7178 + /** 7179 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7180 + */ 7181 + stream?: boolean; 7182 + /** 7183 + * The maximum number of tokens to generate in the response. 7184 + */ 7185 + max_tokens?: number; 7186 + /** 7187 + * Controls the randomness of the output; higher values produce more random results. 7188 + */ 7189 + temperature?: number; 7190 + /** 7191 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 7192 + */ 7193 + top_p?: number; 7194 + /** 7195 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 7196 + */ 7197 + top_k?: number; 7198 + /** 7199 + * Random seed for reproducibility of the generation. 7200 + */ 7201 + seed?: number; 7202 + /** 7203 + * Penalty for repeated tokens; higher values discourage repetition. 7204 + */ 7205 + repetition_penalty?: number; 7206 + /** 7207 + * Decreases the likelihood of the model repeating the same lines verbatim. 7208 + */ 7209 + frequency_penalty?: number; 7210 + /** 7211 + * Increases the likelihood of the model introducing new topics. 7212 + */ 7213 + presence_penalty?: number; 7214 + } 7215 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_3 { 7216 + type?: "json_object" | "json_schema"; 7217 + json_schema?: unknown; 7218 + } 7219 + type Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Output = Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Chat_Completion_Response | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Text_Completion_Response | string | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_AsyncResponse; 7220 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Chat_Completion_Response { 7221 + /** 7222 + * Unique identifier for the completion 7223 + */ 7224 + id?: string; 7225 + /** 7226 + * Object type identifier 7227 + */ 7228 + object?: "chat.completion"; 7229 + /** 7230 + * Unix timestamp of when the completion was created 7231 + */ 7232 + created?: number; 7233 + /** 7234 + * Model used for the completion 7235 + */ 7236 + model?: string; 7237 + /** 7238 + * List of completion choices 7239 + */ 7240 + choices?: { 7241 + /** 7242 + * Index of the choice in the list 7243 + */ 7244 + index?: number; 7245 + /** 7246 + * The message generated by the model 7247 + */ 7248 + message?: { 7249 + /** 7250 + * Role of the message author 7251 + */ 7252 + role: string; 7253 + /** 7254 + * The content of the message 7255 + */ 7256 + content: string; 7257 + /** 7258 + * Internal reasoning content (if available) 7259 + */ 7260 + reasoning_content?: string; 7261 + /** 7262 + * Tool calls made by the assistant 7263 + */ 7264 + tool_calls?: { 7265 + /** 7266 + * Unique identifier for the tool call 7267 + */ 7268 + id: string; 7269 + /** 7270 + * Type of tool call 7271 + */ 7272 + type: "function"; 7273 + function: { 7274 + /** 7275 + * Name of the function to call 7276 + */ 7277 + name: string; 7278 + /** 7279 + * JSON string of arguments for the function 7280 + */ 7281 + arguments: string; 7282 + }; 7283 + }[]; 7284 + }; 7285 + /** 7286 + * Reason why the model stopped generating 7287 + */ 7288 + finish_reason?: string; 7289 + /** 7290 + * Stop reason (may be null) 7291 + */ 7292 + stop_reason?: string | null; 7293 + /** 7294 + * Log probabilities (if requested) 7295 + */ 7296 + logprobs?: {} | null; 7297 + }[]; 7298 + /** 7299 + * Usage statistics for the inference request 7300 + */ 7301 + usage?: { 7302 + /** 7303 + * Total number of tokens in input 7304 + */ 7305 + prompt_tokens?: number; 7306 + /** 7307 + * Total number of tokens in output 7308 + */ 7309 + completion_tokens?: number; 7310 + /** 7311 + * Total number of input and output tokens 7312 + */ 7313 + total_tokens?: number; 7314 + }; 7315 + /** 7316 + * Log probabilities for the prompt (if requested) 7317 + */ 7318 + prompt_logprobs?: {} | null; 7319 + } 7320 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Text_Completion_Response { 7321 + /** 7322 + * Unique identifier for the completion 7323 + */ 7324 + id?: string; 7325 + /** 7326 + * Object type identifier 7327 + */ 7328 + object?: "text_completion"; 7329 + /** 7330 + * Unix timestamp of when the completion was created 7331 + */ 7332 + created?: number; 7333 + /** 7334 + * Model used for the completion 7335 + */ 7336 + model?: string; 7337 + /** 7338 + * List of completion choices 7339 + */ 7340 + choices?: { 7341 + /** 7342 + * Index of the choice in the list 7343 + */ 7344 + index: number; 7345 + /** 7346 + * The generated text completion 7347 + */ 7348 + text: string; 7349 + /** 7350 + * Reason why the model stopped generating 7351 + */ 7352 + finish_reason: string; 7353 + /** 7354 + * Stop reason (may be null) 7355 + */ 7356 + stop_reason?: string | null; 7357 + /** 7358 + * Log probabilities (if requested) 7359 + */ 7360 + logprobs?: {} | null; 7361 + /** 7362 + * Log probabilities for the prompt (if requested) 7363 + */ 7364 + prompt_logprobs?: {} | null; 7365 + }[]; 7366 + /** 7367 + * Usage statistics for the inference request 7368 + */ 7369 + usage?: { 7370 + /** 7371 + * Total number of tokens in input 7372 + */ 7373 + prompt_tokens?: number; 7374 + /** 7375 + * Total number of tokens in output 7376 + */ 7377 + completion_tokens?: number; 7378 + /** 7379 + * Total number of input and output tokens 7380 + */ 7381 + total_tokens?: number; 7382 + }; 7383 + } 7384 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_AsyncResponse { 7385 + /** 7386 + * The async request id that can be used to obtain the results. 7387 + */ 7388 + request_id?: string; 7389 + } 7390 + declare abstract class Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8 { 7391 + inputs: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Input; 7392 + postProcessedOutputs: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Output; 7393 + } 7394 + interface Ai_Cf_Deepgram_Nova_3_Input { 7395 + audio: { 7396 + body: object; 7397 + contentType: string; 7398 + }; 7399 + /** 7400 + * Sets how the model will interpret strings submitted to the custom_topic param. When strict, the model will only return topics submitted using the custom_topic param. When extended, the model will return its own detected topics in addition to those submitted using the custom_topic param. 7401 + */ 7402 + custom_topic_mode?: "extended" | "strict"; 7403 + /** 7404 + * Custom topics you want the model to detect within your input audio or text if present Submit up to 100 7405 + */ 7406 + custom_topic?: string; 7407 + /** 7408 + * Sets how the model will interpret intents submitted to the custom_intent param. When strict, the model will only return intents submitted using the custom_intent param. When extended, the model will return its own detected intents in addition those submitted using the custom_intents param 7409 + */ 7410 + custom_intent_mode?: "extended" | "strict"; 7411 + /** 7412 + * Custom intents you want the model to detect within your input audio if present 7413 + */ 7414 + custom_intent?: string; 7415 + /** 7416 + * Identifies and extracts key entities from content in submitted audio 7417 + */ 7418 + detect_entities?: boolean; 7419 + /** 7420 + * Identifies the dominant language spoken in submitted audio 7421 + */ 7422 + detect_language?: boolean; 7423 + /** 7424 + * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0 7425 + */ 7426 + diarize?: boolean; 7427 + /** 7428 + * Identify and extract key entities from content in submitted audio 7429 + */ 7430 + dictation?: boolean; 7431 + /** 7432 + * Specify the expected encoding of your submitted audio 7433 + */ 7434 + encoding?: "linear16" | "flac" | "mulaw" | "amr-nb" | "amr-wb" | "opus" | "speex" | "g729"; 7435 + /** 7436 + * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing 7437 + */ 7438 + extra?: string; 7439 + /** 7440 + * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um' 7441 + */ 7442 + filler_words?: boolean; 7443 + /** 7444 + * Key term prompting can boost or suppress specialized terminology and brands. 7445 + */ 7446 + keyterm?: string; 7447 + /** 7448 + * Keywords can boost or suppress specialized terminology and brands. 7449 + */ 7450 + keywords?: string; 7451 + /** 7452 + * The BCP-47 language tag that hints at the primary spoken language. Depending on the Model and API endpoint you choose only certain languages are available. 7453 + */ 7454 + language?: string; 7455 + /** 7456 + * Spoken measurements will be converted to their corresponding abbreviations. 7457 + */ 7458 + measurements?: boolean; 7459 + /** 7460 + * Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip. 7461 + */ 7462 + mip_opt_out?: boolean; 7463 + /** 7464 + * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio 7465 + */ 7466 + mode?: "general" | "medical" | "finance"; 7467 + /** 7468 + * Transcribe each audio channel independently. 7469 + */ 7470 + multichannel?: boolean; 7471 + /** 7472 + * Numerals converts numbers from written format to numerical format. 7473 + */ 7474 + numerals?: boolean; 7475 + /** 7476 + * Splits audio into paragraphs to improve transcript readability. 7477 + */ 7478 + paragraphs?: boolean; 7479 + /** 7480 + * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely. 7481 + */ 7482 + profanity_filter?: boolean; 7483 + /** 7484 + * Add punctuation and capitalization to the transcript. 7485 + */ 7486 + punctuate?: boolean; 7487 + /** 7488 + * Redaction removes sensitive information from your transcripts. 7489 + */ 7490 + redact?: string; 7491 + /** 7492 + * Search for terms or phrases in submitted audio and replaces them. 7493 + */ 7494 + replace?: string; 7495 + /** 7496 + * Search for terms or phrases in submitted audio. 7497 + */ 7498 + search?: string; 7499 + /** 7500 + * Recognizes the sentiment throughout a transcript or text. 7501 + */ 7502 + sentiment?: boolean; 7503 + /** 7504 + * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability. 7505 + */ 7506 + smart_format?: boolean; 7507 + /** 7508 + * Detect topics throughout a transcript or text. 7509 + */ 7510 + topics?: boolean; 7511 + /** 7512 + * Segments speech into meaningful semantic units. 7513 + */ 7514 + utterances?: boolean; 7515 + /** 7516 + * Seconds to wait before detecting a pause between words in submitted audio. 7517 + */ 7518 + utt_split?: number; 7519 + /** 7520 + * The number of channels in the submitted audio 7521 + */ 7522 + channels?: number; 7523 + /** 7524 + * Specifies whether the streaming endpoint should provide ongoing transcription updates as more audio is received. When set to true, the endpoint sends continuous updates, meaning transcription results may evolve over time. Note: Supported only for webosockets. 7525 + */ 7526 + interim_results?: boolean; 7527 + /** 7528 + * Indicates how long model will wait to detect whether a speaker has finished speaking or pauses for a significant period of time. When set to a value, the streaming endpoint immediately finalizes the transcription for the processed time range and returns the transcript with a speech_final parameter set to true. Can also be set to false to disable endpointing 7529 + */ 7530 + endpointing?: string; 7531 + /** 7532 + * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets. 7533 + */ 7534 + vad_events?: boolean; 7535 + /** 7536 + * Indicates how long model will wait to send an UtteranceEnd message after a word has been transcribed. Use with interim_results. Note: Supported only for webosockets. 7537 + */ 7538 + utterance_end_ms?: boolean; 7539 + } 7540 + interface Ai_Cf_Deepgram_Nova_3_Output { 7541 + results?: { 7542 + channels?: { 7543 + alternatives?: { 7544 + confidence?: number; 7545 + transcript?: string; 7546 + words?: { 7547 + confidence?: number; 7548 + end?: number; 7549 + start?: number; 7550 + word?: string; 7551 + }[]; 7552 + }[]; 7553 + }[]; 7554 + summary?: { 7555 + result?: string; 7556 + short?: string; 7557 + }; 7558 + sentiments?: { 7559 + segments?: { 7560 + text?: string; 7561 + start_word?: number; 7562 + end_word?: number; 7563 + sentiment?: string; 7564 + sentiment_score?: number; 7565 + }[]; 7566 + average?: { 7567 + sentiment?: string; 7568 + sentiment_score?: number; 7569 + }; 7570 + }; 7571 + }; 7572 + } 7573 + declare abstract class Base_Ai_Cf_Deepgram_Nova_3 { 7574 + inputs: Ai_Cf_Deepgram_Nova_3_Input; 7575 + postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output; 7576 + } 7577 + interface Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input { 7578 + queries?: string | string[]; 7579 + /** 7580 + * Optional instruction for the task 7581 + */ 7582 + instruction?: string; 7583 + documents?: string | string[]; 7584 + text?: string | string[]; 7585 + } 7586 + interface Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Output { 7587 + data?: number[][]; 7588 + shape?: number[]; 7589 + } 7590 + declare abstract class Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B { 7591 + inputs: Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input; 7592 + postProcessedOutputs: Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Output; 7593 + } 7594 + type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input = { 7595 + /** 7596 + * readable stream with audio data and content-type specified for that data 7597 + */ 7598 + audio: { 7599 + body: object; 7600 + contentType: string; 7601 + }; 7602 + /** 7603 + * type of data PCM data that's sent to the inference server as raw array 7604 + */ 7605 + dtype?: "uint8" | "float32" | "float64"; 7606 + } | { 7607 + /** 7608 + * base64 encoded audio data 7609 + */ 7610 + audio: string; 7611 + /** 7612 + * type of data PCM data that's sent to the inference server as raw array 7613 + */ 7614 + dtype?: "uint8" | "float32" | "float64"; 7615 + }; 7616 + interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output { 7617 + /** 7618 + * if true, end-of-turn was detected 7619 + */ 7620 + is_complete?: boolean; 7621 + /** 7622 + * probability of the end-of-turn detection 7623 + */ 7624 + probability?: number; 7625 + } 7626 + declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 { 7627 + inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input; 7628 + postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output; 7629 + } 7630 + declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B { 7631 + inputs: ResponsesInput; 7632 + postProcessedOutputs: ResponsesOutput; 7633 + } 7634 + declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B { 7635 + inputs: ResponsesInput; 7636 + postProcessedOutputs: ResponsesOutput; 7637 + } 7638 + interface Ai_Cf_Leonardo_Phoenix_1_0_Input { 7639 + /** 7640 + * A text description of the image you want to generate. 7641 + */ 7642 + prompt: string; 7643 + /** 7644 + * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt 7645 + */ 7646 + guidance?: number; 7647 + /** 7648 + * Random seed for reproducibility of the image generation 7649 + */ 7650 + seed?: number; 7651 + /** 7652 + * The height of the generated image in pixels 7653 + */ 7654 + height?: number; 7655 + /** 7656 + * The width of the generated image in pixels 7657 + */ 7658 + width?: number; 7659 + /** 7660 + * The number of diffusion steps; higher values can improve quality but take longer 7661 + */ 7662 + num_steps?: number; 7663 + /** 7664 + * Specify what to exclude from the generated images 7665 + */ 7666 + negative_prompt?: string; 7667 + } 7668 + /** 7669 + * The generated image in JPEG format 7670 + */ 7671 + type Ai_Cf_Leonardo_Phoenix_1_0_Output = string; 7672 + declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 { 7673 + inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input; 7674 + postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output; 7675 + } 7676 + interface Ai_Cf_Leonardo_Lucid_Origin_Input { 7677 + /** 7678 + * A text description of the image you want to generate. 7679 + */ 7680 + prompt: string; 7681 + /** 7682 + * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt 7683 + */ 7684 + guidance?: number; 7685 + /** 7686 + * Random seed for reproducibility of the image generation 7687 + */ 7688 + seed?: number; 7689 + /** 7690 + * The height of the generated image in pixels 7691 + */ 7692 + height?: number; 7693 + /** 7694 + * The width of the generated image in pixels 7695 + */ 7696 + width?: number; 7697 + /** 7698 + * The number of diffusion steps; higher values can improve quality but take longer 7699 + */ 7700 + num_steps?: number; 7701 + /** 7702 + * The number of diffusion steps; higher values can improve quality but take longer 7703 + */ 7704 + steps?: number; 7705 + } 7706 + interface Ai_Cf_Leonardo_Lucid_Origin_Output { 7707 + /** 7708 + * The generated image in Base64 format. 7709 + */ 7710 + image?: string; 7711 + } 7712 + declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin { 7713 + inputs: Ai_Cf_Leonardo_Lucid_Origin_Input; 7714 + postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output; 7715 + } 7716 + interface Ai_Cf_Deepgram_Aura_1_Input { 7717 + /** 7718 + * Speaker used to produce the audio. 7719 + */ 7720 + speaker?: "angus" | "asteria" | "arcas" | "orion" | "orpheus" | "athena" | "luna" | "zeus" | "perseus" | "helios" | "hera" | "stella"; 7721 + /** 7722 + * Encoding of the output audio. 7723 + */ 7724 + encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac"; 7725 + /** 7726 + * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type.. 7727 + */ 7728 + container?: "none" | "wav" | "ogg"; 7729 + /** 7730 + * The text content to be converted to speech 7731 + */ 7732 + text: string; 7733 + /** 7734 + * Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable 7735 + */ 7736 + sample_rate?: number; 7737 + /** 7738 + * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type. 7739 + */ 7740 + bit_rate?: number; 7741 + } 7742 + /** 7743 + * The generated audio in MP3 format 7744 + */ 7745 + type Ai_Cf_Deepgram_Aura_1_Output = string; 7746 + declare abstract class Base_Ai_Cf_Deepgram_Aura_1 { 7747 + inputs: Ai_Cf_Deepgram_Aura_1_Input; 7748 + postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output; 7749 + } 7750 + interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input { 7751 + /** 7752 + * Input text to translate. Can be a single string or a list of strings. 7753 + */ 7754 + text: string | string[]; 7755 + /** 7756 + * Target language to translate to 7757 + */ 7758 + target_language: "asm_Beng" | "awa_Deva" | "ben_Beng" | "bho_Deva" | "brx_Deva" | "doi_Deva" | "eng_Latn" | "gom_Deva" | "gon_Deva" | "guj_Gujr" | "hin_Deva" | "hne_Deva" | "kan_Knda" | "kas_Arab" | "kas_Deva" | "kha_Latn" | "lus_Latn" | "mag_Deva" | "mai_Deva" | "mal_Mlym" | "mar_Deva" | "mni_Beng" | "mni_Mtei" | "npi_Deva" | "ory_Orya" | "pan_Guru" | "san_Deva" | "sat_Olck" | "snd_Arab" | "snd_Deva" | "tam_Taml" | "tel_Telu" | "urd_Arab" | "unr_Deva"; 7759 + } 7760 + interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Output { 7761 + /** 7762 + * Translated texts 7763 + */ 7764 + translations: string[]; 7765 + } 7766 + declare abstract class Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B { 7767 + inputs: Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input; 7768 + postProcessedOutputs: Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Output; 7769 + } 7770 + type Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Input = Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Async_Batch; 7771 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt { 7772 + /** 7773 + * The input text prompt for the model to generate a response. 7774 + */ 7775 + prompt: string; 7776 + /** 7777 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 7778 + */ 7779 + lora?: string; 7780 + response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode; 7781 + /** 7782 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7783 + */ 7784 + raw?: boolean; 7785 + /** 7786 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7787 + */ 7788 + stream?: boolean; 7789 + /** 7790 + * The maximum number of tokens to generate in the response. 7791 + */ 7792 + max_tokens?: number; 7793 + /** 7794 + * Controls the randomness of the output; higher values produce more random results. 7795 + */ 7796 + temperature?: number; 7797 + /** 7798 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 7799 + */ 7800 + top_p?: number; 7801 + /** 7802 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 7803 + */ 7804 + top_k?: number; 7805 + /** 7806 + * Random seed for reproducibility of the generation. 7807 + */ 7808 + seed?: number; 7809 + /** 7810 + * Penalty for repeated tokens; higher values discourage repetition. 7811 + */ 7812 + repetition_penalty?: number; 7813 + /** 7814 + * Decreases the likelihood of the model repeating the same lines verbatim. 7815 + */ 7816 + frequency_penalty?: number; 7817 + /** 7818 + * Increases the likelihood of the model introducing new topics. 7819 + */ 7820 + presence_penalty?: number; 7821 + } 7822 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode { 7823 + type?: "json_object" | "json_schema"; 7824 + json_schema?: unknown; 7825 + } 7826 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages { 7827 + /** 7828 + * An array of message objects representing the conversation history. 7829 + */ 7830 + messages: { 7831 + /** 7832 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 7833 + */ 7834 + role: string; 7835 + /** 7836 + * The content of the message as a string. 7837 + */ 7838 + content: string; 7839 + }[]; 7840 + functions?: { 7841 + name: string; 7842 + code: string; 7843 + }[]; 7844 + /** 7845 + * A list of tools available for the assistant to use. 7846 + */ 7847 + tools?: ({ 7848 + /** 7849 + * The name of the tool. More descriptive the better. 7850 + */ 7851 + name: string; 7852 + /** 7853 + * A brief description of what the tool does. 7854 + */ 7855 + description: string; 7856 + /** 7857 + * Schema defining the parameters accepted by the tool. 7858 + */ 7859 + parameters: { 7860 + /** 7861 + * The type of the parameters object (usually 'object'). 7862 + */ 7863 + type: string; 7864 + /** 7865 + * List of required parameter names. 7866 + */ 7867 + required?: string[]; 7868 + /** 7869 + * Definitions of each parameter. 7870 + */ 7871 + properties: { 7872 + [k: string]: { 7873 + /** 7874 + * The data type of the parameter. 7875 + */ 7876 + type: string; 7877 + /** 7878 + * A description of the expected parameter. 7879 + */ 7880 + description: string; 7881 + }; 7882 + }; 7883 + }; 7884 + } | { 7885 + /** 7886 + * Specifies the type of tool (e.g., 'function'). 7887 + */ 7888 + type: string; 7889 + /** 7890 + * Details of the function tool. 7891 + */ 7892 + function: { 7893 + /** 7894 + * The name of the function. 7895 + */ 7896 + name: string; 7897 + /** 7898 + * A brief description of what the function does. 7899 + */ 7900 + description: string; 7901 + /** 7902 + * Schema defining the parameters accepted by the function. 7903 + */ 7904 + parameters: { 7905 + /** 7906 + * The type of the parameters object (usually 'object'). 7907 + */ 7908 + type: string; 7909 + /** 7910 + * List of required parameter names. 7911 + */ 7912 + required?: string[]; 7913 + /** 7914 + * Definitions of each parameter. 7915 + */ 7916 + properties: { 7917 + [k: string]: { 7918 + /** 7919 + * The data type of the parameter. 7920 + */ 7921 + type: string; 7922 + /** 7923 + * A description of the expected parameter. 7924 + */ 7925 + description: string; 7926 + }; 7927 + }; 7928 + }; 7929 + }; 7930 + })[]; 7931 + response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_1; 7932 + /** 7933 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7934 + */ 7935 + raw?: boolean; 7936 + /** 7937 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7938 + */ 7939 + stream?: boolean; 7940 + /** 7941 + * The maximum number of tokens to generate in the response. 7942 + */ 7943 + max_tokens?: number; 7944 + /** 7945 + * Controls the randomness of the output; higher values produce more random results. 7946 + */ 7947 + temperature?: number; 7948 + /** 7949 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 7950 + */ 7951 + top_p?: number; 7952 + /** 7953 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 7954 + */ 7955 + top_k?: number; 7956 + /** 7957 + * Random seed for reproducibility of the generation. 7958 + */ 7959 + seed?: number; 7960 + /** 7961 + * Penalty for repeated tokens; higher values discourage repetition. 7962 + */ 7963 + repetition_penalty?: number; 7964 + /** 7965 + * Decreases the likelihood of the model repeating the same lines verbatim. 7966 + */ 7967 + frequency_penalty?: number; 7968 + /** 7969 + * Increases the likelihood of the model introducing new topics. 7970 + */ 7971 + presence_penalty?: number; 7972 + } 7973 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_1 { 7974 + type?: "json_object" | "json_schema"; 7975 + json_schema?: unknown; 7976 + } 7977 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Async_Batch { 7978 + requests: (Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt_1 | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1)[]; 7979 + } 7980 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt_1 { 7981 + /** 7982 + * The input text prompt for the model to generate a response. 7983 + */ 7984 + prompt: string; 7985 + /** 7986 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 7987 + */ 7988 + lora?: string; 7989 + response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_2; 7990 + /** 7991 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7992 + */ 7993 + raw?: boolean; 7994 + /** 7995 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7996 + */ 7997 + stream?: boolean; 7998 + /** 7999 + * The maximum number of tokens to generate in the response. 8000 + */ 8001 + max_tokens?: number; 8002 + /** 8003 + * Controls the randomness of the output; higher values produce more random results. 8004 + */ 8005 + temperature?: number; 8006 + /** 8007 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 8008 + */ 8009 + top_p?: number; 8010 + /** 8011 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 8012 + */ 8013 + top_k?: number; 8014 + /** 8015 + * Random seed for reproducibility of the generation. 8016 + */ 8017 + seed?: number; 8018 + /** 8019 + * Penalty for repeated tokens; higher values discourage repetition. 8020 + */ 8021 + repetition_penalty?: number; 8022 + /** 8023 + * Decreases the likelihood of the model repeating the same lines verbatim. 8024 + */ 8025 + frequency_penalty?: number; 8026 + /** 8027 + * Increases the likelihood of the model introducing new topics. 8028 + */ 8029 + presence_penalty?: number; 8030 + } 8031 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_2 { 8032 + type?: "json_object" | "json_schema"; 8033 + json_schema?: unknown; 8034 + } 8035 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1 { 8036 + /** 8037 + * An array of message objects representing the conversation history. 8038 + */ 8039 + messages: { 8040 + /** 8041 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 8042 + */ 8043 + role: string; 8044 + /** 8045 + * The content of the message as a string. 8046 + */ 8047 + content: string; 8048 + }[]; 8049 + functions?: { 8050 + name: string; 8051 + code: string; 8052 + }[]; 8053 + /** 8054 + * A list of tools available for the assistant to use. 8055 + */ 8056 + tools?: ({ 8057 + /** 8058 + * The name of the tool. More descriptive the better. 8059 + */ 8060 + name: string; 8061 + /** 8062 + * A brief description of what the tool does. 8063 + */ 8064 + description: string; 8065 + /** 8066 + * Schema defining the parameters accepted by the tool. 8067 + */ 8068 + parameters: { 8069 + /** 8070 + * The type of the parameters object (usually 'object'). 8071 + */ 8072 + type: string; 8073 + /** 8074 + * List of required parameter names. 8075 + */ 8076 + required?: string[]; 8077 + /** 8078 + * Definitions of each parameter. 8079 + */ 8080 + properties: { 8081 + [k: string]: { 8082 + /** 8083 + * The data type of the parameter. 8084 + */ 8085 + type: string; 8086 + /** 8087 + * A description of the expected parameter. 8088 + */ 8089 + description: string; 8090 + }; 8091 + }; 8092 + }; 8093 + } | { 8094 + /** 8095 + * Specifies the type of tool (e.g., 'function'). 8096 + */ 8097 + type: string; 8098 + /** 8099 + * Details of the function tool. 8100 + */ 8101 + function: { 8102 + /** 8103 + * The name of the function. 8104 + */ 8105 + name: string; 8106 + /** 8107 + * A brief description of what the function does. 8108 + */ 8109 + description: string; 8110 + /** 8111 + * Schema defining the parameters accepted by the function. 8112 + */ 8113 + parameters: { 8114 + /** 8115 + * The type of the parameters object (usually 'object'). 8116 + */ 8117 + type: string; 8118 + /** 8119 + * List of required parameter names. 8120 + */ 8121 + required?: string[]; 8122 + /** 8123 + * Definitions of each parameter. 8124 + */ 8125 + properties: { 8126 + [k: string]: { 8127 + /** 8128 + * The data type of the parameter. 8129 + */ 8130 + type: string; 8131 + /** 8132 + * A description of the expected parameter. 8133 + */ 8134 + description: string; 8135 + }; 8136 + }; 8137 + }; 8138 + }; 8139 + })[]; 8140 + response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_3; 8141 + /** 8142 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 8143 + */ 8144 + raw?: boolean; 8145 + /** 8146 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 8147 + */ 8148 + stream?: boolean; 8149 + /** 8150 + * The maximum number of tokens to generate in the response. 8151 + */ 8152 + max_tokens?: number; 8153 + /** 8154 + * Controls the randomness of the output; higher values produce more random results. 8155 + */ 8156 + temperature?: number; 8157 + /** 8158 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses. 8159 + */ 8160 + top_p?: number; 8161 + /** 8162 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. 8163 + */ 8164 + top_k?: number; 8165 + /** 8166 + * Random seed for reproducibility of the generation. 8167 + */ 8168 + seed?: number; 8169 + /** 8170 + * Penalty for repeated tokens; higher values discourage repetition. 8171 + */ 8172 + repetition_penalty?: number; 8173 + /** 8174 + * Decreases the likelihood of the model repeating the same lines verbatim. 8175 + */ 8176 + frequency_penalty?: number; 8177 + /** 8178 + * Increases the likelihood of the model introducing new topics. 8179 + */ 8180 + presence_penalty?: number; 8181 + } 8182 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_3 { 8183 + type?: "json_object" | "json_schema"; 8184 + json_schema?: unknown; 8185 + } 8186 + type Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Output = Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Chat_Completion_Response | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Text_Completion_Response | string | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_AsyncResponse; 8187 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Chat_Completion_Response { 8188 + /** 8189 + * Unique identifier for the completion 8190 + */ 8191 + id?: string; 8192 + /** 8193 + * Object type identifier 8194 + */ 8195 + object?: "chat.completion"; 8196 + /** 8197 + * Unix timestamp of when the completion was created 8198 + */ 8199 + created?: number; 8200 + /** 8201 + * Model used for the completion 8202 + */ 8203 + model?: string; 8204 + /** 8205 + * List of completion choices 8206 + */ 8207 + choices?: { 8208 + /** 8209 + * Index of the choice in the list 8210 + */ 8211 + index?: number; 8212 + /** 8213 + * The message generated by the model 8214 + */ 8215 + message?: { 8216 + /** 8217 + * Role of the message author 8218 + */ 8219 + role: string; 8220 + /** 8221 + * The content of the message 8222 + */ 8223 + content: string; 8224 + /** 8225 + * Internal reasoning content (if available) 8226 + */ 8227 + reasoning_content?: string; 8228 + /** 8229 + * Tool calls made by the assistant 8230 + */ 8231 + tool_calls?: { 8232 + /** 8233 + * Unique identifier for the tool call 8234 + */ 8235 + id: string; 8236 + /** 8237 + * Type of tool call 8238 + */ 8239 + type: "function"; 8240 + function: { 8241 + /** 8242 + * Name of the function to call 8243 + */ 8244 + name: string; 8245 + /** 8246 + * JSON string of arguments for the function 8247 + */ 8248 + arguments: string; 8249 + }; 8250 + }[]; 8251 + }; 8252 + /** 8253 + * Reason why the model stopped generating 8254 + */ 8255 + finish_reason?: string; 8256 + /** 8257 + * Stop reason (may be null) 8258 + */ 8259 + stop_reason?: string | null; 8260 + /** 8261 + * Log probabilities (if requested) 8262 + */ 8263 + logprobs?: {} | null; 8264 + }[]; 8265 + /** 8266 + * Usage statistics for the inference request 8267 + */ 8268 + usage?: { 8269 + /** 8270 + * Total number of tokens in input 8271 + */ 8272 + prompt_tokens?: number; 8273 + /** 8274 + * Total number of tokens in output 8275 + */ 8276 + completion_tokens?: number; 8277 + /** 8278 + * Total number of input and output tokens 8279 + */ 8280 + total_tokens?: number; 8281 + }; 8282 + /** 8283 + * Log probabilities for the prompt (if requested) 8284 + */ 8285 + prompt_logprobs?: {} | null; 8286 + } 8287 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Text_Completion_Response { 8288 + /** 8289 + * Unique identifier for the completion 8290 + */ 8291 + id?: string; 8292 + /** 8293 + * Object type identifier 8294 + */ 8295 + object?: "text_completion"; 8296 + /** 8297 + * Unix timestamp of when the completion was created 8298 + */ 8299 + created?: number; 8300 + /** 8301 + * Model used for the completion 8302 + */ 8303 + model?: string; 8304 + /** 8305 + * List of completion choices 8306 + */ 8307 + choices?: { 8308 + /** 8309 + * Index of the choice in the list 8310 + */ 8311 + index: number; 8312 + /** 8313 + * The generated text completion 8314 + */ 8315 + text: string; 8316 + /** 8317 + * Reason why the model stopped generating 8318 + */ 8319 + finish_reason: string; 8320 + /** 8321 + * Stop reason (may be null) 8322 + */ 8323 + stop_reason?: string | null; 8324 + /** 8325 + * Log probabilities (if requested) 8326 + */ 8327 + logprobs?: {} | null; 8328 + /** 8329 + * Log probabilities for the prompt (if requested) 8330 + */ 8331 + prompt_logprobs?: {} | null; 8332 + }[]; 8333 + /** 8334 + * Usage statistics for the inference request 8335 + */ 8336 + usage?: { 8337 + /** 8338 + * Total number of tokens in input 8339 + */ 8340 + prompt_tokens?: number; 8341 + /** 8342 + * Total number of tokens in output 8343 + */ 8344 + completion_tokens?: number; 8345 + /** 8346 + * Total number of input and output tokens 8347 + */ 8348 + total_tokens?: number; 8349 + }; 8350 + } 8351 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_AsyncResponse { 8352 + /** 8353 + * The async request id that can be used to obtain the results. 8354 + */ 8355 + request_id?: string; 8356 + } 8357 + declare abstract class Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It { 8358 + inputs: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Input; 8359 + postProcessedOutputs: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Output; 8360 + } 8361 + interface Ai_Cf_Pfnet_Plamo_Embedding_1B_Input { 8362 + /** 8363 + * Input text to embed. Can be a single string or a list of strings. 8364 + */ 8365 + text: string | string[]; 8366 + } 8367 + interface Ai_Cf_Pfnet_Plamo_Embedding_1B_Output { 8368 + /** 8369 + * Embedding vectors, where each vector is a list of floats. 8370 + */ 8371 + data: number[][]; 8372 + /** 8373 + * Shape of the embedding data as [number_of_embeddings, embedding_dimension]. 8374 + * 8375 + * @minItems 2 8376 + * @maxItems 2 8377 + */ 8378 + shape: [ 8379 + number, 8380 + number 8381 + ]; 8382 + } 8383 + declare abstract class Base_Ai_Cf_Pfnet_Plamo_Embedding_1B { 8384 + inputs: Ai_Cf_Pfnet_Plamo_Embedding_1B_Input; 8385 + postProcessedOutputs: Ai_Cf_Pfnet_Plamo_Embedding_1B_Output; 8386 + } 8387 + interface Ai_Cf_Deepgram_Flux_Input { 8388 + /** 8389 + * Encoding of the audio stream. Currently only supports raw signed little-endian 16-bit PCM. 8390 + */ 8391 + encoding: "linear16"; 8392 + /** 8393 + * Sample rate of the audio stream in Hz. 8394 + */ 8395 + sample_rate: string; 8396 + /** 8397 + * End-of-turn confidence required to fire an eager end-of-turn event. When set, enables EagerEndOfTurn and TurnResumed events. Valid Values 0.3 - 0.9. 8398 + */ 8399 + eager_eot_threshold?: string; 8400 + /** 8401 + * End-of-turn confidence required to finish a turn. Valid Values 0.5 - 0.9. 8402 + */ 8403 + eot_threshold?: string; 8404 + /** 8405 + * A turn will be finished when this much time has passed after speech, regardless of EOT confidence. 8406 + */ 8407 + eot_timeout_ms?: string; 8408 + /** 8409 + * Keyterm prompting can improve recognition of specialized terminology. Pass multiple keyterm query parameters to boost multiple keyterms. 8410 + */ 8411 + keyterm?: string; 8412 + /** 8413 + * Opts out requests from the Deepgram Model Improvement Program. Refer to Deepgram Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip 8414 + */ 8415 + mip_opt_out?: "true" | "false"; 8416 + /** 8417 + * Label your requests for the purpose of identification during usage reporting 8418 + */ 8419 + tag?: string; 8420 + } 8421 + /** 8422 + * Output will be returned as websocket messages. 8423 + */ 8424 + interface Ai_Cf_Deepgram_Flux_Output { 8425 + /** 8426 + * The unique identifier of the request (uuid) 8427 + */ 8428 + request_id?: string; 8429 + /** 8430 + * Starts at 0 and increments for each message the server sends to the client. 8431 + */ 8432 + sequence_id?: number; 8433 + /** 8434 + * The type of event being reported. 8435 + */ 8436 + event?: "Update" | "StartOfTurn" | "EagerEndOfTurn" | "TurnResumed" | "EndOfTurn"; 8437 + /** 8438 + * The index of the current turn 8439 + */ 8440 + turn_index?: number; 8441 + /** 8442 + * Start time in seconds of the audio range that was transcribed 8443 + */ 8444 + audio_window_start?: number; 8445 + /** 8446 + * End time in seconds of the audio range that was transcribed 8447 + */ 8448 + audio_window_end?: number; 8449 + /** 8450 + * Text that was said over the course of the current turn 8451 + */ 8452 + transcript?: string; 8453 + /** 8454 + * The words in the transcript 8455 + */ 8456 + words?: { 8457 + /** 8458 + * The individual punctuated, properly-cased word from the transcript 8459 + */ 8460 + word: string; 8461 + /** 8462 + * Confidence that this word was transcribed correctly 8463 + */ 8464 + confidence: number; 8465 + }[]; 8466 + /** 8467 + * Confidence that no more speech is coming in this turn 8468 + */ 8469 + end_of_turn_confidence?: number; 8470 + } 8471 + declare abstract class Base_Ai_Cf_Deepgram_Flux { 8472 + inputs: Ai_Cf_Deepgram_Flux_Input; 8473 + postProcessedOutputs: Ai_Cf_Deepgram_Flux_Output; 8474 + } 8475 + interface Ai_Cf_Deepgram_Aura_2_En_Input { 8476 + /** 8477 + * Speaker used to produce the audio. 8478 + */ 8479 + speaker?: "amalthea" | "andromeda" | "apollo" | "arcas" | "aries" | "asteria" | "athena" | "atlas" | "aurora" | "callista" | "cora" | "cordelia" | "delia" | "draco" | "electra" | "harmonia" | "helena" | "hera" | "hermes" | "hyperion" | "iris" | "janus" | "juno" | "jupiter" | "luna" | "mars" | "minerva" | "neptune" | "odysseus" | "ophelia" | "orion" | "orpheus" | "pandora" | "phoebe" | "pluto" | "saturn" | "thalia" | "theia" | "vesta" | "zeus"; 8480 + /** 8481 + * Encoding of the output audio. 8482 + */ 8483 + encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac"; 8484 + /** 8485 + * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type.. 8486 + */ 8487 + container?: "none" | "wav" | "ogg"; 8488 + /** 8489 + * The text content to be converted to speech 8490 + */ 8491 + text: string; 8492 + /** 8493 + * Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable 8494 + */ 8495 + sample_rate?: number; 8496 + /** 8497 + * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type. 8498 + */ 8499 + bit_rate?: number; 8500 + } 8501 + /** 8502 + * The generated audio in MP3 format 8503 + */ 8504 + type Ai_Cf_Deepgram_Aura_2_En_Output = string; 8505 + declare abstract class Base_Ai_Cf_Deepgram_Aura_2_En { 8506 + inputs: Ai_Cf_Deepgram_Aura_2_En_Input; 8507 + postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_En_Output; 8508 + } 8509 + interface Ai_Cf_Deepgram_Aura_2_Es_Input { 8510 + /** 8511 + * Speaker used to produce the audio. 8512 + */ 8513 + speaker?: "sirio" | "nestor" | "carina" | "celeste" | "alvaro" | "diana" | "aquila" | "selena" | "estrella" | "javier"; 8514 + /** 8515 + * Encoding of the output audio. 8516 + */ 8517 + encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac"; 8518 + /** 8519 + * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type.. 8520 + */ 8521 + container?: "none" | "wav" | "ogg"; 8522 + /** 8523 + * The text content to be converted to speech 8524 + */ 8525 + text: string; 8526 + /** 8527 + * Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable 8528 + */ 8529 + sample_rate?: number; 8530 + /** 8531 + * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type. 8532 + */ 8533 + bit_rate?: number; 8534 + } 8535 + /** 8536 + * The generated audio in MP3 format 8537 + */ 8538 + type Ai_Cf_Deepgram_Aura_2_Es_Output = string; 8539 + declare abstract class Base_Ai_Cf_Deepgram_Aura_2_Es { 8540 + inputs: Ai_Cf_Deepgram_Aura_2_Es_Input; 8541 + postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_Es_Output; 8542 + } 8543 + interface AiModels { 8544 + "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification; 8545 + "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage; 8546 + "@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage; 8547 + "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage; 8548 + "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage; 8549 + "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage; 8550 + "@cf/myshell-ai/melotts": BaseAiTextToSpeech; 8551 + "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings; 8552 + "@cf/microsoft/resnet-50": BaseAiImageClassification; 8553 + "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration; 8554 + "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration; 8555 + "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration; 8556 + "@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration; 8557 + "@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration; 8558 + "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration; 8559 + "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration; 8560 + "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration; 8561 + "@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration; 8562 + "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration; 8563 + "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration; 8564 + "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration; 8565 + "@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration; 8566 + "@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration; 8567 + "@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration; 8568 + "@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration; 8569 + "@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration; 8570 + "@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration; 8571 + "@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration; 8572 + "@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration; 8573 + "@cf/microsoft/phi-2": BaseAiTextGeneration; 8574 + "@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration; 8575 + "@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration; 8576 + "@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration; 8577 + "@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration; 8578 + "@hf/google/gemma-7b-it": BaseAiTextGeneration; 8579 + "@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration; 8580 + "@cf/google/gemma-2b-it-lora": BaseAiTextGeneration; 8581 + "@cf/google/gemma-7b-it-lora": BaseAiTextGeneration; 8582 + "@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration; 8583 + "@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration; 8584 + "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration; 8585 + "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration; 8586 + "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration; 8587 + "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration; 8588 + "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration; 8589 + "@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration; 8590 + "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration; 8591 + "@cf/ibm-granite/granite-4.0-h-micro": BaseAiTextGeneration; 8592 + "@cf/facebook/bart-large-cnn": BaseAiSummarization; 8593 + "@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText; 8594 + "@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5; 8595 + "@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper; 8596 + "@cf/meta/m2m100-1.2b": Base_Ai_Cf_Meta_M2M100_1_2B; 8597 + "@cf/baai/bge-small-en-v1.5": Base_Ai_Cf_Baai_Bge_Small_En_V1_5; 8598 + "@cf/baai/bge-large-en-v1.5": Base_Ai_Cf_Baai_Bge_Large_En_V1_5; 8599 + "@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M; 8600 + "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En; 8601 + "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo; 8602 + "@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3; 8603 + "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell; 8604 + "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct; 8605 + "@cf/meta/llama-3.3-70b-instruct-fp8-fast": Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast; 8606 + "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B; 8607 + "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base; 8608 + "@cf/qwen/qwen2.5-coder-32b-instruct": Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct; 8609 + "@cf/qwen/qwq-32b": Base_Ai_Cf_Qwen_Qwq_32B; 8610 + "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct; 8611 + "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It; 8612 + "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct; 8613 + "@cf/qwen/qwen3-30b-a3b-fp8": Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8; 8614 + "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3; 8615 + "@cf/qwen/qwen3-embedding-0.6b": Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B; 8616 + "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2; 8617 + "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B; 8618 + "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B; 8619 + "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0; 8620 + "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin; 8621 + "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1; 8622 + "@cf/ai4bharat/indictrans2-en-indic-1B": Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B; 8623 + "@cf/aisingapore/gemma-sea-lion-v4-27b-it": Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It; 8624 + "@cf/pfnet/plamo-embedding-1b": Base_Ai_Cf_Pfnet_Plamo_Embedding_1B; 8625 + "@cf/deepgram/flux": Base_Ai_Cf_Deepgram_Flux; 8626 + "@cf/deepgram/aura-2-en": Base_Ai_Cf_Deepgram_Aura_2_En; 8627 + "@cf/deepgram/aura-2-es": Base_Ai_Cf_Deepgram_Aura_2_Es; 8628 + } 8629 + type AiOptions = { 8630 + /** 8631 + * Send requests as an asynchronous batch job, only works for supported models 8632 + * https://developers.cloudflare.com/workers-ai/features/batch-api 8633 + */ 8634 + queueRequest?: boolean; 8635 + /** 8636 + * Establish websocket connections, only works for supported models 8637 + */ 8638 + websocket?: boolean; 8639 + /** 8640 + * Tag your requests to group and view them in Cloudflare dashboard. 8641 + * 8642 + * Rules: 8643 + * Tags must only contain letters, numbers, and the symbols: : - . / @ 8644 + * Each tag can have maximum 50 characters. 8645 + * Maximum 5 tags are allowed each request. 8646 + * Duplicate tags will removed. 8647 + */ 8648 + tags?: string[]; 8649 + gateway?: GatewayOptions; 8650 + returnRawResponse?: boolean; 8651 + prefix?: string; 8652 + extraHeaders?: object; 8653 + }; 8654 + type AiModelsSearchParams = { 8655 + author?: string; 8656 + hide_experimental?: boolean; 8657 + page?: number; 8658 + per_page?: number; 8659 + search?: string; 8660 + source?: number; 8661 + task?: string; 8662 + }; 8663 + type AiModelsSearchObject = { 8664 + id: string; 8665 + source: number; 8666 + name: string; 8667 + description: string; 8668 + task: { 8669 + id: string; 8670 + name: string; 8671 + description: string; 8672 + }; 8673 + tags: string[]; 8674 + properties: { 8675 + property_id: string; 8676 + value: string; 8677 + }[]; 8678 + }; 8679 + interface InferenceUpstreamError extends Error { 8680 + } 8681 + interface AiInternalError extends Error { 8682 + } 8683 + type AiModelListType = Record<string, any>; 8684 + declare abstract class Ai<AiModelList extends AiModelListType = AiModels> { 8685 + aiGatewayLogId: string | null; 8686 + gateway(gatewayId: string): AiGateway; 8687 + /** 8688 + * Access the AI Search API for managing AI-powered search instances. 8689 + * 8690 + * This is the new API that replaces AutoRAG with better namespace separation: 8691 + * - Account-level operations: `list()`, `create()` 8692 + * - Instance-level operations: `get(id).search()`, `get(id).chatCompletions()`, `get(id).delete()` 8693 + * 8694 + * @example 8695 + * ```typescript 8696 + * // List all AI Search instances 8697 + * const instances = await env.AI.aiSearch.list(); 8698 + * 8699 + * // Search an instance 8700 + * const results = await env.AI.aiSearch.get('my-search').search({ 8701 + * messages: [{ role: 'user', content: 'What is the policy?' }], 8702 + * ai_search_options: { 8703 + * retrieval: { max_num_results: 10 } 8704 + * } 8705 + * }); 8706 + * 8707 + * // Generate chat completions with AI Search context 8708 + * const response = await env.AI.aiSearch.get('my-search').chatCompletions({ 8709 + * messages: [{ role: 'user', content: 'What is the policy?' }], 8710 + * model: '@cf/meta/llama-3.3-70b-instruct-fp8-fast' 8711 + * }); 8712 + * ``` 8713 + */ 8714 + aiSearch(): AiSearchAccountService; 8715 + /** 8716 + * @deprecated AutoRAG has been replaced by AI Search. 8717 + * Use `env.AI.aiSearch` instead for better API design and new features. 8718 + * 8719 + * Migration guide: 8720 + * - `env.AI.autorag().list()` → `env.AI.aiSearch.list()` 8721 + * - `env.AI.autorag('id').search({ query: '...' })` → `env.AI.aiSearch.get('id').search({ messages: [{ role: 'user', content: '...' }] })` 8722 + * - `env.AI.autorag('id').aiSearch(...)` → `env.AI.aiSearch.get('id').chatCompletions(...)` 8723 + * 8724 + * Note: The old API continues to work for backwards compatibility, but new projects should use AI Search. 8725 + * 8726 + * @see AiSearchAccountService 8727 + * @param autoragId Optional instance ID (omit for account-level operations) 8728 + */ 8729 + autorag(autoragId: string): AutoRAG; 8730 + run<Name extends keyof AiModelList, Options extends AiOptions, InputOptions extends AiModelList[Name]["inputs"]>(model: Name, inputs: InputOptions, options?: Options): Promise<Options extends { 8731 + returnRawResponse: true; 8732 + } | { 8733 + websocket: true; 8734 + } ? Response : InputOptions extends { 8735 + stream: true; 8736 + } ? ReadableStream : AiModelList[Name]["postProcessedOutputs"]>; 8737 + models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>; 8738 + toMarkdown(): ToMarkdownService; 8739 + toMarkdown(files: MarkdownDocument[], options?: ConversionRequestOptions): Promise<ConversionResponse[]>; 8740 + toMarkdown(files: MarkdownDocument, options?: ConversionRequestOptions): Promise<ConversionResponse>; 8741 + } 8742 + type GatewayRetries = { 8743 + maxAttempts?: 1 | 2 | 3 | 4 | 5; 8744 + retryDelayMs?: number; 8745 + backoff?: 'constant' | 'linear' | 'exponential'; 8746 + }; 8747 + type GatewayOptions = { 8748 + id: string; 8749 + cacheKey?: string; 8750 + cacheTtl?: number; 8751 + skipCache?: boolean; 8752 + metadata?: Record<string, number | string | boolean | null | bigint>; 8753 + collectLog?: boolean; 8754 + eventId?: string; 8755 + requestTimeoutMs?: number; 8756 + retries?: GatewayRetries; 8757 + }; 8758 + type UniversalGatewayOptions = Exclude<GatewayOptions, 'id'> & { 8759 + /** 8760 + ** @deprecated 8761 + */ 8762 + id?: string; 8763 + }; 8764 + type AiGatewayPatchLog = { 8765 + score?: number | null; 8766 + feedback?: -1 | 1 | null; 8767 + metadata?: Record<string, number | string | boolean | null | bigint> | null; 8768 + }; 8769 + type AiGatewayLog = { 8770 + id: string; 8771 + provider: string; 8772 + model: string; 8773 + model_type?: string; 8774 + path: string; 8775 + duration: number; 8776 + request_type?: string; 8777 + request_content_type?: string; 8778 + status_code: number; 8779 + response_content_type?: string; 8780 + success: boolean; 8781 + cached: boolean; 8782 + tokens_in?: number; 8783 + tokens_out?: number; 8784 + metadata?: Record<string, number | string | boolean | null | bigint>; 8785 + step?: number; 8786 + cost?: number; 8787 + custom_cost?: boolean; 8788 + request_size: number; 8789 + request_head?: string; 8790 + request_head_complete: boolean; 8791 + response_size: number; 8792 + response_head?: string; 8793 + response_head_complete: boolean; 8794 + created_at: Date; 8795 + }; 8796 + type AIGatewayProviders = 'workers-ai' | 'anthropic' | 'aws-bedrock' | 'azure-openai' | 'google-vertex-ai' | 'huggingface' | 'openai' | 'perplexity-ai' | 'replicate' | 'groq' | 'cohere' | 'google-ai-studio' | 'mistral' | 'grok' | 'openrouter' | 'deepseek' | 'cerebras' | 'cartesia' | 'elevenlabs' | 'adobe-firefly'; 8797 + type AIGatewayHeaders = { 8798 + 'cf-aig-metadata': Record<string, number | string | boolean | null | bigint> | string; 8799 + 'cf-aig-custom-cost': { 8800 + per_token_in?: number; 8801 + per_token_out?: number; 8802 + } | { 8803 + total_cost?: number; 8804 + } | string; 8805 + 'cf-aig-cache-ttl': number | string; 8806 + 'cf-aig-skip-cache': boolean | string; 8807 + 'cf-aig-cache-key': string; 8808 + 'cf-aig-event-id': string; 8809 + 'cf-aig-request-timeout': number | string; 8810 + 'cf-aig-max-attempts': number | string; 8811 + 'cf-aig-retry-delay': number | string; 8812 + 'cf-aig-backoff': string; 8813 + 'cf-aig-collect-log': boolean | string; 8814 + Authorization: string; 8815 + 'Content-Type': string; 8816 + [key: string]: string | number | boolean | object; 8817 + }; 8818 + type AIGatewayUniversalRequest = { 8819 + provider: AIGatewayProviders | string; // eslint-disable-line 8820 + endpoint: string; 8821 + headers: Partial<AIGatewayHeaders>; 8822 + query: unknown; 8823 + }; 8824 + interface AiGatewayInternalError extends Error { 8825 + } 8826 + interface AiGatewayLogNotFound extends Error { 8827 + } 8828 + declare abstract class AiGateway { 8829 + patchLog(logId: string, data: AiGatewayPatchLog): Promise<void>; 8830 + getLog(logId: string): Promise<AiGatewayLog>; 8831 + run(data: AIGatewayUniversalRequest | AIGatewayUniversalRequest[], options?: { 8832 + gateway?: UniversalGatewayOptions; 8833 + extraHeaders?: object; 8834 + }): Promise<Response>; 8835 + getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line 8836 + } 8837 + /** 8838 + * @deprecated AutoRAG has been replaced by AI Search. Use AiSearchInternalError instead. 8839 + * @see AiSearchInternalError 8840 + */ 8841 + interface AutoRAGInternalError extends Error { 8842 + } 8843 + /** 8844 + * @deprecated AutoRAG has been replaced by AI Search. Use AiSearchNotFoundError instead. 8845 + * @see AiSearchNotFoundError 8846 + */ 8847 + interface AutoRAGNotFoundError extends Error { 8848 + } 8849 + /** 8850 + * @deprecated This error type is no longer used in the AI Search API. 8851 + */ 8852 + interface AutoRAGUnauthorizedError extends Error { 8853 + } 8854 + /** 8855 + * @deprecated AutoRAG has been replaced by AI Search. Use AiSearchNameNotSetError instead. 8856 + * @see AiSearchNameNotSetError 8857 + */ 8858 + interface AutoRAGNameNotSetError extends Error { 8859 + } 8860 + type ComparisonFilter = { 8861 + key: string; 8862 + type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte'; 8863 + value: string | number | boolean; 8864 + }; 8865 + type CompoundFilter = { 8866 + type: 'and' | 'or'; 8867 + filters: ComparisonFilter[]; 8868 + }; 8869 + /** 8870 + * @deprecated AutoRAG has been replaced by AI Search. 8871 + * Use AiSearchSearchRequest with the new API instead. 8872 + * @see AiSearchSearchRequest 8873 + */ 8874 + type AutoRagSearchRequest = { 8875 + query: string; 8876 + filters?: CompoundFilter | ComparisonFilter; 8877 + max_num_results?: number; 8878 + ranking_options?: { 8879 + ranker?: string; 8880 + score_threshold?: number; 8881 + }; 8882 + reranking?: { 8883 + enabled?: boolean; 8884 + model?: string; 8885 + }; 8886 + rewrite_query?: boolean; 8887 + }; 8888 + /** 8889 + * @deprecated AutoRAG has been replaced by AI Search. 8890 + * Use AiSearchChatCompletionsRequest with the new API instead. 8891 + * @see AiSearchChatCompletionsRequest 8892 + */ 8893 + type AutoRagAiSearchRequest = AutoRagSearchRequest & { 8894 + stream?: boolean; 8895 + system_prompt?: string; 8896 + }; 8897 + /** 8898 + * @deprecated AutoRAG has been replaced by AI Search. 8899 + * Use AiSearchChatCompletionsRequest with stream: true instead. 8900 + * @see AiSearchChatCompletionsRequest 8901 + */ 8902 + type AutoRagAiSearchRequestStreaming = Omit<AutoRagAiSearchRequest, 'stream'> & { 8903 + stream: true; 8904 + }; 8905 + /** 8906 + * @deprecated AutoRAG has been replaced by AI Search. 8907 + * Use AiSearchSearchResponse with the new API instead. 8908 + * @see AiSearchSearchResponse 8909 + */ 8910 + type AutoRagSearchResponse = { 8911 + object: 'vector_store.search_results.page'; 8912 + search_query: string; 8913 + data: { 8914 + file_id: string; 8915 + filename: string; 8916 + score: number; 8917 + attributes: Record<string, string | number | boolean | null>; 8918 + content: { 8919 + type: 'text'; 8920 + text: string; 8921 + }[]; 8922 + }[]; 8923 + has_more: boolean; 8924 + next_page: string | null; 8925 + }; 8926 + /** 8927 + * @deprecated AutoRAG has been replaced by AI Search. 8928 + * Use AiSearchListResponse with the new API instead. 8929 + * @see AiSearchListResponse 8930 + */ 8931 + type AutoRagListResponse = { 8932 + id: string; 8933 + enable: boolean; 8934 + type: string; 8935 + source: string; 8936 + vectorize_name: string; 8937 + paused: boolean; 8938 + status: string; 8939 + }[]; 8940 + /** 8941 + * @deprecated AutoRAG has been replaced by AI Search. 8942 + * The new API returns different response formats for chat completions. 8943 + */ 8944 + type AutoRagAiSearchResponse = AutoRagSearchResponse & { 8945 + response: string; 8946 + }; 8947 + /** 8948 + * @deprecated AutoRAG has been replaced by AI Search. 8949 + * Use the new AI Search API instead: `env.AI.aiSearch` 8950 + * 8951 + * Migration guide: 8952 + * - `env.AI.autorag().list()` → `env.AI.aiSearch.list()` 8953 + * - `env.AI.autorag('id').search(...)` → `env.AI.aiSearch.get('id').search(...)` 8954 + * - `env.AI.autorag('id').aiSearch(...)` → `env.AI.aiSearch.get('id').chatCompletions(...)` 8955 + * 8956 + * @see AiSearchAccountService 8957 + * @see AiSearchInstanceService 8958 + */ 8959 + declare abstract class AutoRAG { 8960 + /** 8961 + * @deprecated Use `env.AI.aiSearch.list()` instead. 8962 + * @see AiSearchAccountService.list 8963 + */ 8964 + list(): Promise<AutoRagListResponse>; 8965 + /** 8966 + * @deprecated Use `env.AI.aiSearch.get(id).search(...)` instead. 8967 + * Note: The new API uses a messages array instead of a query string. 8968 + * @see AiSearchInstanceService.search 8969 + */ 8970 + search(params: AutoRagSearchRequest): Promise<AutoRagSearchResponse>; 8971 + /** 8972 + * @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead. 8973 + * @see AiSearchInstanceService.chatCompletions 8974 + */ 8975 + aiSearch(params: AutoRagAiSearchRequestStreaming): Promise<Response>; 8976 + /** 8977 + * @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead. 8978 + * @see AiSearchInstanceService.chatCompletions 8979 + */ 8980 + aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse>; 8981 + /** 8982 + * @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead. 8983 + * @see AiSearchInstanceService.chatCompletions 8984 + */ 8985 + aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse | Response>; 8986 + } 8987 + interface BasicImageTransformations { 8988 + /** 8989 + * Maximum width in image pixels. The value must be an integer. 8990 + */ 8991 + width?: number; 8992 + /** 8993 + * Maximum height in image pixels. The value must be an integer. 8994 + */ 8995 + height?: number; 8996 + /** 8997 + * Resizing mode as a string. It affects interpretation of width and height 8998 + * options: 8999 + * - scale-down: Similar to contain, but the image is never enlarged. If 9000 + * the image is larger than given width or height, it will be resized. 9001 + * Otherwise its original size will be kept. 9002 + * - contain: Resizes to maximum size that fits within the given width and 9003 + * height. If only a single dimension is given (e.g. only width), the 9004 + * image will be shrunk or enlarged to exactly match that dimension. 9005 + * Aspect ratio is always preserved. 9006 + * - cover: Resizes (shrinks or enlarges) to fill the entire area of width 9007 + * and height. If the image has an aspect ratio different from the ratio 9008 + * of width and height, it will be cropped to fit. 9009 + * - crop: The image will be shrunk and cropped to fit within the area 9010 + * specified by width and height. The image will not be enlarged. For images 9011 + * smaller than the given dimensions it's the same as scale-down. For 9012 + * images larger than the given dimensions, it's the same as cover. 9013 + * See also trim. 9014 + * - pad: Resizes to the maximum size that fits within the given width and 9015 + * height, and then fills the remaining area with a background color 9016 + * (white by default). Use of this mode is not recommended, as the same 9017 + * effect can be more efficiently achieved with the contain mode and the 9018 + * CSS object-fit: contain property. 9019 + * - squeeze: Stretches and deforms to the width and height given, even if it 9020 + * breaks aspect ratio 9021 + */ 9022 + fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze"; 9023 + /** 9024 + * Image segmentation using artificial intelligence models. Sets pixels not 9025 + * within selected segment area to transparent e.g "foreground" sets every 9026 + * background pixel as transparent. 9027 + */ 9028 + segment?: "foreground"; 9029 + /** 9030 + * When cropping with fit: "cover", this defines the side or point that should 9031 + * be left uncropped. The value is either a string 9032 + * "left", "right", "top", "bottom", "auto", or "center" (the default), 9033 + * or an object {x, y} containing focal point coordinates in the original 9034 + * image expressed as fractions ranging from 0.0 (top or left) to 1.0 9035 + * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will 9036 + * crop bottom or left and right sides as necessary, but won’t crop anything 9037 + * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to 9038 + * preserve as much as possible around a point at 20% of the height of the 9039 + * source image. 9040 + */ 9041 + gravity?: 'face' | 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | BasicImageTransformationsGravityCoordinates; 9042 + /** 9043 + * Background color to add underneath the image. Applies only to images with 9044 + * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…), 9045 + * hsl(…), etc.) 9046 + */ 9047 + background?: string; 9048 + /** 9049 + * Number of degrees (90, 180, 270) to rotate the image by. width and height 9050 + * options refer to axes after rotation. 9051 + */ 9052 + rotate?: 0 | 90 | 180 | 270 | 360; 9053 + } 9054 + interface BasicImageTransformationsGravityCoordinates { 9055 + x?: number; 9056 + y?: number; 9057 + mode?: 'remainder' | 'box-center'; 9058 + } 9059 + /** 9060 + * In addition to the properties you can set in the RequestInit dict 9061 + * that you pass as an argument to the Request constructor, you can 9062 + * set certain properties of a `cf` object to control how Cloudflare 9063 + * features are applied to that new Request. 9064 + * 9065 + * Note: Currently, these properties cannot be tested in the 9066 + * playground. 9067 + */ 9068 + interface RequestInitCfProperties extends Record<string, unknown> { 9069 + cacheEverything?: boolean; 9070 + /** 9071 + * A request's cache key is what determines if two requests are 9072 + * "the same" for caching purposes. If a request has the same cache key 9073 + * as some previous request, then we can serve the same cached response for 9074 + * both. (e.g. 'some-key') 9075 + * 9076 + * Only available for Enterprise customers. 9077 + */ 9078 + cacheKey?: string; 9079 + /** 9080 + * This allows you to append additional Cache-Tag response headers 9081 + * to the origin response without modifications to the origin server. 9082 + * This will allow for greater control over the Purge by Cache Tag feature 9083 + * utilizing changes only in the Workers process. 9084 + * 9085 + * Only available for Enterprise customers. 9086 + */ 9087 + cacheTags?: string[]; 9088 + /** 9089 + * Force response to be cached for a given number of seconds. (e.g. 300) 9090 + */ 9091 + cacheTtl?: number; 9092 + /** 9093 + * Force response to be cached for a given number of seconds based on the Origin status code. 9094 + * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 }) 9095 + */ 9096 + cacheTtlByStatus?: Record<string, number>; 9097 + scrapeShield?: boolean; 9098 + apps?: boolean; 9099 + image?: RequestInitCfPropertiesImage; 9100 + minify?: RequestInitCfPropertiesImageMinify; 9101 + mirage?: boolean; 9102 + polish?: "lossy" | "lossless" | "off"; 9103 + r2?: RequestInitCfPropertiesR2; 9104 + /** 9105 + * Redirects the request to an alternate origin server. You can use this, 9106 + * for example, to implement load balancing across several origins. 9107 + * (e.g.us-east.example.com) 9108 + * 9109 + * Note - For security reasons, the hostname set in resolveOverride must 9110 + * be proxied on the same Cloudflare zone of the incoming request. 9111 + * Otherwise, the setting is ignored. CNAME hosts are allowed, so to 9112 + * resolve to a host under a different domain or a DNS only domain first 9113 + * declare a CNAME record within your own zone’s DNS mapping to the 9114 + * external hostname, set proxy on Cloudflare, then set resolveOverride 9115 + * to point to that CNAME record. 9116 + */ 9117 + resolveOverride?: string; 9118 + } 9119 + interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations { 9120 + /** 9121 + * Absolute URL of the image file to use for the drawing. It can be any of 9122 + * the supported file formats. For drawing of watermarks or non-rectangular 9123 + * overlays we recommend using PNG or WebP images. 9124 + */ 9125 + url: string; 9126 + /** 9127 + * Floating-point number between 0 (transparent) and 1 (opaque). 9128 + * For example, opacity: 0.5 makes overlay semitransparent. 9129 + */ 9130 + opacity?: number; 9131 + /** 9132 + * - If set to true, the overlay image will be tiled to cover the entire 9133 + * area. This is useful for stock-photo-like watermarks. 9134 + * - If set to "x", the overlay image will be tiled horizontally only 9135 + * (form a line). 9136 + * - If set to "y", the overlay image will be tiled vertically only 9137 + * (form a line). 9138 + */ 9139 + repeat?: true | "x" | "y"; 9140 + /** 9141 + * Position of the overlay image relative to a given edge. Each property is 9142 + * an offset in pixels. 0 aligns exactly to the edge. For example, left: 10 9143 + * positions left side of the overlay 10 pixels from the left edge of the 9144 + * image it's drawn over. bottom: 0 aligns bottom of the overlay with bottom 9145 + * of the background image. 9146 + * 9147 + * Setting both left & right, or both top & bottom is an error. 9148 + * 9149 + * If no position is specified, the image will be centered. 9150 + */ 9151 + top?: number; 9152 + left?: number; 9153 + bottom?: number; 9154 + right?: number; 9155 + } 9156 + interface RequestInitCfPropertiesImage extends BasicImageTransformations { 9157 + /** 9158 + * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it 9159 + * easier to specify higher-DPI sizes in <img srcset>. 9160 + */ 9161 + dpr?: number; 9162 + /** 9163 + * Allows you to trim your image. Takes dpr into account and is performed before 9164 + * resizing or rotation. 9165 + * 9166 + * It can be used as: 9167 + * - left, top, right, bottom - it will specify the number of pixels to cut 9168 + * off each side 9169 + * - width, height - the width/height you'd like to end up with - can be used 9170 + * in combination with the properties above 9171 + * - border - this will automatically trim the surroundings of an image based on 9172 + * it's color. It consists of three properties: 9173 + * - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit) 9174 + * - tolerance: difference from color to treat as color 9175 + * - keep: the number of pixels of border to keep 9176 + */ 9177 + trim?: "border" | { 9178 + top?: number; 9179 + bottom?: number; 9180 + left?: number; 9181 + right?: number; 9182 + width?: number; 9183 + height?: number; 9184 + border?: boolean | { 9185 + color?: string; 9186 + tolerance?: number; 9187 + keep?: number; 9188 + }; 9189 + }; 9190 + /** 9191 + * Quality setting from 1-100 (useful values are in 60-90 range). Lower values 9192 + * make images look worse, but load faster. The default is 85. It applies only 9193 + * to JPEG and WebP images. It doesn’t have any effect on PNG. 9194 + */ 9195 + quality?: number | "low" | "medium-low" | "medium-high" | "high"; 9196 + /** 9197 + * Output format to generate. It can be: 9198 + * - avif: generate images in AVIF format. 9199 + * - webp: generate images in Google WebP format. Set quality to 100 to get 9200 + * the WebP-lossless format. 9201 + * - json: instead of generating an image, outputs information about the 9202 + * image, in JSON format. The JSON object will contain image size 9203 + * (before and after resizing), source image’s MIME type, file size, etc. 9204 + * - jpeg: generate images in JPEG format. 9205 + * - png: generate images in PNG format. 9206 + */ 9207 + format?: "avif" | "webp" | "json" | "jpeg" | "png" | "baseline-jpeg" | "png-force" | "svg"; 9208 + /** 9209 + * Whether to preserve animation frames from input files. Default is true. 9210 + * Setting it to false reduces animations to still images. This setting is 9211 + * recommended when enlarging images or processing arbitrary user content, 9212 + * because large GIF animations can weigh tens or even hundreds of megabytes. 9213 + * It is also useful to set anim:false when using format:"json" to get the 9214 + * response quicker without the number of frames. 9215 + */ 9216 + anim?: boolean; 9217 + /** 9218 + * What EXIF data should be preserved in the output image. Note that EXIF 9219 + * rotation and embedded color profiles are always applied ("baked in" into 9220 + * the image), and aren't affected by this option. Note that if the Polish 9221 + * feature is enabled, all metadata may have been removed already and this 9222 + * option may have no effect. 9223 + * - keep: Preserve most of EXIF metadata, including GPS location if there's 9224 + * any. 9225 + * - copyright: Only keep the copyright tag, and discard everything else. 9226 + * This is the default behavior for JPEG files. 9227 + * - none: Discard all invisible EXIF metadata. Currently WebP and PNG 9228 + * output formats always discard metadata. 9229 + */ 9230 + metadata?: "keep" | "copyright" | "none"; 9231 + /** 9232 + * Strength of sharpening filter to apply to the image. Floating-point 9233 + * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a 9234 + * recommended value for downscaled images. 9235 + */ 9236 + sharpen?: number; 9237 + /** 9238 + * Radius of a blur filter (approximate gaussian). Maximum supported radius 9239 + * is 250. 9240 + */ 9241 + blur?: number; 9242 + /** 9243 + * Overlays are drawn in the order they appear in the array (last array 9244 + * entry is the topmost layer). 9245 + */ 9246 + draw?: RequestInitCfPropertiesImageDraw[]; 9247 + /** 9248 + * Fetching image from authenticated origin. Setting this property will 9249 + * pass authentication headers (Authorization, Cookie, etc.) through to 9250 + * the origin. 9251 + */ 9252 + "origin-auth"?: "share-publicly"; 9253 + /** 9254 + * Adds a border around the image. The border is added after resizing. Border 9255 + * width takes dpr into account, and can be specified either using a single 9256 + * width property, or individually for each side. 9257 + */ 9258 + border?: { 9259 + color: string; 9260 + width: number; 9261 + } | { 9262 + color: string; 9263 + top: number; 9264 + right: number; 9265 + bottom: number; 9266 + left: number; 9267 + }; 9268 + /** 9269 + * Increase brightness by a factor. A value of 1.0 equals no change, a value 9270 + * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright. 9271 + * 0 is ignored. 9272 + */ 9273 + brightness?: number; 9274 + /** 9275 + * Increase contrast by a factor. A value of 1.0 equals no change, a value of 9276 + * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is 9277 + * ignored. 9278 + */ 9279 + contrast?: number; 9280 + /** 9281 + * Increase exposure by a factor. A value of 1.0 equals no change, a value of 9282 + * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored. 9283 + */ 9284 + gamma?: number; 9285 + /** 9286 + * Increase contrast by a factor. A value of 1.0 equals no change, a value of 9287 + * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is 9288 + * ignored. 9289 + */ 9290 + saturation?: number; 9291 + /** 9292 + * Flips the images horizontally, vertically, or both. Flipping is applied before 9293 + * rotation, so if you apply flip=h,rotate=90 then the image will be flipped 9294 + * horizontally, then rotated by 90 degrees. 9295 + */ 9296 + flip?: 'h' | 'v' | 'hv'; 9297 + /** 9298 + * Slightly reduces latency on a cache miss by selecting a 9299 + * quickest-to-compress file format, at a cost of increased file size and 9300 + * lower image quality. It will usually override the format option and choose 9301 + * JPEG over WebP or AVIF. We do not recommend using this option, except in 9302 + * unusual circumstances like resizing uncacheable dynamically-generated 9303 + * images. 9304 + */ 9305 + compression?: "fast"; 9306 + } 9307 + interface RequestInitCfPropertiesImageMinify { 9308 + javascript?: boolean; 9309 + css?: boolean; 9310 + html?: boolean; 9311 + } 9312 + interface RequestInitCfPropertiesR2 { 9313 + /** 9314 + * Colo id of bucket that an object is stored in 9315 + */ 9316 + bucketColoId?: number; 9317 + } 9318 + /** 9319 + * Request metadata provided by Cloudflare's edge. 9320 + */ 9321 + type IncomingRequestCfProperties<HostMetadata = unknown> = IncomingRequestCfPropertiesBase & IncomingRequestCfPropertiesBotManagementEnterprise & IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> & IncomingRequestCfPropertiesGeographicInformation & IncomingRequestCfPropertiesCloudflareAccessOrApiShield; 9322 + interface IncomingRequestCfPropertiesBase extends Record<string, unknown> { 9323 + /** 9324 + * [ASN](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) of the incoming request. 9325 + * 9326 + * @example 395747 9327 + */ 9328 + asn?: number; 9329 + /** 9330 + * The organization which owns the ASN of the incoming request. 9331 + * 9332 + * @example "Google Cloud" 9333 + */ 9334 + asOrganization?: string; 9335 + /** 9336 + * The original value of the `Accept-Encoding` header if Cloudflare modified it. 9337 + * 9338 + * @example "gzip, deflate, br" 9339 + */ 9340 + clientAcceptEncoding?: string; 9341 + /** 9342 + * The number of milliseconds it took for the request to reach your worker. 9343 + * 9344 + * @example 22 9345 + */ 9346 + clientTcpRtt?: number; 9347 + /** 9348 + * The three-letter [IATA](https://en.wikipedia.org/wiki/IATA_airport_code) 9349 + * airport code of the data center that the request hit. 9350 + * 9351 + * @example "DFW" 9352 + */ 9353 + colo: string; 9354 + /** 9355 + * Represents the upstream's response to a 9356 + * [TCP `keepalive` message](https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html) 9357 + * from cloudflare. 9358 + * 9359 + * For workers with no upstream, this will always be `1`. 9360 + * 9361 + * @example 3 9362 + */ 9363 + edgeRequestKeepAliveStatus: IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus; 9364 + /** 9365 + * The HTTP Protocol the request used. 9366 + * 9367 + * @example "HTTP/2" 9368 + */ 9369 + httpProtocol: string; 9370 + /** 9371 + * The browser-requested prioritization information in the request object. 9372 + * 9373 + * If no information was set, defaults to the empty string `""` 9374 + * 9375 + * @example "weight=192;exclusive=0;group=3;group-weight=127" 9376 + * @default "" 9377 + */ 9378 + requestPriority: string; 9379 + /** 9380 + * The TLS version of the connection to Cloudflare. 9381 + * In requests served over plaintext (without TLS), this property is the empty string `""`. 9382 + * 9383 + * @example "TLSv1.3" 9384 + */ 9385 + tlsVersion: string; 9386 + /** 9387 + * The cipher for the connection to Cloudflare. 9388 + * In requests served over plaintext (without TLS), this property is the empty string `""`. 9389 + * 9390 + * @example "AEAD-AES128-GCM-SHA256" 9391 + */ 9392 + tlsCipher: string; 9393 + /** 9394 + * Metadata containing the [`HELLO`](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2) and [`FINISHED`](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9) messages from this request's TLS handshake. 9395 + * 9396 + * If the incoming request was served over plaintext (without TLS) this field is undefined. 9397 + */ 9398 + tlsExportedAuthenticator?: IncomingRequestCfPropertiesExportedAuthenticatorMetadata; 9399 + } 9400 + interface IncomingRequestCfPropertiesBotManagementBase { 9401 + /** 9402 + * Cloudflare’s [level of certainty](https://developers.cloudflare.com/bots/concepts/bot-score/) that a request comes from a bot, 9403 + * represented as an integer percentage between `1` (almost certainly a bot) and `99` (almost certainly human). 9404 + * 9405 + * @example 54 9406 + */ 9407 + score: number; 9408 + /** 9409 + * A boolean value that is true if the request comes from a good bot, like Google or Bing. 9410 + * Most customers choose to allow this traffic. For more details, see [Traffic from known bots](https://developers.cloudflare.com/firewall/known-issues-and-faq/#how-does-firewall-rules-handle-traffic-from-known-bots). 9411 + */ 9412 + verifiedBot: boolean; 9413 + /** 9414 + * A boolean value that is true if the request originates from a 9415 + * Cloudflare-verified proxy service. 9416 + */ 9417 + corporateProxy: boolean; 9418 + /** 9419 + * A boolean value that's true if the request matches [file extensions](https://developers.cloudflare.com/bots/reference/static-resources/) for many types of static resources. 9420 + */ 9421 + staticResource: boolean; 9422 + /** 9423 + * List of IDs that correlate to the Bot Management heuristic detections made on a request (you can have multiple heuristic detections on the same request). 9424 + */ 9425 + detectionIds: number[]; 9426 + } 9427 + interface IncomingRequestCfPropertiesBotManagement { 9428 + /** 9429 + * Results of Cloudflare's Bot Management analysis 9430 + */ 9431 + botManagement: IncomingRequestCfPropertiesBotManagementBase; 9432 + /** 9433 + * Duplicate of `botManagement.score`. 9434 + * 9435 + * @deprecated 9436 + */ 9437 + clientTrustScore: number; 9438 + } 9439 + interface IncomingRequestCfPropertiesBotManagementEnterprise extends IncomingRequestCfPropertiesBotManagement { 9440 + /** 9441 + * Results of Cloudflare's Bot Management analysis 9442 + */ 9443 + botManagement: IncomingRequestCfPropertiesBotManagementBase & { 9444 + /** 9445 + * A [JA3 Fingerprint](https://developers.cloudflare.com/bots/concepts/ja3-fingerprint/) to help profile specific SSL/TLS clients 9446 + * across different destination IPs, Ports, and X509 certificates. 9447 + */ 9448 + ja3Hash: string; 9449 + }; 9450 + } 9451 + interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> { 9452 + /** 9453 + * Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/). 9454 + * 9455 + * This field is only present if you have Cloudflare for SaaS enabled on your account 9456 + * and you have followed the [required steps to enable it]((https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/)). 9457 + */ 9458 + hostMetadata?: HostMetadata; 9459 + } 9460 + interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield { 9461 + /** 9462 + * Information about the client certificate presented to Cloudflare. 9463 + * 9464 + * This is populated when the incoming request is served over TLS using 9465 + * either Cloudflare Access or API Shield (mTLS) 9466 + * and the presented SSL certificate has a valid 9467 + * [Certificate Serial Number](https://ldapwiki.com/wiki/Certificate%20Serial%20Number) 9468 + * (i.e., not `null` or `""`). 9469 + * 9470 + * Otherwise, a set of placeholder values are used. 9471 + * 9472 + * The property `certPresented` will be set to `"1"` when 9473 + * the object is populated (i.e. the above conditions were met). 9474 + */ 9475 + tlsClientAuth: IncomingRequestCfPropertiesTLSClientAuth | IncomingRequestCfPropertiesTLSClientAuthPlaceholder; 9476 + } 9477 + /** 9478 + * Metadata about the request's TLS handshake 9479 + */ 9480 + interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata { 9481 + /** 9482 + * The client's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal 9483 + * 9484 + * @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d" 9485 + */ 9486 + clientHandshake: string; 9487 + /** 9488 + * The server's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal 9489 + * 9490 + * @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d" 9491 + */ 9492 + serverHandshake: string; 9493 + /** 9494 + * The client's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal 9495 + * 9496 + * @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b" 9497 + */ 9498 + clientFinished: string; 9499 + /** 9500 + * The server's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal 9501 + * 9502 + * @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b" 9503 + */ 9504 + serverFinished: string; 9505 + } 9506 + /** 9507 + * Geographic data about the request's origin. 9508 + */ 9509 + interface IncomingRequestCfPropertiesGeographicInformation { 9510 + /** 9511 + * The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from. 9512 + * 9513 + * If your worker is [configured to accept TOR connections](https://support.cloudflare.com/hc/en-us/articles/203306930-Understanding-Cloudflare-Tor-support-and-Onion-Routing), this may also be `"T1"`, indicating a request that originated over TOR. 9514 + * 9515 + * If Cloudflare is unable to determine where the request originated this property is omitted. 9516 + * 9517 + * The country code `"T1"` is used for requests originating on TOR. 9518 + * 9519 + * @example "GB" 9520 + */ 9521 + country?: Iso3166Alpha2Code | "T1"; 9522 + /** 9523 + * If present, this property indicates that the request originated in the EU 9524 + * 9525 + * @example "1" 9526 + */ 9527 + isEUCountry?: "1"; 9528 + /** 9529 + * A two-letter code indicating the continent the request originated from. 9530 + * 9531 + * @example "AN" 9532 + */ 9533 + continent?: ContinentCode; 9534 + /** 9535 + * The city the request originated from 9536 + * 9537 + * @example "Austin" 9538 + */ 9539 + city?: string; 9540 + /** 9541 + * Postal code of the incoming request 9542 + * 9543 + * @example "78701" 9544 + */ 9545 + postalCode?: string; 9546 + /** 9547 + * Latitude of the incoming request 9548 + * 9549 + * @example "30.27130" 9550 + */ 9551 + latitude?: string; 9552 + /** 9553 + * Longitude of the incoming request 9554 + * 9555 + * @example "-97.74260" 9556 + */ 9557 + longitude?: string; 9558 + /** 9559 + * Timezone of the incoming request 9560 + * 9561 + * @example "America/Chicago" 9562 + */ 9563 + timezone?: string; 9564 + /** 9565 + * If known, the ISO 3166-2 name for the first level region associated with 9566 + * the IP address of the incoming request 9567 + * 9568 + * @example "Texas" 9569 + */ 9570 + region?: string; 9571 + /** 9572 + * If known, the ISO 3166-2 code for the first-level region associated with 9573 + * the IP address of the incoming request 9574 + * 9575 + * @example "TX" 9576 + */ 9577 + regionCode?: string; 9578 + /** 9579 + * Metro code (DMA) of the incoming request 9580 + * 9581 + * @example "635" 9582 + */ 9583 + metroCode?: string; 9584 + } 9585 + /** Data about the incoming request's TLS certificate */ 9586 + interface IncomingRequestCfPropertiesTLSClientAuth { 9587 + /** Always `"1"`, indicating that the certificate was presented */ 9588 + certPresented: "1"; 9589 + /** 9590 + * Result of certificate verification. 9591 + * 9592 + * @example "FAILED:self signed certificate" 9593 + */ 9594 + certVerified: Exclude<CertVerificationStatus, "NONE">; 9595 + /** The presented certificate's revokation status. 9596 + * 9597 + * - A value of `"1"` indicates the certificate has been revoked 9598 + * - A value of `"0"` indicates the certificate has not been revoked 9599 + */ 9600 + certRevoked: "1" | "0"; 9601 + /** 9602 + * The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) 9603 + * 9604 + * @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare" 9605 + */ 9606 + certIssuerDN: string; 9607 + /** 9608 + * The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) 9609 + * 9610 + * @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare" 9611 + */ 9612 + certSubjectDN: string; 9613 + /** 9614 + * The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted) 9615 + * 9616 + * @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare" 9617 + */ 9618 + certIssuerDNRFC2253: string; 9619 + /** 9620 + * The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted) 9621 + * 9622 + * @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare" 9623 + */ 9624 + certSubjectDNRFC2253: string; 9625 + /** The certificate issuer's distinguished name (legacy policies) */ 9626 + certIssuerDNLegacy: string; 9627 + /** The certificate subject's distinguished name (legacy policies) */ 9628 + certSubjectDNLegacy: string; 9629 + /** 9630 + * The certificate's serial number 9631 + * 9632 + * @example "00936EACBE07F201DF" 9633 + */ 9634 + certSerial: string; 9635 + /** 9636 + * The certificate issuer's serial number 9637 + * 9638 + * @example "2489002934BDFEA34" 9639 + */ 9640 + certIssuerSerial: string; 9641 + /** 9642 + * The certificate's Subject Key Identifier 9643 + * 9644 + * @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4" 9645 + */ 9646 + certSKI: string; 9647 + /** 9648 + * The certificate issuer's Subject Key Identifier 9649 + * 9650 + * @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4" 9651 + */ 9652 + certIssuerSKI: string; 9653 + /** 9654 + * The certificate's SHA-1 fingerprint 9655 + * 9656 + * @example "6b9109f323999e52259cda7373ff0b4d26bd232e" 9657 + */ 9658 + certFingerprintSHA1: string; 9659 + /** 9660 + * The certificate's SHA-256 fingerprint 9661 + * 9662 + * @example "acf77cf37b4156a2708e34c4eb755f9b5dbbe5ebb55adfec8f11493438d19e6ad3f157f81fa3b98278453d5652b0c1fd1d71e5695ae4d709803a4d3f39de9dea" 9663 + */ 9664 + certFingerprintSHA256: string; 9665 + /** 9666 + * The effective starting date of the certificate 9667 + * 9668 + * @example "Dec 22 19:39:00 2018 GMT" 9669 + */ 9670 + certNotBefore: string; 9671 + /** 9672 + * The effective expiration date of the certificate 9673 + * 9674 + * @example "Dec 22 19:39:00 2018 GMT" 9675 + */ 9676 + certNotAfter: string; 9677 + } 9678 + /** Placeholder values for TLS Client Authorization */ 9679 + interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder { 9680 + certPresented: "0"; 9681 + certVerified: "NONE"; 9682 + certRevoked: "0"; 9683 + certIssuerDN: ""; 9684 + certSubjectDN: ""; 9685 + certIssuerDNRFC2253: ""; 9686 + certSubjectDNRFC2253: ""; 9687 + certIssuerDNLegacy: ""; 9688 + certSubjectDNLegacy: ""; 9689 + certSerial: ""; 9690 + certIssuerSerial: ""; 9691 + certSKI: ""; 9692 + certIssuerSKI: ""; 9693 + certFingerprintSHA1: ""; 9694 + certFingerprintSHA256: ""; 9695 + certNotBefore: ""; 9696 + certNotAfter: ""; 9697 + } 9698 + /** Possible outcomes of TLS verification */ 9699 + declare type CertVerificationStatus = 9700 + /** Authentication succeeded */ 9701 + "SUCCESS" 9702 + /** No certificate was presented */ 9703 + | "NONE" 9704 + /** Failed because the certificate was self-signed */ 9705 + | "FAILED:self signed certificate" 9706 + /** Failed because the certificate failed a trust chain check */ 9707 + | "FAILED:unable to verify the first certificate" 9708 + /** Failed because the certificate not yet valid */ 9709 + | "FAILED:certificate is not yet valid" 9710 + /** Failed because the certificate is expired */ 9711 + | "FAILED:certificate has expired" 9712 + /** Failed for another unspecified reason */ 9713 + | "FAILED"; 9714 + /** 9715 + * An upstream endpoint's response to a TCP `keepalive` message from Cloudflare. 9716 + */ 9717 + declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus = 0 /** Unknown */ | 1 /** no keepalives (not found) */ | 2 /** no connection re-use, opening keepalive connection failed */ | 3 /** no connection re-use, keepalive accepted and saved */ | 4 /** connection re-use, refused by the origin server (`TCP FIN`) */ | 5; /** connection re-use, accepted by the origin server */ 9718 + /** ISO 3166-1 Alpha-2 codes */ 9719 + declare type Iso3166Alpha2Code = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW"; 9720 + /** The 2-letter continent codes Cloudflare uses */ 9721 + declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA"; 9722 + type CfProperties<HostMetadata = unknown> = IncomingRequestCfProperties<HostMetadata> | RequestInitCfProperties; 9723 + interface D1Meta { 9724 + duration: number; 9725 + size_after: number; 9726 + rows_read: number; 9727 + rows_written: number; 9728 + last_row_id: number; 9729 + changed_db: boolean; 9730 + changes: number; 9731 + /** 9732 + * The region of the database instance that executed the query. 9733 + */ 9734 + served_by_region?: string; 9735 + /** 9736 + * The three letters airport code of the colo that executed the query. 9737 + */ 9738 + served_by_colo?: string; 9739 + /** 9740 + * True if-and-only-if the database instance that executed the query was the primary. 9741 + */ 9742 + served_by_primary?: boolean; 9743 + timings?: { 9744 + /** 9745 + * The duration of the SQL query execution by the database instance. It doesn't include any network time. 9746 + */ 9747 + sql_duration_ms: number; 9748 + }; 9749 + /** 9750 + * Number of total attempts to execute the query, due to automatic retries. 9751 + * Note: All other fields in the response like `timings` only apply to the last attempt. 9752 + */ 9753 + total_attempts?: number; 9754 + } 9755 + interface D1Response { 9756 + success: true; 9757 + meta: D1Meta & Record<string, unknown>; 9758 + error?: never; 9759 + } 9760 + type D1Result<T = unknown> = D1Response & { 9761 + results: T[]; 9762 + }; 9763 + interface D1ExecResult { 9764 + count: number; 9765 + duration: number; 9766 + } 9767 + type D1SessionConstraint = 9768 + // Indicates that the first query should go to the primary, and the rest queries 9769 + // using the same D1DatabaseSession will go to any replica that is consistent with 9770 + // the bookmark maintained by the session (returned by the first query). 9771 + 'first-primary' 9772 + // Indicates that the first query can go anywhere (primary or replica), and the rest queries 9773 + // using the same D1DatabaseSession will go to any replica that is consistent with 9774 + // the bookmark maintained by the session (returned by the first query). 9775 + | 'first-unconstrained'; 9776 + type D1SessionBookmark = string; 9777 + declare abstract class D1Database { 9778 + prepare(query: string): D1PreparedStatement; 9779 + batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>; 9780 + exec(query: string): Promise<D1ExecResult>; 9781 + /** 9782 + * Creates a new D1 Session anchored at the given constraint or the bookmark. 9783 + * All queries executed using the created session will have sequential consistency, 9784 + * meaning that all writes done through the session will be visible in subsequent reads. 9785 + * 9786 + * @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session. 9787 + */ 9788 + withSession(constraintOrBookmark?: D1SessionBookmark | D1SessionConstraint): D1DatabaseSession; 9789 + /** 9790 + * @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases. 9791 + */ 9792 + dump(): Promise<ArrayBuffer>; 9793 + } 9794 + declare abstract class D1DatabaseSession { 9795 + prepare(query: string): D1PreparedStatement; 9796 + batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>; 9797 + /** 9798 + * @returns The latest session bookmark across all executed queries on the session. 9799 + * If no query has been executed yet, `null` is returned. 9800 + */ 9801 + getBookmark(): D1SessionBookmark | null; 9802 + } 9803 + declare abstract class D1PreparedStatement { 9804 + bind(...values: unknown[]): D1PreparedStatement; 9805 + first<T = unknown>(colName: string): Promise<T | null>; 9806 + first<T = Record<string, unknown>>(): Promise<T | null>; 9807 + run<T = Record<string, unknown>>(): Promise<D1Result<T>>; 9808 + all<T = Record<string, unknown>>(): Promise<D1Result<T>>; 9809 + raw<T = unknown[]>(options: { 9810 + columnNames: true; 9811 + }): Promise<[ 9812 + string[], 9813 + ...T[] 9814 + ]>; 9815 + raw<T = unknown[]>(options?: { 9816 + columnNames?: false; 9817 + }): Promise<T[]>; 9818 + } 9819 + // `Disposable` was added to TypeScript's standard lib types in version 5.2. 9820 + // To support older TypeScript versions, define an empty `Disposable` interface. 9821 + // Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2, 9822 + // but this will ensure type checking on older versions still passes. 9823 + // TypeScript's interface merging will ensure our empty interface is effectively 9824 + // ignored when `Disposable` is included in the standard lib. 9825 + interface Disposable { 9826 + } 9827 + /** 9828 + * The returned data after sending an email 9829 + */ 9830 + interface EmailSendResult { 9831 + /** 9832 + * The Email Message ID 9833 + */ 9834 + messageId: string; 9835 + } 9836 + /** 9837 + * An email message that can be sent from a Worker. 9838 + */ 9839 + interface EmailMessage { 9840 + /** 9841 + * Envelope From attribute of the email message. 9842 + */ 9843 + readonly from: string; 9844 + /** 9845 + * Envelope To attribute of the email message. 9846 + */ 9847 + readonly to: string; 9848 + } 9849 + /** 9850 + * An email message that is sent to a consumer Worker and can be rejected/forwarded. 9851 + */ 9852 + interface ForwardableEmailMessage extends EmailMessage { 9853 + /** 9854 + * Stream of the email message content. 9855 + */ 9856 + readonly raw: ReadableStream<Uint8Array>; 9857 + /** 9858 + * An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers). 9859 + */ 9860 + readonly headers: Headers; 9861 + /** 9862 + * Size of the email message content. 9863 + */ 9864 + readonly rawSize: number; 9865 + /** 9866 + * Reject this email message by returning a permanent SMTP error back to the connecting client including the given reason. 9867 + * @param reason The reject reason. 9868 + * @returns void 9869 + */ 9870 + setReject(reason: string): void; 9871 + /** 9872 + * Forward this email message to a verified destination address of the account. 9873 + * @param rcptTo Verified destination address. 9874 + * @param headers A [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers). 9875 + * @returns A promise that resolves when the email message is forwarded. 9876 + */ 9877 + forward(rcptTo: string, headers?: Headers): Promise<EmailSendResult>; 9878 + /** 9879 + * Reply to the sender of this email message with a new EmailMessage object. 9880 + * @param message The reply message. 9881 + * @returns A promise that resolves when the email message is replied. 9882 + */ 9883 + reply(message: EmailMessage): Promise<EmailSendResult>; 9884 + } 9885 + /** A file attachment for an email message */ 9886 + type EmailAttachment = { 9887 + disposition: 'inline'; 9888 + contentId: string; 9889 + filename: string; 9890 + type: string; 9891 + content: string | ArrayBuffer | ArrayBufferView; 9892 + } | { 9893 + disposition: 'attachment'; 9894 + contentId?: undefined; 9895 + filename: string; 9896 + type: string; 9897 + content: string | ArrayBuffer | ArrayBufferView; 9898 + }; 9899 + /** An Email Address */ 9900 + interface EmailAddress { 9901 + name: string; 9902 + email: string; 9903 + } 9904 + /** 9905 + * A binding that allows a Worker to send email messages. 9906 + */ 9907 + interface SendEmail { 9908 + send(message: EmailMessage): Promise<EmailSendResult>; 9909 + send(builder: { 9910 + from: string | EmailAddress; 9911 + to: string | string[]; 9912 + subject: string; 9913 + replyTo?: string | EmailAddress; 9914 + cc?: string | string[]; 9915 + bcc?: string | string[]; 9916 + headers?: Record<string, string>; 9917 + text?: string; 9918 + html?: string; 9919 + attachments?: EmailAttachment[]; 9920 + }): Promise<EmailSendResult>; 9921 + } 9922 + declare abstract class EmailEvent extends ExtendableEvent { 9923 + readonly message: ForwardableEmailMessage; 9924 + } 9925 + declare type EmailExportedHandler<Env = unknown, Props = unknown> = (message: ForwardableEmailMessage, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>; 9926 + declare module "cloudflare:email" { 9927 + let _EmailMessage: { 9928 + prototype: EmailMessage; 9929 + new (from: string, to: string, raw: ReadableStream | string): EmailMessage; 9930 + }; 9931 + export { _EmailMessage as EmailMessage }; 9932 + } 9933 + /** 9934 + * Hello World binding to serve as an explanatory example. DO NOT USE 9935 + */ 9936 + interface HelloWorldBinding { 9937 + /** 9938 + * Retrieve the current stored value 9939 + */ 9940 + get(): Promise<{ 9941 + value: string; 9942 + ms?: number; 9943 + }>; 9944 + /** 9945 + * Set a new stored value 9946 + */ 9947 + set(value: string): Promise<void>; 9948 + } 9949 + interface Hyperdrive { 9950 + /** 9951 + * Connect directly to Hyperdrive as if it's your database, returning a TCP socket. 9952 + * 9953 + * Calling this method returns an identical socket to if you call 9954 + * `connect("host:port")` using the `host` and `port` fields from this object. 9955 + * Pick whichever approach works better with your preferred DB client library. 9956 + * 9957 + * Note that this socket is not yet authenticated -- it's expected that your 9958 + * code (or preferably, the client library of your choice) will authenticate 9959 + * using the information in this class's readonly fields. 9960 + */ 9961 + connect(): Socket; 9962 + /** 9963 + * A valid DB connection string that can be passed straight into the typical 9964 + * client library/driver/ORM. This will typically be the easiest way to use 9965 + * Hyperdrive. 9966 + */ 9967 + readonly connectionString: string; 9968 + /* 9969 + * A randomly generated hostname that is only valid within the context of the 9970 + * currently running Worker which, when passed into `connect()` function from 9971 + * the "cloudflare:sockets" module, will connect to the Hyperdrive instance 9972 + * for your database. 9973 + */ 9974 + readonly host: string; 9975 + /* 9976 + * The port that must be paired the the host field when connecting. 9977 + */ 9978 + readonly port: number; 9979 + /* 9980 + * The username to use when authenticating to your database via Hyperdrive. 9981 + * Unlike the host and password, this will be the same every time 9982 + */ 9983 + readonly user: string; 9984 + /* 9985 + * The randomly generated password to use when authenticating to your 9986 + * database via Hyperdrive. Like the host field, this password is only valid 9987 + * within the context of the currently running Worker instance from which 9988 + * it's read. 9989 + */ 9990 + readonly password: string; 9991 + /* 9992 + * The name of the database to connect to. 9993 + */ 9994 + readonly database: string; 9995 + } 9996 + // Copyright (c) 2024 Cloudflare, Inc. 9997 + // Licensed under the Apache 2.0 license found in the LICENSE file or at: 9998 + // https://opensource.org/licenses/Apache-2.0 9999 + type ImageInfoResponse = { 10000 + format: 'image/svg+xml'; 10001 + } | { 10002 + format: string; 10003 + fileSize: number; 10004 + width: number; 10005 + height: number; 10006 + }; 10007 + type ImageTransform = { 10008 + width?: number; 10009 + height?: number; 10010 + background?: string; 10011 + blur?: number; 10012 + border?: { 10013 + color?: string; 10014 + width?: number; 10015 + } | { 10016 + top?: number; 10017 + bottom?: number; 10018 + left?: number; 10019 + right?: number; 10020 + }; 10021 + brightness?: number; 10022 + contrast?: number; 10023 + fit?: 'scale-down' | 'contain' | 'pad' | 'squeeze' | 'cover' | 'crop'; 10024 + flip?: 'h' | 'v' | 'hv'; 10025 + gamma?: number; 10026 + segment?: 'foreground'; 10027 + gravity?: 'face' | 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | { 10028 + x?: number; 10029 + y?: number; 10030 + mode: 'remainder' | 'box-center'; 10031 + }; 10032 + rotate?: 0 | 90 | 180 | 270; 10033 + saturation?: number; 10034 + sharpen?: number; 10035 + trim?: 'border' | { 10036 + top?: number; 10037 + bottom?: number; 10038 + left?: number; 10039 + right?: number; 10040 + width?: number; 10041 + height?: number; 10042 + border?: boolean | { 10043 + color?: string; 10044 + tolerance?: number; 10045 + keep?: number; 10046 + }; 10047 + }; 10048 + }; 10049 + type ImageDrawOptions = { 10050 + opacity?: number; 10051 + repeat?: boolean | string; 10052 + top?: number; 10053 + left?: number; 10054 + bottom?: number; 10055 + right?: number; 10056 + }; 10057 + type ImageInputOptions = { 10058 + encoding?: 'base64'; 10059 + }; 10060 + type ImageOutputOptions = { 10061 + format: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/avif' | 'rgb' | 'rgba'; 10062 + quality?: number; 10063 + background?: string; 10064 + anim?: boolean; 10065 + }; 10066 + interface ImageMetadata { 10067 + id: string; 10068 + filename?: string; 10069 + uploaded?: string; 10070 + requireSignedURLs: boolean; 10071 + meta?: Record<string, unknown>; 10072 + variants: string[]; 10073 + draft?: boolean; 10074 + creator?: string; 10075 + } 10076 + interface ImageUploadOptions { 10077 + id?: string; 10078 + filename?: string; 10079 + requireSignedURLs?: boolean; 10080 + metadata?: Record<string, unknown>; 10081 + creator?: string; 10082 + encoding?: 'base64'; 10083 + } 10084 + interface ImageUpdateOptions { 10085 + requireSignedURLs?: boolean; 10086 + metadata?: Record<string, unknown>; 10087 + creator?: string; 10088 + } 10089 + interface ImageListOptions { 10090 + limit?: number; 10091 + cursor?: string; 10092 + sortOrder?: 'asc' | 'desc'; 10093 + creator?: string; 10094 + } 10095 + interface ImageList { 10096 + images: ImageMetadata[]; 10097 + cursor?: string; 10098 + listComplete: boolean; 10099 + } 10100 + interface HostedImagesBinding { 10101 + /** 10102 + * Get detailed metadata for a hosted image 10103 + * @param imageId The ID of the image (UUID or custom ID) 10104 + * @returns Image metadata, or null if not found 10105 + */ 10106 + details(imageId: string): Promise<ImageMetadata | null>; 10107 + /** 10108 + * Get the raw image data for a hosted image 10109 + * @param imageId The ID of the image (UUID or custom ID) 10110 + * @returns ReadableStream of image bytes, or null if not found 10111 + */ 10112 + image(imageId: string): Promise<ReadableStream<Uint8Array> | null>; 10113 + /** 10114 + * Upload a new hosted image 10115 + * @param image The image file to upload 10116 + * @param options Upload configuration 10117 + * @returns Metadata for the uploaded image 10118 + * @throws {@link ImagesError} if upload fails 10119 + */ 10120 + upload(image: ReadableStream<Uint8Array> | ArrayBuffer, options?: ImageUploadOptions): Promise<ImageMetadata>; 10121 + /** 10122 + * Update hosted image metadata 10123 + * @param imageId The ID of the image 10124 + * @param options Properties to update 10125 + * @returns Updated image metadata 10126 + * @throws {@link ImagesError} if update fails 10127 + */ 10128 + update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>; 10129 + /** 10130 + * Delete a hosted image 10131 + * @param imageId The ID of the image 10132 + * @returns True if deleted, false if not found 10133 + */ 10134 + delete(imageId: string): Promise<boolean>; 10135 + /** 10136 + * List hosted images with pagination 10137 + * @param options List configuration 10138 + * @returns List of images with pagination info 10139 + * @throws {@link ImagesError} if list fails 10140 + */ 10141 + list(options?: ImageListOptions): Promise<ImageList>; 10142 + } 10143 + interface ImagesBinding { 10144 + /** 10145 + * Get image metadata (type, width and height) 10146 + * @throws {@link ImagesError} with code 9412 if input is not an image 10147 + * @param stream The image bytes 10148 + */ 10149 + info(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): Promise<ImageInfoResponse>; 10150 + /** 10151 + * Begin applying a series of transformations to an image 10152 + * @param stream The image bytes 10153 + * @returns A transform handle 10154 + */ 10155 + input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer; 10156 + /** 10157 + * Access hosted images CRUD operations 10158 + */ 10159 + readonly hosted: HostedImagesBinding; 10160 + } 10161 + interface ImageTransformer { 10162 + /** 10163 + * Apply transform next, returning a transform handle. 10164 + * You can then apply more transformations, draw, or retrieve the output. 10165 + * @param transform 10166 + */ 10167 + transform(transform: ImageTransform): ImageTransformer; 10168 + /** 10169 + * Draw an image on this transformer, returning a transform handle. 10170 + * You can then apply more transformations, draw, or retrieve the output. 10171 + * @param image The image (or transformer that will give the image) to draw 10172 + * @param options The options configuring how to draw the image 10173 + */ 10174 + draw(image: ReadableStream<Uint8Array> | ImageTransformer, options?: ImageDrawOptions): ImageTransformer; 10175 + /** 10176 + * Retrieve the image that results from applying the transforms to the 10177 + * provided input 10178 + * @param options Options that apply to the output e.g. output format 10179 + */ 10180 + output(options: ImageOutputOptions): Promise<ImageTransformationResult>; 10181 + } 10182 + type ImageTransformationOutputOptions = { 10183 + encoding?: 'base64'; 10184 + }; 10185 + interface ImageTransformationResult { 10186 + /** 10187 + * The image as a response, ready to store in cache or return to users 10188 + */ 10189 + response(): Response; 10190 + /** 10191 + * The content type of the returned image 10192 + */ 10193 + contentType(): string; 10194 + /** 10195 + * The bytes of the response 10196 + */ 10197 + image(options?: ImageTransformationOutputOptions): ReadableStream<Uint8Array>; 10198 + } 10199 + interface ImagesError extends Error { 10200 + readonly code: number; 10201 + readonly message: string; 10202 + readonly stack?: string; 10203 + } 10204 + /** 10205 + * Media binding for transforming media streams. 10206 + * Provides the entry point for media transformation operations. 10207 + */ 10208 + interface MediaBinding { 10209 + /** 10210 + * Creates a media transformer from an input stream. 10211 + * @param media - The input media bytes 10212 + * @returns A MediaTransformer instance for applying transformations 10213 + */ 10214 + input(media: ReadableStream<Uint8Array>): MediaTransformer; 10215 + } 10216 + /** 10217 + * Media transformer for applying transformation operations to media content. 10218 + * Handles sizing, fitting, and other input transformation parameters. 10219 + */ 10220 + interface MediaTransformer { 10221 + /** 10222 + * Applies transformation options to the media content. 10223 + * @param transform - Configuration for how the media should be transformed 10224 + * @returns A generator for producing the transformed media output 10225 + */ 10226 + transform(transform?: MediaTransformationInputOptions): MediaTransformationGenerator; 10227 + /** 10228 + * Generates the final media output with specified options. 10229 + * @param output - Configuration for the output format and parameters 10230 + * @returns The final transformation result containing the transformed media 10231 + */ 10232 + output(output?: MediaTransformationOutputOptions): MediaTransformationResult; 10233 + } 10234 + /** 10235 + * Generator for producing media transformation results. 10236 + * Configures the output format and parameters for the transformed media. 10237 + */ 10238 + interface MediaTransformationGenerator { 10239 + /** 10240 + * Generates the final media output with specified options. 10241 + * @param output - Configuration for the output format and parameters 10242 + * @returns The final transformation result containing the transformed media 10243 + */ 10244 + output(output?: MediaTransformationOutputOptions): MediaTransformationResult; 10245 + } 10246 + /** 10247 + * Result of a media transformation operation. 10248 + * Provides multiple ways to access the transformed media content. 10249 + */ 10250 + interface MediaTransformationResult { 10251 + /** 10252 + * Returns the transformed media as a readable stream of bytes. 10253 + * @returns A promise containing a readable stream with the transformed media 10254 + */ 10255 + media(): Promise<ReadableStream<Uint8Array>>; 10256 + /** 10257 + * Returns the transformed media as an HTTP response object. 10258 + * @returns The transformed media as a Promise<Response>, ready to store in cache or return to users 10259 + */ 10260 + response(): Promise<Response>; 10261 + /** 10262 + * Returns the MIME type of the transformed media. 10263 + * @returns A promise containing the content type string (e.g., 'image/jpeg', 'video/mp4') 10264 + */ 10265 + contentType(): Promise<string>; 10266 + } 10267 + /** 10268 + * Configuration options for transforming media input. 10269 + * Controls how the media should be resized and fitted. 10270 + */ 10271 + type MediaTransformationInputOptions = { 10272 + /** How the media should be resized to fit the specified dimensions */ 10273 + fit?: 'contain' | 'cover' | 'scale-down'; 10274 + /** Target width in pixels */ 10275 + width?: number; 10276 + /** Target height in pixels */ 10277 + height?: number; 10278 + }; 10279 + /** 10280 + * Configuration options for Media Transformations output. 10281 + * Controls the format, timing, and type of the generated output. 10282 + */ 10283 + type MediaTransformationOutputOptions = { 10284 + /** 10285 + * Output mode determining the type of media to generate 10286 + */ 10287 + mode?: 'video' | 'spritesheet' | 'frame' | 'audio'; 10288 + /** Whether to include audio in the output */ 10289 + audio?: boolean; 10290 + /** 10291 + * Starting timestamp for frame extraction or start time for clips. (e.g. '2s'). 10292 + */ 10293 + time?: string; 10294 + /** 10295 + * Duration for video clips, audio extraction, and spritesheet generation (e.g. '5s'). 10296 + */ 10297 + duration?: string; 10298 + /** 10299 + * Number of frames in the spritesheet. 10300 + */ 10301 + imageCount?: number; 10302 + /** 10303 + * Output format for the generated media. 10304 + */ 10305 + format?: 'jpg' | 'png' | 'm4a'; 10306 + }; 10307 + /** 10308 + * Error object for media transformation operations. 10309 + * Extends the standard Error interface with additional media-specific information. 10310 + */ 10311 + interface MediaError extends Error { 10312 + readonly code: number; 10313 + readonly message: string; 10314 + readonly stack?: string; 10315 + } 10316 + declare module 'cloudflare:node' { 10317 + interface NodeStyleServer { 10318 + listen(...args: unknown[]): this; 10319 + address(): { 10320 + port?: number | null | undefined; 10321 + }; 10322 + } 10323 + export function httpServerHandler(port: number): ExportedHandler; 10324 + export function httpServerHandler(options: { 10325 + port: number; 10326 + }): ExportedHandler; 10327 + export function httpServerHandler(server: NodeStyleServer): ExportedHandler; 10328 + } 10329 + type Params<P extends string = any> = Record<P, string | string[]>; 10330 + type EventContext<Env, P extends string, Data> = { 10331 + request: Request<unknown, IncomingRequestCfProperties<unknown>>; 10332 + functionPath: string; 10333 + waitUntil: (promise: Promise<any>) => void; 10334 + passThroughOnException: () => void; 10335 + next: (input?: Request | string, init?: RequestInit) => Promise<Response>; 10336 + env: Env & { 10337 + ASSETS: { 10338 + fetch: typeof fetch; 10339 + }; 10340 + }; 10341 + params: Params<P>; 10342 + data: Data; 10343 + }; 10344 + type PagesFunction<Env = unknown, Params extends string = any, Data extends Record<string, unknown> = Record<string, unknown>> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>; 10345 + type EventPluginContext<Env, P extends string, Data, PluginArgs> = { 10346 + request: Request<unknown, IncomingRequestCfProperties<unknown>>; 10347 + functionPath: string; 10348 + waitUntil: (promise: Promise<any>) => void; 10349 + passThroughOnException: () => void; 10350 + next: (input?: Request | string, init?: RequestInit) => Promise<Response>; 10351 + env: Env & { 10352 + ASSETS: { 10353 + fetch: typeof fetch; 10354 + }; 10355 + }; 10356 + params: Params<P>; 10357 + data: Data; 10358 + pluginArgs: PluginArgs; 10359 + }; 10360 + type PagesPluginFunction<Env = unknown, Params extends string = any, Data extends Record<string, unknown> = Record<string, unknown>, PluginArgs = unknown> = (context: EventPluginContext<Env, Params, Data, PluginArgs>) => Response | Promise<Response>; 10361 + declare module "assets:*" { 10362 + export const onRequest: PagesFunction; 10363 + } 10364 + // Copyright (c) 2022-2023 Cloudflare, Inc. 10365 + // Licensed under the Apache 2.0 license found in the LICENSE file or at: 10366 + // https://opensource.org/licenses/Apache-2.0 10367 + declare module "cloudflare:pipelines" { 10368 + export abstract class PipelineTransformationEntrypoint<Env = unknown, I extends PipelineRecord = PipelineRecord, O extends PipelineRecord = PipelineRecord> { 10369 + protected env: Env; 10370 + protected ctx: ExecutionContext; 10371 + constructor(ctx: ExecutionContext, env: Env); 10372 + /** 10373 + * run receives an array of PipelineRecord which can be 10374 + * transformed and returned to the pipeline 10375 + * @param records Incoming records from the pipeline to be transformed 10376 + * @param metadata Information about the specific pipeline calling the transformation entrypoint 10377 + * @returns A promise containing the transformed PipelineRecord array 10378 + */ 10379 + public run(records: I[], metadata: PipelineBatchMetadata): Promise<O[]>; 10380 + } 10381 + export type PipelineRecord = Record<string, unknown>; 10382 + export type PipelineBatchMetadata = { 10383 + pipelineId: string; 10384 + pipelineName: string; 10385 + }; 10386 + export interface Pipeline<T extends PipelineRecord = PipelineRecord> { 10387 + /** 10388 + * The Pipeline interface represents the type of a binding to a Pipeline 10389 + * 10390 + * @param records The records to send to the pipeline 10391 + */ 10392 + send(records: T[]): Promise<void>; 10393 + } 10394 + } 10395 + // PubSubMessage represents an incoming PubSub message. 10396 + // The message includes metadata about the broker, the client, and the payload 10397 + // itself. 10398 + // https://developers.cloudflare.com/pub-sub/ 10399 + interface PubSubMessage { 10400 + // Message ID 10401 + readonly mid: number; 10402 + // MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT 10403 + readonly broker: string; 10404 + // The MQTT topic the message was sent on. 10405 + readonly topic: string; 10406 + // The client ID of the client that published this message. 10407 + readonly clientId: string; 10408 + // The unique identifier (JWT ID) used by the client to authenticate, if token 10409 + // auth was used. 10410 + readonly jti?: string; 10411 + // A Unix timestamp (seconds from Jan 1, 1970), set when the Pub/Sub Broker 10412 + // received the message from the client. 10413 + readonly receivedAt: number; 10414 + // An (optional) string with the MIME type of the payload, if set by the 10415 + // client. 10416 + readonly contentType: string; 10417 + // Set to 1 when the payload is a UTF-8 string 10418 + // https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901063 10419 + readonly payloadFormatIndicator: number; 10420 + // Pub/Sub (MQTT) payloads can be UTF-8 strings, or byte arrays. 10421 + // You can use payloadFormatIndicator to inspect this before decoding. 10422 + payload: string | Uint8Array; 10423 + } 10424 + // JsonWebKey extended by kid parameter 10425 + interface JsonWebKeyWithKid extends JsonWebKey { 10426 + // Key Identifier of the JWK 10427 + readonly kid: string; 10428 + } 10429 + interface RateLimitOptions { 10430 + key: string; 10431 + } 10432 + interface RateLimitOutcome { 10433 + success: boolean; 10434 + } 10435 + interface RateLimit { 10436 + /** 10437 + * Rate limit a request based on the provided options. 10438 + * @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/ 10439 + * @returns A promise that resolves with the outcome of the rate limit. 10440 + */ 10441 + limit(options: RateLimitOptions): Promise<RateLimitOutcome>; 10442 + } 10443 + // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need 10444 + // to referenced by `Fetcher`. This is included in the "importable" version of the types which 10445 + // strips all `module` blocks. 10446 + declare namespace Rpc { 10447 + // Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s. 10448 + // TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`. 10449 + // For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to 10450 + // accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape) 10451 + export const __RPC_STUB_BRAND: '__RPC_STUB_BRAND'; 10452 + export const __RPC_TARGET_BRAND: '__RPC_TARGET_BRAND'; 10453 + export const __WORKER_ENTRYPOINT_BRAND: '__WORKER_ENTRYPOINT_BRAND'; 10454 + export const __DURABLE_OBJECT_BRAND: '__DURABLE_OBJECT_BRAND'; 10455 + export const __WORKFLOW_ENTRYPOINT_BRAND: '__WORKFLOW_ENTRYPOINT_BRAND'; 10456 + export interface RpcTargetBranded { 10457 + [__RPC_TARGET_BRAND]: never; 10458 + } 10459 + export interface WorkerEntrypointBranded { 10460 + [__WORKER_ENTRYPOINT_BRAND]: never; 10461 + } 10462 + export interface DurableObjectBranded { 10463 + [__DURABLE_OBJECT_BRAND]: never; 10464 + } 10465 + export interface WorkflowEntrypointBranded { 10466 + [__WORKFLOW_ENTRYPOINT_BRAND]: never; 10467 + } 10468 + export type EntrypointBranded = WorkerEntrypointBranded | DurableObjectBranded | WorkflowEntrypointBranded; 10469 + // Types that can be used through `Stub`s 10470 + export type Stubable = RpcTargetBranded | ((...args: any[]) => any); 10471 + // Types that can be passed over RPC 10472 + // The reason for using a generic type here is to build a serializable subset of structured 10473 + // cloneable composite types. This allows types defined with the "interface" keyword to pass the 10474 + // serializable check as well. Otherwise, only types defined with the "type" keyword would pass. 10475 + type Serializable<T> = 10476 + // Structured cloneables 10477 + BaseType 10478 + // Structured cloneable composites 10479 + | Map<T extends Map<infer U, unknown> ? Serializable<U> : never, T extends Map<unknown, infer U> ? Serializable<U> : never> | Set<T extends Set<infer U> ? Serializable<U> : never> | ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never> | { 10480 + [K in keyof T]: K extends number | string ? Serializable<T[K]> : never; 10481 + } 10482 + // Special types 10483 + | Stub<Stubable> 10484 + // Serialized as stubs, see `Stubify` 10485 + | Stubable; 10486 + // Base type for all RPC stubs, including common memory management methods. 10487 + // `T` is used as a marker type for unwrapping `Stub`s later. 10488 + interface StubBase<T extends Stubable> extends Disposable { 10489 + [__RPC_STUB_BRAND]: T; 10490 + dup(): this; 10491 + } 10492 + export type Stub<T extends Stubable> = Provider<T> & StubBase<T>; 10493 + // This represents all the types that can be sent as-is over an RPC boundary 10494 + type BaseType = void | undefined | null | boolean | number | bigint | string | TypedArray | ArrayBuffer | DataView | Date | Error | RegExp | ReadableStream<Uint8Array> | WritableStream<Uint8Array> | Request | Response | Headers; 10495 + // Recursively rewrite all `Stubable` types with `Stub`s 10496 + // prettier-ignore 10497 + type Stubify<T> = T extends Stubable ? Stub<T> : T extends Map<infer K, infer V> ? Map<Stubify<K>, Stubify<V>> : T extends Set<infer V> ? Set<Stubify<V>> : T extends Array<infer V> ? Array<Stubify<V>> : T extends ReadonlyArray<infer V> ? ReadonlyArray<Stubify<V>> : T extends BaseType ? T : T extends { 10498 + [key: string | number]: any; 10499 + } ? { 10500 + [K in keyof T]: Stubify<T[K]>; 10501 + } : T; 10502 + // Recursively rewrite all `Stub<T>`s with the corresponding `T`s. 10503 + // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies: 10504 + // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`. 10505 + // prettier-ignore 10506 + type Unstubify<T> = T extends StubBase<infer V> ? V : T extends Map<infer K, infer V> ? Map<Unstubify<K>, Unstubify<V>> : T extends Set<infer V> ? Set<Unstubify<V>> : T extends Array<infer V> ? Array<Unstubify<V>> : T extends ReadonlyArray<infer V> ? ReadonlyArray<Unstubify<V>> : T extends BaseType ? T : T extends { 10507 + [key: string | number]: unknown; 10508 + } ? { 10509 + [K in keyof T]: Unstubify<T[K]>; 10510 + } : T; 10511 + type UnstubifyAll<A extends any[]> = { 10512 + [I in keyof A]: Unstubify<A[I]>; 10513 + }; 10514 + // Utility type for adding `Provider`/`Disposable`s to `object` types only. 10515 + // Note `unknown & T` is equivalent to `T`. 10516 + type MaybeProvider<T> = T extends object ? Provider<T> : unknown; 10517 + type MaybeDisposable<T> = T extends object ? Disposable : unknown; 10518 + // Type for method return or property on an RPC interface. 10519 + // - Stubable types are replaced by stubs. 10520 + // - Serializable types are passed by value, with stubable types replaced by stubs 10521 + // and a top-level `Disposer`. 10522 + // Everything else can't be passed over PRC. 10523 + // Technically, we use custom thenables here, but they quack like `Promise`s. 10524 + // Intersecting with `(Maybe)Provider` allows pipelining. 10525 + // prettier-ignore 10526 + type Result<R> = R extends Stubable ? Promise<Stub<R>> & Provider<R> : R extends Serializable<R> ? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R> : never; 10527 + // Type for method or property on an RPC interface. 10528 + // For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s. 10529 + // Unwrapping `Stub`s allows calling with `Stubable` arguments. 10530 + // For properties, rewrite types to be `Result`s. 10531 + // In each case, unwrap `Promise`s. 10532 + type MethodOrProperty<V> = V extends (...args: infer P) => infer R ? (...args: UnstubifyAll<P>) => Result<Awaited<R>> : Result<Awaited<V>>; 10533 + // Type for the callable part of an `Provider` if `T` is callable. 10534 + // This is intersected with methods/properties. 10535 + type MaybeCallableProvider<T> = T extends (...args: any[]) => any ? MethodOrProperty<T> : unknown; 10536 + // Base type for all other types providing RPC-like interfaces. 10537 + // Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types. 10538 + // `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC. 10539 + export type Provider<T extends object, Reserved extends string = never> = MaybeCallableProvider<T> & Pick<{ 10540 + [K in keyof T]: MethodOrProperty<T[K]>; 10541 + }, Exclude<keyof T, Reserved | symbol | keyof StubBase<never>>>; 10542 + } 10543 + declare namespace Cloudflare { 10544 + // Type of `env`. 10545 + // 10546 + // The specific project can extend `Env` by redeclaring it in project-specific files. Typescript 10547 + // will merge all declarations. 10548 + // 10549 + // You can use `wrangler types` to generate the `Env` type automatically. 10550 + interface Env { 10551 + } 10552 + // Project-specific parameters used to inform types. 10553 + // 10554 + // This interface is, again, intended to be declared in project-specific files, and then that 10555 + // declaration will be merged with this one. 10556 + // 10557 + // A project should have a declaration like this: 10558 + // 10559 + // interface GlobalProps { 10560 + // // Declares the main module's exports. Used to populate Cloudflare.Exports aka the type 10561 + // // of `ctx.exports`. 10562 + // mainModule: typeof import("my-main-module"); 10563 + // 10564 + // // Declares which of the main module's exports are configured with durable storage, and 10565 + // // thus should behave as Durable Object namsepace bindings. 10566 + // durableNamespaces: "MyDurableObject" | "AnotherDurableObject"; 10567 + // } 10568 + // 10569 + // You can use `wrangler types` to generate `GlobalProps` automatically. 10570 + interface GlobalProps { 10571 + } 10572 + // Evaluates to the type of a property in GlobalProps, defaulting to `Default` if it is not 10573 + // present. 10574 + type GlobalProp<K extends string, Default> = K extends keyof GlobalProps ? GlobalProps[K] : Default; 10575 + // The type of the program's main module exports, if known. Requires `GlobalProps` to declare the 10576 + // `mainModule` property. 10577 + type MainModule = GlobalProp<"mainModule", {}>; 10578 + // The type of ctx.exports, which contains loopback bindings for all top-level exports. 10579 + type Exports = { 10580 + [K in keyof MainModule]: LoopbackForExport<MainModule[K]> 10581 + // If the export is listed in `durableNamespaces`, then it is also a 10582 + // DurableObjectNamespace. 10583 + & (K extends GlobalProp<"durableNamespaces", never> ? MainModule[K] extends new (...args: any[]) => infer DoInstance ? DoInstance extends Rpc.DurableObjectBranded ? DurableObjectNamespace<DoInstance> : DurableObjectNamespace<undefined> : DurableObjectNamespace<undefined> : {}); 10584 + }; 10585 + } 10586 + declare namespace CloudflareWorkersModule { 10587 + export type RpcStub<T extends Rpc.Stubable> = Rpc.Stub<T>; 10588 + export const RpcStub: { 10589 + new <T extends Rpc.Stubable>(value: T): Rpc.Stub<T>; 10590 + }; 10591 + export abstract class RpcTarget implements Rpc.RpcTargetBranded { 10592 + [Rpc.__RPC_TARGET_BRAND]: never; 10593 + } 10594 + // `protected` fields don't appear in `keyof`s, so can't be accessed over RPC 10595 + export abstract class WorkerEntrypoint<Env = Cloudflare.Env, Props = {}> implements Rpc.WorkerEntrypointBranded { 10596 + [Rpc.__WORKER_ENTRYPOINT_BRAND]: never; 10597 + protected ctx: ExecutionContext<Props>; 10598 + protected env: Env; 10599 + constructor(ctx: ExecutionContext, env: Env); 10600 + email?(message: ForwardableEmailMessage): void | Promise<void>; 10601 + fetch?(request: Request): Response | Promise<Response>; 10602 + queue?(batch: MessageBatch<unknown>): void | Promise<void>; 10603 + scheduled?(controller: ScheduledController): void | Promise<void>; 10604 + tail?(events: TraceItem[]): void | Promise<void>; 10605 + tailStream?(event: TailStream.TailEvent<TailStream.Onset>): TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>; 10606 + test?(controller: TestController): void | Promise<void>; 10607 + trace?(traces: TraceItem[]): void | Promise<void>; 10608 + } 10609 + export abstract class DurableObject<Env = Cloudflare.Env, Props = {}> implements Rpc.DurableObjectBranded { 10610 + [Rpc.__DURABLE_OBJECT_BRAND]: never; 10611 + protected ctx: DurableObjectState<Props>; 10612 + protected env: Env; 10613 + constructor(ctx: DurableObjectState, env: Env); 10614 + alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>; 10615 + fetch?(request: Request): Response | Promise<Response>; 10616 + webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>; 10617 + webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>; 10618 + webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>; 10619 + } 10620 + export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year'; 10621 + export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number; 10622 + export type WorkflowDelayDuration = WorkflowSleepDuration; 10623 + export type WorkflowTimeoutDuration = WorkflowSleepDuration; 10624 + export type WorkflowRetentionDuration = WorkflowSleepDuration; 10625 + export type WorkflowBackoff = 'constant' | 'linear' | 'exponential'; 10626 + export type WorkflowStepConfig = { 10627 + retries?: { 10628 + limit: number; 10629 + delay: WorkflowDelayDuration | number; 10630 + backoff?: WorkflowBackoff; 10631 + }; 10632 + timeout?: WorkflowTimeoutDuration | number; 10633 + }; 10634 + export type WorkflowEvent<T> = { 10635 + payload: Readonly<T>; 10636 + timestamp: Date; 10637 + instanceId: string; 10638 + }; 10639 + export type WorkflowStepEvent<T> = { 10640 + payload: Readonly<T>; 10641 + timestamp: Date; 10642 + type: string; 10643 + }; 10644 + export type WorkflowStepContext = { 10645 + attempt: number; 10646 + }; 10647 + export abstract class WorkflowStep { 10648 + do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>): Promise<T>; 10649 + do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>): Promise<T>; 10650 + sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>; 10651 + sleepUntil: (name: string, timestamp: Date | number) => Promise<void>; 10652 + waitForEvent<T extends Rpc.Serializable<T>>(name: string, options: { 10653 + type: string; 10654 + timeout?: WorkflowTimeoutDuration | number; 10655 + }): Promise<WorkflowStepEvent<T>>; 10656 + } 10657 + export type WorkflowInstanceStatus = 'queued' | 'running' | 'paused' | 'errored' | 'terminated' | 'complete' | 'waiting' | 'waitingForPause' | 'unknown'; 10658 + export abstract class WorkflowEntrypoint<Env = unknown, T extends Rpc.Serializable<T> | unknown = unknown> implements Rpc.WorkflowEntrypointBranded { 10659 + [Rpc.__WORKFLOW_ENTRYPOINT_BRAND]: never; 10660 + protected ctx: ExecutionContext; 10661 + protected env: Env; 10662 + constructor(ctx: ExecutionContext, env: Env); 10663 + run(event: Readonly<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown>; 10664 + } 10665 + export function waitUntil(promise: Promise<unknown>): void; 10666 + export function withEnv(newEnv: unknown, fn: () => unknown): unknown; 10667 + export function withExports(newExports: unknown, fn: () => unknown): unknown; 10668 + export function withEnvAndExports(newEnv: unknown, newExports: unknown, fn: () => unknown): unknown; 10669 + export const env: Cloudflare.Env; 10670 + export const exports: Cloudflare.Exports; 10671 + } 10672 + declare module 'cloudflare:workers' { 10673 + export = CloudflareWorkersModule; 10674 + } 10675 + interface SecretsStoreSecret { 10676 + /** 10677 + * Get a secret from the Secrets Store, returning a string of the secret value 10678 + * if it exists, or throws an error if it does not exist 10679 + */ 10680 + get(): Promise<string>; 10681 + } 10682 + declare module "cloudflare:sockets" { 10683 + function _connect(address: string | SocketAddress, options?: SocketOptions): Socket; 10684 + export { _connect as connect }; 10685 + } 10686 + /** 10687 + * Binding entrypoint for Cloudflare Stream. 10688 + * 10689 + * Usage: 10690 + * - Binding-level operations: 10691 + * `await env.STREAM.videos.upload` 10692 + * `await env.STREAM.videos.createDirectUpload` 10693 + * `await env.STREAM.videos.*` 10694 + * `await env.STREAM.watermarks.*` 10695 + * - Per-video operations: 10696 + * `await env.STREAM.video(id).downloads.*` 10697 + * `await env.STREAM.video(id).captions.*` 10698 + * 10699 + * Example usage: 10700 + * ```ts 10701 + * await env.STREAM.video(id).downloads.generate(); 10702 + * 10703 + * const video = env.STREAM.video(id) 10704 + * const captions = video.captions.list(); 10705 + * const videoDetails = video.details() 10706 + * ``` 10707 + */ 10708 + interface StreamBinding { 10709 + /** 10710 + * Returns a handle scoped to a single video for per-video operations. 10711 + * @param id The unique identifier for the video. 10712 + * @returns A handle for per-video operations. 10713 + */ 10714 + video(id: string): StreamVideoHandle; 10715 + /** 10716 + * Uploads a new video from a File. 10717 + * @param file The video file to upload. 10718 + * @returns The uploaded video details. 10719 + * @throws {BadRequestError} if the upload parameter is invalid 10720 + * @throws {QuotaReachedError} if the account storage capacity is exceeded 10721 + * @throws {MaxFileSizeError} if the file size is too large 10722 + * @throws {RateLimitedError} if the server received too many requests 10723 + * @throws {InternalError} if an unexpected error occurs 10724 + */ 10725 + upload(file: File): Promise<StreamVideo>; 10726 + /** 10727 + * Uploads a new video from a provided URL. 10728 + * @param url The URL to upload from. 10729 + * @param params Optional upload parameters. 10730 + * @returns The uploaded video details. 10731 + * @throws {BadRequestError} if the upload parameter is invalid or the URL is invalid 10732 + * @throws {QuotaReachedError} if the account storage capacity is exceeded 10733 + * @throws {MaxFileSizeError} if the file size is too large 10734 + * @throws {RateLimitedError} if the server received too many requests 10735 + * @throws {AlreadyUploadedError} if a video was already uploaded to this URL 10736 + * @throws {InternalError} if an unexpected error occurs 10737 + */ 10738 + upload(url: string, params?: StreamUrlUploadParams): Promise<StreamVideo>; 10739 + /** 10740 + * Creates a direct upload that allows video uploads without an API key. 10741 + * @param params Parameters for the direct upload 10742 + * @returns The direct upload details. 10743 + * @throws {BadRequestError} if the parameters are invalid 10744 + * @throws {RateLimitedError} if the server received too many requests 10745 + * @throws {InternalError} if an unexpected error occurs 10746 + */ 10747 + createDirectUpload(params: StreamDirectUploadCreateParams): Promise<StreamDirectUpload>; 10748 + videos: StreamVideos; 10749 + watermarks: StreamWatermarks; 10750 + } 10751 + /** 10752 + * Handle for operations scoped to a single Stream video. 10753 + */ 10754 + interface StreamVideoHandle { 10755 + /** 10756 + * The unique identifier for the video. 10757 + */ 10758 + id: string; 10759 + /** 10760 + * Get a full videos details 10761 + * @returns The full video details. 10762 + * @throws {NotFoundError} if the video is not found 10763 + * @throws {InternalError} if an unexpected error occurs 10764 + */ 10765 + details(): Promise<StreamVideo>; 10766 + /** 10767 + * Update details for a single video. 10768 + * @param params The fields to update for the video. 10769 + * @returns The updated video details. 10770 + * @throws {NotFoundError} if the video is not found 10771 + * @throws {BadRequestError} if the parameters are invalid 10772 + * @throws {InternalError} if an unexpected error occurs 10773 + */ 10774 + update(params: StreamUpdateVideoParams): Promise<StreamVideo>; 10775 + /** 10776 + * Deletes a video and its copies from Cloudflare Stream. 10777 + * @returns A promise that resolves when deletion completes. 10778 + * @throws {NotFoundError} if the video is not found 10779 + * @throws {InternalError} if an unexpected error occurs 10780 + */ 10781 + delete(): Promise<void>; 10782 + /** 10783 + * Creates a signed URL token for a video. 10784 + * @returns The signed token that was created. 10785 + * @throws {InternalError} if the signing key cannot be retrieved or the token cannot be signed 10786 + */ 10787 + generateToken(): Promise<string>; 10788 + downloads: StreamScopedDownloads; 10789 + captions: StreamScopedCaptions; 10790 + } 10791 + interface StreamVideo { 10792 + /** 10793 + * The unique identifier for the video. 10794 + */ 10795 + id: string; 10796 + /** 10797 + * A user-defined identifier for the media creator. 10798 + */ 10799 + creator: string | null; 10800 + /** 10801 + * The thumbnail URL for the video. 10802 + */ 10803 + thumbnail: string; 10804 + /** 10805 + * The thumbnail timestamp percentage. 10806 + */ 10807 + thumbnailTimestampPct: number; 10808 + /** 10809 + * Indicates whether the video is ready to stream. 10810 + */ 10811 + readyToStream: boolean; 10812 + /** 10813 + * The date and time the video became ready to stream. 10814 + */ 10815 + readyToStreamAt: string | null; 10816 + /** 10817 + * Processing status information. 10818 + */ 10819 + status: StreamVideoStatus; 10820 + /** 10821 + * A user modifiable key-value store. 10822 + */ 10823 + meta: Record<string, string>; 10824 + /** 10825 + * The date and time the video was created. 10826 + */ 10827 + created: string; 10828 + /** 10829 + * The date and time the video was last modified. 10830 + */ 10831 + modified: string; 10832 + /** 10833 + * The date and time at which the video will be deleted. 10834 + */ 10835 + scheduledDeletion: string | null; 10836 + /** 10837 + * The size of the video in bytes. 10838 + */ 10839 + size: number; 10840 + /** 10841 + * The preview URL for the video. 10842 + */ 10843 + preview?: string; 10844 + /** 10845 + * Origins allowed to display the video. 10846 + */ 10847 + allowedOrigins: Array<string>; 10848 + /** 10849 + * Indicates whether signed URLs are required. 10850 + */ 10851 + requireSignedURLs: boolean | null; 10852 + /** 10853 + * The date and time the video was uploaded. 10854 + */ 10855 + uploaded: string | null; 10856 + /** 10857 + * The date and time when the upload URL expires. 10858 + */ 10859 + uploadExpiry: string | null; 10860 + /** 10861 + * The maximum size in bytes for direct uploads. 10862 + */ 10863 + maxSizeBytes: number | null; 10864 + /** 10865 + * The maximum duration in seconds for direct uploads. 10866 + */ 10867 + maxDurationSeconds: number | null; 10868 + /** 10869 + * The video duration in seconds. -1 indicates unknown. 10870 + */ 10871 + duration: number; 10872 + /** 10873 + * Input metadata for the original upload. 10874 + */ 10875 + input: StreamVideoInput; 10876 + /** 10877 + * Playback URLs for the video. 10878 + */ 10879 + hlsPlaybackUrl: string; 10880 + dashPlaybackUrl: string; 10881 + /** 10882 + * The watermark applied to the video, if any. 10883 + */ 10884 + watermark: StreamWatermark | null; 10885 + /** 10886 + * The live input id associated with the video, if any. 10887 + */ 10888 + liveInputId?: string | null; 10889 + /** 10890 + * The source video id if this is a clip. 10891 + */ 10892 + clippedFromId: string | null; 10893 + /** 10894 + * Public details associated with the video. 10895 + */ 10896 + publicDetails: StreamPublicDetails | null; 10897 + } 10898 + type StreamVideoStatus = { 10899 + /** 10900 + * The current processing state. 10901 + */ 10902 + state: string; 10903 + /** 10904 + * The current processing step. 10905 + */ 10906 + step?: string; 10907 + /** 10908 + * The percent complete as a string. 10909 + */ 10910 + pctComplete?: string; 10911 + /** 10912 + * An error reason code, if applicable. 10913 + */ 10914 + errorReasonCode: string; 10915 + /** 10916 + * An error reason text, if applicable. 10917 + */ 10918 + errorReasonText: string; 10919 + }; 10920 + type StreamVideoInput = { 10921 + /** 10922 + * The input width in pixels. 10923 + */ 10924 + width: number; 10925 + /** 10926 + * The input height in pixels. 10927 + */ 10928 + height: number; 10929 + }; 10930 + type StreamPublicDetails = { 10931 + /** 10932 + * The public title for the video. 10933 + */ 10934 + title: string | null; 10935 + /** 10936 + * The public share link. 10937 + */ 10938 + share_link: string | null; 10939 + /** 10940 + * The public channel link. 10941 + */ 10942 + channel_link: string | null; 10943 + /** 10944 + * The public logo URL. 10945 + */ 10946 + logo: string | null; 10947 + }; 10948 + type StreamDirectUpload = { 10949 + /** 10950 + * The URL an unauthenticated upload can use for a single multipart request. 10951 + */ 10952 + uploadURL: string; 10953 + /** 10954 + * A Cloudflare-generated unique identifier for a media item. 10955 + */ 10956 + id: string; 10957 + /** 10958 + * The watermark profile applied to the upload. 10959 + */ 10960 + watermark: StreamWatermark | null; 10961 + /** 10962 + * The scheduled deletion time, if any. 10963 + */ 10964 + scheduledDeletion: string | null; 10965 + }; 10966 + type StreamDirectUploadCreateParams = { 10967 + /** 10968 + * The maximum duration in seconds for a video upload. 10969 + */ 10970 + maxDurationSeconds: number; 10971 + /** 10972 + * The date and time after upload when videos will not be accepted. 10973 + */ 10974 + expiry?: string; 10975 + /** 10976 + * A user-defined identifier for the media creator. 10977 + */ 10978 + creator?: string; 10979 + /** 10980 + * A user modifiable key-value store used to reference other systems of record for 10981 + * managing videos. 10982 + */ 10983 + meta?: Record<string, string>; 10984 + /** 10985 + * Lists the origins allowed to display the video. 10986 + */ 10987 + allowedOrigins?: Array<string>; 10988 + /** 10989 + * Indicates whether the video can be accessed using the id. When set to `true`, 10990 + * a signed token must be generated with a signing key to view the video. 10991 + */ 10992 + requireSignedURLs?: boolean; 10993 + /** 10994 + * The thumbnail timestamp percentage. 10995 + */ 10996 + thumbnailTimestampPct?: number; 10997 + /** 10998 + * The date and time at which the video will be deleted. Include `null` to remove 10999 + * a scheduled deletion. 11000 + */ 11001 + scheduledDeletion?: string | null; 11002 + /** 11003 + * The watermark profile to apply. 11004 + */ 11005 + watermark?: StreamDirectUploadWatermark; 11006 + }; 11007 + type StreamDirectUploadWatermark = { 11008 + /** 11009 + * The unique identifier for the watermark profile. 11010 + */ 11011 + id: string; 11012 + }; 11013 + type StreamUrlUploadParams = { 11014 + /** 11015 + * Lists the origins allowed to display the video. Enter allowed origin 11016 + * domains in an array and use `*` for wildcard subdomains. Empty arrays allow the 11017 + * video to be viewed on any origin. 11018 + */ 11019 + allowedOrigins?: Array<string>; 11020 + /** 11021 + * A user-defined identifier for the media creator. 11022 + */ 11023 + creator?: string; 11024 + /** 11025 + * A user modifiable key-value store used to reference other systems of 11026 + * record for managing videos. 11027 + */ 11028 + meta?: Record<string, string>; 11029 + /** 11030 + * Indicates whether the video can be a accessed using the id. When 11031 + * set to `true`, a signed token must be generated with a signing key to view the 11032 + * video. 11033 + */ 11034 + requireSignedURLs?: boolean; 11035 + /** 11036 + * Indicates the date and time at which the video will be deleted. Omit 11037 + * the field to indicate no change, or include with a `null` value to remove an 11038 + * existing scheduled deletion. If specified, must be at least 30 days from upload 11039 + * time. 11040 + */ 11041 + scheduledDeletion?: string | null; 11042 + /** 11043 + * The timestamp for a thumbnail image calculated as a percentage value 11044 + * of the video's duration. To convert from a second-wise timestamp to a 11045 + * percentage, divide the desired timestamp by the total duration of the video. If 11046 + * this value is not set, the default thumbnail image is taken from 0s of the 11047 + * video. 11048 + */ 11049 + thumbnailTimestampPct?: number; 11050 + /** 11051 + * The identifier for the watermark profile 11052 + */ 11053 + watermarkId?: string; 11054 + }; 11055 + interface StreamScopedCaptions { 11056 + /** 11057 + * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language. 11058 + * One caption or subtitle file per language is allowed. 11059 + * @param language The BCP 47 language tag for the caption or subtitle. 11060 + * @param file The caption or subtitle file to upload. 11061 + * @returns The created caption entry. 11062 + * @throws {NotFoundError} if the video is not found 11063 + * @throws {BadRequestError} if the language or file is invalid 11064 + * @throws {MaxFileSizeError} if the file size is too large 11065 + * @throws {InternalError} if an unexpected error occurs 11066 + */ 11067 + upload(language: string, file: File): Promise<StreamCaption>; 11068 + /** 11069 + * Generate captions or subtitles for the provided language via AI. 11070 + * @param language The BCP 47 language tag to generate. 11071 + * @returns The generated caption entry. 11072 + * @throws {NotFoundError} if the video is not found 11073 + * @throws {BadRequestError} if the language is invalid 11074 + * @throws {StreamError} if a generated caption already exists 11075 + * @throws {StreamError} if the video duration is too long 11076 + * @throws {StreamError} if the video is missing audio 11077 + * @throws {StreamError} if the requested language is not supported 11078 + * @throws {InternalError} if an unexpected error occurs 11079 + */ 11080 + generate(language: string): Promise<StreamCaption>; 11081 + /** 11082 + * Lists the captions or subtitles. 11083 + * Use the language parameter to filter by a specific language. 11084 + * @param language The optional BCP 47 language tag to filter by. 11085 + * @returns The list of captions or subtitles. 11086 + * @throws {NotFoundError} if the video or caption is not found 11087 + * @throws {InternalError} if an unexpected error occurs 11088 + */ 11089 + list(language?: string): Promise<StreamCaption[]>; 11090 + /** 11091 + * Removes the captions or subtitles from a video. 11092 + * @param language The BCP 47 language tag to remove. 11093 + * @returns A promise that resolves when deletion completes. 11094 + * @throws {NotFoundError} if the video or caption is not found 11095 + * @throws {InternalError} if an unexpected error occurs 11096 + */ 11097 + delete(language: string): Promise<void>; 11098 + } 11099 + interface StreamScopedDownloads { 11100 + /** 11101 + * Generates a download for a video when a video is ready to view. Available 11102 + * types are `default` and `audio`. Defaults to `default` when omitted. 11103 + * @param downloadType The download type to create. 11104 + * @returns The current downloads for the video. 11105 + * @throws {NotFoundError} if the video is not found 11106 + * @throws {BadRequestError} if the download type is invalid 11107 + * @throws {StreamError} if the video duration is too long to generate a download 11108 + * @throws {StreamError} if the video is not ready to stream 11109 + * @throws {InternalError} if an unexpected error occurs 11110 + */ 11111 + generate(downloadType?: StreamDownloadType): Promise<StreamDownloadGetResponse>; 11112 + /** 11113 + * Lists the downloads created for a video. 11114 + * @returns The current downloads for the video. 11115 + * @throws {NotFoundError} if the video or downloads are not found 11116 + * @throws {InternalError} if an unexpected error occurs 11117 + */ 11118 + get(): Promise<StreamDownloadGetResponse>; 11119 + /** 11120 + * Delete the downloads for a video. Available types are `default` and `audio`. 11121 + * Defaults to `default` when omitted. 11122 + * @param downloadType The download type to delete. 11123 + * @returns A promise that resolves when deletion completes. 11124 + * @throws {NotFoundError} if the video or downloads are not found 11125 + * @throws {InternalError} if an unexpected error occurs 11126 + */ 11127 + delete(downloadType?: StreamDownloadType): Promise<void>; 11128 + } 11129 + interface StreamVideos { 11130 + /** 11131 + * Lists all videos in a users account. 11132 + * @returns The list of videos. 11133 + * @throws {BadRequestError} if the parameters are invalid 11134 + * @throws {InternalError} if an unexpected error occurs 11135 + */ 11136 + list(params?: StreamVideosListParams): Promise<StreamVideo[]>; 11137 + } 11138 + interface StreamWatermarks { 11139 + /** 11140 + * Generate a new watermark profile 11141 + * @param file The image file to upload 11142 + * @param params The watermark creation parameters. 11143 + * @returns The created watermark profile. 11144 + * @throws {BadRequestError} if the parameters are invalid 11145 + * @throws {InvalidURLError} if the URL is invalid 11146 + * @throws {MaxFileSizeError} if the file size is too large 11147 + * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached 11148 + * @throws {InternalError} if an unexpected error occurs 11149 + */ 11150 + generate(file: File, params: StreamWatermarkCreateParams): Promise<StreamWatermark>; 11151 + /** 11152 + * Generate a new watermark profile 11153 + * @param url The image url to upload 11154 + * @param params The watermark creation parameters. 11155 + * @returns The created watermark profile. 11156 + * @throws {BadRequestError} if the parameters are invalid 11157 + * @throws {InvalidURLError} if the URL is invalid 11158 + * @throws {MaxFileSizeError} if the file size is too large 11159 + * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached 11160 + * @throws {InternalError} if an unexpected error occurs 11161 + */ 11162 + generate(url: string, params: StreamWatermarkCreateParams): Promise<StreamWatermark>; 11163 + /** 11164 + * Lists all watermark profiles for an account. 11165 + * @returns The list of watermark profiles. 11166 + * @throws {InternalError} if an unexpected error occurs 11167 + */ 11168 + list(): Promise<StreamWatermark[]>; 11169 + /** 11170 + * Retrieves details for a single watermark profile. 11171 + * @param watermarkId The watermark profile identifier. 11172 + * @returns The watermark profile details. 11173 + * @throws {NotFoundError} if the watermark is not found 11174 + * @throws {InternalError} if an unexpected error occurs 11175 + */ 11176 + get(watermarkId: string): Promise<StreamWatermark>; 11177 + /** 11178 + * Deletes a watermark profile. 11179 + * @param watermarkId The watermark profile identifier. 11180 + * @returns A promise that resolves when deletion completes. 11181 + * @throws {NotFoundError} if the watermark is not found 11182 + * @throws {InternalError} if an unexpected error occurs 11183 + */ 11184 + delete(watermarkId: string): Promise<void>; 11185 + } 11186 + type StreamUpdateVideoParams = { 11187 + /** 11188 + * Lists the origins allowed to display the video. Enter allowed origin 11189 + * domains in an array and use `*` for wildcard subdomains. Empty arrays allow the 11190 + * video to be viewed on any origin. 11191 + */ 11192 + allowedOrigins?: Array<string>; 11193 + /** 11194 + * A user-defined identifier for the media creator. 11195 + */ 11196 + creator?: string; 11197 + /** 11198 + * The maximum duration in seconds for a video upload. Can be set for a 11199 + * video that is not yet uploaded to limit its duration. Uploads that exceed the 11200 + * specified duration will fail during processing. A value of `-1` means the value 11201 + * is unknown. 11202 + */ 11203 + maxDurationSeconds?: number; 11204 + /** 11205 + * A user modifiable key-value store used to reference other systems of 11206 + * record for managing videos. 11207 + */ 11208 + meta?: Record<string, string>; 11209 + /** 11210 + * Indicates whether the video can be a accessed using the id. When 11211 + * set to `true`, a signed token must be generated with a signing key to view the 11212 + * video. 11213 + */ 11214 + requireSignedURLs?: boolean; 11215 + /** 11216 + * Indicates the date and time at which the video will be deleted. Omit 11217 + * the field to indicate no change, or include with a `null` value to remove an 11218 + * existing scheduled deletion. If specified, must be at least 30 days from upload 11219 + * time. 11220 + */ 11221 + scheduledDeletion?: string | null; 11222 + /** 11223 + * The timestamp for a thumbnail image calculated as a percentage value 11224 + * of the video's duration. To convert from a second-wise timestamp to a 11225 + * percentage, divide the desired timestamp by the total duration of the video. If 11226 + * this value is not set, the default thumbnail image is taken from 0s of the 11227 + * video. 11228 + */ 11229 + thumbnailTimestampPct?: number; 11230 + }; 11231 + type StreamCaption = { 11232 + /** 11233 + * Whether the caption was generated via AI. 11234 + */ 11235 + generated?: boolean; 11236 + /** 11237 + * The language label displayed in the native language to users. 11238 + */ 11239 + label: string; 11240 + /** 11241 + * The language tag in BCP 47 format. 11242 + */ 11243 + language: string; 11244 + /** 11245 + * The status of a generated caption. 11246 + */ 11247 + status?: 'ready' | 'inprogress' | 'error'; 11248 + }; 11249 + type StreamDownloadStatus = 'ready' | 'inprogress' | 'error'; 11250 + type StreamDownloadType = 'default' | 'audio'; 11251 + type StreamDownload = { 11252 + /** 11253 + * Indicates the progress as a percentage between 0 and 100. 11254 + */ 11255 + percentComplete: number; 11256 + /** 11257 + * The status of a generated download. 11258 + */ 11259 + status: StreamDownloadStatus; 11260 + /** 11261 + * The URL to access the generated download. 11262 + */ 11263 + url?: string; 11264 + }; 11265 + /** 11266 + * An object with download type keys. Each key is optional and only present if that 11267 + * download type has been created. 11268 + */ 11269 + type StreamDownloadGetResponse = { 11270 + /** 11271 + * The audio-only download. Only present if this download type has been created. 11272 + */ 11273 + audio?: StreamDownload; 11274 + /** 11275 + * The default video download. Only present if this download type has been created. 11276 + */ 11277 + default?: StreamDownload; 11278 + }; 11279 + type StreamWatermarkPosition = 'upperRight' | 'upperLeft' | 'lowerLeft' | 'lowerRight' | 'center'; 11280 + type StreamWatermark = { 11281 + /** 11282 + * The unique identifier for a watermark profile. 11283 + */ 11284 + id: string; 11285 + /** 11286 + * The size of the image in bytes. 11287 + */ 11288 + size: number; 11289 + /** 11290 + * The height of the image in pixels. 11291 + */ 11292 + height: number; 11293 + /** 11294 + * The width of the image in pixels. 11295 + */ 11296 + width: number; 11297 + /** 11298 + * The date and a time a watermark profile was created. 11299 + */ 11300 + created: string; 11301 + /** 11302 + * The source URL for a downloaded image. If the watermark profile was created via 11303 + * direct upload, this field is null. 11304 + */ 11305 + downloadedFrom: string | null; 11306 + /** 11307 + * A short description of the watermark profile. 11308 + */ 11309 + name: string; 11310 + /** 11311 + * The translucency of the image. A value of `0.0` makes the image completely 11312 + * transparent, and `1.0` makes the image completely opaque. Note that if the image 11313 + * is already semi-transparent, setting this to `1.0` will not make the image 11314 + * completely opaque. 11315 + */ 11316 + opacity: number; 11317 + /** 11318 + * The whitespace between the adjacent edges (determined by position) of the video 11319 + * and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded 11320 + * video width or length, as determined by the algorithm. 11321 + */ 11322 + padding: number; 11323 + /** 11324 + * The size of the image relative to the overall size of the video. This parameter 11325 + * will adapt to horizontal and vertical videos automatically. `0.0` indicates no 11326 + * scaling (use the size of the image as-is), and `1.0 `fills the entire video. 11327 + */ 11328 + scale: number; 11329 + /** 11330 + * The location of the image. Valid positions are: `upperRight`, `upperLeft`, 11331 + * `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the 11332 + * `padding` parameter. 11333 + */ 11334 + position: StreamWatermarkPosition; 11335 + }; 11336 + type StreamWatermarkCreateParams = { 11337 + /** 11338 + * A short description of the watermark profile. 11339 + */ 11340 + name?: string; 11341 + /** 11342 + * The translucency of the image. A value of `0.0` makes the image completely 11343 + * transparent, and `1.0` makes the image completely opaque. Note that if the 11344 + * image is already semi-transparent, setting this to `1.0` will not make the 11345 + * image completely opaque. 11346 + */ 11347 + opacity?: number; 11348 + /** 11349 + * The whitespace between the adjacent edges (determined by position) of the 11350 + * video and the image. `0.0` indicates no padding, and `1.0` indicates a fully 11351 + * padded video width or length, as determined by the algorithm. 11352 + */ 11353 + padding?: number; 11354 + /** 11355 + * The size of the image relative to the overall size of the video. This 11356 + * parameter will adapt to horizontal and vertical videos automatically. `0.0` 11357 + * indicates no scaling (use the size of the image as-is), and `1.0 `fills the 11358 + * entire video. 11359 + */ 11360 + scale?: number; 11361 + /** 11362 + * The location of the image. 11363 + */ 11364 + position?: StreamWatermarkPosition; 11365 + }; 11366 + type StreamVideosListParams = { 11367 + /** 11368 + * The maximum number of videos to return. 11369 + */ 11370 + limit?: number; 11371 + /** 11372 + * Return videos created before this timestamp. 11373 + * (RFC3339/RFC3339Nano) 11374 + */ 11375 + before?: string; 11376 + /** 11377 + * Comparison operator for the `before` field. 11378 + * @default 'lt' 11379 + */ 11380 + beforeComp?: StreamPaginationComparison; 11381 + /** 11382 + * Return videos created after this timestamp. 11383 + * (RFC3339/RFC3339Nano) 11384 + */ 11385 + after?: string; 11386 + /** 11387 + * Comparison operator for the `after` field. 11388 + * @default 'gte' 11389 + */ 11390 + afterComp?: StreamPaginationComparison; 11391 + }; 11392 + type StreamPaginationComparison = 'eq' | 'gt' | 'gte' | 'lt' | 'lte'; 11393 + /** 11394 + * Error object for Stream binding operations. 11395 + */ 11396 + interface StreamError extends Error { 11397 + readonly code: number; 11398 + readonly statusCode: number; 11399 + readonly message: string; 11400 + readonly stack?: string; 11401 + } 11402 + interface InternalError extends StreamError { 11403 + name: 'InternalError'; 11404 + } 11405 + interface BadRequestError extends StreamError { 11406 + name: 'BadRequestError'; 11407 + } 11408 + interface NotFoundError extends StreamError { 11409 + name: 'NotFoundError'; 11410 + } 11411 + interface ForbiddenError extends StreamError { 11412 + name: 'ForbiddenError'; 11413 + } 11414 + interface RateLimitedError extends StreamError { 11415 + name: 'RateLimitedError'; 11416 + } 11417 + interface QuotaReachedError extends StreamError { 11418 + name: 'QuotaReachedError'; 11419 + } 11420 + interface MaxFileSizeError extends StreamError { 11421 + name: 'MaxFileSizeError'; 11422 + } 11423 + interface InvalidURLError extends StreamError { 11424 + name: 'InvalidURLError'; 11425 + } 11426 + interface AlreadyUploadedError extends StreamError { 11427 + name: 'AlreadyUploadedError'; 11428 + } 11429 + interface TooManyWatermarksError extends StreamError { 11430 + name: 'TooManyWatermarksError'; 11431 + } 11432 + type MarkdownDocument = { 11433 + name: string; 11434 + blob: Blob; 11435 + }; 11436 + type ConversionResponse = { 11437 + id: string; 11438 + name: string; 11439 + mimeType: string; 11440 + format: 'markdown'; 11441 + tokens: number; 11442 + data: string; 11443 + } | { 11444 + id: string; 11445 + name: string; 11446 + mimeType: string; 11447 + format: 'error'; 11448 + error: string; 11449 + }; 11450 + type ImageConversionOptions = { 11451 + descriptionLanguage?: 'en' | 'es' | 'fr' | 'it' | 'pt' | 'de'; 11452 + }; 11453 + type EmbeddedImageConversionOptions = ImageConversionOptions & { 11454 + convert?: boolean; 11455 + maxConvertedImages?: number; 11456 + }; 11457 + type ConversionOptions = { 11458 + html?: { 11459 + images?: EmbeddedImageConversionOptions & { 11460 + convertOGImage?: boolean; 11461 + }; 11462 + hostname?: string; 11463 + cssSelector?: string; 11464 + }; 11465 + docx?: { 11466 + images?: EmbeddedImageConversionOptions; 11467 + }; 11468 + image?: ImageConversionOptions; 11469 + pdf?: { 11470 + images?: EmbeddedImageConversionOptions; 11471 + metadata?: boolean; 11472 + }; 11473 + }; 11474 + type ConversionRequestOptions = { 11475 + gateway?: GatewayOptions; 11476 + extraHeaders?: object; 11477 + conversionOptions?: ConversionOptions; 11478 + }; 11479 + type SupportedFileFormat = { 11480 + mimeType: string; 11481 + extension: string; 11482 + }; 11483 + declare abstract class ToMarkdownService { 11484 + transform(files: MarkdownDocument[], options?: ConversionRequestOptions): Promise<ConversionResponse[]>; 11485 + transform(files: MarkdownDocument, options?: ConversionRequestOptions): Promise<ConversionResponse>; 11486 + supported(): Promise<SupportedFileFormat[]>; 11487 + } 11488 + declare namespace TailStream { 11489 + interface Header { 11490 + readonly name: string; 11491 + readonly value: string; 11492 + } 11493 + interface FetchEventInfo { 11494 + readonly type: "fetch"; 11495 + readonly method: string; 11496 + readonly url: string; 11497 + readonly cfJson?: object; 11498 + readonly headers: Header[]; 11499 + } 11500 + interface JsRpcEventInfo { 11501 + readonly type: "jsrpc"; 11502 + } 11503 + interface ScheduledEventInfo { 11504 + readonly type: "scheduled"; 11505 + readonly scheduledTime: Date; 11506 + readonly cron: string; 11507 + } 11508 + interface AlarmEventInfo { 11509 + readonly type: "alarm"; 11510 + readonly scheduledTime: Date; 11511 + } 11512 + interface QueueEventInfo { 11513 + readonly type: "queue"; 11514 + readonly queueName: string; 11515 + readonly batchSize: number; 11516 + } 11517 + interface EmailEventInfo { 11518 + readonly type: "email"; 11519 + readonly mailFrom: string; 11520 + readonly rcptTo: string; 11521 + readonly rawSize: number; 11522 + } 11523 + interface TraceEventInfo { 11524 + readonly type: "trace"; 11525 + readonly traces: (string | null)[]; 11526 + } 11527 + interface HibernatableWebSocketEventInfoMessage { 11528 + readonly type: "message"; 11529 + } 11530 + interface HibernatableWebSocketEventInfoError { 11531 + readonly type: "error"; 11532 + } 11533 + interface HibernatableWebSocketEventInfoClose { 11534 + readonly type: "close"; 11535 + readonly code: number; 11536 + readonly wasClean: boolean; 11537 + } 11538 + interface HibernatableWebSocketEventInfo { 11539 + readonly type: "hibernatableWebSocket"; 11540 + readonly info: HibernatableWebSocketEventInfoClose | HibernatableWebSocketEventInfoError | HibernatableWebSocketEventInfoMessage; 11541 + } 11542 + interface CustomEventInfo { 11543 + readonly type: "custom"; 11544 + } 11545 + interface FetchResponseInfo { 11546 + readonly type: "fetch"; 11547 + readonly statusCode: number; 11548 + } 11549 + type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound"; 11550 + interface ScriptVersion { 11551 + readonly id: string; 11552 + readonly tag?: string; 11553 + readonly message?: string; 11554 + } 11555 + interface Onset { 11556 + readonly type: "onset"; 11557 + readonly attributes: Attribute[]; 11558 + // id for the span being opened by this Onset event. 11559 + readonly spanId: string; 11560 + readonly dispatchNamespace?: string; 11561 + readonly entrypoint?: string; 11562 + readonly executionModel: string; 11563 + readonly scriptName?: string; 11564 + readonly scriptTags?: string[]; 11565 + readonly scriptVersion?: ScriptVersion; 11566 + readonly info: FetchEventInfo | JsRpcEventInfo | ScheduledEventInfo | AlarmEventInfo | QueueEventInfo | EmailEventInfo | TraceEventInfo | HibernatableWebSocketEventInfo | CustomEventInfo; 11567 + } 11568 + interface Outcome { 11569 + readonly type: "outcome"; 11570 + readonly outcome: EventOutcome; 11571 + readonly cpuTime: number; 11572 + readonly wallTime: number; 11573 + } 11574 + interface SpanOpen { 11575 + readonly type: "spanOpen"; 11576 + readonly name: string; 11577 + // id for the span being opened by this SpanOpen event. 11578 + readonly spanId: string; 11579 + readonly info?: FetchEventInfo | JsRpcEventInfo | Attributes; 11580 + } 11581 + interface SpanClose { 11582 + readonly type: "spanClose"; 11583 + readonly outcome: EventOutcome; 11584 + } 11585 + interface DiagnosticChannelEvent { 11586 + readonly type: "diagnosticChannel"; 11587 + readonly channel: string; 11588 + readonly message: any; 11589 + } 11590 + interface Exception { 11591 + readonly type: "exception"; 11592 + readonly name: string; 11593 + readonly message: string; 11594 + readonly stack?: string; 11595 + } 11596 + interface Log { 11597 + readonly type: "log"; 11598 + readonly level: "debug" | "error" | "info" | "log" | "warn"; 11599 + readonly message: object; 11600 + } 11601 + interface DroppedEventsDiagnostic { 11602 + readonly diagnosticsType: "droppedEvents"; 11603 + readonly count: number; 11604 + } 11605 + interface StreamDiagnostic { 11606 + readonly type: 'streamDiagnostic'; 11607 + // To add new diagnostic types, define a new interface and add it to this union type. 11608 + readonly diagnostic: DroppedEventsDiagnostic; 11609 + } 11610 + // This marks the worker handler return information. 11611 + // This is separate from Outcome because the worker invocation can live for a long time after 11612 + // returning. For example - Websockets that return an http upgrade response but then continue 11613 + // streaming information or SSE http connections. 11614 + interface Return { 11615 + readonly type: "return"; 11616 + readonly info?: FetchResponseInfo; 11617 + } 11618 + interface Attribute { 11619 + readonly name: string; 11620 + readonly value: string | string[] | boolean | boolean[] | number | number[] | bigint | bigint[]; 11621 + } 11622 + interface Attributes { 11623 + readonly type: "attributes"; 11624 + readonly info: Attribute[]; 11625 + } 11626 + type EventType = Onset | Outcome | SpanOpen | SpanClose | DiagnosticChannelEvent | Exception | Log | StreamDiagnostic | Return | Attributes; 11627 + // Context in which this trace event lives. 11628 + interface SpanContext { 11629 + // Single id for the entire top-level invocation 11630 + // This should be a new traceId for the first worker stage invoked in the eyeball request and then 11631 + // same-account service-bindings should reuse the same traceId but cross-account service-bindings 11632 + // should use a new traceId. 11633 + readonly traceId: string; 11634 + // spanId in which this event is handled 11635 + // for Onset and SpanOpen events this would be the parent span id 11636 + // for Outcome and SpanClose these this would be the span id of the opening Onset and SpanOpen events 11637 + // For Hibernate and Mark this would be the span under which they were emitted. 11638 + // spanId is not set ONLY if: 11639 + // 1. This is an Onset event 11640 + // 2. We are not inheriting any SpanContext. (e.g. this is a cross-account service binding or a new top-level invocation) 11641 + readonly spanId?: string; 11642 + } 11643 + interface TailEvent<Event extends EventType> { 11644 + // invocation id of the currently invoked worker stage. 11645 + // invocation id will always be unique to every Onset event and will be the same until the Outcome event. 11646 + readonly invocationId: string; 11647 + // Inherited spanContext for this event. 11648 + readonly spanContext: SpanContext; 11649 + readonly timestamp: Date; 11650 + readonly sequence: number; 11651 + readonly event: Event; 11652 + } 11653 + type TailEventHandler<Event extends EventType = EventType> = (event: TailEvent<Event>) => void | Promise<void>; 11654 + type TailEventHandlerObject = { 11655 + outcome?: TailEventHandler<Outcome>; 11656 + spanOpen?: TailEventHandler<SpanOpen>; 11657 + spanClose?: TailEventHandler<SpanClose>; 11658 + diagnosticChannel?: TailEventHandler<DiagnosticChannelEvent>; 11659 + exception?: TailEventHandler<Exception>; 11660 + log?: TailEventHandler<Log>; 11661 + return?: TailEventHandler<Return>; 11662 + attributes?: TailEventHandler<Attributes>; 11663 + }; 11664 + type TailEventHandlerType = TailEventHandler | TailEventHandlerObject; 11665 + } 11666 + // Copyright (c) 2022-2023 Cloudflare, Inc. 11667 + // Licensed under the Apache 2.0 license found in the LICENSE file or at: 11668 + // https://opensource.org/licenses/Apache-2.0 11669 + /** 11670 + * Data types supported for holding vector metadata. 11671 + */ 11672 + type VectorizeVectorMetadataValue = string | number | boolean | string[]; 11673 + /** 11674 + * Additional information to associate with a vector. 11675 + */ 11676 + type VectorizeVectorMetadata = VectorizeVectorMetadataValue | Record<string, VectorizeVectorMetadataValue>; 11677 + type VectorFloatArray = Float32Array | Float64Array; 11678 + interface VectorizeError { 11679 + code?: number; 11680 + error: string; 11681 + } 11682 + /** 11683 + * Comparison logic/operation to use for metadata filtering. 11684 + * 11685 + * This list is expected to grow as support for more operations are released. 11686 + */ 11687 + type VectorizeVectorMetadataFilterOp = '$eq' | '$ne' | '$lt' | '$lte' | '$gt' | '$gte'; 11688 + type VectorizeVectorMetadataFilterCollectionOp = '$in' | '$nin'; 11689 + /** 11690 + * Filter criteria for vector metadata used to limit the retrieved query result set. 11691 + */ 11692 + type VectorizeVectorMetadataFilter = { 11693 + [field: string]: Exclude<VectorizeVectorMetadataValue, string[]> | null | { 11694 + [Op in VectorizeVectorMetadataFilterOp]?: Exclude<VectorizeVectorMetadataValue, string[]> | null; 11695 + } | { 11696 + [Op in VectorizeVectorMetadataFilterCollectionOp]?: Exclude<VectorizeVectorMetadataValue, string[]>[]; 11697 + }; 11698 + }; 11699 + /** 11700 + * Supported distance metrics for an index. 11701 + * Distance metrics determine how other "similar" vectors are determined. 11702 + */ 11703 + type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product"; 11704 + /** 11705 + * Metadata return levels for a Vectorize query. 11706 + * 11707 + * Default to "none". 11708 + * 11709 + * @property all Full metadata for the vector return set, including all fields (including those un-indexed) without truncation. This is a more expensive retrieval, as it requires additional fetching & reading of un-indexed data. 11710 + * @property indexed Return all metadata fields configured for indexing in the vector return set. This level of retrieval is "free" in that no additional overhead is incurred returning this data. However, note that indexed metadata is subject to truncation (especially for larger strings). 11711 + * @property none No indexed metadata will be returned. 11712 + */ 11713 + type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none"; 11714 + interface VectorizeQueryOptions { 11715 + topK?: number; 11716 + namespace?: string; 11717 + returnValues?: boolean; 11718 + returnMetadata?: boolean | VectorizeMetadataRetrievalLevel; 11719 + filter?: VectorizeVectorMetadataFilter; 11720 + } 11721 + /** 11722 + * Information about the configuration of an index. 11723 + */ 11724 + type VectorizeIndexConfig = { 11725 + dimensions: number; 11726 + metric: VectorizeDistanceMetric; 11727 + } | { 11728 + preset: string; // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity 11729 + }; 11730 + /** 11731 + * Metadata about an existing index. 11732 + * 11733 + * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released. 11734 + * See {@link VectorizeIndexInfo} for its post-beta equivalent. 11735 + */ 11736 + interface VectorizeIndexDetails { 11737 + /** The unique ID of the index */ 11738 + readonly id: string; 11739 + /** The name of the index. */ 11740 + name: string; 11741 + /** (optional) A human readable description for the index. */ 11742 + description?: string; 11743 + /** The index configuration, including the dimension size and distance metric. */ 11744 + config: VectorizeIndexConfig; 11745 + /** The number of records containing vectors within the index. */ 11746 + vectorsCount: number; 11747 + } 11748 + /** 11749 + * Metadata about an existing index. 11750 + */ 11751 + interface VectorizeIndexInfo { 11752 + /** The number of records containing vectors within the index. */ 11753 + vectorCount: number; 11754 + /** Number of dimensions the index has been configured for. */ 11755 + dimensions: number; 11756 + /** ISO 8601 datetime of the last processed mutation on in the index. All changes before this mutation will be reflected in the index state. */ 11757 + processedUpToDatetime: number; 11758 + /** UUIDv4 of the last mutation processed by the index. All changes before this mutation will be reflected in the index state. */ 11759 + processedUpToMutation: number; 11760 + } 11761 + /** 11762 + * Represents a single vector value set along with its associated metadata. 11763 + */ 11764 + interface VectorizeVector { 11765 + /** The ID for the vector. This can be user-defined, and must be unique. It should uniquely identify the object, and is best set based on the ID of what the vector represents. */ 11766 + id: string; 11767 + /** The vector values */ 11768 + values: VectorFloatArray | number[]; 11769 + /** The namespace this vector belongs to. */ 11770 + namespace?: string; 11771 + /** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */ 11772 + metadata?: Record<string, VectorizeVectorMetadata>; 11773 + } 11774 + /** 11775 + * Represents a matched vector for a query along with its score and (if specified) the matching vector information. 11776 + */ 11777 + type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> & Omit<VectorizeVector, "values"> & { 11778 + /** The score or rank for similarity, when returned as a result */ 11779 + score: number; 11780 + }; 11781 + /** 11782 + * A set of matching {@link VectorizeMatch} for a particular query. 11783 + */ 11784 + interface VectorizeMatches { 11785 + matches: VectorizeMatch[]; 11786 + count: number; 11787 + } 11788 + /** 11789 + * Results of an operation that performed a mutation on a set of vectors. 11790 + * Here, `ids` is a list of vectors that were successfully processed. 11791 + * 11792 + * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released. 11793 + * See {@link VectorizeAsyncMutation} for its post-beta equivalent. 11794 + */ 11795 + interface VectorizeVectorMutation { 11796 + /* List of ids of vectors that were successfully processed. */ 11797 + ids: string[]; 11798 + /* Total count of the number of processed vectors. */ 11799 + count: number; 11800 + } 11801 + /** 11802 + * Result type indicating a mutation on the Vectorize Index. 11803 + * Actual mutations are processed async where the `mutationId` is the unique identifier for the operation. 11804 + */ 11805 + interface VectorizeAsyncMutation { 11806 + /** The unique identifier for the async mutation operation containing the changeset. */ 11807 + mutationId: string; 11808 + } 11809 + /** 11810 + * A Vectorize Vector Search Index for querying vectors/embeddings. 11811 + * 11812 + * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released. 11813 + * See {@link Vectorize} for its new implementation. 11814 + */ 11815 + declare abstract class VectorizeIndex { 11816 + /** 11817 + * Get information about the currently bound index. 11818 + * @returns A promise that resolves with information about the current index. 11819 + */ 11820 + public describe(): Promise<VectorizeIndexDetails>; 11821 + /** 11822 + * Use the provided vector to perform a similarity search across the index. 11823 + * @param vector Input vector that will be used to drive the similarity search. 11824 + * @param options Configuration options to massage the returned data. 11825 + * @returns A promise that resolves with matched and scored vectors. 11826 + */ 11827 + public query(vector: VectorFloatArray | number[], options?: VectorizeQueryOptions): Promise<VectorizeMatches>; 11828 + /** 11829 + * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown. 11830 + * @param vectors List of vectors that will be inserted. 11831 + * @returns A promise that resolves with the ids & count of records that were successfully processed. 11832 + */ 11833 + public insert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>; 11834 + /** 11835 + * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values. 11836 + * @param vectors List of vectors that will be upserted. 11837 + * @returns A promise that resolves with the ids & count of records that were successfully processed. 11838 + */ 11839 + public upsert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>; 11840 + /** 11841 + * Delete a list of vectors with a matching id. 11842 + * @param ids List of vector ids that should be deleted. 11843 + * @returns A promise that resolves with the ids & count of records that were successfully processed (and thus deleted). 11844 + */ 11845 + public deleteByIds(ids: string[]): Promise<VectorizeVectorMutation>; 11846 + /** 11847 + * Get a list of vectors with a matching id. 11848 + * @param ids List of vector ids that should be returned. 11849 + * @returns A promise that resolves with the raw unscored vectors matching the id set. 11850 + */ 11851 + public getByIds(ids: string[]): Promise<VectorizeVector[]>; 11852 + } 11853 + /** 11854 + * A Vectorize Vector Search Index for querying vectors/embeddings. 11855 + * 11856 + * Mutations in this version are async, returning a mutation id. 11857 + */ 11858 + declare abstract class Vectorize { 11859 + /** 11860 + * Get information about the currently bound index. 11861 + * @returns A promise that resolves with information about the current index. 11862 + */ 11863 + public describe(): Promise<VectorizeIndexInfo>; 11864 + /** 11865 + * Use the provided vector to perform a similarity search across the index. 11866 + * @param vector Input vector that will be used to drive the similarity search. 11867 + * @param options Configuration options to massage the returned data. 11868 + * @returns A promise that resolves with matched and scored vectors. 11869 + */ 11870 + public query(vector: VectorFloatArray | number[], options?: VectorizeQueryOptions): Promise<VectorizeMatches>; 11871 + /** 11872 + * Use the provided vector-id to perform a similarity search across the index. 11873 + * @param vectorId Id for a vector in the index against which the index should be queried. 11874 + * @param options Configuration options to massage the returned data. 11875 + * @returns A promise that resolves with matched and scored vectors. 11876 + */ 11877 + public queryById(vectorId: string, options?: VectorizeQueryOptions): Promise<VectorizeMatches>; 11878 + /** 11879 + * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown. 11880 + * @param vectors List of vectors that will be inserted. 11881 + * @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset. 11882 + */ 11883 + public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>; 11884 + /** 11885 + * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values. 11886 + * @param vectors List of vectors that will be upserted. 11887 + * @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset. 11888 + */ 11889 + public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>; 11890 + /** 11891 + * Delete a list of vectors with a matching id. 11892 + * @param ids List of vector ids that should be deleted. 11893 + * @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset. 11894 + */ 11895 + public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>; 11896 + /** 11897 + * Get a list of vectors with a matching id. 11898 + * @param ids List of vector ids that should be returned. 11899 + * @returns A promise that resolves with the raw unscored vectors matching the id set. 11900 + */ 11901 + public getByIds(ids: string[]): Promise<VectorizeVector[]>; 11902 + } 11903 + /** 11904 + * The interface for "version_metadata" binding 11905 + * providing metadata about the Worker Version using this binding. 11906 + */ 11907 + type WorkerVersionMetadata = { 11908 + /** The ID of the Worker Version using this binding */ 11909 + id: string; 11910 + /** The tag of the Worker Version using this binding */ 11911 + tag: string; 11912 + /** The timestamp of when the Worker Version was uploaded */ 11913 + timestamp: string; 11914 + }; 11915 + interface DynamicDispatchLimits { 11916 + /** 11917 + * Limit CPU time in milliseconds. 11918 + */ 11919 + cpuMs?: number; 11920 + /** 11921 + * Limit number of subrequests. 11922 + */ 11923 + subRequests?: number; 11924 + } 11925 + interface DynamicDispatchOptions { 11926 + /** 11927 + * Limit resources of invoked Worker script. 11928 + */ 11929 + limits?: DynamicDispatchLimits; 11930 + /** 11931 + * Arguments for outbound Worker script, if configured. 11932 + */ 11933 + outbound?: { 11934 + [key: string]: any; 11935 + }; 11936 + } 11937 + interface DispatchNamespace { 11938 + /** 11939 + * @param name Name of the Worker script. 11940 + * @param args Arguments to Worker script. 11941 + * @param options Options for Dynamic Dispatch invocation. 11942 + * @returns A Fetcher object that allows you to send requests to the Worker script. 11943 + * @throws If the Worker script does not exist in this dispatch namespace, an error will be thrown. 11944 + */ 11945 + get(name: string, args?: { 11946 + [key: string]: any; 11947 + }, options?: DynamicDispatchOptions): Fetcher; 11948 + } 11949 + declare module 'cloudflare:workflows' { 11950 + /** 11951 + * NonRetryableError allows for a user to throw a fatal error 11952 + * that makes a Workflow instance fail immediately without triggering a retry 11953 + */ 11954 + export class NonRetryableError extends Error { 11955 + public constructor(message: string, name?: string); 11956 + } 11957 + } 11958 + declare abstract class Workflow<PARAMS = unknown> { 11959 + /** 11960 + * Get a handle to an existing instance of the Workflow. 11961 + * @param id Id for the instance of this Workflow 11962 + * @returns A promise that resolves with a handle for the Instance 11963 + */ 11964 + public get(id: string): Promise<WorkflowInstance>; 11965 + /** 11966 + * Create a new instance and return a handle to it. If a provided id exists, an error will be thrown. 11967 + * @param options Options when creating an instance including id and params 11968 + * @returns A promise that resolves with a handle for the Instance 11969 + */ 11970 + public create(options?: WorkflowInstanceCreateOptions<PARAMS>): Promise<WorkflowInstance>; 11971 + /** 11972 + * Create a batch of instances and return handle for all of them. If a provided id exists, an error will be thrown. 11973 + * `createBatch` is limited at 100 instances at a time or when the RPC limit for the batch (1MiB) is reached. 11974 + * @param batch List of Options when creating an instance including name and params 11975 + * @returns A promise that resolves with a list of handles for the created instances. 11976 + */ 11977 + public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>; 11978 + } 11979 + type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year'; 11980 + type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number; 11981 + type WorkflowRetentionDuration = WorkflowSleepDuration; 11982 + interface WorkflowInstanceCreateOptions<PARAMS = unknown> { 11983 + /** 11984 + * An id for your Workflow instance. Must be unique within the Workflow. 11985 + */ 11986 + id?: string; 11987 + /** 11988 + * The event payload the Workflow instance is triggered with 11989 + */ 11990 + params?: PARAMS; 11991 + /** 11992 + * The retention policy for Workflow instance. 11993 + * Defaults to the maximum retention period available for the owner's account. 11994 + */ 11995 + retention?: { 11996 + successRetention?: WorkflowRetentionDuration; 11997 + errorRetention?: WorkflowRetentionDuration; 11998 + }; 11999 + } 12000 + type InstanceStatus = { 12001 + status: 'queued' // means that instance is waiting to be started (see concurrency limits) 12002 + | 'running' | 'paused' | 'errored' | 'terminated' // user terminated the instance while it was running 12003 + | 'complete' | 'waiting' // instance is hibernating and waiting for sleep or event to finish 12004 + | 'waitingForPause' // instance is finishing the current work to pause 12005 + | 'unknown'; 12006 + error?: { 12007 + name: string; 12008 + message: string; 12009 + }; 12010 + output?: unknown; 12011 + }; 12012 + interface WorkflowError { 12013 + code?: number; 12014 + message: string; 12015 + } 12016 + declare abstract class WorkflowInstance { 12017 + public id: string; 12018 + /** 12019 + * Pause the instance. 12020 + */ 12021 + public pause(): Promise<void>; 12022 + /** 12023 + * Resume the instance. If it is already running, an error will be thrown. 12024 + */ 12025 + public resume(): Promise<void>; 12026 + /** 12027 + * Terminate the instance. If it is errored, terminated or complete, an error will be thrown. 12028 + */ 12029 + public terminate(): Promise<void>; 12030 + /** 12031 + * Restart the instance. 12032 + */ 12033 + public restart(): Promise<void>; 12034 + /** 12035 + * Returns the current status of the instance. 12036 + */ 12037 + public status(): Promise<InstanceStatus>; 12038 + /** 12039 + * Send an event to this instance. 12040 + */ 12041 + public sendEvent({ type, payload, }: { 12042 + type: string; 12043 + payload: unknown; 12044 + }): Promise<void>; 12045 + }