silgi 0.42.5 → 0.43.0
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/dist/_virtual/rolldown_runtime.mjs +11 -0
- package/dist/build.d.mts +3 -11
- package/dist/build.mjs +4 -48
- package/dist/cli/build/build.mjs +17 -0
- package/dist/cli/build/dev.d.mts +9 -0
- package/dist/cli/build/dev.mjs +59 -0
- package/dist/cli/build/prepare.d.mts +6 -0
- package/dist/cli/build/prepare.mjs +15 -0
- package/dist/cli/commands/commands.mjs +90 -0
- package/dist/cli/commands/env.mjs +53 -0
- package/dist/cli/commands/init.mjs +84 -0
- package/dist/cli/commands/install.mjs +52 -0
- package/dist/cli/commands/prepare.mjs +65 -0
- package/dist/cli/commands/reset.mjs +46 -0
- package/dist/cli/commands/run.mjs +105 -0
- package/dist/cli/commands/watch.mjs +48 -0
- package/dist/cli/config/defaults.mjs +117 -0
- package/dist/cli/config/index.d.mts +3 -11
- package/dist/cli/config/index.mjs +4 -17
- package/dist/cli/config/loader.d.mts +6 -0
- package/dist/cli/config/loader.mjs +71 -0
- package/dist/cli/config/resolvers/compatibility.mjs +71 -0
- package/dist/cli/config/resolvers/imports.mjs +35 -0
- package/dist/cli/config/resolvers/paths.mjs +98 -0
- package/dist/cli/config/resolvers/storage.mjs +23 -0
- package/dist/cli/config/resolvers/url.mjs +9 -0
- package/dist/cli/config/types.d.mts +14 -0
- package/dist/cli/config/types.mjs +147 -0
- package/dist/cli/core/apiful.mjs +36 -0
- package/dist/cli/core/app.mjs +105 -0
- package/dist/cli/core/devServer.mjs +10 -0
- package/dist/cli/core/env.mjs +68 -0
- package/dist/cli/core/installPackage.mjs +60 -0
- package/dist/cli/core/runtimeConfig.mjs +70 -0
- package/dist/cli/core/scan.mjs +35 -0
- package/dist/cli/core/silgi.mjs +111 -0
- package/dist/cli/core/templates.mjs +38 -0
- package/dist/cli/framework/emptyFramework.mjs +7 -0
- package/dist/cli/framework/h3.mjs +55 -0
- package/dist/cli/framework/index.mjs +15 -0
- package/dist/cli/framework/nitro.mjs +24 -0
- package/dist/cli/framework/nuxt.mjs +10 -0
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +24 -27
- package/dist/cli/module/exportScan.mjs +180 -0
- package/dist/cli/module/install.mjs +49 -0
- package/dist/cli/module/scan.mjs +195 -0
- package/dist/cli/scan/prepareCommands.mjs +40 -0
- package/dist/cli/scan/prepareConfigs.mjs +33 -0
- package/dist/cli/scan/prepareCoreFile.mjs +118 -0
- package/dist/cli/scan/prepareScanFile.mjs +59 -0
- package/dist/cli/scan/prepareSchema.mjs +140 -0
- package/dist/cli/scan/scanExportFile.mjs +312 -0
- package/dist/cli/scan/writeCoreFile.mjs +22 -0
- package/dist/cli/scan/writeTypesAndFiles.mjs +72 -0
- package/dist/cli/utils/cancel.mjs +14 -0
- package/dist/cli/utils/common.mjs +15 -0
- package/dist/cli/utils/compatibility.mjs +33 -0
- package/dist/cli/utils/debug.mjs +11 -0
- package/dist/cli/utils/ignore.mjs +56 -0
- package/dist/cli/utils/readScanFile.mjs +58 -0
- package/dist/cli/utils/storage.mjs +23 -0
- package/dist/core/context.d.mts +30 -0
- package/dist/core/context.mjs +32 -0
- package/dist/core/createSilgi.d.mts +6 -0
- package/dist/core/createSilgi.mjs +152 -0
- package/dist/core/error.d.mts +65 -0
- package/dist/core/error.mjs +106 -0
- package/dist/core/event.d.mts +26 -0
- package/dist/core/event.mjs +44 -0
- package/dist/core/index.d.mts +24 -316
- package/dist/core/index.mjs +27 -1345
- package/dist/core/orchestrate.mjs +113 -0
- package/dist/core/response.d.mts +20 -0
- package/dist/core/response.mjs +105 -0
- package/dist/core/silgi.d.mts +19 -0
- package/dist/core/silgi.mjs +141 -0
- package/dist/core/silgiApp.d.mts +9 -0
- package/dist/core/silgiApp.mjs +23 -0
- package/dist/core/storage.d.mts +7 -0
- package/dist/core/storage.mjs +15 -0
- package/dist/core/unctx.d.mts +21 -0
- package/dist/core/unctx.mjs +35 -0
- package/dist/core/utils/event-stream.d.mts +53 -0
- package/dist/core/utils/event-stream.mjs +38 -0
- package/dist/core/utils/event.d.mts +8 -0
- package/dist/core/utils/event.mjs +12 -0
- package/dist/core/utils/internal/event-stream.d.mts +45 -0
- package/dist/core/utils/internal/event-stream.mjs +137 -0
- package/dist/core/utils/internal/obj.mjs +9 -0
- package/dist/core/utils/internal/object.mjs +29 -0
- package/dist/core/utils/internal/query.mjs +73 -0
- package/dist/core/utils/internal/req.mjs +35 -0
- package/dist/core/utils/merge.d.mts +14 -0
- package/dist/core/utils/merge.mjs +27 -0
- package/dist/{shared/silgi.DTwQEdSr.d.mts → core/utils/middleware.d.mts} +11 -13
- package/dist/core/utils/middleware.mjs +12 -0
- package/dist/core/utils/request.mjs +35 -0
- package/dist/core/utils/resolver.d.mts +7 -0
- package/dist/core/utils/resolver.mjs +29 -0
- package/dist/core/utils/runtime.d.mts +7 -0
- package/dist/core/utils/runtime.mjs +20 -0
- package/dist/core/utils/sanitize.mjs +22 -0
- package/dist/core/utils/schema.d.mts +34 -0
- package/dist/core/utils/schema.mjs +33 -0
- package/dist/core/utils/service.d.mts +13 -0
- package/dist/core/utils/service.mjs +19 -0
- package/dist/core/utils/shared.d.mts +6 -0
- package/dist/core/utils/shared.mjs +7 -0
- package/dist/core/utils/storage.d.mts +24 -0
- package/dist/core/utils/storage.mjs +54 -0
- package/dist/index.d.mts +21 -6
- package/dist/index.mjs +22 -16
- package/dist/kit/add/add-commands.d.mts +6 -0
- package/dist/kit/add/add-commands.mjs +12 -0
- package/dist/kit/add/add-core-file.d.mts +9 -0
- package/dist/kit/add/add-core-file.mjs +11 -0
- package/dist/kit/add/add-imports.d.mts +14 -0
- package/dist/kit/add/add-imports.mjs +56 -0
- package/dist/kit/add/add-npm.d.mts +14 -0
- package/dist/kit/add/add-npm.mjs +23 -0
- package/dist/kit/define.d.mts +28 -0
- package/dist/kit/define.mjs +25 -0
- package/dist/kit/errors.d.mts +6 -0
- package/dist/kit/errors.mjs +11 -0
- package/dist/kit/esm.d.mts +11 -0
- package/dist/kit/esm.mjs +21 -0
- package/dist/kit/fs.d.mts +7 -0
- package/dist/kit/fs.mjs +23 -0
- package/dist/kit/function-utils.d.mts +27 -0
- package/dist/kit/function-utils.mjs +75 -0
- package/dist/kit/gen.d.mts +5 -0
- package/dist/kit/gen.mjs +26 -0
- package/dist/kit/hash.d.mts +4 -0
- package/dist/kit/hash.mjs +10 -0
- package/dist/kit/index.d.mts +22 -321
- package/dist/kit/index.mjs +23 -1039
- package/dist/kit/isFramework.d.mts +6 -0
- package/dist/kit/isFramework.mjs +21 -0
- package/dist/kit/logger.d.mts +6 -0
- package/dist/kit/logger.mjs +10 -0
- package/dist/kit/migration.d.mts +113 -0
- package/dist/kit/migration.mjs +301 -0
- package/dist/kit/module.d.mts +14 -0
- package/dist/kit/module.mjs +53 -0
- package/dist/kit/path.d.mts +7 -0
- package/dist/kit/path.mjs +26 -0
- package/dist/kit/preset.d.mts +8 -0
- package/dist/kit/preset.mjs +11 -0
- package/dist/kit/resolve.d.mts +37 -0
- package/dist/kit/resolve.mjs +82 -0
- package/dist/kit/template.d.mts +14 -0
- package/dist/kit/template.mjs +59 -0
- package/dist/kit/useRequest.d.mts +19 -0
- package/dist/kit/useRequest.mjs +63 -0
- package/dist/kit/utils.d.mts +34 -0
- package/dist/kit/utils.mjs +90 -0
- package/dist/package.mjs +176 -0
- package/dist/presets/_all.gen.d.mts +5 -2
- package/dist/presets/_all.gen.mjs +16 -13
- package/dist/presets/_resolve.d.mts +10 -6
- package/dist/presets/_resolve.mjs +51 -65
- package/dist/presets/_types.gen.d.mts +8 -5
- package/dist/presets/_types.gen.mjs +5 -1
- package/dist/presets/h3/preset.d.mts +5 -2
- package/dist/presets/h3/preset.mjs +33 -38
- package/dist/presets/hono/preset.d.mts +5 -2
- package/dist/presets/hono/preset.mjs +28 -35
- package/dist/presets/index.d.mts +3 -2
- package/dist/presets/index.mjs +3 -1
- package/dist/presets/nitro/preset.d.mts +5 -2
- package/dist/presets/nitro/preset.mjs +35 -42
- package/dist/presets/npmpackage/preset.d.mts +5 -2
- package/dist/presets/npmpackage/preset.mjs +27 -32
- package/dist/presets/nuxt/preset.d.mts +5 -2
- package/dist/presets/nuxt/preset.mjs +39 -44
- package/dist/runtime/index.d.mts +4 -3
- package/dist/runtime/index.mjs +5 -3
- package/dist/runtime/internal/config.d.mts +11 -7
- package/dist/runtime/internal/config.mjs +79 -90
- package/dist/runtime/internal/debug.d.mts +6 -3
- package/dist/runtime/internal/debug.mjs +9 -4
- package/dist/runtime/internal/defu.d.mts +4 -1
- package/dist/runtime/internal/defu.mjs +7 -2
- package/dist/runtime/internal/index.d.mts +7 -6
- package/dist/runtime/internal/index.mjs +8 -20
- package/dist/runtime/internal/nitro.d.mts +6 -3
- package/dist/runtime/internal/nitro.mjs +29 -37
- package/dist/runtime/internal/nuxt.d.mts +12 -8
- package/dist/runtime/internal/nuxt.mjs +12 -7
- package/dist/runtime/internal/ofetch.d.mts +8 -4
- package/dist/runtime/internal/ofetch.mjs +33 -34
- package/dist/runtime/internal/plugin.d.mts +7 -3
- package/dist/runtime/internal/plugin.mjs +7 -3
- package/dist/types/cliConfig.d.mts +288 -0
- package/dist/types/cliConfig.mjs +0 -0
- package/dist/types/cliHooks.d.mts +154 -0
- package/dist/types/cliHooks.mjs +0 -0
- package/dist/types/compatibility.d.mts +13 -0
- package/dist/types/compatibility.mjs +0 -0
- package/dist/types/config.d.mts +46 -0
- package/dist/types/config.mjs +0 -0
- package/dist/types/dotenv.d.mts +29 -0
- package/dist/types/dotenv.mjs +0 -0
- package/dist/types/event.d.mts +63 -0
- package/dist/types/event.mjs +0 -0
- package/dist/types/global.d.mts +24 -0
- package/dist/types/global.mjs +0 -0
- package/dist/types/helper.d.mts +25 -0
- package/dist/types/helper.mjs +0 -0
- package/dist/types/hooks.d.mts +37 -0
- package/dist/types/hooks.mjs +0 -0
- package/dist/types/index.d.mts +26 -1306
- package/dist/types/index.mjs +0 -1
- package/dist/types/kits.d.mts +32 -0
- package/dist/types/kits.mjs +0 -0
- package/dist/types/middleware.d.mts +31 -0
- package/dist/types/middleware.mjs +0 -0
- package/dist/types/module.d.mts +102 -0
- package/dist/types/module.mjs +0 -0
- package/dist/types/preset.d.mts +20 -0
- package/dist/types/preset.mjs +0 -0
- package/dist/types/route.d.mts +59 -0
- package/dist/types/route.mjs +0 -0
- package/dist/types/runtime/index.d.mts +5 -0
- package/dist/types/runtime/index.mjs +0 -0
- package/dist/types/runtime/nuxt.d.mts +13 -0
- package/dist/types/runtime/nuxt.mjs +0 -0
- package/dist/types/runtime/ofetch.d.mts +14 -0
- package/dist/types/runtime/ofetch.mjs +0 -0
- package/dist/types/runtime/plugin.d.mts +8 -0
- package/dist/types/runtime/plugin.mjs +0 -0
- package/dist/types/runtime/silgi.d.mts +11 -0
- package/dist/types/runtime/silgi.mjs +0 -0
- package/dist/types/schema.d.mts +86 -0
- package/dist/types/schema.mjs +0 -0
- package/dist/types/service.d.mts +102 -0
- package/dist/types/service.mjs +0 -0
- package/dist/types/shared.d.mts +19 -0
- package/dist/types/shared.mjs +0 -0
- package/dist/types/silgi.d.mts +71 -0
- package/dist/types/silgi.mjs +0 -0
- package/dist/types/silgiCLI.d.mts +118 -0
- package/dist/types/silgiCLI.mjs +0 -0
- package/dist/types/standard-schema.d.mts +61 -0
- package/dist/types/standard-schema.mjs +0 -0
- package/dist/types/storage.d.mts +30 -0
- package/dist/types/storage.mjs +0 -0
- package/package.json +20 -35
- package/dist/_chunks/silgiApp.mjs +0 -25
- package/dist/cli/build.mjs +0 -2190
- package/dist/cli/common.mjs +0 -13
- package/dist/cli/compatibility.mjs +0 -30
- package/dist/cli/dev.mjs +0 -67
- package/dist/cli/init.mjs +0 -112
- package/dist/cli/install.mjs +0 -151
- package/dist/cli/loader.mjs +0 -618
- package/dist/cli/prepare.mjs +0 -188
- package/dist/cli/reset.mjs +0 -55
- package/dist/cli/run.mjs +0 -159
- package/dist/cli/types.mjs +0 -232
- package/dist/cli/watch.mjs +0 -91
- package/dist/presets/next/preset.d.mts +0 -3
- package/dist/presets/next/preset.mjs +0 -38
- package/dist/runtime/internal/next.d.mts +0 -9
- package/dist/runtime/internal/next.mjs +0 -22
package/dist/types/index.d.mts
CHANGED
|
@@ -1,1306 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
import { silgiFetch } from 'silgi';
|
|
28
|
-
import { useRuntimeConfig } from 'silgi/runtime';
|
|
29
|
-
import { Unimport } from 'unimport';
|
|
30
|
-
import { ProviderName } from 'std-env';
|
|
31
|
-
import { FetchOptions, FetchResponse } from 'ofetch';
|
|
32
|
-
import 'silgi/types';
|
|
33
|
-
|
|
34
|
-
interface SilgiCompatibilityIssue {
|
|
35
|
-
name: string;
|
|
36
|
-
message: string;
|
|
37
|
-
}
|
|
38
|
-
interface SilgiCompatibilityIssues extends Array<SilgiCompatibilityIssue> {
|
|
39
|
-
/**
|
|
40
|
-
* Return formatted error message.
|
|
41
|
-
*/
|
|
42
|
-
toString: () => string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
type RequiredServiceType<T> = {
|
|
46
|
-
[K in keyof T]-?: T[K] extends Record<string, any> ? {
|
|
47
|
-
[P in keyof T[K]]-?: any;
|
|
48
|
-
} : never;
|
|
49
|
-
};
|
|
50
|
-
type EventHandlerResponse<T = unknown> = T | Promise<T>;
|
|
51
|
-
type HookResult = Promise<void> | void;
|
|
52
|
-
interface EnvOptions {
|
|
53
|
-
prefix?: string;
|
|
54
|
-
altPrefix?: string;
|
|
55
|
-
silgiPrefix?: string;
|
|
56
|
-
envExpansion?: boolean;
|
|
57
|
-
}
|
|
58
|
-
type IsPlainObject<T> = T extends object ? T extends Function ? false : T extends any[] ? false : true : false;
|
|
59
|
-
/**
|
|
60
|
-
* Recursively merges two object types. Properties in U override properties in T.
|
|
61
|
-
* @template T - The base object type.
|
|
62
|
-
* @template U - The object type to merge into T.
|
|
63
|
-
*/
|
|
64
|
-
type DeepMerge<A, B> = {
|
|
65
|
-
[K in keyof A | keyof B]: K extends keyof B ? K extends keyof A ? IsPlainObject<A[K]> extends true ? IsPlainObject<B[K]> extends true ? DeepMerge<A[K], B[K]> : B[K] : B[K] : B[K] : K extends keyof A ? A[K] : never;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Merges an array of object types recursively using DeepMerge.
|
|
69
|
-
* @template T - A tuple type containing the object types to merge.
|
|
70
|
-
*/
|
|
71
|
-
type MergeAll<T extends readonly any[]> = T extends [infer First, ...infer Rest] ? Rest extends [] ? First : DeepMerge<First, MergeAll<Rest>> : object;
|
|
72
|
-
|
|
73
|
-
interface SilgiRuntimeMethods {
|
|
74
|
-
}
|
|
75
|
-
type CommandType = 'run' | 'prepare' | 'install' | 'dev' | 'init';
|
|
76
|
-
interface SilgiRouterTypes {
|
|
77
|
-
}
|
|
78
|
-
interface DefaultHooks {
|
|
79
|
-
}
|
|
80
|
-
type DeepPartial<T> = T extends (...args: any[]) => any ? T : T extends Record<string, any> ? {
|
|
81
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
82
|
-
} : T;
|
|
83
|
-
type DeepRequired<T> = T extends (...args: any[]) => any ? T : T extends Record<string, any> ? {
|
|
84
|
-
[P in keyof T]-?: DeepRequired<T[P]>;
|
|
85
|
-
} : T;
|
|
86
|
-
type Awaitable<T> = T | Promise<T>;
|
|
87
|
-
|
|
88
|
-
interface ExtendContext {
|
|
89
|
-
}
|
|
90
|
-
interface SilgiRuntimeContext extends Record<string, any> {
|
|
91
|
-
params?: Record<string, string>;
|
|
92
|
-
protocol: EventProtocol;
|
|
93
|
-
/**
|
|
94
|
-
* Matched router Node
|
|
95
|
-
*
|
|
96
|
-
* @experimental The object structure may change in non-major version.
|
|
97
|
-
*/
|
|
98
|
-
matchedRoute?: SilgiRoute;
|
|
99
|
-
sessions?: Record<string, Session>;
|
|
100
|
-
clientAddress?: string;
|
|
101
|
-
silgi: {
|
|
102
|
-
runtimeConfig?: SilgiRuntimeConfig;
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
type EventProtocol = 'GRAPHQL' | 'HTTP' | 'WEBSOCKET';
|
|
106
|
-
/**
|
|
107
|
-
* Bu nitrojs, h3 event or request context.
|
|
108
|
-
*/
|
|
109
|
-
interface SilgiEvent extends Record<string, unknown> {
|
|
110
|
-
_chain: Promise<unknown> | undefined;
|
|
111
|
-
/**
|
|
112
|
-
* Event context.
|
|
113
|
-
*/
|
|
114
|
-
readonly context: SilgiRuntimeContext;
|
|
115
|
-
/**
|
|
116
|
-
* Incoming HTTP request info.
|
|
117
|
-
*
|
|
118
|
-
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Request)
|
|
119
|
-
*/
|
|
120
|
-
readonly req: ServerRequest;
|
|
121
|
-
/**
|
|
122
|
-
* Access to runtime specific additional context.
|
|
123
|
-
*
|
|
124
|
-
*/
|
|
125
|
-
runtime: ServerRequest['runtime'];
|
|
126
|
-
/**
|
|
127
|
-
* Access to the parsed request URL.
|
|
128
|
-
*
|
|
129
|
-
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/URL)
|
|
130
|
-
*/
|
|
131
|
-
readonly url: URL;
|
|
132
|
-
/**
|
|
133
|
-
* Prepared HTTP response.
|
|
134
|
-
*/
|
|
135
|
-
readonly res: {
|
|
136
|
-
status?: number;
|
|
137
|
-
statusText?: string;
|
|
138
|
-
readonly headers: Headers;
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Route configuration interface.
|
|
144
|
-
*/
|
|
145
|
-
interface Resolvers {
|
|
146
|
-
}
|
|
147
|
-
interface Routers {
|
|
148
|
-
}
|
|
149
|
-
interface RouteRules extends Record<string, unknown> {
|
|
150
|
-
}
|
|
151
|
-
type MergeRouteRules = Partial<RouteRules> & {
|
|
152
|
-
readBeforeBody?: boolean;
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* Extracts the prefix (first segment) from a URL, including the leading slash.
|
|
156
|
-
* @example ExtractPrefix<'/api/blueSpace/basket'> // '/api'
|
|
157
|
-
*/
|
|
158
|
-
type ExtractPrefix<URL extends string> = URL extends `/${infer Prefix}/${string}` ? `/${Prefix}` : never;
|
|
159
|
-
/**
|
|
160
|
-
* Extracts the namespace (second segment) from a URL, including the leading slash.
|
|
161
|
-
* @example ExtractNamespace<'/api/blueSpace/basket'> // '/blueSpace'
|
|
162
|
-
*/
|
|
163
|
-
type ExtractNamespace<URL extends string> = URL extends `/${string}/${infer Namespace}/${string}` ? `/${Namespace}` : never;
|
|
164
|
-
/**
|
|
165
|
-
* Extracts the route (third and subsequent segments) from a URL, including the leading slash.
|
|
166
|
-
* @example ExtractRoute<'/api/blueSpace/basket/getBook'> // '/basket/getBook'
|
|
167
|
-
*/
|
|
168
|
-
type ExtractRoute<URL extends string> = URL extends `/${string}/${string}/${infer Route}` ? `/${Route}` : never;
|
|
169
|
-
/**
|
|
170
|
-
* Gets all route keys from Routers as strings.
|
|
171
|
-
* All keys should start with a leading slash.
|
|
172
|
-
*/
|
|
173
|
-
type RouterKeys = (keyof ServicesObject extends string ? keyof ServicesObject : never) & (keyof Routers extends string ? keyof Routers : never);
|
|
174
|
-
/**
|
|
175
|
-
* Extracts all prefixes (first segment) in the system, including the leading slash.
|
|
176
|
-
* @example AllPrefixes // '/api' | ...
|
|
177
|
-
*/
|
|
178
|
-
type AllPrefixes = RouterKeys extends infer K ? K extends string ? ExtractPrefix<K> : never : never;
|
|
179
|
-
/**
|
|
180
|
-
* Extracts all namespaces (second segment) for a given prefix, including the leading slash.
|
|
181
|
-
* @example NamespacesForPrefix<'/api'> // '/blueSpace' | ...
|
|
182
|
-
*/
|
|
183
|
-
type NamespacesForPrefix<P extends string> = RouterKeys extends infer K ? K extends string ? K extends `${P}/${infer N}/${string}` ? `/${N}` : never : never : never;
|
|
184
|
-
/**
|
|
185
|
-
* Extracts all routes (third and subsequent segments) for a given prefix and namespace, including the leading slash.
|
|
186
|
-
* @example RoutesForPrefixAndNamespace<'/api', '/blueSpace'> // '/basket/getBook' | ...
|
|
187
|
-
*/
|
|
188
|
-
type RoutesForPrefixAndNamespace<P extends string, N extends string> = RouterKeys extends infer K ? K extends string ? K extends `${P}${N}${infer R}` ? `${R}` : never : never : never;
|
|
189
|
-
/**
|
|
190
|
-
* Extracts path parameter keys from a URL pattern string.
|
|
191
|
-
*
|
|
192
|
-
* @example
|
|
193
|
-
* ExtractPathParamKeys<'/users/:id/posts/:postId'> // 'id' | 'postId'
|
|
194
|
-
* ExtractPathParamKeys<'/users/:id?'> // 'id'
|
|
195
|
-
*/
|
|
196
|
-
type ExtractPathParamKeys<S extends string> = S extends `${string}:${infer Param}/${infer Rest}` ? Param extends `${infer Key}?` ? Key | ExtractPathParamKeys<Rest> : Param | ExtractPathParamKeys<Rest> : S extends `${string}:${infer Param}` ? Param extends `${infer Key}?` ? Key : Param : never;
|
|
197
|
-
|
|
198
|
-
type CustomDriverName = string & {
|
|
199
|
-
_custom?: any;
|
|
200
|
-
};
|
|
201
|
-
interface StorageMounts {
|
|
202
|
-
[path: string]: {
|
|
203
|
-
driver: BuiltinDriverName | CustomDriverName;
|
|
204
|
-
[option: string]: any;
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
interface SilgiStorageBase {
|
|
208
|
-
}
|
|
209
|
-
type StorageKeyGenerator<TInput> = (input: TInput) => string | Promise<string>;
|
|
210
|
-
interface StorageConfig<TInput = unknown> {
|
|
211
|
-
options: TransactionOptions;
|
|
212
|
-
base: 'memory' | keyof SilgiStorageBase;
|
|
213
|
-
key?: StorageKeyGenerator<TInput>;
|
|
214
|
-
scope?: 'request' | 'global';
|
|
215
|
-
}
|
|
216
|
-
interface StorageKeyParams<TInput = unknown> {
|
|
217
|
-
url: SilgiURL;
|
|
218
|
-
input: TInput;
|
|
219
|
-
requestId?: string;
|
|
220
|
-
keyGenerator?: StorageKeyGenerator<TInput>;
|
|
221
|
-
storageOptions?: Pick<StorageConfig<TInput>, 'base' | 'options' | 'scope'>;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
interface SilgiRuntimeShareds extends SilgiRuntimeSharedsExtend {
|
|
225
|
-
storage: <T extends StorageValue = StorageValue>(base: StorageConfig<T>['base']) => Storage<T>;
|
|
226
|
-
useRuntimeConfig: typeof useRuntimeConfig;
|
|
227
|
-
$fetch: typeof silgiFetch;
|
|
228
|
-
silgi: Silgi;
|
|
229
|
-
}
|
|
230
|
-
interface SilgiRuntimeSharedsExtend {
|
|
231
|
-
}
|
|
232
|
-
interface ExtendShared {
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/** The Standard Schema interface. */
|
|
236
|
-
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
237
|
-
/** The Standard Schema properties. */
|
|
238
|
-
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
239
|
-
}
|
|
240
|
-
declare namespace StandardSchemaV1 {
|
|
241
|
-
/** The Standard Schema properties interface. */
|
|
242
|
-
export interface Props<Input = unknown, Output = Input> {
|
|
243
|
-
/** The version number of the standard. */
|
|
244
|
-
readonly version: 1;
|
|
245
|
-
/** The vendor name of the schema library. */
|
|
246
|
-
readonly vendor: string;
|
|
247
|
-
/** Validates unknown input values. */
|
|
248
|
-
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
249
|
-
/** Inferred types associated with the schema. */
|
|
250
|
-
readonly types?: Types<Input, Output> | undefined;
|
|
251
|
-
}
|
|
252
|
-
/** The result interface of the validate function. */
|
|
253
|
-
export type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
254
|
-
/** The result interface if validation succeeds. */
|
|
255
|
-
export interface SuccessResult<Output> {
|
|
256
|
-
/** The typed output value. */
|
|
257
|
-
readonly value: Output;
|
|
258
|
-
/** The non-existent issues. */
|
|
259
|
-
readonly issues?: undefined;
|
|
260
|
-
}
|
|
261
|
-
/** The result interface if validation fails. */
|
|
262
|
-
export interface FailureResult {
|
|
263
|
-
/** The issues of failed validation. */
|
|
264
|
-
readonly issues: ReadonlyArray<Issue>;
|
|
265
|
-
}
|
|
266
|
-
/** The issue interface of the failure output. */
|
|
267
|
-
export interface Issue {
|
|
268
|
-
/** The error message of the issue. */
|
|
269
|
-
readonly message: string;
|
|
270
|
-
/** The path of the issue, if any. */
|
|
271
|
-
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
272
|
-
}
|
|
273
|
-
/** The path segment interface of the issue. */
|
|
274
|
-
export interface PathSegment {
|
|
275
|
-
/** The key representing a path segment. */
|
|
276
|
-
readonly key: PropertyKey;
|
|
277
|
-
}
|
|
278
|
-
/** The Standard Schema types interface. */
|
|
279
|
-
export interface Types<Input = unknown, Output = Input> {
|
|
280
|
-
/** The input type of the schema. */
|
|
281
|
-
readonly input: Input;
|
|
282
|
-
/** The output type of the schema. */
|
|
283
|
-
readonly output: Output;
|
|
284
|
-
}
|
|
285
|
-
/** Infers the input type of a Standard Schema. */
|
|
286
|
-
export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];
|
|
287
|
-
/** Infers the output type of a Standard Schema. */
|
|
288
|
-
export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];
|
|
289
|
-
export {};
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
interface ServicesObject {
|
|
293
|
-
}
|
|
294
|
-
interface WebSocketOptions {
|
|
295
|
-
resolve?: ResolveHooks;
|
|
296
|
-
hooks?: Partial<Hooks>;
|
|
297
|
-
adapterHooks?: Partial<Hooks>;
|
|
298
|
-
}
|
|
299
|
-
type SlashCount<S extends string, Count extends any[] = []> = S extends `${infer _Prefix}/${infer Rest}` ? SlashCount<Rest, [any, ...Count]> : Count['length'];
|
|
300
|
-
type Max4Slashes<S extends keyof Routers> = SlashCount<S> extends 0 | 1 | 2 | 3 ? S : never;
|
|
301
|
-
/**
|
|
302
|
-
* Yardımcı tipler
|
|
303
|
-
*/
|
|
304
|
-
type InferInput<T> = T extends StandardSchemaV1 ? StandardSchemaV1.InferInput<T> : unknown;
|
|
305
|
-
type InferOutput<T> = T extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<T> : unknown;
|
|
306
|
-
/**
|
|
307
|
-
* Route ve method'a göre input, output, params çıkarımı
|
|
308
|
-
*
|
|
309
|
-
* - Eğer PathParams veya QueryParams never/undefined ise parameters alanı eklenmez.
|
|
310
|
-
* - args her zaman zorunlu.
|
|
311
|
-
*/
|
|
312
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
313
|
-
type IsUndefined<T> = [undefined] extends [T] ? true : false;
|
|
314
|
-
type HasPath<T> = IsNever<T> extends true ? false : IsUndefined<T> extends true ? false : true;
|
|
315
|
-
type HasQuery<T> = IsNever<T> extends true ? false : IsUndefined<T> extends true ? false : true;
|
|
316
|
-
type ServiceHandlerInput<Input extends StandardSchemaV1 = StandardSchemaV1, PathParams extends StandardSchemaV1 | never | undefined = never, QueryParams extends StandardSchemaV1 | never | undefined = never, HiddenParameters extends boolean = false> = HiddenParameters extends true ? {
|
|
317
|
-
args: InferInput<Input>;
|
|
318
|
-
} : HasPath<PathParams> extends true ? HasQuery<QueryParams> extends true ? {
|
|
319
|
-
args: InferInput<Input>;
|
|
320
|
-
path: InferInput<PathParams>;
|
|
321
|
-
query: Partial<InferInput<QueryParams>>;
|
|
322
|
-
} : {
|
|
323
|
-
args: InferInput<Input>;
|
|
324
|
-
path: InferInput<PathParams>;
|
|
325
|
-
} : HasQuery<QueryParams> extends true ? {
|
|
326
|
-
args: InferInput<Input>;
|
|
327
|
-
query: InferInput<QueryParams>;
|
|
328
|
-
} : {
|
|
329
|
-
args: InferInput<Input>;
|
|
330
|
-
};
|
|
331
|
-
type ServiceHandler<Input extends StandardSchemaV1, Output extends StandardSchemaV1, PathParams extends StandardSchemaV1 | never | undefined = never, QueryParams extends StandardSchemaV1 | never | undefined = never, Resolved extends boolean = false, HiddenParameters extends boolean = false> = Resolved extends true ? (input: ServiceHandlerInput<Input, PathParams, QueryParams, HiddenParameters>, shared?: SilgiRuntimeShareds, event?: SilgiEvent) => Promise<InferOutput<Output>> | InferOutput<Output> | AsyncGenerator<InferOutput<Output>> | Generator<InferOutput<Output>> | Iterator<InferOutput<Output>> | AsyncIterator<InferOutput<Output>> | ReadableStream<InferOutput<Output>> : (input: ServiceHandlerInput<Input, PathParams, QueryParams, HiddenParameters>, shared: SilgiRuntimeShareds, event: SilgiEvent) => Promise<InferOutput<Output>> | InferOutput<Output> | AsyncGenerator<InferOutput<Output>> | Generator<InferOutput<Output>> | Iterator<InferOutput<Output>> | AsyncIterator<InferOutput<Output>> | ReadableStream<InferOutput<Output>>;
|
|
332
|
-
/**
|
|
333
|
-
* Servis setup tipi
|
|
334
|
-
*/
|
|
335
|
-
interface ServiceSetup<Method extends HTTPMethod = HTTPMethod, Path extends string = string, Input extends StandardSchemaV1 = StandardSchemaV1, Output extends StandardSchemaV1 = StandardSchemaV1, PathParams extends StandardSchemaV1 | undefined | never = undefined, QueryParams extends StandardSchemaV1 | undefined | never = undefined, Resolved extends boolean = false, HiddenParameters extends boolean = false> {
|
|
336
|
-
path: Path;
|
|
337
|
-
method?: Method;
|
|
338
|
-
handler?: ServiceHandler<Input, Output, PathParams, QueryParams, Resolved, HiddenParameters>;
|
|
339
|
-
rules?: MergeRouteRules;
|
|
340
|
-
modules?: Partial<SetupModuleOption>;
|
|
341
|
-
storage?: StorageConfig<ServiceHandlerInput<Input, PathParams, QueryParams, HiddenParameters>>;
|
|
342
|
-
input?: Input;
|
|
343
|
-
output?: Output;
|
|
344
|
-
pathParams?: PathParams;
|
|
345
|
-
queryParams?: QueryParams;
|
|
346
|
-
}
|
|
347
|
-
interface WebSocketServiceSetup<Method extends HTTPMethod = HTTPMethod, Path extends string = string> {
|
|
348
|
-
path: Path;
|
|
349
|
-
websocket: Partial<Hooks>;
|
|
350
|
-
method?: Method;
|
|
351
|
-
rules?: MergeRouteRules;
|
|
352
|
-
modules?: Partial<SetupModuleOption>;
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Represents a fully resolved service definition that maps route paths
|
|
356
|
-
* to their handler and configurations.
|
|
357
|
-
*
|
|
358
|
-
* This interface is designed to be compatible with the structure created
|
|
359
|
-
* by the createService function.
|
|
360
|
-
*
|
|
361
|
-
* Format: "routePath" => setup + methods + input + output + queryParams
|
|
362
|
-
*/
|
|
363
|
-
interface ResolvedServiceDefinition {
|
|
364
|
-
[key: string]: ServiceSetup<any, any, any, any, any, any, any, any>;
|
|
365
|
-
}
|
|
366
|
-
interface ResolvedWebSocketServiceDefinition {
|
|
367
|
-
[key: string]: WebSocketServiceSetup<any, any>;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* SilgiURL tipi
|
|
371
|
-
*/
|
|
372
|
-
interface SilgiURL {
|
|
373
|
-
namespaceName: string;
|
|
374
|
-
prefixName: string;
|
|
375
|
-
methodName: string;
|
|
376
|
-
path: string;
|
|
377
|
-
raw: string;
|
|
378
|
-
pathParams?: Record<string, string | undefined>;
|
|
379
|
-
queryParams?: Record<string, string>;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
interface SilgiCLI {
|
|
383
|
-
_ignore?: Ignore;
|
|
384
|
-
errors: {
|
|
385
|
-
type: 'Parser';
|
|
386
|
-
path?: string;
|
|
387
|
-
}[];
|
|
388
|
-
services: ResolvedServiceDefinition;
|
|
389
|
-
middleware: SilgiRoute[];
|
|
390
|
-
shareds: SilgiRuntimeShareds;
|
|
391
|
-
resolvers: IResolvers<any, any>[];
|
|
392
|
-
schemas: Record<string, any>;
|
|
393
|
-
templates: SilgiTemplate[];
|
|
394
|
-
hooks: Hookable<SilgiCLIHooks>;
|
|
395
|
-
hook: SilgiCLI['hooks']['hook'];
|
|
396
|
-
callHook: SilgiCLI['hooks']['callHook'];
|
|
397
|
-
addHooks: SilgiCLI['hooks']['addHooks'];
|
|
398
|
-
storage: Storage;
|
|
399
|
-
useLocalConfig: typeof useRuntimeConfig;
|
|
400
|
-
unimport?: Unimport;
|
|
401
|
-
logger: ConsolaInstance;
|
|
402
|
-
close: () => Promise<void>;
|
|
403
|
-
scanModules: Array<{
|
|
404
|
-
meta: ModuleMeta;
|
|
405
|
-
module: SilgiModule;
|
|
406
|
-
timings?: Record<string, number | undefined>;
|
|
407
|
-
entryPath?: string;
|
|
408
|
-
installed?: boolean;
|
|
409
|
-
options: Record<string, any>;
|
|
410
|
-
}>;
|
|
411
|
-
options: SilgiCLIOptions;
|
|
412
|
-
_requiredModules: Record<string, boolean>;
|
|
413
|
-
adapters: Record<string, Adapter<Record<string, any>, TablesSchema, InferModelTypes<TablesSchema>>>;
|
|
414
|
-
meta: MetaData;
|
|
415
|
-
}
|
|
416
|
-
interface SilgiFrameworkInfo {
|
|
417
|
-
name?: 'silgi' | (string & {});
|
|
418
|
-
version?: string;
|
|
419
|
-
}
|
|
420
|
-
/** Build info written to `.output/silgi.json` or `.silgi/dev/silgi.json` */
|
|
421
|
-
interface NitroBuildInfo {
|
|
422
|
-
date: string;
|
|
423
|
-
preset: PresetName;
|
|
424
|
-
framework: SilgiFrameworkInfo;
|
|
425
|
-
versions: {
|
|
426
|
-
silgi: string;
|
|
427
|
-
[key: string]: string;
|
|
428
|
-
};
|
|
429
|
-
commands?: {
|
|
430
|
-
preview?: string;
|
|
431
|
-
deploy?: string;
|
|
432
|
-
};
|
|
433
|
-
dev?: {
|
|
434
|
-
pid: number;
|
|
435
|
-
workerAddress: {
|
|
436
|
-
host: string;
|
|
437
|
-
port: number;
|
|
438
|
-
socketPath?: string;
|
|
439
|
-
};
|
|
440
|
-
};
|
|
441
|
-
config?: Partial<PresetOptions>;
|
|
442
|
-
}
|
|
443
|
-
interface ScanFile {
|
|
444
|
-
context: string;
|
|
445
|
-
object: {
|
|
446
|
-
schemas: any;
|
|
447
|
-
services: any;
|
|
448
|
-
shareds: any;
|
|
449
|
-
};
|
|
450
|
-
path: string;
|
|
451
|
-
}
|
|
452
|
-
type TemplateDefaultOptions = Record<string, any>;
|
|
453
|
-
interface SilgiTemplate<Options = TemplateDefaultOptions> {
|
|
454
|
-
/** resolved output file path (generated) */
|
|
455
|
-
dst?: string;
|
|
456
|
-
/** The target filename once the template is copied into the Silgi buildDir */
|
|
457
|
-
filename?: string;
|
|
458
|
-
/** An options object that will be accessible within the template via `<% options %>` */
|
|
459
|
-
options?: Options;
|
|
460
|
-
/** The resolved path to the source file to be template */
|
|
461
|
-
src?: string;
|
|
462
|
-
/** Provided compile option instead of src */
|
|
463
|
-
where?: 'server' | 'client' | '.silgi' | 'root';
|
|
464
|
-
getContents?: (data: {
|
|
465
|
-
app: SilgiCLI;
|
|
466
|
-
options: Options;
|
|
467
|
-
}) => string | Promise<string>;
|
|
468
|
-
/** Write to filesystem */
|
|
469
|
-
write?: boolean;
|
|
470
|
-
skipIfExists?: boolean;
|
|
471
|
-
watch?: false;
|
|
472
|
-
}
|
|
473
|
-
interface ResolvedSilgiTemplate<Options = TemplateDefaultOptions> extends SilgiTemplate<Options> {
|
|
474
|
-
filename: string;
|
|
475
|
-
dst: string;
|
|
476
|
-
modified?: boolean;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
interface SetupModuleOption {
|
|
480
|
-
}
|
|
481
|
-
interface SilgiModuleOptions {
|
|
482
|
-
}
|
|
483
|
-
interface SilgiRuntimeOptions {
|
|
484
|
-
}
|
|
485
|
-
type SilgiModuleInput = (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false);
|
|
486
|
-
interface SilgiCompatibility {
|
|
487
|
-
/**
|
|
488
|
-
* Required silgi version in semver format.
|
|
489
|
-
* @example `^3.2.0` or `>=3.13.0`.
|
|
490
|
-
*/
|
|
491
|
-
silgi?: string;
|
|
492
|
-
}
|
|
493
|
-
interface ModuleMeta {
|
|
494
|
-
/** Module name. */
|
|
495
|
-
name?: string;
|
|
496
|
-
/** Module description. */
|
|
497
|
-
description?: string;
|
|
498
|
-
/** Module author. */
|
|
499
|
-
author?: string;
|
|
500
|
-
/** Module license. */
|
|
501
|
-
license?: string;
|
|
502
|
-
/** Module version. */
|
|
503
|
-
version?: string;
|
|
504
|
-
/**
|
|
505
|
-
* The configuration key used within `silgi.config` for this module's options.
|
|
506
|
-
* For example, `@silgijs/axios` uses `axios`.
|
|
507
|
-
*/
|
|
508
|
-
configKey?: string;
|
|
509
|
-
/**
|
|
510
|
-
* Constraints for the versions of silgi or features this module requires.
|
|
511
|
-
*/
|
|
512
|
-
compatibility?: SilgiCompatibility;
|
|
513
|
-
/**
|
|
514
|
-
* @private
|
|
515
|
-
*/
|
|
516
|
-
_modules?: {
|
|
517
|
-
[key: string]: string;
|
|
518
|
-
};
|
|
519
|
-
/**
|
|
520
|
-
* @private
|
|
521
|
-
*/
|
|
522
|
-
_packageName?: string;
|
|
523
|
-
cliToRuntimeOptionsKeys?: string[];
|
|
524
|
-
readonly afterDependencies?: ReadonlyArray<string>;
|
|
525
|
-
readonly beforeDependencies?: ReadonlyArray<string>;
|
|
526
|
-
readonly requiredDependencies?: ReadonlyArray<string>;
|
|
527
|
-
[key: string]: unknown;
|
|
528
|
-
}
|
|
529
|
-
interface ResolvedModuleMeta extends ModuleMeta {
|
|
530
|
-
configKey: string;
|
|
531
|
-
name: string;
|
|
532
|
-
}
|
|
533
|
-
type ModuleHookContext = Readonly<{
|
|
534
|
-
event?: SilgiEvent;
|
|
535
|
-
url?: SilgiURL;
|
|
536
|
-
input?: unknown;
|
|
537
|
-
result?: unknown;
|
|
538
|
-
route?: SilgiRoute;
|
|
539
|
-
error?: Error;
|
|
540
|
-
success?: boolean;
|
|
541
|
-
cached?: boolean;
|
|
542
|
-
}> & {
|
|
543
|
-
hookContext?: {
|
|
544
|
-
earlyReturnValue: any | false;
|
|
545
|
-
};
|
|
546
|
-
};
|
|
547
|
-
/** The options received. */
|
|
548
|
-
type ModuleOptionsCustom = Record<string, any>;
|
|
549
|
-
type Prettify<T> = {
|
|
550
|
-
[K in keyof T]: T[K];
|
|
551
|
-
} & {};
|
|
552
|
-
type ResolvedModuleOptions<TOptions extends ModuleOptionsCustom, TOptionsDefaults extends Partial<TOptions>> = Prettify<Defu<Partial<TOptions>, [
|
|
553
|
-
Partial<TOptions>,
|
|
554
|
-
TOptionsDefaults
|
|
555
|
-
]>>;
|
|
556
|
-
interface ModuleDefinition<TOptions extends ModuleOptionsCustom, TOptionsDefaults extends Partial<TOptions>, TWith extends boolean> {
|
|
557
|
-
meta?: ModuleMeta;
|
|
558
|
-
defaults?: TOptionsDefaults | ((silgi: SilgiCLI) => Awaitable<TOptionsDefaults>);
|
|
559
|
-
hooks?: Partial<SilgiCLIHooks>;
|
|
560
|
-
setup?: (this: void, resolvedOptions: TWith extends true ? ResolvedModuleOptions<TOptions, TOptionsDefaults> : TOptions, silgi: SilgiCLI & SilgiModuleOptions) => ModuleSetupReturn;
|
|
561
|
-
}
|
|
562
|
-
interface ModuleSetupInstallResult {
|
|
563
|
-
/**
|
|
564
|
-
* Timing information for the initial setup
|
|
565
|
-
*/
|
|
566
|
-
timings?: {
|
|
567
|
-
/** Total time took for module setup in ms */
|
|
568
|
-
setup?: number;
|
|
569
|
-
[key: string]: number | undefined;
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
type ModuleSetupReturn = Awaitable<false | void | ModuleSetupInstallResult>;
|
|
573
|
-
interface SilgiModule<TOptions extends ModuleOptionsCustom = ModuleOptionsCustom, TOptionsDefaults extends Partial<TOptions> = Partial<TOptions>, TWith extends boolean = false> {
|
|
574
|
-
(this: void, resolvedOptions: TWith extends true ? ResolvedModuleOptions<TOptions, TOptionsDefaults> : TOptions, silgi: SilgiCLI): ModuleSetupReturn;
|
|
575
|
-
getOptions?: (inlineOptions?: Partial<TOptions>, silgi?: SilgiCLI) => Promise<TWith extends true ? ResolvedModuleOptions<TOptions, TOptionsDefaults> : TOptions>;
|
|
576
|
-
getMeta?: () => Promise<ModuleMeta>;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
type WildcardVariants<Path extends string, Acc extends string = ''> = Path extends `${infer Head}/${infer Tail}` ? Tail extends '' ? `${Acc}${Head}` : `${Acc}${Head}/${Tail}` | `${Acc}${Head}/*` | `${Acc}${Head}/**` | WildcardVariants<Tail, `${Acc}${Head}/`> : `${Acc}${Path}`;
|
|
580
|
-
type MiddlewarePath<S extends WildcardVariants<keyof Routers>> = S | 'global';
|
|
581
|
-
interface CreateMiddlewareParams<S extends WildcardVariants<keyof Routers>, UsedMethod extends readonly HTTPMethod[] = readonly HTTPMethod[], Key extends string = string> {
|
|
582
|
-
path: MiddlewarePath<S>;
|
|
583
|
-
methods?: UsedMethod;
|
|
584
|
-
setup: MiddlewareSetup;
|
|
585
|
-
key: Key;
|
|
586
|
-
}
|
|
587
|
-
type MiddlewareHandler<Response extends EventHandlerResponse = EventHandlerResponse> = (event: SilgiEvent, silgi: Silgi) => Response;
|
|
588
|
-
/**
|
|
589
|
-
* Middleware Setup tipi
|
|
590
|
-
*/
|
|
591
|
-
interface MiddlewareSetup {
|
|
592
|
-
handler?: MiddlewareHandler;
|
|
593
|
-
rules?: MergeRouteRules;
|
|
594
|
-
modules?: Partial<SetupModuleOption>;
|
|
595
|
-
storage?: StorageConfig;
|
|
596
|
-
}
|
|
597
|
-
type ResolvedMiddlewareDefinition = CreateMiddlewareResult<string, readonly HTTPMethod[], string>;
|
|
598
|
-
|
|
599
|
-
type TrimAfterFourSlashes<T extends string> = T extends `/${infer S1}/${infer S2}/${infer S3}/${infer S4}/${infer _}` ? `/${S1}/${S2}/${S3}/${S4}` : T;
|
|
600
|
-
type AllPaths = SilgiRouterTypes extends {
|
|
601
|
-
keys: infer U;
|
|
602
|
-
} ? keyof U extends never ? string : keyof U : string;
|
|
603
|
-
type ExtractPathParams<T extends string> = T extends `${infer _Start}:${infer Param}/${infer Rest}` ? {
|
|
604
|
-
[K in Param]: string;
|
|
605
|
-
} & ExtractPathParams<Rest> : T extends `${infer _Start}:${infer Param}` ? {
|
|
606
|
-
[K in Param]: string;
|
|
607
|
-
} : unknown;
|
|
608
|
-
|
|
609
|
-
type RouterParams<R extends AllPaths | (string & {})> = ExtractPathParams<R>;
|
|
610
|
-
type SilgiFetchOptions<P extends AllPaths | (string & {}), BasePath extends keyof SilgiRouterTypes = TrimAfterFourSlashes<P> extends keyof SilgiRouterTypes ? TrimAfterFourSlashes<P> : never, M extends keyof SilgiRouterTypes[BasePath] = keyof SilgiRouterTypes[BasePath]> = {
|
|
611
|
-
method?: M;
|
|
612
|
-
params?: ExtractPathParams<P>;
|
|
613
|
-
body?: SilgiRouterTypes[BasePath][M]['input'];
|
|
614
|
-
} & Omit<FetchOptions, 'method' | 'body' | 'params'>;
|
|
615
|
-
type SilgiFetchClient = <P extends AllPaths | (string & {}), BasePath extends keyof SilgiRouterTypes = TrimAfterFourSlashes<P> extends keyof SilgiRouterTypes ? TrimAfterFourSlashes<P> : never, M extends keyof SilgiRouterTypes[BasePath] = keyof SilgiRouterTypes[BasePath]>(url: BasePath, options?: SilgiFetchOptions<P, BasePath, M>) => Promise<FetchResponse<SilgiRouterTypes[BasePath][M]['output']>>;
|
|
616
|
-
|
|
617
|
-
interface SilgiAppPlugin {
|
|
618
|
-
(silgi: Silgi): Promise<void> | void;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
interface CapturedErrorContext {
|
|
622
|
-
event?: SilgiEvent;
|
|
623
|
-
[key: string]: unknown;
|
|
624
|
-
}
|
|
625
|
-
type CaptureError = (silgi: Silgi, error: Error, context: CapturedErrorContext) => void;
|
|
626
|
-
|
|
627
|
-
/**
|
|
628
|
-
* The listeners to Silgi
|
|
629
|
-
*/
|
|
630
|
-
interface SilgiRuntimeHooks {
|
|
631
|
-
/**
|
|
632
|
-
* Called after Silgi initialization, when the Silgi instance is ready to work.
|
|
633
|
-
* @param silgi The configured Silgi object
|
|
634
|
-
* @returns Promise
|
|
635
|
-
*/
|
|
636
|
-
'ready': (silgi: Silgi) => HookResult;
|
|
637
|
-
/**
|
|
638
|
-
* Called when silgi instance is gracefully closing.
|
|
639
|
-
* @param silgi The configured silgi object
|
|
640
|
-
* @returns Promise
|
|
641
|
-
*/
|
|
642
|
-
'close': (silgi: Silgi) => HookResult;
|
|
643
|
-
'middleware:global:on': (event: SilgiEvent, setup: MiddlewareSetup) => HookResult;
|
|
644
|
-
'middleware:router:on': (event: SilgiEvent, setup: MiddlewareSetup) => HookResult;
|
|
645
|
-
'request:on': (event: SilgiEvent) => HookResult;
|
|
646
|
-
'fetch:before': (context: ModuleHookContext) => HookResult;
|
|
647
|
-
'fetch:after': (context: ModuleHookContext) => HookResult;
|
|
648
|
-
'fetch:error': (context: ModuleHookContext) => HookResult;
|
|
649
|
-
'fetch:finally': (context: Omit<ModuleHookContext, 'event'>) => HookResult;
|
|
650
|
-
'error': CaptureError;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
interface SilgiRuntimeDefaultConfig {
|
|
654
|
-
silgi?: {
|
|
655
|
-
envPrefix?: string;
|
|
656
|
-
envExpansion?: boolean;
|
|
657
|
-
};
|
|
658
|
-
}
|
|
659
|
-
interface SilgiRuntimeConfig extends SilgiRuntimeDefaultConfig {
|
|
660
|
-
}
|
|
661
|
-
interface SilgiOptions {
|
|
662
|
-
consolaOptions?: Partial<ConsolaOptions>;
|
|
663
|
-
present: PresetNameInput;
|
|
664
|
-
hooks: Partial<SilgiRuntimeHooks & DefaultHooks>;
|
|
665
|
-
/**
|
|
666
|
-
* Set to `true` to enable debug mode.
|
|
667
|
-
*
|
|
668
|
-
* At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser.
|
|
669
|
-
*
|
|
670
|
-
* @default false
|
|
671
|
-
*/
|
|
672
|
-
debug: boolean;
|
|
673
|
-
storage: StorageMounts;
|
|
674
|
-
putStorage?: Storage<StorageValue>;
|
|
675
|
-
runtimeConfig: SilgiRuntimeConfig & {
|
|
676
|
-
[key: string]: any;
|
|
677
|
-
};
|
|
678
|
-
captureError: CaptureError;
|
|
679
|
-
adapters: Record<string, Adapter<Record<string, any>, TablesSchema, InferModelTypes<TablesSchema>>>;
|
|
680
|
-
meta: MetaData;
|
|
681
|
-
websocket?: WebSocketOptions;
|
|
682
|
-
[key: string]: any;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
interface SilgiSchema {
|
|
686
|
-
}
|
|
687
|
-
interface MergedSilgiSchema {
|
|
688
|
-
}
|
|
689
|
-
type ExtractMethod<T extends string> = T extends `${infer M}:${string}` ? M : never;
|
|
690
|
-
type ExtractPath<T extends string> = T extends `${string}:${infer P}` ? P : never;
|
|
691
|
-
type RouteEntry<Schema> = {
|
|
692
|
-
[K in keyof Schema & string]: {
|
|
693
|
-
method: ExtractMethod<K>;
|
|
694
|
-
path: ExtractPath<K>;
|
|
695
|
-
raw: K;
|
|
696
|
-
schema: Schema[K];
|
|
697
|
-
};
|
|
698
|
-
}[keyof Schema & string];
|
|
699
|
-
/**
|
|
700
|
-
* Creates an object type representing path parameters extracted from a URL pattern.
|
|
701
|
-
*
|
|
702
|
-
* @example
|
|
703
|
-
* PathParamsObject<'/users/:id/posts/:postId'> // { id?: string | number, postId?: string | number }
|
|
704
|
-
*/
|
|
705
|
-
type PathParamsObject<S extends string> = {
|
|
706
|
-
[K in ExtractPathParamKeys<S>]?: string | number;
|
|
707
|
-
};
|
|
708
|
-
/**
|
|
709
|
-
* Determines if a URL pattern contains any path parameters.
|
|
710
|
-
*
|
|
711
|
-
* @example
|
|
712
|
-
* HasPathParams<'/users/:id'> // true
|
|
713
|
-
* HasPathParams<'/users'> // false
|
|
714
|
-
*/
|
|
715
|
-
type HasPathParams<S extends string> = ExtractPathParamKeys<S> extends never ? false : true;
|
|
716
|
-
/**
|
|
717
|
-
* Base schema definition for API method handlers.
|
|
718
|
-
* Defines the structure of input/output data.
|
|
719
|
-
*/
|
|
720
|
-
interface BaseMethodSchema {
|
|
721
|
-
/** Schema for request body */
|
|
722
|
-
input?: StandardSchemaV1;
|
|
723
|
-
/** Schema for response body */
|
|
724
|
-
output?: StandardSchemaV1;
|
|
725
|
-
/** Schema for URL query parameters */
|
|
726
|
-
queryParams?: StandardSchemaV1;
|
|
727
|
-
/** Schema for URL headers */
|
|
728
|
-
pathParams?: StandardSchemaV1;
|
|
729
|
-
/** Schema for source data (contextual information) */
|
|
730
|
-
source?: StandardSchemaV1;
|
|
731
|
-
}
|
|
732
|
-
/**
|
|
733
|
-
* Interface for adding path parameters schema to method definitions.
|
|
734
|
-
*/
|
|
735
|
-
interface WithPathParams<PathParamsStr extends string> {
|
|
736
|
-
/** Schema for path parameters */
|
|
737
|
-
pathParams: StandardSchemaV1<PathParamsObject<PathParamsStr>>;
|
|
738
|
-
}
|
|
739
|
-
/**
|
|
740
|
-
* Defines the schema structure for HTTP methods, conditionally including
|
|
741
|
-
* path parameters based on the URL pattern.
|
|
742
|
-
*
|
|
743
|
-
* @example
|
|
744
|
-
* // For a route with path parameters:
|
|
745
|
-
* type UserMethodSchema = MethodSchemas<'/:id'>
|
|
746
|
-
* // Result includes required pathParams for each method
|
|
747
|
-
*
|
|
748
|
-
* // For a route without path parameters:
|
|
749
|
-
* type ListMethodSchema = MethodSchemas<''>
|
|
750
|
-
* // Result doesn't allow pathParams property
|
|
751
|
-
*/
|
|
752
|
-
type MethodSchemas<PathParamsStr extends string = ''> = {
|
|
753
|
-
[K in HTTPMethod]?: HasPathParams<PathParamsStr> extends true ? BaseMethodSchema & WithPathParams<PathParamsStr> : BaseMethodSchema & {
|
|
754
|
-
pathParams?: never;
|
|
755
|
-
};
|
|
756
|
-
};
|
|
757
|
-
/**
|
|
758
|
-
* Represents a fully resolved schema definition that maps API route paths
|
|
759
|
-
* to their method schemas.
|
|
760
|
-
*/
|
|
761
|
-
interface ResolvedSchema {
|
|
762
|
-
[routePath: string]: MethodSchemas<string>;
|
|
763
|
-
}
|
|
764
|
-
/**
|
|
765
|
-
* Represents a schema definition that has been fully resolved,
|
|
766
|
-
* typically after processing and validating all schema components.
|
|
767
|
-
*/
|
|
768
|
-
interface ResolvedSchemaDefinition {
|
|
769
|
-
[methodAndRoutePath: string]: BaseMethodSchema;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
type StandardHTTPMethod = 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE';
|
|
773
|
-
type HTTPMethod = StandardHTTPMethod;
|
|
774
|
-
interface MetaData extends Record<string, unknown> {
|
|
775
|
-
}
|
|
776
|
-
interface SilgiRoute {
|
|
777
|
-
route?: string;
|
|
778
|
-
method?: HTTPMethod;
|
|
779
|
-
service?: ResolvedServiceDefinition[keyof ResolvedServiceDefinition] & ResolvedWebSocketServiceDefinition[keyof ResolvedWebSocketServiceDefinition];
|
|
780
|
-
middleware?: MiddlewareSetup;
|
|
781
|
-
}
|
|
782
|
-
interface Silgi {
|
|
783
|
-
router: RouterContext<SilgiRoute>;
|
|
784
|
-
_middlewareRouter: RouterContext<SilgiRoute>;
|
|
785
|
-
middlewares: ResolvedMiddlewareDefinition;
|
|
786
|
-
globalMiddlewares: SilgiRoute[];
|
|
787
|
-
routerPrefixs: string[];
|
|
788
|
-
schemas: ResolvedSchemaDefinition;
|
|
789
|
-
resolvers: IResolvers<any, any>[];
|
|
790
|
-
services: ResolvedServiceDefinition & ResolvedWebSocketServiceDefinition;
|
|
791
|
-
shared: SilgiRuntimeShareds;
|
|
792
|
-
plugins: SilgiAppPlugin[];
|
|
793
|
-
framework?: {
|
|
794
|
-
nitro?: NitroApp;
|
|
795
|
-
};
|
|
796
|
-
_ignore?: Ignore;
|
|
797
|
-
hooks: Hookable<SilgiRuntimeHooks & DefaultHooks>;
|
|
798
|
-
hook: Silgi['hooks']['hook'];
|
|
799
|
-
callHook: Silgi['hooks']['callHook'];
|
|
800
|
-
addHooks: Silgi['hooks']['addHooks'];
|
|
801
|
-
ready: () => Promise<void>;
|
|
802
|
-
close: () => Promise<void>;
|
|
803
|
-
logger: ConsolaInstance;
|
|
804
|
-
storage: Storage;
|
|
805
|
-
envOptions: EnvOptions;
|
|
806
|
-
options: SilgiOptions & SilgiRuntimeOptions;
|
|
807
|
-
captureError: CaptureError;
|
|
808
|
-
websocket?: WebSocketOptions;
|
|
809
|
-
}
|
|
810
|
-
interface SilgiConfig extends Partial<Omit<Silgi, 'options'>>, Partial<SilgiRuntimeOptions> {
|
|
811
|
-
options: DeepPartial<SilgiOptions>;
|
|
812
|
-
}
|
|
813
|
-
interface BuildSilgi {
|
|
814
|
-
framework?: {
|
|
815
|
-
nitro?: NitroApp;
|
|
816
|
-
};
|
|
817
|
-
modules?: Partial<SilgiRuntimeOptions>;
|
|
818
|
-
options?: Partial<SilgiOptions>;
|
|
819
|
-
}
|
|
820
|
-
type CustomRequestInit<Schema extends SilgiSchema = SilgiSchema, Method extends RouteEntry<Schema>['method'] = RouteEntry<Schema>['method'], Path extends Extract<RouteEntry<Schema>, {
|
|
821
|
-
method: Method;
|
|
822
|
-
}>['path'] = Extract<RouteEntry<Schema>, {
|
|
823
|
-
method: Method;
|
|
824
|
-
}>['path'], _Resolved extends boolean = true, _HiddenParameters extends boolean = true> = Omit<RequestInit, 'body' | 'headers' | 'method'> & {
|
|
825
|
-
method: Method;
|
|
826
|
-
body?: `${Method}:${Path}` extends keyof Schema ? Schema[`${Method}:${Path}`] extends {
|
|
827
|
-
input?: infer I;
|
|
828
|
-
} ? I extends StandardSchemaV1 ? StandardSchemaV1.InferInput<I> : unknown : unknown : unknown;
|
|
829
|
-
headers?: `${Method}:${Path}` extends keyof Schema ? Schema[`${Method}:${Path}`] extends {
|
|
830
|
-
headers?: infer H;
|
|
831
|
-
} ? H extends StandardSchemaV1 ? StandardSchemaV1.InferInput<H> : unknown : unknown : unknown;
|
|
832
|
-
} & (`${Method}:${Path}` extends keyof Schema ? Schema[`${Method}:${Path}`] extends {
|
|
833
|
-
pathParams?: infer P;
|
|
834
|
-
} ? P extends StandardSchemaV1 ? {
|
|
835
|
-
pathParams: {
|
|
836
|
-
[K in keyof StandardSchemaV1.InferInput<P>]: StandardSchemaV1.InferInput<P>[K] extends string ? string | number : StandardSchemaV1.InferInput<P>[K];
|
|
837
|
-
};
|
|
838
|
-
} : {
|
|
839
|
-
pathParams?: unknown;
|
|
840
|
-
} : {
|
|
841
|
-
pathParams?: unknown;
|
|
842
|
-
} : {
|
|
843
|
-
pathParams?: unknown;
|
|
844
|
-
});
|
|
845
|
-
|
|
846
|
-
interface SilgiCommands {
|
|
847
|
-
}
|
|
848
|
-
interface Commands {
|
|
849
|
-
name: string;
|
|
850
|
-
description?: string;
|
|
851
|
-
group: string;
|
|
852
|
-
when?: boolean;
|
|
853
|
-
type: 'function' | 'command';
|
|
854
|
-
tags?: (keyof SilgiCommands)[] | (string | object)[];
|
|
855
|
-
getContents: (data: {
|
|
856
|
-
app: SilgiCLI;
|
|
857
|
-
}) => string;
|
|
858
|
-
order?: number;
|
|
859
|
-
}
|
|
860
|
-
interface GenImport {
|
|
861
|
-
specifier: string;
|
|
862
|
-
imports: ESMImport | ESMImport[];
|
|
863
|
-
options?: ESMCodeGenOptions;
|
|
864
|
-
}
|
|
865
|
-
type Framework<T extends PresetName> = T extends 'nitro' ? nitropack_types.NitroApp : T extends 'nuxt' ? nitropack_types.NitroApp : T extends 'h3' ? h3.Router : T extends 'next' ? next.NextApiHandler : never;
|
|
866
|
-
interface DefineFrameworkOptions<T extends PresetName> extends Omit<BuildSilgi, 'framework'> {
|
|
867
|
-
framework: Framework<T>;
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
interface SilgiCLIHooks extends SilgiHooks {
|
|
871
|
-
/**
|
|
872
|
-
* Called after Silgi initialization, when the Silgi instance is ready to work.
|
|
873
|
-
* @param silgi The configured Silgi object
|
|
874
|
-
* @returns Promise
|
|
875
|
-
*/
|
|
876
|
-
'ready': (silgi: SilgiCLI) => HookResult;
|
|
877
|
-
/**
|
|
878
|
-
* Called when silgi instance is gracefully closing.
|
|
879
|
-
* @param silgi The configured silgi object
|
|
880
|
-
* @returns Promise
|
|
881
|
-
*/
|
|
882
|
-
'close': (silgi: SilgiCLI) => HookResult;
|
|
883
|
-
'reload:scan': (path: string, stats?: Stats) => HookResult;
|
|
884
|
-
/**
|
|
885
|
-
* Allows extending compatibility checks.
|
|
886
|
-
* @param compatibility Compatibility object
|
|
887
|
-
* @param issues Issues to be mapped
|
|
888
|
-
* @returns Promise
|
|
889
|
-
*/
|
|
890
|
-
'kit:compatibility': (compatibility: SilgiCompatibility, issues: SilgiCompatibilityIssues) => HookResult;
|
|
891
|
-
/**
|
|
892
|
-
* Called before Nuxi writes `.nuxt/tsconfig.json` and `.nuxt/nuxt.d.ts`, allowing addition of custom references and declarations in `nuxt.d.ts`, or directly modifying the options in `tsconfig.json`
|
|
893
|
-
* @param options Objects containing `references`, `declarations`, `tsConfig`
|
|
894
|
-
* @returns Promise
|
|
895
|
-
*/
|
|
896
|
-
'prepare:types': (options: {
|
|
897
|
-
references: TSReference[];
|
|
898
|
-
declarations: string[];
|
|
899
|
-
tsConfig: TSConfig;
|
|
900
|
-
}) => HookResult;
|
|
901
|
-
'before:core.ts': (data: {
|
|
902
|
-
silgiConfigs: Record<string, any>[];
|
|
903
|
-
addImportItem: (data: GenImport | GenImport[]) => void;
|
|
904
|
-
addImportItemType: (data: GenImport | GenImport[]) => void;
|
|
905
|
-
addBuildFunction: (data: {
|
|
906
|
-
name: string;
|
|
907
|
-
params?: string[];
|
|
908
|
-
custom?: string;
|
|
909
|
-
where: 'before' | 'after';
|
|
910
|
-
}[] | {
|
|
911
|
-
name: string;
|
|
912
|
-
params?: string[];
|
|
913
|
-
custom?: string;
|
|
914
|
-
where: 'before' | 'after';
|
|
915
|
-
}) => void;
|
|
916
|
-
}) => HookResult;
|
|
917
|
-
'after:core.ts': (content: string[]) => HookResult;
|
|
918
|
-
'before:scan.ts': (data: {
|
|
919
|
-
services: string[];
|
|
920
|
-
shareds: string[];
|
|
921
|
-
resolvers: string[];
|
|
922
|
-
schemas: string[];
|
|
923
|
-
middlewares: string[];
|
|
924
|
-
addImportItem: (data: GenImport | GenImport[]) => void;
|
|
925
|
-
addImportItemType: (data: GenImport | GenImport[]) => void;
|
|
926
|
-
}) => HookResult;
|
|
927
|
-
'after:scan.ts': (content: string[]) => HookResult;
|
|
928
|
-
'before:schema.ts': (options: {
|
|
929
|
-
addImportItem: (data: GenImport | GenImport[]) => void;
|
|
930
|
-
addImportItemType: (data: GenImport | GenImport[]) => void;
|
|
931
|
-
options: {
|
|
932
|
-
key: string;
|
|
933
|
-
value: string;
|
|
934
|
-
}[];
|
|
935
|
-
runtimeOptions: {
|
|
936
|
-
key: string;
|
|
937
|
-
value: string;
|
|
938
|
-
}[];
|
|
939
|
-
resolvers: {
|
|
940
|
-
key: string;
|
|
941
|
-
value: string;
|
|
942
|
-
}[];
|
|
943
|
-
methods: {
|
|
944
|
-
key: string;
|
|
945
|
-
value: string;
|
|
946
|
-
}[];
|
|
947
|
-
contexts: {
|
|
948
|
-
key: string;
|
|
949
|
-
value: string;
|
|
950
|
-
}[];
|
|
951
|
-
setupModuleOption: {
|
|
952
|
-
key: string;
|
|
953
|
-
value: string;
|
|
954
|
-
}[];
|
|
955
|
-
shareds: {
|
|
956
|
-
key: string;
|
|
957
|
-
value: string;
|
|
958
|
-
}[];
|
|
959
|
-
routeRules: {
|
|
960
|
-
key: string;
|
|
961
|
-
value: string;
|
|
962
|
-
}[];
|
|
963
|
-
metaDatas: {
|
|
964
|
-
key: string;
|
|
965
|
-
value: string;
|
|
966
|
-
}[];
|
|
967
|
-
events: {
|
|
968
|
-
key: string;
|
|
969
|
-
value: string;
|
|
970
|
-
/**
|
|
971
|
-
* If extends is true, it won't be added to the key value interface.
|
|
972
|
-
* interface SilgiModuleEventsExtends extends SilgiEvent {}
|
|
973
|
-
*/
|
|
974
|
-
extends?: boolean;
|
|
975
|
-
isSilgiContext?: boolean;
|
|
976
|
-
}[];
|
|
977
|
-
hooks: {
|
|
978
|
-
key: string;
|
|
979
|
-
value: string;
|
|
980
|
-
}[];
|
|
981
|
-
runtimeHooks: {
|
|
982
|
-
key: string;
|
|
983
|
-
value: string;
|
|
984
|
-
}[];
|
|
985
|
-
}) => HookResult;
|
|
986
|
-
'after:schema.ts': (content: string[]) => HookResult;
|
|
987
|
-
'prepare:configs.ts': (cliOptions: Record<string, any>) => HookResult;
|
|
988
|
-
/**
|
|
989
|
-
* Called during `SilgiCLI` generation, to allow customizing, modifying or adding new files to the build directory (either virtually or to written to `.nuxt`).
|
|
990
|
-
* @param app The configured `SilgiCLI` object
|
|
991
|
-
* @returns Promise
|
|
992
|
-
*/
|
|
993
|
-
'app:templates': (app: SilgiCLI) => HookResult;
|
|
994
|
-
/**
|
|
995
|
-
* Called after templates are compiled into the [virtual file system](https://nuxt.com/docs/guide/directory-structure/nuxt#virtual-file-system) (vfs).
|
|
996
|
-
* @param app The configured `SilgiCLI` object
|
|
997
|
-
* @returns Promise
|
|
998
|
-
*/
|
|
999
|
-
'app:templatesGenerated': (app: SilgiCLI, templates: ResolvedSilgiTemplate[], options?: GenerateAppOptions) => HookResult;
|
|
1000
|
-
'prepare:commands': (commands: Commands[]) => HookResult;
|
|
1001
|
-
'nextjs:prepare': (data: {
|
|
1002
|
-
config: NextConfig;
|
|
1003
|
-
}) => HookResult;
|
|
1004
|
-
}
|
|
1005
|
-
type TSReference = {
|
|
1006
|
-
types: string;
|
|
1007
|
-
} | {
|
|
1008
|
-
path: string;
|
|
1009
|
-
};
|
|
1010
|
-
interface SilgiHooks {
|
|
1011
|
-
}
|
|
1012
|
-
interface GenerateAppOptions {
|
|
1013
|
-
filter?: (template: ResolvedSilgiTemplate<any>) => boolean;
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
interface DotenvOptions {
|
|
1017
|
-
/**
|
|
1018
|
-
* The project root directory (either absolute or relative to the current working directory).
|
|
1019
|
-
*/
|
|
1020
|
-
cwd: string;
|
|
1021
|
-
/**
|
|
1022
|
-
* What file to look in for environment variables (either absolute or relative
|
|
1023
|
-
* to the current working directory). For example, `.env`.
|
|
1024
|
-
*/
|
|
1025
|
-
fileName?: string;
|
|
1026
|
-
/**
|
|
1027
|
-
* Whether to interpolate variables within .env.
|
|
1028
|
-
*
|
|
1029
|
-
* @example
|
|
1030
|
-
* ```env
|
|
1031
|
-
* BASE_DIR="/test"
|
|
1032
|
-
* # resolves to "/test/further"
|
|
1033
|
-
* ANOTHER_DIR="${BASE_DIR}/further"
|
|
1034
|
-
* ```
|
|
1035
|
-
*/
|
|
1036
|
-
interpolate?: boolean;
|
|
1037
|
-
/**
|
|
1038
|
-
* An object describing environment variables (key, value pairs).
|
|
1039
|
-
*/
|
|
1040
|
-
env?: NodeJS.ProcessEnv;
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
type SilgiPreset = (SilgiCLIConfig & {
|
|
1044
|
-
_meta?: SilgiPresetMeta;
|
|
1045
|
-
}) | (() => SilgiCLIConfig & {
|
|
1046
|
-
_meta?: SilgiPresetMeta;
|
|
1047
|
-
});
|
|
1048
|
-
interface SilgiPresetMeta {
|
|
1049
|
-
url: string;
|
|
1050
|
-
name: string;
|
|
1051
|
-
stdName?: ProviderName;
|
|
1052
|
-
aliases?: string[];
|
|
1053
|
-
static?: boolean;
|
|
1054
|
-
compatibilityDate?: DateString;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
type Schema = 'zod' | 'valibot' | 'arkType' | 'typebox';
|
|
1058
|
-
/**
|
|
1059
|
-
* SilgiCLI normalized options (silgi.options)
|
|
1060
|
-
*/
|
|
1061
|
-
interface SilgiCLIOptions extends PresetOptions {
|
|
1062
|
-
_config: SilgiCLIConfig;
|
|
1063
|
-
_c12: ResolvedConfig<SilgiCLIConfig> | ConfigWatcher<SilgiCLIConfig>;
|
|
1064
|
-
package: {
|
|
1065
|
-
present: PresetName;
|
|
1066
|
-
name: string;
|
|
1067
|
-
};
|
|
1068
|
-
commandType: CommandType;
|
|
1069
|
-
commands: Commands[];
|
|
1070
|
-
schemaVendor: Schema | Schema[];
|
|
1071
|
-
environments: DotenvOptions[];
|
|
1072
|
-
activeEnvironment: 'prod' | 'docker' | 'staging' | 'testing' | '.env' | (string & {});
|
|
1073
|
-
envOptions: EnvOptions;
|
|
1074
|
-
runtimeConfig: SilgiRuntimeConfig;
|
|
1075
|
-
storages: string[];
|
|
1076
|
-
hooks: NestedHooks<SilgiCLIHooks>;
|
|
1077
|
-
plugins: {
|
|
1078
|
-
path: string;
|
|
1079
|
-
packageImport: string;
|
|
1080
|
-
}[];
|
|
1081
|
-
baseURL: string;
|
|
1082
|
-
compatibilityDate: CompatibilityDates;
|
|
1083
|
-
modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
1084
|
-
_modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
1085
|
-
isPreparingModules: boolean;
|
|
1086
|
-
debug: true | {
|
|
1087
|
-
command?: boolean;
|
|
1088
|
-
install?: boolean;
|
|
1089
|
-
};
|
|
1090
|
-
preset: PresetName;
|
|
1091
|
-
static: boolean;
|
|
1092
|
-
logLevel: LogLevel;
|
|
1093
|
-
appConfig: AppConfig;
|
|
1094
|
-
appConfigFiles: string[];
|
|
1095
|
-
codegen: {
|
|
1096
|
-
env: {
|
|
1097
|
-
safeList: string[][];
|
|
1098
|
-
};
|
|
1099
|
-
};
|
|
1100
|
-
storage: StorageMounts;
|
|
1101
|
-
devStorage: StorageMounts;
|
|
1102
|
-
workspaceDir: string;
|
|
1103
|
-
rootDir: string;
|
|
1104
|
-
srcDir: string;
|
|
1105
|
-
migrationDir: string;
|
|
1106
|
-
scanDirs: string[];
|
|
1107
|
-
build: {
|
|
1108
|
-
dir: string;
|
|
1109
|
-
typesDir: string;
|
|
1110
|
-
/**
|
|
1111
|
-
* It is recommended to use `addTemplate` from `@nuxt/kit` instead of this option.
|
|
1112
|
-
*
|
|
1113
|
-
*
|
|
1114
|
-
* @example
|
|
1115
|
-
* ```js
|
|
1116
|
-
* templates: [
|
|
1117
|
-
* {
|
|
1118
|
-
* src: '~/modules/support/plugin.js', // `src` can be absolute or relative
|
|
1119
|
-
* dst: 'support.js', // `dst` is relative to project `.nuxt` dir
|
|
1120
|
-
* }
|
|
1121
|
-
* ]
|
|
1122
|
-
* ```
|
|
1123
|
-
*/
|
|
1124
|
-
templates: SilgiTemplate<any>[];
|
|
1125
|
-
};
|
|
1126
|
-
modulesDir: string[];
|
|
1127
|
-
output: {
|
|
1128
|
-
dir: string;
|
|
1129
|
-
serverDir: string;
|
|
1130
|
-
publicDir: string;
|
|
1131
|
-
};
|
|
1132
|
-
serverDir: string;
|
|
1133
|
-
clientDir: string;
|
|
1134
|
-
silgi: {
|
|
1135
|
-
/**
|
|
1136
|
-
* @default "{serverDir}/silgi"
|
|
1137
|
-
*/
|
|
1138
|
-
serverDir: string;
|
|
1139
|
-
clientDir: string;
|
|
1140
|
-
/**
|
|
1141
|
-
* @default "{serverDir}/public"
|
|
1142
|
-
*/
|
|
1143
|
-
publicDir: string;
|
|
1144
|
-
/**
|
|
1145
|
-
* @default "{silgi.serverDir}/utils"
|
|
1146
|
-
*/
|
|
1147
|
-
utilsDir: string;
|
|
1148
|
-
/**
|
|
1149
|
-
* @default "{silgi.serverDir}/types"
|
|
1150
|
-
*/
|
|
1151
|
-
typesDir: string;
|
|
1152
|
-
/**
|
|
1153
|
-
* @default "{silgi.serverDir}/vfs"
|
|
1154
|
-
*/
|
|
1155
|
-
vfsDir: string;
|
|
1156
|
-
};
|
|
1157
|
-
imports: UnimportPluginOptions | false;
|
|
1158
|
-
watchOptions: ChokidarOptions;
|
|
1159
|
-
nodeModulesDirs: string[];
|
|
1160
|
-
devServer: {
|
|
1161
|
-
watch: string[];
|
|
1162
|
-
};
|
|
1163
|
-
framework: SilgiFrameworkInfo;
|
|
1164
|
-
/**
|
|
1165
|
-
* More customizable than `ignorePrefix`: all files matching glob patterns specified inside the `ignore` array will be ignored in building.
|
|
1166
|
-
*
|
|
1167
|
-
* @default ["**\/*.stories.{js,cts,mts,ts,jsx,tsx}","**\/*.{spec,test}.{js,cts,mts,ts,jsx,tsx}","**\/*.d.{cts,mts,ts}","**\/.{pnpm-store,vercel,netlify,output,git,cache,data}",".nuxt/analyze",".nuxt","**\/-*.*"]
|
|
1168
|
-
*/
|
|
1169
|
-
ignore: Array<string>;
|
|
1170
|
-
/**
|
|
1171
|
-
* Whether Nuxt is running in development mode.
|
|
1172
|
-
*
|
|
1173
|
-
* Normally, you should not need to set this.
|
|
1174
|
-
*
|
|
1175
|
-
* @default false
|
|
1176
|
-
*/
|
|
1177
|
-
dev: boolean;
|
|
1178
|
-
/**
|
|
1179
|
-
* jiti with stub mode
|
|
1180
|
-
* @default false
|
|
1181
|
-
*/
|
|
1182
|
-
stub: boolean;
|
|
1183
|
-
/**
|
|
1184
|
-
* Whether your app is being unit tested.
|
|
1185
|
-
*
|
|
1186
|
-
* @default false
|
|
1187
|
-
*/
|
|
1188
|
-
test: boolean;
|
|
1189
|
-
extensions: string[];
|
|
1190
|
-
future: {
|
|
1191
|
-
/**
|
|
1192
|
-
* This enables 'Bundler' module resolution mode for TypeScript, which is the recommended setting for frameworks like Nuxt and Vite.
|
|
1193
|
-
*
|
|
1194
|
-
* It improves type support when using modern libraries with `exports`.
|
|
1195
|
-
* You can set it to false to use the legacy 'Node' mode, which is the default for TypeScript.
|
|
1196
|
-
*
|
|
1197
|
-
* @default true
|
|
1198
|
-
*
|
|
1199
|
-
* @see [TypeScript PR implementing `bundler` module resolution](https://github.com/microsoft/TypeScript/pull/51669)
|
|
1200
|
-
*/
|
|
1201
|
-
typescriptBundlerResolution: boolean;
|
|
1202
|
-
};
|
|
1203
|
-
typescript: {
|
|
1204
|
-
/**
|
|
1205
|
-
* Modules to generate deep aliases for within `compilerOptions.paths`. This does not yet support subpaths. It may be necessary when using Nuxt within a pnpm monorepo with `shamefully-hoist=false`.
|
|
1206
|
-
*
|
|
1207
|
-
* @default ["nitro/types","nitro/runtime","defu","h3","consola","ofetch","@unhead/vue","@nuxt/devtools","vue","@vue/runtime-core","@vue/compiler-sfc","vue-router","vue-router/auto-routes","unplugin-vue-router/client","@nuxt/schema","nuxt"]
|
|
1208
|
-
*/
|
|
1209
|
-
hoist: Array<string>;
|
|
1210
|
-
/**
|
|
1211
|
-
* Include parent workspace in the Nuxt project. Mostly useful for themes and module authors.
|
|
1212
|
-
*
|
|
1213
|
-
* @default false
|
|
1214
|
-
*/
|
|
1215
|
-
includeWorkspace: boolean;
|
|
1216
|
-
/**
|
|
1217
|
-
* Enable build-time type checking.
|
|
1218
|
-
*
|
|
1219
|
-
* If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. Requires to install `typescript` and `vue-tsc` as dev dependencies.
|
|
1220
|
-
*
|
|
1221
|
-
* @default false
|
|
1222
|
-
*
|
|
1223
|
-
* @see [Nuxt TypeScript docs](https://nuxt.com/docs/guide/concepts/typescript)
|
|
1224
|
-
*/
|
|
1225
|
-
typeCheck: boolean | 'build';
|
|
1226
|
-
/**
|
|
1227
|
-
* You can extend generated `.nuxt/tsconfig.json` using this option.
|
|
1228
|
-
*
|
|
1229
|
-
*/
|
|
1230
|
-
tsConfig: TSConfig;
|
|
1231
|
-
/**
|
|
1232
|
-
* Generate a `*.vue` shim.
|
|
1233
|
-
*
|
|
1234
|
-
* We recommend instead letting the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar) generate accurate types for your components.
|
|
1235
|
-
* Note that you may wish to set this to `true` if you are using other libraries, such as ESLint, that are unable to understand the type of `.vue` files.
|
|
1236
|
-
*
|
|
1237
|
-
* @default false
|
|
1238
|
-
*/
|
|
1239
|
-
shim: boolean;
|
|
1240
|
-
/**
|
|
1241
|
-
* @default "types/silgi.tsconfig.json"
|
|
1242
|
-
*/
|
|
1243
|
-
tsconfigPath: string;
|
|
1244
|
-
/**
|
|
1245
|
-
* @default true
|
|
1246
|
-
*/
|
|
1247
|
-
generateTsConfig: boolean;
|
|
1248
|
-
/**
|
|
1249
|
-
* @default ['silgiTypes']
|
|
1250
|
-
*/
|
|
1251
|
-
customConditions: string[];
|
|
1252
|
-
/**
|
|
1253
|
-
* Enable generating runtime configuration types.
|
|
1254
|
-
*
|
|
1255
|
-
* @default true
|
|
1256
|
-
*/
|
|
1257
|
-
generateRuntimeConfigTypes: boolean;
|
|
1258
|
-
/**
|
|
1259
|
-
* @default false
|
|
1260
|
-
* Behavior of import paths in auto-generated silgi files
|
|
1261
|
-
*/
|
|
1262
|
-
removeFileExtension: boolean;
|
|
1263
|
-
};
|
|
1264
|
-
alias: Record<string, string>;
|
|
1265
|
-
/**
|
|
1266
|
-
* @default ['silgi']
|
|
1267
|
-
*/
|
|
1268
|
-
conditions: string[];
|
|
1269
|
-
/**
|
|
1270
|
-
* Pass options directly to `node-ignore` (which is used by Nuxt to ignore files).
|
|
1271
|
-
*
|
|
1272
|
-
*
|
|
1273
|
-
* @see [node-ignore](https://github.com/kaelzhang/node-ignore)
|
|
1274
|
-
*
|
|
1275
|
-
* @example
|
|
1276
|
-
* ```js
|
|
1277
|
-
* ignoreOptions: {
|
|
1278
|
-
* ignorecase: false
|
|
1279
|
-
* }
|
|
1280
|
-
* ```
|
|
1281
|
-
*/
|
|
1282
|
-
ignoreOptions: Options;
|
|
1283
|
-
installPackages: Record<'dependencies' | 'devDependencies', Record<string, string>>;
|
|
1284
|
-
apiFul: ApifulConfig;
|
|
1285
|
-
adapters: Record<string, Adapter<Record<string, any>, TablesSchema, InferModelTypes<TablesSchema>> | ((silgi: SilgiCLI) => Adapter<Record<string, any>, TablesSchema, InferModelTypes<TablesSchema>>) | ((silgi: SilgiCLI) => Promise<Adapter<Record<string, any>, TablesSchema, InferModelTypes<TablesSchema>>>)>;
|
|
1286
|
-
}
|
|
1287
|
-
/**
|
|
1288
|
-
* Silgi input config (silgi.config)
|
|
1289
|
-
*/
|
|
1290
|
-
interface SilgiCLIConfig extends DeepPartial<Omit<SilgiCLIOptions, 'preset' | 'compatibilityDate' | '_config' | '_c12' | 'consola'>>, C12InputConfig<SilgiCLIConfig>, Partial<SilgiModuleOptions> {
|
|
1291
|
-
preset?: PresetNameInput;
|
|
1292
|
-
extends?: string | string[] | SilgiPreset;
|
|
1293
|
-
compatibilityDate?: CompatibilityDateSpec;
|
|
1294
|
-
}
|
|
1295
|
-
interface AppConfig {
|
|
1296
|
-
[key: string]: any;
|
|
1297
|
-
}
|
|
1298
|
-
interface LoadConfigOptions {
|
|
1299
|
-
watch?: boolean;
|
|
1300
|
-
c12?: WatchConfigOptions;
|
|
1301
|
-
compatibilityDate?: CompatibilityDateSpec;
|
|
1302
|
-
consola?: ConsolaInstance;
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
export { StandardSchemaV1 };
|
|
1306
|
-
export type { AllPaths, AllPrefixes, AppConfig, Awaitable, BaseMethodSchema, BuildSilgi, CaptureError, CapturedErrorContext, CommandType, Commands, CreateMiddlewareParams, CustomRequestInit, DeepPartial, DeepRequired, DefaultHooks, DefineFrameworkOptions, DotenvOptions, EnvOptions, EventHandlerResponse, EventProtocol, ExtendContext, ExtendShared, ExtractNamespace, ExtractPathParamKeys, ExtractPathParams, ExtractPrefix, ExtractRoute, GenImport, GenerateAppOptions, HTTPMethod, HasPathParams, HookResult, LoadConfigOptions, Max4Slashes, MergeAll, MergeRouteRules, MergedSilgiSchema, MetaData, MethodSchemas, MiddlewareHandler, MiddlewarePath, MiddlewareSetup, ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, NamespacesForPrefix, NitroBuildInfo, RequiredServiceType, ResolvedMiddlewareDefinition, ResolvedModuleMeta, ResolvedModuleOptions, ResolvedSchema, ResolvedSchemaDefinition, ResolvedServiceDefinition, ResolvedSilgiTemplate, ResolvedWebSocketServiceDefinition, Resolvers, RouteEntry, RouteRules, RouterParams, Routers, RoutesForPrefixAndNamespace, ScanFile, Schema, ServiceHandler, ServiceHandlerInput, ServiceSetup, ServicesObject, SetupModuleOption, Silgi, SilgiAppPlugin, SilgiCLI, SilgiCLIConfig, SilgiCLIHooks, SilgiCLIOptions, SilgiCommands, SilgiCompatibility, SilgiCompatibilityIssue, SilgiCompatibilityIssues, SilgiConfig, SilgiEvent, SilgiFetchClient, SilgiFetchOptions, SilgiFrameworkInfo, SilgiHooks, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiOptions, SilgiPreset, SilgiPresetMeta, SilgiRoute, SilgiRouterTypes, SilgiRuntimeConfig, SilgiRuntimeContext, SilgiRuntimeDefaultConfig, SilgiRuntimeHooks, SilgiRuntimeMethods, SilgiRuntimeOptions, SilgiRuntimeShareds, SilgiRuntimeSharedsExtend, SilgiSchema, SilgiStorageBase, SilgiTemplate, SilgiURL, StandardHTTPMethod, StorageConfig, StorageKeyGenerator, StorageKeyParams, StorageMounts, TSReference, TrimAfterFourSlashes, WebSocketOptions, WebSocketServiceSetup, WildcardVariants, WithPathParams };
|
|
1
|
+
import { SilgiCompatibilityIssue, SilgiCompatibilityIssues } from "./compatibility.mjs";
|
|
2
|
+
import { EnvOptions, EventHandlerResponse, HookResult, MergeAll, RequiredServiceType } from "./helper.mjs";
|
|
3
|
+
import { Awaitable, CommandType, DeepPartial, DeepRequired, DefaultHooks, SilgiRouterTypes, SilgiRuntimeMethods } from "./global.mjs";
|
|
4
|
+
import { EventProtocol, ExtendContext, SilgiEvent, SilgiRuntimeContext } from "./event.mjs";
|
|
5
|
+
import { AllPrefixes, ExtractNamespace, ExtractPathParamKeys, ExtractPrefix, ExtractRoute, MergeRouteRules, NamespacesForPrefix, Resolvers, RouteRules, Routers, RoutesForPrefixAndNamespace } from "./route.mjs";
|
|
6
|
+
import { SilgiStorageBase, StorageConfig, StorageKeyGenerator, StorageKeyParams, StorageMounts } from "./storage.mjs";
|
|
7
|
+
import { ExtendShared, SilgiRuntimeShareds, SilgiRuntimeSharedsExtend } from "./shared.mjs";
|
|
8
|
+
import { StandardSchemaV1 } from "./standard-schema.mjs";
|
|
9
|
+
import { Max4Slashes, ResolvedServiceDefinition, ResolvedWebSocketServiceDefinition, ServiceHandler, ServiceHandlerInput, ServiceSetup, ServicesObject, SilgiURL, WebSocketOptions, WebSocketServiceSetup } from "./service.mjs";
|
|
10
|
+
import { NitroBuildInfo, ResolvedSilgiTemplate, ScanFile, SilgiCLI, SilgiFrameworkInfo, SilgiTemplate } from "./silgiCLI.mjs";
|
|
11
|
+
import { ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, ResolvedModuleMeta, ResolvedModuleOptions, SetupModuleOption, SilgiCompatibility, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiRuntimeOptions } from "./module.mjs";
|
|
12
|
+
import { CreateMiddlewareParams, MiddlewareHandler, MiddlewarePath, MiddlewareSetup, ResolvedMiddlewareDefinition, WildcardVariants } from "./middleware.mjs";
|
|
13
|
+
import { AllPaths, ExtractPathParams, TrimAfterFourSlashes } from "./runtime/nuxt.mjs";
|
|
14
|
+
import { RouterParams, SilgiFetchClient, SilgiFetchOptions } from "./runtime/ofetch.mjs";
|
|
15
|
+
import { SilgiAppPlugin } from "./runtime/plugin.mjs";
|
|
16
|
+
import { CaptureError, CapturedErrorContext } from "./runtime/silgi.mjs";
|
|
17
|
+
import { SilgiRuntimeHooks } from "./hooks.mjs";
|
|
18
|
+
import { SilgiOptions, SilgiRuntimeConfig, SilgiRuntimeDefaultConfig } from "./config.mjs";
|
|
19
|
+
import { BaseMethodSchema, HasPathParams, MergedSilgiSchema, MethodSchemas, ResolvedSchema, ResolvedSchemaDefinition, RouteEntry, SilgiSchema, WithPathParams } from "./schema.mjs";
|
|
20
|
+
import { BuildSilgi, HTTPMethod, MetaData, Silgi, SilgiConfig, SilgiRoute, StandardHTTPMethod } from "./silgi.mjs";
|
|
21
|
+
import { Commands, DefineFrameworkOptions, GenImport, SilgiCommands } from "./kits.mjs";
|
|
22
|
+
import { GenerateAppOptions, SilgiCLIHooks, SilgiHooks, TSReference } from "./cliHooks.mjs";
|
|
23
|
+
import { DotenvOptions } from "./dotenv.mjs";
|
|
24
|
+
import { SilgiPreset, SilgiPresetMeta } from "./preset.mjs";
|
|
25
|
+
import { AppConfig, LoadConfigOptions, Schema, SilgiCLIConfig, SilgiCLIOptions } from "./cliConfig.mjs";
|
|
26
|
+
export { AllPaths, AllPrefixes, AppConfig, Awaitable, BaseMethodSchema, BuildSilgi, CaptureError, CapturedErrorContext, CommandType, Commands, CreateMiddlewareParams, DeepPartial, DeepRequired, DefaultHooks, DefineFrameworkOptions, DotenvOptions, EnvOptions, EventHandlerResponse, EventProtocol, ExtendContext, ExtendShared, ExtractNamespace, ExtractPathParamKeys, ExtractPathParams, ExtractPrefix, ExtractRoute, GenImport, GenerateAppOptions, HTTPMethod, HasPathParams, HookResult, LoadConfigOptions, Max4Slashes, MergeAll, MergeRouteRules, MergedSilgiSchema, MetaData, MethodSchemas, MiddlewareHandler, MiddlewarePath, MiddlewareSetup, ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, NamespacesForPrefix, NitroBuildInfo, RequiredServiceType, ResolvedMiddlewareDefinition, ResolvedModuleMeta, ResolvedModuleOptions, ResolvedSchema, ResolvedSchemaDefinition, ResolvedServiceDefinition, ResolvedSilgiTemplate, ResolvedWebSocketServiceDefinition, Resolvers, RouteEntry, RouteRules, RouterParams, Routers, RoutesForPrefixAndNamespace, ScanFile, Schema, ServiceHandler, ServiceHandlerInput, ServiceSetup, ServicesObject, SetupModuleOption, Silgi, SilgiAppPlugin, SilgiCLI, SilgiCLIConfig, SilgiCLIHooks, SilgiCLIOptions, SilgiCommands, SilgiCompatibility, SilgiCompatibilityIssue, SilgiCompatibilityIssues, SilgiConfig, SilgiEvent, SilgiFetchClient, SilgiFetchOptions, SilgiFrameworkInfo, SilgiHooks, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiOptions, SilgiPreset, SilgiPresetMeta, SilgiRoute, SilgiRouterTypes, SilgiRuntimeConfig, SilgiRuntimeContext, SilgiRuntimeDefaultConfig, SilgiRuntimeHooks, SilgiRuntimeMethods, SilgiRuntimeOptions, SilgiRuntimeShareds, SilgiRuntimeSharedsExtend, SilgiSchema, SilgiStorageBase, SilgiTemplate, SilgiURL, StandardHTTPMethod, StandardSchemaV1, StorageConfig, StorageKeyGenerator, StorageKeyParams, StorageMounts, TSReference, TrimAfterFourSlashes, WebSocketOptions, WebSocketServiceSetup, WildcardVariants, WithPathParams };
|