@nuxt/kit 4.3.1 → 4.4.1
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.
- package/README.md +4 -4
- package/dist/index.d.mts +8 -18
- package/dist/index.mjs +307 -11
- package/package.json +8 -8
- package/dist/THIRD-PARTY-LICENSES.md +0 -1129
- package/dist/_chunks/libs/@oxc-project/types.d.mts +0 -1300
- package/dist/_chunks/libs/@rolldown/pluginutils.d.mts +0 -63
- package/dist/_chunks/libs/@rollup/plugin-commonjs.d.mts +0 -1345
- package/dist/_chunks/libs/@vercel/nft.d.mts +0 -114
- package/dist/_chunks/libs/chokidar.d.mts +0 -34
- package/dist/_chunks/libs/compatx.d.mts +0 -47
- package/dist/_chunks/libs/crossws.d.mts +0 -7
- package/dist/_chunks/libs/db0.d.mts +0 -8
- package/dist/_chunks/libs/esbuild.d.mts +0 -137
- package/dist/_chunks/libs/httpxy.d.mts +0 -79
- package/dist/_chunks/libs/ioredis.d.mts +0 -6
- package/dist/_chunks/libs/listhen.d.mts +0 -7
- package/dist/_chunks/libs/magic-string.d.mts +0 -220
- package/dist/_chunks/libs/nitro.d.mts +0 -9879
- package/dist/_chunks/libs/nitropack.d.mts +0 -3343
|
@@ -1,3343 +0,0 @@
|
|
|
1
|
-
import { a as Preset$1, c as Dispatcher, o as BuiltinDriverName, s as Storage } from "./nitro.mjs";
|
|
2
|
-
import { n as CompatibilityDates, t as CompatibilityDateSpec } from "./compatx.mjs";
|
|
3
|
-
import { t as ConnectorName } from "./db0.mjs";
|
|
4
|
-
import { t as ChokidarOptions } from "./chokidar.mjs";
|
|
5
|
-
import { n as OutputOptions, t as InputOptions } from "./@rollup/plugin-commonjs.mjs";
|
|
6
|
-
import { t as ProxyServerOptions } from "./httpxy.mjs";
|
|
7
|
-
import { n as TransformOptions, t as Loader } from "./esbuild.mjs";
|
|
8
|
-
import { t as MagicString } from "./magic-string.mjs";
|
|
9
|
-
import { t as NodeFileTraceOptions } from "./@vercel/nft.mjs";
|
|
10
|
-
import { ConsolaInstance, LogLevel } from "consola";
|
|
11
|
-
import { TSConfig } from "pkg-types";
|
|
12
|
-
import { ESMExport } from "mlly";
|
|
13
|
-
import { C12InputConfig, ConfigWatcher, ResolvedConfig } from "c12";
|
|
14
|
-
import { Unimport } from "unimport";
|
|
15
|
-
import "webpack";
|
|
16
|
-
import "@rspack/core";
|
|
17
|
-
import "vite";
|
|
18
|
-
import { EventHandler, H3Error, H3Event, ProxyOptions, RouterMethod } from "h3";
|
|
19
|
-
import { Duplex } from "node:stream";
|
|
20
|
-
import { EventEmitter } from "node:events";
|
|
21
|
-
import { Socket } from "node:net";
|
|
22
|
-
import "node:worker_threads";
|
|
23
|
-
import { Hookable, NestedHooks } from "hookable";
|
|
24
|
-
import { ExecutionContext, ForwardableEmailMessage, MessageBatch, ScheduledController, TraceItem } from "@cloudflare/workers-types";
|
|
25
|
-
import { DurableObject } from "cloudflare:workers";
|
|
26
|
-
import { RuntimeOptions, region } from "firebase-functions/v1";
|
|
27
|
-
import { HttpsOptions } from "firebase-functions/v2/https";
|
|
28
|
-
import "node:http";
|
|
29
|
-
import { NitroRuntimeConfig } from "nitropack";
|
|
30
|
-
import "child_process";
|
|
31
|
-
import { ApiReferenceConfiguration } from "@scalar/api-reference";
|
|
32
|
-
|
|
33
|
-
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.BbrTaNPp.d.mts
|
|
34
|
-
interface FetchOptions<R extends ResponseType = ResponseType, T = any> extends Omit<RequestInit, "body">, FetchHooks<T, R> {
|
|
35
|
-
baseURL?: string;
|
|
36
|
-
body?: RequestInit["body"] | Record<string, any>;
|
|
37
|
-
ignoreResponseError?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated use query instead.
|
|
40
|
-
*/
|
|
41
|
-
params?: Record<string, any>;
|
|
42
|
-
query?: Record<string, any>;
|
|
43
|
-
parseResponse?: (responseText: string) => any;
|
|
44
|
-
responseType?: R;
|
|
45
|
-
/**
|
|
46
|
-
* @experimental Set to "half" to enable duplex streaming.
|
|
47
|
-
* Will be automatically set to "half" when using a ReadableStream as body.
|
|
48
|
-
* @see https://fetch.spec.whatwg.org/#enumdef-requestduplex
|
|
49
|
-
*/
|
|
50
|
-
duplex?: "half" | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Only supported in Node.js >= 18 using undici
|
|
53
|
-
*
|
|
54
|
-
* @see https://undici.nodejs.org/#/docs/api/Dispatcher
|
|
55
|
-
*/
|
|
56
|
-
dispatcher?: InstanceType<typeof Dispatcher>;
|
|
57
|
-
/**
|
|
58
|
-
* Only supported older Node.js versions using node-fetch-native polyfill.
|
|
59
|
-
*/
|
|
60
|
-
agent?: unknown;
|
|
61
|
-
/** timeout in milliseconds */
|
|
62
|
-
timeout?: number;
|
|
63
|
-
retry?: number | false;
|
|
64
|
-
/** Delay between retries in milliseconds. */
|
|
65
|
-
retryDelay?: number | ((context: FetchContext<T, R>) => number);
|
|
66
|
-
/** Default is [408, 409, 425, 429, 500, 502, 503, 504] */
|
|
67
|
-
retryStatusCodes?: number[];
|
|
68
|
-
}
|
|
69
|
-
interface ResolvedFetchOptions<R extends ResponseType = ResponseType, T = any> extends FetchOptions<R, T> {
|
|
70
|
-
headers: Headers;
|
|
71
|
-
}
|
|
72
|
-
interface FetchContext<T = any, R extends ResponseType = ResponseType> {
|
|
73
|
-
request: FetchRequest;
|
|
74
|
-
options: ResolvedFetchOptions<R>;
|
|
75
|
-
response?: FetchResponse<T>;
|
|
76
|
-
error?: Error;
|
|
77
|
-
}
|
|
78
|
-
type MaybePromise$1<T> = T | Promise<T>;
|
|
79
|
-
type MaybeArray$1<T> = T | T[];
|
|
80
|
-
type FetchHook<C extends FetchContext = FetchContext> = (context: C) => MaybePromise$1<void>;
|
|
81
|
-
interface FetchHooks<T = any, R extends ResponseType = ResponseType> {
|
|
82
|
-
onRequest?: MaybeArray$1<FetchHook<FetchContext<T, R>>>;
|
|
83
|
-
onRequestError?: MaybeArray$1<FetchHook<FetchContext<T, R> & {
|
|
84
|
-
error: Error;
|
|
85
|
-
}>>;
|
|
86
|
-
onResponse?: MaybeArray$1<FetchHook<FetchContext<T, R> & {
|
|
87
|
-
response: FetchResponse<T>;
|
|
88
|
-
}>>;
|
|
89
|
-
onResponseError?: MaybeArray$1<FetchHook<FetchContext<T, R> & {
|
|
90
|
-
response: FetchResponse<T>;
|
|
91
|
-
}>>;
|
|
92
|
-
}
|
|
93
|
-
interface ResponseMap {
|
|
94
|
-
blob: Blob;
|
|
95
|
-
text: string;
|
|
96
|
-
arrayBuffer: ArrayBuffer;
|
|
97
|
-
stream: ReadableStream<Uint8Array>;
|
|
98
|
-
}
|
|
99
|
-
type ResponseType = keyof ResponseMap | "json";
|
|
100
|
-
interface FetchResponse<T> extends Response {
|
|
101
|
-
_data?: T;
|
|
102
|
-
}
|
|
103
|
-
type FetchRequest = RequestInfo;
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/aws-amplify/types.d.ts
|
|
106
|
-
type AmplifyImageSettings = {
|
|
107
|
-
/** Array of supported image widths */sizes: number[];
|
|
108
|
-
/**
|
|
109
|
-
* Array of allowed external domains that can use Image Optimization.
|
|
110
|
-
* Leave empty for only allowing the deployment domain to use Image Optimization.
|
|
111
|
-
*/
|
|
112
|
-
domains: string[];
|
|
113
|
-
/**
|
|
114
|
-
* Array of allowed external patterns that can use Image Optimization.
|
|
115
|
-
* Similar to `domains` but provides more control with RegExp.
|
|
116
|
-
*/
|
|
117
|
-
remotePatterns: {
|
|
118
|
-
/** The protocol of the allowed remote pattern. Can be `http` or `https`. */protocol?: "http" | "https";
|
|
119
|
-
/**
|
|
120
|
-
* The hostname of the allowed remote pattern.
|
|
121
|
-
* Can be literal or wildcard. Single `*` matches a single subdomain.
|
|
122
|
-
* Double `**` matches any number of subdomains.
|
|
123
|
-
* We will disallow blanket wildcards of `**` with nothing else.
|
|
124
|
-
*/
|
|
125
|
-
hostname: string; /** The port of the allowed remote pattern. */
|
|
126
|
-
port?: string; /** The pathname of the allowed remote pattern. */
|
|
127
|
-
pathname?: string;
|
|
128
|
-
}[]; /** Array of allowed output image formats. */
|
|
129
|
-
formats: ("image/avif" | "image/webp" | "image/gif" | "image/png" | "image/jpeg")[]; /** Cache duration (in seconds) for the optimized images. */
|
|
130
|
-
minimumCacheTTL: number; /** Allow SVG input image URLs. This is disabled by default for security purposes. */
|
|
131
|
-
dangerouslyAllowSVG: boolean;
|
|
132
|
-
};
|
|
133
|
-
interface AWSAmplifyOptions {
|
|
134
|
-
catchAllStaticFallback?: boolean;
|
|
135
|
-
imageOptimization?: {
|
|
136
|
-
path?: string;
|
|
137
|
-
cacheControl?: string;
|
|
138
|
-
};
|
|
139
|
-
imageSettings?: AmplifyImageSettings;
|
|
140
|
-
runtime?: "nodejs16.x" | "nodejs18.x" | "nodejs20.x";
|
|
141
|
-
}
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/aws-lambda/types.d.ts
|
|
144
|
-
interface AwsLambdaOptions {
|
|
145
|
-
streaming?: boolean;
|
|
146
|
-
}
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/azure/types.d.ts
|
|
149
|
-
interface AzureOptions {
|
|
150
|
-
config?: {
|
|
151
|
-
platform?: {
|
|
152
|
-
apiRuntime?: string;
|
|
153
|
-
[key: string]: unknown;
|
|
154
|
-
};
|
|
155
|
-
navigationFallback?: {
|
|
156
|
-
rewrite?: string;
|
|
157
|
-
[key: string]: unknown;
|
|
158
|
-
};
|
|
159
|
-
[key: string]: unknown;
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/cloudflare/wrangler/environment.d.ts
|
|
164
|
-
/**
|
|
165
|
-
* Copyright (c) 2020 Cloudflare, Inc. <wrangler@cloudflare.com>
|
|
166
|
-
* https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-MIT
|
|
167
|
-
* https://github.com/cloudflare/workers-sdk/blob/main/LICENSE-APACHE
|
|
168
|
-
*
|
|
169
|
-
* Source: https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/config/environment.ts
|
|
170
|
-
*/
|
|
171
|
-
/**
|
|
172
|
-
* The `Environment` interface declares all the configuration fields that
|
|
173
|
-
* can be specified for an environment.
|
|
174
|
-
*
|
|
175
|
-
* This could be the top-level default environment, or a specific named environment.
|
|
176
|
-
*/
|
|
177
|
-
interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {}
|
|
178
|
-
type SimpleRoute = string;
|
|
179
|
-
type ZoneIdRoute = {
|
|
180
|
-
pattern: string;
|
|
181
|
-
zone_id: string;
|
|
182
|
-
custom_domain?: boolean;
|
|
183
|
-
};
|
|
184
|
-
type ZoneNameRoute = {
|
|
185
|
-
pattern: string;
|
|
186
|
-
zone_name: string;
|
|
187
|
-
custom_domain?: boolean;
|
|
188
|
-
};
|
|
189
|
-
type CustomDomainRoute = {
|
|
190
|
-
pattern: string;
|
|
191
|
-
custom_domain: boolean;
|
|
192
|
-
};
|
|
193
|
-
type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
|
194
|
-
/**
|
|
195
|
-
* Configuration in wrangler for Cloudchamber
|
|
196
|
-
*/
|
|
197
|
-
type CloudchamberConfig = {
|
|
198
|
-
image?: string;
|
|
199
|
-
location?: string;
|
|
200
|
-
instance_type?: "dev" | "basic" | "standard";
|
|
201
|
-
vcpu?: number;
|
|
202
|
-
memory?: string;
|
|
203
|
-
ipv4?: boolean;
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Configuration for a container application
|
|
207
|
-
*/
|
|
208
|
-
type ContainerApp = {
|
|
209
|
-
/**
|
|
210
|
-
* Name of the application
|
|
211
|
-
* @optional Defaults to `worker_name-class_name` if not specified.
|
|
212
|
-
*/
|
|
213
|
-
name?: string;
|
|
214
|
-
/**
|
|
215
|
-
* Number of application instances
|
|
216
|
-
* @deprecated
|
|
217
|
-
* @hidden
|
|
218
|
-
*/
|
|
219
|
-
instances?: number;
|
|
220
|
-
/**
|
|
221
|
-
* Number of maximum application instances.
|
|
222
|
-
* @optional
|
|
223
|
-
*/
|
|
224
|
-
max_instances?: number;
|
|
225
|
-
/**
|
|
226
|
-
* The path to a Dockerfile, or an image URI for the Cloudflare registry.
|
|
227
|
-
*/
|
|
228
|
-
image: string;
|
|
229
|
-
/**
|
|
230
|
-
* Build context of the application.
|
|
231
|
-
* @optional - defaults to the directory of `image`.
|
|
232
|
-
*/
|
|
233
|
-
image_build_context?: string;
|
|
234
|
-
/**
|
|
235
|
-
* Image variables to be passed along the image at build time.
|
|
236
|
-
* @optional
|
|
237
|
-
*/
|
|
238
|
-
image_vars?: Record<string, string>;
|
|
239
|
-
/**
|
|
240
|
-
* The class name of the Durable Object the container is connected to.
|
|
241
|
-
*/
|
|
242
|
-
class_name: string;
|
|
243
|
-
/**
|
|
244
|
-
* The scheduling policy of the application
|
|
245
|
-
* @optional
|
|
246
|
-
* @default "default"
|
|
247
|
-
*/
|
|
248
|
-
scheduling_policy?: "regional" | "moon" | "default";
|
|
249
|
-
/**
|
|
250
|
-
* The instance type to be used for the container. This sets preconfigured options for vcpu and memory
|
|
251
|
-
* @optional
|
|
252
|
-
*/
|
|
253
|
-
instance_type?: "dev" | "basic" | "standard";
|
|
254
|
-
/**
|
|
255
|
-
* @deprecated Use top level `containers` fields instead.
|
|
256
|
-
* `configuration.image` should be `image`
|
|
257
|
-
* `configuration.disk` should be set via `instance_type`
|
|
258
|
-
* @hidden
|
|
259
|
-
*/
|
|
260
|
-
configuration?: {
|
|
261
|
-
image?: string;
|
|
262
|
-
labels?: {
|
|
263
|
-
name: string;
|
|
264
|
-
value: string;
|
|
265
|
-
}[];
|
|
266
|
-
secrets?: {
|
|
267
|
-
name: string;
|
|
268
|
-
type: "env";
|
|
269
|
-
secret: string;
|
|
270
|
-
}[];
|
|
271
|
-
disk?: {
|
|
272
|
-
size: string;
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
|
-
/**
|
|
276
|
-
* Scheduling constraints
|
|
277
|
-
* @hidden
|
|
278
|
-
*/
|
|
279
|
-
constraints?: {
|
|
280
|
-
regions?: string[];
|
|
281
|
-
cities?: string[];
|
|
282
|
-
tier?: number;
|
|
283
|
-
};
|
|
284
|
-
/**
|
|
285
|
-
* @deprecated use the `class_name` field instead.
|
|
286
|
-
* @hidden
|
|
287
|
-
*/
|
|
288
|
-
durable_objects?: {
|
|
289
|
-
namespace_id: string;
|
|
290
|
-
};
|
|
291
|
-
/**
|
|
292
|
-
* How a rollout should be done, defining the size of it
|
|
293
|
-
* @optional
|
|
294
|
-
* @default 25
|
|
295
|
-
* */
|
|
296
|
-
rollout_step_percentage?: number;
|
|
297
|
-
/**
|
|
298
|
-
* How a rollout should be created. It supports the following modes:
|
|
299
|
-
* - full_auto: The container application will be rolled out fully automatically.
|
|
300
|
-
* - none: The container application won't have a roll out or update.
|
|
301
|
-
* - manual: The container application will be rollout fully by manually actioning progress steps.
|
|
302
|
-
* @optional
|
|
303
|
-
* @default "full_auto"
|
|
304
|
-
*/
|
|
305
|
-
rollout_kind?: "full_auto" | "none" | "full_manual";
|
|
306
|
-
};
|
|
307
|
-
/**
|
|
308
|
-
* Configuration in wrangler for Durable Object Migrations
|
|
309
|
-
*/
|
|
310
|
-
type DurableObjectMigration = {
|
|
311
|
-
/** A unique identifier for this migration. */tag: string; /** The new Durable Objects being defined. */
|
|
312
|
-
new_classes?: string[]; /** The new SQLite Durable Objects being defined. */
|
|
313
|
-
new_sqlite_classes?: string[]; /** The Durable Objects being renamed. */
|
|
314
|
-
renamed_classes?: {
|
|
315
|
-
from: string;
|
|
316
|
-
to: string;
|
|
317
|
-
}[]; /** The Durable Objects being removed. */
|
|
318
|
-
deleted_classes?: string[];
|
|
319
|
-
};
|
|
320
|
-
/**
|
|
321
|
-
* The `EnvironmentInheritable` interface declares all the configuration fields for an environment
|
|
322
|
-
* that can be inherited (and overridden) from the top-level environment.
|
|
323
|
-
*/
|
|
324
|
-
interface EnvironmentInheritable {
|
|
325
|
-
/**
|
|
326
|
-
* The name of your Worker. Alphanumeric + dashes only.
|
|
327
|
-
*
|
|
328
|
-
* @inheritable
|
|
329
|
-
*/
|
|
330
|
-
name: string | undefined;
|
|
331
|
-
/**
|
|
332
|
-
* This is the ID of the account associated with your zone.
|
|
333
|
-
* You might have more than one account, so make sure to use
|
|
334
|
-
* the ID of the account associated with the zone/route you
|
|
335
|
-
* provide, if you provide one. It can also be specified through
|
|
336
|
-
* the CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
337
|
-
*
|
|
338
|
-
* @inheritable
|
|
339
|
-
*/
|
|
340
|
-
account_id: string | undefined;
|
|
341
|
-
/**
|
|
342
|
-
* A date in the form yyyy-mm-dd, which will be used to determine
|
|
343
|
-
* which version of the Workers runtime is used.
|
|
344
|
-
*
|
|
345
|
-
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
|
|
346
|
-
*
|
|
347
|
-
* @inheritable
|
|
348
|
-
*/
|
|
349
|
-
compatibility_date: string | undefined;
|
|
350
|
-
/**
|
|
351
|
-
* A list of flags that enable features from upcoming features of
|
|
352
|
-
* the Workers runtime, usually used together with compatibility_date.
|
|
353
|
-
*
|
|
354
|
-
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
|
|
355
|
-
*
|
|
356
|
-
* @default []
|
|
357
|
-
* @inheritable
|
|
358
|
-
*/
|
|
359
|
-
compatibility_flags: string[];
|
|
360
|
-
/**
|
|
361
|
-
* The entrypoint/path to the JavaScript file that will be executed.
|
|
362
|
-
*
|
|
363
|
-
* @inheritable
|
|
364
|
-
*/
|
|
365
|
-
main: string | undefined;
|
|
366
|
-
/**
|
|
367
|
-
* If true then Wrangler will traverse the file tree below `base_dir`;
|
|
368
|
-
* Any files that match `rules` will be included in the deployed Worker.
|
|
369
|
-
* Defaults to true if `no_bundle` is true, otherwise false.
|
|
370
|
-
*
|
|
371
|
-
* @inheritable
|
|
372
|
-
*/
|
|
373
|
-
find_additional_modules: boolean | undefined;
|
|
374
|
-
/**
|
|
375
|
-
* Determines whether Wrangler will preserve bundled file names.
|
|
376
|
-
* Defaults to false.
|
|
377
|
-
* If left unset, files will be named using the pattern ${fileHash}-${basename},
|
|
378
|
-
* for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
|
|
379
|
-
*
|
|
380
|
-
* @inheritable
|
|
381
|
-
*/
|
|
382
|
-
preserve_file_names: boolean | undefined;
|
|
383
|
-
/**
|
|
384
|
-
* The directory in which module rules should be evaluated when including additional files into a Worker deployment.
|
|
385
|
-
* This defaults to the directory containing the `main` entry point of the Worker if not specified.
|
|
386
|
-
*
|
|
387
|
-
* @inheritable
|
|
388
|
-
*/
|
|
389
|
-
base_dir: string | undefined;
|
|
390
|
-
/**
|
|
391
|
-
* Whether we use <name>.<subdomain>.workers.dev to
|
|
392
|
-
* test and deploy your Worker.
|
|
393
|
-
*
|
|
394
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
|
|
395
|
-
*
|
|
396
|
-
* @default true
|
|
397
|
-
* @breaking
|
|
398
|
-
* @inheritable
|
|
399
|
-
*/
|
|
400
|
-
workers_dev: boolean | undefined;
|
|
401
|
-
/**
|
|
402
|
-
* Whether we use <version>-<name>.<subdomain>.workers.dev to
|
|
403
|
-
* serve Preview URLs for your Worker.
|
|
404
|
-
*
|
|
405
|
-
* @default true
|
|
406
|
-
* @inheritable
|
|
407
|
-
*/
|
|
408
|
-
preview_urls: boolean | undefined;
|
|
409
|
-
/**
|
|
410
|
-
* A list of routes that your Worker should be published to.
|
|
411
|
-
* Only one of `routes` or `route` is required.
|
|
412
|
-
*
|
|
413
|
-
* Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
|
|
414
|
-
*
|
|
415
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
416
|
-
*
|
|
417
|
-
* @inheritable
|
|
418
|
-
*/
|
|
419
|
-
routes: Route[] | undefined;
|
|
420
|
-
/**
|
|
421
|
-
* A route that your Worker should be published to. Literally
|
|
422
|
-
* the same as routes, but only one.
|
|
423
|
-
* Only one of `routes` or `route` is required.
|
|
424
|
-
*
|
|
425
|
-
* Only required when workers_dev is false, and there's no scheduled Worker
|
|
426
|
-
*
|
|
427
|
-
* @inheritable
|
|
428
|
-
*/
|
|
429
|
-
route: Route | undefined;
|
|
430
|
-
/**
|
|
431
|
-
* Path to a custom tsconfig
|
|
432
|
-
*
|
|
433
|
-
* @inheritable
|
|
434
|
-
*/
|
|
435
|
-
tsconfig: string | undefined;
|
|
436
|
-
/**
|
|
437
|
-
* The function to use to replace jsx syntax.
|
|
438
|
-
*
|
|
439
|
-
* @default "React.createElement"
|
|
440
|
-
* @inheritable
|
|
441
|
-
*/
|
|
442
|
-
jsx_factory: string;
|
|
443
|
-
/**
|
|
444
|
-
* The function to use to replace jsx fragment syntax.
|
|
445
|
-
*
|
|
446
|
-
* @default "React.Fragment"
|
|
447
|
-
* @inheritable
|
|
448
|
-
*/
|
|
449
|
-
jsx_fragment: string;
|
|
450
|
-
/**
|
|
451
|
-
* A list of migrations that should be uploaded with your Worker.
|
|
452
|
-
*
|
|
453
|
-
* These define changes in your Durable Object declarations.
|
|
454
|
-
*
|
|
455
|
-
* More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
|
|
456
|
-
*
|
|
457
|
-
* @default []
|
|
458
|
-
* @inheritable
|
|
459
|
-
*/
|
|
460
|
-
migrations: DurableObjectMigration[];
|
|
461
|
-
/**
|
|
462
|
-
* "Cron" definitions to trigger a Worker's "scheduled" function.
|
|
463
|
-
*
|
|
464
|
-
* Lets you call Workers periodically, much like a cron job.
|
|
465
|
-
*
|
|
466
|
-
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
467
|
-
*
|
|
468
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
469
|
-
*
|
|
470
|
-
* @default {crons: undefined}
|
|
471
|
-
* @inheritable
|
|
472
|
-
*/
|
|
473
|
-
triggers: {
|
|
474
|
-
crons: string[] | undefined;
|
|
475
|
-
};
|
|
476
|
-
/**
|
|
477
|
-
* Specify limits for runtime behavior.
|
|
478
|
-
* Only supported for the "standard" Usage Model
|
|
479
|
-
*
|
|
480
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
|
|
481
|
-
*
|
|
482
|
-
* @inheritable
|
|
483
|
-
*/
|
|
484
|
-
limits: UserLimits | undefined;
|
|
485
|
-
/**
|
|
486
|
-
* An ordered list of rules that define which modules to import,
|
|
487
|
-
* and what type to import them as. You will need to specify rules
|
|
488
|
-
* to use Text, Data, and CompiledWasm modules, or when you wish to
|
|
489
|
-
* have a .js file be treated as an ESModule instead of CommonJS.
|
|
490
|
-
*
|
|
491
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#bundling
|
|
492
|
-
*
|
|
493
|
-
* @inheritable
|
|
494
|
-
*/
|
|
495
|
-
rules: Rule[];
|
|
496
|
-
/**
|
|
497
|
-
* Configures a custom build step to be run by Wrangler when building your Worker.
|
|
498
|
-
*
|
|
499
|
-
* Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
|
|
500
|
-
* for more details.
|
|
501
|
-
*
|
|
502
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds
|
|
503
|
-
*
|
|
504
|
-
* @default {watch_dir:"./src"}
|
|
505
|
-
*/
|
|
506
|
-
build: {
|
|
507
|
-
/** The command used to build your Worker. On Linux and macOS, the command is executed in the `sh` shell and the `cmd` shell for Windows. The `&&` and `||` shell operators may be used. */command?: string; /** The directory in which the command is executed. */
|
|
508
|
-
cwd?: string; /** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
|
|
509
|
-
watch_dir?: string | string[];
|
|
510
|
-
};
|
|
511
|
-
/**
|
|
512
|
-
* Skip internal build steps and directly deploy script
|
|
513
|
-
* @inheritable
|
|
514
|
-
*/
|
|
515
|
-
no_bundle: boolean | undefined;
|
|
516
|
-
/**
|
|
517
|
-
* Minify the script before uploading.
|
|
518
|
-
* @inheritable
|
|
519
|
-
*/
|
|
520
|
-
minify: boolean | undefined;
|
|
521
|
-
/**
|
|
522
|
-
* Set the `name` property to the original name for functions and classes renamed during minification.
|
|
523
|
-
*
|
|
524
|
-
* See https://esbuild.github.io/api/#keep-names
|
|
525
|
-
*
|
|
526
|
-
* @default true
|
|
527
|
-
* @inheritable
|
|
528
|
-
*/
|
|
529
|
-
keep_names: boolean | undefined;
|
|
530
|
-
/**
|
|
531
|
-
* Designates this Worker as an internal-only "first-party" Worker.
|
|
532
|
-
*
|
|
533
|
-
* @inheritable
|
|
534
|
-
*/
|
|
535
|
-
first_party_worker: boolean | undefined;
|
|
536
|
-
/**
|
|
537
|
-
* List of bindings that you will send to logfwdr
|
|
538
|
-
*
|
|
539
|
-
* @default {bindings:[]}
|
|
540
|
-
* @inheritable
|
|
541
|
-
*/
|
|
542
|
-
logfwdr: {
|
|
543
|
-
bindings: {
|
|
544
|
-
/** The binding name used to refer to logfwdr */name: string; /** The destination for this logged message */
|
|
545
|
-
destination: string;
|
|
546
|
-
}[];
|
|
547
|
-
};
|
|
548
|
-
/**
|
|
549
|
-
* Send Trace Events from this Worker to Workers Logpush.
|
|
550
|
-
*
|
|
551
|
-
* This will not configure a corresponding Logpush job automatically.
|
|
552
|
-
*
|
|
553
|
-
* For more information about Workers Logpush, see:
|
|
554
|
-
* https://blog.cloudflare.com/logpush-for-workers/
|
|
555
|
-
*
|
|
556
|
-
* @inheritable
|
|
557
|
-
*/
|
|
558
|
-
logpush: boolean | undefined;
|
|
559
|
-
/**
|
|
560
|
-
* Include source maps when uploading this worker.
|
|
561
|
-
*
|
|
562
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
|
|
563
|
-
*
|
|
564
|
-
* @inheritable
|
|
565
|
-
*/
|
|
566
|
-
upload_source_maps: boolean | undefined;
|
|
567
|
-
/**
|
|
568
|
-
* Specify how the Worker should be located to minimize round-trip time.
|
|
569
|
-
*
|
|
570
|
-
* More details: https://developers.cloudflare.com/workers/platform/smart-placement/
|
|
571
|
-
*
|
|
572
|
-
* @inheritable
|
|
573
|
-
*/
|
|
574
|
-
placement: {
|
|
575
|
-
mode: "off" | "smart";
|
|
576
|
-
hint?: string;
|
|
577
|
-
} | undefined;
|
|
578
|
-
/**
|
|
579
|
-
* Specify the directory of static assets to deploy/serve
|
|
580
|
-
*
|
|
581
|
-
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
582
|
-
*
|
|
583
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
584
|
-
*
|
|
585
|
-
* @inheritable
|
|
586
|
-
*/
|
|
587
|
-
assets: Assets | undefined;
|
|
588
|
-
/**
|
|
589
|
-
* Specify the observability behavior of the Worker.
|
|
590
|
-
*
|
|
591
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
|
|
592
|
-
*
|
|
593
|
-
* @inheritable
|
|
594
|
-
*/
|
|
595
|
-
observability: Observability | undefined;
|
|
596
|
-
/**
|
|
597
|
-
* Specify the compliance region mode of the Worker.
|
|
598
|
-
*
|
|
599
|
-
* Although if the user does not specify a compliance region, the default is `public`,
|
|
600
|
-
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
|
|
601
|
-
*/
|
|
602
|
-
compliance_region: "public" | "fedramp_high" | undefined;
|
|
603
|
-
}
|
|
604
|
-
type DurableObjectBindings = {
|
|
605
|
-
/** The name of the binding used to refer to the Durable Object */name: string; /** The exported class name of the Durable Object */
|
|
606
|
-
class_name: string; /** The script where the Durable Object is defined (if it's external to this Worker) */
|
|
607
|
-
script_name?: string; /** The service environment of the script_name to bind to */
|
|
608
|
-
environment?: string;
|
|
609
|
-
}[];
|
|
610
|
-
type WorkflowBinding = {
|
|
611
|
-
/** The name of the binding used to refer to the Workflow */binding: string; /** The name of the Workflow */
|
|
612
|
-
name: string; /** The exported class name of the Workflow */
|
|
613
|
-
class_name: string; /** The script where the Workflow is defined (if it's external to this Worker) */
|
|
614
|
-
script_name?: string; /** Whether the Workflow should be remote or not (only available under `--x-remote-bindings`) */
|
|
615
|
-
experimental_remote?: boolean;
|
|
616
|
-
};
|
|
617
|
-
/**
|
|
618
|
-
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
|
619
|
-
* that cannot be inherited from the top-level environment, and must be defined specifically.
|
|
620
|
-
*
|
|
621
|
-
* If any of these fields are defined at the top-level then they should also be specifically defined
|
|
622
|
-
* for each named environment.
|
|
623
|
-
*/
|
|
624
|
-
interface EnvironmentNonInheritable {
|
|
625
|
-
/**
|
|
626
|
-
* A map of values to substitute when deploying your Worker.
|
|
627
|
-
*
|
|
628
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
629
|
-
* and so must be specified in every named environment.
|
|
630
|
-
*
|
|
631
|
-
* @default {}
|
|
632
|
-
* @nonInheritable
|
|
633
|
-
*/
|
|
634
|
-
define: Record<string, string>;
|
|
635
|
-
/**
|
|
636
|
-
* A map of environment variables to set when deploying your Worker.
|
|
637
|
-
*
|
|
638
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
639
|
-
* and so must be specified in every named environment.
|
|
640
|
-
*
|
|
641
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
642
|
-
*
|
|
643
|
-
* @default {}
|
|
644
|
-
* @nonInheritable
|
|
645
|
-
*/
|
|
646
|
-
vars: Record<string, unknown>;
|
|
647
|
-
/**
|
|
648
|
-
* A list of durable objects that your Worker should be bound to.
|
|
649
|
-
*
|
|
650
|
-
* For more information about Durable Objects, see the documentation at
|
|
651
|
-
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
652
|
-
*
|
|
653
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
654
|
-
* and so must be specified in every named environment.
|
|
655
|
-
*
|
|
656
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
657
|
-
*
|
|
658
|
-
* @default {bindings:[]}
|
|
659
|
-
* @nonInheritable
|
|
660
|
-
*/
|
|
661
|
-
durable_objects: {
|
|
662
|
-
bindings: DurableObjectBindings;
|
|
663
|
-
};
|
|
664
|
-
/**
|
|
665
|
-
* A list of workflows that your Worker should be bound to.
|
|
666
|
-
*
|
|
667
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
668
|
-
* and so must be specified in every named environment.
|
|
669
|
-
*
|
|
670
|
-
* @default []
|
|
671
|
-
* @nonInheritable
|
|
672
|
-
*/
|
|
673
|
-
workflows: WorkflowBinding[];
|
|
674
|
-
/**
|
|
675
|
-
* Cloudchamber configuration
|
|
676
|
-
*
|
|
677
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
678
|
-
* and so must be specified in every named environment.
|
|
679
|
-
*
|
|
680
|
-
* @default {}
|
|
681
|
-
* @nonInheritable
|
|
682
|
-
*/
|
|
683
|
-
cloudchamber: CloudchamberConfig;
|
|
684
|
-
/**
|
|
685
|
-
* Container related configuration
|
|
686
|
-
*
|
|
687
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
688
|
-
* and so must be specified in every named environment.
|
|
689
|
-
*
|
|
690
|
-
* @default []
|
|
691
|
-
* @nonInheritable
|
|
692
|
-
*/
|
|
693
|
-
containers?: ContainerApp[];
|
|
694
|
-
/**
|
|
695
|
-
* These specify any Workers KV Namespaces you want to
|
|
696
|
-
* access from inside your Worker.
|
|
697
|
-
*
|
|
698
|
-
* To learn more about KV Namespaces,
|
|
699
|
-
* see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
|
|
700
|
-
*
|
|
701
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
702
|
-
* and so must be specified in every named environment.
|
|
703
|
-
*
|
|
704
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
705
|
-
*
|
|
706
|
-
* @default []
|
|
707
|
-
* @nonInheritable
|
|
708
|
-
*/
|
|
709
|
-
kv_namespaces: {
|
|
710
|
-
/** The binding name used to refer to the KV Namespace */binding: string; /** The ID of the KV namespace */
|
|
711
|
-
id?: string; /** The ID of the KV namespace used during `wrangler dev` */
|
|
712
|
-
preview_id?: string; /** Whether the KV namespace should be remote or not (only available under `--x-remote-bindings`) */
|
|
713
|
-
experimental_remote?: boolean;
|
|
714
|
-
}[];
|
|
715
|
-
/**
|
|
716
|
-
* These specify bindings to send email from inside your Worker.
|
|
717
|
-
*
|
|
718
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
719
|
-
* and so must be specified in every named environment.
|
|
720
|
-
*
|
|
721
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
722
|
-
*
|
|
723
|
-
* @default []
|
|
724
|
-
* @nonInheritable
|
|
725
|
-
*/
|
|
726
|
-
send_email: {
|
|
727
|
-
/** The binding name used to refer to the this binding */name: string; /** If this binding should be restricted to a specific verified address */
|
|
728
|
-
destination_address?: string; /** If this binding should be restricted to a set of verified addresses */
|
|
729
|
-
allowed_destination_addresses?: string[];
|
|
730
|
-
}[];
|
|
731
|
-
/**
|
|
732
|
-
* Specifies Queues that are bound to this Worker environment.
|
|
733
|
-
*
|
|
734
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
735
|
-
* and so must be specified in every named environment.
|
|
736
|
-
*
|
|
737
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
738
|
-
*
|
|
739
|
-
* @default {consumers:[],producers:[]}
|
|
740
|
-
* @nonInheritable
|
|
741
|
-
*/
|
|
742
|
-
queues: {
|
|
743
|
-
/** Producer bindings */producers?: {
|
|
744
|
-
/** The binding name used to refer to the Queue in the Worker. */binding: string; /** The name of this Queue. */
|
|
745
|
-
queue: string; /** The number of seconds to wait before delivering a message */
|
|
746
|
-
delivery_delay?: number; /** Whether the Queue producer should be remote or not (only available under `--x-remote-bindings`) */
|
|
747
|
-
experimental_remote?: boolean;
|
|
748
|
-
}[]; /** Consumer configuration */
|
|
749
|
-
consumers?: {
|
|
750
|
-
/** The name of the queue from which this consumer should consume. */queue: string; /** The consumer type, e.g., worker, http-pull, r2-bucket, etc. Default is worker. */
|
|
751
|
-
type?: string; /** The maximum number of messages per batch */
|
|
752
|
-
max_batch_size?: number; /** The maximum number of seconds to wait to fill a batch with messages. */
|
|
753
|
-
max_batch_timeout?: number; /** The maximum number of retries for each message. */
|
|
754
|
-
max_retries?: number; /** The queue to send messages that failed to be consumed. */
|
|
755
|
-
dead_letter_queue?: string; /** The maximum number of concurrent consumer Worker invocations. Leaving this unset will allow your consumer to scale to the maximum concurrency needed to keep up with the message backlog. */
|
|
756
|
-
max_concurrency?: number | null; /** The number of milliseconds to wait for pulled messages to become visible again */
|
|
757
|
-
visibility_timeout_ms?: number; /** The number of seconds to wait before retrying a message */
|
|
758
|
-
retry_delay?: number;
|
|
759
|
-
}[];
|
|
760
|
-
};
|
|
761
|
-
/**
|
|
762
|
-
* Specifies R2 buckets that are bound to this Worker environment.
|
|
763
|
-
*
|
|
764
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
765
|
-
* and so must be specified in every named environment.
|
|
766
|
-
*
|
|
767
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
768
|
-
*
|
|
769
|
-
* @default []
|
|
770
|
-
* @nonInheritable
|
|
771
|
-
*/
|
|
772
|
-
r2_buckets: {
|
|
773
|
-
/** The binding name used to refer to the R2 bucket in the Worker. */binding: string; /** The name of this R2 bucket at the edge. */
|
|
774
|
-
bucket_name?: string; /** The preview name of this R2 bucket at the edge. */
|
|
775
|
-
preview_bucket_name?: string; /** The jurisdiction that the bucket exists in. Default if not present. */
|
|
776
|
-
jurisdiction?: string; /** Whether the R2 bucket should be remote or not (only available under `--x-remote-bindings`) */
|
|
777
|
-
experimental_remote?: boolean;
|
|
778
|
-
}[];
|
|
779
|
-
/**
|
|
780
|
-
* Specifies D1 databases that are bound to this Worker environment.
|
|
781
|
-
*
|
|
782
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
783
|
-
* and so must be specified in every named environment.
|
|
784
|
-
*
|
|
785
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
|
786
|
-
*
|
|
787
|
-
* @default []
|
|
788
|
-
* @nonInheritable
|
|
789
|
-
*/
|
|
790
|
-
d1_databases: {
|
|
791
|
-
/** The binding name used to refer to the D1 database in the Worker. */binding: string; /** The name of this D1 database. */
|
|
792
|
-
database_name?: string; /** The UUID of this D1 database (not required). */
|
|
793
|
-
database_id?: string; /** The UUID of this D1 database for Wrangler Dev (if specified). */
|
|
794
|
-
preview_database_id?: string; /** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
|
|
795
|
-
migrations_table?: string; /** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
|
|
796
|
-
migrations_dir?: string; /** Internal use only. */
|
|
797
|
-
database_internal_env?: string; /** Whether the D1 database should be remote or not (only available under `--x-remote-bindings`) */
|
|
798
|
-
experimental_remote?: boolean;
|
|
799
|
-
}[];
|
|
800
|
-
/**
|
|
801
|
-
* Specifies Vectorize indexes that are bound to this Worker environment.
|
|
802
|
-
*
|
|
803
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
804
|
-
* and so must be specified in every named environment.
|
|
805
|
-
*
|
|
806
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
807
|
-
*
|
|
808
|
-
* @default []
|
|
809
|
-
* @nonInheritable
|
|
810
|
-
*/
|
|
811
|
-
vectorize: {
|
|
812
|
-
/** The binding name used to refer to the Vectorize index in the Worker. */binding: string; /** The name of the index. */
|
|
813
|
-
index_name: string; /** Whether the Vectorize index should be remote or not (only available under `--x-remote-bindings`) */
|
|
814
|
-
experimental_remote?: boolean;
|
|
815
|
-
}[];
|
|
816
|
-
/**
|
|
817
|
-
* Specifies Hyperdrive configs that are bound to this Worker environment.
|
|
818
|
-
*
|
|
819
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
820
|
-
* and so must be specified in every named environment.
|
|
821
|
-
*
|
|
822
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
823
|
-
*
|
|
824
|
-
* @default []
|
|
825
|
-
* @nonInheritable
|
|
826
|
-
*/
|
|
827
|
-
hyperdrive: {
|
|
828
|
-
/** The binding name used to refer to the project in the Worker. */binding: string; /** The id of the database. */
|
|
829
|
-
id: string; /** The local database connection string for `wrangler dev` */
|
|
830
|
-
localConnectionString?: string;
|
|
831
|
-
}[];
|
|
832
|
-
/**
|
|
833
|
-
* Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
|
|
834
|
-
*
|
|
835
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
836
|
-
* and so must be specified in every named environment.
|
|
837
|
-
*
|
|
838
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
839
|
-
*
|
|
840
|
-
* @default []
|
|
841
|
-
* @nonInheritable
|
|
842
|
-
*/
|
|
843
|
-
services: {
|
|
844
|
-
/** The binding name used to refer to the bound service. */binding: string; /** The name of the service. */
|
|
845
|
-
service: string; /** The environment of the service (e.g. production, staging, etc). */
|
|
846
|
-
environment?: string; /** Optionally, the entrypoint (named export) of the service to bind to. */
|
|
847
|
-
entrypoint?: string; /** Optional properties that will be made available to the service via ctx.props. */
|
|
848
|
-
props?: Record<string, unknown>; /** Whether the service binding should be remote or not (only available under `--x-remote-bindings`) */
|
|
849
|
-
experimental_remote?: boolean;
|
|
850
|
-
}[] | undefined;
|
|
851
|
-
/**
|
|
852
|
-
* Specifies analytics engine datasets that are bound to this Worker environment.
|
|
853
|
-
*
|
|
854
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
855
|
-
* and so must be specified in every named environment.
|
|
856
|
-
*
|
|
857
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
858
|
-
*
|
|
859
|
-
* @default []
|
|
860
|
-
* @nonInheritable
|
|
861
|
-
*/
|
|
862
|
-
analytics_engine_datasets: {
|
|
863
|
-
/** The binding name used to refer to the dataset in the Worker. */binding: string; /** The name of this dataset to write to. */
|
|
864
|
-
dataset?: string;
|
|
865
|
-
}[];
|
|
866
|
-
/**
|
|
867
|
-
* A browser that will be usable from the Worker.
|
|
868
|
-
*
|
|
869
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
870
|
-
* and so must be specified in every named environment.
|
|
871
|
-
*
|
|
872
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
873
|
-
*
|
|
874
|
-
* @default {}
|
|
875
|
-
* @nonInheritable
|
|
876
|
-
*/
|
|
877
|
-
browser: {
|
|
878
|
-
binding: string; /** Whether the Browser binding should be remote or not (only available under `--x-remote-bindings`) */
|
|
879
|
-
experimental_remote?: boolean;
|
|
880
|
-
} | undefined;
|
|
881
|
-
/**
|
|
882
|
-
* Binding to the AI project.
|
|
883
|
-
*
|
|
884
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
885
|
-
* and so must be specified in every named environment.
|
|
886
|
-
*
|
|
887
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
888
|
-
*
|
|
889
|
-
* @default {}
|
|
890
|
-
* @nonInheritable
|
|
891
|
-
*/
|
|
892
|
-
ai: {
|
|
893
|
-
binding: string;
|
|
894
|
-
staging?: boolean; /** Whether the AI binding should be remote or not (only available under `--x-remote-bindings`) */
|
|
895
|
-
experimental_remote?: boolean;
|
|
896
|
-
} | undefined;
|
|
897
|
-
/**
|
|
898
|
-
* Binding to Cloudflare Images
|
|
899
|
-
*
|
|
900
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
901
|
-
* and so must be specified in every named environment.
|
|
902
|
-
*
|
|
903
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
|
|
904
|
-
*
|
|
905
|
-
* @default {}
|
|
906
|
-
* @nonInheritable
|
|
907
|
-
*/
|
|
908
|
-
images: {
|
|
909
|
-
binding: string; /** Whether the Images binding should be remote or not (only available under `--x-remote-bindings`) */
|
|
910
|
-
experimental_remote?: boolean;
|
|
911
|
-
} | undefined;
|
|
912
|
-
/**
|
|
913
|
-
* Binding to the Worker Version's metadata
|
|
914
|
-
*/
|
|
915
|
-
version_metadata: {
|
|
916
|
-
binding: string;
|
|
917
|
-
} | undefined;
|
|
918
|
-
/**
|
|
919
|
-
* "Unsafe" tables for features that aren't directly supported by wrangler.
|
|
920
|
-
*
|
|
921
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
922
|
-
* and so must be specified in every named environment.
|
|
923
|
-
*
|
|
924
|
-
* @default {}
|
|
925
|
-
* @nonInheritable
|
|
926
|
-
*/
|
|
927
|
-
unsafe: {
|
|
928
|
-
/**
|
|
929
|
-
* A set of bindings that should be put into a Worker's upload metadata without changes. These
|
|
930
|
-
* can be used to implement bindings for features that haven't released and aren't supported
|
|
931
|
-
* directly by wrangler or miniflare.
|
|
932
|
-
*/
|
|
933
|
-
bindings?: {
|
|
934
|
-
name: string;
|
|
935
|
-
type: string;
|
|
936
|
-
[key: string]: unknown;
|
|
937
|
-
}[];
|
|
938
|
-
/**
|
|
939
|
-
* Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
|
|
940
|
-
* here will always be applied to metadata last, so can add new or override existing fields.
|
|
941
|
-
*/
|
|
942
|
-
metadata?: {
|
|
943
|
-
[key: string]: unknown;
|
|
944
|
-
};
|
|
945
|
-
/**
|
|
946
|
-
* Used for internal capnp uploads for the Workers runtime
|
|
947
|
-
*/
|
|
948
|
-
capnp?: {
|
|
949
|
-
base_path: string;
|
|
950
|
-
source_schemas: string[];
|
|
951
|
-
compiled_schema?: never;
|
|
952
|
-
} | {
|
|
953
|
-
base_path?: never;
|
|
954
|
-
source_schemas?: never;
|
|
955
|
-
compiled_schema: string;
|
|
956
|
-
};
|
|
957
|
-
};
|
|
958
|
-
/**
|
|
959
|
-
* Specifies a list of mTLS certificates that are bound to this Worker environment.
|
|
960
|
-
*
|
|
961
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
962
|
-
* and so must be specified in every named environment.
|
|
963
|
-
*
|
|
964
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
|
965
|
-
*
|
|
966
|
-
* @default []
|
|
967
|
-
* @nonInheritable
|
|
968
|
-
*/
|
|
969
|
-
mtls_certificates: {
|
|
970
|
-
/** The binding name used to refer to the certificate in the Worker */binding: string; /** The uuid of the uploaded mTLS certificate */
|
|
971
|
-
certificate_id: string; /** Whether the mtls fetcher should be remote or not (only available under `--x-remote-bindings`) */
|
|
972
|
-
experimental_remote?: boolean;
|
|
973
|
-
}[];
|
|
974
|
-
/**
|
|
975
|
-
* Specifies a list of Tail Workers that are bound to this Worker environment
|
|
976
|
-
*
|
|
977
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
978
|
-
* and so must be specified in every named environment.
|
|
979
|
-
*
|
|
980
|
-
* @default []
|
|
981
|
-
* @nonInheritable
|
|
982
|
-
*/
|
|
983
|
-
tail_consumers?: TailConsumer[];
|
|
984
|
-
/**
|
|
985
|
-
* Specifies namespace bindings that are bound to this Worker environment.
|
|
986
|
-
*
|
|
987
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
988
|
-
* and so must be specified in every named environment.
|
|
989
|
-
*
|
|
990
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
991
|
-
*
|
|
992
|
-
* @default []
|
|
993
|
-
* @nonInheritable
|
|
994
|
-
*/
|
|
995
|
-
dispatch_namespaces: {
|
|
996
|
-
/** The binding name used to refer to the bound service. */binding: string; /** The namespace to bind to. */
|
|
997
|
-
namespace: string; /** Details about the outbound Worker which will handle outbound requests from your namespace */
|
|
998
|
-
outbound?: DispatchNamespaceOutbound; /** Whether the Dispatch Namespace should be remote or not (only available under `--x-remote-bindings`) */
|
|
999
|
-
experimental_remote?: boolean;
|
|
1000
|
-
}[];
|
|
1001
|
-
/**
|
|
1002
|
-
* Specifies list of Pipelines bound to this Worker environment
|
|
1003
|
-
*
|
|
1004
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1005
|
-
* and so must be specified in every named environment.
|
|
1006
|
-
*
|
|
1007
|
-
* @default []
|
|
1008
|
-
* @nonInheritable
|
|
1009
|
-
*/
|
|
1010
|
-
pipelines: {
|
|
1011
|
-
/** The binding name used to refer to the bound service. */binding: string; /** Name of the Pipeline to bind */
|
|
1012
|
-
pipeline: string;
|
|
1013
|
-
}[];
|
|
1014
|
-
/**
|
|
1015
|
-
* Specifies Secret Store bindings that are bound to this Worker environment.
|
|
1016
|
-
*
|
|
1017
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1018
|
-
* and so must be specified in every named environment.
|
|
1019
|
-
*
|
|
1020
|
-
* @default []
|
|
1021
|
-
* @nonInheritable
|
|
1022
|
-
*/
|
|
1023
|
-
secrets_store_secrets: {
|
|
1024
|
-
/** The binding name used to refer to the bound service. */binding: string; /** Id of the secret store */
|
|
1025
|
-
store_id: string; /** Name of the secret */
|
|
1026
|
-
secret_name: string;
|
|
1027
|
-
}[];
|
|
1028
|
-
/**
|
|
1029
|
-
* **DO NOT USE**. Hello World Binding Config to serve as an explanatory example.
|
|
1030
|
-
*
|
|
1031
|
-
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1032
|
-
* and so must be specified in every named environment.
|
|
1033
|
-
*
|
|
1034
|
-
* @default []
|
|
1035
|
-
* @nonInheritable
|
|
1036
|
-
*/
|
|
1037
|
-
unsafe_hello_world: {
|
|
1038
|
-
/** The binding name used to refer to the bound service. */binding: string; /** Whether the timer is enabled */
|
|
1039
|
-
enable_timer?: boolean;
|
|
1040
|
-
}[];
|
|
1041
|
-
}
|
|
1042
|
-
/**
|
|
1043
|
-
* A bundling resolver rule, defining the modules type for paths that match the specified globs.
|
|
1044
|
-
*/
|
|
1045
|
-
type Rule = {
|
|
1046
|
-
type: ConfigModuleRuleType;
|
|
1047
|
-
globs: string[];
|
|
1048
|
-
fallthrough?: boolean;
|
|
1049
|
-
};
|
|
1050
|
-
/**
|
|
1051
|
-
* The possible types for a `Rule`.
|
|
1052
|
-
*/
|
|
1053
|
-
type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
|
|
1054
|
-
type TailConsumer = {
|
|
1055
|
-
/** The name of the service tail events will be forwarded to. */service: string; /** (Optional) The environment of the service. */
|
|
1056
|
-
environment?: string;
|
|
1057
|
-
};
|
|
1058
|
-
interface DispatchNamespaceOutbound {
|
|
1059
|
-
/** Name of the service handling the outbound requests */
|
|
1060
|
-
service: string;
|
|
1061
|
-
/** (Optional) Name of the environment handling the outbound requests. */
|
|
1062
|
-
environment?: string;
|
|
1063
|
-
/** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
|
|
1064
|
-
parameters?: string[];
|
|
1065
|
-
}
|
|
1066
|
-
interface UserLimits {
|
|
1067
|
-
/** Maximum allowed CPU time for a Worker's invocation in milliseconds */
|
|
1068
|
-
cpu_ms: number;
|
|
1069
|
-
}
|
|
1070
|
-
type Assets = {
|
|
1071
|
-
/** Absolute path to assets directory */directory?: string; /** Name of `env` binding property in the User Worker. */
|
|
1072
|
-
binding?: string; /** How to handle HTML requests. */
|
|
1073
|
-
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none"; /** How to handle requests that do not match an asset. */
|
|
1074
|
-
not_found_handling?: "single-page-application" | "404-page" | "none";
|
|
1075
|
-
/**
|
|
1076
|
-
* Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
|
|
1077
|
-
*
|
|
1078
|
-
* Can also be `true`, indicating that every request should be routed to the User Worker.
|
|
1079
|
-
*/
|
|
1080
|
-
run_worker_first?: string[] | boolean;
|
|
1081
|
-
};
|
|
1082
|
-
interface Observability {
|
|
1083
|
-
/** If observability is enabled for this Worker */
|
|
1084
|
-
enabled?: boolean;
|
|
1085
|
-
/** The sampling rate */
|
|
1086
|
-
head_sampling_rate?: number;
|
|
1087
|
-
logs?: {
|
|
1088
|
-
enabled?: boolean; /** The sampling rate */
|
|
1089
|
-
head_sampling_rate?: number; /** Set to false to disable invocation logs */
|
|
1090
|
-
invocation_logs?: boolean;
|
|
1091
|
-
};
|
|
1092
|
-
}
|
|
1093
|
-
//#endregion
|
|
1094
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/cloudflare/wrangler/config.d.ts
|
|
1095
|
-
/**
|
|
1096
|
-
* This is the static type definition for the configuration object.
|
|
1097
|
-
*
|
|
1098
|
-
* It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
|
|
1099
|
-
* and optionally augment with arguments passed directly to wrangler.
|
|
1100
|
-
*
|
|
1101
|
-
* For more information about the configuration object, see the
|
|
1102
|
-
* documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
|
|
1103
|
-
*
|
|
1104
|
-
* Notes:
|
|
1105
|
-
*
|
|
1106
|
-
* - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
|
|
1107
|
-
* in the top level config and should not appear in any environments.
|
|
1108
|
-
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
1109
|
-
* - All top level fields in config and environments are optional in the Wrangler configuration file.
|
|
1110
|
-
*
|
|
1111
|
-
* Legend for the annotations:
|
|
1112
|
-
*
|
|
1113
|
-
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
1114
|
-
* - `@todo`: there's more work to be done (with details attached).
|
|
1115
|
-
*/
|
|
1116
|
-
type Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
|
1117
|
-
interface ComputedFields {
|
|
1118
|
-
/** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
|
|
1119
|
-
configPath: string | undefined;
|
|
1120
|
-
/** The path to the user's Wrangler configuration file (if any), which may have been redirected to another file that used to create this configuration. */
|
|
1121
|
-
userConfigPath: string | undefined;
|
|
1122
|
-
/**
|
|
1123
|
-
* The original top level name for the Worker in the raw configuration.
|
|
1124
|
-
*
|
|
1125
|
-
* When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
|
|
1126
|
-
* It can be useful to know what the top-level name was before the flattening.
|
|
1127
|
-
*/
|
|
1128
|
-
topLevelName: string | undefined;
|
|
1129
|
-
}
|
|
1130
|
-
interface ConfigFields<Dev extends RawDevConfig> {
|
|
1131
|
-
/**
|
|
1132
|
-
* A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
|
|
1133
|
-
* These have been superseded by Services, but there may be projects that won't
|
|
1134
|
-
* (or can't) use them. If you're using a legacy environment, you can set this
|
|
1135
|
-
* to `true` to enable it.
|
|
1136
|
-
*/
|
|
1137
|
-
legacy_env: boolean;
|
|
1138
|
-
/**
|
|
1139
|
-
* Whether Wrangler should send usage metrics to Cloudflare for this project.
|
|
1140
|
-
*
|
|
1141
|
-
* When defined this will override any user settings.
|
|
1142
|
-
* Otherwise, Wrangler will use the user's preference.
|
|
1143
|
-
*/
|
|
1144
|
-
send_metrics: boolean | undefined;
|
|
1145
|
-
/**
|
|
1146
|
-
* Options to configure the development server that your worker will use.
|
|
1147
|
-
*/
|
|
1148
|
-
dev: Dev;
|
|
1149
|
-
/**
|
|
1150
|
-
* The definition of a Worker Site, a feature that lets you upload
|
|
1151
|
-
* static assets with your Worker.
|
|
1152
|
-
*
|
|
1153
|
-
* More details at https://developers.cloudflare.com/workers/platform/sites
|
|
1154
|
-
*/
|
|
1155
|
-
site: {
|
|
1156
|
-
/**
|
|
1157
|
-
* The directory containing your static assets.
|
|
1158
|
-
*
|
|
1159
|
-
* It must be a path relative to your Wrangler configuration file.
|
|
1160
|
-
* Example: bucket = "./public"
|
|
1161
|
-
*
|
|
1162
|
-
* If there is a `site` field then it must contain this `bucket` field.
|
|
1163
|
-
*/
|
|
1164
|
-
bucket: string;
|
|
1165
|
-
/**
|
|
1166
|
-
* The location of your Worker script.
|
|
1167
|
-
*
|
|
1168
|
-
* @deprecated DO NOT use this (it's a holdover from Wrangler v1.x). Either use the top level `main` field, or pass the path to your entry file as a command line argument.
|
|
1169
|
-
* @breaking
|
|
1170
|
-
*/
|
|
1171
|
-
"entry-point"?: string;
|
|
1172
|
-
/**
|
|
1173
|
-
* An exclusive list of .gitignore-style patterns that match file
|
|
1174
|
-
* or directory names from your bucket location. Only matched
|
|
1175
|
-
* items will be uploaded. Example: include = ["upload_dir"]
|
|
1176
|
-
*
|
|
1177
|
-
* @optional
|
|
1178
|
-
* @default []
|
|
1179
|
-
*/
|
|
1180
|
-
include?: string[];
|
|
1181
|
-
/**
|
|
1182
|
-
* A list of .gitignore-style patterns that match files or
|
|
1183
|
-
* directories in your bucket that should be excluded from
|
|
1184
|
-
* uploads. Example: exclude = ["ignore_dir"]
|
|
1185
|
-
*
|
|
1186
|
-
* @optional
|
|
1187
|
-
* @default []
|
|
1188
|
-
*/
|
|
1189
|
-
exclude?: string[];
|
|
1190
|
-
} | undefined;
|
|
1191
|
-
/**
|
|
1192
|
-
* Old behaviour of serving a folder of static assets with your Worker,
|
|
1193
|
-
* without any additional code.
|
|
1194
|
-
* This can either be a string, or an object with additional config
|
|
1195
|
-
* fields.
|
|
1196
|
-
* Will be deprecated in the near future in favor of `assets`.
|
|
1197
|
-
*/
|
|
1198
|
-
legacy_assets: {
|
|
1199
|
-
bucket: string;
|
|
1200
|
-
include: string[];
|
|
1201
|
-
exclude: string[];
|
|
1202
|
-
browser_TTL: number | undefined;
|
|
1203
|
-
serve_single_page_app: boolean;
|
|
1204
|
-
} | string | undefined;
|
|
1205
|
-
/**
|
|
1206
|
-
* A list of wasm modules that your worker should be bound to. This is
|
|
1207
|
-
* the "legacy" way of binding to a wasm module. ES module workers should
|
|
1208
|
-
* do proper module imports.
|
|
1209
|
-
*/
|
|
1210
|
-
wasm_modules: {
|
|
1211
|
-
[key: string]: string;
|
|
1212
|
-
} | undefined;
|
|
1213
|
-
/**
|
|
1214
|
-
* A list of text files that your worker should be bound to. This is
|
|
1215
|
-
* the "legacy" way of binding to a text file. ES module workers should
|
|
1216
|
-
* do proper module imports.
|
|
1217
|
-
*/
|
|
1218
|
-
text_blobs: {
|
|
1219
|
-
[key: string]: string;
|
|
1220
|
-
} | undefined;
|
|
1221
|
-
/**
|
|
1222
|
-
* A list of data files that your worker should be bound to. This is
|
|
1223
|
-
* the "legacy" way of binding to a data file. ES module workers should
|
|
1224
|
-
* do proper module imports.
|
|
1225
|
-
*/
|
|
1226
|
-
data_blobs: {
|
|
1227
|
-
[key: string]: string;
|
|
1228
|
-
} | undefined;
|
|
1229
|
-
/**
|
|
1230
|
-
* A map of module aliases. Lets you swap out a module for any others.
|
|
1231
|
-
* Corresponds with esbuild's `alias` config
|
|
1232
|
-
*/
|
|
1233
|
-
alias: {
|
|
1234
|
-
[key: string]: string;
|
|
1235
|
-
} | undefined;
|
|
1236
|
-
/**
|
|
1237
|
-
* By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
|
|
1238
|
-
*
|
|
1239
|
-
* If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
|
|
1240
|
-
*
|
|
1241
|
-
* If you want to keep your dashboard vars when wrangler deploys, set this field to true.
|
|
1242
|
-
*
|
|
1243
|
-
* @default false
|
|
1244
|
-
* @nonInheritable
|
|
1245
|
-
*/
|
|
1246
|
-
keep_vars?: boolean;
|
|
1247
|
-
}
|
|
1248
|
-
interface PagesConfigFields {
|
|
1249
|
-
/**
|
|
1250
|
-
* The directory of static assets to serve.
|
|
1251
|
-
*
|
|
1252
|
-
* The presence of this field in a Wrangler configuration file indicates a Pages project,
|
|
1253
|
-
* and will prompt the handling of the configuration file according to the
|
|
1254
|
-
* Pages-specific validation rules.
|
|
1255
|
-
*/
|
|
1256
|
-
pages_build_output_dir?: string;
|
|
1257
|
-
}
|
|
1258
|
-
interface DevConfig {
|
|
1259
|
-
/**
|
|
1260
|
-
* IP address for the local dev server to listen on,
|
|
1261
|
-
*
|
|
1262
|
-
* @default localhost
|
|
1263
|
-
*/
|
|
1264
|
-
ip: string;
|
|
1265
|
-
/**
|
|
1266
|
-
* Port for the local dev server to listen on
|
|
1267
|
-
*
|
|
1268
|
-
* @default 8787
|
|
1269
|
-
*/
|
|
1270
|
-
port: number | undefined;
|
|
1271
|
-
/**
|
|
1272
|
-
* Port for the local dev server's inspector to listen on
|
|
1273
|
-
*
|
|
1274
|
-
* @default 9229
|
|
1275
|
-
*/
|
|
1276
|
-
inspector_port: number | undefined;
|
|
1277
|
-
/**
|
|
1278
|
-
* Protocol that local wrangler dev server listens to requests on.
|
|
1279
|
-
*
|
|
1280
|
-
* @default http
|
|
1281
|
-
*/
|
|
1282
|
-
local_protocol: "http" | "https";
|
|
1283
|
-
/**
|
|
1284
|
-
* Protocol that wrangler dev forwards requests on
|
|
1285
|
-
*
|
|
1286
|
-
* Setting this to `http` is not currently implemented for remote mode.
|
|
1287
|
-
* See https://github.com/cloudflare/workers-sdk/issues/583
|
|
1288
|
-
*
|
|
1289
|
-
* @default https
|
|
1290
|
-
*/
|
|
1291
|
-
upstream_protocol: "https" | "http";
|
|
1292
|
-
/**
|
|
1293
|
-
* Host to forward requests to, defaults to the host of the first route of project
|
|
1294
|
-
*/
|
|
1295
|
-
host: string | undefined;
|
|
1296
|
-
}
|
|
1297
|
-
type RawDevConfig = Partial<DevConfig>;
|
|
1298
|
-
//#endregion
|
|
1299
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/cloudflare/types.d.ts
|
|
1300
|
-
type WranglerConfig = Partial<Omit<Config, keyof ComputedFields>>;
|
|
1301
|
-
/**
|
|
1302
|
-
* https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes
|
|
1303
|
-
*/
|
|
1304
|
-
interface CloudflarePagesRoutes {
|
|
1305
|
-
/** Defines the version of the schema. Currently there is only one version of the schema (version 1), however, we may add more in the future and aim to be backwards compatible. */
|
|
1306
|
-
version?: 1;
|
|
1307
|
-
/** Defines routes that will be invoked by Functions. Accepts wildcard behavior. */
|
|
1308
|
-
include?: string[];
|
|
1309
|
-
/** Defines routes that will not be invoked by Functions. Accepts wildcard behavior. `exclude` always take priority over `include`. */
|
|
1310
|
-
exclude?: string[];
|
|
1311
|
-
}
|
|
1312
|
-
interface CloudflareOptions {
|
|
1313
|
-
/**
|
|
1314
|
-
* Configuration for the Cloudflare Deployments.
|
|
1315
|
-
*
|
|
1316
|
-
* **NOTE:** This option is only effective if `deployConfig` is enabled.
|
|
1317
|
-
*/
|
|
1318
|
-
wrangler?: WranglerConfig;
|
|
1319
|
-
/**
|
|
1320
|
-
* Enable automatic generation of `.wrangler/deploy/config.json`.
|
|
1321
|
-
*
|
|
1322
|
-
* **IMPORTANT:** Enabling this option will cause settings from cloudflare dashboard (including environment variables) to be disabled and discarded.
|
|
1323
|
-
*
|
|
1324
|
-
* More info: https://developers.cloudflare.com/workers/wrangler/configuration#generated-wrangler-configuration
|
|
1325
|
-
*/
|
|
1326
|
-
deployConfig?: boolean;
|
|
1327
|
-
/**
|
|
1328
|
-
* Enable native Node.js compatibility support.
|
|
1329
|
-
*
|
|
1330
|
-
* If this option disabled, pure unenv polyfills will be used instead.
|
|
1331
|
-
*
|
|
1332
|
-
* If not set, will be auto enabled if `nodejs_compat` or `nodejs_compat_v2` is detected in `wrangler.toml` or `wrangler.json`.
|
|
1333
|
-
*/
|
|
1334
|
-
nodeCompat?: boolean;
|
|
1335
|
-
/**
|
|
1336
|
-
* Options for dev emulation.
|
|
1337
|
-
*/
|
|
1338
|
-
dev?: {
|
|
1339
|
-
configPath?: string;
|
|
1340
|
-
environment?: string;
|
|
1341
|
-
persistDir?: string;
|
|
1342
|
-
};
|
|
1343
|
-
pages?: {
|
|
1344
|
-
/**
|
|
1345
|
-
* Nitro will automatically generate a `_routes.json` that controls which files get served statically and
|
|
1346
|
-
* which get served by the Worker. Using this config will override the automatic `_routes.json`. Or, if the
|
|
1347
|
-
* `merge` options is set, it will merge the user-set routes with the auto-generated ones, giving priority
|
|
1348
|
-
* to the user routes.
|
|
1349
|
-
*
|
|
1350
|
-
* @see https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes
|
|
1351
|
-
*
|
|
1352
|
-
* There are a maximum of 100 rules, and you must have at least one include rule. Wildcards are accepted.
|
|
1353
|
-
*
|
|
1354
|
-
* If any fields are unset, they default to:
|
|
1355
|
-
*
|
|
1356
|
-
* ```json
|
|
1357
|
-
* {
|
|
1358
|
-
* "version": 1,
|
|
1359
|
-
* "include": ["/*"],
|
|
1360
|
-
* "exclude": []
|
|
1361
|
-
* }
|
|
1362
|
-
* ```
|
|
1363
|
-
*/
|
|
1364
|
-
routes?: CloudflarePagesRoutes;
|
|
1365
|
-
/**
|
|
1366
|
-
* If set to `false`, nitro will disable the automatically generated `_routes.json` and instead use the user-set only ones.
|
|
1367
|
-
*
|
|
1368
|
-
* @default true
|
|
1369
|
-
*/
|
|
1370
|
-
defaultRoutes?: boolean;
|
|
1371
|
-
};
|
|
1372
|
-
}
|
|
1373
|
-
type DurableObjectState = ConstructorParameters<typeof DurableObject>[0];
|
|
1374
|
-
declare module "nitropack/types" {
|
|
1375
|
-
interface NitroRuntimeHooks {
|
|
1376
|
-
"cloudflare:scheduled": (_: {
|
|
1377
|
-
controller: ScheduledController;
|
|
1378
|
-
env: unknown;
|
|
1379
|
-
context: ExecutionContext;
|
|
1380
|
-
}) => void;
|
|
1381
|
-
"cloudflare:email": (_: {
|
|
1382
|
-
message: ForwardableEmailMessage; /** @deprecated please use `message` */
|
|
1383
|
-
event: ForwardableEmailMessage;
|
|
1384
|
-
env: unknown;
|
|
1385
|
-
context: ExecutionContext;
|
|
1386
|
-
}) => void;
|
|
1387
|
-
"cloudflare:queue": (_: {
|
|
1388
|
-
batch: MessageBatch; /** @deprecated please use `batch` */
|
|
1389
|
-
event: MessageBatch;
|
|
1390
|
-
env: unknown;
|
|
1391
|
-
context: ExecutionContext;
|
|
1392
|
-
}) => void;
|
|
1393
|
-
"cloudflare:tail": (_: {
|
|
1394
|
-
traces: TraceItem[];
|
|
1395
|
-
env: unknown;
|
|
1396
|
-
context: ExecutionContext;
|
|
1397
|
-
}) => void;
|
|
1398
|
-
"cloudflare:trace": (_: {
|
|
1399
|
-
traces: TraceItem[];
|
|
1400
|
-
env: unknown;
|
|
1401
|
-
context: ExecutionContext;
|
|
1402
|
-
}) => void;
|
|
1403
|
-
"cloudflare:durable:init": (durable: DurableObject, _: {
|
|
1404
|
-
state: DurableObjectState;
|
|
1405
|
-
env: unknown;
|
|
1406
|
-
}) => void;
|
|
1407
|
-
"cloudflare:durable:alarm": (durable: DurableObject) => void;
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
//#endregion
|
|
1411
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/firebase/types.d.ts
|
|
1412
|
-
type FirebaseOptions = FirebaseFunctionsOptions | AppHostingOptions;
|
|
1413
|
-
type FirebaseFunctionsOptions = FirebaseOptionsGen1 | FirebaseOptionsGen2;
|
|
1414
|
-
interface FirebaseOptionsBase {
|
|
1415
|
-
gen: 1 | 2;
|
|
1416
|
-
/**
|
|
1417
|
-
* Firebase functions node runtime version.
|
|
1418
|
-
* @see https://cloud.google.com/functions/docs/runtime-support
|
|
1419
|
-
* @see https://cloud.google.com/functions/docs/concepts/nodejs-runtime
|
|
1420
|
-
*/
|
|
1421
|
-
nodeVersion?: "22" | "20" | "18" | "16";
|
|
1422
|
-
/**
|
|
1423
|
-
* When deploying multiple apps within the same Firebase project
|
|
1424
|
-
* you must give your server a unique name in order to avoid overwriting your functions.
|
|
1425
|
-
*
|
|
1426
|
-
* @default "server"
|
|
1427
|
-
*/
|
|
1428
|
-
serverFunctionName?: string;
|
|
1429
|
-
}
|
|
1430
|
-
interface FirebaseOptionsGen1 extends FirebaseOptionsBase {
|
|
1431
|
-
gen: 1;
|
|
1432
|
-
/**
|
|
1433
|
-
* Firebase functions 1st generation region passed to `functions.region()`.
|
|
1434
|
-
*/
|
|
1435
|
-
region?: Parameters<typeof region>[0];
|
|
1436
|
-
/**
|
|
1437
|
-
* Firebase functions 1st generation runtime options passed to `functions.runWith()`.
|
|
1438
|
-
*/
|
|
1439
|
-
runtimeOptions?: RuntimeOptions;
|
|
1440
|
-
}
|
|
1441
|
-
interface FirebaseOptionsGen2 extends FirebaseOptionsBase {
|
|
1442
|
-
gen: 2;
|
|
1443
|
-
/**
|
|
1444
|
-
* Firebase functions 2nd generation https options passed to `onRequest`.
|
|
1445
|
-
* @see https://firebase.google.com/docs/reference/functions/2nd-gen/node/firebase-functions.https.httpsoptions
|
|
1446
|
-
*/
|
|
1447
|
-
httpsOptions?: HttpsOptions;
|
|
1448
|
-
}
|
|
1449
|
-
interface AppHostingOptions {
|
|
1450
|
-
appHosting: Partial<AppHostingOutputBundleConfig["runConfig"]>;
|
|
1451
|
-
}
|
|
1452
|
-
interface AppHostingOutputBundleConfig {
|
|
1453
|
-
version: "v1";
|
|
1454
|
-
runConfig: {
|
|
1455
|
-
/** Command to start the server (e.g. "node dist/index.js"). Assume this command is run from the root dir of the workspace. */runCommand: string; /** Environment variables set when the app is run. */
|
|
1456
|
-
environmentVariables?: Array<{
|
|
1457
|
-
/** Name of the variable. */variable: string; /** Value associated with the variable. */
|
|
1458
|
-
value: string; /** Where the variable will be available, for now only RUNTIME is supported. */
|
|
1459
|
-
availability: "RUNTIME"[];
|
|
1460
|
-
}>; /** The maximum number of concurrent requests that each server instance can receive. */
|
|
1461
|
-
concurrency?: number; /** The number of CPUs used in a single server instance. */
|
|
1462
|
-
cpu?: number; /** The amount of memory available for a server instance. */
|
|
1463
|
-
memoryMiB?: number; /** The limit on the minimum number of function instances that may coexist at a given time. */
|
|
1464
|
-
minInstances?: number; /** The limit on the maximum number of function instances that may coexist at a given time. */
|
|
1465
|
-
maxInstances?: number;
|
|
1466
|
-
};
|
|
1467
|
-
metadata: {
|
|
1468
|
-
adapterPackageName: string;
|
|
1469
|
-
adapterVersion: string;
|
|
1470
|
-
framework: string;
|
|
1471
|
-
frameworkVersion?: string;
|
|
1472
|
-
};
|
|
1473
|
-
outputFiles?: {
|
|
1474
|
-
/** serverApp holds a list of directories + files relative to the app root dir that frameworks need to deploy to the App Hosting server. */serverApp: {
|
|
1475
|
-
include: string[];
|
|
1476
|
-
};
|
|
1477
|
-
};
|
|
1478
|
-
}
|
|
1479
|
-
//#endregion
|
|
1480
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/netlify/types.d.ts
|
|
1481
|
-
/**
|
|
1482
|
-
* Netlify options
|
|
1483
|
-
*/
|
|
1484
|
-
interface NetlifyOptions {
|
|
1485
|
-
images?: {
|
|
1486
|
-
/**
|
|
1487
|
-
* Permitted remote image sources. Array of regex strings.
|
|
1488
|
-
* @see https://docs.netlify.com/image-cdn/overview/#remote-path
|
|
1489
|
-
*/
|
|
1490
|
-
remote_images?: string[];
|
|
1491
|
-
};
|
|
1492
|
-
}
|
|
1493
|
-
//#endregion
|
|
1494
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/vercel/types.d.ts
|
|
1495
|
-
/**
|
|
1496
|
-
* Vercel Build Output Configuration
|
|
1497
|
-
* @see https://vercel.com/docs/build-output-api/v3
|
|
1498
|
-
*/
|
|
1499
|
-
interface VercelBuildConfigV3 {
|
|
1500
|
-
version: 3;
|
|
1501
|
-
routes?: ({
|
|
1502
|
-
src: string;
|
|
1503
|
-
headers: {
|
|
1504
|
-
"cache-control": string;
|
|
1505
|
-
};
|
|
1506
|
-
continue: boolean;
|
|
1507
|
-
} | {
|
|
1508
|
-
handle: string;
|
|
1509
|
-
} | {
|
|
1510
|
-
src: string;
|
|
1511
|
-
dest: string;
|
|
1512
|
-
})[];
|
|
1513
|
-
images?: {
|
|
1514
|
-
sizes: number[];
|
|
1515
|
-
domains: string[];
|
|
1516
|
-
remotePatterns?: {
|
|
1517
|
-
protocol?: "http" | "https";
|
|
1518
|
-
hostname: string;
|
|
1519
|
-
port?: string;
|
|
1520
|
-
pathname?: string;
|
|
1521
|
-
}[];
|
|
1522
|
-
minimumCacheTTL?: number;
|
|
1523
|
-
formats?: ("image/avif" | "image/webp")[];
|
|
1524
|
-
dangerouslyAllowSVG?: boolean;
|
|
1525
|
-
contentSecurityPolicy?: string;
|
|
1526
|
-
};
|
|
1527
|
-
wildcard?: Array<{
|
|
1528
|
-
domain: string;
|
|
1529
|
-
value: string;
|
|
1530
|
-
}>;
|
|
1531
|
-
overrides?: Record<string, {
|
|
1532
|
-
path?: string;
|
|
1533
|
-
contentType?: string;
|
|
1534
|
-
}>;
|
|
1535
|
-
cache?: string[];
|
|
1536
|
-
bypassToken?: string;
|
|
1537
|
-
crons?: {
|
|
1538
|
-
path: string;
|
|
1539
|
-
schedule: string;
|
|
1540
|
-
}[];
|
|
1541
|
-
}
|
|
1542
|
-
/**
|
|
1543
|
-
* https://vercel.com/docs/build-output-api/primitives#serverless-function-configuration
|
|
1544
|
-
* https://vercel.com/docs/build-output-api/primitives#node.js-config
|
|
1545
|
-
*/
|
|
1546
|
-
interface VercelServerlessFunctionConfig {
|
|
1547
|
-
/**
|
|
1548
|
-
* Amount of memory (RAM in MB) that will be allocated to the Serverless Function.
|
|
1549
|
-
*/
|
|
1550
|
-
memory?: number;
|
|
1551
|
-
/**
|
|
1552
|
-
* Specifies the instruction set "architecture" the Vercel Function supports.
|
|
1553
|
-
*
|
|
1554
|
-
* Either `x86_64` or `arm64`. The default value is `x86_64`
|
|
1555
|
-
*/
|
|
1556
|
-
architecture?: "x86_64" | "arm64";
|
|
1557
|
-
/**
|
|
1558
|
-
* Maximum execution duration (in seconds) that will be allowed for the Serverless Function.
|
|
1559
|
-
*/
|
|
1560
|
-
maxDuration?: number;
|
|
1561
|
-
/**
|
|
1562
|
-
* Map of additional environment variables that will be available to the Vercel Function,
|
|
1563
|
-
* in addition to the env vars specified in the Project Settings.
|
|
1564
|
-
*/
|
|
1565
|
-
environment?: Record<string, string>;
|
|
1566
|
-
/**
|
|
1567
|
-
* List of Vercel Regions where the Vercel Function will be deployed to.
|
|
1568
|
-
*/
|
|
1569
|
-
regions?: string[];
|
|
1570
|
-
/**
|
|
1571
|
-
* True if a custom runtime has support for Lambda runtime wrappers.
|
|
1572
|
-
*/
|
|
1573
|
-
supportsWrapper?: boolean;
|
|
1574
|
-
/**
|
|
1575
|
-
* When true, the Serverless Function will stream the response to the client.
|
|
1576
|
-
*/
|
|
1577
|
-
supportsResponseStreaming?: boolean;
|
|
1578
|
-
/**
|
|
1579
|
-
* Enables source map generation.
|
|
1580
|
-
*/
|
|
1581
|
-
shouldAddSourcemapSupport?: boolean;
|
|
1582
|
-
/**
|
|
1583
|
-
* The runtime to use. Defaults to the auto-detected Node.js version.
|
|
1584
|
-
*/
|
|
1585
|
-
runtime?: "nodejs20.x" | "nodejs22.x" | "bun1.x" | (string & {});
|
|
1586
|
-
[key: string]: unknown;
|
|
1587
|
-
}
|
|
1588
|
-
interface VercelOptions {
|
|
1589
|
-
config: VercelBuildConfigV3;
|
|
1590
|
-
/**
|
|
1591
|
-
* If you have enabled skew protection in the Vercel dashboard, it will
|
|
1592
|
-
* be enabled by default.
|
|
1593
|
-
*
|
|
1594
|
-
* You can disable the Nitro integration by setting this option to `false`.
|
|
1595
|
-
*/
|
|
1596
|
-
skewProtection?: boolean;
|
|
1597
|
-
/**
|
|
1598
|
-
* If you are using `vercel-edge`, you can specify the region(s) for your edge function.
|
|
1599
|
-
* @see https://vercel.com/docs/concepts/functions/edge-functions#edge-function-regions
|
|
1600
|
-
*/
|
|
1601
|
-
regions?: string[];
|
|
1602
|
-
functions?: VercelServerlessFunctionConfig;
|
|
1603
|
-
}
|
|
1604
|
-
//#endregion
|
|
1605
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/presets/_types.gen.d.ts
|
|
1606
|
-
interface PresetOptions {
|
|
1607
|
-
awsAmplify?: AWSAmplifyOptions;
|
|
1608
|
-
awsLambda?: AwsLambdaOptions;
|
|
1609
|
-
azure?: AzureOptions;
|
|
1610
|
-
cloudflare?: CloudflareOptions;
|
|
1611
|
-
firebase?: FirebaseOptions;
|
|
1612
|
-
netlify?: NetlifyOptions;
|
|
1613
|
-
vercel?: VercelOptions;
|
|
1614
|
-
}
|
|
1615
|
-
type PresetName = "alwaysdata" | "aws-amplify" | "aws-lambda" | "azure" | "azure-functions" | "azure-swa" | "base-worker" | "bun" | "cleavr" | "cli" | "cloudflare" | "cloudflare-dev" | "cloudflare-durable" | "cloudflare-module" | "cloudflare-module-legacy" | "cloudflare-pages" | "cloudflare-pages-static" | "cloudflare-worker" | "deno" | "deno-deploy" | "deno-server" | "deno-server-legacy" | "digital-ocean" | "edgio" | "firebase" | "firebase-app-hosting" | "flight-control" | "genezio" | "github-pages" | "gitlab-pages" | "heroku" | "iis" | "iis-handler" | "iis-node" | "koyeb" | "layer0" | "netlify" | "netlify-builder" | "netlify-edge" | "netlify-legacy" | "netlify-static" | "nitro-dev" | "nitro-prerender" | "node" | "node-cluster" | "node-listener" | "node-server" | "platform-sh" | "render-com" | "service-worker" | "static" | "stormkit" | "vercel" | "vercel-edge" | "vercel-static" | "winterjs" | "zeabur" | "zeabur-static" | "zerops" | "zerops-static";
|
|
1616
|
-
type PresetNameInput = "alwaysdata" | "aws-amplify" | "awsAmplify" | "aws_amplify" | "aws-lambda" | "awsLambda" | "aws_lambda" | "azure" | "azure-functions" | "azureFunctions" | "azure_functions" | "azure-swa" | "azureSwa" | "azure_swa" | "base-worker" | "baseWorker" | "base_worker" | "bun" | "cleavr" | "cli" | "cloudflare" | "cloudflare-dev" | "cloudflareDev" | "cloudflare_dev" | "cloudflare-durable" | "cloudflareDurable" | "cloudflare_durable" | "cloudflare-module" | "cloudflareModule" | "cloudflare_module" | "cloudflare-module-legacy" | "cloudflareModuleLegacy" | "cloudflare_module_legacy" | "cloudflare-pages" | "cloudflarePages" | "cloudflare_pages" | "cloudflare-pages-static" | "cloudflarePagesStatic" | "cloudflare_pages_static" | "cloudflare-worker" | "cloudflareWorker" | "cloudflare_worker" | "deno" | "deno-deploy" | "denoDeploy" | "deno_deploy" | "deno-server" | "denoServer" | "deno_server" | "deno-server-legacy" | "denoServerLegacy" | "deno_server_legacy" | "digital-ocean" | "digitalOcean" | "digital_ocean" | "edgio" | "firebase" | "firebase-app-hosting" | "firebaseAppHosting" | "firebase_app_hosting" | "flight-control" | "flightControl" | "flight_control" | "genezio" | "github-pages" | "githubPages" | "github_pages" | "gitlab-pages" | "gitlabPages" | "gitlab_pages" | "heroku" | "iis" | "iis-handler" | "iisHandler" | "iis_handler" | "iis-node" | "iisNode" | "iis_node" | "koyeb" | "layer0" | "netlify" | "netlify-builder" | "netlifyBuilder" | "netlify_builder" | "netlify-edge" | "netlifyEdge" | "netlify_edge" | "netlify-legacy" | "netlifyLegacy" | "netlify_legacy" | "netlify-static" | "netlifyStatic" | "netlify_static" | "nitro-dev" | "nitroDev" | "nitro_dev" | "nitro-prerender" | "nitroPrerender" | "nitro_prerender" | "node" | "node-cluster" | "nodeCluster" | "node_cluster" | "node-listener" | "nodeListener" | "node_listener" | "node-server" | "nodeServer" | "node_server" | "platform-sh" | "platformSh" | "platform_sh" | "render-com" | "renderCom" | "render_com" | "service-worker" | "serviceWorker" | "service_worker" | "static" | "stormkit" | "vercel" | "vercel-edge" | "vercelEdge" | "vercel_edge" | "vercel-static" | "vercelStatic" | "vercel_static" | "winterjs" | "zeabur" | "zeabur-static" | "zeaburStatic" | "zeabur_static" | "zerops" | "zerops-static" | "zeropsStatic" | "zerops_static" | (string & {});
|
|
1617
|
-
//#endregion
|
|
1618
|
-
//#region ../../node_modules/.pnpm/rollup-plugin-visualizer@6.0.5_rolldown@1.0.0-rc.3_rollup@4.57.1/node_modules/rollup-plugin-visualizer/dist/plugin/template-types.d.ts
|
|
1619
|
-
type TemplateType = "sunburst" | "treemap" | "network" | "raw-data" | "list" | "flamegraph";
|
|
1620
|
-
//#endregion
|
|
1621
|
-
//#region ../../node_modules/.pnpm/rollup-plugin-visualizer@6.0.5_rolldown@1.0.0-rc.3_rollup@4.57.1/node_modules/rollup-plugin-visualizer/dist/shared/create-filter.d.ts
|
|
1622
|
-
type Filter = {
|
|
1623
|
-
bundle?: string | null | undefined;
|
|
1624
|
-
file?: string | null | undefined;
|
|
1625
|
-
};
|
|
1626
|
-
//#endregion
|
|
1627
|
-
//#region ../../node_modules/.pnpm/rollup-plugin-visualizer@6.0.5_rolldown@1.0.0-rc.3_rollup@4.57.1/node_modules/rollup-plugin-visualizer/dist/plugin/index.d.ts
|
|
1628
|
-
interface PluginVisualizerOptions {
|
|
1629
|
-
/**
|
|
1630
|
-
* The path to the template file to use. Or just a name of a file.
|
|
1631
|
-
*
|
|
1632
|
-
* @default "stats.html"
|
|
1633
|
-
*/
|
|
1634
|
-
filename?: string;
|
|
1635
|
-
/**
|
|
1636
|
-
* If plugin should emit json file with visualizer data. It can be used with plugin CLI
|
|
1637
|
-
*
|
|
1638
|
-
* @default false
|
|
1639
|
-
* @deprecated use template 'raw-data'
|
|
1640
|
-
*/
|
|
1641
|
-
json?: boolean;
|
|
1642
|
-
/**
|
|
1643
|
-
* HTML <title> value in generated file. Ignored when `json` is true.
|
|
1644
|
-
*
|
|
1645
|
-
* @default "Rollup Visualizer"
|
|
1646
|
-
*/
|
|
1647
|
-
title?: string;
|
|
1648
|
-
/**
|
|
1649
|
-
* If plugin should open browser with generated file. Ignored when `json` or `emitFile` is true.
|
|
1650
|
-
*
|
|
1651
|
-
* @default false
|
|
1652
|
-
*/
|
|
1653
|
-
open?: boolean;
|
|
1654
|
-
openOptions?: OpenOptions;
|
|
1655
|
-
/**
|
|
1656
|
-
* Which diagram to generate. 'sunburst' or 'treemap' can help find big dependencies or if they are repeated.
|
|
1657
|
-
* 'network' can answer you why something was included.
|
|
1658
|
-
* 'flamegraph' will be familar to tools that you know already.
|
|
1659
|
-
*
|
|
1660
|
-
* @default 'treemap'
|
|
1661
|
-
*/
|
|
1662
|
-
template?: TemplateType;
|
|
1663
|
-
/**
|
|
1664
|
-
* If plugin should also calculate sizes of gzipped files.
|
|
1665
|
-
*
|
|
1666
|
-
* @default false
|
|
1667
|
-
*/
|
|
1668
|
-
gzipSize?: boolean;
|
|
1669
|
-
/**
|
|
1670
|
-
* If plugin should also calculate sizes of brotlied files.
|
|
1671
|
-
*
|
|
1672
|
-
* @default false
|
|
1673
|
-
*/
|
|
1674
|
-
brotliSize?: boolean;
|
|
1675
|
-
/**
|
|
1676
|
-
* If plugin should use sourcemap to calculate sizes of modules. By idea it will present more accurate results.
|
|
1677
|
-
* `gzipSize` and `brotliSize` does not make much sense with this option.
|
|
1678
|
-
*
|
|
1679
|
-
* @default false
|
|
1680
|
-
*/
|
|
1681
|
-
sourcemap?: boolean;
|
|
1682
|
-
/**
|
|
1683
|
-
* Absolute path where project is located. It is used to cut prefix from file's paths.
|
|
1684
|
-
*
|
|
1685
|
-
* @default process.cwd()
|
|
1686
|
-
*/
|
|
1687
|
-
projectRoot?: string | RegExp;
|
|
1688
|
-
/**
|
|
1689
|
-
* Use rollup .emitFile API to generate files. Could be usefull if you want to output to configured by rollup output dir.
|
|
1690
|
-
* When this set to true, filename options must be filename and not a path.
|
|
1691
|
-
*
|
|
1692
|
-
* @default false
|
|
1693
|
-
*/
|
|
1694
|
-
emitFile?: boolean;
|
|
1695
|
-
/**
|
|
1696
|
-
* A valid picomatch pattern, or array of patterns. If options.include is omitted or has zero length, filter will return true by
|
|
1697
|
-
* default. Otherwise, an ID must match one or more of the picomatch patterns, and must not match any of the options.exclude patterns.
|
|
1698
|
-
*/
|
|
1699
|
-
include?: Filter | Filter[];
|
|
1700
|
-
/**
|
|
1701
|
-
* A valid picomatch pattern, or array of patterns. If options.include is omitted or has zero length, filter will return true by
|
|
1702
|
-
* default. Otherwise, an ID must match one or more of the picomatch patterns, and must not match any of the options.exclude patterns.
|
|
1703
|
-
*/
|
|
1704
|
-
exclude?: Filter | Filter[];
|
|
1705
|
-
}
|
|
1706
|
-
//#endregion
|
|
1707
|
-
//#region ../../node_modules/.pnpm/unplugin-utils@0.3.1/node_modules/unplugin-utils/dist/index.d.ts
|
|
1708
|
-
//#region src/filter.d.ts
|
|
1709
|
-
/**
|
|
1710
|
-
* A valid `picomatch` glob pattern, or array of patterns.
|
|
1711
|
-
*/
|
|
1712
|
-
type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
|
|
1713
|
-
/**
|
|
1714
|
-
* Constructs a filter function which can be used to determine whether or not
|
|
1715
|
-
* certain modules should be operated upon.
|
|
1716
|
-
* @param include If `include` is omitted or has zero length, filter will return `true` by default.
|
|
1717
|
-
* @param exclude ID must not match any of the `exclude` patterns.
|
|
1718
|
-
* @param options Additional options.
|
|
1719
|
-
* @param options.resolve Optionally resolves the patterns against a directory other than `process.cwd()`.
|
|
1720
|
-
* If a `string` is specified, then the value will be used as the base directory.
|
|
1721
|
-
* Relative paths will be resolved against `process.cwd()` first.
|
|
1722
|
-
* If `false`, then the patterns will not be resolved against any directory.
|
|
1723
|
-
* This can be useful if you want to create a filter for virtual module names.
|
|
1724
|
-
*/
|
|
1725
|
-
//#endregion
|
|
1726
|
-
//#region ../../node_modules/.pnpm/unimport@5.6.0/node_modules/unimport/dist/shared/unimport.C0UbTDPO.d.mts
|
|
1727
|
-
declare const builtinPresets: {
|
|
1728
|
-
'@vue/composition-api': InlinePreset$1;
|
|
1729
|
-
'@vueuse/core': () => Preset;
|
|
1730
|
-
'@vueuse/head': InlinePreset$1;
|
|
1731
|
-
pinia: InlinePreset$1;
|
|
1732
|
-
preact: InlinePreset$1;
|
|
1733
|
-
quasar: InlinePreset$1;
|
|
1734
|
-
react: InlinePreset$1;
|
|
1735
|
-
'react-router': InlinePreset$1;
|
|
1736
|
-
'react-router-dom': InlinePreset$1;
|
|
1737
|
-
svelte: InlinePreset$1;
|
|
1738
|
-
'svelte/animate': InlinePreset$1;
|
|
1739
|
-
'svelte/easing': InlinePreset$1;
|
|
1740
|
-
'svelte/motion': InlinePreset$1;
|
|
1741
|
-
'svelte/store': InlinePreset$1;
|
|
1742
|
-
'svelte/transition': InlinePreset$1;
|
|
1743
|
-
'vee-validate': InlinePreset$1;
|
|
1744
|
-
vitepress: InlinePreset$1;
|
|
1745
|
-
'vue-demi': InlinePreset$1;
|
|
1746
|
-
'vue-i18n': InlinePreset$1;
|
|
1747
|
-
'vue-router': InlinePreset$1;
|
|
1748
|
-
'vue-router-composables': InlinePreset$1;
|
|
1749
|
-
vue: InlinePreset$1;
|
|
1750
|
-
'vue/macros': InlinePreset$1;
|
|
1751
|
-
vuex: InlinePreset$1;
|
|
1752
|
-
vitest: InlinePreset$1;
|
|
1753
|
-
'uni-app': InlinePreset$1;
|
|
1754
|
-
'solid-js': InlinePreset$1;
|
|
1755
|
-
'solid-app-router': InlinePreset$1;
|
|
1756
|
-
rxjs: InlinePreset$1;
|
|
1757
|
-
'date-fns': InlinePreset$1;
|
|
1758
|
-
};
|
|
1759
|
-
type BuiltinPresetName = keyof typeof builtinPresets;
|
|
1760
|
-
type ModuleId = string;
|
|
1761
|
-
type ImportName = string;
|
|
1762
|
-
interface ImportCommon {
|
|
1763
|
-
/** Module specifier to import from */
|
|
1764
|
-
from: ModuleId;
|
|
1765
|
-
/**
|
|
1766
|
-
* Priority of the import, if multiple imports have the same name, the one with the highest priority will be used
|
|
1767
|
-
* @default 1
|
|
1768
|
-
*/
|
|
1769
|
-
priority?: number;
|
|
1770
|
-
/** If this import is disabled */
|
|
1771
|
-
disabled?: boolean;
|
|
1772
|
-
/** Won't output import in declaration file if true */
|
|
1773
|
-
dtsDisabled?: boolean;
|
|
1774
|
-
/** Import declaration type like const / var / enum */
|
|
1775
|
-
declarationType?: ESMExport['declarationType'];
|
|
1776
|
-
/**
|
|
1777
|
-
* Metadata of the import
|
|
1778
|
-
*/
|
|
1779
|
-
meta?: {
|
|
1780
|
-
/** Short description of the import */description?: string; /** URL to the documentation */
|
|
1781
|
-
docsUrl?: string; /** Additional metadata */
|
|
1782
|
-
[key: string]: any;
|
|
1783
|
-
};
|
|
1784
|
-
/**
|
|
1785
|
-
* If this import is a pure type import
|
|
1786
|
-
*/
|
|
1787
|
-
type?: boolean;
|
|
1788
|
-
/**
|
|
1789
|
-
* Using this as the from when generating type declarations
|
|
1790
|
-
*/
|
|
1791
|
-
typeFrom?: ModuleId;
|
|
1792
|
-
}
|
|
1793
|
-
interface Import$1 extends ImportCommon {
|
|
1794
|
-
/** Import name to be detected */
|
|
1795
|
-
name: ImportName;
|
|
1796
|
-
/** Import as this name */
|
|
1797
|
-
as?: ImportName;
|
|
1798
|
-
/**
|
|
1799
|
-
* With properties
|
|
1800
|
-
*
|
|
1801
|
-
* Ignored for CJS imports.
|
|
1802
|
-
*/
|
|
1803
|
-
with?: Record<string, string>;
|
|
1804
|
-
}
|
|
1805
|
-
type PresetImport = Omit<Import$1, 'from'> | ImportName | [name: ImportName, as?: ImportName, from?: ModuleId];
|
|
1806
|
-
interface InlinePreset$1 extends ImportCommon {
|
|
1807
|
-
imports: (PresetImport | InlinePreset$1)[];
|
|
1808
|
-
}
|
|
1809
|
-
/**
|
|
1810
|
-
* Auto extract exports from a package for auto import
|
|
1811
|
-
*/
|
|
1812
|
-
interface PackagePreset {
|
|
1813
|
-
/**
|
|
1814
|
-
* Name of the package
|
|
1815
|
-
*/
|
|
1816
|
-
package: string;
|
|
1817
|
-
/**
|
|
1818
|
-
* Path of the importer
|
|
1819
|
-
* @default process.cwd()
|
|
1820
|
-
*/
|
|
1821
|
-
url?: string;
|
|
1822
|
-
/**
|
|
1823
|
-
* RegExp, string, or custom function to exclude names of the extracted imports
|
|
1824
|
-
*/
|
|
1825
|
-
ignore?: (string | RegExp | ((name: string) => boolean))[];
|
|
1826
|
-
/**
|
|
1827
|
-
* Use local cache if exits
|
|
1828
|
-
* @default true
|
|
1829
|
-
*/
|
|
1830
|
-
cache?: boolean;
|
|
1831
|
-
}
|
|
1832
|
-
type Preset = InlinePreset$1 | PackagePreset;
|
|
1833
|
-
interface UnimportContext {
|
|
1834
|
-
readonly version: string;
|
|
1835
|
-
options: Partial<UnimportOptions>;
|
|
1836
|
-
staticImports: Import$1[];
|
|
1837
|
-
dynamicImports: Import$1[];
|
|
1838
|
-
addons: Addon[];
|
|
1839
|
-
getImports: () => Promise<Import$1[]>;
|
|
1840
|
-
getImportMap: () => Promise<Map<string, Import$1>>;
|
|
1841
|
-
getMetadata: () => UnimportMeta | undefined;
|
|
1842
|
-
modifyDynamicImports: (fn: (imports: Import$1[]) => Thenable<void | Import$1[]>) => Promise<void>;
|
|
1843
|
-
clearDynamicImports: () => void;
|
|
1844
|
-
replaceImports: (imports: UnimportOptions['imports']) => Promise<Import$1[]>;
|
|
1845
|
-
invalidate: () => void;
|
|
1846
|
-
resolveId: (id: string, parentId?: string) => Thenable<string | null | undefined | void>;
|
|
1847
|
-
}
|
|
1848
|
-
interface InjectionUsageRecord {
|
|
1849
|
-
import: Import$1;
|
|
1850
|
-
count: number;
|
|
1851
|
-
moduleIds: string[];
|
|
1852
|
-
}
|
|
1853
|
-
interface UnimportMeta {
|
|
1854
|
-
injectionUsage: Record<string, InjectionUsageRecord>;
|
|
1855
|
-
}
|
|
1856
|
-
interface AddonsOptions {
|
|
1857
|
-
addons?: Addon[];
|
|
1858
|
-
/**
|
|
1859
|
-
* Enable auto import inside for Vue's <template>
|
|
1860
|
-
*
|
|
1861
|
-
* @default false
|
|
1862
|
-
*/
|
|
1863
|
-
vueTemplate?: boolean;
|
|
1864
|
-
/**
|
|
1865
|
-
* Enable auto import directives for Vue's SFC.
|
|
1866
|
-
*
|
|
1867
|
-
* Library authors should include `meta.vueDirective: true` in the import metadata.
|
|
1868
|
-
*
|
|
1869
|
-
* When using a local directives folder, provide the `isDirective`
|
|
1870
|
-
* callback to check if the import is a Vue directive.
|
|
1871
|
-
*/
|
|
1872
|
-
vueDirectives?: true | AddonVueDirectivesOptions;
|
|
1873
|
-
}
|
|
1874
|
-
interface AddonVueDirectivesOptions {
|
|
1875
|
-
/**
|
|
1876
|
-
* Checks if the import is a Vue directive.
|
|
1877
|
-
*
|
|
1878
|
-
* **NOTES**:
|
|
1879
|
-
* - imports from a library should include `meta.vueDirective: true`.
|
|
1880
|
-
* - this callback is only invoked for local directives (only when meta.vueDirective is not set).
|
|
1881
|
-
*
|
|
1882
|
-
* @param from The path of the import normalized.
|
|
1883
|
-
* @param importEntry The import entry.
|
|
1884
|
-
*/
|
|
1885
|
-
isDirective?: (from: string, importEntry: Import$1) => boolean;
|
|
1886
|
-
}
|
|
1887
|
-
interface UnimportOptions extends Pick<InjectImportsOptions, 'injectAtEnd' | 'mergeExisting' | 'parser'> {
|
|
1888
|
-
/**
|
|
1889
|
-
* Auto import items
|
|
1890
|
-
*/
|
|
1891
|
-
imports: Import$1[];
|
|
1892
|
-
/**
|
|
1893
|
-
* Auto import preset
|
|
1894
|
-
*/
|
|
1895
|
-
presets: (Preset | BuiltinPresetName)[];
|
|
1896
|
-
/**
|
|
1897
|
-
* Custom warning function
|
|
1898
|
-
* @default console.warn
|
|
1899
|
-
*/
|
|
1900
|
-
warn: (msg: string) => void;
|
|
1901
|
-
/**
|
|
1902
|
-
* Custom debug log function
|
|
1903
|
-
* @default console.log
|
|
1904
|
-
*/
|
|
1905
|
-
debugLog: (msg: string) => void;
|
|
1906
|
-
/**
|
|
1907
|
-
* Unimport Addons.
|
|
1908
|
-
* To use built-in addons, use:
|
|
1909
|
-
* ```js
|
|
1910
|
-
* addons: {
|
|
1911
|
-
* addons: [<custom-addons-here>] // if you want to use also custom addons
|
|
1912
|
-
* vueTemplate: true,
|
|
1913
|
-
* vueDirectives: [<the-directives-here>]
|
|
1914
|
-
* }
|
|
1915
|
-
* ```
|
|
1916
|
-
*
|
|
1917
|
-
* Built-in addons:
|
|
1918
|
-
* - vueDirectives: enable auto import directives for Vue's SFC
|
|
1919
|
-
* - vueTemplate: enable auto import inside for Vue's <template>
|
|
1920
|
-
*
|
|
1921
|
-
* @default {}
|
|
1922
|
-
*/
|
|
1923
|
-
addons: AddonsOptions | Addon[];
|
|
1924
|
-
/**
|
|
1925
|
-
* Name of virtual modules that exposed all the registed auto-imports
|
|
1926
|
-
* @default []
|
|
1927
|
-
*/
|
|
1928
|
-
virtualImports: string[];
|
|
1929
|
-
/**
|
|
1930
|
-
* Directories to scan for auto import
|
|
1931
|
-
* @default []
|
|
1932
|
-
*/
|
|
1933
|
-
dirs?: (string | ScanDir)[];
|
|
1934
|
-
/**
|
|
1935
|
-
* Options for scanning directories for auto import
|
|
1936
|
-
*/
|
|
1937
|
-
dirsScanOptions?: ScanDirExportsOptions;
|
|
1938
|
-
/**
|
|
1939
|
-
* Custom resolver to auto import id
|
|
1940
|
-
*/
|
|
1941
|
-
resolveId?: (id: string, importee?: string) => Thenable<string | void>;
|
|
1942
|
-
/**
|
|
1943
|
-
* Custom magic comments to be opt-out for auto import, per file/module
|
|
1944
|
-
*
|
|
1945
|
-
* @default ['@unimport-disable', '@imports-disable']
|
|
1946
|
-
*/
|
|
1947
|
-
commentsDisable?: string[];
|
|
1948
|
-
/**
|
|
1949
|
-
* Custom magic comments to debug auto import, printed to console
|
|
1950
|
-
*
|
|
1951
|
-
* @default ['@unimport-debug', '@imports-debug']
|
|
1952
|
-
*/
|
|
1953
|
-
commentsDebug?: string[];
|
|
1954
|
-
/**
|
|
1955
|
-
* Collect meta data for each auto import. Accessible via `ctx.meta`
|
|
1956
|
-
*/
|
|
1957
|
-
collectMeta?: boolean;
|
|
1958
|
-
}
|
|
1959
|
-
type PathFromResolver = (_import: Import$1) => string | undefined;
|
|
1960
|
-
interface ScanDirExportsOptions {
|
|
1961
|
-
/**
|
|
1962
|
-
* Glob patterns for matching files
|
|
1963
|
-
*
|
|
1964
|
-
* @default ['*.{ts,js,mjs,cjs,mts,cts,tsx,jsx}']
|
|
1965
|
-
*/
|
|
1966
|
-
filePatterns?: string[];
|
|
1967
|
-
/**
|
|
1968
|
-
* Custom function to filter scanned files
|
|
1969
|
-
*/
|
|
1970
|
-
fileFilter?: (file: string) => boolean;
|
|
1971
|
-
/**
|
|
1972
|
-
* Register type exports
|
|
1973
|
-
*
|
|
1974
|
-
* @default true
|
|
1975
|
-
*/
|
|
1976
|
-
types?: boolean;
|
|
1977
|
-
/**
|
|
1978
|
-
* Current working directory
|
|
1979
|
-
*
|
|
1980
|
-
* @default process.cwd()
|
|
1981
|
-
*/
|
|
1982
|
-
cwd?: string;
|
|
1983
|
-
}
|
|
1984
|
-
interface ScanDir {
|
|
1985
|
-
/**
|
|
1986
|
-
* Path pattern of the directory
|
|
1987
|
-
*/
|
|
1988
|
-
glob: string;
|
|
1989
|
-
/**
|
|
1990
|
-
* Register type exports
|
|
1991
|
-
*
|
|
1992
|
-
* @default true
|
|
1993
|
-
*/
|
|
1994
|
-
types?: boolean;
|
|
1995
|
-
}
|
|
1996
|
-
interface TypeDeclarationOptions {
|
|
1997
|
-
/**
|
|
1998
|
-
* Custom resolver for path of the import
|
|
1999
|
-
*/
|
|
2000
|
-
resolvePath?: PathFromResolver;
|
|
2001
|
-
/**
|
|
2002
|
-
* Append `export {}` to the end of the file
|
|
2003
|
-
*
|
|
2004
|
-
* @default true
|
|
2005
|
-
*/
|
|
2006
|
-
exportHelper?: boolean;
|
|
2007
|
-
/**
|
|
2008
|
-
* Auto-import for type exports
|
|
2009
|
-
*
|
|
2010
|
-
* @default true
|
|
2011
|
-
*/
|
|
2012
|
-
typeReExports?: boolean;
|
|
2013
|
-
}
|
|
2014
|
-
interface InjectImportsOptions {
|
|
2015
|
-
/**
|
|
2016
|
-
* Merge the existing imports
|
|
2017
|
-
*
|
|
2018
|
-
* @default false
|
|
2019
|
-
*/
|
|
2020
|
-
mergeExisting?: boolean;
|
|
2021
|
-
/**
|
|
2022
|
-
* If the module should be auto imported
|
|
2023
|
-
*
|
|
2024
|
-
* @default true
|
|
2025
|
-
*/
|
|
2026
|
-
autoImport?: boolean;
|
|
2027
|
-
/**
|
|
2028
|
-
* If the module should be transformed for virtual modules.
|
|
2029
|
-
* Only available when `virtualImports` is set.
|
|
2030
|
-
*
|
|
2031
|
-
* @default true
|
|
2032
|
-
*/
|
|
2033
|
-
transformVirtualImports?: boolean;
|
|
2034
|
-
/**
|
|
2035
|
-
* Parser to use for parsing the code
|
|
2036
|
-
*
|
|
2037
|
-
* Note that `acorn` only takes valid JS Code, should usually only be used after transformationa and transpilation
|
|
2038
|
-
*
|
|
2039
|
-
* @default 'regex'
|
|
2040
|
-
*/
|
|
2041
|
-
parser?: 'acorn' | 'regex';
|
|
2042
|
-
/**
|
|
2043
|
-
* Inject the imports at the end of other imports
|
|
2044
|
-
*
|
|
2045
|
-
* @default false
|
|
2046
|
-
*/
|
|
2047
|
-
injectAtEnd?: boolean;
|
|
2048
|
-
}
|
|
2049
|
-
type Thenable<T> = Promise<T> | T;
|
|
2050
|
-
interface Addon {
|
|
2051
|
-
name?: string;
|
|
2052
|
-
transform?: (this: UnimportContext, code: MagicString, id: string | undefined) => Thenable<MagicString>;
|
|
2053
|
-
declaration?: (this: UnimportContext, dts: string, options: TypeDeclarationOptions) => Thenable<string>;
|
|
2054
|
-
matchImports?: (this: UnimportContext, identifiers: Set<string>, matched: Import$1[]) => Thenable<Import$1[] | void>;
|
|
2055
|
-
/**
|
|
2056
|
-
* Extend or modify the imports list before injecting
|
|
2057
|
-
*/
|
|
2058
|
-
extendImports?: (this: UnimportContext, imports: Import$1[]) => Import$1[] | void;
|
|
2059
|
-
/**
|
|
2060
|
-
* Resolve imports before injecting
|
|
2061
|
-
*/
|
|
2062
|
-
injectImportsResolved?: (this: UnimportContext, imports: Import$1[], code: MagicString, id?: string) => Import$1[] | void;
|
|
2063
|
-
/**
|
|
2064
|
-
* Modify the injection code before injecting
|
|
2065
|
-
*/
|
|
2066
|
-
injectImportsStringified?: (this: UnimportContext, injection: string, imports: Import$1[], code: MagicString, id?: string) => string | void;
|
|
2067
|
-
}
|
|
2068
|
-
//#endregion
|
|
2069
|
-
//#region ../../node_modules/.pnpm/unimport@5.6.0/node_modules/unimport/dist/unplugin.d.mts
|
|
2070
|
-
interface UnimportPluginOptions extends UnimportOptions {
|
|
2071
|
-
include: FilterPattern;
|
|
2072
|
-
exclude: FilterPattern;
|
|
2073
|
-
dts: boolean | string;
|
|
2074
|
-
/**
|
|
2075
|
-
* Enable implicit auto import.
|
|
2076
|
-
* Generate global TypeScript definitions.
|
|
2077
|
-
*
|
|
2078
|
-
* @default true
|
|
2079
|
-
*/
|
|
2080
|
-
autoImport?: boolean;
|
|
2081
|
-
}
|
|
2082
|
-
//#endregion
|
|
2083
|
-
//#region ../../node_modules/.pnpm/unwasm@0.5.3/node_modules/unwasm/dist/plugin/index.d.mts
|
|
2084
|
-
//#region src/plugin/shared.d.ts
|
|
2085
|
-
interface UnwasmPluginOptions {
|
|
2086
|
-
/**
|
|
2087
|
-
* Directly import the `.wasm` files instead of bundling as base64 string.
|
|
2088
|
-
*
|
|
2089
|
-
* @default false
|
|
2090
|
-
*/
|
|
2091
|
-
esmImport?: boolean;
|
|
2092
|
-
/**
|
|
2093
|
-
* Avoid using top level await and always use a proxy.
|
|
2094
|
-
*
|
|
2095
|
-
* Useful for compatibility with environments that don't support top level await.
|
|
2096
|
-
*
|
|
2097
|
-
* @default false
|
|
2098
|
-
*/
|
|
2099
|
-
lazy?: boolean;
|
|
2100
|
-
/**
|
|
2101
|
-
* Suppress all warnings from the plugin.
|
|
2102
|
-
*
|
|
2103
|
-
* @default false
|
|
2104
|
-
*/
|
|
2105
|
-
silent?: boolean;
|
|
2106
|
-
} //#endregion
|
|
2107
|
-
//#region src/plugin/index.d.ts
|
|
2108
|
-
//#endregion
|
|
2109
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/shared/nitro.DLF2_KRt.d.ts
|
|
2110
|
-
type Enumerate<N extends number, Acc extends number[] = []> = Acc["length"] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc["length"]]>;
|
|
2111
|
-
type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
2112
|
-
type ExcludeFunctions<G extends Record<string, any>> = Pick<G, { [P in keyof G]: NonNullable<G[P]> extends Function ? never : P }[keyof G]>;
|
|
2113
|
-
type DeepPartial<T> = T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> | T[P] } : T;
|
|
2114
|
-
interface DevServerOptions {
|
|
2115
|
-
watch: string[];
|
|
2116
|
-
}
|
|
2117
|
-
/**
|
|
2118
|
-
Source: (inlined because of install size concernes)
|
|
2119
|
-
|
|
2120
|
-
https://github.com/openapi-ts/openapi-typescript/blob/fc3f7/packages/openapi-typescript/src/types.ts
|
|
2121
|
-
|
|
2122
|
-
MIT License
|
|
2123
|
-
|
|
2124
|
-
Copyright (c) 2020 Drew Powers
|
|
2125
|
-
|
|
2126
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2127
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
2128
|
-
in the Software without restriction, including without limitation the rights
|
|
2129
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2130
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
2131
|
-
furnished to do so, subject to the following conditions:
|
|
2132
|
-
|
|
2133
|
-
The above copyright notice and this permission notice shall be included in all
|
|
2134
|
-
copies or substantial portions of the Software.
|
|
2135
|
-
|
|
2136
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2137
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2138
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2139
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2140
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2141
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
2142
|
-
SOFTWARE.
|
|
2143
|
-
*/
|
|
2144
|
-
interface Extensable {
|
|
2145
|
-
[key: `x-${string}`]: any;
|
|
2146
|
-
}
|
|
2147
|
-
/**
|
|
2148
|
-
* [4.8] Schema
|
|
2149
|
-
* @see https://spec.openapis.org/oas/v3.1.0#schema
|
|
2150
|
-
*/
|
|
2151
|
-
interface OpenAPI3 extends Extensable {
|
|
2152
|
-
/** REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI document. This is not related to the API info.version string. */
|
|
2153
|
-
openapi: string;
|
|
2154
|
-
/** REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required. */
|
|
2155
|
-
info: InfoObject;
|
|
2156
|
-
/** The default value for the $schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI. */
|
|
2157
|
-
jsonSchemaDialect?: string;
|
|
2158
|
-
/** An array of Server Objects, which provide connectivity information to a target server. If the servers property is not provided, or is an empty array, the default value would be a Server Object with a url value of /. */
|
|
2159
|
-
servers?: ServerObject[];
|
|
2160
|
-
/** The available paths and operations for the API. */
|
|
2161
|
-
paths?: PathsObject;
|
|
2162
|
-
/** The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the callbacks feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An example is available. */
|
|
2163
|
-
webhooks?: {
|
|
2164
|
-
[id: string]: PathItemObject | ReferenceObject;
|
|
2165
|
-
};
|
|
2166
|
-
/** An element to hold various schemas for the document. */
|
|
2167
|
-
components?: ComponentsObject;
|
|
2168
|
-
/** A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement ({}) can be included in the array. */
|
|
2169
|
-
security?: SecurityRequirementObject[];
|
|
2170
|
-
/** A list of tags used by the document with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools’ logic. Each tag name in the list MUST be unique. */
|
|
2171
|
-
tags?: TagObject[];
|
|
2172
|
-
/** Additional external documentation. */
|
|
2173
|
-
externalDocs?: ExternalDocumentationObject;
|
|
2174
|
-
$defs?: $defs;
|
|
2175
|
-
}
|
|
2176
|
-
/**
|
|
2177
|
-
* [4.8.2] Info Object
|
|
2178
|
-
* The object provides metadata about the API.
|
|
2179
|
-
*/
|
|
2180
|
-
interface InfoObject extends Extensable {
|
|
2181
|
-
/** REQUIRED. The title of the API. */
|
|
2182
|
-
title: string;
|
|
2183
|
-
/** A short summary of the API. */
|
|
2184
|
-
summary?: string;
|
|
2185
|
-
/** A description of the API. CommonMark syntax MAY be used for rich text representation. */
|
|
2186
|
-
description?: string;
|
|
2187
|
-
/** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */
|
|
2188
|
-
termsOfService?: string;
|
|
2189
|
-
/** The contact information for the exposed API. */
|
|
2190
|
-
contact?: ContactObject;
|
|
2191
|
-
/** The license information for the exposed API. */
|
|
2192
|
-
license?: LicenseObject;
|
|
2193
|
-
/** REQUIRED. The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version). */
|
|
2194
|
-
version: string;
|
|
2195
|
-
}
|
|
2196
|
-
/**
|
|
2197
|
-
* [4.8.3] Contact Object
|
|
2198
|
-
* Contact information for the exposed API.
|
|
2199
|
-
*/
|
|
2200
|
-
interface ContactObject extends Extensable {
|
|
2201
|
-
/** The identifying name of the contact person/organization. */
|
|
2202
|
-
name?: string;
|
|
2203
|
-
/** The URL pointing to the contact information. This MUST be in the form of a URL. */
|
|
2204
|
-
url?: string;
|
|
2205
|
-
/** The email address of the contact person/organization. This MUST be in the form of an email address. */
|
|
2206
|
-
email?: string;
|
|
2207
|
-
}
|
|
2208
|
-
/**
|
|
2209
|
-
* [4.8.4] License object
|
|
2210
|
-
* License information for the exposed API.
|
|
2211
|
-
*/
|
|
2212
|
-
interface LicenseObject extends Extensable {
|
|
2213
|
-
/** REQUIRED. The license name used for the API. */
|
|
2214
|
-
name: string;
|
|
2215
|
-
/** An SPDX license expression for the API. The identifier field is mutually exclusive of the url field. */
|
|
2216
|
-
identifier: string;
|
|
2217
|
-
/** A URL to the license used for the API. This MUST be in the form of a URL. The url field is mutually exclusive of the identifier field. */
|
|
2218
|
-
url: string;
|
|
2219
|
-
}
|
|
2220
|
-
/**
|
|
2221
|
-
* [4.8.5] Server Object
|
|
2222
|
-
* An object representing a Server.
|
|
2223
|
-
*/
|
|
2224
|
-
interface ServerObject extends Extensable {
|
|
2225
|
-
/** REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in {brackets}. */
|
|
2226
|
-
url: string;
|
|
2227
|
-
/** An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation. */
|
|
2228
|
-
description: string;
|
|
2229
|
-
/** A map between a variable name and its value. The value is used for substitution in the server’s URL template. */
|
|
2230
|
-
variables: {
|
|
2231
|
-
[name: string]: ServerVariableObject;
|
|
2232
|
-
};
|
|
2233
|
-
}
|
|
2234
|
-
/**
|
|
2235
|
-
* [4.8.6] Server Variable Object
|
|
2236
|
-
* An object representing a Server Variable for server URL template substitution.
|
|
2237
|
-
*/
|
|
2238
|
-
interface ServerVariableObject extends Extensable {
|
|
2239
|
-
/** An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty. */
|
|
2240
|
-
enum?: string[];
|
|
2241
|
-
/** REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied. Note this behavior is different than the Schema Object’s treatment of default values, because in those cases parameter values are optional. If the enum is defined, the value MUST exist in the enum’s values. */
|
|
2242
|
-
default: string;
|
|
2243
|
-
/** An optional description for the server variable. CommonMark syntax MAY be used for rich text representation. */
|
|
2244
|
-
description?: string;
|
|
2245
|
-
}
|
|
2246
|
-
/**
|
|
2247
|
-
* [4.8.7] Components Object
|
|
2248
|
-
* Holds a set of reusable objects for different aspects of the OAS.
|
|
2249
|
-
*/
|
|
2250
|
-
interface ComponentsObject extends Extensable {
|
|
2251
|
-
/** An object to hold reusable Schema Objects.*/
|
|
2252
|
-
schemas?: Record<string, SchemaObject>;
|
|
2253
|
-
/** An object to hold reusable Response Objects. */
|
|
2254
|
-
responses?: Record<string, ResponseObject | ReferenceObject>;
|
|
2255
|
-
/** An object to hold reusable Parameter Objects. */
|
|
2256
|
-
parameters?: Record<string, ParameterObject | ReferenceObject>;
|
|
2257
|
-
/** An object to hold reusable Example Objects. */
|
|
2258
|
-
examples?: Record<string, ExampleObject | ReferenceObject>;
|
|
2259
|
-
/** An object to hold reusable Request Body Objects. */
|
|
2260
|
-
requestBodies?: Record<string, RequestBodyObject | ReferenceObject>;
|
|
2261
|
-
/** An object to hold reusable Header Objects. */
|
|
2262
|
-
headers?: Record<string, HeaderObject | ReferenceObject>;
|
|
2263
|
-
/** An object to hold reusable Security Scheme Objects. */
|
|
2264
|
-
securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>;
|
|
2265
|
-
/** An object to hold reusable Link Objects. */
|
|
2266
|
-
links?: Record<string, LinkObject | ReferenceObject>;
|
|
2267
|
-
/** An object to hold reusable Callback Objects. */
|
|
2268
|
-
callbacks?: Record<string, CallbackObject | ReferenceObject>;
|
|
2269
|
-
/** An object to hold reusable Path Item Objects. */
|
|
2270
|
-
pathItems?: Record<string, PathItemObject | ReferenceObject>;
|
|
2271
|
-
}
|
|
2272
|
-
/**
|
|
2273
|
-
* [4.8.8] Paths Object
|
|
2274
|
-
* Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the Server Object in order to construct the full URL. The Paths MAY be empty, due to Access Control List (ACL) constraints.
|
|
2275
|
-
*/
|
|
2276
|
-
interface PathsObject {
|
|
2277
|
-
[pathname: string]: PathItemObject | ReferenceObject;
|
|
2278
|
-
}
|
|
2279
|
-
/**
|
|
2280
|
-
* [4.8.9] Path Item Object
|
|
2281
|
-
* Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
|
|
2282
|
-
*/
|
|
2283
|
-
interface PathItemObject extends Extensable {
|
|
2284
|
-
/** A definition of a GET operation on this path. */
|
|
2285
|
-
get?: OperationObject | ReferenceObject;
|
|
2286
|
-
/** A definition of a PUT operation on this path. */
|
|
2287
|
-
put?: OperationObject | ReferenceObject;
|
|
2288
|
-
/** A definition of a POST operation on this path. */
|
|
2289
|
-
post?: OperationObject | ReferenceObject;
|
|
2290
|
-
/** A definition of a DELETE operation on this path. */
|
|
2291
|
-
delete?: OperationObject | ReferenceObject;
|
|
2292
|
-
/** A definition of a OPTIONS operation on this path. */
|
|
2293
|
-
options?: OperationObject | ReferenceObject;
|
|
2294
|
-
/** A definition of a HEAD operation on this path. */
|
|
2295
|
-
head?: OperationObject | ReferenceObject;
|
|
2296
|
-
/** A definition of a PATCH operation on this path. */
|
|
2297
|
-
patch?: OperationObject | ReferenceObject;
|
|
2298
|
-
/** A definition of a TRACE operation on this path. */
|
|
2299
|
-
trace?: OperationObject | ReferenceObject;
|
|
2300
|
-
/** An alternative server array to service all operations in this path. */
|
|
2301
|
-
servers?: ServerObject[];
|
|
2302
|
-
/** A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object’s components/parameters. */
|
|
2303
|
-
parameters?: (ParameterObject | ReferenceObject)[];
|
|
2304
|
-
}
|
|
2305
|
-
/**
|
|
2306
|
-
* [4.8.10] Operation Object
|
|
2307
|
-
* Describes a single API operation on a path.
|
|
2308
|
-
*/
|
|
2309
|
-
interface OperationObject extends Extensable {
|
|
2310
|
-
/** A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier. */
|
|
2311
|
-
tags?: string[];
|
|
2312
|
-
/** A short summary of what the operation does. */
|
|
2313
|
-
summary?: string;
|
|
2314
|
-
/** A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text representation. */
|
|
2315
|
-
description?: string;
|
|
2316
|
-
/** Additional external documentation for this operation. */
|
|
2317
|
-
externalDocs?: ExternalDocumentationObject;
|
|
2318
|
-
/** Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is case-sensitive. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions. */
|
|
2319
|
-
operationId?: string;
|
|
2320
|
-
/** A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object’s components/parameters. */
|
|
2321
|
-
parameters?: (ParameterObject | ReferenceObject)[];
|
|
2322
|
-
/** The request body applicable for this operation. The requestBody is fully supported in HTTP methods where the HTTP 1.1 specification [RFC7231] has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague (such as GET, HEAD and DELETE), requestBody is permitted but does not have well-defined semantics and SHOULD be avoided if possible. */
|
|
2323
|
-
requestBody?: RequestBodyObject | ReferenceObject;
|
|
2324
|
-
/** The list of possible responses as they are returned from executing this operation. */
|
|
2325
|
-
responses?: ResponsesObject;
|
|
2326
|
-
/** A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a Callback Object that describes a request that may be initiated by the API provider and the expected responses. */
|
|
2327
|
-
callbacks?: Record<string, CallbackObject | ReferenceObject>;
|
|
2328
|
-
/** Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is false. */
|
|
2329
|
-
deprecated?: boolean;
|
|
2330
|
-
/** A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. To make security optional, an empty security requirement ({}) can be included in the array. This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used. */
|
|
2331
|
-
security?: SecurityRequirementObject[];
|
|
2332
|
-
/** An alternative server array to service this operation. If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by this value. */
|
|
2333
|
-
servers?: ServerObject[];
|
|
2334
|
-
}
|
|
2335
|
-
/**
|
|
2336
|
-
* [4.8.11] External Documentation Object
|
|
2337
|
-
* Allows referencing an external resource for extended documentation.
|
|
2338
|
-
*/
|
|
2339
|
-
interface ExternalDocumentationObject extends Extensable {
|
|
2340
|
-
/** A description of the target documentation. CommonMark syntax MAY be used for rich text representation. */
|
|
2341
|
-
description?: string;
|
|
2342
|
-
/** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */
|
|
2343
|
-
url: string;
|
|
2344
|
-
}
|
|
2345
|
-
/**
|
|
2346
|
-
* [4.8.12] Parameter Object
|
|
2347
|
-
* Describes a single operation parameter.
|
|
2348
|
-
* A unique parameter is defined by a combination of a name and location.
|
|
2349
|
-
*/
|
|
2350
|
-
interface ParameterObject extends Extensable {
|
|
2351
|
-
/**
|
|
2352
|
-
* REQUIRED. The name of the parameter. Parameter names are case sensitive.
|
|
2353
|
-
*
|
|
2354
|
-
* - If `in` is `"path"`, the `name` field MUST correspond to a template expression occurring within the path field in the Paths Object. See Path Templating for further information.
|
|
2355
|
-
* - If `in` is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
|
|
2356
|
-
* - For all other cases, the `name` corresponds to the parameter name used by the `in` property.
|
|
2357
|
-
*/
|
|
2358
|
-
name: string;
|
|
2359
|
-
/** REQUIRED. The location of the parameter. Possible values are "query", "header", "path" or "cookie".*/
|
|
2360
|
-
in: "query" | "header" | "path" | "cookie";
|
|
2361
|
-
/** A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation. */
|
|
2362
|
-
description?: string;
|
|
2363
|
-
/** Determines whether this parameter is mandatory. If the parameter location is "path", this property is REQUIRED and its value MUST be true. Otherwise, the property MAY be included and its default value is false. */
|
|
2364
|
-
required?: boolean;
|
|
2365
|
-
/** Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false. */
|
|
2366
|
-
deprecated?: boolean;
|
|
2367
|
-
/** Sets the ability to pass empty-valued parameters. This is valid only for query parameters and allows sending a parameter with an empty value. Default value is false. If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision. */
|
|
2368
|
-
allowEmptyValue?: boolean;
|
|
2369
|
-
/** Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form. */
|
|
2370
|
-
style?: string;
|
|
2371
|
-
/** When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When `style` is `form`, the default value is `true`. For all other styles, the default value is `false`. */
|
|
2372
|
-
explode?: boolean;
|
|
2373
|
-
/** Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986] `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`. */
|
|
2374
|
-
allowReserved?: boolean;
|
|
2375
|
-
/** The schema defining the type used for the parameter. */
|
|
2376
|
-
schema?: SchemaObject;
|
|
2377
|
-
/** Example of the parameter’s potential value. */
|
|
2378
|
-
example?: any;
|
|
2379
|
-
/** Examples of the parameter’s potential value. */
|
|
2380
|
-
examples?: {
|
|
2381
|
-
[name: string]: ExampleObject | ReferenceObject;
|
|
2382
|
-
};
|
|
2383
|
-
/** A map containing the representations for the parameter. */
|
|
2384
|
-
content?: {
|
|
2385
|
-
[contentType: string]: MediaTypeObject | ReferenceObject;
|
|
2386
|
-
};
|
|
2387
|
-
}
|
|
2388
|
-
/**
|
|
2389
|
-
* [4.8.13] Request Body Object
|
|
2390
|
-
* Describes a single request body.
|
|
2391
|
-
*/
|
|
2392
|
-
interface RequestBodyObject extends Extensable {
|
|
2393
|
-
/** A brief description of the request body. This could contain examples of use. CommonMark syntax MAY be used for rich text representation. */
|
|
2394
|
-
description?: string;
|
|
2395
|
-
/** REQUIRED. The content of the request body. The key is a media type or media type range and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text */
|
|
2396
|
-
content: {
|
|
2397
|
-
[contentType: string]: MediaTypeObject | ReferenceObject;
|
|
2398
|
-
};
|
|
2399
|
-
/** Determines if the request body is required in the request. Defaults to false. */
|
|
2400
|
-
required?: boolean;
|
|
2401
|
-
}
|
|
2402
|
-
/**
|
|
2403
|
-
* [4.8.14] Media Type Object
|
|
2404
|
-
*/
|
|
2405
|
-
interface MediaTypeObject extends Extensable {
|
|
2406
|
-
/** The schema defining the content of the request, response, or parameter. */
|
|
2407
|
-
schema?: SchemaObject | ReferenceObject;
|
|
2408
|
-
/** Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The example field is mutually exclusive of the examples field. Furthermore, if referencing a schema which contains an example, the example value SHALL override the example provided by the schema. */
|
|
2409
|
-
example?: any;
|
|
2410
|
-
/** Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The examples field is mutually exclusive of the example field. Furthermore, if referencing a schema which contains an example, the examples value SHALL override the example provided by the schema. */
|
|
2411
|
-
examples?: {
|
|
2412
|
-
[name: string]: ExampleObject | ReferenceObject;
|
|
2413
|
-
};
|
|
2414
|
-
/** A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded. */
|
|
2415
|
-
encoding?: {
|
|
2416
|
-
[propertyName: string]: EncodingObject;
|
|
2417
|
-
};
|
|
2418
|
-
}
|
|
2419
|
-
/**
|
|
2420
|
-
* [4.8.15] Encoding Object
|
|
2421
|
-
* A single encoding definition applied to a single schema property.
|
|
2422
|
-
*/
|
|
2423
|
-
interface EncodingObject extends Extensable {
|
|
2424
|
-
/** The Content-Type for encoding a specific property. Default value depends on the property type: for object - application/json; for array – the default is defined based on the inner type; for all other cases the default is application/octet-stream. The value can be a specific media type (e.g. application/json), a wildcard media type (e.g. image/*), or a comma-separated list of the two types. */
|
|
2425
|
-
contentType?: string;
|
|
2426
|
-
/** A map allowing additional information to be provided as headers, for example Content-Disposition. Content-Type is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a multipart. */
|
|
2427
|
-
headers?: {
|
|
2428
|
-
[name: string]: HeaderObject | ReferenceObject;
|
|
2429
|
-
};
|
|
2430
|
-
/** Describes how a specific property value will be serialized depending on its type. See Parameter Object for details on the style property. The behavior follows the same values as query parameters, including default values. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored. */
|
|
2431
|
-
style?: string;
|
|
2432
|
-
/** When this is true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When style is form, the default value is true. For all other styles, the default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored. */
|
|
2433
|
-
explode?: string;
|
|
2434
|
-
/** Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986] :/?#[]@!$&'()*+,;= to be included without percent-encoding. The default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored. */
|
|
2435
|
-
allowReserved?: string;
|
|
2436
|
-
}
|
|
2437
|
-
/**
|
|
2438
|
-
* [4.8.16] Responses Object
|
|
2439
|
-
* A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.
|
|
2440
|
-
*/
|
|
2441
|
-
type ResponsesObject = {
|
|
2442
|
-
[responseCode: string]: ResponseObject | ReferenceObject;
|
|
2443
|
-
} & {
|
|
2444
|
-
/** The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. */default?: ResponseObject | ReferenceObject;
|
|
2445
|
-
};
|
|
2446
|
-
/**
|
|
2447
|
-
* [4.8.17] Response Object
|
|
2448
|
-
* Describes a single response from an API Operation, including design-time, static links to operations based on the response.
|
|
2449
|
-
*/
|
|
2450
|
-
interface ResponseObject extends Extensable {
|
|
2451
|
-
/** REQUIRED. A description of the response. CommonMark syntax MAY be used for rich text representation. */
|
|
2452
|
-
description: string;
|
|
2453
|
-
/** Maps a header name to its definition. [RFC7230] states header names are case insensitive. If a response header is defined with the name "Content-Type", it SHALL be ignored. */
|
|
2454
|
-
headers?: {
|
|
2455
|
-
[name: string]: HeaderObject | ReferenceObject;
|
|
2456
|
-
};
|
|
2457
|
-
/** A map containing descriptions of potential response payloads. The key is a media type or media type range and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text */
|
|
2458
|
-
content?: {
|
|
2459
|
-
[contentType: string]: MediaTypeObject;
|
|
2460
|
-
};
|
|
2461
|
-
/** A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for Component Objects. */
|
|
2462
|
-
links?: {
|
|
2463
|
-
[name: string]: LinkObject | ReferenceObject;
|
|
2464
|
-
};
|
|
2465
|
-
}
|
|
2466
|
-
/**
|
|
2467
|
-
* [4.8.18] Callback Object
|
|
2468
|
-
* A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
|
|
2469
|
-
*/
|
|
2470
|
-
type CallbackObject = Record<string, PathItemObject>;
|
|
2471
|
-
/**
|
|
2472
|
-
* [4.8.19[ Example Object
|
|
2473
|
-
*/
|
|
2474
|
-
interface ExampleObject extends Extensable {
|
|
2475
|
-
/** Short description for the example. */
|
|
2476
|
-
summary?: string;
|
|
2477
|
-
/** Long description for the example. CommonMark syntax MAY be used for rich text representation. */
|
|
2478
|
-
description?: string;
|
|
2479
|
-
/** Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary. */
|
|
2480
|
-
value?: any;
|
|
2481
|
-
/** A URI that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive. See the rules for resolving Relative References. */
|
|
2482
|
-
externalValue?: string;
|
|
2483
|
-
}
|
|
2484
|
-
/**
|
|
2485
|
-
* [4.8.20] Link Object
|
|
2486
|
-
* The Link object represents a possible design-time link for a response. The presence of a link does not guarantee the caller’s ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
|
|
2487
|
-
*/
|
|
2488
|
-
interface LinkObject extends Extensable {
|
|
2489
|
-
/** A relative or absolute URI reference to an OAS operation. This field is mutually exclusive of the operationId field, and MUST point to an Operation Object. Relative operationRef values MAY be used to locate an existing Operation Object in the OpenAPI definition. See the rules for resolving Relative References. */
|
|
2490
|
-
operationRef?: string;
|
|
2491
|
-
/** The name of an existing, resolvable OAS operation, as defined with a unique operationId. This field is mutually exclusive of the operationRef field. */
|
|
2492
|
-
operationId?: string;
|
|
2493
|
-
/** A map representing parameters to pass to an operation as specified with operationId or identified via operationRef. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the parameter location [{in}.]{name} for operations that use the same parameter name in different locations (e.g. path.id). */
|
|
2494
|
-
parameters?: {
|
|
2495
|
-
[name: string]: `$${string}`;
|
|
2496
|
-
};
|
|
2497
|
-
/** A literal value or {expression} to use as a request body when calling the target operation. */
|
|
2498
|
-
requestBody?: `$${string}`;
|
|
2499
|
-
/** A description of the link. CommonMark syntax MAY be used for rich text representation. */
|
|
2500
|
-
description?: string;
|
|
2501
|
-
/** A server object to be used by the target operation. */
|
|
2502
|
-
server?: ServerObject;
|
|
2503
|
-
}
|
|
2504
|
-
/**
|
|
2505
|
-
* [4.8.21] Header Object
|
|
2506
|
-
* The Header Object follows the structure of the Parameter Object with the following changes:
|
|
2507
|
-
*
|
|
2508
|
-
* 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
|
|
2509
|
-
* 2. `in` MUST NOT be specified, it is implicitly in `header`.
|
|
2510
|
-
* 3. All traits that are affected by the location MUST be applicable to a location of `heade`r (for example, `style`).
|
|
2511
|
-
*/
|
|
2512
|
-
type HeaderObject = Omit<ParameterObject, "name" | "in">;
|
|
2513
|
-
/**
|
|
2514
|
-
* [4.8.22] Tag Object
|
|
2515
|
-
* Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
|
|
2516
|
-
*/
|
|
2517
|
-
interface TagObject extends Extensable {
|
|
2518
|
-
/** REQUIRED. The name of the tag. */
|
|
2519
|
-
name: string;
|
|
2520
|
-
/** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
|
|
2521
|
-
description?: string;
|
|
2522
|
-
/** Additional external documentation for this tag. */
|
|
2523
|
-
externalDocs?: ExternalDocumentationObject;
|
|
2524
|
-
}
|
|
2525
|
-
/**
|
|
2526
|
-
* [4.8.23] Reference Object
|
|
2527
|
-
* A simple object to allow referencing other components in the OpenAPI document, internally and externally. The $ref string value contains a URI [RFC3986], which identifies the location of the value being referenced. See the rules for resolving Relative References.
|
|
2528
|
-
*/
|
|
2529
|
-
interface ReferenceObject extends Extensable {
|
|
2530
|
-
/** REQUIRED. The reference identifier. This MUST be in the form of a URI. */
|
|
2531
|
-
$ref: string;
|
|
2532
|
-
/** A short summary which by default SHOULD override that of the referenced component. If the referenced object-type does not allow a summary field, then this field has no effect. */
|
|
2533
|
-
summary?: string;
|
|
2534
|
-
/** A description which by default SHOULD override that of the referenced component. CommonMark syntax MAY be used for rich text representation. If the referenced object-type does not allow a description field, then this field has no effect. */
|
|
2535
|
-
description?: string;
|
|
2536
|
-
}
|
|
2537
|
-
/**
|
|
2538
|
-
* [4.8.24] Schema Object
|
|
2539
|
-
* The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 2020-12.
|
|
2540
|
-
*/
|
|
2541
|
-
type SchemaObject = {
|
|
2542
|
-
/** The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 2020-12. */discriminator?: DiscriminatorObject; /** MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property. */
|
|
2543
|
-
xml?: XMLObject; /** Additional external documentation for this schema. */
|
|
2544
|
-
externalDocs?: ExternalDocumentationObject; /** @deprecated */
|
|
2545
|
-
example?: any;
|
|
2546
|
-
title?: string;
|
|
2547
|
-
description?: string;
|
|
2548
|
-
$comment?: string;
|
|
2549
|
-
deprecated?: boolean;
|
|
2550
|
-
readOnly?: boolean;
|
|
2551
|
-
writeOnly?: boolean;
|
|
2552
|
-
enum?: unknown[]; /** Use of this keyword is functionally equivalent to an "enum" (Section 6.1.2) with a single value. */
|
|
2553
|
-
const?: unknown;
|
|
2554
|
-
default?: unknown;
|
|
2555
|
-
format?: string; /** @deprecated in 3.1 (still valid for 3.0) */
|
|
2556
|
-
nullable?: boolean;
|
|
2557
|
-
oneOf?: (SchemaObject | ReferenceObject)[];
|
|
2558
|
-
allOf?: (SchemaObject | ReferenceObject)[];
|
|
2559
|
-
anyOf?: (SchemaObject | ReferenceObject)[];
|
|
2560
|
-
required?: string[];
|
|
2561
|
-
[key: `x-${string}`]: any;
|
|
2562
|
-
} & (StringSubtype | NumberSubtype | IntegerSubtype | ArraySubtype | BooleanSubtype | NullSubtype | ObjectSubtype | {
|
|
2563
|
-
type: ("string" | "number" | "integer" | "array" | "boolean" | "null" | "object")[];
|
|
2564
|
-
});
|
|
2565
|
-
interface StringSubtype {
|
|
2566
|
-
type: "string" | ["string", "null"];
|
|
2567
|
-
enum?: (string | ReferenceObject)[];
|
|
2568
|
-
}
|
|
2569
|
-
interface NumberSubtype {
|
|
2570
|
-
type: "number" | ["number", "null"];
|
|
2571
|
-
minimum?: number;
|
|
2572
|
-
maximum?: number;
|
|
2573
|
-
enum?: (number | ReferenceObject)[];
|
|
2574
|
-
}
|
|
2575
|
-
interface IntegerSubtype {
|
|
2576
|
-
type: "integer" | ["integer", "null"];
|
|
2577
|
-
minimum?: number;
|
|
2578
|
-
maximum?: number;
|
|
2579
|
-
enum?: (number | ReferenceObject)[];
|
|
2580
|
-
}
|
|
2581
|
-
interface ArraySubtype {
|
|
2582
|
-
type: "array" | ["array", "null"];
|
|
2583
|
-
prefixItems?: (SchemaObject | ReferenceObject)[];
|
|
2584
|
-
items?: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];
|
|
2585
|
-
minItems?: number;
|
|
2586
|
-
maxItems?: number;
|
|
2587
|
-
enum?: (SchemaObject | ReferenceObject)[];
|
|
2588
|
-
}
|
|
2589
|
-
interface BooleanSubtype {
|
|
2590
|
-
type: "boolean" | ["boolean", "null"];
|
|
2591
|
-
enum?: (boolean | ReferenceObject)[];
|
|
2592
|
-
}
|
|
2593
|
-
interface NullSubtype {
|
|
2594
|
-
type: "null";
|
|
2595
|
-
}
|
|
2596
|
-
interface ObjectSubtype {
|
|
2597
|
-
type: "object" | ["object", "null"];
|
|
2598
|
-
properties?: {
|
|
2599
|
-
[name: string]: SchemaObject | ReferenceObject;
|
|
2600
|
-
};
|
|
2601
|
-
additionalProperties?: boolean | Record<string, never> | SchemaObject | ReferenceObject;
|
|
2602
|
-
required?: string[];
|
|
2603
|
-
allOf?: (SchemaObject | ReferenceObject)[];
|
|
2604
|
-
anyOf?: (SchemaObject | ReferenceObject)[];
|
|
2605
|
-
enum?: (SchemaObject | ReferenceObject)[];
|
|
2606
|
-
$defs?: $defs;
|
|
2607
|
-
}
|
|
2608
|
-
/**
|
|
2609
|
-
* [4.8.25] Discriminator Object
|
|
2610
|
-
* When request bodies or response payloads may be one of a number of different schemas, a discriminator object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the document of an alternative schema based on the value associated with it.
|
|
2611
|
-
*/
|
|
2612
|
-
interface DiscriminatorObject {
|
|
2613
|
-
/** REQUIRED. The name of the property in the payload that will hold the discriminator value. */
|
|
2614
|
-
propertyName: string;
|
|
2615
|
-
/** An object to hold mappings between payload values and schema names or references. */
|
|
2616
|
-
mapping?: Record<string, string>;
|
|
2617
|
-
/** If this exists, then a discriminator type should be added to objects matching this path */
|
|
2618
|
-
oneOf?: string[];
|
|
2619
|
-
}
|
|
2620
|
-
/**
|
|
2621
|
-
* [4.8.26] XML Object
|
|
2622
|
-
* A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are not inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior.
|
|
2623
|
-
*/
|
|
2624
|
-
interface XMLObject extends Extensable {
|
|
2625
|
-
/** Replaces the name of the element/attribute used for the described schema property. When defined within `items`, it will affect the name of the individual XML elements within the list. When defined alongside `type` being `array` (outside the `items`), it will affect the wrapping element and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored. */
|
|
2626
|
-
name?: string;
|
|
2627
|
-
/** The URI of the namespace definition. This MUST be in the form of an absolute URI. */
|
|
2628
|
-
namespace?: string;
|
|
2629
|
-
/** The prefix to be used for the name. */
|
|
2630
|
-
prefix?: string;
|
|
2631
|
-
/** Declares whether the property definition translates to an attribute instead of an element. Default value is `false`. */
|
|
2632
|
-
attribute?: boolean;
|
|
2633
|
-
/** MAY be used only for an array definition. Signifies whether the array is wrapped (for example, `<books><book/><book/></books>`) or unwrapped (`<book/><book/>`). Default value is `false`. The definition takes effect only when defined alongside `type` being `array` (outside the `items`). */
|
|
2634
|
-
wrapped?: boolean;
|
|
2635
|
-
}
|
|
2636
|
-
/**
|
|
2637
|
-
* [4.8.27] Security Scheme Object
|
|
2638
|
-
* Defines a security scheme that can be used by the operations.
|
|
2639
|
-
*/
|
|
2640
|
-
type SecuritySchemeObject = {
|
|
2641
|
-
/** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */description?: string;
|
|
2642
|
-
[key: `x-${string}`]: any;
|
|
2643
|
-
} & ({
|
|
2644
|
-
/** REQUIRED. The type of the security scheme. */type: "apiKey"; /** REQUIRED. The name of the header, query or cookie parameter to be used. */
|
|
2645
|
-
name: string; /** REQUIRED. The location of the API key. */
|
|
2646
|
-
in: "query" | "header" | "cookie";
|
|
2647
|
-
} | {
|
|
2648
|
-
/** REQUIRED. The type of the security scheme. */type: "http"; /** REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry. */
|
|
2649
|
-
scheme: string; /** A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes. */
|
|
2650
|
-
bearer?: string;
|
|
2651
|
-
} | {
|
|
2652
|
-
/** REQUIRED. The type of the security scheme. */type: "mutualTLS";
|
|
2653
|
-
} | {
|
|
2654
|
-
/** REQUIRED. Tye type of the security scheme. */type: "oauth2"; /** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
2655
|
-
flows: OAuthFlowsObject;
|
|
2656
|
-
} | {
|
|
2657
|
-
/** REQUIRED. Tye type of the security scheme. */type: "openIdConnect"; /** REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL. The OpenID Connect standard requires the use of TLS. */
|
|
2658
|
-
openIdConnectUrl: string;
|
|
2659
|
-
});
|
|
2660
|
-
/**
|
|
2661
|
-
* [4.8.26] OAuth Flows Object
|
|
2662
|
-
* Allows configuration of the supported OAuth Flows.
|
|
2663
|
-
*/
|
|
2664
|
-
interface OAuthFlowsObject extends Extensable {
|
|
2665
|
-
/** Configuration for the OAuth Implicit flow */
|
|
2666
|
-
implicit?: OAuthFlowObject;
|
|
2667
|
-
/** Configuration for the OAuth Resource Owner Password flow */
|
|
2668
|
-
password?: OAuthFlowObject;
|
|
2669
|
-
/** Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0. */
|
|
2670
|
-
clientCredentials?: OAuthFlowObject;
|
|
2671
|
-
/** Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0. */
|
|
2672
|
-
authorizationCode?: OAuthFlowObject;
|
|
2673
|
-
}
|
|
2674
|
-
/**
|
|
2675
|
-
* [4.8.29] OAuth Flow Object
|
|
2676
|
-
* Configuration details for a supported OAuth Flow
|
|
2677
|
-
*/
|
|
2678
|
-
interface OAuthFlowObject extends Extensable {
|
|
2679
|
-
/** REQUIRED. The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS. */
|
|
2680
|
-
authorizationUrl: string;
|
|
2681
|
-
/** REQUIRED. The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS. */
|
|
2682
|
-
tokenUrl: string;
|
|
2683
|
-
/** The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS. */
|
|
2684
|
-
refreshUrl: string;
|
|
2685
|
-
/** REQUIRED. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty. */
|
|
2686
|
-
scopes: {
|
|
2687
|
-
[name: string]: string;
|
|
2688
|
-
};
|
|
2689
|
-
}
|
|
2690
|
-
/**
|
|
2691
|
-
* [4.8.30] Security Requirements Object
|
|
2692
|
-
* Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object.
|
|
2693
|
-
*/
|
|
2694
|
-
type SecurityRequirementObject = { [P in keyof ComponentsObject["securitySchemes"]]?: string[] };
|
|
2695
|
-
type $defs = Record<string, SchemaObject>;
|
|
2696
|
-
type MaybeArray<T> = T | T[];
|
|
2697
|
-
/** @exprerimental */
|
|
2698
|
-
interface NitroRouteMeta {
|
|
2699
|
-
openAPI?: OperationObject & {
|
|
2700
|
-
$global?: Pick<OpenAPI3, "components"> & Extensable;
|
|
2701
|
-
};
|
|
2702
|
-
}
|
|
2703
|
-
interface NitroEventHandler {
|
|
2704
|
-
/**
|
|
2705
|
-
* Path prefix or route
|
|
2706
|
-
*
|
|
2707
|
-
* If an empty string used, will be used as a middleware
|
|
2708
|
-
*/
|
|
2709
|
-
route?: string;
|
|
2710
|
-
/**
|
|
2711
|
-
* Specifies this is a middleware handler.
|
|
2712
|
-
* Middleware are called on every route and should normally return nothing to pass to the next handlers
|
|
2713
|
-
*/
|
|
2714
|
-
middleware?: boolean;
|
|
2715
|
-
/**
|
|
2716
|
-
* Use lazy loading to import handler
|
|
2717
|
-
*/
|
|
2718
|
-
lazy?: boolean;
|
|
2719
|
-
/**
|
|
2720
|
-
* Path to event handler
|
|
2721
|
-
*
|
|
2722
|
-
*/
|
|
2723
|
-
handler: string;
|
|
2724
|
-
/**
|
|
2725
|
-
* Router method matcher
|
|
2726
|
-
*/
|
|
2727
|
-
method?: RouterMethod;
|
|
2728
|
-
/**
|
|
2729
|
-
* Meta
|
|
2730
|
-
*/
|
|
2731
|
-
meta?: NitroRouteMeta;
|
|
2732
|
-
env?: MaybeArray<"dev" | "prod" | "prerender" | PresetName | (string & {})>;
|
|
2733
|
-
}
|
|
2734
|
-
interface NitroDevEventHandler {
|
|
2735
|
-
/**
|
|
2736
|
-
* Path prefix or route
|
|
2737
|
-
*/
|
|
2738
|
-
route?: string;
|
|
2739
|
-
/**
|
|
2740
|
-
* Event handler
|
|
2741
|
-
*
|
|
2742
|
-
*/
|
|
2743
|
-
handler: EventHandler;
|
|
2744
|
-
}
|
|
2745
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
2746
|
-
type NitroErrorHandler = (error: H3Error, event: H3Event, _: {
|
|
2747
|
-
defaultHandler: (error: H3Error, event: H3Event, opts?: {
|
|
2748
|
-
silent?: boolean;
|
|
2749
|
-
json?: boolean;
|
|
2750
|
-
}) => MaybePromise<{
|
|
2751
|
-
status: number;
|
|
2752
|
-
statusText: string;
|
|
2753
|
-
headers: Record<string, string>;
|
|
2754
|
-
body: string | Record<string, any>;
|
|
2755
|
-
}>;
|
|
2756
|
-
}) => void | Promise<void>;
|
|
2757
|
-
interface PrerenderRoute {
|
|
2758
|
-
route: string;
|
|
2759
|
-
contents?: string;
|
|
2760
|
-
data?: ArrayBuffer;
|
|
2761
|
-
fileName?: string;
|
|
2762
|
-
error?: Error & {
|
|
2763
|
-
statusCode: number;
|
|
2764
|
-
statusMessage: string;
|
|
2765
|
-
};
|
|
2766
|
-
generateTimeMS?: number;
|
|
2767
|
-
skip?: boolean;
|
|
2768
|
-
contentType?: string;
|
|
2769
|
-
}
|
|
2770
|
-
/** @deprecated Internal type will be removed in future versions */
|
|
2771
|
-
type RollupConfig = InputOptions & {
|
|
2772
|
-
output: OutputOptions;
|
|
2773
|
-
};
|
|
2774
|
-
interface EsbuildOptions extends TransformOptions {
|
|
2775
|
-
include?: FilterPattern;
|
|
2776
|
-
exclude?: FilterPattern;
|
|
2777
|
-
sourceMap?: boolean | "inline" | "hidden";
|
|
2778
|
-
/**
|
|
2779
|
-
* Map extension to esbuild loader
|
|
2780
|
-
* Note that each entry (the extension) needs to start with a dot
|
|
2781
|
-
*/
|
|
2782
|
-
loaders?: {
|
|
2783
|
-
[ext: string]: Loader | false;
|
|
2784
|
-
};
|
|
2785
|
-
}
|
|
2786
|
-
interface NodeExternalsOptions {
|
|
2787
|
-
inline?: Array<string | RegExp | ((id: string, importer?: string) => Promise<boolean> | boolean)>;
|
|
2788
|
-
external?: Array<string | RegExp | ((id: string, importer?: string) => Promise<boolean> | boolean)>;
|
|
2789
|
-
rootDir?: string;
|
|
2790
|
-
outDir: string;
|
|
2791
|
-
trace?: boolean;
|
|
2792
|
-
traceOptions?: NodeFileTraceOptions;
|
|
2793
|
-
moduleDirectories?: string[];
|
|
2794
|
-
exportConditions?: string[];
|
|
2795
|
-
traceInclude?: string[];
|
|
2796
|
-
traceAlias?: Record<string, string>;
|
|
2797
|
-
chmod?: boolean | number;
|
|
2798
|
-
}
|
|
2799
|
-
type HookResult = void | Promise<void>;
|
|
2800
|
-
interface NitroHooks {
|
|
2801
|
-
"types:extend": (types: NitroTypes) => HookResult;
|
|
2802
|
-
"build:before": (nitro: Nitro) => HookResult;
|
|
2803
|
-
"rollup:before": (nitro: Nitro, config: RollupConfig) => HookResult;
|
|
2804
|
-
compiled: (nitro: Nitro) => HookResult;
|
|
2805
|
-
"dev:reload": () => HookResult;
|
|
2806
|
-
"dev:start": () => HookResult;
|
|
2807
|
-
"dev:error": (cause?: unknown) => HookResult;
|
|
2808
|
-
"rollup:reload": () => HookResult;
|
|
2809
|
-
restart: () => HookResult;
|
|
2810
|
-
close: () => HookResult;
|
|
2811
|
-
"prerender:routes": (routes: Set<string>) => HookResult;
|
|
2812
|
-
"prerender:config": (config: NitroConfig) => HookResult;
|
|
2813
|
-
"prerender:init": (prerenderer: Nitro) => HookResult;
|
|
2814
|
-
"prerender:generate": (route: PrerenderRoute, nitro: Nitro) => HookResult;
|
|
2815
|
-
"prerender:route": (route: PrerenderRoute) => HookResult;
|
|
2816
|
-
"prerender:done": (result: {
|
|
2817
|
-
prerenderedRoutes: PrerenderRoute[];
|
|
2818
|
-
failedRoutes: PrerenderRoute[];
|
|
2819
|
-
}) => HookResult;
|
|
2820
|
-
}
|
|
2821
|
-
/**
|
|
2822
|
-
* Nitro OpenAPI configuration
|
|
2823
|
-
*/
|
|
2824
|
-
interface NitroOpenAPIConfig {
|
|
2825
|
-
/**
|
|
2826
|
-
* OpenAPI meta information
|
|
2827
|
-
*/
|
|
2828
|
-
meta?: {
|
|
2829
|
-
title?: string;
|
|
2830
|
-
description?: string;
|
|
2831
|
-
version?: string;
|
|
2832
|
-
};
|
|
2833
|
-
/**
|
|
2834
|
-
* OpenAPI json route
|
|
2835
|
-
*
|
|
2836
|
-
* Default is `/_openapi.json`
|
|
2837
|
-
*/
|
|
2838
|
-
route?: string;
|
|
2839
|
-
/**
|
|
2840
|
-
* Enable OpenAPI generation for production builds
|
|
2841
|
-
*/
|
|
2842
|
-
production?: false | "runtime" | "prerender";
|
|
2843
|
-
/**
|
|
2844
|
-
* UI configurations
|
|
2845
|
-
*/
|
|
2846
|
-
ui?: {
|
|
2847
|
-
/**
|
|
2848
|
-
* Scalar UI configuration
|
|
2849
|
-
*/
|
|
2850
|
-
scalar?: false | (Partial<ApiReferenceConfiguration> & {
|
|
2851
|
-
/**
|
|
2852
|
-
* Scalar UI route
|
|
2853
|
-
*
|
|
2854
|
-
* Default is `/_scalar`
|
|
2855
|
-
*/
|
|
2856
|
-
route?: string;
|
|
2857
|
-
});
|
|
2858
|
-
/**
|
|
2859
|
-
* Swagger UI configuration
|
|
2860
|
-
*/
|
|
2861
|
-
swagger?: false | {
|
|
2862
|
-
/**
|
|
2863
|
-
* Swagger UI route
|
|
2864
|
-
*
|
|
2865
|
-
* Default is `/_swagger`
|
|
2866
|
-
*/
|
|
2867
|
-
route?: string;
|
|
2868
|
-
};
|
|
2869
|
-
};
|
|
2870
|
-
}
|
|
2871
|
-
type NitroPreset = NitroConfig | (() => NitroConfig);
|
|
2872
|
-
interface CacheEntry<T = any> {
|
|
2873
|
-
value?: T;
|
|
2874
|
-
expires?: number;
|
|
2875
|
-
mtime?: number;
|
|
2876
|
-
integrity?: string;
|
|
2877
|
-
}
|
|
2878
|
-
interface CacheOptions<T = any, ArgsT extends unknown[] = any[]> {
|
|
2879
|
-
name?: string;
|
|
2880
|
-
getKey?: (...args: ArgsT) => string | Promise<string>;
|
|
2881
|
-
transform?: (entry: CacheEntry<T>, ...args: ArgsT) => any;
|
|
2882
|
-
validate?: (entry: CacheEntry<T>, ...args: ArgsT) => boolean;
|
|
2883
|
-
shouldInvalidateCache?: (...args: ArgsT) => boolean | Promise<boolean>;
|
|
2884
|
-
shouldBypassCache?: (...args: ArgsT) => boolean | Promise<boolean>;
|
|
2885
|
-
group?: string;
|
|
2886
|
-
integrity?: any;
|
|
2887
|
-
/**
|
|
2888
|
-
* Number of seconds to cache the response. Defaults to 1.
|
|
2889
|
-
*/
|
|
2890
|
-
maxAge?: number;
|
|
2891
|
-
swr?: boolean;
|
|
2892
|
-
staleMaxAge?: number;
|
|
2893
|
-
base?: string;
|
|
2894
|
-
}
|
|
2895
|
-
interface ResponseCacheEntry<T = any> {
|
|
2896
|
-
body: T | undefined;
|
|
2897
|
-
code: number;
|
|
2898
|
-
headers: Record<string, string | number | string[] | undefined>;
|
|
2899
|
-
}
|
|
2900
|
-
interface CachedEventHandlerOptions<T = any> extends Omit<CacheOptions<ResponseCacheEntry<T>, [H3Event]>, "transform" | "validate"> {
|
|
2901
|
-
headersOnly?: boolean;
|
|
2902
|
-
varies?: string[] | readonly string[];
|
|
2903
|
-
}
|
|
2904
|
-
type HTTPStatusCode = IntRange<100, 600>;
|
|
2905
|
-
interface NitroRouteConfig {
|
|
2906
|
-
cache?: ExcludeFunctions<CachedEventHandlerOptions> | false;
|
|
2907
|
-
headers?: Record<string, string>;
|
|
2908
|
-
redirect?: string | {
|
|
2909
|
-
to: string;
|
|
2910
|
-
statusCode?: HTTPStatusCode;
|
|
2911
|
-
};
|
|
2912
|
-
prerender?: boolean;
|
|
2913
|
-
proxy?: string | ({
|
|
2914
|
-
to: string;
|
|
2915
|
-
} & ProxyOptions);
|
|
2916
|
-
isr?: number | boolean | VercelISRConfig;
|
|
2917
|
-
cors?: boolean;
|
|
2918
|
-
swr?: boolean | number;
|
|
2919
|
-
static?: boolean | number;
|
|
2920
|
-
}
|
|
2921
|
-
interface NitroRouteRules extends Omit<NitroRouteConfig, "redirect" | "cors" | "swr" | "static"> {
|
|
2922
|
-
redirect?: {
|
|
2923
|
-
to: string;
|
|
2924
|
-
statusCode: HTTPStatusCode;
|
|
2925
|
-
};
|
|
2926
|
-
proxy?: {
|
|
2927
|
-
to: string;
|
|
2928
|
-
} & ProxyOptions;
|
|
2929
|
-
}
|
|
2930
|
-
interface VercelISRConfig {
|
|
2931
|
-
/**
|
|
2932
|
-
* (vercel)
|
|
2933
|
-
* Expiration time (in seconds) before the cached asset will be re-generated by invoking the Serverless Function.
|
|
2934
|
-
* Setting the value to `false` (or `isr: true` route rule) means it will never expire.
|
|
2935
|
-
*/
|
|
2936
|
-
expiration?: number | false;
|
|
2937
|
-
/**
|
|
2938
|
-
* (vercel)
|
|
2939
|
-
* Group number of the asset.
|
|
2940
|
-
* Prerender assets with the same group number will all be re-validated at the same time.
|
|
2941
|
-
*/
|
|
2942
|
-
group?: number;
|
|
2943
|
-
/**
|
|
2944
|
-
* (vercel)
|
|
2945
|
-
* List of query string parameter names that will be cached independently.
|
|
2946
|
-
* - If an empty array, query values are not considered for caching.
|
|
2947
|
-
* - If undefined each unique query value is cached independently
|
|
2948
|
-
* - For wildcard `/**` route rules, `url` is always added.
|
|
2949
|
-
*/
|
|
2950
|
-
allowQuery?: string[];
|
|
2951
|
-
/**
|
|
2952
|
-
* (vercel)
|
|
2953
|
-
* When `true`, the query string will be present on the `request` argument passed to the invoked function. The `allowQuery` filter still applies.
|
|
2954
|
-
*/
|
|
2955
|
-
passQuery?: boolean;
|
|
2956
|
-
}
|
|
2957
|
-
/**
|
|
2958
|
-
* Nitro normalized options (nitro.options)
|
|
2959
|
-
*/
|
|
2960
|
-
interface NitroOptions extends PresetOptions {
|
|
2961
|
-
_config: NitroConfig;
|
|
2962
|
-
_c12: ResolvedConfig<NitroConfig> | ConfigWatcher<NitroConfig>;
|
|
2963
|
-
_cli?: {
|
|
2964
|
-
command?: string;
|
|
2965
|
-
};
|
|
2966
|
-
compatibilityDate: CompatibilityDates;
|
|
2967
|
-
debug: boolean;
|
|
2968
|
-
preset: PresetName;
|
|
2969
|
-
static: boolean;
|
|
2970
|
-
logLevel: LogLevel;
|
|
2971
|
-
runtimeConfig: NitroRuntimeConfig$1;
|
|
2972
|
-
appConfig: AppConfig;
|
|
2973
|
-
appConfigFiles: string[];
|
|
2974
|
-
workspaceDir: string;
|
|
2975
|
-
rootDir: string;
|
|
2976
|
-
srcDir: string;
|
|
2977
|
-
scanDirs: string[];
|
|
2978
|
-
apiDir: string;
|
|
2979
|
-
routesDir: string;
|
|
2980
|
-
buildDir: string;
|
|
2981
|
-
output: {
|
|
2982
|
-
dir: string;
|
|
2983
|
-
serverDir: string;
|
|
2984
|
-
publicDir: string;
|
|
2985
|
-
};
|
|
2986
|
-
storage: StorageMounts;
|
|
2987
|
-
devStorage: StorageMounts;
|
|
2988
|
-
database: DatabaseConnectionConfigs;
|
|
2989
|
-
devDatabase: DatabaseConnectionConfigs;
|
|
2990
|
-
bundledStorage: string[];
|
|
2991
|
-
timing: boolean;
|
|
2992
|
-
renderer?: string;
|
|
2993
|
-
ssrRoutes: string[];
|
|
2994
|
-
serveStatic: boolean | "node" | "deno" | "inline";
|
|
2995
|
-
noPublicDir: boolean;
|
|
2996
|
-
/**
|
|
2997
|
-
* @experimental Requires `experimental.wasm` to work
|
|
2998
|
-
*
|
|
2999
|
-
* @see https://github.com/unjs/unwasm
|
|
3000
|
-
*/
|
|
3001
|
-
wasm?: UnwasmPluginOptions;
|
|
3002
|
-
openAPI?: NitroOpenAPIConfig;
|
|
3003
|
-
experimental: {
|
|
3004
|
-
legacyExternals?: boolean;
|
|
3005
|
-
openAPI?: boolean;
|
|
3006
|
-
/**
|
|
3007
|
-
* See https://github.com/microsoft/TypeScript/pull/51669
|
|
3008
|
-
*/
|
|
3009
|
-
typescriptBundlerResolution?: boolean;
|
|
3010
|
-
/**
|
|
3011
|
-
* Enable native async context support for useEvent()
|
|
3012
|
-
*/
|
|
3013
|
-
asyncContext?: boolean;
|
|
3014
|
-
/**
|
|
3015
|
-
* Enable Experimental WebAssembly Support
|
|
3016
|
-
*
|
|
3017
|
-
* @see https://github.com/unjs/unwasm
|
|
3018
|
-
*/
|
|
3019
|
-
wasm?: boolean;
|
|
3020
|
-
/**
|
|
3021
|
-
* Disable Experimental bundling of Nitro Runtime Dependencies
|
|
3022
|
-
*/
|
|
3023
|
-
bundleRuntimeDependencies?: false;
|
|
3024
|
-
/**
|
|
3025
|
-
* Disable Experimental Sourcemap Minification
|
|
3026
|
-
*/
|
|
3027
|
-
sourcemapMinify?: false;
|
|
3028
|
-
/**
|
|
3029
|
-
* Backward compatibility support for Node fetch (required for Node < 18)
|
|
3030
|
-
*/
|
|
3031
|
-
nodeFetchCompat?: boolean;
|
|
3032
|
-
/**
|
|
3033
|
-
* Allow env expansion in runtime config
|
|
3034
|
-
*
|
|
3035
|
-
* @see https://github.com/nitrojs/nitro/pull/2043
|
|
3036
|
-
*/
|
|
3037
|
-
envExpansion?: boolean;
|
|
3038
|
-
/**
|
|
3039
|
-
* Enable experimental WebSocket support
|
|
3040
|
-
*
|
|
3041
|
-
* @see https://nitro.build/guide/websocket
|
|
3042
|
-
*/
|
|
3043
|
-
websocket?: boolean;
|
|
3044
|
-
/**
|
|
3045
|
-
* Enable experimental Database support
|
|
3046
|
-
*
|
|
3047
|
-
* @see https://nitro.build/guide/database
|
|
3048
|
-
*/
|
|
3049
|
-
database?: boolean;
|
|
3050
|
-
/**
|
|
3051
|
-
* Enable experimental Tasks support
|
|
3052
|
-
*
|
|
3053
|
-
* @see https://nitro.build/guide/tasks
|
|
3054
|
-
*/
|
|
3055
|
-
tasks?: boolean;
|
|
3056
|
-
};
|
|
3057
|
-
future: {
|
|
3058
|
-
nativeSWR: boolean;
|
|
3059
|
-
};
|
|
3060
|
-
serverAssets: ServerAssetDir[];
|
|
3061
|
-
publicAssets: PublicAssetDir[];
|
|
3062
|
-
imports: UnimportPluginOptions | false;
|
|
3063
|
-
modules?: NitroModuleInput[];
|
|
3064
|
-
plugins: string[];
|
|
3065
|
-
tasks: {
|
|
3066
|
-
[name: string]: {
|
|
3067
|
-
handler: string;
|
|
3068
|
-
description: string;
|
|
3069
|
-
};
|
|
3070
|
-
};
|
|
3071
|
-
scheduledTasks: {
|
|
3072
|
-
[cron: string]: string | string[];
|
|
3073
|
-
};
|
|
3074
|
-
virtual: Record<string, string | (() => string | Promise<string>)>;
|
|
3075
|
-
compressPublicAssets: boolean | CompressOptions;
|
|
3076
|
-
ignore: string[];
|
|
3077
|
-
dev: boolean;
|
|
3078
|
-
devServer: DevServerOptions;
|
|
3079
|
-
watchOptions: ChokidarOptions;
|
|
3080
|
-
devProxy: Record<string, string | ProxyServerOptions>;
|
|
3081
|
-
logging: {
|
|
3082
|
-
compressedSizes: boolean;
|
|
3083
|
-
buildSuccess: boolean;
|
|
3084
|
-
};
|
|
3085
|
-
baseURL: string;
|
|
3086
|
-
apiBaseURL: string;
|
|
3087
|
-
handlers: NitroEventHandler[];
|
|
3088
|
-
routeRules: {
|
|
3089
|
-
[path: string]: NitroRouteRules;
|
|
3090
|
-
};
|
|
3091
|
-
devHandlers: NitroDevEventHandler[];
|
|
3092
|
-
errorHandler: string | string[];
|
|
3093
|
-
devErrorHandler: NitroErrorHandler;
|
|
3094
|
-
prerender: {
|
|
3095
|
-
/**
|
|
3096
|
-
* Prerender HTML routes within subfolders (`/test` would produce `/test/index.html`)
|
|
3097
|
-
*/
|
|
3098
|
-
autoSubfolderIndex: boolean;
|
|
3099
|
-
concurrency: number;
|
|
3100
|
-
interval: number;
|
|
3101
|
-
crawlLinks: boolean;
|
|
3102
|
-
failOnError: boolean;
|
|
3103
|
-
ignore: Array<string | RegExp | ((path: string) => undefined | null | boolean)>;
|
|
3104
|
-
ignoreUnprefixedPublicAssets: boolean;
|
|
3105
|
-
routes: string[];
|
|
3106
|
-
/**
|
|
3107
|
-
* Amount of retries. Pass Infinity to retry indefinitely.
|
|
3108
|
-
* @default 3
|
|
3109
|
-
*/
|
|
3110
|
-
retry: number;
|
|
3111
|
-
/**
|
|
3112
|
-
* Delay between each retry in ms.
|
|
3113
|
-
* @default 500
|
|
3114
|
-
*/
|
|
3115
|
-
retryDelay: number;
|
|
3116
|
-
};
|
|
3117
|
-
rollupConfig?: RollupConfig;
|
|
3118
|
-
entry: string;
|
|
3119
|
-
unenv: Preset$1[];
|
|
3120
|
-
alias: Record<string, string>;
|
|
3121
|
-
minify: boolean;
|
|
3122
|
-
inlineDynamicImports: boolean;
|
|
3123
|
-
sourceMap: boolean | "inline" | "hidden";
|
|
3124
|
-
node: boolean;
|
|
3125
|
-
moduleSideEffects: string[];
|
|
3126
|
-
esbuild?: {
|
|
3127
|
-
options?: Partial<EsbuildOptions>;
|
|
3128
|
-
};
|
|
3129
|
-
noExternals: boolean;
|
|
3130
|
-
externals: NodeExternalsOptions;
|
|
3131
|
-
analyze: false | PluginVisualizerOptions;
|
|
3132
|
-
replace: Record<string, string | ((id: string) => string)>;
|
|
3133
|
-
commonJS?: RollupCommonJSOptions;
|
|
3134
|
-
exportConditions?: string[];
|
|
3135
|
-
typescript: {
|
|
3136
|
-
strict?: boolean;
|
|
3137
|
-
internalPaths?: boolean;
|
|
3138
|
-
generateRuntimeConfigTypes?: boolean;
|
|
3139
|
-
generateTsConfig?: boolean; /** the path of the generated `tsconfig.json`, relative to buildDir */
|
|
3140
|
-
tsconfigPath: string;
|
|
3141
|
-
tsConfig?: Partial<TSConfig>;
|
|
3142
|
-
};
|
|
3143
|
-
hooks: NestedHooks<NitroHooks>;
|
|
3144
|
-
nodeModulesDirs: string[];
|
|
3145
|
-
commands: {
|
|
3146
|
-
preview: string;
|
|
3147
|
-
deploy: string;
|
|
3148
|
-
};
|
|
3149
|
-
framework: NitroFrameworkInfo;
|
|
3150
|
-
iis?: {
|
|
3151
|
-
mergeConfig?: boolean;
|
|
3152
|
-
overrideConfig?: boolean;
|
|
3153
|
-
};
|
|
3154
|
-
}
|
|
3155
|
-
/**
|
|
3156
|
-
* Nitro input config (nitro.config)
|
|
3157
|
-
*/
|
|
3158
|
-
interface NitroConfig extends DeepPartial<Omit<NitroOptions, "routeRules" | "rollupConfig" | "preset" | "compatibilityDate" | "unenv">>, C12InputConfig<NitroConfig> {
|
|
3159
|
-
preset?: PresetNameInput;
|
|
3160
|
-
extends?: string | string[] | NitroPreset;
|
|
3161
|
-
routeRules?: {
|
|
3162
|
-
[path: string]: NitroRouteConfig;
|
|
3163
|
-
};
|
|
3164
|
-
rollupConfig?: Partial<RollupConfig>;
|
|
3165
|
-
compatibilityDate?: CompatibilityDateSpec;
|
|
3166
|
-
unenv?: Preset$1 | Preset$1[];
|
|
3167
|
-
}
|
|
3168
|
-
interface AppConfig {
|
|
3169
|
-
[key: string]: any;
|
|
3170
|
-
}
|
|
3171
|
-
interface PublicAssetDir {
|
|
3172
|
-
baseURL?: string;
|
|
3173
|
-
fallthrough?: boolean;
|
|
3174
|
-
maxAge: number;
|
|
3175
|
-
dir: string;
|
|
3176
|
-
}
|
|
3177
|
-
interface CompressOptions {
|
|
3178
|
-
gzip?: boolean;
|
|
3179
|
-
brotli?: boolean;
|
|
3180
|
-
}
|
|
3181
|
-
interface ServerAssetDir {
|
|
3182
|
-
baseName: string;
|
|
3183
|
-
pattern?: string;
|
|
3184
|
-
dir: string;
|
|
3185
|
-
ignore?: string[];
|
|
3186
|
-
}
|
|
3187
|
-
type CustomDriverName = string & {
|
|
3188
|
-
_custom?: any;
|
|
3189
|
-
};
|
|
3190
|
-
interface StorageMounts {
|
|
3191
|
-
[path: string]: {
|
|
3192
|
-
driver: BuiltinDriverName | CustomDriverName;
|
|
3193
|
-
[option: string]: any;
|
|
3194
|
-
};
|
|
3195
|
-
}
|
|
3196
|
-
type DatabaseConnectionName = "default" | (string & {});
|
|
3197
|
-
type DatabaseConnectionConfig = {
|
|
3198
|
-
connector: ConnectorName;
|
|
3199
|
-
options?: {
|
|
3200
|
-
[key: string]: any;
|
|
3201
|
-
};
|
|
3202
|
-
};
|
|
3203
|
-
type DatabaseConnectionConfigs = Record<DatabaseConnectionName, DatabaseConnectionConfig>;
|
|
3204
|
-
interface NitroRuntimeConfig$1 extends NitroRuntimeConfig {}
|
|
3205
|
-
interface Nitro {
|
|
3206
|
-
options: NitroOptions;
|
|
3207
|
-
scannedHandlers: NitroEventHandler[];
|
|
3208
|
-
vfs: Record<string, string>;
|
|
3209
|
-
hooks: Hookable<NitroHooks>;
|
|
3210
|
-
unimport?: Unimport;
|
|
3211
|
-
logger: ConsolaInstance;
|
|
3212
|
-
storage: Storage;
|
|
3213
|
-
close: () => Promise<void>;
|
|
3214
|
-
updateConfig: (config: NitroDynamicConfig) => void | Promise<void>;
|
|
3215
|
-
_prerenderedRoutes?: PrerenderRoute[];
|
|
3216
|
-
_prerenderMeta?: Record<string, {
|
|
3217
|
-
contentType?: string;
|
|
3218
|
-
}>;
|
|
3219
|
-
}
|
|
3220
|
-
type NitroDynamicConfig = Pick<NitroConfig, "runtimeConfig" | "routeRules">;
|
|
3221
|
-
type NitroTypes = {
|
|
3222
|
-
routes: Record<string, Partial<Record<RouterMethod | "default", string[]>>>;
|
|
3223
|
-
tsConfig?: TSConfig;
|
|
3224
|
-
};
|
|
3225
|
-
interface NitroFrameworkInfo {
|
|
3226
|
-
name?: "nitro" | (string & {});
|
|
3227
|
-
version?: string;
|
|
3228
|
-
}
|
|
3229
|
-
/** Build info written to `.output/nitro.json` or `.nitro/dev/nitro.json` */
|
|
3230
|
-
type NitroModuleInput = string | NitroModule | NitroModule["setup"];
|
|
3231
|
-
interface NitroModule {
|
|
3232
|
-
name?: string;
|
|
3233
|
-
setup: (this: void, nitro: Nitro) => void | Promise<void>;
|
|
3234
|
-
}
|
|
3235
|
-
//#endregion
|
|
3236
|
-
//#region ../../node_modules/.pnpm/nitropack@2.13.1_rolldown@1.0.0-rc.3/node_modules/nitropack/dist/types/index.d.ts
|
|
3237
|
-
interface CapturedErrorContext {
|
|
3238
|
-
event?: H3Event;
|
|
3239
|
-
[key: string]: unknown;
|
|
3240
|
-
}
|
|
3241
|
-
type CaptureError = (error: Error, context: CapturedErrorContext) => void;
|
|
3242
|
-
interface InternalApi {}
|
|
3243
|
-
type NitroFetchRequest = Exclude<keyof InternalApi, `/_${string}` | `/api/_${string}`> | Exclude<FetchRequest, string> | (string & {});
|
|
3244
|
-
type MiddlewareOf<Route extends string, Method extends RouterMethod | "default"> = Method extends keyof InternalApi[MatchedRoutes<Route>] ? InternalApi[MatchedRoutes<Route>][Method] : never;
|
|
3245
|
-
type TypedInternalResponse<Route, Default = unknown, Method extends RouterMethod = RouterMethod> = Default extends string | boolean | number | null | void | object ? Default : Route extends string ? MiddlewareOf<Route, Method> extends never ? MiddlewareOf<Route, "default"> extends never ? Default : MiddlewareOf<Route, "default"> : MiddlewareOf<Route, Method> : Default;
|
|
3246
|
-
type AvailableRouterMethod<R extends NitroFetchRequest> = R extends string ? keyof InternalApi[MatchedRoutes<R>] extends undefined ? RouterMethod : Extract<keyof InternalApi[MatchedRoutes<R>], "default"> extends undefined ? Extract<RouterMethod, keyof InternalApi[MatchedRoutes<R>]> : RouterMethod : RouterMethod;
|
|
3247
|
-
interface NitroFetchOptions<R extends NitroFetchRequest, M extends AvailableRouterMethod<R> = AvailableRouterMethod<R>> extends FetchOptions {
|
|
3248
|
-
method?: Uppercase<M> | M;
|
|
3249
|
-
}
|
|
3250
|
-
type ExtractedRouteMethod<R extends NitroFetchRequest, O extends NitroFetchOptions<R>> = O extends undefined ? "get" : Lowercase<Exclude<O["method"], undefined>> extends RouterMethod ? Lowercase<Exclude<O["method"], undefined>> : "get";
|
|
3251
|
-
type Base$Fetch<DefaultT = unknown, DefaultR extends NitroFetchRequest = NitroFetchRequest> = <T = DefaultT, R extends NitroFetchRequest = DefaultR, O extends NitroFetchOptions<R> = NitroFetchOptions<R>>(request: R, opts?: O) => Promise<TypedInternalResponse<R, T, NitroFetchOptions<R> extends O ? "get" : ExtractedRouteMethod<R, O>>>;
|
|
3252
|
-
interface $Fetch<DefaultT = unknown, DefaultR extends NitroFetchRequest = NitroFetchRequest> extends Base$Fetch<DefaultT, DefaultR> {
|
|
3253
|
-
raw<T = DefaultT, R extends NitroFetchRequest = DefaultR, O extends NitroFetchOptions<R> = NitroFetchOptions<R>>(request: R, opts?: O): Promise<FetchResponse<TypedInternalResponse<R, T, NitroFetchOptions<R> extends O ? "get" : ExtractedRouteMethod<R, O>>>>;
|
|
3254
|
-
create<T = DefaultT, R extends NitroFetchRequest = DefaultR>(defaults: FetchOptions): $Fetch<T, R>;
|
|
3255
|
-
}
|
|
3256
|
-
declare global {
|
|
3257
|
-
var $fetch: $Fetch;
|
|
3258
|
-
namespace NodeJS {
|
|
3259
|
-
interface Global {
|
|
3260
|
-
$fetch: $Fetch;
|
|
3261
|
-
}
|
|
3262
|
-
}
|
|
3263
|
-
}
|
|
3264
|
-
type MatchResult<Key extends string, Exact extends boolean = false, Score extends any[] = [], catchAll extends boolean = false> = { [k in Key]: {
|
|
3265
|
-
key: k;
|
|
3266
|
-
exact: Exact;
|
|
3267
|
-
score: Score;
|
|
3268
|
-
catchAll: catchAll;
|
|
3269
|
-
} }[Key];
|
|
3270
|
-
type Subtract<Minuend extends any[] = [], Subtrahend extends any[] = []> = Minuend extends [...Subtrahend, ...infer Remainder] ? Remainder : never;
|
|
3271
|
-
type TupleIfDiff<First extends string, Second extends string, Tuple extends any[] = []> = First extends `${Second}${infer Diff}` ? Diff extends "" ? [] : Tuple : [];
|
|
3272
|
-
type MaxTuple<N extends any[] = [], T extends any[] = []> = {
|
|
3273
|
-
current: T;
|
|
3274
|
-
result: MaxTuple<N, ["", ...T]>;
|
|
3275
|
-
}[[N["length"]] extends [Partial<T>["length"]] ? "current" : "result"];
|
|
3276
|
-
type CalcMatchScore<Key extends string, Route extends string, Score extends any[] = [], Init extends boolean = false, FirstKeySegMatcher extends string = (Init extends true ? ":Invalid:" : "")> = `${Key}/` extends `${infer KeySeg}/${infer KeyRest}` ? KeySeg extends FirstKeySegMatcher ? Subtract<[...Score, ...TupleIfDiff<Route, Key, ["", ""]>], TupleIfDiff<Key, Route, ["", ""]>> : `${Route}/` extends `${infer RouteSeg}/${infer RouteRest}` ? `${RouteSeg}?` extends `${infer RouteSegWithoutQuery}?${string}` ? RouteSegWithoutQuery extends KeySeg ? CalcMatchScore<KeyRest, RouteRest, [...Score, "", ""]> : KeySeg extends `:${string}` ? RouteSegWithoutQuery extends "" ? never : CalcMatchScore<KeyRest, RouteRest, [...Score, ""]> : KeySeg extends RouteSegWithoutQuery ? CalcMatchScore<KeyRest, RouteRest, [...Score, ""]> : never : never : never : never;
|
|
3277
|
-
type _MatchedRoutes<Route extends string, MatchedResultUnion extends MatchResult<string> = MatchResult<keyof InternalApi>> = MatchedResultUnion["key"] extends infer MatchedKeys ? MatchedKeys extends string ? Route extends MatchedKeys ? MatchResult<MatchedKeys, true> : MatchedKeys extends `${infer Root}/**${string}` ? MatchedKeys extends `${string}/**` ? Route extends `${Root}/${string}` ? MatchResult<MatchedKeys, false, [], true> : never : MatchResult<MatchedKeys, false, CalcMatchScore<Root, Route, [], true>> : MatchResult<MatchedKeys, false, CalcMatchScore<MatchedKeys, Route, [], true>> : never : never;
|
|
3278
|
-
type MatchedRoutes<Route extends string, MatchedKeysResult extends MatchResult<string> = MatchResult<keyof InternalApi>, Matches extends MatchResult<string> = _MatchedRoutes<Route, MatchedKeysResult>> = Route extends "/" ? keyof InternalApi : Extract<Matches, {
|
|
3279
|
-
exact: true;
|
|
3280
|
-
}> extends never ? Extract<Exclude<Matches, {
|
|
3281
|
-
score: never;
|
|
3282
|
-
}>, {
|
|
3283
|
-
score: MaxTuple<Matches["score"]>;
|
|
3284
|
-
}>["key"] | Extract<Matches, {
|
|
3285
|
-
catchAll: true;
|
|
3286
|
-
}>["key"] : Extract<Matches, {
|
|
3287
|
-
exact: true;
|
|
3288
|
-
}>["key"];
|
|
3289
|
-
/**
|
|
3290
|
-
* @link https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
|
|
3291
|
-
*/
|
|
3292
|
-
interface NitroStaticBuildFlags {
|
|
3293
|
-
_asyncContext?: boolean;
|
|
3294
|
-
_websocket?: boolean;
|
|
3295
|
-
_tasks?: boolean;
|
|
3296
|
-
dev?: boolean;
|
|
3297
|
-
client?: boolean;
|
|
3298
|
-
nitro?: boolean;
|
|
3299
|
-
baseURL?: string;
|
|
3300
|
-
prerender?: boolean;
|
|
3301
|
-
preset?: NitroOptions["preset"];
|
|
3302
|
-
server?: boolean;
|
|
3303
|
-
versions?: {
|
|
3304
|
-
nitro?: string;
|
|
3305
|
-
};
|
|
3306
|
-
}
|
|
3307
|
-
declare global {
|
|
3308
|
-
namespace NodeJS {
|
|
3309
|
-
interface Process extends NitroStaticBuildFlags {}
|
|
3310
|
-
}
|
|
3311
|
-
interface ImportMeta extends NitroStaticBuildFlags {}
|
|
3312
|
-
}
|
|
3313
|
-
declare global {
|
|
3314
|
-
const defineNitroConfig: (config: NitroConfig) => NitroConfig;
|
|
3315
|
-
const defineNitroModule: (definition: NitroModule) => NitroModule;
|
|
3316
|
-
}
|
|
3317
|
-
type H3EventFetch = (request: NitroFetchRequest, init?: RequestInit) => Promise<Response>;
|
|
3318
|
-
type H3Event$Fetch = Base$Fetch<unknown, NitroFetchRequest>;
|
|
3319
|
-
declare module "h3" {
|
|
3320
|
-
interface H3Event {
|
|
3321
|
-
/** @experimental Calls fetch with same context and request headers */
|
|
3322
|
-
fetch: H3EventFetch;
|
|
3323
|
-
/** @experimental Calls fetch with same context and request headers */
|
|
3324
|
-
$fetch: H3Event$Fetch;
|
|
3325
|
-
waitUntil: (promise: Promise<unknown>) => void;
|
|
3326
|
-
/** @experimental */
|
|
3327
|
-
captureError: CaptureError;
|
|
3328
|
-
}
|
|
3329
|
-
interface H3Context {
|
|
3330
|
-
nitro: {
|
|
3331
|
-
_waitUntilPromises?: Promise<unknown>[]; /** @experimental */
|
|
3332
|
-
errors: {
|
|
3333
|
-
error?: Error;
|
|
3334
|
-
context: CapturedErrorContext;
|
|
3335
|
-
}[];
|
|
3336
|
-
};
|
|
3337
|
-
cache: {
|
|
3338
|
-
options: CacheOptions;
|
|
3339
|
-
};
|
|
3340
|
-
}
|
|
3341
|
-
}
|
|
3342
|
-
//#endregion
|
|
3343
|
-
export { type NitroRouteConfig as i, type NitroDevEventHandler as n, type NitroEventHandler as r, type Nitro as t };
|