nitropack-nightly 2.10.0-28638494.93d002b7 → 3.0.0-beta-28638629.b32e0831-nitro-nightly-mirror

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/README.md +1 -1
  2. package/cli.d.ts +1 -1
  3. package/config.d.ts +1 -1
  4. package/core.d.ts +1 -1
  5. package/dist/cli/index.d.mts +1 -1
  6. package/dist/cli/index.d.ts +1 -1
  7. package/dist/cli/index.mjs +1 -18
  8. package/dist/config/index.d.mts +1 -6
  9. package/dist/config/index.d.ts +1 -6
  10. package/dist/config/index.mjs +1 -5
  11. package/dist/core/index.d.mts +1 -69
  12. package/dist/core/index.d.ts +1 -69
  13. package/dist/core/index.mjs +1 -2435
  14. package/dist/kit/index.d.mts +1 -44
  15. package/dist/kit/index.d.ts +1 -44
  16. package/dist/kit/index.mjs +1 -71
  17. package/dist/meta/index.d.mts +1 -3
  18. package/dist/meta/index.d.ts +1 -3
  19. package/dist/meta/index.mjs +1 -3
  20. package/dist/presets/index.d.mts +1 -1
  21. package/dist/presets/index.d.ts +1 -2
  22. package/dist/presets/index.mjs +1 -1
  23. package/dist/rollup/index.d.mts +1 -5
  24. package/dist/rollup/index.d.ts +1 -5
  25. package/dist/rollup/index.mjs +1 -2033
  26. package/dist/runtime/index.d.mts +1 -0
  27. package/dist/runtime/index.d.ts +1 -12
  28. package/dist/runtime/index.mjs +1 -17
  29. package/dist/types/index.d.mts +1 -260
  30. package/dist/types/index.d.ts +1 -260
  31. package/dist/types/index.mjs +1 -1
  32. package/kit.d.ts +1 -1
  33. package/meta.d.ts +1 -1
  34. package/package.json +6 -172
  35. package/presets.d.ts +1 -1
  36. package/rollup.d.ts +1 -1
  37. package/runtime-meta.d.ts +1 -4
  38. package/runtime-meta.mjs +1 -30
  39. package/runtime.d.ts +1 -1
  40. package/types.d.ts +1 -1
  41. package/dist/cli/build.mjs +0 -47
  42. package/dist/cli/common.mjs +0 -13
  43. package/dist/cli/dev.mjs +0 -63
  44. package/dist/cli/index2.mjs +0 -14
  45. package/dist/cli/list.mjs +0 -28
  46. package/dist/cli/prepare.mjs +0 -21
  47. package/dist/cli/run.mjs +0 -57
  48. package/dist/presets/_all.gen.d.ts +0 -2
  49. package/dist/presets/_all.gen.mjs +0 -52
  50. package/dist/presets/_nitro/base-worker.d.ts +0 -2
  51. package/dist/presets/_nitro/base-worker.mjs +0 -25
  52. package/dist/presets/_nitro/nitro-dev.d.ts +0 -2
  53. package/dist/presets/_nitro/nitro-dev.mjs +0 -19
  54. package/dist/presets/_nitro/nitro-prerender.d.ts +0 -2
  55. package/dist/presets/_nitro/nitro-prerender.mjs +0 -17
  56. package/dist/presets/_nitro/preset.d.ts +0 -2
  57. package/dist/presets/_nitro/preset.mjs +0 -5
  58. package/dist/presets/_nitro/runtime/nitro-dev.d.ts +0 -1
  59. package/dist/presets/_nitro/runtime/nitro-dev.mjs +0 -86
  60. package/dist/presets/_nitro/runtime/nitro-prerenderer.d.ts +0 -3
  61. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +0 -7
  62. package/dist/presets/_nitro/runtime/service-worker.d.ts +0 -1
  63. package/dist/presets/_nitro/runtime/service-worker.mjs +0 -31
  64. package/dist/presets/_nitro/service-worker.d.ts +0 -2
  65. package/dist/presets/_nitro/service-worker.mjs +0 -110
  66. package/dist/presets/_resolve.d.ts +0 -8
  67. package/dist/presets/_resolve.mjs +0 -44
  68. package/dist/presets/_static/preset.d.ts +0 -2
  69. package/dist/presets/_static/preset.mjs +0 -69
  70. package/dist/presets/_types.gen.d.ts +0 -16
  71. package/dist/presets/_types.gen.mjs +0 -0
  72. package/dist/presets/alwaysdata/preset.d.ts +0 -2
  73. package/dist/presets/alwaysdata/preset.mjs +0 -14
  74. package/dist/presets/aws-amplify/preset.d.ts +0 -3
  75. package/dist/presets/aws-amplify/preset.mjs +0 -27
  76. package/dist/presets/aws-amplify/runtime/aws-amplify.d.ts +0 -1
  77. package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +0 -13
  78. package/dist/presets/aws-amplify/types.d.ts +0 -141
  79. package/dist/presets/aws-amplify/types.mjs +0 -0
  80. package/dist/presets/aws-amplify/utils.d.ts +0 -2
  81. package/dist/presets/aws-amplify/utils.mjs +0 -82
  82. package/dist/presets/aws-lambda/preset.d.ts +0 -2
  83. package/dist/presets/aws-lambda/preset.mjs +0 -21
  84. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.ts +0 -15
  85. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +0 -53
  86. package/dist/presets/aws-lambda/runtime/aws-lambda.d.ts +0 -4
  87. package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +0 -45
  88. package/dist/presets/azure/preset.d.ts +0 -3
  89. package/dist/presets/azure/preset.mjs +0 -44
  90. package/dist/presets/azure/runtime/azure-functions.d.ts +0 -5
  91. package/dist/presets/azure/runtime/azure-functions.mjs +0 -24
  92. package/dist/presets/azure/runtime/azure-swa.d.ts +0 -5
  93. package/dist/presets/azure/runtime/azure-swa.mjs +0 -30
  94. package/dist/presets/azure/types.d.ts +0 -13
  95. package/dist/presets/azure/types.mjs +0 -0
  96. package/dist/presets/azure/utils.d.ts +0 -3
  97. package/dist/presets/azure/utils.mjs +0 -183
  98. package/dist/presets/bun/preset.d.ts +0 -2
  99. package/dist/presets/bun/preset.mjs +0 -17
  100. package/dist/presets/bun/runtime/bun.d.ts +0 -1
  101. package/dist/presets/bun/runtime/bun.mjs +0 -32
  102. package/dist/presets/cleavr/preset.d.ts +0 -2
  103. package/dist/presets/cleavr/preset.mjs +0 -12
  104. package/dist/presets/cloudflare/preset.d.ts +0 -3
  105. package/dist/presets/cloudflare/preset.mjs +0 -145
  106. package/dist/presets/cloudflare/runtime/cloudflare-module.d.ts +0 -13
  107. package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +0 -102
  108. package/dist/presets/cloudflare/runtime/cloudflare-pages.d.ts +0 -20
  109. package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +0 -55
  110. package/dist/presets/cloudflare/runtime/cloudflare-worker.d.ts +0 -1
  111. package/dist/presets/cloudflare/runtime/cloudflare-worker.mjs +0 -63
  112. package/dist/presets/cloudflare/types.d.ts +0 -89
  113. package/dist/presets/cloudflare/types.mjs +0 -0
  114. package/dist/presets/cloudflare/types.wrangler.d.ts +0 -974
  115. package/dist/presets/cloudflare/types.wrangler.mjs +0 -0
  116. package/dist/presets/cloudflare/utils.d.ts +0 -3
  117. package/dist/presets/cloudflare/utils.mjs +0 -163
  118. package/dist/presets/deno/preset.d.ts +0 -2
  119. package/dist/presets/deno/preset.mjs +0 -148
  120. package/dist/presets/deno/runtime/_deno-env-polyfill.d.ts +0 -0
  121. package/dist/presets/deno/runtime/_deno-env-polyfill.mjs +0 -1
  122. package/dist/presets/deno/runtime/deno-deploy.d.ts +0 -2
  123. package/dist/presets/deno/runtime/deno-deploy.mjs +0 -32
  124. package/dist/presets/deno/runtime/deno-server.d.ts +0 -4
  125. package/dist/presets/deno/runtime/deno-server.mjs +0 -66
  126. package/dist/presets/digitalocean/preset.d.ts +0 -2
  127. package/dist/presets/digitalocean/preset.mjs +0 -11
  128. package/dist/presets/edgio/preset.d.ts +0 -2
  129. package/dist/presets/edgio/preset.mjs +0 -95
  130. package/dist/presets/firebase/preset.d.ts +0 -3
  131. package/dist/presets/firebase/preset.mjs +0 -51
  132. package/dist/presets/firebase/runtime/firebase-gen-1.d.ts +0 -2
  133. package/dist/presets/firebase/runtime/firebase-gen-1.mjs +0 -8
  134. package/dist/presets/firebase/runtime/firebase-gen-2.d.ts +0 -2
  135. package/dist/presets/firebase/runtime/firebase-gen-2.mjs +0 -15
  136. package/dist/presets/firebase/runtime/firebase-gen-default.d.ts +0 -1
  137. package/dist/presets/firebase/runtime/firebase-gen-default.mjs +0 -1
  138. package/dist/presets/firebase/types.d.ts +0 -37
  139. package/dist/presets/firebase/types.mjs +0 -0
  140. package/dist/presets/firebase/utils.d.ts +0 -3
  141. package/dist/presets/firebase/utils.mjs +0 -50
  142. package/dist/presets/flightcontrol/preset.d.ts +0 -2
  143. package/dist/presets/flightcontrol/preset.mjs +0 -11
  144. package/dist/presets/heroku/preset.d.ts +0 -2
  145. package/dist/presets/heroku/preset.mjs +0 -11
  146. package/dist/presets/iis/preset.d.ts +0 -2
  147. package/dist/presets/iis/preset.mjs +0 -32
  148. package/dist/presets/iis/utils.d.ts +0 -3
  149. package/dist/presets/iis/utils.mjs +0 -159
  150. package/dist/presets/koyeb/preset.d.ts +0 -2
  151. package/dist/presets/koyeb/preset.mjs +0 -11
  152. package/dist/presets/netlify/legacy/preset.d.ts +0 -2
  153. package/dist/presets/netlify/legacy/preset.mjs +0 -142
  154. package/dist/presets/netlify/legacy/runtime/_deno-env-polyfill.d.ts +0 -0
  155. package/dist/presets/netlify/legacy/runtime/_deno-env-polyfill.mjs +0 -1
  156. package/dist/presets/netlify/legacy/runtime/netlify-builder.d.ts +0 -3
  157. package/dist/presets/netlify/legacy/runtime/netlify-builder.mjs +0 -5
  158. package/dist/presets/netlify/legacy/runtime/netlify-edge.d.ts +0 -3
  159. package/dist/presets/netlify/legacy/runtime/netlify-edge.mjs +0 -26
  160. package/dist/presets/netlify/legacy/runtime/netlify-lambda.d.ts +0 -4
  161. package/dist/presets/netlify/legacy/runtime/netlify-lambda.mjs +0 -39
  162. package/dist/presets/netlify/legacy/runtime/netlify.d.ts +0 -4
  163. package/dist/presets/netlify/legacy/runtime/netlify.mjs +0 -22
  164. package/dist/presets/netlify/legacy/utils.d.ts +0 -4
  165. package/dist/presets/netlify/legacy/utils.mjs +0 -113
  166. package/dist/presets/netlify/preset.d.ts +0 -3
  167. package/dist/presets/netlify/preset.mjs +0 -127
  168. package/dist/presets/netlify/runtime/_deno-env-polyfill.d.ts +0 -0
  169. package/dist/presets/netlify/runtime/_deno-env-polyfill.mjs +0 -1
  170. package/dist/presets/netlify/runtime/netlify-edge.d.ts +0 -2
  171. package/dist/presets/netlify/runtime/netlify-edge.mjs +0 -25
  172. package/dist/presets/netlify/runtime/netlify.d.ts +0 -4
  173. package/dist/presets/netlify/runtime/netlify.mjs +0 -54
  174. package/dist/presets/netlify/types.d.ts +0 -12
  175. package/dist/presets/netlify/types.mjs +0 -0
  176. package/dist/presets/netlify/utils.d.ts +0 -5
  177. package/dist/presets/netlify/utils.mjs +0 -94
  178. package/dist/presets/node/preset.d.ts +0 -2
  179. package/dist/presets/node/preset.mjs +0 -49
  180. package/dist/presets/node/runtime/cli.d.ts +0 -1
  181. package/dist/presets/node/runtime/cli.mjs +0 -21
  182. package/dist/presets/node/runtime/cluster.d.ts +0 -1
  183. package/dist/presets/node/runtime/cluster.mjs +0 -60
  184. package/dist/presets/node/runtime/node-listener.d.ts +0 -6
  185. package/dist/presets/node/runtime/node-listener.mjs +0 -15
  186. package/dist/presets/node/runtime/node-server.d.ts +0 -3
  187. package/dist/presets/node/runtime/node-server.mjs +0 -44
  188. package/dist/presets/platform.sh/preset.d.ts +0 -2
  189. package/dist/presets/platform.sh/preset.mjs +0 -11
  190. package/dist/presets/render.com/preset.d.ts +0 -2
  191. package/dist/presets/render.com/preset.mjs +0 -11
  192. package/dist/presets/stormkit/preset.d.ts +0 -2
  193. package/dist/presets/stormkit/preset.mjs +0 -15
  194. package/dist/presets/stormkit/runtime/stormkit.d.ts +0 -21
  195. package/dist/presets/stormkit/runtime/stormkit.mjs +0 -32
  196. package/dist/presets/vercel/preset.d.ts +0 -3
  197. package/dist/presets/vercel/preset.mjs +0 -104
  198. package/dist/presets/vercel/runtime/vercel-edge.d.ts +0 -2
  199. package/dist/presets/vercel/runtime/vercel-edge.mjs +0 -22
  200. package/dist/presets/vercel/runtime/vercel.d.ts +0 -4
  201. package/dist/presets/vercel/runtime/vercel.mjs +0 -17
  202. package/dist/presets/vercel/types.d.ts +0 -78
  203. package/dist/presets/vercel/types.mjs +0 -0
  204. package/dist/presets/vercel/utils.d.ts +0 -5
  205. package/dist/presets/vercel/utils.mjs +0 -186
  206. package/dist/presets/winterjs/preset.d.ts +0 -2
  207. package/dist/presets/winterjs/preset.mjs +0 -20
  208. package/dist/presets/winterjs/runtime/winterjs.d.ts +0 -1
  209. package/dist/presets/winterjs/runtime/winterjs.mjs +0 -69
  210. package/dist/presets/zeabur/preset.d.ts +0 -2
  211. package/dist/presets/zeabur/preset.mjs +0 -70
  212. package/dist/presets/zeabur/runtime/zeabur.d.ts +0 -4
  213. package/dist/presets/zeabur/runtime/zeabur.mjs +0 -8
  214. package/dist/runtime/app.d.ts +0 -2
  215. package/dist/runtime/app.mjs +0 -1
  216. package/dist/runtime/cache.d.ts +0 -1
  217. package/dist/runtime/cache.mjs +0 -6
  218. package/dist/runtime/config.d.ts +0 -1
  219. package/dist/runtime/config.mjs +0 -1
  220. package/dist/runtime/context.d.ts +0 -1
  221. package/dist/runtime/context.mjs +0 -1
  222. package/dist/runtime/database.d.ts +0 -1
  223. package/dist/runtime/database.mjs +0 -1
  224. package/dist/runtime/error.d.ts +0 -1
  225. package/dist/runtime/error.mjs +0 -1
  226. package/dist/runtime/internal/app.d.ts +0 -3
  227. package/dist/runtime/internal/app.mjs +0 -152
  228. package/dist/runtime/internal/cache.d.ts +0 -8
  229. package/dist/runtime/internal/cache.mjs +0 -329
  230. package/dist/runtime/internal/client.d.ts +0 -1
  231. package/dist/runtime/internal/client.mjs +0 -4
  232. package/dist/runtime/internal/config.d.ts +0 -6
  233. package/dist/runtime/internal/config.mjs +0 -58
  234. package/dist/runtime/internal/context.d.ts +0 -12
  235. package/dist/runtime/internal/context.mjs +0 -17
  236. package/dist/runtime/internal/database.d.ts +0 -2
  237. package/dist/runtime/internal/database.mjs +0 -14
  238. package/dist/runtime/internal/debug.d.ts +0 -2
  239. package/dist/runtime/internal/debug.mjs +0 -5
  240. package/dist/runtime/internal/error.d.ts +0 -4
  241. package/dist/runtime/internal/error.mjs +0 -71
  242. package/dist/runtime/internal/index.d.ts +0 -6
  243. package/dist/runtime/internal/index.mjs +0 -16
  244. package/dist/runtime/internal/lib/http-graceful-shutdown.d.ts +0 -16
  245. package/dist/runtime/internal/lib/http-graceful-shutdown.mjs +0 -213
  246. package/dist/runtime/internal/meta.d.ts +0 -2
  247. package/dist/runtime/internal/meta.mjs +0 -3
  248. package/dist/runtime/internal/plugin.d.ts +0 -3
  249. package/dist/runtime/internal/plugin.mjs +0 -4
  250. package/dist/runtime/internal/renderer.d.ts +0 -2
  251. package/dist/runtime/internal/renderer.mjs +0 -38
  252. package/dist/runtime/internal/route-rules.d.ts +0 -14
  253. package/dist/runtime/internal/route-rules.mjs +0 -67
  254. package/dist/runtime/internal/routes/openapi.d.ts +0 -3
  255. package/dist/runtime/internal/routes/openapi.mjs +0 -85
  256. package/dist/runtime/internal/routes/scalar.d.ts +0 -2
  257. package/dist/runtime/internal/routes/scalar.mjs +0 -191
  258. package/dist/runtime/internal/routes/swagger.d.ts +0 -2
  259. package/dist/runtime/internal/routes/swagger.mjs +0 -39
  260. package/dist/runtime/internal/shutdown.d.ts +0 -10
  261. package/dist/runtime/internal/shutdown.mjs +0 -34
  262. package/dist/runtime/internal/static.d.ts +0 -2
  263. package/dist/runtime/internal/static.mjs +0 -89
  264. package/dist/runtime/internal/storage.d.ts +0 -2
  265. package/dist/runtime/internal/storage.mjs +0 -5
  266. package/dist/runtime/internal/task.d.ts +0 -17
  267. package/dist/runtime/internal/task.mjs +0 -73
  268. package/dist/runtime/internal/timing.d.ts +0 -2
  269. package/dist/runtime/internal/timing.mjs +0 -29
  270. package/dist/runtime/internal/utils.azure.d.ts +0 -2
  271. package/dist/runtime/internal/utils.azure.mjs +0 -51
  272. package/dist/runtime/internal/utils.d.ts +0 -23
  273. package/dist/runtime/internal/utils.env.d.ts +0 -7
  274. package/dist/runtime/internal/utils.env.mjs +0 -39
  275. package/dist/runtime/internal/utils.lambda.d.ts +0 -12
  276. package/dist/runtime/internal/utils.lambda.mjs +0 -30
  277. package/dist/runtime/internal/utils.mjs +0 -129
  278. package/dist/runtime/plugin.d.ts +0 -1
  279. package/dist/runtime/plugin.mjs +0 -1
  280. package/dist/runtime/storage.d.ts +0 -1
  281. package/dist/runtime/storage.mjs +0 -1
  282. package/dist/runtime/task.d.ts +0 -1
  283. package/dist/runtime/task.mjs +0 -1
  284. package/dist/runtime/utils.d.ts +0 -1
  285. package/dist/runtime/utils.mjs +0 -1
  286. package/dist/shared/nitro.DkCt8MDS.d.mts +0 -588
  287. package/dist/shared/nitro.DkCt8MDS.d.ts +0 -588
@@ -1,85 +0,0 @@
1
- import { eventHandler, getRequestURL } from "h3";
2
- import { joinURL } from "ufo";
3
- import { handlersMeta } from "#nitro-internal-virtual/server-handlers-meta";
4
- import { useRuntimeConfig } from "../config.mjs";
5
- export default eventHandler((event) => {
6
- const runtimeConfig = useRuntimeConfig(event);
7
- const base = runtimeConfig.app?.baseURL;
8
- const url = joinURL(getRequestURL(event).origin, base);
9
- const meta = {
10
- title: "Nitro Server Routes",
11
- ...runtimeConfig.nitro?.openAPI?.meta
12
- };
13
- return {
14
- openapi: "3.1.0",
15
- info: {
16
- title: meta?.title,
17
- version: meta?.version,
18
- description: meta?.description
19
- },
20
- servers: [
21
- {
22
- url,
23
- description: "Local Development Server",
24
- variables: {}
25
- }
26
- ],
27
- paths: getPaths()
28
- };
29
- });
30
- function getPaths() {
31
- const paths = {};
32
- for (const h of handlersMeta) {
33
- const { route, parameters } = normalizeRoute(h.route || "");
34
- const tags = defaultTags(h.route || "");
35
- const method = (h.method || "get").toLowerCase();
36
- const item = {
37
- [method]: {
38
- tags,
39
- parameters,
40
- responses: {
41
- 200: { description: "OK" }
42
- },
43
- ...h.meta?.openAPI
44
- }
45
- };
46
- if (paths[route] === void 0) {
47
- paths[route] = item;
48
- } else {
49
- Object.assign(paths[route], item);
50
- }
51
- }
52
- return paths;
53
- }
54
- function normalizeRoute(_route) {
55
- const parameters = [];
56
- let anonymousCtr = 0;
57
- const route = _route.replace(/:(\w+)/g, (_, name) => `{${name}}`).replace(/\/(\*)\//g, () => `/{param${++anonymousCtr}}/`).replace(/\*\*{/, "{").replace(/\/(\*\*)$/g, () => `/{*param${++anonymousCtr}}`);
58
- const paramMatches = route.matchAll(/{(\*?\w+)}/g);
59
- for (const match of paramMatches) {
60
- const name = match[1];
61
- if (!parameters.some((p) => p.name === name)) {
62
- parameters.push({
63
- name,
64
- in: "path",
65
- required: true,
66
- schema: { type: "string" }
67
- });
68
- }
69
- }
70
- return {
71
- route,
72
- parameters
73
- };
74
- }
75
- function defaultTags(route) {
76
- const tags = [];
77
- if (route.startsWith("/api/")) {
78
- tags.push("API Routes");
79
- } else if (route.startsWith("/_")) {
80
- tags.push("Internal");
81
- } else {
82
- tags.push("App Routes");
83
- }
84
- return tags;
85
- }
@@ -1,2 +0,0 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, string>;
2
- export default _default;
@@ -1,191 +0,0 @@
1
- import { eventHandler } from "h3";
2
- import { useRuntimeConfig } from "../config.mjs";
3
- export default eventHandler((event) => {
4
- const runtimeConfig = useRuntimeConfig(event);
5
- const configuration = {
6
- ...runtimeConfig.nitro.openAPI?.ui?.scalar,
7
- spec: {
8
- url: "/_nitro/openapi.json",
9
- ...runtimeConfig.nitro.openAPI?.ui?.scalar?.spec
10
- }
11
- };
12
- const title = "Nitro Scalar API Reference";
13
- return (
14
- /* html */
15
- `<!doctype html>
16
- <html lang="en">
17
- <head>
18
- <meta charset="utf-8" />
19
- <meta name="viewport" content="width=device-width, initial-scale=1" />
20
- <meta name="description" content="${title}" />
21
- <title>${title}</title>
22
- <style>
23
- ${configuration.theme ? null : customTheme}
24
- </style>
25
- </head>
26
- <body>
27
- <script
28
- id="api-reference"
29
- data-configuration="${JSON.stringify(configuration).split('"').join("&quot;")}"
30
- ><\/script>
31
- <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"><\/script>
32
- </body>
33
- </html>`
34
- );
35
- });
36
- const customTheme = (
37
- /* css */
38
- `/* basic theme */
39
- .light-mode,
40
- .light-mode .dark-mode {
41
- --theme-background-1: #fff;
42
- --theme-background-2: #fafafa;
43
- --theme-background-3: rgb(245 245 245);
44
-
45
- --theme-color-1: #2a2f45;
46
- --theme-color-2: #757575;
47
- --theme-color-3: #8e8e8e;
48
-
49
- --theme-color-accent: #ef4444;
50
- --theme-background-accent: transparent;
51
-
52
- --theme-border-color: rgba(0, 0, 0, 0.1);
53
- }
54
- .dark-mode {
55
- --theme-background-1: #171717;
56
- --theme-background-2: #262626;
57
- --theme-background-3: #2e2e2e;
58
-
59
- --theme-color-1: rgba(255, 255, 255, 0.9);
60
- --theme-color-2: rgba(255, 255, 255, 0.62);
61
- --theme-color-3: rgba(255, 255, 255, 0.44);
62
-
63
- --theme-color-accent: #f87171;
64
- --theme-background-accent: transparent;
65
-
66
- --theme-border-color: rgba(255, 255, 255, 0.1);
67
- }
68
-
69
- /* Document Sidebar */
70
- .light-mode .t-doc__sidebar,
71
- .dark-mode .t-doc__sidebar {
72
- --sidebar-background-1: var(--theme-background-1);
73
- --sidebar-color-1: var(--theme-color-1);
74
- --sidebar-color-2: var(--theme-color-2);
75
- --sidebar-border-color: var(--theme-border-color);
76
-
77
- --sidebar-item-hover-background: transparent;
78
- --sidebar-item-hover-color: var(--sidebar-color-1);
79
-
80
- --sidebar-item-active-background: var(--theme-background-accent);
81
- --sidebar-color-active: var(--theme-color-accent);
82
-
83
- --sidebar-search-background: transparent;
84
- --sidebar-search-color: var(--theme-color-3);
85
- --sidebar-search-border-color: var(--theme-border-color);
86
- }
87
-
88
- /* advanced */
89
- .light-mode .dark-mode,
90
- .light-mode {
91
- --theme-color-green: #91b859;
92
- --theme-color-red: #e53935;
93
- --theme-color-yellow: #e2931d;
94
- --theme-color-blue: #6182b8;
95
- --theme-color-orange: #f76d47;
96
- --theme-color-purple: #9c3eda;
97
- }
98
- .dark-mode {
99
- --theme-color-green: #c3e88d;
100
- --theme-color-red: #f07178;
101
- --theme-color-yellow: #ffcb6b;
102
- --theme-color-blue: #82aaff;
103
- --theme-color-orange: #f78c6c;
104
- --theme-color-purple: #c792ea;
105
- }
106
- /* custom-theme */
107
- .section-container:nth-of-type(2)
108
- ~ .section-container
109
- .scalar-card
110
- .scalar-card-header {
111
- --theme-background-2: var(--theme-background-1) !important;
112
- }
113
- .section-flare {
114
- width: 100%;
115
- height: 100%;
116
- position: absolute;
117
- top: 0;
118
- left: 0;
119
- animation: spin 39s linear infinite;
120
- transition: all 0.3s ease-in-out;
121
- opacity: 1;
122
- }
123
- .section-flare-item:nth-of-type(1),
124
- .section-flare-item:nth-of-type(2),
125
- .section-flare-item:nth-of-type(3) {
126
- content: "";
127
- width: 1000px;
128
- height: 1000px;
129
- position: absolute;
130
- top: 0;
131
- right: 0;
132
- border-radius: 50%;
133
- background: var(--default-theme-background-1);
134
- display: block;
135
- opacity: 1;
136
- filter: blur(48px);
137
- -webkit-backface-visibility: hidden;
138
- -webkit-perspective: 1000;
139
- -webkit-transform: translate3d(0, 0, 0);
140
- -webkit-transform: translateZ(0);
141
- perspective: 1000;
142
- transform: translate3d(0, 0, 0);
143
- transform: translateZ(0);
144
- }
145
- .section-flare-item:nth-of-type(2) {
146
- top: initial;
147
- right: initial;
148
- background: #ef4444;
149
- width: 700px;
150
- height: 700px;
151
- opacity: 0.3;
152
- animation: sectionflare 37s linear infinite;
153
- }
154
- .section-flare-item:nth-of-type(1) {
155
- top: initial;
156
- right: initial;
157
- bottom: 0;
158
- left: -20px;
159
- background: #ef4444;
160
- width: 500px;
161
- height: 500px;
162
- opacity: 0.3;
163
- animation: sectionflare2 38s linear infinite;
164
- }
165
- @keyframes sectionflare {
166
- 0%,
167
- 100% {
168
- transform: translate3d(0, 0, 0);
169
- }
170
- 50% {
171
- transform: translate3d(525px, 525px, 0);
172
- }
173
- }
174
- @keyframes sectionflare2 {
175
- 0%,
176
- 100% {
177
- transform: translate3d(700px, 700px, 0);
178
- }
179
- 50% {
180
- transform: translate3d(0, 0, 0);
181
- }
182
- }
183
- @keyframes spin {
184
- 100% {
185
- transform: rotate(360deg);
186
- }
187
- }
188
- .section-container:nth-of-type(2) {
189
- overflow: hidden;
190
- }`
191
- );
@@ -1,2 +0,0 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, string>;
2
- export default _default;
@@ -1,39 +0,0 @@
1
- import { eventHandler } from "h3";
2
- export default eventHandler((event) => {
3
- const title = "Nitro Swagger UI";
4
- const CDN_BASE = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@^5";
5
- return (
6
- /* html */
7
- `<!doctype html>
8
- <html lang="en">
9
- <head>
10
- <meta charset="utf-8" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- <meta name="description" content="${title}" />
13
- <title>${title}</title>
14
- <link rel="stylesheet" href="${CDN_BASE}/swagger-ui.css" />
15
- </head>
16
- <body>
17
- <div id="swagger-ui"></div>
18
- <script src="${CDN_BASE}/swagger-ui-bundle.js" crossorigin><\/script>
19
- <script
20
- src="${CDN_BASE}/swagger-ui-standalone-preset.js"
21
- crossorigin
22
- ><\/script>
23
- <script>
24
- window.onload = () => {
25
- window.ui = SwaggerUIBundle({
26
- url: "./openapi.json",
27
- dom_id: "#swagger-ui",
28
- presets: [
29
- SwaggerUIBundle.presets.apis,
30
- SwaggerUIStandalonePreset,
31
- ],
32
- layout2: "StandaloneLayout",
33
- });
34
- };
35
- <\/script>
36
- </body>
37
- </html> `
38
- );
39
- });
@@ -1,10 +0,0 @@
1
- /// <reference types="node" />
2
- import type { Server as HttpServer } from "node:http";
3
- import type { NitroApp } from "nitropack/types";
4
- export declare function getGracefulShutdownConfig(): {
5
- disabled: boolean;
6
- signals: string[];
7
- timeout: number;
8
- forceExit: boolean;
9
- };
10
- export declare function setupGracefulShutdown(listener: HttpServer, nitroApp: NitroApp): void;
@@ -1,34 +0,0 @@
1
- import gracefulShutdown from "./lib/http-graceful-shutdown.mjs";
2
- export function getGracefulShutdownConfig() {
3
- return {
4
- disabled: !!process.env.NITRO_SHUTDOWN_DISABLED,
5
- signals: (process.env.NITRO_SHUTDOWN_SIGNALS || "SIGTERM SIGINT").split(" ").map((s) => s.trim()),
6
- timeout: Number.parseInt(process.env.NITRO_SHUTDOWN_TIMEOUT || "", 10) || 3e4,
7
- forceExit: !process.env.NITRO_SHUTDOWN_NO_FORCE_EXIT
8
- };
9
- }
10
- export function setupGracefulShutdown(listener, nitroApp) {
11
- const shutdownConfig = getGracefulShutdownConfig();
12
- if (shutdownConfig.disabled) {
13
- return;
14
- }
15
- gracefulShutdown(listener, {
16
- signals: shutdownConfig.signals.join(" "),
17
- timeout: shutdownConfig.timeout,
18
- forceExit: shutdownConfig.forceExit,
19
- onShutdown: async () => {
20
- await new Promise((resolve) => {
21
- const timeout = setTimeout(() => {
22
- console.warn("Graceful shutdown timeout, force exiting...");
23
- resolve();
24
- }, shutdownConfig.timeout);
25
- nitroApp.hooks.callHook("close").catch((error) => {
26
- console.error(error);
27
- }).finally(() => {
28
- clearTimeout(timeout);
29
- resolve();
30
- });
31
- });
32
- }
33
- });
34
- }
@@ -1,2 +0,0 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
2
- export default _default;
@@ -1,89 +0,0 @@
1
- import {
2
- eventHandler,
3
- createError,
4
- getRequestHeader,
5
- getResponseHeader,
6
- setResponseHeader,
7
- setResponseStatus,
8
- removeResponseHeader
9
- } from "h3";
10
- import {
11
- decodePath,
12
- joinURL,
13
- parseURL,
14
- withLeadingSlash,
15
- withoutTrailingSlash
16
- } from "ufo";
17
- import {
18
- getAsset,
19
- readAsset,
20
- isPublicAssetURL
21
- } from "#nitro-internal-virtual/public-assets";
22
- const METHODS = /* @__PURE__ */ new Set(["HEAD", "GET"]);
23
- const EncodingMap = { gzip: ".gz", br: ".br" };
24
- export default eventHandler((event) => {
25
- if (event.method && !METHODS.has(event.method)) {
26
- return;
27
- }
28
- let id = decodePath(
29
- withLeadingSlash(withoutTrailingSlash(parseURL(event.path).pathname))
30
- );
31
- let asset;
32
- const encodingHeader = String(
33
- getRequestHeader(event, "accept-encoding") || ""
34
- );
35
- const encodings = [
36
- ...encodingHeader.split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(),
37
- ""
38
- ];
39
- if (encodings.length > 1) {
40
- setResponseHeader(event, "Vary", "Accept-Encoding");
41
- }
42
- for (const encoding of encodings) {
43
- for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) {
44
- const _asset = getAsset(_id);
45
- if (_asset) {
46
- asset = _asset;
47
- id = _id;
48
- break;
49
- }
50
- }
51
- }
52
- if (!asset) {
53
- if (isPublicAssetURL(id)) {
54
- removeResponseHeader(event, "Cache-Control");
55
- throw createError({
56
- statusMessage: "Cannot find static asset " + id,
57
- statusCode: 404
58
- });
59
- }
60
- return;
61
- }
62
- const ifNotMatch = getRequestHeader(event, "if-none-match") === asset.etag;
63
- if (ifNotMatch) {
64
- setResponseStatus(event, 304, "Not Modified");
65
- return "";
66
- }
67
- const ifModifiedSinceH = getRequestHeader(event, "if-modified-since");
68
- const mtimeDate = new Date(asset.mtime);
69
- if (ifModifiedSinceH && asset.mtime && new Date(ifModifiedSinceH) >= mtimeDate) {
70
- setResponseStatus(event, 304, "Not Modified");
71
- return "";
72
- }
73
- if (asset.type && !getResponseHeader(event, "Content-Type")) {
74
- setResponseHeader(event, "Content-Type", asset.type);
75
- }
76
- if (asset.etag && !getResponseHeader(event, "ETag")) {
77
- setResponseHeader(event, "ETag", asset.etag);
78
- }
79
- if (asset.mtime && !getResponseHeader(event, "Last-Modified")) {
80
- setResponseHeader(event, "Last-Modified", mtimeDate.toUTCString());
81
- }
82
- if (asset.encoding && !getResponseHeader(event, "Content-Encoding")) {
83
- setResponseHeader(event, "Content-Encoding", asset.encoding);
84
- }
85
- if (asset.size > 0 && !getResponseHeader(event, "Content-Length")) {
86
- setResponseHeader(event, "Content-Length", asset.size);
87
- }
88
- return readAsset(id);
89
- });
@@ -1,2 +0,0 @@
1
- import type { Storage, StorageValue } from "unstorage";
2
- export declare function useStorage<T extends StorageValue = StorageValue>(base?: string): Storage<T>;
@@ -1,5 +0,0 @@
1
- import { prefixStorage } from "unstorage";
2
- import { storage } from "#nitro-internal-virtual/storage";
3
- export function useStorage(base = "") {
4
- return base ? prefixStorage(storage, base) : storage;
5
- }
@@ -1,17 +0,0 @@
1
- import type { Task, TaskResult, TaskPayload, TaskContext } from "nitropack/types";
2
- /** @experimental */
3
- export declare function defineTask<RT = unknown>(def: Task<RT>): Task<RT>;
4
- /** @experimental */
5
- export declare function runTask<RT = unknown>(name: string, { payload, context, }?: {
6
- payload?: TaskPayload;
7
- context?: TaskContext;
8
- }): Promise<TaskResult<RT>>;
9
- /** @experimental */
10
- export declare function startScheduleRunner(): void;
11
- /** @experimental */
12
- export declare function getCronTasks(cron: string): string[];
13
- /** @experimental */
14
- export declare function runCronTasks(cron: string, ctx: {
15
- payload?: TaskPayload;
16
- context?: TaskContext;
17
- }): Promise<TaskResult[]>;
@@ -1,73 +0,0 @@
1
- import { createError } from "h3";
2
- import { Cron } from "croner";
3
- import { isTest } from "std-env";
4
- import { tasks, scheduledTasks } from "#nitro-internal-virtual/tasks";
5
- export function defineTask(def) {
6
- if (typeof def.run !== "function") {
7
- def.run = () => {
8
- throw new TypeError("Task must implement a `run` method!");
9
- };
10
- }
11
- return def;
12
- }
13
- const __runningTasks__ = {};
14
- export async function runTask(name, {
15
- payload = {},
16
- context = {}
17
- } = {}) {
18
- if (__runningTasks__[name]) {
19
- return __runningTasks__[name];
20
- }
21
- if (!(name in tasks)) {
22
- throw createError({
23
- message: `Task \`${name}\` is not available!`,
24
- statusCode: 404
25
- });
26
- }
27
- if (!tasks[name].resolve) {
28
- throw createError({
29
- message: `Task \`${name}\` is not implemented!`,
30
- statusCode: 501
31
- });
32
- }
33
- const handler = await tasks[name].resolve();
34
- const taskEvent = { name, payload, context };
35
- __runningTasks__[name] = handler.run(taskEvent);
36
- try {
37
- const res = await __runningTasks__[name];
38
- return res;
39
- } finally {
40
- delete __runningTasks__[name];
41
- }
42
- }
43
- export function startScheduleRunner() {
44
- if (!scheduledTasks || scheduledTasks.length === 0 || isTest) {
45
- return;
46
- }
47
- const payload = {
48
- scheduledTime: Date.now()
49
- };
50
- for (const schedule of scheduledTasks) {
51
- const cron = new Cron(schedule.cron, async () => {
52
- await Promise.all(
53
- schedule.tasks.map(
54
- (name) => runTask(name, {
55
- payload,
56
- context: {}
57
- }).catch((error) => {
58
- console.error(
59
- `[nitro] Error while running scheduled task "${name}"`,
60
- error
61
- );
62
- })
63
- )
64
- );
65
- });
66
- }
67
- }
68
- export function getCronTasks(cron) {
69
- return (scheduledTasks || []).find((task) => task.cron === cron)?.tasks || [];
70
- }
71
- export function runCronTasks(cron, ctx) {
72
- return Promise.all(getCronTasks(cron).map((name) => runTask(name, ctx)));
73
- }
@@ -1,2 +0,0 @@
1
- declare const _default: NitroAppPlugin;
2
- export default _default;
@@ -1,29 +0,0 @@
1
- import { eventHandler } from "h3";
2
- import { defineNitroPlugin } from "./plugin.mjs";
3
- const globalTiming = globalThis.__timing__ || {
4
- start: () => 0,
5
- end: () => 0,
6
- metrics: []
7
- };
8
- const timingMiddleware = eventHandler((event) => {
9
- const start = globalTiming.start();
10
- const _end = event.node.res.end;
11
- event.node.res.end = function(chunk, encoding, cb) {
12
- const metrics = [
13
- ["Generate", globalTiming.end(start)],
14
- ...globalTiming.metrics
15
- ];
16
- const serverTiming = metrics.map((m) => `-;dur=${m[1]};desc="${encodeURIComponent(m[0])}"`).join(", ");
17
- if (!event.node.res.headersSent) {
18
- event.node.res.setHeader("Server-Timing", serverTiming);
19
- }
20
- _end.call(event.node.res, chunk, encoding, cb);
21
- return this;
22
- }.bind(event.node.res);
23
- });
24
- export default defineNitroPlugin((nitro) => {
25
- nitro.h3App.stack.unshift({
26
- route: "/",
27
- handler: timingMiddleware
28
- });
29
- });
@@ -1,2 +0,0 @@
1
- import type { Cookie } from "@azure/functions";
2
- export declare function getAzureParsedCookiesFromHeaders(headers: Record<string, number | string | string[] | undefined>): Cookie[];
@@ -1,51 +0,0 @@
1
- import { parse } from "cookie-es";
2
- import { splitCookiesString } from "h3";
3
- export function getAzureParsedCookiesFromHeaders(headers) {
4
- const setCookieHeader = headers["set-cookie"];
5
- if (!setCookieHeader || typeof setCookieHeader === "number" || setCookieHeader.length === 0) {
6
- return [];
7
- }
8
- const azureCookies = [];
9
- for (const setCookieStr of splitCookiesString(setCookieHeader)) {
10
- const setCookie = Object.entries(parse(setCookieStr));
11
- if (setCookie.length === 0) {
12
- continue;
13
- }
14
- const [[key, value], ..._setCookieOptions] = setCookie;
15
- const setCookieOptions = Object.fromEntries(
16
- _setCookieOptions.map(([k, v]) => [k.toLowerCase(), v])
17
- );
18
- const cookieObject = {
19
- name: key,
20
- value,
21
- domain: setCookieOptions.domain,
22
- path: setCookieOptions.path,
23
- expires: parseNumberOrDate(setCookieOptions.expires),
24
- sameSite: setCookieOptions.samesite,
25
- maxAge: parseNumber(setCookieOptions["max-age"]),
26
- secure: setCookieStr.includes("Secure") ? true : void 0,
27
- httpOnly: setCookieStr.includes("HttpOnly") ? true : void 0
28
- };
29
- azureCookies.push(cookieObject);
30
- }
31
- return azureCookies;
32
- }
33
- function parseNumberOrDate(expires) {
34
- const expiresAsNumber = parseNumber(expires);
35
- if (expiresAsNumber !== void 0) {
36
- return expiresAsNumber;
37
- }
38
- const expiresAsDate = new Date(expires);
39
- if (!Number.isNaN(expiresAsDate.getTime())) {
40
- return expiresAsDate;
41
- }
42
- }
43
- function parseNumber(maxAge) {
44
- if (!maxAge) {
45
- return void 0;
46
- }
47
- const maxAgeAsNumber = Number(maxAge);
48
- if (!Number.isNaN(maxAgeAsNumber)) {
49
- return maxAgeAsNumber;
50
- }
51
- }
@@ -1,23 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import type { Readable } from "node:stream";
4
- import type { H3Event } from "h3";
5
- export declare function requestHasBody(request: globalThis.Request): boolean;
6
- export declare function useRequestBody(request: globalThis.Request): Promise<any>;
7
- export declare function hasReqHeader(event: H3Event, name: string, includes: string): boolean | "" | undefined;
8
- export declare function isJsonRequest(event: H3Event): boolean;
9
- export declare function normalizeError(error: any): {
10
- stack: {
11
- text: string;
12
- internal: boolean;
13
- }[];
14
- statusCode: any;
15
- statusMessage: any;
16
- message: any;
17
- };
18
- export declare function trapUnhandledNodeErrors(): void;
19
- export declare function joinHeaders(value: number | string | string[]): string;
20
- export declare function normalizeFetchResponse(response: Response): Response;
21
- export declare function normalizeCookieHeader(header?: number | string | string[]): string[];
22
- export declare function normalizeCookieHeaders(headers: Headers): Headers;
23
- export declare function toBuffer(data: ReadableStream | Readable | Uint8Array): Buffer | Promise<Buffer>;
@@ -1,7 +0,0 @@
1
- export type EnvOptions = {
2
- prefix?: string;
3
- altPrefix?: string;
4
- envExpansion?: boolean;
5
- };
6
- export declare function getEnv(key: string, opts: EnvOptions): unknown;
7
- export declare function applyEnv(obj: Record<string, any>, opts: EnvOptions, parentKey?: string): Record<string, any>;