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.
Files changed (186) hide show
  1. package/README.md +102 -1
  2. package/dist/_virtual/_rolldown/runtime.mjs +5 -0
  3. package/dist/adapters/astro.d.mts +17 -0
  4. package/dist/adapters/astro.mjs +24 -0
  5. package/dist/adapters/aws-lambda.d.mts +31 -0
  6. package/dist/adapters/aws-lambda.mjs +85 -0
  7. package/dist/adapters/elysia.d.mts +17 -0
  8. package/dist/adapters/elysia.mjs +76 -0
  9. package/dist/adapters/express.d.mts +16 -0
  10. package/dist/adapters/express.mjs +78 -0
  11. package/dist/adapters/fastify.d.mts +15 -0
  12. package/dist/adapters/fastify.mjs +78 -0
  13. package/dist/adapters/message-port.d.mts +37 -0
  14. package/dist/adapters/message-port.mjs +129 -0
  15. package/dist/adapters/nestjs.d.mts +25 -0
  16. package/dist/adapters/nestjs.mjs +91 -0
  17. package/dist/adapters/nextjs.d.mts +21 -0
  18. package/dist/adapters/nextjs.mjs +30 -0
  19. package/dist/adapters/peer.d.mts +27 -0
  20. package/dist/adapters/peer.mjs +36 -0
  21. package/dist/adapters/remix.d.mts +17 -0
  22. package/dist/adapters/remix.mjs +24 -0
  23. package/dist/adapters/solidstart.d.mts +14 -0
  24. package/dist/adapters/solidstart.mjs +30 -0
  25. package/dist/adapters/sveltekit.d.mts +18 -0
  26. package/dist/adapters/sveltekit.mjs +33 -0
  27. package/dist/analyze.mjs +26 -0
  28. package/dist/broker/index.d.mts +62 -0
  29. package/dist/broker/index.mjs +153 -0
  30. package/dist/broker/nats.d.mts +33 -0
  31. package/dist/broker/nats.mjs +31 -0
  32. package/dist/broker/redis.d.mts +51 -0
  33. package/dist/broker/redis.mjs +92 -0
  34. package/dist/builder.d.mts +36 -0
  35. package/dist/builder.mjs +51 -0
  36. package/dist/callable.d.mts +17 -0
  37. package/dist/callable.mjs +42 -0
  38. package/dist/client/adapters/fetch/index.d.mts +17 -0
  39. package/dist/client/adapters/fetch/index.mjs +61 -0
  40. package/dist/client/adapters/ofetch/index.d.mts +41 -0
  41. package/dist/client/adapters/ofetch/index.mjs +92 -0
  42. package/dist/client/client.d.mts +29 -0
  43. package/dist/client/client.mjs +54 -0
  44. package/dist/client/dynamic-link.d.mts +15 -0
  45. package/dist/client/dynamic-link.mjs +16 -0
  46. package/dist/client/index.d.mts +7 -0
  47. package/dist/client/index.mjs +6 -0
  48. package/dist/client/interceptor.d.mts +31 -0
  49. package/dist/client/interceptor.mjs +34 -0
  50. package/dist/client/merge.d.mts +28 -0
  51. package/dist/client/merge.mjs +30 -0
  52. package/dist/client/openapi.d.mts +29 -0
  53. package/dist/client/openapi.mjs +89 -0
  54. package/dist/client/plugins/batch.d.mts +20 -0
  55. package/dist/client/plugins/batch.mjs +64 -0
  56. package/dist/client/plugins/csrf.d.mts +13 -0
  57. package/dist/client/plugins/csrf.mjs +20 -0
  58. package/dist/client/plugins/dedupe.d.mts +10 -0
  59. package/dist/client/plugins/dedupe.mjs +28 -0
  60. package/dist/client/plugins/index.d.mts +5 -0
  61. package/dist/client/plugins/index.mjs +5 -0
  62. package/dist/client/plugins/retry.d.mts +11 -0
  63. package/dist/client/plugins/retry.mjs +21 -0
  64. package/dist/client/server.d.mts +16 -0
  65. package/dist/client/server.mjs +60 -0
  66. package/dist/client/types.d.mts +29 -0
  67. package/dist/codec/devalue.d.mts +21 -0
  68. package/dist/codec/devalue.mjs +32 -0
  69. package/dist/codec/msgpack.d.mts +21 -0
  70. package/dist/codec/msgpack.mjs +59 -0
  71. package/dist/compile.d.mts +52 -0
  72. package/dist/compile.mjs +304 -0
  73. package/dist/contract.d.mts +36 -0
  74. package/dist/contract.mjs +40 -0
  75. package/dist/core/error.d.mts +104 -0
  76. package/dist/core/error.mjs +139 -0
  77. package/dist/core/handler.mjs +546 -0
  78. package/dist/core/iterator.d.mts +17 -0
  79. package/dist/core/iterator.mjs +79 -0
  80. package/dist/core/router-utils.mjs +16 -0
  81. package/dist/core/schema.d.mts +19 -0
  82. package/dist/core/schema.mjs +26 -0
  83. package/dist/core/serve.mjs +38 -0
  84. package/dist/core/sse.d.mts +16 -0
  85. package/dist/core/sse.mjs +95 -0
  86. package/dist/core/storage.d.mts +21 -0
  87. package/dist/core/storage.mjs +63 -0
  88. package/dist/core/utils.mjs +21 -0
  89. package/dist/fast-stringify.mjs +125 -0
  90. package/dist/index.d.mts +15 -37
  91. package/dist/index.mjs +13 -7
  92. package/dist/integrations/ai/index.d.mts +25 -0
  93. package/dist/integrations/ai/index.mjs +116 -0
  94. package/dist/integrations/react/index.d.mts +83 -0
  95. package/dist/integrations/react/index.mjs +197 -0
  96. package/dist/integrations/tanstack-query/index.d.mts +120 -0
  97. package/dist/integrations/tanstack-query/index.mjs +100 -0
  98. package/dist/integrations/tanstack-query/ssr.d.mts +51 -0
  99. package/dist/integrations/tanstack-query/ssr.mjs +89 -0
  100. package/dist/integrations/zod/converter.d.mts +75 -0
  101. package/dist/integrations/zod/converter.mjs +345 -0
  102. package/dist/integrations/zod/index.d.mts +2 -0
  103. package/dist/integrations/zod/index.mjs +2 -0
  104. package/dist/lazy.d.mts +24 -0
  105. package/dist/lazy.mjs +27 -0
  106. package/dist/lifecycle.d.mts +36 -0
  107. package/dist/lifecycle.mjs +46 -0
  108. package/dist/map-input.d.mts +17 -0
  109. package/dist/map-input.mjs +24 -0
  110. package/dist/plugins/analytics.d.mts +168 -0
  111. package/dist/plugins/analytics.mjs +459 -0
  112. package/dist/plugins/batch-server.d.mts +20 -0
  113. package/dist/plugins/batch-server.mjs +86 -0
  114. package/dist/plugins/body-limit.d.mts +16 -0
  115. package/dist/plugins/body-limit.mjs +44 -0
  116. package/dist/plugins/cache.d.mts +170 -0
  117. package/dist/plugins/cache.mjs +200 -0
  118. package/dist/plugins/coerce.d.mts +21 -0
  119. package/dist/plugins/coerce.mjs +46 -0
  120. package/dist/plugins/compression.d.mts +19 -0
  121. package/dist/plugins/compression.mjs +23 -0
  122. package/dist/plugins/cookies.d.mts +44 -0
  123. package/dist/plugins/cookies.mjs +67 -0
  124. package/dist/plugins/cors.d.mts +39 -0
  125. package/dist/plugins/cors.mjs +56 -0
  126. package/dist/plugins/custom-serializer.d.mts +57 -0
  127. package/dist/plugins/custom-serializer.mjs +40 -0
  128. package/dist/plugins/file-upload.d.mts +38 -0
  129. package/dist/plugins/file-upload.mjs +100 -0
  130. package/dist/plugins/index.d.mts +16 -0
  131. package/dist/plugins/index.mjs +16 -0
  132. package/dist/plugins/otel.d.mts +35 -0
  133. package/dist/plugins/otel.mjs +40 -0
  134. package/dist/plugins/pino.d.mts +60 -0
  135. package/dist/plugins/pino.mjs +42 -0
  136. package/dist/plugins/pubsub.d.mts +50 -0
  137. package/dist/plugins/pubsub.mjs +53 -0
  138. package/dist/plugins/ratelimit.d.mts +51 -0
  139. package/dist/plugins/ratelimit.mjs +81 -0
  140. package/dist/plugins/signing.d.mts +41 -0
  141. package/dist/plugins/signing.mjs +115 -0
  142. package/dist/plugins/strict-get.d.mts +10 -0
  143. package/dist/plugins/strict-get.mjs +33 -0
  144. package/dist/route/add.mjs +240 -0
  145. package/dist/route/compiler.mjs +373 -0
  146. package/dist/route/context.mjs +12 -0
  147. package/dist/route/types.d.mts +11 -0
  148. package/dist/route/utils.mjs +17 -0
  149. package/dist/scalar.d.mts +53 -0
  150. package/dist/scalar.mjs +315 -0
  151. package/dist/silgi.d.mts +139 -0
  152. package/dist/silgi.mjs +113 -0
  153. package/dist/trpc-interop.d.mts +22 -0
  154. package/dist/trpc-interop.mjs +68 -0
  155. package/dist/types.d.mts +82 -0
  156. package/dist/ws.d.mts +42 -0
  157. package/dist/ws.mjs +137 -0
  158. package/lib/dashboard/index.html +123 -0
  159. package/lib/ocache.d.mts +1 -0
  160. package/lib/ocache.mjs +1 -0
  161. package/lib/ofetch.d.mts +1 -0
  162. package/lib/ofetch.mjs +1 -0
  163. package/lib/srvx.d.mts +1 -0
  164. package/lib/srvx.mjs +1 -0
  165. package/lib/unstorage.d.mts +1 -0
  166. package/lib/unstorage.mjs +1 -0
  167. package/package.json +291 -65
  168. package/bin/silgi.mjs +0 -3
  169. package/dist/chunks/generate.mjs +0 -933
  170. package/dist/chunks/init.mjs +0 -21
  171. package/dist/cli/config.d.mts +0 -19
  172. package/dist/cli/config.d.ts +0 -19
  173. package/dist/cli/config.mjs +0 -5
  174. package/dist/cli/index.d.mts +0 -2
  175. package/dist/cli/index.d.ts +0 -2
  176. package/dist/cli/index.mjs +0 -119
  177. package/dist/index.d.ts +0 -37
  178. package/dist/plugins/openapi.d.mts +0 -138
  179. package/dist/plugins/openapi.d.ts +0 -138
  180. package/dist/plugins/openapi.mjs +0 -204
  181. package/dist/plugins/scalar.d.mts +0 -14
  182. package/dist/plugins/scalar.d.ts +0 -14
  183. package/dist/plugins/scalar.mjs +0 -66
  184. package/dist/shared/silgi.BMCYk2cR.mjs +0 -841
  185. package/dist/shared/silgi.D5qK9QOm.d.mts +0 -301
  186. package/dist/shared/silgi.D5qK9QOm.d.ts +0 -301
@@ -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 };
@@ -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 };
@@ -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 };
@@ -1,5 +0,0 @@
1
- function defineSilgiConfig(config) {
2
- return config;
3
- }
4
-
5
- export { defineSilgiConfig };
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -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 };