silgi 0.0.13 → 0.1.0-beta.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 +102 -1
- package/dist/_virtual/_rolldown/runtime.mjs +5 -0
- package/dist/adapters/astro.d.mts +17 -0
- package/dist/adapters/astro.mjs +24 -0
- package/dist/adapters/aws-lambda.d.mts +31 -0
- package/dist/adapters/aws-lambda.mjs +85 -0
- package/dist/adapters/elysia.d.mts +17 -0
- package/dist/adapters/elysia.mjs +76 -0
- package/dist/adapters/express.d.mts +16 -0
- package/dist/adapters/express.mjs +78 -0
- package/dist/adapters/fastify.d.mts +15 -0
- package/dist/adapters/fastify.mjs +78 -0
- package/dist/adapters/message-port.d.mts +37 -0
- package/dist/adapters/message-port.mjs +129 -0
- package/dist/adapters/nestjs.d.mts +25 -0
- package/dist/adapters/nestjs.mjs +91 -0
- package/dist/adapters/nextjs.d.mts +21 -0
- package/dist/adapters/nextjs.mjs +30 -0
- package/dist/adapters/peer.d.mts +27 -0
- package/dist/adapters/peer.mjs +36 -0
- package/dist/adapters/remix.d.mts +17 -0
- package/dist/adapters/remix.mjs +24 -0
- package/dist/adapters/solidstart.d.mts +14 -0
- package/dist/adapters/solidstart.mjs +30 -0
- package/dist/adapters/sveltekit.d.mts +18 -0
- package/dist/adapters/sveltekit.mjs +33 -0
- package/dist/analyze.mjs +26 -0
- package/dist/broker/index.d.mts +62 -0
- package/dist/broker/index.mjs +153 -0
- package/dist/broker/nats.d.mts +33 -0
- package/dist/broker/nats.mjs +31 -0
- package/dist/broker/redis.d.mts +51 -0
- package/dist/broker/redis.mjs +92 -0
- package/dist/builder.d.mts +36 -0
- package/dist/builder.mjs +51 -0
- package/dist/callable.d.mts +17 -0
- package/dist/callable.mjs +42 -0
- package/dist/client/adapters/fetch/index.d.mts +17 -0
- package/dist/client/adapters/fetch/index.mjs +61 -0
- package/dist/client/adapters/ofetch/index.d.mts +41 -0
- package/dist/client/adapters/ofetch/index.mjs +92 -0
- package/dist/client/client.d.mts +29 -0
- package/dist/client/client.mjs +54 -0
- package/dist/client/dynamic-link.d.mts +15 -0
- package/dist/client/dynamic-link.mjs +16 -0
- package/dist/client/index.d.mts +7 -0
- package/dist/client/index.mjs +6 -0
- package/dist/client/interceptor.d.mts +31 -0
- package/dist/client/interceptor.mjs +34 -0
- package/dist/client/merge.d.mts +28 -0
- package/dist/client/merge.mjs +30 -0
- package/dist/client/openapi.d.mts +29 -0
- package/dist/client/openapi.mjs +89 -0
- package/dist/client/plugins/batch.d.mts +20 -0
- package/dist/client/plugins/batch.mjs +64 -0
- package/dist/client/plugins/csrf.d.mts +13 -0
- package/dist/client/plugins/csrf.mjs +20 -0
- package/dist/client/plugins/dedupe.d.mts +10 -0
- package/dist/client/plugins/dedupe.mjs +28 -0
- package/dist/client/plugins/index.d.mts +5 -0
- package/dist/client/plugins/index.mjs +5 -0
- package/dist/client/plugins/retry.d.mts +11 -0
- package/dist/client/plugins/retry.mjs +21 -0
- package/dist/client/server.d.mts +16 -0
- package/dist/client/server.mjs +60 -0
- package/dist/client/types.d.mts +29 -0
- package/dist/codec/devalue.d.mts +21 -0
- package/dist/codec/devalue.mjs +32 -0
- package/dist/codec/msgpack.d.mts +21 -0
- package/dist/codec/msgpack.mjs +59 -0
- package/dist/compile.d.mts +52 -0
- package/dist/compile.mjs +304 -0
- package/dist/contract.d.mts +36 -0
- package/dist/contract.mjs +40 -0
- package/dist/core/error.d.mts +104 -0
- package/dist/core/error.mjs +139 -0
- package/dist/core/handler.mjs +546 -0
- package/dist/core/iterator.d.mts +17 -0
- package/dist/core/iterator.mjs +79 -0
- package/dist/core/router-utils.mjs +16 -0
- package/dist/core/schema.d.mts +19 -0
- package/dist/core/schema.mjs +26 -0
- package/dist/core/serve.mjs +38 -0
- package/dist/core/sse.d.mts +16 -0
- package/dist/core/sse.mjs +95 -0
- package/dist/core/storage.d.mts +21 -0
- package/dist/core/storage.mjs +63 -0
- package/dist/core/utils.mjs +21 -0
- package/dist/fast-stringify.mjs +125 -0
- package/dist/index.d.mts +15 -37
- package/dist/index.mjs +13 -7
- package/dist/integrations/ai/index.d.mts +25 -0
- package/dist/integrations/ai/index.mjs +116 -0
- package/dist/integrations/react/index.d.mts +83 -0
- package/dist/integrations/react/index.mjs +197 -0
- package/dist/integrations/tanstack-query/index.d.mts +120 -0
- package/dist/integrations/tanstack-query/index.mjs +100 -0
- package/dist/integrations/tanstack-query/ssr.d.mts +51 -0
- package/dist/integrations/tanstack-query/ssr.mjs +89 -0
- package/dist/integrations/zod/converter.d.mts +75 -0
- package/dist/integrations/zod/converter.mjs +345 -0
- package/dist/integrations/zod/index.d.mts +2 -0
- package/dist/integrations/zod/index.mjs +2 -0
- package/dist/lazy.d.mts +24 -0
- package/dist/lazy.mjs +27 -0
- package/dist/lifecycle.d.mts +36 -0
- package/dist/lifecycle.mjs +46 -0
- package/dist/map-input.d.mts +17 -0
- package/dist/map-input.mjs +24 -0
- package/dist/plugins/analytics.d.mts +168 -0
- package/dist/plugins/analytics.mjs +459 -0
- package/dist/plugins/batch-server.d.mts +20 -0
- package/dist/plugins/batch-server.mjs +86 -0
- package/dist/plugins/body-limit.d.mts +16 -0
- package/dist/plugins/body-limit.mjs +44 -0
- package/dist/plugins/cache.d.mts +170 -0
- package/dist/plugins/cache.mjs +200 -0
- package/dist/plugins/coerce.d.mts +21 -0
- package/dist/plugins/coerce.mjs +46 -0
- package/dist/plugins/compression.d.mts +19 -0
- package/dist/plugins/compression.mjs +23 -0
- package/dist/plugins/cookies.d.mts +44 -0
- package/dist/plugins/cookies.mjs +67 -0
- package/dist/plugins/cors.d.mts +39 -0
- package/dist/plugins/cors.mjs +56 -0
- package/dist/plugins/custom-serializer.d.mts +57 -0
- package/dist/plugins/custom-serializer.mjs +40 -0
- package/dist/plugins/file-upload.d.mts +38 -0
- package/dist/plugins/file-upload.mjs +100 -0
- package/dist/plugins/index.d.mts +16 -0
- package/dist/plugins/index.mjs +16 -0
- package/dist/plugins/otel.d.mts +35 -0
- package/dist/plugins/otel.mjs +40 -0
- package/dist/plugins/pino.d.mts +60 -0
- package/dist/plugins/pino.mjs +42 -0
- package/dist/plugins/pubsub.d.mts +50 -0
- package/dist/plugins/pubsub.mjs +53 -0
- package/dist/plugins/ratelimit.d.mts +51 -0
- package/dist/plugins/ratelimit.mjs +81 -0
- package/dist/plugins/signing.d.mts +41 -0
- package/dist/plugins/signing.mjs +115 -0
- package/dist/plugins/strict-get.d.mts +10 -0
- package/dist/plugins/strict-get.mjs +33 -0
- package/dist/route/add.mjs +240 -0
- package/dist/route/compiler.mjs +373 -0
- package/dist/route/context.mjs +12 -0
- package/dist/route/types.d.mts +11 -0
- package/dist/route/utils.mjs +17 -0
- package/dist/scalar.d.mts +53 -0
- package/dist/scalar.mjs +315 -0
- package/dist/silgi.d.mts +139 -0
- package/dist/silgi.mjs +113 -0
- package/dist/trpc-interop.d.mts +22 -0
- package/dist/trpc-interop.mjs +68 -0
- package/dist/types.d.mts +82 -0
- package/dist/ws.d.mts +42 -0
- package/dist/ws.mjs +137 -0
- package/lib/dashboard/index.html +123 -0
- package/lib/ocache.d.mts +1 -0
- package/lib/ocache.mjs +1 -0
- package/lib/ofetch.d.mts +1 -0
- package/lib/ofetch.mjs +1 -0
- package/lib/srvx.d.mts +1 -0
- package/lib/srvx.mjs +1 -0
- package/lib/unstorage.d.mts +1 -0
- package/lib/unstorage.mjs +1 -0
- package/package.json +291 -65
- package/bin/silgi.mjs +0 -3
- package/dist/chunks/generate.mjs +0 -933
- package/dist/chunks/init.mjs +0 -21
- package/dist/cli/config.d.mts +0 -19
- package/dist/cli/config.d.ts +0 -19
- package/dist/cli/config.mjs +0 -5
- package/dist/cli/index.d.mts +0 -2
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.mjs +0 -119
- package/dist/index.d.ts +0 -37
- package/dist/plugins/openapi.d.mts +0 -138
- package/dist/plugins/openapi.d.ts +0 -138
- package/dist/plugins/openapi.mjs +0 -204
- package/dist/plugins/scalar.d.mts +0 -14
- package/dist/plugins/scalar.d.ts +0 -14
- package/dist/plugins/scalar.mjs +0 -66
- package/dist/shared/silgi.BMCYk2cR.mjs +0 -841
- package/dist/shared/silgi.D5qK9QOm.d.mts +0 -301
- package/dist/shared/silgi.D5qK9QOm.d.ts +0 -301
package/dist/chunks/init.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { writeFileSync } from 'node:fs';
|
|
2
|
-
import { defineCommand } from 'citty';
|
|
3
|
-
|
|
4
|
-
const init = defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: "Silgi Init",
|
|
7
|
-
description: "Initialize silgi config",
|
|
8
|
-
version: "0.1.0"
|
|
9
|
-
},
|
|
10
|
-
args: {},
|
|
11
|
-
async run() {
|
|
12
|
-
const context = `import { defineSilgiConfig } from 'silgi/config'
|
|
13
|
-
|
|
14
|
-
export default defineSilgiConfig({
|
|
15
|
-
|
|
16
|
-
})`;
|
|
17
|
-
writeFileSync("silgi.config.ts", context);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export { init as default };
|
package/dist/cli/config.d.mts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface SilgiConfig {
|
|
2
|
-
scopes: ScopeConfig[];
|
|
3
|
-
removeExtensions?: boolean;
|
|
4
|
-
output: {
|
|
5
|
-
server?: string;
|
|
6
|
-
client?: string;
|
|
7
|
-
};
|
|
8
|
-
modules?: string[];
|
|
9
|
-
moduleDir?: string[];
|
|
10
|
-
}
|
|
11
|
-
interface ScopeConfig {
|
|
12
|
-
name: string;
|
|
13
|
-
path: string;
|
|
14
|
-
type: 'server' | 'client';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
declare function defineSilgiConfig(config: SilgiConfig): SilgiConfig;
|
|
18
|
-
|
|
19
|
-
export { defineSilgiConfig };
|
package/dist/cli/config.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface SilgiConfig {
|
|
2
|
-
scopes: ScopeConfig[];
|
|
3
|
-
removeExtensions?: boolean;
|
|
4
|
-
output: {
|
|
5
|
-
server?: string;
|
|
6
|
-
client?: string;
|
|
7
|
-
};
|
|
8
|
-
modules?: string[];
|
|
9
|
-
moduleDir?: string[];
|
|
10
|
-
}
|
|
11
|
-
interface ScopeConfig {
|
|
12
|
-
name: string;
|
|
13
|
-
path: string;
|
|
14
|
-
type: 'server' | 'client';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
declare function defineSilgiConfig(config: SilgiConfig): SilgiConfig;
|
|
18
|
-
|
|
19
|
-
export { defineSilgiConfig };
|
package/dist/cli/config.mjs
DELETED
package/dist/cli/index.d.mts
DELETED
package/dist/cli/index.d.ts
DELETED
package/dist/cli/index.mjs
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { defineCommand, runMain } from 'citty';
|
|
2
|
-
import consola from 'consola';
|
|
3
|
-
|
|
4
|
-
const name = "silgi";
|
|
5
|
-
const type = "module";
|
|
6
|
-
const version = "0.0.13";
|
|
7
|
-
const exports = {
|
|
8
|
-
".": {
|
|
9
|
-
"import": {
|
|
10
|
-
types: "./dist/index.d.mts",
|
|
11
|
-
"default": "./dist/index.mjs"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"./plugins/openapi": {
|
|
15
|
-
types: "./dist/plugins/openapi.d.mts",
|
|
16
|
-
"import": "./dist/plugins/openapi.mjs"
|
|
17
|
-
},
|
|
18
|
-
"./plugins/scalar": {
|
|
19
|
-
types: "./dist/plugins/scalar.d.mts",
|
|
20
|
-
"import": "./dist/plugins/scalar.mjs"
|
|
21
|
-
},
|
|
22
|
-
"./config": {
|
|
23
|
-
types: "./dist/cli/config.d.mts",
|
|
24
|
-
"import": "./dist/cli/config.mjs"
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const types = "./dist/index.d.ts";
|
|
28
|
-
const typesVersions = {
|
|
29
|
-
"*": {
|
|
30
|
-
"*": [
|
|
31
|
-
"./dist/*"
|
|
32
|
-
],
|
|
33
|
-
"plugins/*": [
|
|
34
|
-
"./dist/plugins/*"
|
|
35
|
-
],
|
|
36
|
-
config: [
|
|
37
|
-
"./dist/cli/config"
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const bin = {
|
|
42
|
-
silgi: "bin/silgi.mjs"
|
|
43
|
-
};
|
|
44
|
-
const files = [
|
|
45
|
-
"bin",
|
|
46
|
-
"dist",
|
|
47
|
-
"package.json"
|
|
48
|
-
];
|
|
49
|
-
const scripts = {
|
|
50
|
-
build: "unbuild",
|
|
51
|
-
"build:stub": "unbuild --stub",
|
|
52
|
-
dev: "npx --yes listhen -w --open ./__tests__/h3.ts",
|
|
53
|
-
"dev:k6": "k6 run ./__tests__/k6.js"
|
|
54
|
-
};
|
|
55
|
-
const dependencies = {
|
|
56
|
-
"@anatine/zod-openapi": "^2.2.6",
|
|
57
|
-
"@antfu/eslint-config": "^3.12.2",
|
|
58
|
-
"@asteasolutions/zod-to-openapi": "^7.3.0",
|
|
59
|
-
"@oxc-parser/wasm": "^0.44.0",
|
|
60
|
-
c12: "^2.0.1",
|
|
61
|
-
citty: "^0.1.6",
|
|
62
|
-
consola: "^3.3.3",
|
|
63
|
-
defu: "^6.1.4",
|
|
64
|
-
eslint: "^9.17.0",
|
|
65
|
-
h3: "^1.13.0",
|
|
66
|
-
hookable: "^5.5.3",
|
|
67
|
-
jiti: "^2.4.2",
|
|
68
|
-
mlly: "^1.7.3",
|
|
69
|
-
"openapi3-ts": "^4.4.0",
|
|
70
|
-
pathe: "^2.0.0",
|
|
71
|
-
scule: "^1.3.0",
|
|
72
|
-
unctx: "^2.4.1",
|
|
73
|
-
zod: "^3.24.1"
|
|
74
|
-
};
|
|
75
|
-
const devDependencies = {
|
|
76
|
-
silgi: "workspace:*",
|
|
77
|
-
unbuild: "^3.2.0"
|
|
78
|
-
};
|
|
79
|
-
const resolutions = {
|
|
80
|
-
silgi: "workspace:*"
|
|
81
|
-
};
|
|
82
|
-
const packageJson = {
|
|
83
|
-
name: name,
|
|
84
|
-
type: type,
|
|
85
|
-
version: version,
|
|
86
|
-
exports: exports,
|
|
87
|
-
types: types,
|
|
88
|
-
typesVersions: typesVersions,
|
|
89
|
-
bin: bin,
|
|
90
|
-
files: files,
|
|
91
|
-
scripts: scripts,
|
|
92
|
-
dependencies: dependencies,
|
|
93
|
-
devDependencies: devDependencies,
|
|
94
|
-
resolutions: resolutions
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const main = defineCommand({
|
|
98
|
-
meta: {
|
|
99
|
-
name: "Silgi",
|
|
100
|
-
version: packageJson.version,
|
|
101
|
-
description: "Silgi CLI"
|
|
102
|
-
},
|
|
103
|
-
args: {
|
|
104
|
-
version: {
|
|
105
|
-
alias: "v",
|
|
106
|
-
description: "Show version"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
subCommands: {
|
|
110
|
-
generate: () => import('../chunks/generate.mjs').then((m) => m.default),
|
|
111
|
-
init: () => import('../chunks/init.mjs').then((m) => m.default)
|
|
112
|
-
},
|
|
113
|
-
run({ args }) {
|
|
114
|
-
consola.info("Silgi CLI , --help for more info");
|
|
115
|
-
if (args.version)
|
|
116
|
-
console.warn("Silgi version:", packageJson.version);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
runMain(main);
|
package/dist/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { D as DefaultContext, a as DefaultInterface, E as ExtractScope, S as ServicePluginConfig, b as ServiceMethod, c as ExtractShared, C as CacheScope, d as CacheKeyGenerator, M as MethodPluginConfig, e as ServiceExecutor, O as OmitSilgiOptions, I as InitSilgi, P as PergelPlugin, f as Silgi } from './shared/silgi.D5qK9QOm.js';
|
|
2
|
-
export { h as DefaultHooks, g as InitializedCreateScope, k as SchemaGenerated, i as SilgiDefaultContext, j as SilgiDefaultInterface } from './shared/silgi.D5qK9QOm.js';
|
|
3
|
-
import * as unctx from 'unctx';
|
|
4
|
-
import 'consola';
|
|
5
|
-
import 'h3';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'hookable';
|
|
8
|
-
|
|
9
|
-
declare function defineService<TContext extends DefaultContext = DefaultContext, TInterface extends DefaultInterface = DefaultInterface>(): {
|
|
10
|
-
scope<TScope extends keyof ExtractScope<TInterface>>(scope: TScope): {
|
|
11
|
-
service<TService extends keyof ExtractScope<TInterface>[TScope]>(name: TService, config?: ServicePluginConfig<TInterface> | undefined): {
|
|
12
|
-
methods<TMethods extends { [K in keyof ExtractScope<TInterface>[TScope][TService]]: {
|
|
13
|
-
handler: (input: ExtractScope<TInterface>[TScope][TService][K] extends ServiceMethod<infer I, any, DefaultInterface> ? I : never, shared: ExtractShared<TInterface>, context: TContext) => Promise<ExtractScope<TInterface>[TScope][TService][K] extends ServiceMethod<any, infer O, DefaultInterface> ? O : never>;
|
|
14
|
-
options?: {
|
|
15
|
-
cache?: {
|
|
16
|
-
ttl: number;
|
|
17
|
-
scope?: CacheScope;
|
|
18
|
-
key?: CacheKeyGenerator<any>;
|
|
19
|
-
namespace?: string;
|
|
20
|
-
} | undefined;
|
|
21
|
-
plugins?: MethodPluginConfig<TInterface> | undefined;
|
|
22
|
-
} | undefined;
|
|
23
|
-
}; }>(methodsConfig: TMethods): ServiceExecutor<ExtractScope<TInterface>[TScope][TService], TContext, TInterface>;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
declare function createSilgi<TContext extends DefaultContext, TInterface extends DefaultInterface>(options: OmitSilgiOptions<TContext, TInterface>): InitSilgi<TContext, TInterface>;
|
|
28
|
-
declare function defineSilgiPlugin<TPluginConfig, TContext extends DefaultContext = DefaultContext, TInterface extends DefaultInterface = DefaultInterface>(plugin: Omit<PergelPlugin<TContext, TInterface, TPluginConfig>, 'defaults'> & {
|
|
29
|
-
defaults?: TPluginConfig;
|
|
30
|
-
}): (options?: TPluginConfig) => PergelPlugin<TContext, TInterface, TPluginConfig>;
|
|
31
|
-
|
|
32
|
-
declare const silgiCtx: unctx.UseContext<InitSilgi<DefaultContext, DefaultInterface>>;
|
|
33
|
-
declare function useShared<TContext extends DefaultContext, TInterface extends DefaultInterface>(): Silgi<TContext, TInterface>["options"]["shared"];
|
|
34
|
-
declare function useSilgi(): InitSilgi<DefaultContext, DefaultInterface>;
|
|
35
|
-
declare function useHook<TContext extends DefaultContext, TInterface extends DefaultInterface>(): Silgi<TContext, TInterface>["hooks"]["hook"];
|
|
36
|
-
|
|
37
|
-
export { DefaultContext, DefaultInterface, InitSilgi, OmitSilgiOptions, createSilgi, defineService, defineSilgiPlugin, silgiCtx, useHook, useShared, useSilgi };
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
|
|
2
|
-
import { SchemaObject, ServerObject, OpenAPIObject } from 'openapi3-ts/oas31';
|
|
3
|
-
import { P as PergelPlugin, D as DefaultContext, a as DefaultInterface, I as InitSilgi } from '../shared/silgi.D5qK9QOm.mjs';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import 'consola';
|
|
6
|
-
import 'h3';
|
|
7
|
-
import 'hookable';
|
|
8
|
-
|
|
9
|
-
interface DefaultSilgiPlugin {
|
|
10
|
-
openapi?: {
|
|
11
|
-
schema?: {
|
|
12
|
-
input?: SchemaObject;
|
|
13
|
-
output?: SchemaObject;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
declare module 'silgi' {
|
|
18
|
-
interface DefaultInterface {
|
|
19
|
-
plugins: DefaultSilgiPlugin;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
interface OpenAPIPluginConfig {
|
|
23
|
-
title?: string;
|
|
24
|
-
version?: string;
|
|
25
|
-
description?: string;
|
|
26
|
-
servers?: ServerObject[];
|
|
27
|
-
writeToFile?: boolean;
|
|
28
|
-
outputPath?: string;
|
|
29
|
-
}
|
|
30
|
-
declare const createOpenAPIPlugin: (options?: OpenAPIPluginConfig | undefined) => PergelPlugin<DefaultContext, DefaultInterface, OpenAPIPluginConfig>;
|
|
31
|
-
declare function createSchema(schema: {
|
|
32
|
-
input?: Partial<SchemaObject>;
|
|
33
|
-
output?: Partial<SchemaObject>;
|
|
34
|
-
}): {
|
|
35
|
-
input: {
|
|
36
|
-
discriminator?: openapi3_ts_oas31.DiscriminatorObject;
|
|
37
|
-
readOnly?: boolean;
|
|
38
|
-
writeOnly?: boolean;
|
|
39
|
-
xml?: openapi3_ts_oas31.XmlObject;
|
|
40
|
-
externalDocs?: openapi3_ts_oas31.ExternalDocumentationObject;
|
|
41
|
-
example?: any;
|
|
42
|
-
examples?: any[];
|
|
43
|
-
deprecated?: boolean;
|
|
44
|
-
type: string | openapi3_ts_oas31.SchemaObjectType[];
|
|
45
|
-
format?: "int32" | "int64" | "float" | "double" | "byte" | "binary" | "date" | "date-time" | "password" | string;
|
|
46
|
-
allOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
47
|
-
oneOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
48
|
-
anyOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
49
|
-
not?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
50
|
-
items?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
51
|
-
properties?: {
|
|
52
|
-
[propertyName: string]: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
53
|
-
};
|
|
54
|
-
additionalProperties?: SchemaObject | openapi3_ts_oas31.ReferenceObject | boolean;
|
|
55
|
-
propertyNames?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
56
|
-
description?: string;
|
|
57
|
-
default?: any;
|
|
58
|
-
title?: string;
|
|
59
|
-
multipleOf?: number;
|
|
60
|
-
maximum?: number;
|
|
61
|
-
const?: any;
|
|
62
|
-
exclusiveMaximum?: number;
|
|
63
|
-
minimum?: number;
|
|
64
|
-
exclusiveMinimum?: number;
|
|
65
|
-
maxLength?: number;
|
|
66
|
-
minLength?: number;
|
|
67
|
-
pattern?: string;
|
|
68
|
-
maxItems?: number;
|
|
69
|
-
minItems?: number;
|
|
70
|
-
uniqueItems?: boolean;
|
|
71
|
-
maxProperties?: number;
|
|
72
|
-
minProperties?: number;
|
|
73
|
-
required?: string[];
|
|
74
|
-
enum?: any[];
|
|
75
|
-
prefixItems?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
76
|
-
contentMediaType?: string;
|
|
77
|
-
contentEncoding?: string;
|
|
78
|
-
};
|
|
79
|
-
output: {
|
|
80
|
-
discriminator?: openapi3_ts_oas31.DiscriminatorObject;
|
|
81
|
-
readOnly?: boolean;
|
|
82
|
-
writeOnly?: boolean;
|
|
83
|
-
xml?: openapi3_ts_oas31.XmlObject;
|
|
84
|
-
externalDocs?: openapi3_ts_oas31.ExternalDocumentationObject;
|
|
85
|
-
example?: any;
|
|
86
|
-
examples?: any[];
|
|
87
|
-
deprecated?: boolean;
|
|
88
|
-
type: string | openapi3_ts_oas31.SchemaObjectType[];
|
|
89
|
-
format?: "int32" | "int64" | "float" | "double" | "byte" | "binary" | "date" | "date-time" | "password" | string;
|
|
90
|
-
allOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
91
|
-
oneOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
92
|
-
anyOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
93
|
-
not?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
94
|
-
items?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
95
|
-
properties?: {
|
|
96
|
-
[propertyName: string]: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
97
|
-
};
|
|
98
|
-
additionalProperties?: SchemaObject | openapi3_ts_oas31.ReferenceObject | boolean;
|
|
99
|
-
propertyNames?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
100
|
-
description?: string;
|
|
101
|
-
default?: any;
|
|
102
|
-
title?: string;
|
|
103
|
-
multipleOf?: number;
|
|
104
|
-
maximum?: number;
|
|
105
|
-
const?: any;
|
|
106
|
-
exclusiveMaximum?: number;
|
|
107
|
-
minimum?: number;
|
|
108
|
-
exclusiveMinimum?: number;
|
|
109
|
-
maxLength?: number;
|
|
110
|
-
minLength?: number;
|
|
111
|
-
pattern?: string;
|
|
112
|
-
maxItems?: number;
|
|
113
|
-
minItems?: number;
|
|
114
|
-
uniqueItems?: boolean;
|
|
115
|
-
maxProperties?: number;
|
|
116
|
-
minProperties?: number;
|
|
117
|
-
required?: string[];
|
|
118
|
-
enum?: any[];
|
|
119
|
-
prefixItems?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
120
|
-
contentMediaType?: string;
|
|
121
|
-
contentEncoding?: string;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
declare function createSchemaFromZod(schema: {
|
|
125
|
-
input?: z.ZodType<any>;
|
|
126
|
-
output?: z.ZodType<any>;
|
|
127
|
-
}): {
|
|
128
|
-
input: SchemaObject | {
|
|
129
|
-
type: string;
|
|
130
|
-
};
|
|
131
|
-
output: SchemaObject | {
|
|
132
|
-
type: string;
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
declare function getOpenAPIDocument(initSilgi: InitSilgi<any, any>): OpenAPIObject;
|
|
136
|
-
declare function getOpenAPIPath(initSilgi: InitSilgi<any, any>): string | undefined;
|
|
137
|
-
|
|
138
|
-
export { type DefaultSilgiPlugin, type OpenAPIPluginConfig, createOpenAPIPlugin, createSchema, createSchemaFromZod, getOpenAPIDocument, getOpenAPIPath };
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
|
|
2
|
-
import { SchemaObject, ServerObject, OpenAPIObject } from 'openapi3-ts/oas31';
|
|
3
|
-
import { P as PergelPlugin, D as DefaultContext, a as DefaultInterface, I as InitSilgi } from '../shared/silgi.D5qK9QOm.js';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import 'consola';
|
|
6
|
-
import 'h3';
|
|
7
|
-
import 'hookable';
|
|
8
|
-
|
|
9
|
-
interface DefaultSilgiPlugin {
|
|
10
|
-
openapi?: {
|
|
11
|
-
schema?: {
|
|
12
|
-
input?: SchemaObject;
|
|
13
|
-
output?: SchemaObject;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
declare module 'silgi' {
|
|
18
|
-
interface DefaultInterface {
|
|
19
|
-
plugins: DefaultSilgiPlugin;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
interface OpenAPIPluginConfig {
|
|
23
|
-
title?: string;
|
|
24
|
-
version?: string;
|
|
25
|
-
description?: string;
|
|
26
|
-
servers?: ServerObject[];
|
|
27
|
-
writeToFile?: boolean;
|
|
28
|
-
outputPath?: string;
|
|
29
|
-
}
|
|
30
|
-
declare const createOpenAPIPlugin: (options?: OpenAPIPluginConfig | undefined) => PergelPlugin<DefaultContext, DefaultInterface, OpenAPIPluginConfig>;
|
|
31
|
-
declare function createSchema(schema: {
|
|
32
|
-
input?: Partial<SchemaObject>;
|
|
33
|
-
output?: Partial<SchemaObject>;
|
|
34
|
-
}): {
|
|
35
|
-
input: {
|
|
36
|
-
discriminator?: openapi3_ts_oas31.DiscriminatorObject;
|
|
37
|
-
readOnly?: boolean;
|
|
38
|
-
writeOnly?: boolean;
|
|
39
|
-
xml?: openapi3_ts_oas31.XmlObject;
|
|
40
|
-
externalDocs?: openapi3_ts_oas31.ExternalDocumentationObject;
|
|
41
|
-
example?: any;
|
|
42
|
-
examples?: any[];
|
|
43
|
-
deprecated?: boolean;
|
|
44
|
-
type: string | openapi3_ts_oas31.SchemaObjectType[];
|
|
45
|
-
format?: "int32" | "int64" | "float" | "double" | "byte" | "binary" | "date" | "date-time" | "password" | string;
|
|
46
|
-
allOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
47
|
-
oneOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
48
|
-
anyOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
49
|
-
not?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
50
|
-
items?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
51
|
-
properties?: {
|
|
52
|
-
[propertyName: string]: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
53
|
-
};
|
|
54
|
-
additionalProperties?: SchemaObject | openapi3_ts_oas31.ReferenceObject | boolean;
|
|
55
|
-
propertyNames?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
56
|
-
description?: string;
|
|
57
|
-
default?: any;
|
|
58
|
-
title?: string;
|
|
59
|
-
multipleOf?: number;
|
|
60
|
-
maximum?: number;
|
|
61
|
-
const?: any;
|
|
62
|
-
exclusiveMaximum?: number;
|
|
63
|
-
minimum?: number;
|
|
64
|
-
exclusiveMinimum?: number;
|
|
65
|
-
maxLength?: number;
|
|
66
|
-
minLength?: number;
|
|
67
|
-
pattern?: string;
|
|
68
|
-
maxItems?: number;
|
|
69
|
-
minItems?: number;
|
|
70
|
-
uniqueItems?: boolean;
|
|
71
|
-
maxProperties?: number;
|
|
72
|
-
minProperties?: number;
|
|
73
|
-
required?: string[];
|
|
74
|
-
enum?: any[];
|
|
75
|
-
prefixItems?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
76
|
-
contentMediaType?: string;
|
|
77
|
-
contentEncoding?: string;
|
|
78
|
-
};
|
|
79
|
-
output: {
|
|
80
|
-
discriminator?: openapi3_ts_oas31.DiscriminatorObject;
|
|
81
|
-
readOnly?: boolean;
|
|
82
|
-
writeOnly?: boolean;
|
|
83
|
-
xml?: openapi3_ts_oas31.XmlObject;
|
|
84
|
-
externalDocs?: openapi3_ts_oas31.ExternalDocumentationObject;
|
|
85
|
-
example?: any;
|
|
86
|
-
examples?: any[];
|
|
87
|
-
deprecated?: boolean;
|
|
88
|
-
type: string | openapi3_ts_oas31.SchemaObjectType[];
|
|
89
|
-
format?: "int32" | "int64" | "float" | "double" | "byte" | "binary" | "date" | "date-time" | "password" | string;
|
|
90
|
-
allOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
91
|
-
oneOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
92
|
-
anyOf?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
93
|
-
not?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
94
|
-
items?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
95
|
-
properties?: {
|
|
96
|
-
[propertyName: string]: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
97
|
-
};
|
|
98
|
-
additionalProperties?: SchemaObject | openapi3_ts_oas31.ReferenceObject | boolean;
|
|
99
|
-
propertyNames?: SchemaObject | openapi3_ts_oas31.ReferenceObject;
|
|
100
|
-
description?: string;
|
|
101
|
-
default?: any;
|
|
102
|
-
title?: string;
|
|
103
|
-
multipleOf?: number;
|
|
104
|
-
maximum?: number;
|
|
105
|
-
const?: any;
|
|
106
|
-
exclusiveMaximum?: number;
|
|
107
|
-
minimum?: number;
|
|
108
|
-
exclusiveMinimum?: number;
|
|
109
|
-
maxLength?: number;
|
|
110
|
-
minLength?: number;
|
|
111
|
-
pattern?: string;
|
|
112
|
-
maxItems?: number;
|
|
113
|
-
minItems?: number;
|
|
114
|
-
uniqueItems?: boolean;
|
|
115
|
-
maxProperties?: number;
|
|
116
|
-
minProperties?: number;
|
|
117
|
-
required?: string[];
|
|
118
|
-
enum?: any[];
|
|
119
|
-
prefixItems?: (SchemaObject | openapi3_ts_oas31.ReferenceObject)[];
|
|
120
|
-
contentMediaType?: string;
|
|
121
|
-
contentEncoding?: string;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
declare function createSchemaFromZod(schema: {
|
|
125
|
-
input?: z.ZodType<any>;
|
|
126
|
-
output?: z.ZodType<any>;
|
|
127
|
-
}): {
|
|
128
|
-
input: SchemaObject | {
|
|
129
|
-
type: string;
|
|
130
|
-
};
|
|
131
|
-
output: SchemaObject | {
|
|
132
|
-
type: string;
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
declare function getOpenAPIDocument(initSilgi: InitSilgi<any, any>): OpenAPIObject;
|
|
136
|
-
declare function getOpenAPIPath(initSilgi: InitSilgi<any, any>): string | undefined;
|
|
137
|
-
|
|
138
|
-
export { type DefaultSilgiPlugin, type OpenAPIPluginConfig, createOpenAPIPlugin, createSchema, createSchemaFromZod, getOpenAPIDocument, getOpenAPIPath };
|