@innet/server 2.0.0-beta.8 → 2.0.0-beta.9
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/constants.d.ts +4 -0
- package/handler/handler.d.ts +106 -0
- package/handler/index.d.ts +1 -0
- package/hooks/index.d.ts +33 -0
- package/hooks/useAction/index.d.ts +1 -0
- package/hooks/useAction/useAction.d.ts +4 -0
- package/hooks/useApi/index.d.ts +1 -0
- package/hooks/useApi/useApi.d.ts +11 -0
- package/hooks/useBlock/index.d.ts +1 -0
- package/hooks/useBlock/useBlock.d.ts +2 -0
- package/hooks/useBody/index.d.ts +1 -0
- package/hooks/useBody/useBody.d.ts +1 -0
- package/hooks/useBodyFile/index.d.ts +1 -0
- package/hooks/useBodyFile/useBodyFile.d.ts +3 -0
- package/hooks/useClientIp/index.d.ts +1 -0
- package/hooks/useClientIp/useClientIp.d.ts +1 -0
- package/hooks/useComponentName/index.d.ts +1 -0
- package/hooks/useComponentName/useComponentName.d.ts +1 -0
- package/hooks/useCookies/index.d.ts +1 -0
- package/hooks/useCookies/useCookies.d.ts +1 -0
- package/hooks/useEffect/index.d.ts +1 -0
- package/hooks/useEffect/useEffect.d.ts +2 -0
- package/hooks/useEndpoint/index.d.ts +1 -0
- package/hooks/useEndpoint/useEndpoint.d.ts +10 -0
- package/hooks/useHeaders/index.d.ts +1 -0
- package/hooks/useHeaders/useHeaders.d.ts +2 -0
- package/hooks/useHost/index.d.ts +1 -0
- package/hooks/useHost/useHost.d.ts +7 -0
- package/hooks/useIsServerHttps/index.d.ts +1 -0
- package/hooks/useIsServerHttps/useIsServerHttps.d.ts +3 -0
- package/hooks/useNewSchema/index.d.ts +1 -0
- package/hooks/useNewSchema/useNewSchema.d.ts +2 -0
- package/hooks/useNewSchema/useNewSchema.es6.js +1 -0
- package/hooks/useNewSchema/useNewSchema.js +1 -0
- package/hooks/useObjectRule/index.d.ts +1 -0
- package/hooks/useObjectRule/useObjectRule.d.ts +4 -0
- package/hooks/useObjectSchemaContext/index.d.ts +1 -0
- package/hooks/useObjectSchemaContext/useObjectSchemaContext.d.ts +3 -0
- package/hooks/useOneElementError/index.d.ts +1 -0
- package/hooks/useOneElementError/useOneElementError.d.ts +1 -0
- package/hooks/useParam/index.d.ts +1 -0
- package/hooks/useParam/useParam.d.ts +7 -0
- package/hooks/useParams/index.d.ts +1 -0
- package/hooks/useParams/useParams.d.ts +3 -0
- package/hooks/useParentRule/index.d.ts +1 -0
- package/hooks/useParentRule/useParentRule.d.ts +4 -0
- package/hooks/usePath/index.d.ts +1 -0
- package/hooks/usePath/usePath.d.ts +1 -0
- package/hooks/useRequest/index.d.ts +1 -0
- package/hooks/useRequest/useRequest.d.ts +1 -0
- package/hooks/useRequestHandler/index.d.ts +1 -0
- package/hooks/useRequestHandler/useRequestHandler.d.ts +4 -0
- package/hooks/useResponse/index.d.ts +1 -0
- package/hooks/useResponse/useResponse.d.ts +1 -0
- package/hooks/useRule/index.d.ts +1 -0
- package/hooks/useRule/useRule.d.ts +6 -0
- package/hooks/useSchemaContext/index.d.ts +1 -0
- package/hooks/useSchemaContext/useSchemaContext.d.ts +5 -0
- package/hooks/useSchemaType/index.d.ts +1 -0
- package/hooks/useSchemaType/useSchemaType.d.ts +5 -0
- package/hooks/useSearch/index.d.ts +1 -0
- package/hooks/useSearch/useSearch.d.ts +1 -0
- package/hooks/useServer/index.d.ts +1 -0
- package/hooks/useServer/useServer.d.ts +10 -0
- package/hooks/useServerPlugin/index.d.ts +1 -0
- package/hooks/useServerPlugin/useServerPlugin.d.ts +2 -0
- package/hooks/useServerPlugins/index.d.ts +1 -0
- package/hooks/useServerPlugins/useServerPlugins.d.ts +4 -0
- package/hooks/useServerPort/index.d.ts +1 -0
- package/hooks/useServerPort/useServerPort.d.ts +3 -0
- package/hooks/useTag/index.d.ts +1 -0
- package/hooks/useTag/useTag.d.ts +3 -0
- package/hooks/useThrow/index.d.ts +1 -0
- package/hooks/useThrow/useThrow.d.ts +1 -0
- package/index.d.ts +6 -0
- package/package.json +1 -1
- package/plugins/handler/index.d.ts +1 -0
- package/plugins/handler/serverFn/index.d.ts +1 -0
- package/plugins/handler/serverFn/serverFn.d.ts +2 -0
- package/plugins/index.d.ts +5 -0
- package/plugins/main/api/api.d.ts +25 -0
- package/plugins/main/api/index.d.ts +1 -0
- package/plugins/main/body/body.d.ts +5 -0
- package/plugins/main/body/index.d.ts +1 -0
- package/plugins/main/contact/contact.d.ts +10 -0
- package/plugins/main/contact/index.d.ts +1 -0
- package/plugins/main/endpoint/endpoint.d.ts +43 -0
- package/plugins/main/endpoint/endpoint.es6.js +2 -0
- package/plugins/main/endpoint/endpoint.js +2 -0
- package/plugins/main/endpoint/index.d.ts +1 -0
- package/plugins/main/host/host.d.ts +16 -0
- package/plugins/main/host/host.es6.js +1 -0
- package/plugins/main/host/host.js +1 -0
- package/plugins/main/host/index.d.ts +1 -0
- package/plugins/main/index.d.ts +13 -0
- package/plugins/main/license/index.d.ts +1 -0
- package/plugins/main/license/license.d.ts +21 -0
- package/plugins/main/param/index.d.ts +1 -0
- package/plugins/main/param/param.d.ts +36 -0
- package/plugins/main/preset/index.d.ts +1 -0
- package/plugins/main/preset/preset.d.ts +3 -0
- package/plugins/main/response/index.d.ts +1 -0
- package/plugins/main/response/response.d.ts +21 -0
- package/plugins/main/return/index.d.ts +1 -0
- package/plugins/main/return/return.d.ts +4 -0
- package/plugins/main/server/index.d.ts +1 -0
- package/plugins/main/server/server.d.ts +13 -0
- package/plugins/main/tag/index.d.ts +1 -0
- package/plugins/main/tag/tag.d.ts +19 -0
- package/plugins/main/tag/tag.es6.js +1 -0
- package/plugins/main/tag/tag.js +1 -0
- package/plugins/main/variable/index.d.ts +1 -0
- package/plugins/main/variable/variable.d.ts +24 -0
- package/plugins/main/variable/variable.es6.js +4 -1
- package/plugins/main/variable/variable.js +4 -1
- package/plugins/request/cms/cms.d.ts +6 -0
- package/plugins/request/cms/index.d.ts +1 -0
- package/plugins/request/cookie/cookie.d.ts +7 -0
- package/plugins/request/cookie/index.d.ts +1 -0
- package/plugins/request/error/error.d.ts +61 -0
- package/plugins/request/error/index.d.ts +1 -0
- package/plugins/request/file/file.d.ts +5 -0
- package/plugins/request/file/index.d.ts +1 -0
- package/plugins/request/header/header.d.ts +6 -0
- package/plugins/request/header/index.d.ts +1 -0
- package/plugins/request/index.d.ts +8 -0
- package/plugins/request/proxy/index.d.ts +1 -0
- package/plugins/request/proxy/proxy.d.ts +8 -0
- package/plugins/request/redirect/index.d.ts +1 -0
- package/plugins/request/redirect/redirect.d.ts +18 -0
- package/plugins/request/redirect/redirect.es6.js +1 -0
- package/plugins/request/redirect/redirect.js +1 -0
- package/plugins/request/success/index.d.ts +1 -0
- package/plugins/request/success/success.d.ts +19 -0
- package/plugins/schema/any/any.d.ts +5 -0
- package/plugins/schema/any/index.d.ts +1 -0
- package/plugins/schema/array/array.d.ts +9 -0
- package/plugins/schema/array/index.d.ts +1 -0
- package/plugins/schema/binary/binary.d.ts +9 -0
- package/plugins/schema/binary/index.d.ts +1 -0
- package/plugins/schema/boolean/boolean.d.ts +5 -0
- package/plugins/schema/boolean/index.d.ts +1 -0
- package/plugins/schema/date/date.d.ts +8 -0
- package/plugins/schema/date/date.es6.js +6 -0
- package/plugins/schema/date/date.js +6 -0
- package/plugins/schema/date/index.d.ts +1 -0
- package/plugins/schema/field/field.d.ts +10 -0
- package/plugins/schema/field/index.d.ts +1 -0
- package/plugins/schema/index.d.ts +13 -0
- package/plugins/schema/integer/index.d.ts +1 -0
- package/plugins/schema/integer/integer.d.ts +45 -0
- package/plugins/schema/null/index.d.ts +1 -0
- package/plugins/schema/null/null.d.ts +5 -0
- package/plugins/schema/number/index.d.ts +1 -0
- package/plugins/schema/number/number.d.ts +41 -0
- package/plugins/schema/object/index.d.ts +1 -0
- package/plugins/schema/object/object.d.ts +6 -0
- package/plugins/schema/string/index.d.ts +1 -0
- package/plugins/schema/string/string.d.ts +36 -0
- package/plugins/schema/tuple/index.d.ts +1 -0
- package/plugins/schema/tuple/tuple.d.ts +6 -0
- package/plugins/schema/tuple/tuple.es6.js +1 -0
- package/plugins/schema/tuple/tuple.js +1 -0
- package/plugins/schema/uuid/index.d.ts +1 -0
- package/plugins/schema/uuid/uuid.d.ts +6 -0
- package/plugins/schema/uuid/uuid.es6.js +2 -0
- package/plugins/schema/uuid/uuid.js +2 -0
- package/plugins/utils/blacklist/blacklist.d.ts +5 -0
- package/plugins/utils/blacklist/index.d.ts +1 -0
- package/plugins/utils/dts/dts.d.ts +6 -0
- package/plugins/utils/dts/index.d.ts +1 -0
- package/plugins/utils/env/env.d.ts +7 -0
- package/plugins/utils/env/index.d.ts +1 -0
- package/plugins/utils/index.d.ts +7 -0
- package/plugins/utils/protection/index.d.ts +1 -0
- package/plugins/utils/protection/protection.d.ts +9 -0
- package/plugins/utils/swagger/index.d.ts +1 -0
- package/plugins/utils/swagger/swagger.d.ts +6 -0
- package/plugins/utils/swagger/swagger.es6.js +1 -0
- package/plugins/utils/swagger/swagger.js +1 -0
- package/plugins/utils/ui/index.d.ts +1 -0
- package/plugins/utils/ui/ui.d.ts +13 -0
- package/plugins/utils/whitelist/index.d.ts +1 -0
- package/plugins/utils/whitelist/whitelist.d.ts +5 -0
- package/types.d.ts +69 -0
- package/utils/FileData/Bin.d.ts +47 -0
- package/utils/FileData/index.d.ts +1 -0
- package/utils/JSONString/JSONString.d.ts +1 -0
- package/utils/JSONString/index.d.ts +1 -0
- package/utils/action/Action.d.ts +31 -0
- package/utils/action/index.d.ts +1 -0
- package/utils/dateFormat/dateFormat.d.ts +2 -0
- package/utils/dateFormat/index.d.ts +1 -0
- package/utils/decorators/index.d.ts +1 -0
- package/utils/decorators/once/index.d.ts +1 -0
- package/utils/decorators/once/once.d.ts +4 -0
- package/utils/decorators/once/once.es6.js +4 -0
- package/utils/decorators/once/once.js +4 -0
- package/utils/generateTypes/generateTypes.d.ts +3 -0
- package/utils/generateTypes/generateTypes.es6.js +1 -0
- package/utils/generateTypes/generateTypes.js +1 -0
- package/utils/generateTypes/index.d.ts +1 -0
- package/utils/getEndpoint/getEndpoint.d.ts +2 -0
- package/utils/getEndpoint/index.d.ts +1 -0
- package/utils/getOrAdd/getOrAdd.d.ts +1 -0
- package/utils/getOrAdd/index.d.ts +1 -0
- package/utils/getSafeSchema/getSafeSchema.d.ts +2 -0
- package/utils/getSafeSchema/index.d.ts +1 -0
- package/utils/httpOnStart/httpOnStart.d.ts +2 -0
- package/utils/httpOnStart/index.d.ts +1 -0
- package/utils/index.d.ts +14 -0
- package/utils/parseBody/index.d.ts +1 -0
- package/utils/parseBody/parseBody.d.ts +2 -0
- package/utils/parseFormBody/index.d.ts +1 -0
- package/utils/parseFormBody/parseFormBody.d.ts +2 -0
- package/utils/parseSearch/index.d.ts +1 -0
- package/utils/parseSearch/parseSearch.d.ts +3 -0
- package/utils/rules/arrayOf/arrayOf.d.ts +2 -0
- package/utils/rules/arrayOf/index.d.ts +1 -0
- package/utils/rules/bin/bin.d.ts +2 -0
- package/utils/rules/bin/index.d.ts +1 -0
- package/utils/rules/binaryAccept/binaryAccept.d.ts +2 -0
- package/utils/rules/binaryAccept/index.d.ts +1 -0
- package/utils/rules/constants.d.ts +1 -0
- package/utils/rules/dateTo/dateTo.d.ts +2 -0
- package/utils/rules/dateTo/index.d.ts +1 -0
- package/utils/rules/defaultTo/defaultTo.d.ts +1 -0
- package/utils/rules/defaultTo/index.d.ts +1 -0
- package/utils/rules/helpers.d.ts +8 -0
- package/utils/rules/index.d.ts +28 -0
- package/utils/rules/int/index.d.ts +1 -0
- package/utils/rules/int/int.d.ts +2 -0
- package/utils/rules/max/index.d.ts +1 -0
- package/utils/rules/max/max.d.ts +1 -0
- package/utils/rules/maxBin/index.d.ts +1 -0
- package/utils/rules/maxBin/maxBin.d.ts +2 -0
- package/utils/rules/maxDate/index.d.ts +1 -0
- package/utils/rules/maxDate/maxDate.d.ts +1 -0
- package/utils/rules/maxLength/index.d.ts +1 -0
- package/utils/rules/maxLength/maxLength.d.ts +1 -0
- package/utils/rules/min/index.d.ts +1 -0
- package/utils/rules/min/min.d.ts +1 -0
- package/utils/rules/minBin/index.d.ts +1 -0
- package/utils/rules/minBin/minBin.d.ts +2 -0
- package/utils/rules/minDate/index.d.ts +1 -0
- package/utils/rules/minDate/minDate.d.ts +1 -0
- package/utils/rules/minLength/index.d.ts +1 -0
- package/utils/rules/minLength/minLength.d.ts +1 -0
- package/utils/rules/nullable/index.d.ts +1 -0
- package/utils/rules/nullable/nullable.d.ts +1 -0
- package/utils/rules/num/index.d.ts +1 -0
- package/utils/rules/num/num.d.ts +1 -0
- package/utils/rules/objectOf/index.d.ts +1 -0
- package/utils/rules/objectOf/objectOf.d.ts +3 -0
- package/utils/rules/oneOf/index.d.ts +1 -0
- package/utils/rules/oneOf/oneOf.d.ts +2 -0
- package/utils/rules/optional/index.d.ts +1 -0
- package/utils/rules/optional/optional.d.ts +2 -0
- package/utils/rules/pattern/index.d.ts +1 -0
- package/utils/rules/pattern/pattern.d.ts +1 -0
- package/utils/rules/pipe/index.d.ts +1 -0
- package/utils/rules/pipe/pipe.d.ts +2 -0
- package/utils/rules/required/index.d.ts +1 -0
- package/utils/rules/required/required.d.ts +2 -0
- package/utils/rules/tupleOf/index.d.ts +1 -0
- package/utils/rules/tupleOf/tupleOf.d.ts +2 -0
- package/utils/rules/types.d.ts +4 -0
- package/utils/rules/uuidTo/index.d.ts +1 -0
- package/utils/rules/uuidTo/uuidTo.d.ts +1 -0
- package/utils/rules/values/index.d.ts +1 -0
- package/utils/rules/values/values.d.ts +1 -0
- package/utils/stringifySearch/index.d.ts +1 -0
- package/utils/stringifySearch/stringifySearch.d.ts +2 -0
package/constants.d.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { type JSXElement } from '@innet/jsx';
|
|
2
|
+
import { arraySync, async } from '@innet/utils';
|
|
3
|
+
import { type AnyProps, type ApiProps, type ArrayProps, type BinaryProps, blacklist, type BlacklistProps, type BodyProps, type BooleanProps, cms, type CmsProps, type ContactProps, type CookieProps, type DateProps, type DtsProps, type EndpointProps, type EnvProps, type ErrorProps, type FieldProps, file, type FileProps, type HeaderProps, type HostProps, type IntegerProps, type LicenseProps, type NullProps, type NumberProps, type ObjectProps, type ParamProps, preset, type PresetProps, protection, type ProtectionProps, type ProxyProps, type RedirectProps, type ResponseProps, type ReturnProps, type ServerProps, type StringProps, type SuccessProps, type SwaggerProps, type TagProps, type TupleProps, type UiProps, type UuidProps, type VariableProps, whitelist, type WhitelistProps } from '../plugins';
|
|
4
|
+
export declare const arrayPlugins: (typeof arraySync)[];
|
|
5
|
+
export declare const JSXPlugins: {
|
|
6
|
+
any: import("innet").HandlerPlugin;
|
|
7
|
+
api: import("innet").HandlerPlugin;
|
|
8
|
+
array: import("innet").HandlerPlugin;
|
|
9
|
+
binary: import("innet").HandlerPlugin;
|
|
10
|
+
blacklist: typeof blacklist;
|
|
11
|
+
body: import("innet").HandlerPlugin;
|
|
12
|
+
boolean: import("innet").HandlerPlugin;
|
|
13
|
+
cms: typeof cms;
|
|
14
|
+
contact: import("innet").HandlerPlugin;
|
|
15
|
+
cookie: import("innet").HandlerPlugin;
|
|
16
|
+
date: import("innet").HandlerPlugin;
|
|
17
|
+
dts: import("innet").HandlerPlugin;
|
|
18
|
+
endpoint: import("innet").HandlerPlugin;
|
|
19
|
+
env: import("innet").HandlerPlugin;
|
|
20
|
+
error: import("innet").HandlerPlugin;
|
|
21
|
+
field: import("innet").HandlerPlugin;
|
|
22
|
+
file: typeof file;
|
|
23
|
+
header: import("innet").HandlerPlugin;
|
|
24
|
+
host: import("innet").HandlerPlugin;
|
|
25
|
+
integer: import("innet").HandlerPlugin;
|
|
26
|
+
license: import("innet").HandlerPlugin;
|
|
27
|
+
null: import("innet").HandlerPlugin;
|
|
28
|
+
number: import("innet").HandlerPlugin;
|
|
29
|
+
object: import("innet").HandlerPlugin;
|
|
30
|
+
param: import("innet").HandlerPlugin;
|
|
31
|
+
preset: typeof preset;
|
|
32
|
+
protection: typeof protection;
|
|
33
|
+
proxy: import("innet").HandlerPlugin;
|
|
34
|
+
redirect: import("innet").HandlerPlugin;
|
|
35
|
+
response: import("innet").HandlerPlugin;
|
|
36
|
+
return: import("innet").HandlerPlugin;
|
|
37
|
+
server: import("innet").HandlerPlugin;
|
|
38
|
+
string: import("innet").HandlerPlugin;
|
|
39
|
+
success: import("innet").HandlerPlugin;
|
|
40
|
+
swagger: import("innet").HandlerPlugin;
|
|
41
|
+
tag: import("innet").HandlerPlugin;
|
|
42
|
+
tuple: import("innet").HandlerPlugin;
|
|
43
|
+
ui: import("innet").HandlerPlugin;
|
|
44
|
+
uuid: import("innet").HandlerPlugin;
|
|
45
|
+
variable: import("innet").HandlerPlugin;
|
|
46
|
+
whitelist: typeof whitelist;
|
|
47
|
+
};
|
|
48
|
+
export declare const fnPlugins: import("innet").Plugin[];
|
|
49
|
+
export declare const objectPlugins: import("innet").Plugin[];
|
|
50
|
+
export declare const promisePlugins: (typeof async)[];
|
|
51
|
+
export declare const handler: import("innet").Handler;
|
|
52
|
+
declare global {
|
|
53
|
+
namespace JSX {
|
|
54
|
+
type Element = ({} & string) | ArrayElement | FunctionElement | JSXElement | boolean | null | number | undefined;
|
|
55
|
+
interface ArrayElement extends Array<Element> {
|
|
56
|
+
}
|
|
57
|
+
type FunctionElement = () => Element;
|
|
58
|
+
interface ElementChildrenAttribute {
|
|
59
|
+
children: {};
|
|
60
|
+
}
|
|
61
|
+
interface IntrinsicElements {
|
|
62
|
+
any: AnyProps;
|
|
63
|
+
api: ApiProps;
|
|
64
|
+
array: ArrayProps;
|
|
65
|
+
binary: BinaryProps;
|
|
66
|
+
blacklist: BlacklistProps;
|
|
67
|
+
body: BodyProps;
|
|
68
|
+
boolean: BooleanProps;
|
|
69
|
+
cms: CmsProps;
|
|
70
|
+
contact: ContactProps;
|
|
71
|
+
cookie: CookieProps;
|
|
72
|
+
date: DateProps;
|
|
73
|
+
dts: DtsProps;
|
|
74
|
+
endpoint: EndpointProps;
|
|
75
|
+
env: EnvProps;
|
|
76
|
+
error: ErrorProps;
|
|
77
|
+
field: FieldProps;
|
|
78
|
+
file: FileProps;
|
|
79
|
+
header: HeaderProps;
|
|
80
|
+
host: HostProps;
|
|
81
|
+
integer: IntegerProps;
|
|
82
|
+
license: LicenseProps;
|
|
83
|
+
null: NullProps;
|
|
84
|
+
number: NumberProps;
|
|
85
|
+
object: ObjectProps;
|
|
86
|
+
param: ParamProps;
|
|
87
|
+
preset: PresetProps;
|
|
88
|
+
protection: ProtectionProps;
|
|
89
|
+
proxy: ProxyProps;
|
|
90
|
+
redirect: RedirectProps;
|
|
91
|
+
response: ResponseProps;
|
|
92
|
+
return: ReturnProps;
|
|
93
|
+
server: ServerProps;
|
|
94
|
+
string: StringProps;
|
|
95
|
+
success: SuccessProps;
|
|
96
|
+
/** @deprecated Use <ui> */
|
|
97
|
+
swagger: SwaggerProps;
|
|
98
|
+
tag: TagProps;
|
|
99
|
+
tuple: TupleProps;
|
|
100
|
+
ui: UiProps;
|
|
101
|
+
uuid: UuidProps;
|
|
102
|
+
variable: VariableProps;
|
|
103
|
+
whitelist: WhitelistProps;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './handler';
|
package/hooks/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export * from './useAction';
|
|
2
|
+
export * from './useApi';
|
|
3
|
+
export * from './useBlock';
|
|
4
|
+
export * from './useBody';
|
|
5
|
+
export * from './useBodyFile';
|
|
6
|
+
export * from './useClientIp';
|
|
7
|
+
export * from './useComponentName';
|
|
8
|
+
export * from './useCookies';
|
|
9
|
+
export * from './useEffect';
|
|
10
|
+
export * from './useEndpoint';
|
|
11
|
+
export * from './useHeaders';
|
|
12
|
+
export * from './useHost';
|
|
13
|
+
export * from './useIsServerHttps';
|
|
14
|
+
export * from './useNewSchema';
|
|
15
|
+
export * from './useObjectRule';
|
|
16
|
+
export * from './useObjectSchemaContext';
|
|
17
|
+
export * from './useOneElementError';
|
|
18
|
+
export * from './useParam';
|
|
19
|
+
export * from './useParams';
|
|
20
|
+
export * from './usePath';
|
|
21
|
+
export * from './useRequest';
|
|
22
|
+
export * from './useRequestHandler';
|
|
23
|
+
export * from './useResponse';
|
|
24
|
+
export * from './useRule';
|
|
25
|
+
export * from './useSchemaContext';
|
|
26
|
+
export * from './useSchemaType';
|
|
27
|
+
export * from './useSearch';
|
|
28
|
+
export * from './useServer';
|
|
29
|
+
export * from './useServerPlugin';
|
|
30
|
+
export * from './useServerPlugins';
|
|
31
|
+
export * from './useServerPort';
|
|
32
|
+
export * from './useTag';
|
|
33
|
+
export * from './useThrow';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useAction';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useApi';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Context } from '@innet/jsx';
|
|
2
|
+
import { type Document, type Endpoints } from '../../types';
|
|
3
|
+
import { type Rule } from '../../utils';
|
|
4
|
+
export interface ApiContext {
|
|
5
|
+
docs: Document;
|
|
6
|
+
endpoints: Endpoints;
|
|
7
|
+
prefix: string;
|
|
8
|
+
refRules: Record<string, Rule>;
|
|
9
|
+
}
|
|
10
|
+
export declare const apiContext: Context<ApiContext, ApiContext | undefined>;
|
|
11
|
+
export declare function useApi(): ApiContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useBlock';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useBody';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useBody<D>(): D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useBodyFile';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useClientIp';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useClientIp(): null | string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useComponentName';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useComponentName(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useCookies';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useCookies<D>(): D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useEffect';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useEndpoint';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context } from '@innet/jsx';
|
|
2
|
+
import { type EndpointProps } from '../../plugins';
|
|
3
|
+
import type { Endpoint, OperationObject } from '../../types';
|
|
4
|
+
export interface EndpointContext {
|
|
5
|
+
endpoint: Endpoint;
|
|
6
|
+
operation: OperationObject;
|
|
7
|
+
props: EndpointProps;
|
|
8
|
+
}
|
|
9
|
+
export declare const endpointContext: Context<EndpointContext, EndpointContext | undefined>;
|
|
10
|
+
export declare function useEndpoint(): EndpointContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useHeaders';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useHost';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context } from '@innet/jsx';
|
|
2
|
+
import { type ServerObject } from '../../types';
|
|
3
|
+
export interface HostContext {
|
|
4
|
+
server: ServerObject;
|
|
5
|
+
}
|
|
6
|
+
export declare const hostContext: Context<HostContext, HostContext | undefined>;
|
|
7
|
+
export declare function useHost(): HostContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useIsServerHttps';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useNewSchema';
|
|
@@ -17,6 +17,7 @@ function useNewSchema(schema = Object.create(null)) {
|
|
|
17
17
|
else if (parentSchema.type || '$ref' in parentSchema) {
|
|
18
18
|
const oldSchema = { ...parentSchema };
|
|
19
19
|
for (const key in parentSchema) {
|
|
20
|
+
// @ts-expect-error: FIXME
|
|
20
21
|
delete parentSchema[key];
|
|
21
22
|
}
|
|
22
23
|
parentSchema.oneOf = [oldSchema, schema];
|
|
@@ -21,6 +21,7 @@ function useNewSchema(schema = Object.create(null)) {
|
|
|
21
21
|
else if (parentSchema.type || '$ref' in parentSchema) {
|
|
22
22
|
const oldSchema = { ...parentSchema };
|
|
23
23
|
for (const key in parentSchema) {
|
|
24
|
+
// @ts-expect-error: FIXME
|
|
24
25
|
delete parentSchema[key];
|
|
25
26
|
}
|
|
26
27
|
parentSchema.oneOf = [oldSchema, schema];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useObjectRule';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useObjectSchemaContext';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Context } from '@innet/jsx';
|
|
2
|
+
export declare const objectSchemaContext: Context<import("openapi-types").OpenAPIV3_1.SchemaObject, import("openapi-types").OpenAPIV3_1.SchemaObject | undefined>;
|
|
3
|
+
export declare function useObjectSchemaContext(): import("openapi-types").OpenAPIV3_1.SchemaObject;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useOneElementError';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useOneElementError(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useParam';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context } from '@innet/jsx';
|
|
2
|
+
import { type ParamProps } from '../../plugins';
|
|
3
|
+
export interface ParamContext {
|
|
4
|
+
props: ParamProps;
|
|
5
|
+
}
|
|
6
|
+
export declare const paramContext: Context<ParamContext, ParamContext | undefined>;
|
|
7
|
+
export declare function useParam(): ParamContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useParams';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useParentRule';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './usePath';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePath(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useRequest';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRequest(): import("http").IncomingMessage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useRequestHandler';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useResponse';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useResponse(): import("http").ServerResponse<import("http").IncomingMessage>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useRule';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Context } from '@innet/jsx';
|
|
2
|
+
import { type Rule } from '../../utils/rules';
|
|
3
|
+
export type RuleContext = (rule: Rule) => void;
|
|
4
|
+
export declare const ruleContext: Context<RuleContext, null>;
|
|
5
|
+
export declare function useSetRule(): RuleContext;
|
|
6
|
+
export declare function useRule(rule: Rule): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useSchemaContext';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Context } from '@innet/jsx';
|
|
2
|
+
import { type SchemaObject } from '../../types';
|
|
3
|
+
export type SchemaContext = SchemaObject | SchemaObject[];
|
|
4
|
+
export declare const schemaContext: Context<SchemaContext, SchemaContext | undefined>;
|
|
5
|
+
export declare function useSchemaContext(): SchemaContext | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useSchemaType';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ObjectType, type SchemaObject, type ValuesSchemaProps } from '../../types';
|
|
2
|
+
export type SchemaType = 'any' | ObjectType;
|
|
3
|
+
type TypeMap<T extends SchemaType> = T extends 'integer' | 'number' ? number : T extends 'string' ? string : T extends 'object' ? object : T extends 'array' ? any[] : T extends 'boolean' ? boolean : T extends 'null' ? null : T extends 'any' ? any : unknown;
|
|
4
|
+
export declare function useSchemaType<T extends SchemaType>(type: T, { example, examples, ref, values, ...options }?: ValuesSchemaProps<TypeMap<T>> | undefined): SchemaObject | undefined;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useSearch';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useSearch<D>(): D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useServer';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context } from '@innet/jsx';
|
|
2
|
+
import { type Server as HttpServer } from 'http';
|
|
3
|
+
import { type Server as HttpsServer } from 'https';
|
|
4
|
+
export type ServerPlugin = () => any;
|
|
5
|
+
export interface ServerContext {
|
|
6
|
+
port: number;
|
|
7
|
+
server: HttpServer | HttpsServer;
|
|
8
|
+
}
|
|
9
|
+
export declare const serverContext: Context<ServerContext, ServerContext | undefined>;
|
|
10
|
+
export declare function useServer(): ServerContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useServerPlugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useServerPlugins';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useServerPort';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useTag';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Context } from '@innet/jsx';
|
|
2
|
+
export declare const tagContext: Context<import("openapi-types").OpenAPIV3.TagObject, import("openapi-types").OpenAPIV3.TagObject | undefined>;
|
|
3
|
+
export declare function useTag(): import("openapi-types").OpenAPIV3.TagObject | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useThrow';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useThrow(message: string): never;
|
package/index.d.ts
ADDED
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './serverFn';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './serverFn';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type HandlerPlugin } from 'innet';
|
|
2
|
+
export interface ApiProps {
|
|
3
|
+
children?: any;
|
|
4
|
+
/** A description of the API. [CommonMark syntax](https://spec.commonmark.or.org) MAY be used for rich text representation. */
|
|
5
|
+
description?: string;
|
|
6
|
+
exclude?: RegExp;
|
|
7
|
+
include?: RegExp;
|
|
8
|
+
/** URL path prefix scopes the API. */
|
|
9
|
+
prefix?: string;
|
|
10
|
+
/** A short summary of the API. */
|
|
11
|
+
summary?: string;
|
|
12
|
+
/** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */
|
|
13
|
+
termsOfService?: string;
|
|
14
|
+
/** The title of the API. */
|
|
15
|
+
title?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The version of the OpenAPI document (which is distinct from the
|
|
18
|
+
* [OpenAPI Specification version](https://swagger.io/specification/#oas-version)
|
|
19
|
+
* or the API implementation version).
|
|
20
|
+
* @example: 0.0.1
|
|
21
|
+
* @default: 0.0.0
|
|
22
|
+
* */
|
|
23
|
+
version?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const api: HandlerPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './body';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type HandlerPlugin } from 'innet';
|
|
2
|
+
export interface ContactProps {
|
|
3
|
+
/** The email address of the contact person/organization. This MUST be in the form of an email address. */
|
|
4
|
+
email?: string;
|
|
5
|
+
/** The identifying name of the contact person/organization. */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** The URL pointing to the contact information. This MUST be in the form of a URL. */
|
|
8
|
+
url?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const contact: HandlerPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './contact';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type HandlerPlugin } from 'innet';
|
|
2
|
+
import { type EndpointsMethods } from '../../../types';
|
|
3
|
+
export interface EndpointProps {
|
|
4
|
+
children?: any;
|
|
5
|
+
/**
|
|
6
|
+
* Declares this operation to be deprecated.
|
|
7
|
+
* Consumers SHOULD refrain from usage of the declared operation.
|
|
8
|
+
* Default value is false.
|
|
9
|
+
* */
|
|
10
|
+
deprecated?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* An optional, string description, intended to apply to all operations in this path.
|
|
13
|
+
* [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
|
|
14
|
+
* */
|
|
15
|
+
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* A method of the endpoint.
|
|
18
|
+
* */
|
|
19
|
+
method: EndpointsMethods;
|
|
20
|
+
/**
|
|
21
|
+
* `operationId` is an optional unique string used to identify an operation.
|
|
22
|
+
* If provided, these IDs must be unique among all operations described in your API.
|
|
23
|
+
* */
|
|
24
|
+
operationId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* A relative path to an individual endpoint.
|
|
27
|
+
* The property MUST begin with a forward slash (/).
|
|
28
|
+
* Path templating is allowed.
|
|
29
|
+
* When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts.
|
|
30
|
+
* Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical.
|
|
31
|
+
* */
|
|
32
|
+
path: string;
|
|
33
|
+
/**
|
|
34
|
+
* Declares this operation to make an endpoint private.
|
|
35
|
+
* That means the endpoint should not be described and will not be shown in the Open API documentation.
|
|
36
|
+
* */
|
|
37
|
+
private?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* An optional, string summary, intended to apply to all operations in this path.
|
|
40
|
+
* */
|
|
41
|
+
summary?: string;
|
|
42
|
+
}
|
|
43
|
+
export declare const endpoint: HandlerPlugin;
|