soonjs 0.0.20 → 0.0.22
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/dist/deps/acorn-tklbyr11e.js +15 -0
- package/dist/deps/angular-m17t0gdsi.js +1 -0
- package/dist/deps/babel-48ei1aig4.js +15 -0
- package/dist/deps/estree-4o5bj9gvd.js +36 -0
- package/dist/deps/flow-xlruu7boa.js +19 -0
- package/dist/deps/glimmer-kyfivr6g7.js +30 -0
- package/dist/deps/graphql-xojtytb2p.js +29 -0
- package/dist/deps/html-jal5w2b1p.js +23 -0
- package/dist/deps/markdown-qhqqns7vp.js +62 -0
- package/dist/deps/meriyah-sl495y757.js +4 -0
- package/dist/deps/postcss-vq400h6ym.js +52 -0
- package/dist/deps/soon-id-gmzr57ufv.js +1 -0
- package/dist/deps/typescript-jihynpl9y.js +20 -0
- package/dist/deps/yaml-auqgv4vnk.js +161 -0
- package/dist/index.d.ts +12 -7
- package/dist/index.js +10 -54561
- package/dist/types.d.ts +11 -1
- package/dist/vite-plugin-soon-client.js +249 -0
- package/dist/vite-plugin-soon-server.js +272 -0
- package/package.json +2 -2
- package/dist/acorn-BeS7roP3.js +0 -2895
- package/dist/angular-B-EYu3Xp.js +0 -1448
- package/dist/babel-NsGQycRb.js +0 -6844
- package/dist/estree-cBJzAinS.js +0 -4265
- package/dist/flow-CH5Saqka.js +0 -26221
- package/dist/glimmer-D1ryh0Nj.js +0 -2756
- package/dist/graphql-DsBI6lrt.js +0 -1212
- package/dist/html-BCw0gm0V.js +0 -2623
- package/dist/markdown-k-AdjTGy.js +0 -3058
- package/dist/meriyah-CghVgtuf.js +0 -2320
- package/dist/one.d.ts +0 -20
- package/dist/postcss-BC57c3E8.js +0 -4664
- package/dist/testtt.d.ts +0 -1
- package/dist/typescript-DtWxbCCh.js +0 -12794
- package/dist/utils.d.ts +0 -6
- package/dist/yaml-CFlm97O-.js +0 -4088
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config, defineApi, defineConfig, Meta, Platform, ServiceContext, SoonApp, UserContext } from '
|
|
1
|
+
import { Config, defineApi, defineConfig, Meta, Namespace, Platform, ServiceContext, SoonApp, UserContext } from './index';
|
|
2
2
|
import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http';
|
|
3
3
|
|
|
4
4
|
type Method = 'get' | 'head' | 'post' | 'put' | 'delete' | 'options' | 'patch' | 'all';
|
|
@@ -31,6 +31,14 @@ export type APIOptionsBase = {
|
|
|
31
31
|
* api扩展信息
|
|
32
32
|
*/
|
|
33
33
|
meta?: Meta;
|
|
34
|
+
/**
|
|
35
|
+
* api中间件
|
|
36
|
+
*/
|
|
37
|
+
middlewares?: Middleware[];
|
|
38
|
+
/**
|
|
39
|
+
* 命名空间
|
|
40
|
+
*/
|
|
41
|
+
namespace?: keyof Namespace;
|
|
34
42
|
};
|
|
35
43
|
export type APIOptions = ReturnType<typeof defineApi>;
|
|
36
44
|
export type Request = {
|
|
@@ -46,6 +54,7 @@ export type Request = {
|
|
|
46
54
|
reqId: string;
|
|
47
55
|
requestId: string;
|
|
48
56
|
ip: string;
|
|
57
|
+
namespace?: keyof Namespace;
|
|
49
58
|
};
|
|
50
59
|
export type Response<Body = any> = {
|
|
51
60
|
headers: OutgoingHttpHeaders;
|
|
@@ -75,6 +84,7 @@ export type SoonFetchOptions = {
|
|
|
75
84
|
query?: Record<string, string>;
|
|
76
85
|
ip?: string;
|
|
77
86
|
platform?: Context['platform'];
|
|
87
|
+
namespace?: keyof Namespace;
|
|
78
88
|
};
|
|
79
89
|
export type Middleware = (context: Context, next: () => any) => Promise<void> | void;
|
|
80
90
|
export type SoonAppOptions = {
|