@buildplease/apikit 1.0.2 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -4
- package/dist/cli/index.mjs +6 -6
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.d.cts +185 -263
- package/dist/src/index.d.mts +185 -263
- package/dist/src/index.mjs +1 -1
- package/dist/{src-node-test → src-test}/index.d.cts +2 -2
- package/dist/{src-node-test → src-test}/index.d.mts +2 -2
- package/package.json +7 -8
- /package/dist/{src-node-test → src-test}/index.cjs +0 -0
- /package/dist/{src-node-test → src-test}/index.mjs +0 -0
package/dist/src/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Assembly, Awaitable, JSONSerializable, ScopeController, UnitFormatterController } from "@buildplease/core";
|
|
3
|
+
import { BuildMetadata, ConfigDefinition, ConfigurationBinding, ConfigurationContract, ConfigurationInputFromSchema, ConfigurationSchema, EnvironmentConfig, EnvironmentRegistry, InferConfiguration, Logger, LoggerTransportOptions } from "@buildplease/core/node";
|
|
4
4
|
import { InitOptions, TOptions } from "i18next";
|
|
5
5
|
import fastifyCookie, { SerializeOptions } from "@fastify/cookie";
|
|
6
6
|
import { Readable } from "stream";
|
|
@@ -17,8 +17,8 @@ import fastifyView from "@fastify/view";
|
|
|
17
17
|
import { FastifyInstance, FastifyReply, FastifyRequest, FastifySchema, RouteOptions } from "fastify";
|
|
18
18
|
import { ZodType, z } from "zod";
|
|
19
19
|
import { IncomingHttpHeaders } from "http";
|
|
20
|
-
export * from "@buildplease/core/node";
|
|
21
20
|
export * from "@buildplease/core";
|
|
21
|
+
export * from "@buildplease/core/node";
|
|
22
22
|
//#region src/request/request-log-metadata.d.ts
|
|
23
23
|
declare class RequestLogMetadata {
|
|
24
24
|
private readonly metadata;
|
|
@@ -140,96 +140,9 @@ declare module 'fastify' {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
143
|
-
//#region src/configuration/core/build-metadata.d.ts
|
|
144
|
-
interface BuildMetadata {
|
|
145
|
-
readonly name: {
|
|
146
|
-
readonly original: string;
|
|
147
|
-
readonly base: string;
|
|
148
|
-
};
|
|
149
|
-
readonly version: string;
|
|
150
|
-
readonly id: string;
|
|
151
|
-
readonly createdAt: string;
|
|
152
|
-
}
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/configuration/core/field.d.ts
|
|
155
|
-
interface ConfigurationField<Output, Required extends boolean = true, Input = Output> {
|
|
156
|
-
readonly required: Required;
|
|
157
|
-
readonly hasDefault: boolean;
|
|
158
|
-
readonly defaultValue?: Output;
|
|
159
|
-
parse(value: unknown, path: string): Output;
|
|
160
|
-
optional(): ConfigurationField<Output | undefined, false, Input | undefined | null>;
|
|
161
|
-
default(value: Output): ConfigurationField<Output, false, Input>;
|
|
162
|
-
map<NextOutput>(transform: (value: Output) => NextOutput): ConfigurationField<NextOutput, Required, Input>;
|
|
163
|
-
}
|
|
164
|
-
declare const field: {
|
|
165
|
-
string(): ConfigurationField<string, true, string>;
|
|
166
|
-
number(): ConfigurationField<number, true, string | number>;
|
|
167
|
-
boolean(): ConfigurationField<boolean, true, string | boolean>;
|
|
168
|
-
array<Item, ItemInput>(item: ConfigurationField<Item, boolean, ItemInput>): ConfigurationField<readonly Item[], true, readonly ItemInput[]>;
|
|
169
|
-
custom<T>(): ConfigurationField<T, true, T>;
|
|
170
|
-
};
|
|
171
|
-
//#endregion
|
|
172
|
-
//#region src/configuration/core/environments.d.ts
|
|
173
|
-
interface EnvironmentDefinition {
|
|
174
|
-
readonly file: string;
|
|
175
|
-
readonly fileDir?: string;
|
|
176
|
-
}
|
|
177
|
-
interface EnvironmentConfig<Name extends string = string> {
|
|
178
|
-
readonly name: Name;
|
|
179
|
-
readonly file: string;
|
|
180
|
-
readonly fileDir: string;
|
|
181
|
-
}
|
|
182
|
-
type EnvironmentRegistry = Record<string, EnvironmentDefinition>;
|
|
183
|
-
declare function defineEnvironments<const Environments extends EnvironmentRegistry>(environments: Environments): Environments;
|
|
184
|
-
//#endregion
|
|
185
|
-
//#region src/configuration/core/source.d.ts
|
|
186
|
-
type ConfigurationSourceKind = 'env' | 'by-environment' | 'compute' | 'static';
|
|
187
|
-
interface ConfigurationResolveContext<EnvironmentName extends string = string> {
|
|
188
|
-
readonly environment: EnvironmentConfig<EnvironmentName>;
|
|
189
|
-
readonly buildMetadata: BuildMetadata;
|
|
190
|
-
}
|
|
191
|
-
interface ConfigurationSource<Output = unknown> {
|
|
192
|
-
readonly kind: ConfigurationSourceKind;
|
|
193
|
-
readonly options: unknown;
|
|
194
|
-
readonly transforms: readonly ConfigurationSourceTransform[];
|
|
195
|
-
map<NextOutput>(transform: (value: Output, context: ConfigurationResolveContext) => NextOutput | Promise<NextOutput>): ConfigurationSource<NextOutput>;
|
|
196
|
-
}
|
|
197
|
-
declare function defineSource<const Environments extends Record<string, unknown>>(_environments: Environments): {
|
|
198
|
-
env(name: string): ConfigurationSource<string>;
|
|
199
|
-
byEnvironment<const Cases extends { readonly [Key in keyof Environments & string]: unknown; }>(cases: Cases): ConfigurationSource<InferSourceOutput<Cases[keyof Environments & string]>>;
|
|
200
|
-
compute<Output>(compute: (context: ConfigurationResolveContext<keyof Environments & string>) => Output | Promise<Output>): ConfigurationSource<Output>;
|
|
201
|
-
static<Output>(value: Output): ConfigurationSource<Output>;
|
|
202
|
-
};
|
|
203
|
-
type ConfigurationSourceTransform = (value: unknown, context: ConfigurationResolveContext) => unknown | Promise<unknown>;
|
|
204
|
-
type InferSourceOutput<T> = T extends ConfigurationSource<infer Output> ? Output : T extends ((...args: any[]) => any) ? T : T extends readonly [unknown, ...unknown[]] ? { readonly [Key in keyof T]: InferSourceOutput<T[Key]>; } : T extends readonly (infer Item)[] ? readonly InferSourceOutput<Item>[] : T extends object ? { readonly [Key in keyof T]: InferSourceOutput<T[Key]>; } : T;
|
|
205
|
-
//#endregion
|
|
206
|
-
//#region src/configuration/core/configuration.d.ts
|
|
207
|
-
type ConfigurationSchema = ConfigurationField<any, boolean, any> | {
|
|
208
|
-
readonly [key: string]: ConfigurationSchema;
|
|
209
|
-
};
|
|
210
|
-
type InferSchemaOutput<Schema> = Schema extends ConfigurationField<infer Output, any, any> ? Output : Schema extends object ? { readonly [Key in keyof Schema]: InferSchemaOutput<Schema[Key]>; } : never;
|
|
211
|
-
type InferSchemaInput<Schema> = Schema extends ConfigurationField<any, any, infer Input> ? Input : Schema extends object ? { readonly [Key in RequiredSchemaKeys<Schema>]: InferSchemaInput<Schema[Key]>; } & { readonly [Key in OptionalSchemaKeys<Schema>]?: InferSchemaInput<Schema[Key]>; } : never;
|
|
212
|
-
type ConfigurationValueInput<T> = ConfigurationSource<T | undefined> | (T extends unknown ? ConfigurationValueInputValue<T> : never);
|
|
213
|
-
type ConfigurationInputFromSchema<Schema> = ConfigurationSource<InferSchemaInput<Schema> | undefined> | (Schema extends ConfigurationField<any, any, infer Input> ? ConfigurationValueInput<Input> : Schema extends object ? { readonly [Key in RequiredSchemaKeys<Schema>]: ConfigurationInputFromSchema<Schema[Key]>; } & { readonly [Key in OptionalSchemaKeys<Schema>]?: ConfigurationInputFromSchema<Schema[Key]>; } : never);
|
|
214
|
-
interface ConfigurationContract<Output, Schema extends ConfigurationSchema = ConfigurationSchema> {
|
|
215
|
-
readonly key: string;
|
|
216
|
-
readonly schema: Schema;
|
|
217
|
-
(input: ConfigurationInputFromSchema<Schema>): ConfigurationBinding<Output, Schema>;
|
|
218
|
-
}
|
|
219
|
-
interface ConfigurationBinding<Output = unknown, Schema extends ConfigurationSchema = ConfigurationSchema> {
|
|
220
|
-
readonly contract: ConfigurationContract<Output, Schema>;
|
|
221
|
-
readonly input: ConfigurationInputFromSchema<Schema>;
|
|
222
|
-
}
|
|
223
|
-
type InferConfiguration<Contract> = Contract extends ConfigurationContract<infer Output, any> ? Output : never;
|
|
224
|
-
declare function defineConfiguration<const Schema extends ConfigurationSchema>(key: string, schema: Schema): ConfigurationContract<InferSchemaOutput<Schema>, Schema>;
|
|
225
|
-
type ConfigurationValueInputValue<T> = T extends ((...args: any[]) => any) ? T : T extends readonly [unknown, ...unknown[]] ? { readonly [Key in keyof T]: ConfigurationValueInput<T[Key]>; } : T extends readonly (infer Item)[] ? readonly ConfigurationValueInput<Item>[] : T extends object ? { readonly [Key in keyof T]: ConfigurationValueInput<T[Key]>; } : T;
|
|
226
|
-
type IsSchemaInputRequired<Schema> = Schema extends ConfigurationField<any, infer Required, any> ? Required : Schema extends object ? RequiredSchemaKeys<Schema> extends never ? false : true : true;
|
|
227
|
-
type RequiredSchemaKeys<Schema extends object> = { [Key in keyof Schema]-?: IsSchemaInputRequired<Schema[Key]> extends true ? Key : never; }[keyof Schema];
|
|
228
|
-
type OptionalSchemaKeys<Schema extends object> = { [Key in keyof Schema]-?: IsSchemaInputRequired<Schema[Key]> extends true ? never : Key; }[keyof Schema];
|
|
229
|
-
//#endregion
|
|
230
143
|
//#region src/configuration/configs/basic-auth.d.ts
|
|
231
144
|
type BasicAuthAuthenticate = FastifyBasicAuthOptions['authenticate'];
|
|
232
|
-
declare const BasicAuthConfiguration: ConfigurationContract<{
|
|
145
|
+
declare const BasicAuthConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
233
146
|
readonly enabled: boolean;
|
|
234
147
|
readonly authenticate: boolean | {
|
|
235
148
|
realm?: string | ((req: import("fastify").FastifyRequest) => string);
|
|
@@ -241,47 +154,47 @@ declare const BasicAuthConfiguration: ConfigurationContract<{
|
|
|
241
154
|
readonly username: string | undefined;
|
|
242
155
|
readonly password: string | undefined;
|
|
243
156
|
}, {
|
|
244
|
-
readonly enabled: ConfigurationField<boolean, false, string | boolean>;
|
|
245
|
-
readonly authenticate: ConfigurationField<boolean | {
|
|
157
|
+
readonly enabled: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
158
|
+
readonly authenticate: import("@buildplease/core/node").ConfigurationField<boolean | {
|
|
246
159
|
realm?: string | ((req: import("fastify").FastifyRequest) => string);
|
|
247
160
|
header?: string;
|
|
248
161
|
} | undefined, false, boolean | {
|
|
249
162
|
realm?: string | ((req: import("fastify").FastifyRequest) => string);
|
|
250
163
|
header?: string;
|
|
251
164
|
} | undefined>;
|
|
252
|
-
readonly proxyMode: ConfigurationField<boolean, false, string | boolean>;
|
|
253
|
-
readonly header: ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
254
|
-
readonly strictCredentials: ConfigurationField<boolean | undefined, false, string | boolean | null | undefined>;
|
|
255
|
-
readonly username: ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
256
|
-
readonly password: ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
165
|
+
readonly proxyMode: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
166
|
+
readonly header: import("@buildplease/core/node").ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
167
|
+
readonly strictCredentials: import("@buildplease/core/node").ConfigurationField<boolean | undefined, false, string | boolean | null | undefined>;
|
|
168
|
+
readonly username: import("@buildplease/core/node").ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
169
|
+
readonly password: import("@buildplease/core/node").ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
257
170
|
}>;
|
|
258
171
|
type BasicAuthConfig = InferConfiguration<typeof BasicAuthConfiguration>;
|
|
259
172
|
//#endregion
|
|
260
173
|
//#region src/configuration/configs/build.d.ts
|
|
261
|
-
declare const BuildConfiguration: ConfigurationContract<{
|
|
174
|
+
declare const BuildConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
262
175
|
readonly outDir: string;
|
|
263
176
|
}, {
|
|
264
|
-
readonly outDir: ConfigurationField<string, false, string>;
|
|
177
|
+
readonly outDir: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
265
178
|
}>;
|
|
266
179
|
type BuildConfig = InferConfiguration<typeof BuildConfiguration>;
|
|
267
180
|
//#endregion
|
|
268
181
|
//#region src/configuration/configs/cors.d.ts
|
|
269
182
|
type CorsOptions = FastifyCorsOptions;
|
|
270
|
-
declare const CorsConfiguration: ConfigurationContract<{
|
|
183
|
+
declare const CorsConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
271
184
|
readonly enabled: boolean;
|
|
272
185
|
readonly allowAllOrigins: boolean;
|
|
273
186
|
readonly includeWwwSubdomain: boolean;
|
|
274
187
|
readonly options: FastifyCorsOptions;
|
|
275
188
|
}, {
|
|
276
|
-
readonly enabled: ConfigurationField<boolean, false, string | boolean>;
|
|
277
|
-
readonly allowAllOrigins: ConfigurationField<boolean, false, string | boolean>;
|
|
278
|
-
readonly includeWwwSubdomain: ConfigurationField<boolean, false, string | boolean>;
|
|
279
|
-
readonly options: ConfigurationField<FastifyCorsOptions, false, FastifyCorsOptions>;
|
|
189
|
+
readonly enabled: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
190
|
+
readonly allowAllOrigins: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
191
|
+
readonly includeWwwSubdomain: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
192
|
+
readonly options: import("@buildplease/core/node").ConfigurationField<FastifyCorsOptions, false, FastifyCorsOptions>;
|
|
280
193
|
}>;
|
|
281
194
|
type CorsConfig = InferConfiguration<typeof CorsConfiguration>;
|
|
282
195
|
//#endregion
|
|
283
196
|
//#region src/configuration/configs/email.d.ts
|
|
284
|
-
declare const EmailConfiguration: ConfigurationContract<{
|
|
197
|
+
declare const EmailConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
285
198
|
readonly enabled: boolean;
|
|
286
199
|
readonly templatesPath: string;
|
|
287
200
|
readonly globals: Record<string, unknown>;
|
|
@@ -293,21 +206,21 @@ declare const EmailConfiguration: ConfigurationContract<{
|
|
|
293
206
|
readonly password: string | undefined;
|
|
294
207
|
};
|
|
295
208
|
}, {
|
|
296
|
-
readonly enabled: ConfigurationField<boolean, false, string | boolean>;
|
|
297
|
-
readonly templatesPath: ConfigurationField<string, false, string>;
|
|
298
|
-
readonly globals: ConfigurationField<Record<string, unknown>, false, Record<string, unknown>>;
|
|
209
|
+
readonly enabled: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
210
|
+
readonly templatesPath: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
211
|
+
readonly globals: import("@buildplease/core/node").ConfigurationField<Record<string, unknown>, false, Record<string, unknown>>;
|
|
299
212
|
readonly smtp: {
|
|
300
|
-
readonly host: ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
301
|
-
readonly port: ConfigurationField<number | undefined, false, string | number | null | undefined>;
|
|
302
|
-
readonly secure: ConfigurationField<boolean | undefined, false, string | boolean | null | undefined>;
|
|
303
|
-
readonly user: ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
304
|
-
readonly password: ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
213
|
+
readonly host: import("@buildplease/core/node").ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
214
|
+
readonly port: import("@buildplease/core/node").ConfigurationField<number | undefined, false, string | number | null | undefined>;
|
|
215
|
+
readonly secure: import("@buildplease/core/node").ConfigurationField<boolean | undefined, false, string | boolean | null | undefined>;
|
|
216
|
+
readonly user: import("@buildplease/core/node").ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
217
|
+
readonly password: import("@buildplease/core/node").ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
305
218
|
};
|
|
306
219
|
}>;
|
|
307
220
|
type EmailConfig = InferConfiguration<typeof EmailConfiguration>;
|
|
308
221
|
//#endregion
|
|
309
222
|
//#region src/configuration/configs/health.d.ts
|
|
310
|
-
declare const HealthConfiguration: ConfigurationContract<{
|
|
223
|
+
declare const HealthConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
311
224
|
readonly enabled: boolean;
|
|
312
225
|
readonly url: string;
|
|
313
226
|
readonly pressure: {
|
|
@@ -317,13 +230,13 @@ declare const HealthConfiguration: ConfigurationContract<{
|
|
|
317
230
|
readonly maxEventLoopUtilization: number;
|
|
318
231
|
};
|
|
319
232
|
}, {
|
|
320
|
-
readonly enabled: ConfigurationField<boolean, false, string | boolean>;
|
|
321
|
-
readonly url: ConfigurationField<string, false, string>;
|
|
233
|
+
readonly enabled: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
234
|
+
readonly url: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
322
235
|
readonly pressure: {
|
|
323
|
-
readonly maxEventLoopDelay: ConfigurationField<number, false, string | number>;
|
|
324
|
-
readonly maxHeapUsedBytes: ConfigurationField<number, false, string | number>;
|
|
325
|
-
readonly maxRssBytes: ConfigurationField<number, false, string | number>;
|
|
326
|
-
readonly maxEventLoopUtilization: ConfigurationField<number, false, string | number>;
|
|
236
|
+
readonly maxEventLoopDelay: import("@buildplease/core/node").ConfigurationField<number, false, string | number>;
|
|
237
|
+
readonly maxHeapUsedBytes: import("@buildplease/core/node").ConfigurationField<number, false, string | number>;
|
|
238
|
+
readonly maxRssBytes: import("@buildplease/core/node").ConfigurationField<number, false, string | number>;
|
|
239
|
+
readonly maxEventLoopUtilization: import("@buildplease/core/node").ConfigurationField<number, false, string | number>;
|
|
327
240
|
};
|
|
328
241
|
}>;
|
|
329
242
|
type HealthConfig = InferConfiguration<typeof HealthConfiguration>;
|
|
@@ -342,7 +255,7 @@ type I18nInitOptions = InitOptions<object>;
|
|
|
342
255
|
type I18nFallbackLanguages = Extract<NonNullable<I18nInitOptions['fallbackLng']>, string | readonly string[]>;
|
|
343
256
|
type I18nLoadMode = NonNullable<I18nInitOptions['load']>;
|
|
344
257
|
type I18nPreload = NonNullable<I18nInitOptions['preload']>;
|
|
345
|
-
declare const I18nConfiguration: ConfigurationContract<{
|
|
258
|
+
declare const I18nConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
346
259
|
readonly resources: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
347
260
|
readonly directories: readonly I18nDirectoryEntry[];
|
|
348
261
|
readonly files: readonly I18nFileEntry[];
|
|
@@ -361,23 +274,23 @@ declare const I18nConfiguration: ConfigurationContract<{
|
|
|
361
274
|
readonly pluralSeparator: string;
|
|
362
275
|
readonly contextSeparator: string;
|
|
363
276
|
}, {
|
|
364
|
-
readonly resources: ConfigurationField<Readonly<Record<string, Readonly<Record<string, unknown>>>>, false, Readonly<Record<string, Readonly<Record<string, unknown>>>>>;
|
|
365
|
-
readonly directories: ConfigurationField<readonly I18nDirectoryEntry[], false, readonly I18nDirectoryEntry[]>;
|
|
366
|
-
readonly files: ConfigurationField<readonly I18nFileEntry[], false, readonly I18nFileEntry[]>;
|
|
367
|
-
readonly defaultLanguage: ConfigurationField<string, false, string>;
|
|
368
|
-
readonly fallbackLanguages: ConfigurationField<I18nFallbackLanguages, false, I18nFallbackLanguages>;
|
|
369
|
-
readonly supportedLanguages: ConfigurationField<readonly string[], false, readonly string[]>;
|
|
370
|
-
readonly load: ConfigurationField<I18nLoadMode, false, I18nLoadMode>;
|
|
371
|
-
readonly preload: ConfigurationField<I18nPreload, false, I18nPreload>;
|
|
372
|
-
readonly nonExplicitSupportedLngs: ConfigurationField<boolean, false, string | boolean>;
|
|
373
|
-
readonly lowerCaseLng: ConfigurationField<boolean, false, string | boolean>;
|
|
374
|
-
readonly cleanCode: ConfigurationField<boolean, false, string | boolean>;
|
|
375
|
-
readonly namespaces: ConfigurationField<readonly string[] | undefined, false, readonly string[] | null | undefined>;
|
|
376
|
-
readonly defaultNamespace: ConfigurationField<string, false, string>;
|
|
377
|
-
readonly keySeparator: ConfigurationField<string, false, string>;
|
|
378
|
-
readonly nsSeparator: ConfigurationField<string, false, string>;
|
|
379
|
-
readonly pluralSeparator: ConfigurationField<string, false, string>;
|
|
380
|
-
readonly contextSeparator: ConfigurationField<string, false, string>;
|
|
277
|
+
readonly resources: import("@buildplease/core/node").ConfigurationField<Readonly<Record<string, Readonly<Record<string, unknown>>>>, false, Readonly<Record<string, Readonly<Record<string, unknown>>>>>;
|
|
278
|
+
readonly directories: import("@buildplease/core/node").ConfigurationField<readonly I18nDirectoryEntry[], false, readonly I18nDirectoryEntry[]>;
|
|
279
|
+
readonly files: import("@buildplease/core/node").ConfigurationField<readonly I18nFileEntry[], false, readonly I18nFileEntry[]>;
|
|
280
|
+
readonly defaultLanguage: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
281
|
+
readonly fallbackLanguages: import("@buildplease/core/node").ConfigurationField<I18nFallbackLanguages, false, I18nFallbackLanguages>;
|
|
282
|
+
readonly supportedLanguages: import("@buildplease/core/node").ConfigurationField<readonly string[], false, readonly string[]>;
|
|
283
|
+
readonly load: import("@buildplease/core/node").ConfigurationField<I18nLoadMode, false, I18nLoadMode>;
|
|
284
|
+
readonly preload: import("@buildplease/core/node").ConfigurationField<I18nPreload, false, I18nPreload>;
|
|
285
|
+
readonly nonExplicitSupportedLngs: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
286
|
+
readonly lowerCaseLng: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
287
|
+
readonly cleanCode: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
288
|
+
readonly namespaces: import("@buildplease/core/node").ConfigurationField<readonly string[] | undefined, false, readonly string[] | null | undefined>;
|
|
289
|
+
readonly defaultNamespace: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
290
|
+
readonly keySeparator: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
291
|
+
readonly nsSeparator: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
292
|
+
readonly pluralSeparator: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
293
|
+
readonly contextSeparator: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
381
294
|
}>;
|
|
382
295
|
type I18nConfig = InferConfiguration<typeof I18nConfiguration>;
|
|
383
296
|
//#endregion
|
|
@@ -416,7 +329,7 @@ type LoggerConfigurationValue = {
|
|
|
416
329
|
readonly transports: readonly [LoggerTransportOptions, ...LoggerTransportOptions[]];
|
|
417
330
|
readonly request?: LoggerRequestOptions;
|
|
418
331
|
};
|
|
419
|
-
declare const LoggerConfiguration: ConfigurationContract<LoggerConfigurationValue, ConfigurationField<LoggerConfigurationValue, false, LoggerConfigurationValue>>;
|
|
332
|
+
declare const LoggerConfiguration: import("@buildplease/core/node").ConfigurationContract<LoggerConfigurationValue, import("@buildplease/core/node").ConfigurationField<LoggerConfigurationValue, false, LoggerConfigurationValue>>;
|
|
420
333
|
type LoggerConfig = InferConfiguration<typeof LoggerConfiguration>;
|
|
421
334
|
//#endregion
|
|
422
335
|
//#region src/configuration/configs/metrics.d.ts
|
|
@@ -435,7 +348,7 @@ interface MetricsRouteConfig {
|
|
|
435
348
|
readonly methodBlacklist?: readonly string[];
|
|
436
349
|
readonly invalidRouteGroup?: string;
|
|
437
350
|
}
|
|
438
|
-
declare const MetricsConfiguration: ConfigurationContract<{
|
|
351
|
+
declare const MetricsConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
439
352
|
readonly enabled: boolean;
|
|
440
353
|
readonly endpoint: MetricsEndpoint;
|
|
441
354
|
readonly name: string;
|
|
@@ -443,23 +356,23 @@ declare const MetricsConfiguration: ConfigurationContract<{
|
|
|
443
356
|
readonly routeMetrics: MetricsRouteConfig;
|
|
444
357
|
readonly clearRegisterOnInit: boolean;
|
|
445
358
|
}, {
|
|
446
|
-
readonly enabled: ConfigurationField<boolean, false, string | boolean>;
|
|
447
|
-
readonly endpoint: ConfigurationField<MetricsEndpoint, false, MetricsEndpoint>;
|
|
448
|
-
readonly name: ConfigurationField<string, false, string>;
|
|
449
|
-
readonly defaultMetrics: ConfigurationField<MetricsDefaultConfig, false, MetricsDefaultConfig>;
|
|
450
|
-
readonly routeMetrics: ConfigurationField<MetricsRouteConfig, false, MetricsRouteConfig>;
|
|
451
|
-
readonly clearRegisterOnInit: ConfigurationField<boolean, false, string | boolean>;
|
|
359
|
+
readonly enabled: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
360
|
+
readonly endpoint: import("@buildplease/core/node").ConfigurationField<MetricsEndpoint, false, MetricsEndpoint>;
|
|
361
|
+
readonly name: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
362
|
+
readonly defaultMetrics: import("@buildplease/core/node").ConfigurationField<MetricsDefaultConfig, false, MetricsDefaultConfig>;
|
|
363
|
+
readonly routeMetrics: import("@buildplease/core/node").ConfigurationField<MetricsRouteConfig, false, MetricsRouteConfig>;
|
|
364
|
+
readonly clearRegisterOnInit: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
452
365
|
}>;
|
|
453
366
|
type MetricsConfig = InferConfiguration<typeof MetricsConfiguration>;
|
|
454
367
|
//#endregion
|
|
455
368
|
//#region src/configuration/configs/multipart.d.ts
|
|
456
369
|
type MultipartOptions = FastifyMultipartBaseOptions | FastifyMultipartOptions | FastifyMultipartAttachFieldsToBodyOptions;
|
|
457
|
-
declare const MultipartConfiguration: ConfigurationContract<{
|
|
370
|
+
declare const MultipartConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
458
371
|
readonly enabled: boolean;
|
|
459
372
|
readonly options: MultipartOptions;
|
|
460
373
|
}, {
|
|
461
|
-
readonly enabled: ConfigurationField<boolean, false, string | boolean>;
|
|
462
|
-
readonly options: ConfigurationField<MultipartOptions, false, MultipartOptions>;
|
|
374
|
+
readonly enabled: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
375
|
+
readonly options: import("@buildplease/core/node").ConfigurationField<MultipartOptions, false, MultipartOptions>;
|
|
463
376
|
}>;
|
|
464
377
|
type MultipartConfig = InferConfiguration<typeof MultipartConfiguration>;
|
|
465
378
|
//#endregion
|
|
@@ -478,29 +391,29 @@ type NotificationConfigurationValue = {
|
|
|
478
391
|
readonly enabled: true;
|
|
479
392
|
readonly channels: NotificationChannelsConfig;
|
|
480
393
|
};
|
|
481
|
-
declare const NotificationConfiguration: ConfigurationContract<NotificationConfigurationValue, ConfigurationField<NotificationConfigurationValue, false, NotificationConfigurationValue>>;
|
|
394
|
+
declare const NotificationConfiguration: import("@buildplease/core/node").ConfigurationContract<NotificationConfigurationValue, import("@buildplease/core/node").ConfigurationField<NotificationConfigurationValue, false, NotificationConfigurationValue>>;
|
|
482
395
|
type NotificationConfig = InferConfiguration<typeof NotificationConfiguration>;
|
|
483
396
|
//#endregion
|
|
484
397
|
//#region src/configuration/configs/server.d.ts
|
|
485
398
|
type TrustProxy = boolean | string | string[] | ((address: string, hop: number) => boolean);
|
|
486
|
-
declare const ServerConfiguration: ConfigurationContract<{
|
|
399
|
+
declare const ServerConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
487
400
|
readonly identifier: string;
|
|
488
401
|
readonly debug: boolean;
|
|
489
402
|
readonly host: string;
|
|
490
403
|
readonly port: number;
|
|
491
404
|
readonly trustProxy: TrustProxy;
|
|
492
405
|
}, {
|
|
493
|
-
readonly identifier: ConfigurationField<string, true, string>;
|
|
494
|
-
readonly debug: ConfigurationField<boolean, false, string | boolean>;
|
|
495
|
-
readonly host: ConfigurationField<string, true, string>;
|
|
496
|
-
readonly port: ConfigurationField<number, true, string | number>;
|
|
497
|
-
readonly trustProxy: ConfigurationField<TrustProxy, false, TrustProxy>;
|
|
406
|
+
readonly identifier: import("@buildplease/core/node").ConfigurationField<string, true, string>;
|
|
407
|
+
readonly debug: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
408
|
+
readonly host: import("@buildplease/core/node").ConfigurationField<string, true, string>;
|
|
409
|
+
readonly port: import("@buildplease/core/node").ConfigurationField<number, true, string | number>;
|
|
410
|
+
readonly trustProxy: import("@buildplease/core/node").ConfigurationField<TrustProxy, false, TrustProxy>;
|
|
498
411
|
}>;
|
|
499
412
|
type ServerConfig = InferConfiguration<typeof ServerConfiguration>;
|
|
500
413
|
//#endregion
|
|
501
414
|
//#region src/configuration/configs/static-files.d.ts
|
|
502
415
|
type StaticFilesDotfilesMode = NonNullable<FastifyStaticOptions['dotfiles']>;
|
|
503
|
-
declare const StaticFilesConfiguration: ConfigurationContract<{
|
|
416
|
+
declare const StaticFilesConfiguration: import("@buildplease/core/node").ConfigurationContract<{
|
|
504
417
|
readonly enabled: boolean;
|
|
505
418
|
readonly publicDirectory: string | undefined;
|
|
506
419
|
readonly routePrefix: string;
|
|
@@ -511,20 +424,20 @@ declare const StaticFilesConfiguration: ConfigurationContract<{
|
|
|
511
424
|
readonly decorateReply: boolean;
|
|
512
425
|
readonly preCompressed: boolean;
|
|
513
426
|
}, {
|
|
514
|
-
readonly enabled: ConfigurationField<boolean, false, string | boolean>;
|
|
515
|
-
readonly publicDirectory: ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
516
|
-
readonly routePrefix: ConfigurationField<string, false, string>;
|
|
517
|
-
readonly maxAge: ConfigurationField<number, false, string | number>;
|
|
518
|
-
readonly dotfiles: ConfigurationField<StaticFilesDotfilesMode, false, StaticFilesDotfilesMode>;
|
|
519
|
-
readonly etag: ConfigurationField<boolean, false, string | boolean>;
|
|
520
|
-
readonly immutable: ConfigurationField<boolean, false, string | boolean>;
|
|
521
|
-
readonly decorateReply: ConfigurationField<boolean, false, string | boolean>;
|
|
522
|
-
readonly preCompressed: ConfigurationField<boolean, false, string | boolean>;
|
|
427
|
+
readonly enabled: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
428
|
+
readonly publicDirectory: import("@buildplease/core/node").ConfigurationField<string | undefined, false, string | null | undefined>;
|
|
429
|
+
readonly routePrefix: import("@buildplease/core/node").ConfigurationField<string, false, string>;
|
|
430
|
+
readonly maxAge: import("@buildplease/core/node").ConfigurationField<number, false, string | number>;
|
|
431
|
+
readonly dotfiles: import("@buildplease/core/node").ConfigurationField<StaticFilesDotfilesMode, false, StaticFilesDotfilesMode>;
|
|
432
|
+
readonly etag: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
433
|
+
readonly immutable: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
434
|
+
readonly decorateReply: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
435
|
+
readonly preCompressed: import("@buildplease/core/node").ConfigurationField<boolean, false, string | boolean>;
|
|
523
436
|
}>;
|
|
524
437
|
type StaticFilesConfig = InferConfiguration<typeof StaticFilesConfiguration>;
|
|
525
438
|
//#endregion
|
|
526
439
|
//#region src/configuration/config.d.ts
|
|
527
|
-
interface
|
|
440
|
+
interface DefineApiKitConfigInput {
|
|
528
441
|
readonly build?: InputOf<typeof BuildConfiguration>;
|
|
529
442
|
readonly server: InputOf<typeof ServerConfiguration>;
|
|
530
443
|
readonly logger?: InputOf<typeof LoggerConfiguration>;
|
|
@@ -539,10 +452,10 @@ interface DefineApiKitInput {
|
|
|
539
452
|
readonly multipart?: InputOf<typeof MultipartConfiguration>;
|
|
540
453
|
readonly configurations?: readonly ExtensionConfigurationBinding[];
|
|
541
454
|
}
|
|
542
|
-
interface
|
|
543
|
-
readonly environments: Environments;
|
|
455
|
+
interface ApiKitConfigInput extends Omit<DefineApiKitConfigInput, 'configurations'> {
|
|
544
456
|
readonly configurations: readonly ExtensionConfigurationBinding[];
|
|
545
457
|
}
|
|
458
|
+
type ApiKitConfig<Environments extends EnvironmentRegistry = EnvironmentRegistry> = ConfigDefinition<Environments, ApiKitConfigInput>;
|
|
546
459
|
type InputOf<Contract extends ConfigurationContract<any, ConfigurationSchema>> = Contract extends ConfigurationContract<any, infer Schema> ? ConfigurationInputFromSchema<Schema> : never;
|
|
547
460
|
type ExtensionConfigurationBinding = ConfigurationBinding<any, any>;
|
|
548
461
|
//#endregion
|
|
@@ -585,14 +498,7 @@ declare class ApiKitControllerImpl implements ApiKitController {
|
|
|
585
498
|
}
|
|
586
499
|
//#endregion
|
|
587
500
|
//#region src/configuration/define.d.ts
|
|
588
|
-
declare function
|
|
589
|
-
//#endregion
|
|
590
|
-
//#region src/configuration/load-context.d.ts
|
|
591
|
-
interface LoadApiKitContextOptions {
|
|
592
|
-
readonly environment: string;
|
|
593
|
-
readonly config?: string;
|
|
594
|
-
}
|
|
595
|
-
declare function loadApiKitContext(options: LoadApiKitContextOptions): Promise<void>;
|
|
501
|
+
declare function defineApiKitConfiguration<const Environments extends EnvironmentRegistry>(environments: Environments, input: DefineApiKitConfigInput): ApiKitConfig<Environments>;
|
|
596
502
|
//#endregion
|
|
597
503
|
//#region types/global.d.ts
|
|
598
504
|
declare global {
|
|
@@ -2734,6 +2640,106 @@ interface OpenAPISchemaResponse {
|
|
|
2734
2640
|
headers?: OpenAPISchemaHeaders;
|
|
2735
2641
|
}
|
|
2736
2642
|
//#endregion
|
|
2643
|
+
//#region src/server/plugins/index.d.ts
|
|
2644
|
+
declare const FastifyPlugins: {
|
|
2645
|
+
readonly basicAuth: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2646
|
+
readonly cookie: import("fastify").FastifyPluginAsync;
|
|
2647
|
+
readonly cors: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2648
|
+
readonly health: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2649
|
+
readonly ip: import("fastify").FastifyPluginAsync;
|
|
2650
|
+
readonly metrics: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2651
|
+
readonly multipart: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2652
|
+
readonly requestLogger: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2653
|
+
readonly requestMetadata: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2654
|
+
readonly requestScope: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2655
|
+
readonly staticFiles: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2656
|
+
readonly view: import("fastify").FastifyPluginAsync;
|
|
2657
|
+
};
|
|
2658
|
+
//#endregion
|
|
2659
|
+
//#region src/server/endpoint.d.ts
|
|
2660
|
+
interface Endpoint {
|
|
2661
|
+
method: HttpMethod;
|
|
2662
|
+
url: string;
|
|
2663
|
+
schema(server: FastifyInstance): FastifySchema;
|
|
2664
|
+
handle: (request: FastifyRequest) => Promise<HttpResponse>;
|
|
2665
|
+
}
|
|
2666
|
+
//#endregion
|
|
2667
|
+
//#region src/server/server-controller.d.ts
|
|
2668
|
+
interface ServerPluginBaseOptions {
|
|
2669
|
+
i18nController: I18nController;
|
|
2670
|
+
logger: Logger;
|
|
2671
|
+
apikitController: ApiKitController;
|
|
2672
|
+
}
|
|
2673
|
+
type ServerPluginOptions<TExtras extends object = {}> = ServerPluginBaseOptions & TExtras;
|
|
2674
|
+
type ServerPluginExternalHook = (instance: FastifyInstance, options: ServerPluginOptions) => Promise<void>;
|
|
2675
|
+
interface ServerController {
|
|
2676
|
+
get instance(): FastifyInstance;
|
|
2677
|
+
preparePlugins(externalHook?: ServerPluginExternalHook): Promise<void>;
|
|
2678
|
+
prepare(shutdownHook?: () => Promise<void>): Promise<void>;
|
|
2679
|
+
start(): Promise<void>;
|
|
2680
|
+
}
|
|
2681
|
+
declare class ServerControllerImpl implements ServerController {
|
|
2682
|
+
private i18n;
|
|
2683
|
+
private logger;
|
|
2684
|
+
private configuration;
|
|
2685
|
+
private server;
|
|
2686
|
+
constructor(i18n: I18nController, logger: Logger, configuration: ApiKitController);
|
|
2687
|
+
get instance(): FastifyInstance;
|
|
2688
|
+
preparePlugins(externalHook?: ServerPluginExternalHook): Promise<void>;
|
|
2689
|
+
prepare(shutdownHook?: () => Promise<void>): Promise<void>;
|
|
2690
|
+
start(): Promise<void>;
|
|
2691
|
+
private configureErrorHandler;
|
|
2692
|
+
private configureShutdownHandler;
|
|
2693
|
+
}
|
|
2694
|
+
//#endregion
|
|
2695
|
+
//#region src/server/request-controller.d.ts
|
|
2696
|
+
type HttpReplyPromise = (request: FastifyRequest, options: object) => Promise<HttpResponse>;
|
|
2697
|
+
type HttpOrVoidReplyPromise = (request: FastifyRequest, options?: object) => Promise<HttpResponse | void>;
|
|
2698
|
+
interface RequestController {
|
|
2699
|
+
handler(controllerFn: HttpReplyPromise, options?: object): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
2700
|
+
preHandler(controllerFn: HttpOrVoidReplyPromise, options?: object): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
2701
|
+
}
|
|
2702
|
+
declare class RequestControllerImpl implements RequestController {
|
|
2703
|
+
private logger;
|
|
2704
|
+
private responseController;
|
|
2705
|
+
constructor(logger: Logger, responseController: ResponseController);
|
|
2706
|
+
handler(controllerFn: HttpReplyPromise, options?: object): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
2707
|
+
preHandler(controllerFn: HttpOrVoidReplyPromise, options?: object): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
2708
|
+
private logError;
|
|
2709
|
+
}
|
|
2710
|
+
//#endregion
|
|
2711
|
+
//#region src/server/response-controller.d.ts
|
|
2712
|
+
interface ResponseController {
|
|
2713
|
+
sendResponse(request: FastifyRequest, reply: FastifyReply, response: HttpResponse): Promise<void>;
|
|
2714
|
+
}
|
|
2715
|
+
declare class ResponseControllerImpl implements ResponseController {
|
|
2716
|
+
private logger;
|
|
2717
|
+
constructor(logger: Logger);
|
|
2718
|
+
sendResponse(request: FastifyRequest, reply: FastifyReply, response: HttpResponse): Promise<void>;
|
|
2719
|
+
private sendJSONResponse;
|
|
2720
|
+
private sendFileResponse;
|
|
2721
|
+
private createResponseHeaders;
|
|
2722
|
+
}
|
|
2723
|
+
//#endregion
|
|
2724
|
+
//#region src/runtime/run-apikit.d.ts
|
|
2725
|
+
interface ApiKitRuntimeHookContext {
|
|
2726
|
+
readonly scope: ScopeController;
|
|
2727
|
+
}
|
|
2728
|
+
interface ApiKitRuntimePluginHookContext extends ApiKitRuntimeHookContext {
|
|
2729
|
+
readonly server: FastifyInstance;
|
|
2730
|
+
readonly options: ServerPluginOptions;
|
|
2731
|
+
}
|
|
2732
|
+
interface ApiKitRuntimeHooks {
|
|
2733
|
+
readonly assemblies?: () => Assembly[];
|
|
2734
|
+
readonly plugins?: (context: ApiKitRuntimePluginHookContext) => Awaitable<void>;
|
|
2735
|
+
readonly prepare?: (context: ApiKitRuntimeHookContext) => Awaitable<void>;
|
|
2736
|
+
readonly close?: (context: ApiKitRuntimeHookContext) => Awaitable<void>;
|
|
2737
|
+
}
|
|
2738
|
+
interface RunApiKitOptions {
|
|
2739
|
+
readonly hooks?: ApiKitRuntimeHooks;
|
|
2740
|
+
}
|
|
2741
|
+
declare function runApiKit(options?: RunApiKitOptions): Promise<void>;
|
|
2742
|
+
//#endregion
|
|
2737
2743
|
//#region src/security/cryptography-options.d.ts
|
|
2738
2744
|
/**
|
|
2739
2745
|
* @description Supported output encodings for cryptographic digest and MAC values.
|
|
@@ -2855,87 +2861,6 @@ declare class Token<T extends Record<string, unknown> = any> {
|
|
|
2855
2861
|
getField<K extends keyof T>(key: K): T[K] | undefined;
|
|
2856
2862
|
}
|
|
2857
2863
|
//#endregion
|
|
2858
|
-
//#region src/server/plugins/index.d.ts
|
|
2859
|
-
declare const FastifyPlugins: {
|
|
2860
|
-
readonly basicAuth: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2861
|
-
readonly cookie: import("fastify").FastifyPluginAsync;
|
|
2862
|
-
readonly cors: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2863
|
-
readonly health: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2864
|
-
readonly ip: import("fastify").FastifyPluginAsync;
|
|
2865
|
-
readonly metrics: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2866
|
-
readonly multipart: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2867
|
-
readonly requestLogger: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2868
|
-
readonly requestMetadata: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2869
|
-
readonly requestScope: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2870
|
-
readonly staticFiles: import("fastify").FastifyPluginAsync<ServerPluginBaseOptions>;
|
|
2871
|
-
readonly view: import("fastify").FastifyPluginAsync;
|
|
2872
|
-
};
|
|
2873
|
-
//#endregion
|
|
2874
|
-
//#region src/server/endpoint.d.ts
|
|
2875
|
-
interface Endpoint {
|
|
2876
|
-
method: HttpMethod;
|
|
2877
|
-
url: string;
|
|
2878
|
-
schema(server: FastifyInstance): FastifySchema;
|
|
2879
|
-
handle: (request: FastifyRequest) => Promise<HttpResponse>;
|
|
2880
|
-
}
|
|
2881
|
-
//#endregion
|
|
2882
|
-
//#region src/server/server-controller.d.ts
|
|
2883
|
-
interface ServerPluginBaseOptions {
|
|
2884
|
-
i18nController: I18nController;
|
|
2885
|
-
logger: Logger;
|
|
2886
|
-
apikitController: ApiKitController;
|
|
2887
|
-
}
|
|
2888
|
-
type ServerPluginOptions<TExtras extends object = {}> = ServerPluginBaseOptions & TExtras;
|
|
2889
|
-
type ServerPluginExternalHook = (instance: FastifyInstance, options: ServerPluginOptions) => Promise<void>;
|
|
2890
|
-
interface ServerController {
|
|
2891
|
-
get instance(): FastifyInstance;
|
|
2892
|
-
preparePlugins(externalHook?: ServerPluginExternalHook): Promise<void>;
|
|
2893
|
-
prepare(shutdownHook?: () => Promise<void>): Promise<void>;
|
|
2894
|
-
start(): Promise<void>;
|
|
2895
|
-
}
|
|
2896
|
-
declare class ServerControllerImpl implements ServerController {
|
|
2897
|
-
private i18n;
|
|
2898
|
-
private logger;
|
|
2899
|
-
private configuration;
|
|
2900
|
-
private server;
|
|
2901
|
-
constructor(i18n: I18nController, logger: Logger, configuration: ApiKitController);
|
|
2902
|
-
get instance(): FastifyInstance;
|
|
2903
|
-
preparePlugins(externalHook?: ServerPluginExternalHook): Promise<void>;
|
|
2904
|
-
prepare(shutdownHook?: () => Promise<void>): Promise<void>;
|
|
2905
|
-
start(): Promise<void>;
|
|
2906
|
-
private configureErrorHandler;
|
|
2907
|
-
private configureShutdownHandler;
|
|
2908
|
-
}
|
|
2909
|
-
//#endregion
|
|
2910
|
-
//#region src/server/request-controller.d.ts
|
|
2911
|
-
type HttpReplyPromise = (request: FastifyRequest, options: object) => Promise<HttpResponse>;
|
|
2912
|
-
type HttpOrVoidReplyPromise = (request: FastifyRequest, options?: object) => Promise<HttpResponse | void>;
|
|
2913
|
-
interface RequestController {
|
|
2914
|
-
handler(controllerFn: HttpReplyPromise, options?: object): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
2915
|
-
preHandler(controllerFn: HttpOrVoidReplyPromise, options?: object): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
2916
|
-
}
|
|
2917
|
-
declare class RequestControllerImpl implements RequestController {
|
|
2918
|
-
private logger;
|
|
2919
|
-
private responseController;
|
|
2920
|
-
constructor(logger: Logger, responseController: ResponseController);
|
|
2921
|
-
handler(controllerFn: HttpReplyPromise, options?: object): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
2922
|
-
preHandler(controllerFn: HttpOrVoidReplyPromise, options?: object): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
2923
|
-
private logError;
|
|
2924
|
-
}
|
|
2925
|
-
//#endregion
|
|
2926
|
-
//#region src/server/response-controller.d.ts
|
|
2927
|
-
interface ResponseController {
|
|
2928
|
-
sendResponse(request: FastifyRequest, reply: FastifyReply, response: HttpResponse): Promise<void>;
|
|
2929
|
-
}
|
|
2930
|
-
declare class ResponseControllerImpl implements ResponseController {
|
|
2931
|
-
private logger;
|
|
2932
|
-
constructor(logger: Logger);
|
|
2933
|
-
sendResponse(request: FastifyRequest, reply: FastifyReply, response: HttpResponse): Promise<void>;
|
|
2934
|
-
private sendJSONResponse;
|
|
2935
|
-
private sendFileResponse;
|
|
2936
|
-
private createResponseHeaders;
|
|
2937
|
-
}
|
|
2938
|
-
//#endregion
|
|
2939
2864
|
//#region src/validation/dto-validation-controller.d.ts
|
|
2940
2865
|
interface DtoValidationController {
|
|
2941
2866
|
/**
|
|
@@ -3043,7 +2968,4 @@ declare class ValidationControllerImpl implements ValidationController {
|
|
|
3043
2968
|
isValidDateThrowing(dateString?: string | null): Date;
|
|
3044
2969
|
}
|
|
3045
2970
|
//#endregion
|
|
3046
|
-
|
|
3047
|
-
declare function apikitAssembly(): Assembly[];
|
|
3048
|
-
//#endregion
|
|
3049
|
-
export { ApiError, ApiErrorCodes, ApiErrorDefinition, ApiErrorDetails, ApiErrorFactory, ApiErrorFactoryOptions, ApiErrorPath, ApiErrorProperties, ApiErrorTree, ApiKitConfig, ApiKitController, ApiKitControllerImpl, ApiKitL10n, ApiKitL10nResource, ApiKitSymbols, AuthorizationErrors, BaseEmailTemplate, BasicAuthAuthenticate, BasicAuthConfig, BasicAuthConfiguration, BuildConfig, BuildConfiguration, type BuildMetadata, CommonErrors, type ConfigurationContract, type ConfigurationField, type ConfigurationResolveContext, Cookie, CookieMutation, CookieOptions, CorsConfig, CorsConfiguration, CorsOptions, CryptographyController, CryptographyControllerImpl, CryptographyOutputEncoding, DEFAULT_GENERATE_STRING_OPTIONS, DefineApiKitInput, DigestAlgorithm, DigestOptions, DtoValidationController, DtoValidationControllerImpl, EmailConfig, EmailConfiguration, EmailController, EmailControllerImpl, EmailTemplate, EmailTemplateInput, Endpoint, type EnvironmentConfig, type EnvironmentDefinition, type EnvironmentRegistry, FastifyPlugins, FileHttpResponse, FormatErrors, FormatType, Formatter, FormatterController, FormatterControllerImpl, GenerateNumberOptions, GenerateStringOptions, HealthConfig, HealthConfiguration, HttpHeaderKey, HttpHeaderValues, HttpHeaders, HttpMethod, HttpResponse, I18nConfig, I18nConfiguration, I18nController, I18nControllerImpl, I18nDirectoryEntry, I18nFactory, I18nFactoryOptions, I18nFallbackLanguages, I18nFileEntry, I18nLoadMode, I18nOptions, I18nPreload, I18nProvider, IRequestScope, ImageErrors, ImageNormalizationController, ImageNormalizationControllerImpl, ImageOptions, type InferConfiguration, JSONHttpResponse, LimitErrors, LoadApiKitContextOptions, LoggerConfig, LoggerConfiguration, LoggerConfigurationValue, LoggerRequestOptions, MacAlgorithm, MacOptions, MetricsConfig, MetricsConfiguration, MetricsDefaultConfig, MetricsEndpoint, MetricsRouteConfig, MongoDbComparisonOperators, MongoDbFieldQuery, MongoDbFieldValue, MongoDbLogicalOperators, MongoDbQuery, MongoDbQueryFormatter, MongoDbQueryFormatterImpl, MongoDbUpdateOptions, MultipartConfig, MultipartConfiguration, MultipartFormatterController, MultipartFormatterControllerImpl, MultipartOptions, NormalizationController, NormalizationControllerImpl, NotificationChannel, NotificationChannelRequest, NotificationChannelsConfig, NotificationConfig, NotificationConfiguration, NotificationConfigurationValue, NotificationController, NotificationDeliveryResult, NotificationDeliveryStatus, NotificationMessage, NotificationRequest, NotificationResult, NotificationSendOptions, OpenAPIMediaType, OpenAPISchemaController, OpenAPISchemaControllerImpl, OpenAPISchemaExample, OpenAPISchemaHeader, OpenAPISchemaHeaders, OpenAPISchemaMediaType, OpenAPISchemaResponse, ParseLocaleOptions, PasswordHashAlgorithm, PasswordHashOptions, RANDOM_VALUE_GENERATOR_LIMITS, RandomValueAlphabet, RandomValueAlphabetPreset, RandomValueCustomAlphabet, RandomValueGenerator, RandomValueGeneratorImpl, RequestController, RequestControllerImpl, RequestLogMetadata, RequestMetadata, RequestScope, RequestScopeData, ResponseController, ResponseControllerImpl, ResponseType, ServerConfig, ServerConfiguration, ServerController, ServerControllerImpl, ServerErrors, ServerPluginBaseOptions, ServerPluginExternalHook, ServerPluginOptions, SharpFormat, SharpInstance, StaticFilesConfig, StaticFilesConfiguration, StaticFilesDotfilesMode, TelegramNotificationConfig, TelegramNotificationRequest, TemporaryFileRepository, TemporaryFileRepositoryImpl, Token, TrustProxy, ValidationController, ValidationControllerImpl, ValidationErrors, apikitAssembly, defineApiKit, defineConfiguration, defineEnvironments, defineErrors, defineSource, fastifyBasicAuth, fastifyCookie, fastifyCors, fastifyIp, fastifyMetrics, fastifyMultipart, fastifyStatic, fastifyUnderPressure, fastifyView, field, fp, isApiErrorDefinition, loadApiKitContext };
|
|
2971
|
+
export { ApiError, ApiErrorCodes, ApiErrorDefinition, ApiErrorDetails, ApiErrorFactory, ApiErrorFactoryOptions, ApiErrorPath, ApiErrorProperties, ApiErrorTree, ApiKitConfig, ApiKitConfigInput, ApiKitController, ApiKitControllerImpl, ApiKitL10n, ApiKitL10nResource, ApiKitRuntimeHookContext, ApiKitRuntimeHooks, ApiKitRuntimePluginHookContext, ApiKitSymbols, AuthorizationErrors, BaseEmailTemplate, BasicAuthAuthenticate, BasicAuthConfig, BasicAuthConfiguration, BuildConfig, BuildConfiguration, CommonErrors, Cookie, CookieMutation, CookieOptions, CorsConfig, CorsConfiguration, CorsOptions, CryptographyController, CryptographyControllerImpl, CryptographyOutputEncoding, DEFAULT_GENERATE_STRING_OPTIONS, DefineApiKitConfigInput, DigestAlgorithm, DigestOptions, DtoValidationController, DtoValidationControllerImpl, EmailConfig, EmailConfiguration, EmailController, EmailControllerImpl, EmailTemplate, EmailTemplateInput, Endpoint, FastifyPlugins, FileHttpResponse, FormatErrors, FormatType, Formatter, FormatterController, FormatterControllerImpl, GenerateNumberOptions, GenerateStringOptions, HealthConfig, HealthConfiguration, HttpHeaderKey, HttpHeaderValues, HttpHeaders, HttpMethod, HttpResponse, I18nConfig, I18nConfiguration, I18nController, I18nControllerImpl, I18nDirectoryEntry, I18nFactory, I18nFactoryOptions, I18nFallbackLanguages, I18nFileEntry, I18nLoadMode, I18nOptions, I18nPreload, I18nProvider, IRequestScope, ImageErrors, ImageNormalizationController, ImageNormalizationControllerImpl, ImageOptions, JSONHttpResponse, LimitErrors, LoggerConfig, LoggerConfiguration, LoggerConfigurationValue, LoggerRequestOptions, MacAlgorithm, MacOptions, MetricsConfig, MetricsConfiguration, MetricsDefaultConfig, MetricsEndpoint, MetricsRouteConfig, MongoDbComparisonOperators, MongoDbFieldQuery, MongoDbFieldValue, MongoDbLogicalOperators, MongoDbQuery, MongoDbQueryFormatter, MongoDbQueryFormatterImpl, MongoDbUpdateOptions, MultipartConfig, MultipartConfiguration, MultipartFormatterController, MultipartFormatterControllerImpl, MultipartOptions, NormalizationController, NormalizationControllerImpl, NotificationChannel, NotificationChannelRequest, NotificationChannelsConfig, NotificationConfig, NotificationConfiguration, NotificationConfigurationValue, NotificationController, NotificationDeliveryResult, NotificationDeliveryStatus, NotificationMessage, NotificationRequest, NotificationResult, NotificationSendOptions, OpenAPIMediaType, OpenAPISchemaController, OpenAPISchemaControllerImpl, OpenAPISchemaExample, OpenAPISchemaHeader, OpenAPISchemaHeaders, OpenAPISchemaMediaType, OpenAPISchemaResponse, ParseLocaleOptions, PasswordHashAlgorithm, PasswordHashOptions, RANDOM_VALUE_GENERATOR_LIMITS, RandomValueAlphabet, RandomValueAlphabetPreset, RandomValueCustomAlphabet, RandomValueGenerator, RandomValueGeneratorImpl, RequestController, RequestControllerImpl, RequestLogMetadata, RequestMetadata, RequestScope, RequestScopeData, ResponseController, ResponseControllerImpl, ResponseType, RunApiKitOptions, ServerConfig, ServerConfiguration, ServerController, ServerControllerImpl, ServerErrors, ServerPluginBaseOptions, ServerPluginExternalHook, ServerPluginOptions, SharpFormat, SharpInstance, StaticFilesConfig, StaticFilesConfiguration, StaticFilesDotfilesMode, TelegramNotificationConfig, TelegramNotificationRequest, TemporaryFileRepository, TemporaryFileRepositoryImpl, Token, TrustProxy, ValidationController, ValidationControllerImpl, ValidationErrors, defineApiKitConfiguration as defineConfig, defineErrors, fastifyBasicAuth, fastifyCookie, fastifyCors, fastifyIp, fastifyMetrics, fastifyMultipart, fastifyStatic, fastifyUnderPressure, fastifyView, fp, isApiErrorDefinition, runApiKit };
|