silgi 0.4.12 → 0.5.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/_chunks/index.mjs +1 -1
- package/dist/cli/prepare.mjs +5 -0
- package/dist/core/index.d.mts +183 -36
- package/dist/core/index.d.ts +183 -36
- package/dist/core/index.mjs +308 -107
- package/dist/kit/index.d.mts +6 -3
- package/dist/kit/index.d.ts +6 -3
- package/dist/kit/index.mjs +24 -1
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/presets/_types.gen.d.ts +1 -1
- package/dist/runtime/internal/nitro.mjs +46 -35
- package/dist/shared/{silgi.yr8vHHvd.d.ts → silgi.CN_giHTc.d.mts} +67 -267
- package/dist/shared/{silgi.DQSwjP5u.d.mts → silgi.CN_giHTc.d.ts} +67 -267
- package/dist/shared/{silgi.40ZJYm8F.d.mts → silgi.DGmIWx95.d.mts} +2 -2
- package/dist/shared/{silgi.40ZJYm8F.d.ts → silgi.DGmIWx95.d.ts} +2 -2
- package/dist/types/index.d.mts +196 -9
- package/dist/types/index.d.ts +196 -9
- package/package.json +1 -1
|
@@ -1,44 +1,55 @@
|
|
|
1
|
-
import { createError, defineEventHandler, getQuery, readBody } from "h3";
|
|
1
|
+
import { createError, defineEventHandler, getQuery, H3Error, readBody, setResponseStatus } from "h3";
|
|
2
2
|
import { silgi, SilgiError, useSilgi } from "silgi/core";
|
|
3
3
|
export default async function addNitroApp(silgiCtx = useSilgi()) {
|
|
4
4
|
const nitro = silgiCtx.framework;
|
|
5
|
-
nitro.router.use("/srn/**", defineEventHandler({
|
|
6
|
-
|
|
5
|
+
nitro.router.use("/srn/**", defineEventHandler(async (event) => {
|
|
6
|
+
try {
|
|
7
7
|
const ctx = useSilgi();
|
|
8
|
-
if (ctx.options.environment
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (ctx.options.environment !== "nitrojs" && ctx.options.environment !== "h3") {
|
|
9
|
+
event.node.res.statusCode = 400;
|
|
10
|
+
return createError({
|
|
11
|
+
statusCode: 400,
|
|
12
|
+
statusMessage: "Bad Request"
|
|
12
13
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
}
|
|
15
|
+
const silgiConnect = silgi(event);
|
|
16
|
+
const query = getQuery(event);
|
|
17
|
+
const body = await readBody(event).catch(() => ({}));
|
|
18
|
+
let newPath = event.path;
|
|
19
|
+
if (event.path.includes("?")) {
|
|
20
|
+
newPath = `${event.path}&method=${event.method}`;
|
|
21
|
+
} else {
|
|
22
|
+
newPath = `${event.path}?method=${event.method}`;
|
|
23
|
+
}
|
|
24
|
+
const data = await silgiConnect.execute(newPath, {
|
|
25
|
+
...query,
|
|
26
|
+
...body
|
|
27
|
+
});
|
|
28
|
+
if (data) {
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
} catch (error) {
|
|
32
|
+
if (error instanceof H3Error) {
|
|
33
|
+
setResponseStatus(event, error.statusCode);
|
|
34
|
+
throw createError({
|
|
35
|
+
statusCode: error.statusCode,
|
|
36
|
+
message: error.message,
|
|
37
|
+
data: error.data
|
|
38
|
+
// unhandled: false,
|
|
39
|
+
// fatal: false,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (SilgiError.isError(error)) {
|
|
43
|
+
throw createError({
|
|
44
|
+
statusCode: error.httpStatus,
|
|
45
|
+
message: error.message,
|
|
46
|
+
data: {
|
|
47
|
+
code: error.code,
|
|
48
|
+
category: error.category,
|
|
49
|
+
severity: error.severity,
|
|
50
|
+
context: error.context
|
|
33
51
|
}
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
path: event.path,
|
|
38
|
-
method: event.method,
|
|
39
|
-
body,
|
|
40
|
-
query
|
|
41
|
-
};
|
|
52
|
+
});
|
|
42
53
|
}
|
|
43
54
|
}
|
|
44
55
|
}));
|
|
@@ -2,19 +2,18 @@ import { Defu } from 'defu';
|
|
|
2
2
|
import { TypeSource, IResolvers } from '@graphql-tools/utils';
|
|
3
3
|
import { TSConfig } from 'pkg-types';
|
|
4
4
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
5
|
-
import {
|
|
5
|
+
import { LogLevel, ConsolaInstance } from 'consola';
|
|
6
6
|
import { Hookable } from 'hookable';
|
|
7
|
-
import {
|
|
7
|
+
import { Options, Ignore } from 'ignore';
|
|
8
8
|
import { PresetOptions, PresetName, PresetNameInput } from 'silgi/presets';
|
|
9
|
-
import { StorageMounts
|
|
9
|
+
import { StorageMounts, SilgiFrameworkInfo as SilgiFrameworkInfo$1, ResolvedServiceType, SilgiDefaultShared, SilgiModules as SilgiModules$1, ModuleMeta as ModuleMeta$1 } from 'silgi/types';
|
|
10
10
|
import { Unimport } from 'unimport';
|
|
11
|
-
import {
|
|
11
|
+
import { Storage } from 'unstorage';
|
|
12
12
|
import { ResolvedConfig, ConfigWatcher, C12InputConfig, WatchConfigOptions } from 'c12';
|
|
13
13
|
import { ChokidarOptions } from 'chokidar';
|
|
14
14
|
import { DateString, CompatibilityDates, CompatibilityDateSpec } from 'compatx';
|
|
15
15
|
import { UnimportPluginOptions } from 'unimport/unplugin';
|
|
16
16
|
import { ProviderName } from 'std-env';
|
|
17
|
-
import { s as silgi, u as useStorage } from './silgi.40ZJYm8F.js';
|
|
18
17
|
|
|
19
18
|
type HookResult = Promise<void> | void;
|
|
20
19
|
|
|
@@ -29,12 +28,6 @@ interface SilgiCompatibilityIssues extends Array<SilgiCompatibilityIssue> {
|
|
|
29
28
|
toString: () => string;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
/**
|
|
33
|
-
* Bu nitrojs, h3 event or request context.
|
|
34
|
-
*/
|
|
35
|
-
interface SilgiEvent extends Record<string, unknown> {
|
|
36
|
-
}
|
|
37
|
-
|
|
38
31
|
interface SilgiSchema {
|
|
39
32
|
}
|
|
40
33
|
interface MergedSilgiSchema {
|
|
@@ -86,256 +79,6 @@ type ExtractInputFromURI<TURI extends keyof SilgiURIs> = GetInput<ExtractPath<TU
|
|
|
86
79
|
type ExtractOutputFromURI<TURI extends keyof SilgiURIs> = GetOutput<ExtractPath<TURI>>;
|
|
87
80
|
type ExtractRouterParamsFromURI<TURI extends keyof SilgiURIs> = GetRouterParams<ExtractPath<TURI>>;
|
|
88
81
|
|
|
89
|
-
/**
|
|
90
|
-
* @example
|
|
91
|
-
* namespace: 'coreApi'
|
|
92
|
-
* serviceName: 'basket'
|
|
93
|
-
* method: 'post'
|
|
94
|
-
* action: 'createBasket'
|
|
95
|
-
*/
|
|
96
|
-
interface SilgiOperation {
|
|
97
|
-
/**
|
|
98
|
-
* 'coreApi'
|
|
99
|
-
* 'storageApi'
|
|
100
|
-
*/
|
|
101
|
-
namespaceName: keyof DefaultNamespaces;
|
|
102
|
-
/**
|
|
103
|
-
* 'basket'
|
|
104
|
-
* 'user'
|
|
105
|
-
*/
|
|
106
|
-
serviceName: string;
|
|
107
|
-
/**
|
|
108
|
-
* 'post'
|
|
109
|
-
* 'delete'
|
|
110
|
-
*/
|
|
111
|
-
methodName: string;
|
|
112
|
-
/**
|
|
113
|
-
* 'createBasket'
|
|
114
|
-
* 'deleteUser'
|
|
115
|
-
*/
|
|
116
|
-
actionName: string;
|
|
117
|
-
/**
|
|
118
|
-
* 'coreApi/basket/post/createBasket'
|
|
119
|
-
*/
|
|
120
|
-
raw: string;
|
|
121
|
-
/**
|
|
122
|
-
* '/book/basket/getAllBaskets'
|
|
123
|
-
*/
|
|
124
|
-
uri: keyof SilgiURIs;
|
|
125
|
-
/**
|
|
126
|
-
* ['coreApi', 'book', 'basket', 'getAllBaskets']
|
|
127
|
-
*/
|
|
128
|
-
parts: string[];
|
|
129
|
-
/**
|
|
130
|
-
* {id: '123', name: 'John', bookId: '456', authorId: '789'}
|
|
131
|
-
*/
|
|
132
|
-
routerParams?: Record<string, string | undefined>;
|
|
133
|
-
/**
|
|
134
|
-
* url ?limit=10&page=1
|
|
135
|
-
* {limit: '10', page: '1'}
|
|
136
|
-
*/
|
|
137
|
-
query?: Record<string, string>;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
type CustomDriverName = string & {
|
|
141
|
-
_custom?: any;
|
|
142
|
-
};
|
|
143
|
-
interface StorageMounts {
|
|
144
|
-
[path: string]: {
|
|
145
|
-
driver: BuiltinDriverName | CustomDriverName;
|
|
146
|
-
[option: string]: any;
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
interface SilgiStorageBase {
|
|
150
|
-
}
|
|
151
|
-
type StorageKeyGenerator<TInput> = (input: TInput) => string | Promise<string>;
|
|
152
|
-
interface StorageConfig<TInput> {
|
|
153
|
-
options: TransactionOptions;
|
|
154
|
-
base: '/memory:cache' | keyof SilgiStorageBase;
|
|
155
|
-
key?: StorageKeyGenerator<TInput>;
|
|
156
|
-
scope?: 'request' | 'global';
|
|
157
|
-
}
|
|
158
|
-
interface StorageKeyParams<TInput = unknown> {
|
|
159
|
-
operation: SilgiOperation;
|
|
160
|
-
input: TInput;
|
|
161
|
-
requestId?: string;
|
|
162
|
-
keyGenerator?: StorageKeyGenerator<TInput>;
|
|
163
|
-
storageOptions?: Pick<StorageConfig<TInput>, 'base' | 'options' | 'scope'>;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
interface SilgiOptions {
|
|
167
|
-
consolaOptions?: Partial<ConsolaOptions>;
|
|
168
|
-
builder: 'nuxt' | 'nitrojs';
|
|
169
|
-
/**
|
|
170
|
-
* Set to `true` to enable debug mode.
|
|
171
|
-
*
|
|
172
|
-
* At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser.
|
|
173
|
-
*
|
|
174
|
-
* @default false
|
|
175
|
-
*/
|
|
176
|
-
debug: boolean;
|
|
177
|
-
storage: StorageMounts;
|
|
178
|
-
[key: string]: any;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
interface SilgiAppPlugin {
|
|
182
|
-
(silgi: Silgi): Promise<void> | void;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
interface CapturedErrorContext {
|
|
186
|
-
event?: SilgiEvent;
|
|
187
|
-
[key: string]: unknown;
|
|
188
|
-
}
|
|
189
|
-
type CaptureError = (error: Error, context: CapturedErrorContext) => void;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* The listeners to Silgi
|
|
193
|
-
*/
|
|
194
|
-
interface SilgiHooks {
|
|
195
|
-
/**
|
|
196
|
-
* Called after Silgi initialization, when the Silgi instance is ready to work.
|
|
197
|
-
* @param silgi The configured Silgi object
|
|
198
|
-
* @returns Promise
|
|
199
|
-
*/
|
|
200
|
-
'ready': (silgi: Silgi) => HookResult;
|
|
201
|
-
/**
|
|
202
|
-
* Called when silgi instance is gracefully closing.
|
|
203
|
-
* @param silgi The configured silgi object
|
|
204
|
-
* @returns Promise
|
|
205
|
-
*/
|
|
206
|
-
'close': (silgi: Silgi) => HookResult;
|
|
207
|
-
'app:setup:start': (silgi: Silgi) => HookResult;
|
|
208
|
-
'action:before': (context: ModuleHookContext) => HookResult;
|
|
209
|
-
'action:after': (context: ModuleHookContext) => HookResult;
|
|
210
|
-
'action:error': (context: ModuleHookContext) => HookResult;
|
|
211
|
-
'action:finally': (context: ModuleHookContext) => HookResult;
|
|
212
|
-
'event:before': (event: SilgiEvent) => HookResult;
|
|
213
|
-
'error': CaptureError;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
type SilgiServiceInterface<T extends BaseSchemaType<StandardSchemaV1>> = {
|
|
217
|
-
[Action in keyof T]: T[Action] extends Record<string, any> ? {
|
|
218
|
-
[Method in keyof T[Action]]: {
|
|
219
|
-
input: T[Action][Method]['input'];
|
|
220
|
-
output: T[Action][Method]['output'];
|
|
221
|
-
router: T[Action][Method]['router'];
|
|
222
|
-
};
|
|
223
|
-
} : never;
|
|
224
|
-
};
|
|
225
|
-
type ServiceType<T> = Partial<{
|
|
226
|
-
[Namespace in keyof T]: T[Namespace] extends Record<string, any> ? {
|
|
227
|
-
[Service in keyof T[Namespace]]?: MethodHandlerType<T[Namespace][Service]>;
|
|
228
|
-
} : never;
|
|
229
|
-
}>;
|
|
230
|
-
type RequiredServiceType<T> = {
|
|
231
|
-
[K in keyof T]-?: T[K] extends Record<string, any> ? {
|
|
232
|
-
[P in keyof T[K]]-?: MethodHandlerType<T[K][P]>;
|
|
233
|
-
} : never;
|
|
234
|
-
};
|
|
235
|
-
/**
|
|
236
|
-
* const test: ResolvedServiceType = {
|
|
237
|
-
aaa: {
|
|
238
|
-
bbb: {
|
|
239
|
-
delete: {
|
|
240
|
-
storage: {
|
|
241
|
-
handler: () => {}
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
}
|
|
247
|
-
*/
|
|
248
|
-
type ResolvedServiceType = {
|
|
249
|
-
[K in string]: {
|
|
250
|
-
[P in string]: {
|
|
251
|
-
[Q in BaseSilgiMethodType]?: {
|
|
252
|
-
[M in string]: ResolvedMethodHandlerType;
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
interface FrameworkContext {
|
|
259
|
-
}
|
|
260
|
-
interface Silgi {
|
|
261
|
-
schemas: any;
|
|
262
|
-
services: ResolvedServiceType;
|
|
263
|
-
shared: SilgiDefaultShared;
|
|
264
|
-
uris: Record<string, any>;
|
|
265
|
-
modulesURIs: Partial<Record<keyof SilgiModules, any>>;
|
|
266
|
-
scannedHandlers: Map<string, ResolvedMethodHandlerType>;
|
|
267
|
-
plugins: SilgiAppPlugin[];
|
|
268
|
-
framework: FrameworkContext;
|
|
269
|
-
_ignore?: Ignore;
|
|
270
|
-
hooks: Hookable<SilgiHooks & DefaultHooks>;
|
|
271
|
-
hook: Silgi['hooks']['hook'];
|
|
272
|
-
callHook: Silgi['hooks']['callHook'];
|
|
273
|
-
addHooks: Silgi['hooks']['addHooks'];
|
|
274
|
-
ready: () => Promise<void>;
|
|
275
|
-
close: () => Promise<void>;
|
|
276
|
-
logger: ConsolaInstance;
|
|
277
|
-
storage: Storage;
|
|
278
|
-
options: SilgiOptions & SilgiModuleOptions;
|
|
279
|
-
captureError: CaptureError;
|
|
280
|
-
}
|
|
281
|
-
interface SilgiConfig extends Pick<Silgi, 'services' | 'shared' | 'uris' | 'schemas' | 'modulesURIs' | 'plugins' | 'framework'>, Partial<SilgiModuleOptions> {
|
|
282
|
-
options: DeepPartial<SilgiOptions>;
|
|
283
|
-
}
|
|
284
|
-
type SilgiFunction = typeof silgi;
|
|
285
|
-
|
|
286
|
-
interface SilgiDefaultShared extends SilgiModuleShared {
|
|
287
|
-
storage: (...data: Parameters<typeof useStorage>) => ReturnType<typeof useStorage>;
|
|
288
|
-
silgi: SilgiFunction;
|
|
289
|
-
}
|
|
290
|
-
interface SilgiModuleShared {
|
|
291
|
-
}
|
|
292
|
-
interface ExtendShared {
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
interface MethodSchemaType<Input, Output> {
|
|
296
|
-
default: {
|
|
297
|
-
input?: Input;
|
|
298
|
-
output: Output;
|
|
299
|
-
};
|
|
300
|
-
handler: (input: Input, shared: SilgiDefaultShared, event: SilgiEvent) => Promise<Output>;
|
|
301
|
-
modules?: Partial<ModuleConfigurations>;
|
|
302
|
-
storage?: StorageConfig<Input>;
|
|
303
|
-
}
|
|
304
|
-
type EventHandlerResponse<T = undefined> = T extends undefined ? void : void | T | Promise<T>;
|
|
305
|
-
type MethodHandlerType<T> = {
|
|
306
|
-
[Action in keyof T]: T[Action] extends Record<string, any> ? {
|
|
307
|
-
[Method in keyof T[Action]]: {
|
|
308
|
-
default?: {
|
|
309
|
-
input?: StandardSchemaV1.InferInput<T[Action][Method]['input']>;
|
|
310
|
-
output?: StandardSchemaV1.InferInput<T[Action][Method]['output']>;
|
|
311
|
-
};
|
|
312
|
-
handler: (router: StandardSchemaV1.InferInput<T[Action][Method]['router']>, input: StandardSchemaV1.InferInput<T[Action][Method]['input']>, shared: SilgiDefaultShared, event: SilgiEvent) => EventHandlerResponse<StandardSchemaV1.InferOutput<T[Action][Method]['output']>>;
|
|
313
|
-
modules?: Partial<ModuleConfigurations>;
|
|
314
|
-
storage?: StorageConfig<T[Action][Method]['input']>;
|
|
315
|
-
};
|
|
316
|
-
} : never;
|
|
317
|
-
};
|
|
318
|
-
interface ResolvedMethodHandlerType {
|
|
319
|
-
input?: Partial<BaseSchemaType<any>>;
|
|
320
|
-
output: Partial<BaseSchemaType<any>>;
|
|
321
|
-
handler: (router: StandardSchemaV1.InferInput<any>, input: StandardSchemaV1.InferInput<any>, shared: SilgiDefaultShared, event: SilgiEvent) => Promise<StandardSchemaV1.InferInput<any>>;
|
|
322
|
-
modules?: Partial<ModuleConfigurations>;
|
|
323
|
-
storage?: StorageConfig<StandardSchemaV1.InferInput<any>>;
|
|
324
|
-
execute: (input: StandardSchemaV1.InferInput<any>, shared: SilgiDefaultShared, event: SilgiEvent) => Promise<StandardSchemaV1.InferInput<any>>;
|
|
325
|
-
}
|
|
326
|
-
type MethodResponse<T> = {
|
|
327
|
-
success: true;
|
|
328
|
-
data: T;
|
|
329
|
-
cached?: boolean;
|
|
330
|
-
} | {
|
|
331
|
-
success: false;
|
|
332
|
-
error: {
|
|
333
|
-
code: string;
|
|
334
|
-
message: string;
|
|
335
|
-
details?: Record<string, unknown>;
|
|
336
|
-
};
|
|
337
|
-
};
|
|
338
|
-
|
|
339
82
|
interface SilgiMethods {
|
|
340
83
|
}
|
|
341
84
|
interface SilgiNamespaces {
|
|
@@ -354,7 +97,7 @@ type DeepPartial<T> = T extends void ? T : T extends Record<string, any> ? {
|
|
|
354
97
|
} : T;
|
|
355
98
|
type Awaitable<T> = T | Promise<T>;
|
|
356
99
|
interface CreateScope {
|
|
357
|
-
execute: <TURI extends keyof SilgiURIs>(uriString: TURI, input: ExtractInputFromURI<TURI>) => Promise<
|
|
100
|
+
execute: <TURI extends keyof SilgiURIs>(uriString: TURI, input: ExtractInputFromURI<TURI>) => Promise<ExtractOutputFromURI<TURI>>;
|
|
358
101
|
}
|
|
359
102
|
|
|
360
103
|
type SilgiPreset = SilgiCLIConfig | (() => SilgiCLIConfig);
|
|
@@ -391,8 +134,8 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
391
134
|
logLevel: LogLevel;
|
|
392
135
|
appConfig: AppConfig;
|
|
393
136
|
appConfigFiles: string[];
|
|
394
|
-
storage: StorageMounts
|
|
395
|
-
devStorage: StorageMounts
|
|
137
|
+
storage: StorageMounts;
|
|
138
|
+
devStorage: StorageMounts;
|
|
396
139
|
workspaceDir: string;
|
|
397
140
|
rootDir: string;
|
|
398
141
|
srcDir: string;
|
|
@@ -574,8 +317,8 @@ interface ImportItem {
|
|
|
574
317
|
}
|
|
575
318
|
interface SilgiCLI {
|
|
576
319
|
_ignore?: Ignore;
|
|
577
|
-
services: ResolvedServiceType
|
|
578
|
-
shareds: SilgiDefaultShared
|
|
320
|
+
services: ResolvedServiceType;
|
|
321
|
+
shareds: SilgiDefaultShared;
|
|
579
322
|
uris: Record<string, any>;
|
|
580
323
|
schemas: Record<string, any>;
|
|
581
324
|
modulesURIs: Partial<Record<keyof SilgiModules$1, any>>;
|
|
@@ -721,6 +464,63 @@ interface SilgiCLIHooks {
|
|
|
721
464
|
}) => HookResult;
|
|
722
465
|
}
|
|
723
466
|
|
|
467
|
+
/**
|
|
468
|
+
* Bu nitrojs, h3 event or request context.
|
|
469
|
+
*/
|
|
470
|
+
interface SilgiEvent extends Record<string, unknown> {
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* @example
|
|
475
|
+
* namespace: 'coreApi'
|
|
476
|
+
* serviceName: 'basket'
|
|
477
|
+
* method: 'post'
|
|
478
|
+
* action: 'createBasket'
|
|
479
|
+
*/
|
|
480
|
+
interface SilgiOperation {
|
|
481
|
+
/**
|
|
482
|
+
* 'coreApi'
|
|
483
|
+
* 'storageApi'
|
|
484
|
+
*/
|
|
485
|
+
namespaceName: keyof DefaultNamespaces;
|
|
486
|
+
/**
|
|
487
|
+
* 'basket'
|
|
488
|
+
* 'user'
|
|
489
|
+
*/
|
|
490
|
+
serviceName: string;
|
|
491
|
+
/**
|
|
492
|
+
* 'post'
|
|
493
|
+
* 'delete'
|
|
494
|
+
*/
|
|
495
|
+
methodName: string;
|
|
496
|
+
/**
|
|
497
|
+
* 'createBasket'
|
|
498
|
+
* 'deleteUser'
|
|
499
|
+
*/
|
|
500
|
+
actionName: string;
|
|
501
|
+
/**
|
|
502
|
+
* 'coreApi/basket/post/createBasket'
|
|
503
|
+
*/
|
|
504
|
+
raw: string;
|
|
505
|
+
/**
|
|
506
|
+
* '/book/basket/getAllBaskets'
|
|
507
|
+
*/
|
|
508
|
+
uri: keyof SilgiURIs;
|
|
509
|
+
/**
|
|
510
|
+
* ['coreApi', 'book', 'basket', 'getAllBaskets']
|
|
511
|
+
*/
|
|
512
|
+
parts: string[];
|
|
513
|
+
/**
|
|
514
|
+
* {id: '123', name: 'John', bookId: '456', authorId: '789'}
|
|
515
|
+
*/
|
|
516
|
+
routerParams?: Record<string, string | undefined>;
|
|
517
|
+
/**
|
|
518
|
+
* url ?limit=10&page=1
|
|
519
|
+
* {limit: '10', page: '1'}
|
|
520
|
+
*/
|
|
521
|
+
query?: Record<string, string>;
|
|
522
|
+
}
|
|
523
|
+
|
|
724
524
|
interface SilgiModules {
|
|
725
525
|
}
|
|
726
526
|
interface SilgiModuleMethods {
|
|
@@ -831,4 +631,4 @@ interface SilgiModule<TOptions extends ModuleOptions = ModuleOptions, TOptionsDe
|
|
|
831
631
|
}
|
|
832
632
|
type ModuleConfigurations = SilgiModuleMethods;
|
|
833
633
|
|
|
834
|
-
export type {
|
|
634
|
+
export type { AppConfig as A, BaseSchemaType as B, CreateScope as C, DefaultHooks as D, ModuleSetupReturn as E, SilgiPreset as F, SilgiPresetMeta as G, HookResult as H, SilgiSchema as I, MergedSilgiSchema as J, ImportItem as K, LoadConfigOptions as L, ModuleOptions as M, SilgiCLI as N, SilgiCLIDynamicConfig as O, SilgiFrameworkInfo as P, NitroBuildInfo as Q, ResolvedModuleMeta as R, SilgiModule as S, TSReference as T, SilgiURIs as U, URIsTypes as V, ExtractInputFromURI as W, ExtractOutputFromURI as X, ExtractRouterParamsFromURI as Y, ModuleDefinition as a, SilgiOperation as b, SilgiEvent as c, ModuleConfigurations as d, BaseSilgiMethodType as e, SilgiModules as f, SilgiModuleOptions as g, DeepPartial as h, ModuleHookContext as i, DefaultNamespaces as j, SilgiCLIOptions as k, SilgiCLIConfig as l, SilgiCLIHooks as m, SilgiCompatibilityIssue as n, SilgiCompatibilityIssues as o, SilgiMethods as p, SilgiNamespaces as q, SilgiRouterTypes as r, SilgiHook as s, Awaitable as t, SilgiModuleMethods as u, SilgiModuleInput as v, SilgiCompatibility as w, ModuleMeta as x, ResolvedModuleOptions as y, ModuleSetupInstallResult as z };
|