@innet/server 1.7.0 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3060 -387
- package/constants.d.ts +4 -1
- package/constants.es6.js +10 -2
- package/constants.js +11 -2
- package/declaration.d.ts +9 -0
- package/example/app/App/App.d.ts +1 -0
- package/example/app/App/index.d.ts +1 -0
- package/example/index.d.ts +1 -0
- package/example/requests/index.d.ts +1 -0
- package/example/requests/partners/EditPartner/EditPartner.d.ts +1 -0
- package/example/requests/partners/EditPartner/index.d.ts +1 -0
- package/example/requests/partners/GetPartner/GetPartner.d.ts +1 -0
- package/example/requests/partners/GetPartner/index.d.ts +1 -0
- package/example/requests/partners/GetPartners/GetPartners.d.ts +1 -0
- package/example/requests/partners/GetPartners/index.d.ts +1 -0
- package/example/requests/partners/index.d.ts +3 -0
- package/example/schemas/address/AddressSchema/AddressSchema.d.ts +1 -0
- package/example/schemas/address/AddressSchema/index.d.ts +1 -0
- package/example/schemas/address/index.d.ts +1 -0
- package/example/schemas/app/ListSchema/ListSchema.d.ts +1 -0
- package/example/schemas/app/ListSchema/index.d.ts +1 -0
- package/example/schemas/app/index.d.ts +1 -0
- package/example/schemas/index.d.ts +4 -0
- package/example/schemas/location/LocationSchema/LocationSchema.d.ts +1 -0
- package/example/schemas/location/LocationSchema/index.d.ts +1 -0
- package/example/schemas/location/index.d.ts +1 -0
- package/example/schemas/partner/EditPartnerSchema/EditPartnerSchema.d.ts +1 -0
- package/example/schemas/partner/EditPartnerSchema/index.d.ts +1 -0
- package/example/schemas/partner/PartnerSchema/PartnerSchema.d.ts +1 -0
- package/example/schemas/partner/PartnerSchema/index.d.ts +1 -0
- package/example/schemas/partner/index.d.ts +2 -0
- package/example/tags/Partner/Partner.d.ts +1 -0
- package/example/tags/Partner/index.d.ts +1 -0
- package/example/tags/index.d.ts +1 -0
- package/handler/handler.d.ts +96 -58
- package/handler/handler.es6.js +102 -63
- package/handler/handler.js +100 -65
- package/handler/index.d.ts +1 -1
- package/hooks/index.d.ts +25 -6
- package/hooks/index.es6.js +25 -6
- package/hooks/index.js +25 -18
- package/hooks/useAction/index.d.ts +1 -1
- package/hooks/useAction/useAction.d.ts +4 -4
- package/hooks/useAction/useAction.es6.js +9 -7
- package/hooks/useAction/useAction.js +9 -7
- package/hooks/useApi/index.d.ts +1 -0
- package/hooks/useApi/index.es6.js +1 -0
- package/hooks/useApi/index.js +10 -0
- package/hooks/useApi/useApi.d.ts +13 -0
- package/hooks/useApi/useApi.es6.js +12 -0
- package/hooks/useApi/useApi.js +17 -0
- package/hooks/useBlock/index.d.ts +1 -0
- package/hooks/useBlock/index.es6.js +1 -0
- package/hooks/{useFiles → useBlock}/index.js +2 -2
- package/hooks/useBlock/useBlock.d.ts +2 -0
- package/hooks/useBlock/useBlock.es6.js +14 -0
- package/hooks/useBlock/useBlock.js +18 -0
- package/hooks/useBody/index.d.ts +1 -1
- package/hooks/useBody/useBody.d.ts +1 -1
- package/hooks/useBody/useBody.es6.js +3 -2
- package/hooks/useBody/useBody.js +3 -2
- package/hooks/useBodyFile/index.d.ts +1 -0
- package/hooks/useBodyFile/index.es6.js +1 -0
- package/hooks/useBodyFile/index.js +10 -0
- package/hooks/useBodyFile/useBodyFile.d.ts +3 -0
- package/hooks/useBodyFile/useBodyFile.es6.js +14 -0
- package/hooks/useBodyFile/useBodyFile.js +19 -0
- package/hooks/useComponentName/index.d.ts +1 -0
- package/hooks/useComponentName/index.es6.js +1 -0
- package/hooks/useComponentName/index.js +9 -0
- package/hooks/useComponentName/useComponentName.d.ts +1 -0
- package/hooks/useComponentName/useComponentName.es6.js +8 -0
- package/hooks/useComponentName/useComponentName.js +12 -0
- package/hooks/useCookies/index.d.ts +1 -1
- package/hooks/useCookies/useCookies.d.ts +1 -2
- package/hooks/useCookies/useCookies.es6.js +3 -2
- package/hooks/useCookies/useCookies.js +3 -2
- package/hooks/useEndpoint/index.d.ts +1 -0
- package/hooks/useEndpoint/index.es6.js +1 -0
- package/hooks/useEndpoint/index.js +10 -0
- package/hooks/useEndpoint/useEndpoint.d.ts +10 -0
- package/hooks/useEndpoint/useEndpoint.es6.js +12 -0
- package/hooks/useEndpoint/useEndpoint.js +17 -0
- package/hooks/useHeaders/index.d.ts +1 -0
- package/hooks/useHeaders/index.es6.js +1 -0
- package/hooks/useHeaders/index.js +9 -0
- package/hooks/useHeaders/useHeaders.d.ts +3 -0
- package/hooks/useHeaders/useHeaders.es6.js +8 -0
- package/hooks/useHeaders/useHeaders.js +12 -0
- package/hooks/useHost/index.d.ts +1 -0
- package/hooks/useHost/index.es6.js +1 -0
- package/hooks/useHost/index.js +10 -0
- package/hooks/useHost/useHost.d.ts +7 -0
- package/hooks/useHost/useHost.es6.js +12 -0
- package/hooks/useHost/useHost.js +17 -0
- package/hooks/useNewSchema/index.d.ts +1 -0
- package/hooks/useNewSchema/index.es6.js +1 -0
- package/hooks/useNewSchema/index.js +9 -0
- package/hooks/useNewSchema/useNewSchema.d.ts +2 -0
- package/hooks/useNewSchema/useNewSchema.es6.js +32 -0
- package/hooks/useNewSchema/useNewSchema.js +36 -0
- package/hooks/useObjectRule/index.d.ts +1 -0
- package/hooks/useObjectRule/index.es6.js +1 -0
- package/hooks/useObjectRule/index.js +10 -0
- package/hooks/useObjectRule/useObjectRule.d.ts +4 -0
- package/hooks/useObjectRule/useObjectRule.es6.js +14 -0
- package/hooks/useObjectRule/useObjectRule.js +19 -0
- package/hooks/useOneElementError/index.d.ts +1 -0
- package/hooks/useOneElementError/index.es6.js +1 -0
- package/hooks/useOneElementError/index.js +9 -0
- package/hooks/useOneElementError/useOneElementError.d.ts +1 -0
- package/hooks/useOneElementError/useOneElementError.es6.js +8 -0
- package/hooks/useOneElementError/useOneElementError.js +12 -0
- package/hooks/useParam/index.d.ts +1 -0
- package/hooks/useParam/index.es6.js +1 -0
- package/hooks/useParam/index.js +10 -0
- package/hooks/useParam/useParam.d.ts +7 -0
- package/hooks/useParam/useParam.es6.js +12 -0
- package/hooks/useParam/useParam.js +17 -0
- package/hooks/useParams/index.d.ts +1 -0
- package/hooks/useParams/index.es6.js +1 -0
- package/hooks/useParams/index.js +10 -0
- package/hooks/useParams/useParams.d.ts +3 -0
- package/hooks/useParams/useParams.es6.js +8 -0
- package/hooks/useParams/useParams.js +13 -0
- package/hooks/useParentRule/index.d.ts +1 -0
- package/hooks/useParentRule/index.es6.js +1 -0
- package/hooks/useParentRule/index.js +10 -0
- package/hooks/useParentRule/useParentRule.d.ts +4 -0
- package/hooks/useParentRule/useParentRule.es6.js +10 -0
- package/hooks/useParentRule/useParentRule.js +15 -0
- package/hooks/usePath/index.d.ts +1 -0
- package/hooks/usePath/index.es6.js +1 -0
- package/hooks/usePath/index.js +9 -0
- package/hooks/usePath/usePath.d.ts +1 -0
- package/hooks/usePath/usePath.es6.js +8 -0
- package/hooks/{useFiles/useFiles.js → usePath/usePath.js} +4 -3
- package/hooks/useRequest/index.d.ts +1 -0
- package/hooks/useRequest/index.es6.js +1 -0
- package/hooks/useRequest/index.js +10 -0
- package/hooks/useRequest/useRequest.d.ts +5 -0
- package/hooks/useRequest/useRequest.es6.js +8 -0
- package/hooks/useRequest/useRequest.js +13 -0
- package/hooks/useResponse/index.d.ts +1 -0
- package/hooks/useResponse/index.es6.js +1 -0
- package/hooks/useResponse/index.js +10 -0
- package/hooks/useResponse/useResponse.d.ts +5 -0
- package/hooks/useResponse/useResponse.es6.js +8 -0
- package/hooks/useResponse/useResponse.js +13 -0
- package/hooks/useRule/index.d.ts +1 -0
- package/hooks/useRule/index.es6.js +1 -0
- package/hooks/useRule/index.js +11 -0
- package/hooks/useRule/useRule.d.ts +6 -0
- package/hooks/useRule/useRule.es6.js +17 -0
- package/hooks/useRule/useRule.js +23 -0
- package/hooks/useSchemaContext/index.d.ts +1 -0
- package/hooks/useSchemaContext/index.es6.js +1 -0
- package/hooks/useSchemaContext/index.js +10 -0
- package/hooks/useSchemaContext/useSchemaContext.d.ts +5 -0
- package/hooks/useSchemaContext/useSchemaContext.es6.js +8 -0
- package/hooks/useSchemaContext/useSchemaContext.js +13 -0
- package/hooks/useSchemaType/index.d.ts +1 -0
- package/hooks/useSchemaType/index.es6.js +1 -0
- package/hooks/useSchemaType/index.js +9 -0
- package/hooks/useSchemaType/useSchemaType.d.ts +4 -0
- package/hooks/useSchemaType/useSchemaType.es6.js +32 -0
- package/hooks/useSchemaType/useSchemaType.js +36 -0
- package/hooks/useSearch/index.d.ts +1 -1
- package/hooks/useSearch/useSearch.d.ts +1 -1
- package/hooks/useSearch/useSearch.es6.js +9 -2
- package/hooks/useSearch/useSearch.js +9 -2
- package/hooks/useServer/index.d.ts +1 -1
- package/hooks/useServer/useServer.d.ts +11 -7
- package/hooks/useServer/useServer.es6.js +7 -7
- package/hooks/useServer/useServer.js +7 -7
- package/hooks/useTag/index.d.ts +1 -0
- package/hooks/useTag/index.es6.js +1 -0
- package/hooks/useTag/index.js +10 -0
- package/hooks/useTag/useTag.d.ts +3 -0
- package/hooks/useTag/useTag.es6.js +8 -0
- package/hooks/useTag/useTag.js +13 -0
- package/hooks/useThrow/index.d.ts +1 -0
- package/hooks/useThrow/index.es6.js +1 -0
- package/hooks/useThrow/index.js +9 -0
- package/hooks/useThrow/useThrow.d.ts +1 -0
- package/hooks/useThrow/useThrow.es6.js +9 -0
- package/hooks/useThrow/useThrow.js +13 -0
- package/index.d.ts +6 -5
- package/index.es6.js +104 -21
- package/index.js +213 -44
- package/openApi.test.d.ts +1 -0
- package/package.json +27 -12
- package/{experimental/serverFn → plugins/handler}/index.d.ts +1 -1
- package/plugins/handler/index.es6.js +1 -0
- package/plugins/handler/index.js +4 -0
- package/plugins/handler/serverFn/index.d.ts +1 -0
- package/plugins/handler/serverFn/serverFn.d.ts +2 -0
- package/plugins/handler/serverFn/serverFn.es6.js +14 -0
- package/{experimental → plugins/handler}/serverFn/serverFn.js +9 -7
- package/plugins/index.d.ts +5 -15
- package/plugins/index.es6.js +5 -15
- package/plugins/index.js +5 -42
- package/plugins/main/api/api.d.ts +22 -0
- package/plugins/main/api/api.es6.js +180 -0
- package/plugins/main/api/api.js +188 -0
- package/plugins/main/api/index.d.ts +1 -0
- package/plugins/main/api/index.es6.js +1 -0
- package/plugins/main/api/index.js +9 -0
- package/plugins/main/body/body.d.ts +4 -0
- package/plugins/main/body/body.es6.js +55 -0
- package/plugins/main/body/body.js +63 -0
- package/plugins/main/body/index.d.ts +1 -0
- package/plugins/main/body/index.es6.js +1 -0
- package/plugins/main/body/index.js +9 -0
- package/plugins/main/contact/contact.d.ts +10 -0
- package/plugins/main/contact/contact.es6.js +16 -0
- package/plugins/main/contact/contact.js +20 -0
- package/plugins/main/contact/index.d.ts +1 -0
- package/plugins/main/contact/index.es6.js +1 -0
- package/plugins/main/contact/index.js +9 -0
- package/plugins/main/endpoint/endpoint.d.ts +37 -0
- package/plugins/main/endpoint/endpoint.es6.js +54 -0
- package/plugins/main/endpoint/endpoint.js +62 -0
- package/plugins/main/endpoint/index.d.ts +1 -0
- package/plugins/main/endpoint/index.es6.js +1 -0
- package/plugins/main/endpoint/index.js +9 -0
- package/plugins/main/fallback/fallback.d.ts +4 -0
- package/plugins/main/fallback/fallback.es6.js +19 -0
- package/plugins/main/fallback/fallback.js +23 -0
- package/plugins/main/fallback/index.d.ts +1 -0
- package/plugins/main/fallback/index.es6.js +1 -0
- package/plugins/main/fallback/index.js +9 -0
- package/plugins/main/host/host.d.ts +16 -0
- package/plugins/main/host/host.es6.js +26 -0
- package/plugins/main/host/host.js +34 -0
- package/plugins/main/host/index.d.ts +1 -0
- package/plugins/main/host/index.es6.js +1 -0
- package/plugins/main/host/index.js +9 -0
- package/plugins/main/index.d.ts +13 -0
- package/plugins/main/index.es6.js +13 -0
- package/plugins/main/index.js +16 -0
- package/plugins/main/license/index.d.ts +1 -0
- package/plugins/main/license/index.es6.js +1 -0
- package/plugins/main/license/index.js +9 -0
- package/plugins/main/license/license.d.ts +21 -0
- package/plugins/main/license/license.es6.js +15 -0
- package/plugins/main/license/license.js +19 -0
- package/plugins/main/param/index.d.ts +1 -0
- package/plugins/main/param/index.es6.js +1 -0
- package/plugins/main/param/index.js +9 -0
- package/plugins/main/param/param.d.ts +35 -0
- package/plugins/main/param/param.es6.js +63 -0
- package/plugins/main/param/param.js +71 -0
- package/plugins/main/request/index.d.ts +1 -0
- package/plugins/main/request/index.es6.js +1 -0
- package/plugins/main/request/index.js +9 -0
- package/plugins/main/request/request.d.ts +4 -0
- package/plugins/main/request/request.es6.js +21 -0
- package/plugins/main/request/request.js +25 -0
- package/plugins/main/response/index.d.ts +1 -0
- package/plugins/main/response/index.es6.js +1 -0
- package/plugins/main/response/index.js +9 -0
- package/plugins/main/response/response.d.ts +16 -0
- package/plugins/main/response/response.es6.js +44 -0
- package/plugins/main/response/response.js +52 -0
- package/plugins/{server → main/server}/index.d.ts +1 -1
- package/plugins/main/server/server.d.ts +13 -0
- package/plugins/main/server/server.es6.js +44 -0
- package/plugins/main/server/server.js +55 -0
- package/plugins/main/tag/index.d.ts +1 -0
- package/plugins/main/tag/index.es6.js +1 -0
- package/plugins/main/tag/index.js +9 -0
- package/plugins/main/tag/tag.d.ts +11 -0
- package/plugins/main/tag/tag.es6.js +29 -0
- package/plugins/main/tag/tag.js +37 -0
- package/plugins/main/variable/index.d.ts +1 -0
- package/plugins/main/variable/index.es6.js +1 -0
- package/plugins/main/variable/index.js +9 -0
- package/plugins/main/variable/variable.d.ts +24 -0
- package/plugins/main/variable/variable.es6.js +16 -0
- package/plugins/main/variable/variable.js +20 -0
- package/plugins/request/cms/cms.d.ts +5 -0
- package/plugins/request/cms/cms.es6.js +24 -0
- package/plugins/request/cms/cms.js +33 -0
- package/plugins/{cms → request/cms}/index.d.ts +1 -1
- package/plugins/request/cookie/cookie.d.ts +7 -0
- package/plugins/request/cookie/cookie.es6.js +28 -0
- package/plugins/request/cookie/cookie.js +36 -0
- package/plugins/{cookie → request/cookie}/index.d.ts +1 -1
- package/plugins/{error → request/error}/error.d.ts +60 -61
- package/plugins/{error → request/error}/error.es6.js +70 -70
- package/plugins/{error → request/error}/error.js +70 -75
- package/plugins/{error → request/error}/index.d.ts +1 -1
- package/plugins/request/file/file.d.ts +4 -0
- package/plugins/request/file/file.es6.js +38 -0
- package/plugins/request/file/file.js +48 -0
- package/plugins/{file → request/file}/index.d.ts +1 -1
- package/plugins/request/header/header.d.ts +6 -0
- package/plugins/request/header/header.es6.js +15 -0
- package/plugins/request/header/header.js +19 -0
- package/plugins/{header → request/header}/index.d.ts +1 -1
- package/plugins/request/index.d.ts +8 -0
- package/plugins/request/index.es6.js +8 -0
- package/plugins/request/index.js +11 -0
- package/plugins/{proxy → request/proxy}/index.d.ts +1 -1
- package/plugins/request/proxy/proxy.d.ts +6 -0
- package/plugins/request/proxy/proxy.es6.js +20 -0
- package/plugins/request/proxy/proxy.js +28 -0
- package/plugins/{redirect → request/redirect}/index.d.ts +1 -1
- package/plugins/{redirect → request/redirect}/redirect.d.ts +17 -19
- package/plugins/request/redirect/redirect.es6.js +41 -0
- package/plugins/request/redirect/redirect.js +46 -0
- package/plugins/{success → request/success}/index.d.ts +1 -1
- package/plugins/{success → request/success}/success.d.ts +17 -19
- package/plugins/request/success/success.es6.js +33 -0
- package/plugins/request/success/success.js +38 -0
- package/plugins/schema/array/array.d.ts +5 -0
- package/plugins/schema/array/array.es6.js +58 -0
- package/plugins/schema/array/array.js +66 -0
- package/plugins/schema/array/index.d.ts +1 -0
- package/plugins/schema/array/index.es6.js +1 -0
- package/plugins/schema/array/index.js +9 -0
- package/plugins/schema/binary/binary.d.ts +9 -0
- package/plugins/schema/binary/binary.es6.js +39 -0
- package/plugins/schema/binary/binary.js +43 -0
- package/plugins/schema/binary/index.d.ts +1 -0
- package/plugins/schema/binary/index.es6.js +1 -0
- package/plugins/{action → schema/binary}/index.js +2 -2
- package/plugins/schema/boolean/boolean.d.ts +5 -0
- package/plugins/schema/boolean/boolean.es6.js +32 -0
- package/plugins/schema/boolean/boolean.js +36 -0
- package/plugins/schema/boolean/index.d.ts +1 -0
- package/plugins/schema/boolean/index.es6.js +1 -0
- package/plugins/schema/boolean/index.js +9 -0
- package/plugins/schema/date/date.d.ts +8 -0
- package/plugins/schema/date/date.es6.js +64 -0
- package/plugins/schema/date/date.js +68 -0
- package/plugins/schema/date/index.d.ts +1 -0
- package/plugins/schema/date/index.es6.js +1 -0
- package/plugins/schema/date/index.js +9 -0
- package/plugins/schema/field/field.d.ts +6 -0
- package/plugins/schema/field/field.es6.js +46 -0
- package/plugins/schema/field/field.js +54 -0
- package/plugins/schema/field/index.d.ts +1 -0
- package/plugins/schema/field/index.es6.js +1 -0
- package/plugins/schema/field/index.js +9 -0
- package/plugins/schema/index.d.ts +12 -0
- package/plugins/schema/index.es6.js +12 -0
- package/plugins/schema/index.js +15 -0
- package/plugins/schema/integer/index.d.ts +1 -0
- package/plugins/schema/integer/index.es6.js +1 -0
- package/plugins/schema/integer/index.js +9 -0
- package/plugins/schema/integer/integer.d.ts +8 -0
- package/plugins/schema/integer/integer.es6.js +46 -0
- package/plugins/schema/integer/integer.js +50 -0
- package/plugins/schema/null/index.d.ts +1 -0
- package/plugins/schema/null/index.es6.js +1 -0
- package/plugins/schema/null/index.js +9 -0
- package/plugins/schema/null/null.d.ts +5 -0
- package/plugins/schema/null/null.es6.js +15 -0
- package/plugins/schema/null/null.js +19 -0
- package/plugins/schema/number/index.d.ts +1 -0
- package/plugins/schema/number/index.es6.js +1 -0
- package/plugins/schema/number/index.js +9 -0
- package/plugins/schema/number/number.d.ts +9 -0
- package/plugins/schema/number/number.es6.js +46 -0
- package/plugins/schema/number/number.js +50 -0
- package/plugins/schema/object/index.d.ts +1 -0
- package/plugins/schema/object/index.es6.js +1 -0
- package/plugins/schema/object/index.js +9 -0
- package/plugins/schema/object/object.d.ts +5 -0
- package/plugins/schema/object/object.es6.js +54 -0
- package/plugins/schema/object/object.js +62 -0
- package/plugins/schema/string/index.d.ts +1 -0
- package/plugins/schema/string/index.es6.js +1 -0
- package/plugins/schema/string/index.js +9 -0
- package/plugins/schema/string/string.d.ts +9 -0
- package/plugins/schema/string/string.es6.js +51 -0
- package/plugins/schema/string/string.js +55 -0
- package/plugins/schema/tuple/index.d.ts +1 -0
- package/plugins/schema/tuple/index.es6.js +1 -0
- package/plugins/schema/tuple/index.js +9 -0
- package/plugins/schema/tuple/tuple.d.ts +5 -0
- package/plugins/schema/tuple/tuple.es6.js +54 -0
- package/plugins/schema/tuple/tuple.js +62 -0
- package/plugins/schema/uuid/index.d.ts +1 -0
- package/plugins/schema/uuid/index.es6.js +1 -0
- package/plugins/schema/uuid/index.js +9 -0
- package/plugins/schema/uuid/uuid.d.ts +6 -0
- package/plugins/schema/uuid/uuid.es6.js +39 -0
- package/plugins/schema/uuid/uuid.js +43 -0
- package/plugins/utils/dev/dev.d.ts +4 -0
- package/plugins/utils/dev/dev.es6.js +10 -0
- package/plugins/utils/dev/dev.js +18 -0
- package/plugins/utils/dev/index.d.ts +1 -0
- package/plugins/utils/dev/index.es6.js +1 -0
- package/plugins/utils/dev/index.js +9 -0
- package/plugins/utils/dts/dts.d.ts +6 -0
- package/plugins/utils/dts/dts.es6.js +35 -0
- package/plugins/utils/dts/dts.js +44 -0
- package/plugins/utils/dts/index.d.ts +1 -0
- package/plugins/utils/dts/index.es6.js +1 -0
- package/plugins/utils/dts/index.js +9 -0
- package/plugins/utils/index.d.ts +4 -0
- package/plugins/utils/index.es6.js +4 -0
- package/plugins/utils/index.js +7 -0
- package/plugins/utils/prod/index.d.ts +1 -0
- package/plugins/utils/prod/index.es6.js +1 -0
- package/plugins/utils/prod/index.js +9 -0
- package/plugins/utils/prod/prod.d.ts +4 -0
- package/plugins/utils/prod/prod.es6.js +10 -0
- package/plugins/utils/prod/prod.js +18 -0
- package/plugins/utils/swagger/index.d.ts +1 -0
- package/plugins/utils/swagger/index.es6.js +1 -0
- package/plugins/utils/swagger/index.js +9 -0
- package/plugins/utils/swagger/swagger.d.ts +5 -0
- package/plugins/utils/swagger/swagger.es6.js +28 -0
- package/plugins/utils/swagger/swagger.html.es6.js +3 -0
- package/plugins/utils/swagger/swagger.html.js +7 -0
- package/plugins/utils/swagger/swagger.js +32 -0
- package/types.d.ts +76 -0
- package/types.es6.js +1 -0
- package/types.js +2 -0
- package/utils/FileData/Bin.d.ts +47 -0
- package/utils/FileData/Bin.es6.js +19 -0
- package/utils/FileData/Bin.js +23 -0
- package/utils/FileData/index.d.ts +1 -0
- package/utils/FileData/index.es6.js +1 -0
- package/utils/FileData/index.js +9 -0
- package/utils/JSONString/JSONString.d.ts +1 -0
- package/utils/JSONString/JSONString.es6.js +10 -0
- package/utils/JSONString/JSONString.js +14 -0
- package/utils/JSONString/index.d.ts +1 -0
- package/utils/JSONString/index.es6.js +1 -0
- package/utils/JSONString/index.js +9 -0
- package/utils/action/Action.d.ts +29 -0
- package/utils/action/Action.es6.js +125 -0
- package/utils/action/Action.js +134 -0
- package/utils/action/index.d.ts +1 -1
- package/utils/action/index.es6.js +1 -1
- package/utils/action/index.js +1 -3
- package/utils/dateFormat/dateFormat.d.ts +2 -0
- package/utils/dateFormat/dateFormat.es6.js +11 -0
- package/utils/dateFormat/dateFormat.js +15 -0
- package/utils/dateFormat/index.d.ts +1 -0
- package/utils/dateFormat/index.es6.js +1 -0
- package/utils/dateFormat/index.js +9 -0
- package/utils/decorators/index.d.ts +1 -0
- package/utils/decorators/index.es6.js +1 -0
- package/utils/decorators/index.js +4 -0
- package/utils/decorators/once/index.d.ts +1 -0
- package/utils/decorators/once/index.es6.js +1 -0
- package/utils/decorators/once/index.js +9 -0
- package/utils/decorators/once/once.d.ts +4 -0
- package/utils/decorators/once/once.es6.js +28 -0
- package/utils/decorators/once/once.js +32 -0
- package/utils/decorators/once/once.test.d.ts +1 -0
- package/utils/getEndpoint/getEndpoint.d.ts +2 -0
- package/utils/getEndpoint/getEndpoint.es6.js +31 -0
- package/utils/getEndpoint/getEndpoint.js +35 -0
- package/utils/getEndpoint/index.d.ts +1 -0
- package/utils/getEndpoint/index.es6.js +1 -0
- package/utils/getEndpoint/index.js +9 -0
- package/utils/getOrAdd/getOrAdd.d.ts +1 -0
- package/utils/getOrAdd/getOrAdd.es6.js +14 -0
- package/utils/getOrAdd/getOrAdd.js +18 -0
- package/utils/getOrAdd/index.d.ts +1 -0
- package/utils/getOrAdd/index.es6.js +1 -0
- package/utils/getOrAdd/index.js +9 -0
- package/utils/httpOnStart/httpOnStart.d.ts +2 -0
- package/utils/httpOnStart/httpOnStart.es6.js +5 -0
- package/utils/httpOnStart/httpOnStart.js +9 -0
- package/utils/httpOnStart/index.d.ts +1 -0
- package/utils/httpOnStart/index.es6.js +1 -0
- package/utils/httpOnStart/index.js +9 -0
- package/utils/index.d.ts +12 -3
- package/utils/index.es6.js +12 -3
- package/utils/index.js +12 -13
- package/{plugins → utils}/parseBody/index.d.ts +1 -1
- package/utils/parseBody/parseBody.d.ts +3 -0
- package/utils/parseBody/parseBody.es6.js +23 -0
- package/utils/parseBody/parseBody.js +27 -0
- package/utils/parseFormBody/index.d.ts +1 -0
- package/utils/parseFormBody/index.es6.js +1 -0
- package/utils/parseFormBody/index.js +9 -0
- package/utils/parseFormBody/parseFormBody.d.ts +3 -0
- package/utils/parseFormBody/parseFormBody.es6.js +56 -0
- package/utils/parseFormBody/parseFormBody.js +60 -0
- package/utils/parseSearch/index.d.ts +1 -1
- package/utils/parseSearch/index.es6.js +1 -1
- package/utils/parseSearch/index.js +1 -0
- package/utils/parseSearch/parseSearch.d.ts +3 -2
- package/utils/parseSearch/parseSearch.es6.js +6 -3
- package/utils/parseSearch/parseSearch.js +6 -3
- package/utils/parseSearch/parseSearch.test.d.ts +1 -0
- package/utils/rules/any/any.d.ts +1 -0
- package/utils/rules/any/any.es6.js +5 -0
- package/utils/rules/any/any.js +9 -0
- package/utils/rules/any/index.d.ts +1 -0
- package/utils/rules/any/index.es6.js +1 -0
- package/utils/rules/any/index.js +9 -0
- package/utils/rules/arrayOf/arrayOf.d.ts +2 -0
- package/utils/rules/arrayOf/arrayOf.es6.js +15 -0
- package/utils/rules/arrayOf/arrayOf.js +19 -0
- package/utils/rules/arrayOf/index.d.ts +1 -0
- package/utils/rules/arrayOf/index.es6.js +1 -0
- package/utils/rules/arrayOf/index.js +9 -0
- package/utils/rules/bin/bin.d.ts +2 -0
- package/utils/rules/bin/bin.es6.js +12 -0
- package/utils/rules/bin/bin.js +16 -0
- package/utils/rules/bin/index.d.ts +1 -0
- package/utils/rules/bin/index.es6.js +1 -0
- package/utils/rules/bin/index.js +9 -0
- package/utils/rules/binaryAccept/binaryAccept.d.ts +2 -0
- package/utils/rules/binaryAccept/binaryAccept.es6.js +32 -0
- package/utils/rules/binaryAccept/binaryAccept.js +36 -0
- package/utils/rules/binaryAccept/index.d.ts +1 -0
- package/utils/rules/binaryAccept/index.es6.js +1 -0
- package/utils/rules/binaryAccept/index.js +9 -0
- package/utils/rules/constants.d.ts +1 -0
- package/utils/rules/constants.es6.js +28 -0
- package/utils/rules/constants.js +32 -0
- package/utils/rules/dateTo/dateTo.d.ts +2 -0
- package/utils/rules/dateTo/dateTo.es6.js +11 -0
- package/utils/rules/dateTo/dateTo.js +15 -0
- package/utils/rules/dateTo/index.d.ts +1 -0
- package/utils/rules/dateTo/index.es6.js +1 -0
- package/utils/rules/dateTo/index.js +9 -0
- package/utils/rules/defaultTo/defaultTo.d.ts +1 -0
- package/utils/rules/defaultTo/defaultTo.es6.js +9 -0
- package/utils/rules/defaultTo/defaultTo.js +13 -0
- package/utils/rules/defaultTo/index.d.ts +1 -0
- package/utils/rules/defaultTo/index.es6.js +1 -0
- package/utils/rules/defaultTo/index.js +9 -0
- package/utils/rules/helpers.d.ts +8 -0
- package/utils/rules/helpers.es6.js +11 -0
- package/utils/rules/helpers.js +16 -0
- package/utils/rules/index.d.ts +29 -0
- package/utils/rules/index.es6.js +29 -0
- package/utils/rules/index.js +39 -0
- package/utils/rules/int/index.d.ts +1 -0
- package/utils/rules/int/index.es6.js +1 -0
- package/utils/rules/int/index.js +9 -0
- package/utils/rules/int/int.d.ts +2 -0
- package/utils/rules/int/int.es6.js +36 -0
- package/utils/rules/int/int.js +40 -0
- package/utils/rules/max/index.d.ts +1 -0
- package/utils/rules/max/index.es6.js +1 -0
- package/utils/rules/max/index.js +9 -0
- package/utils/rules/max/max.d.ts +1 -0
- package/utils/rules/max/max.es6.js +16 -0
- package/utils/rules/max/max.js +20 -0
- package/utils/rules/maxBin/index.d.ts +1 -0
- package/utils/rules/maxBin/index.es6.js +1 -0
- package/utils/rules/maxBin/index.js +9 -0
- package/utils/rules/maxBin/maxBin.d.ts +2 -0
- package/utils/rules/maxBin/maxBin.es6.js +13 -0
- package/utils/rules/maxBin/maxBin.js +17 -0
- package/utils/rules/maxDate/index.d.ts +1 -0
- package/utils/rules/maxDate/index.es6.js +1 -0
- package/utils/rules/maxDate/index.js +9 -0
- package/utils/rules/maxDate/maxDate.d.ts +1 -0
- package/utils/rules/maxDate/maxDate.es6.js +15 -0
- package/utils/rules/maxDate/maxDate.js +19 -0
- package/utils/rules/maxLength/index.d.ts +1 -0
- package/utils/rules/maxLength/index.es6.js +1 -0
- package/utils/rules/maxLength/index.js +9 -0
- package/utils/rules/maxLength/maxLength.d.ts +1 -0
- package/utils/rules/maxLength/maxLength.es6.js +16 -0
- package/utils/rules/maxLength/maxLength.js +20 -0
- package/utils/rules/min/index.d.ts +1 -0
- package/utils/rules/min/index.es6.js +1 -0
- package/utils/rules/min/index.js +9 -0
- package/utils/rules/min/min.d.ts +1 -0
- package/utils/rules/min/min.es6.js +16 -0
- package/utils/rules/min/min.js +20 -0
- package/utils/rules/minBin/index.d.ts +1 -0
- package/utils/rules/minBin/index.es6.js +1 -0
- package/utils/rules/minBin/index.js +9 -0
- package/utils/rules/minBin/minBin.d.ts +2 -0
- package/utils/rules/minBin/minBin.es6.js +13 -0
- package/utils/rules/minBin/minBin.js +17 -0
- package/utils/rules/minDate/index.d.ts +1 -0
- package/utils/rules/minDate/index.es6.js +1 -0
- package/utils/rules/minDate/index.js +9 -0
- package/utils/rules/minDate/minDate.d.ts +1 -0
- package/utils/rules/minDate/minDate.es6.js +15 -0
- package/utils/rules/minDate/minDate.js +19 -0
- package/utils/rules/minLength/index.d.ts +1 -0
- package/utils/rules/minLength/index.es6.js +1 -0
- package/utils/rules/minLength/index.js +9 -0
- package/utils/rules/minLength/minLength.d.ts +1 -0
- package/utils/rules/minLength/minLength.es6.js +16 -0
- package/utils/rules/minLength/minLength.js +20 -0
- package/utils/rules/nullable/index.d.ts +1 -0
- package/utils/rules/nullable/index.es6.js +1 -0
- package/utils/rules/nullable/index.js +9 -0
- package/utils/rules/nullable/nullable.d.ts +1 -0
- package/utils/rules/nullable/nullable.es6.js +10 -0
- package/utils/rules/nullable/nullable.js +14 -0
- package/utils/rules/num/index.d.ts +1 -0
- package/utils/rules/num/index.es6.js +1 -0
- package/utils/rules/num/index.js +9 -0
- package/utils/rules/num/num.d.ts +1 -0
- package/utils/rules/num/num.es6.js +11 -0
- package/utils/rules/num/num.js +15 -0
- package/utils/rules/objectOf/index.d.ts +1 -0
- package/utils/rules/objectOf/index.es6.js +1 -0
- package/utils/rules/objectOf/index.js +9 -0
- package/utils/rules/objectOf/objectOf.d.ts +3 -0
- package/utils/rules/objectOf/objectOf.es6.js +16 -0
- package/utils/rules/objectOf/objectOf.js +20 -0
- package/utils/rules/oneOf/index.d.ts +1 -0
- package/utils/rules/oneOf/index.es6.js +1 -0
- package/utils/rules/oneOf/index.js +9 -0
- package/utils/rules/oneOf/oneOf.d.ts +2 -0
- package/utils/rules/oneOf/oneOf.es6.js +18 -0
- package/utils/rules/oneOf/oneOf.js +22 -0
- package/utils/rules/optional/index.d.ts +1 -0
- package/utils/rules/optional/index.es6.js +1 -0
- package/utils/rules/optional/index.js +9 -0
- package/utils/rules/optional/optional.d.ts +2 -0
- package/utils/rules/optional/optional.es6.js +9 -0
- package/utils/rules/optional/optional.js +13 -0
- package/utils/rules/pattern/index.d.ts +1 -0
- package/utils/rules/pattern/index.es6.js +1 -0
- package/utils/rules/pattern/index.js +9 -0
- package/utils/rules/pattern/pattern.d.ts +1 -0
- package/utils/rules/pattern/pattern.es6.js +13 -0
- package/utils/rules/pattern/pattern.js +17 -0
- package/utils/rules/pipe/index.d.ts +1 -0
- package/utils/rules/pipe/index.es6.js +1 -0
- package/utils/rules/pipe/index.js +9 -0
- package/utils/rules/pipe/pipe.d.ts +2 -0
- package/utils/rules/pipe/pipe.es6.js +7 -0
- package/utils/rules/pipe/pipe.js +11 -0
- package/utils/rules/required/index.d.ts +1 -0
- package/utils/rules/required/index.es6.js +1 -0
- package/utils/rules/required/index.js +9 -0
- package/utils/rules/required/required.d.ts +2 -0
- package/utils/rules/required/required.es6.js +12 -0
- package/utils/rules/required/required.js +16 -0
- package/utils/rules/tupleOf/index.d.ts +1 -0
- package/utils/rules/tupleOf/index.es6.js +1 -0
- package/utils/rules/tupleOf/index.js +9 -0
- package/utils/rules/tupleOf/tupleOf.d.ts +2 -0
- package/utils/rules/tupleOf/tupleOf.es6.js +19 -0
- package/utils/rules/tupleOf/tupleOf.js +23 -0
- package/utils/rules/types.d.ts +4 -0
- package/utils/rules/types.es6.js +1 -0
- package/utils/rules/types.js +2 -0
- package/utils/rules/uuidTo/index.d.ts +1 -0
- package/utils/rules/uuidTo/index.es6.js +1 -0
- package/utils/rules/uuidTo/index.js +9 -0
- package/utils/rules/uuidTo/uuidTo.d.ts +1 -0
- package/utils/rules/uuidTo/uuidTo.es6.js +11 -0
- package/utils/rules/uuidTo/uuidTo.js +15 -0
- package/utils/rules/values/index.d.ts +1 -0
- package/utils/rules/values/index.es6.js +1 -0
- package/utils/rules/values/index.js +9 -0
- package/utils/rules/values/values.d.ts +1 -0
- package/utils/rules/values/values.es6.js +13 -0
- package/utils/rules/values/values.js +17 -0
- package/utils/stringifySearch/index.d.ts +1 -1
- package/utils/stringifySearch/stringifySearch.d.ts +2 -2
- package/utils/stringifySearch/stringifySearch.es6.js +2 -2
- package/utils/stringifySearch/stringifySearch.js +2 -3
- package/experimental/serverFn/serverFn.d.ts +0 -2
- package/experimental/serverFn/serverFn.es6.js +0 -12
- package/hooks/useFiles/index.d.ts +0 -1
- package/hooks/useFiles/index.es6.js +0 -1
- package/hooks/useFiles/useFiles.d.ts +0 -1
- package/hooks/useFiles/useFiles.es6.js +0 -7
- package/plugins/access/access.d.ts +0 -14
- package/plugins/access/access.es6.js +0 -24
- package/plugins/access/access.js +0 -34
- package/plugins/access/index.d.ts +0 -1
- package/plugins/access/index.es6.js +0 -1
- package/plugins/access/index.js +0 -10
- package/plugins/action/action.d.ts +0 -10
- package/plugins/action/action.es6.js +0 -38
- package/plugins/action/action.js +0 -60
- package/plugins/action/index.d.ts +0 -1
- package/plugins/action/index.es6.js +0 -1
- package/plugins/cms/cms.d.ts +0 -9
- package/plugins/cms/cms.es6.js +0 -25
- package/plugins/cms/cms.js +0 -34
- package/plugins/cookie/cookie.d.ts +0 -14
- package/plugins/cookie/cookie.es6.js +0 -21
- package/plugins/cookie/cookie.js +0 -29
- package/plugins/file/file.d.ts +0 -7
- package/plugins/file/file.es6.js +0 -39
- package/plugins/file/file.js +0 -50
- package/plugins/formatter/formatter.d.ts +0 -16
- package/plugins/formatter/formatter.es6.js +0 -30
- package/plugins/formatter/formatter.js +0 -51
- package/plugins/formatter/index.d.ts +0 -1
- package/plugins/formatter/index.es6.js +0 -1
- package/plugins/formatter/index.js +0 -9
- package/plugins/header/header.d.ts +0 -12
- package/plugins/header/header.es6.js +0 -14
- package/plugins/header/header.js +0 -23
- package/plugins/parseBody/parseBody.d.ts +0 -7
- package/plugins/parseBody/parseBody.es6.js +0 -9
- package/plugins/parseBody/parseBody.js +0 -18
- package/plugins/proxy/proxy.d.ts +0 -10
- package/plugins/proxy/proxy.es6.js +0 -18
- package/plugins/proxy/proxy.js +0 -27
- package/plugins/redirect/redirect.es6.js +0 -34
- package/plugins/redirect/redirect.js +0 -40
- package/plugins/router/index.d.ts +0 -1
- package/plugins/router/index.es6.js +0 -1
- package/plugins/router/index.js +0 -12
- package/plugins/router/router.d.ts +0 -20
- package/plugins/router/router.es6.js +0 -51
- package/plugins/router/router.js +0 -63
- package/plugins/server/server.d.ts +0 -22
- package/plugins/server/server.es6.js +0 -43
- package/plugins/server/server.js +0 -55
- package/plugins/success/success.es6.js +0 -34
- package/plugins/success/success.js +0 -44
- package/plugins/validation/index.d.ts +0 -1
- package/plugins/validation/index.es6.js +0 -1
- package/plugins/validation/index.js +0 -10
- package/plugins/validation/validation.d.ts +0 -16
- package/plugins/validation/validation.es6.js +0 -31
- package/plugins/validation/validation.js +0 -41
- package/utils/action/Action/Action.d.ts +0 -48
- package/utils/action/Action/Action.es6.js +0 -134
- package/utils/action/Action/Action.js +0 -165
- package/utils/action/Action/index.d.ts +0 -1
- package/utils/action/Action/index.es6.js +0 -1
- package/utils/action/Action/index.js +0 -12
- /package/{experimental → plugins/handler}/serverFn/index.es6.js +0 -0
- /package/{experimental → plugins/handler}/serverFn/index.js +0 -0
- /package/plugins/{server → main/server}/index.es6.js +0 -0
- /package/plugins/{server → main/server}/index.js +0 -0
- /package/plugins/{cms → request/cms}/index.es6.js +0 -0
- /package/plugins/{cms → request/cms}/index.js +0 -0
- /package/plugins/{cookie → request/cookie}/index.es6.js +0 -0
- /package/plugins/{cookie → request/cookie}/index.js +0 -0
- /package/plugins/{error → request/error}/index.es6.js +0 -0
- /package/plugins/{error → request/error}/index.js +0 -0
- /package/plugins/{file → request/file}/index.es6.js +0 -0
- /package/plugins/{file → request/file}/index.js +0 -0
- /package/plugins/{header → request/header}/index.es6.js +0 -0
- /package/plugins/{header → request/header}/index.js +0 -0
- /package/plugins/{proxy → request/proxy}/index.es6.js +0 -0
- /package/plugins/{proxy → request/proxy}/index.js +0 -0
- /package/plugins/{redirect → request/redirect}/index.es6.js +0 -0
- /package/plugins/{redirect → request/redirect}/index.js +0 -0
- /package/plugins/{success → request/success}/index.es6.js +0 -0
- /package/plugins/{success → request/success}/index.js +0 -0
- /package/{plugins → utils}/parseBody/index.es6.js +0 -0
- /package/{plugins → utils}/parseBody/index.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { dts } from './dts.es6.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './prod';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { prod } from './prod.es6.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var innet = require('innet');
|
|
6
|
+
var jsx = require('@innet/jsx');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var innet__default = /*#__PURE__*/_interopDefaultLegacy(innet);
|
|
11
|
+
|
|
12
|
+
const prod = () => {
|
|
13
|
+
if (process.env.NODE_ENV === 'production') {
|
|
14
|
+
innet__default["default"](jsx.useChildren(), innet.useHandler());
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.prod = prod;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './swagger';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { swagger } from './swagger.es6.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useProps } from '@innet/jsx';
|
|
2
|
+
import { onDestroy } from 'watch-state';
|
|
3
|
+
import '../../../hooks/index.es6.js';
|
|
4
|
+
import html from './swagger.html.es6.js';
|
|
5
|
+
import { useApi } from '../../../hooks/useApi/useApi.es6.js';
|
|
6
|
+
|
|
7
|
+
const swagger = () => {
|
|
8
|
+
const { path = '/swagger-ui' } = useProps() || {};
|
|
9
|
+
const { docs, requestPlugins, prefix } = useApi();
|
|
10
|
+
let swaggerResponse;
|
|
11
|
+
const listener = (req, res) => {
|
|
12
|
+
if (req.url === prefix + path) {
|
|
13
|
+
if (!swaggerResponse) {
|
|
14
|
+
swaggerResponse = html.replace('spec: {},', `spec: ${JSON.stringify(docs)},`);
|
|
15
|
+
}
|
|
16
|
+
res.statusCode = 200;
|
|
17
|
+
res.write(swaggerResponse);
|
|
18
|
+
res.end();
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
requestPlugins.add(listener);
|
|
23
|
+
onDestroy(() => {
|
|
24
|
+
requestPlugins.delete(listener);
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { swagger };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var html = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <meta\n name=\"description\"\n content=\"SwaggerUI\"\n />\n <title>SwaggerUI</title>\n <link rel=\"stylesheet\" href=\"https://unpkg.com/swagger-ui-dist@5.1.0/swagger-ui.css\" />\n</head>\n<body>\n<div id=\"swagger-ui\"></div>\n<script src=\"https://unpkg.com/swagger-ui-dist@5.1.0/swagger-ui-bundle.js\" crossorigin></script>\n<script>\n window.onload = () => {\n window.ui = SwaggerUIBundle({\n spec: {},\n dom_id: '#swagger-ui',\n });\n };\n</script>\n</body>\n</html>\n";
|
|
2
|
+
|
|
3
|
+
export { html as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var html = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <meta\n name=\"description\"\n content=\"SwaggerUI\"\n />\n <title>SwaggerUI</title>\n <link rel=\"stylesheet\" href=\"https://unpkg.com/swagger-ui-dist@5.1.0/swagger-ui.css\" />\n</head>\n<body>\n<div id=\"swagger-ui\"></div>\n<script src=\"https://unpkg.com/swagger-ui-dist@5.1.0/swagger-ui-bundle.js\" crossorigin></script>\n<script>\n window.onload = () => {\n window.ui = SwaggerUIBundle({\n spec: {},\n dom_id: '#swagger-ui',\n });\n };\n</script>\n</body>\n</html>\n";
|
|
6
|
+
|
|
7
|
+
exports["default"] = html;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsx = require('@innet/jsx');
|
|
6
|
+
var watchState = require('watch-state');
|
|
7
|
+
require('../../../hooks/index.js');
|
|
8
|
+
var swagger$1 = require('./swagger.html.js');
|
|
9
|
+
var useApi = require('../../../hooks/useApi/useApi.js');
|
|
10
|
+
|
|
11
|
+
const swagger = () => {
|
|
12
|
+
const { path = '/swagger-ui' } = jsx.useProps() || {};
|
|
13
|
+
const { docs, requestPlugins, prefix } = useApi.useApi();
|
|
14
|
+
let swaggerResponse;
|
|
15
|
+
const listener = (req, res) => {
|
|
16
|
+
if (req.url === prefix + path) {
|
|
17
|
+
if (!swaggerResponse) {
|
|
18
|
+
swaggerResponse = swagger$1["default"].replace('spec: {},', `spec: ${JSON.stringify(docs)},`);
|
|
19
|
+
}
|
|
20
|
+
res.statusCode = 200;
|
|
21
|
+
res.write(swaggerResponse);
|
|
22
|
+
res.end();
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
requestPlugins.add(listener);
|
|
27
|
+
watchState.onDestroy(() => {
|
|
28
|
+
requestPlugins.delete(listener);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.swagger = swagger;
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
+
import type { Handler } from 'innet';
|
|
4
|
+
import type { OpenAPIV3_1 as API } from 'openapi-types';
|
|
5
|
+
import type { ApiErrorValue } from './constants';
|
|
6
|
+
import { type Rule, type RulesErrors } from './utils/rules';
|
|
7
|
+
export type TagObject = API.TagObject;
|
|
8
|
+
export type Document = API.Document;
|
|
9
|
+
export type ServerObject = API.ServerObject;
|
|
10
|
+
export type OperationObject = API.OperationObject;
|
|
11
|
+
export type ResponseObject = API.ResponseObject;
|
|
12
|
+
export type SchemaObject = API.SchemaObject;
|
|
13
|
+
export type ArraySchemaObjectType = API.ArraySchemaObjectType;
|
|
14
|
+
export type NonArraySchemaObjectType = API.NonArraySchemaObjectType;
|
|
15
|
+
export type ArraySchemaObject = API.ArraySchemaObject;
|
|
16
|
+
export type ReferenceObject = API.ReferenceObject;
|
|
17
|
+
export type ParameterObject = API.ParameterObject;
|
|
18
|
+
export type RequestBodyObject = API.RequestBodyObject;
|
|
19
|
+
export type ObjectType = ArraySchemaObjectType | NonArraySchemaObjectType;
|
|
20
|
+
export type RefSchemaObject = SchemaObject | ReferenceObject;
|
|
21
|
+
export interface IValidationErrorData extends Record<string, any> {
|
|
22
|
+
error: RulesErrors;
|
|
23
|
+
}
|
|
24
|
+
export type ValidationErrorData = IValidationErrorData | undefined;
|
|
25
|
+
export interface EndpointRules {
|
|
26
|
+
path?: Rule;
|
|
27
|
+
search?: Rule;
|
|
28
|
+
cookie?: Rule;
|
|
29
|
+
header?: Rule;
|
|
30
|
+
body?: Rule;
|
|
31
|
+
response?: Rule;
|
|
32
|
+
}
|
|
33
|
+
export interface EndpointRulesMaps {
|
|
34
|
+
path?: Record<string, Rule>;
|
|
35
|
+
search?: Record<string, Rule>;
|
|
36
|
+
cookie?: Record<string, Rule>;
|
|
37
|
+
header?: Record<string, Rule>;
|
|
38
|
+
}
|
|
39
|
+
export interface Endpoint<I = unknown, O = unknown, E extends ApiErrorValue = ApiErrorValue, P extends InValidationErrorParam = InValidationErrorParam, D extends ValidationErrorData = ValidationErrorData> {
|
|
40
|
+
key: string;
|
|
41
|
+
content?: any;
|
|
42
|
+
rules?: EndpointRules;
|
|
43
|
+
rulesMaps?: EndpointRulesMaps;
|
|
44
|
+
handler?: Handler;
|
|
45
|
+
static?: Record<string, Endpoint<I, O, E, P, D>>;
|
|
46
|
+
dynamic?: Endpoint<I, O, E, P, D>[];
|
|
47
|
+
}
|
|
48
|
+
export type IntegerFormats = 'int32' | 'int64';
|
|
49
|
+
export type EndpointsMethods = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'options' | 'head' | 'trace';
|
|
50
|
+
export type InParam = 'query' | 'header' | 'path' | 'cookie';
|
|
51
|
+
export type InValidationErrorParam = InParam | 'body';
|
|
52
|
+
export type BodyType = 'application/x-www-form-urlencoded' | 'application/json' | 'multipart/form-data';
|
|
53
|
+
export type Endpoints<I = unknown, O = unknown, E extends ApiErrorValue = ApiErrorValue, P extends InValidationErrorParam = InValidationErrorParam, D extends ValidationErrorData = ValidationErrorData> = Partial<Record<EndpointsMethods, Endpoint<I, O, E, P, D>>>;
|
|
54
|
+
export interface SSL {
|
|
55
|
+
cert: string;
|
|
56
|
+
key: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ServerStartParams {
|
|
59
|
+
port: number;
|
|
60
|
+
https: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface BaseSchemaProps<T> {
|
|
63
|
+
default?: T;
|
|
64
|
+
example?: T;
|
|
65
|
+
examples?: T[];
|
|
66
|
+
description?: string;
|
|
67
|
+
ref?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface ValuesSchemaProps<T> extends BaseSchemaProps<T> {
|
|
70
|
+
values?: T[];
|
|
71
|
+
}
|
|
72
|
+
export interface Fallback {
|
|
73
|
+
children: any;
|
|
74
|
+
handler: Handler;
|
|
75
|
+
}
|
|
76
|
+
export type RequestPlugin = (req: IncomingMessage, res: ServerResponse) => boolean | undefined;
|
package/types.es6.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/types.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface BinOptions {
|
|
2
|
+
/**
|
|
3
|
+
* A field name of FormData request
|
|
4
|
+
*/
|
|
5
|
+
fieldName: string;
|
|
6
|
+
/**
|
|
7
|
+
* Full origin file name
|
|
8
|
+
*/
|
|
9
|
+
originalFilename: string;
|
|
10
|
+
/**
|
|
11
|
+
* Full path to the file on server, you MUST use it only on server side for the safe
|
|
12
|
+
*/
|
|
13
|
+
path: string;
|
|
14
|
+
/**
|
|
15
|
+
* MIME-type of the file
|
|
16
|
+
*/
|
|
17
|
+
type: string;
|
|
18
|
+
disposition: string;
|
|
19
|
+
/**
|
|
20
|
+
* The file size
|
|
21
|
+
*/
|
|
22
|
+
size: number;
|
|
23
|
+
}
|
|
24
|
+
export declare class Bin implements BinOptions {
|
|
25
|
+
/**
|
|
26
|
+
* A file name, without extension
|
|
27
|
+
*/
|
|
28
|
+
filename: string;
|
|
29
|
+
/**
|
|
30
|
+
* The extension of the origin file from originalFilename
|
|
31
|
+
*/
|
|
32
|
+
extension?: string;
|
|
33
|
+
type: string;
|
|
34
|
+
disposition: string;
|
|
35
|
+
fieldName: string;
|
|
36
|
+
originalFilename: string;
|
|
37
|
+
path: string;
|
|
38
|
+
size: number;
|
|
39
|
+
constructor(options: BinOptions);
|
|
40
|
+
toJSON(): {
|
|
41
|
+
$: string;
|
|
42
|
+
originalFilename: string;
|
|
43
|
+
type: string;
|
|
44
|
+
disposition: string;
|
|
45
|
+
size: number;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class Bin {
|
|
2
|
+
constructor(options) {
|
|
3
|
+
Object.assign(this, options);
|
|
4
|
+
const splitFilename = options.originalFilename.split('.');
|
|
5
|
+
this.extension = splitFilename.pop();
|
|
6
|
+
this.filename = splitFilename.join('.');
|
|
7
|
+
}
|
|
8
|
+
toJSON() {
|
|
9
|
+
return {
|
|
10
|
+
$: 'binary',
|
|
11
|
+
originalFilename: this.originalFilename,
|
|
12
|
+
type: this.type,
|
|
13
|
+
disposition: this.disposition,
|
|
14
|
+
size: this.size,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { Bin };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
class Bin {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
Object.assign(this, options);
|
|
8
|
+
const splitFilename = options.originalFilename.split('.');
|
|
9
|
+
this.extension = splitFilename.pop();
|
|
10
|
+
this.filename = splitFilename.join('.');
|
|
11
|
+
}
|
|
12
|
+
toJSON() {
|
|
13
|
+
return {
|
|
14
|
+
$: 'binary',
|
|
15
|
+
originalFilename: this.originalFilename,
|
|
16
|
+
type: this.type,
|
|
17
|
+
disposition: this.disposition,
|
|
18
|
+
size: this.size,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.Bin = Bin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Bin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Bin } from './Bin.es6.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function JSONString(target: any): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function JSONString(target) {
|
|
6
|
+
return JSON.stringify(target, (key, value) => {
|
|
7
|
+
if (typeof value === 'bigint') {
|
|
8
|
+
return String(value);
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.JSONString = JSONString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './JSONString';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JSONString } from './JSONString.es6.js';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type http from 'http';
|
|
3
|
+
import { type IncomingHttpHeaders } from 'http';
|
|
4
|
+
import { type ParsedQs } from 'qs';
|
|
5
|
+
import { type BodyType } from '../../types';
|
|
6
|
+
export declare const URL_PARSER: RegExp;
|
|
7
|
+
export interface ParsedUrl {
|
|
8
|
+
path: string;
|
|
9
|
+
search?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class Action {
|
|
12
|
+
#private;
|
|
13
|
+
private readonly req;
|
|
14
|
+
constructor(req: http.IncomingMessage);
|
|
15
|
+
get parsedUrl(): ParsedUrl;
|
|
16
|
+
get path(): string;
|
|
17
|
+
get originSearch(): ParsedQs;
|
|
18
|
+
get search(): ParsedQs;
|
|
19
|
+
set search(value: ParsedQs);
|
|
20
|
+
get originHeaders(): IncomingHttpHeaders;
|
|
21
|
+
get headers(): IncomingHttpHeaders;
|
|
22
|
+
set headers(value: IncomingHttpHeaders);
|
|
23
|
+
get originCookies(): Record<string, string>;
|
|
24
|
+
get cookies(): Record<string, string>;
|
|
25
|
+
set cookies(value: Record<string, string>);
|
|
26
|
+
get bodyType(): BodyType | undefined;
|
|
27
|
+
body?: object;
|
|
28
|
+
parseBody(): Promise<void>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { __runInitializers, __classPrivateFieldGet, __classPrivateFieldSet, __awaiter, __esDecorate } from 'tslib';
|
|
2
|
+
import cookie from 'cookie';
|
|
3
|
+
import '../decorators/index.es6.js';
|
|
4
|
+
import '../parseBody/index.es6.js';
|
|
5
|
+
import '../parseFormBody/index.es6.js';
|
|
6
|
+
import '../parseSearch/index.es6.js';
|
|
7
|
+
import { allBodyTypes } from '../../constants.es6.js';
|
|
8
|
+
import { parseSearch } from '../parseSearch/parseSearch.es6.js';
|
|
9
|
+
import { parseFormBody } from '../parseFormBody/parseFormBody.es6.js';
|
|
10
|
+
import { parseBody } from '../parseBody/parseBody.es6.js';
|
|
11
|
+
import { once } from '../decorators/once/once.es6.js';
|
|
12
|
+
|
|
13
|
+
const URL_PARSER = /^(?<path>[^?]+)(\?(?<search>.*))?/;
|
|
14
|
+
let Action = (() => {
|
|
15
|
+
var _a, _Action_search, _Action_headers, _Action_cookie;
|
|
16
|
+
let _instanceExtraInitializers = [];
|
|
17
|
+
let _get_parsedUrl_decorators;
|
|
18
|
+
let _get_originSearch_decorators;
|
|
19
|
+
let _get_originCookies_decorators;
|
|
20
|
+
let _get_bodyType_decorators;
|
|
21
|
+
let _parseBody_decorators;
|
|
22
|
+
return _a = class Action {
|
|
23
|
+
constructor(req) {
|
|
24
|
+
this.req = (__runInitializers(this, _instanceExtraInitializers), req);
|
|
25
|
+
_Action_search.set(this, void 0);
|
|
26
|
+
_Action_headers.set(this, {});
|
|
27
|
+
_Action_cookie.set(this, {});
|
|
28
|
+
}
|
|
29
|
+
get parsedUrl() {
|
|
30
|
+
var _a;
|
|
31
|
+
const match = (_a = this.req.url) === null || _a === void 0 ? void 0 : _a.match(URL_PARSER);
|
|
32
|
+
if (!match)
|
|
33
|
+
throw Error('cannot parse url');
|
|
34
|
+
const result = match.groups;
|
|
35
|
+
result.path = result.path
|
|
36
|
+
.replaceAll(/\/\.\.\//g, '/')
|
|
37
|
+
.replaceAll(/\/+/g, '/');
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
get path() {
|
|
41
|
+
return this.parsedUrl.path;
|
|
42
|
+
}
|
|
43
|
+
get originSearch() {
|
|
44
|
+
return parseSearch(this.parsedUrl.search);
|
|
45
|
+
}
|
|
46
|
+
get search() {
|
|
47
|
+
if (__classPrivateFieldGet(this, _Action_search, "f"))
|
|
48
|
+
return __classPrivateFieldGet(this, _Action_search, "f");
|
|
49
|
+
__classPrivateFieldSet(this, _Action_search, this.originSearch, "f");
|
|
50
|
+
return __classPrivateFieldGet(this, _Action_search, "f");
|
|
51
|
+
}
|
|
52
|
+
set search(value) {
|
|
53
|
+
__classPrivateFieldSet(this, _Action_search, value, "f");
|
|
54
|
+
}
|
|
55
|
+
get originHeaders() {
|
|
56
|
+
return this.req.headers;
|
|
57
|
+
}
|
|
58
|
+
get headers() {
|
|
59
|
+
if (__classPrivateFieldGet(this, _Action_headers, "f"))
|
|
60
|
+
return __classPrivateFieldGet(this, _Action_headers, "f");
|
|
61
|
+
__classPrivateFieldSet(this, _Action_headers, this.originHeaders, "f");
|
|
62
|
+
return __classPrivateFieldGet(this, _Action_headers, "f");
|
|
63
|
+
}
|
|
64
|
+
set headers(value) {
|
|
65
|
+
__classPrivateFieldSet(this, _Action_headers, value, "f");
|
|
66
|
+
}
|
|
67
|
+
get originCookies() {
|
|
68
|
+
var _a;
|
|
69
|
+
return cookie.parse((_a = this.req.headers.cookie) !== null && _a !== void 0 ? _a : '');
|
|
70
|
+
}
|
|
71
|
+
get cookies() {
|
|
72
|
+
if (__classPrivateFieldGet(this, _Action_cookie, "f"))
|
|
73
|
+
return __classPrivateFieldGet(this, _Action_cookie, "f");
|
|
74
|
+
__classPrivateFieldSet(this, _Action_cookie, this.originCookies, "f");
|
|
75
|
+
return __classPrivateFieldGet(this, _Action_cookie, "f");
|
|
76
|
+
}
|
|
77
|
+
set cookies(value) {
|
|
78
|
+
__classPrivateFieldSet(this, _Action_cookie, value, "f");
|
|
79
|
+
}
|
|
80
|
+
get bodyType() {
|
|
81
|
+
const headerType = this.req.headers['content-type'];
|
|
82
|
+
if (!headerType)
|
|
83
|
+
return;
|
|
84
|
+
for (const bodyType of allBodyTypes) {
|
|
85
|
+
if (headerType.startsWith(bodyType)) {
|
|
86
|
+
return bodyType;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
parseBody() {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
if (!this.bodyType) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (this.bodyType === 'multipart/form-data') {
|
|
96
|
+
this.body = yield parseFormBody(this.req);
|
|
97
|
+
}
|
|
98
|
+
if (this.bodyType === 'application/x-www-form-urlencoded') {
|
|
99
|
+
this.body = parseSearch(yield parseBody(this.req));
|
|
100
|
+
}
|
|
101
|
+
if (this.bodyType === 'application/json') {
|
|
102
|
+
this.body = JSON.parse(yield parseBody(this.req));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
_Action_search = new WeakMap(),
|
|
108
|
+
_Action_headers = new WeakMap(),
|
|
109
|
+
_Action_cookie = new WeakMap(),
|
|
110
|
+
(() => {
|
|
111
|
+
_get_parsedUrl_decorators = [once];
|
|
112
|
+
_get_originSearch_decorators = [once];
|
|
113
|
+
_get_originCookies_decorators = [once];
|
|
114
|
+
_get_bodyType_decorators = [once];
|
|
115
|
+
_parseBody_decorators = [once];
|
|
116
|
+
__esDecorate(_a, null, _get_parsedUrl_decorators, { kind: "getter", name: "parsedUrl", static: false, private: false, access: { has: obj => "parsedUrl" in obj, get: obj => obj.parsedUrl } }, null, _instanceExtraInitializers);
|
|
117
|
+
__esDecorate(_a, null, _get_originSearch_decorators, { kind: "getter", name: "originSearch", static: false, private: false, access: { has: obj => "originSearch" in obj, get: obj => obj.originSearch } }, null, _instanceExtraInitializers);
|
|
118
|
+
__esDecorate(_a, null, _get_originCookies_decorators, { kind: "getter", name: "originCookies", static: false, private: false, access: { has: obj => "originCookies" in obj, get: obj => obj.originCookies } }, null, _instanceExtraInitializers);
|
|
119
|
+
__esDecorate(_a, null, _get_bodyType_decorators, { kind: "getter", name: "bodyType", static: false, private: false, access: { has: obj => "bodyType" in obj, get: obj => obj.bodyType } }, null, _instanceExtraInitializers);
|
|
120
|
+
__esDecorate(_a, null, _parseBody_decorators, { kind: "method", name: "parseBody", static: false, private: false, access: { has: obj => "parseBody" in obj, get: obj => obj.parseBody } }, null, _instanceExtraInitializers);
|
|
121
|
+
})(),
|
|
122
|
+
_a;
|
|
123
|
+
})();
|
|
124
|
+
|
|
125
|
+
export { Action, URL_PARSER };
|