@jayfong/x-server 2.106.5 → 2.106.6

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 (2) hide show
  1. package/lib/core/types.d.ts +10 -10
  2. package/package.json +1 -1
@@ -1,15 +1,15 @@
1
- import type { IncomingHttpHeaders } from 'http';
1
+ import type { IncomingHttpHeaders } from 'node:http';
2
2
  import type { MultipartFile } from '@fastify/multipart';
3
3
  import type { SocketStream } from '@fastify/websocket';
4
4
  import type { Queue } from 'bull';
5
- import { CronJob } from 'cron';
6
- import { FastifyReply, FastifyRequest, FastifyServerOptions } from 'fastify';
5
+ import type { CronJob } from 'cron';
6
+ import type { FastifyReply, FastifyRequest, FastifyServerOptions } from 'fastify';
7
7
  import type { MsValue } from 'vtils';
8
8
  import type { AsyncOrSync, LiteralUnion, OneOrMore, RequiredDeep } from 'vtils/types';
9
- import * as vae from 'vtils/vae';
10
- import { yup } from 'vtils/validator';
11
- import { BasePlugin } from '../plugins/base';
12
- import { BaseService } from '../services/base';
9
+ import type * as vae from 'vtils/vae';
10
+ import type { yup } from 'vtils/validator';
11
+ import type { BasePlugin } from '../plugins/base';
12
+ import type { BaseService } from '../services/base';
13
13
  import type { DisposeService } from '../services/dispose';
14
14
  import type { Handler } from './handler';
15
15
  export declare namespace XServer {
@@ -117,7 +117,7 @@ export declare namespace XHandler {
117
117
  ctx: Context) => AsyncOrSync<TResData>;
118
118
  interface ExtraOptions {
119
119
  }
120
- interface Options<TReqData extends any = void, TResData extends any = void, TReqMethod extends Method = Method> extends ExtraOptions {
120
+ interface Options<TReqData extends any = void, TResData extends any = void, TReqMethod extends Method = Method, TReqDataRequired = RequiredDeep<TReqData>> extends ExtraOptions {
121
121
  /**
122
122
  * 请求方法
123
123
  *
@@ -156,11 +156,11 @@ export declare namespace XHandler {
156
156
  /**
157
157
  * 请求数据验证结构(yup)
158
158
  */
159
- requestDataSchema?: (_: typeof yup) => yup.GetSchema<RequiredDeep<TReqData>>;
159
+ requestDataSchema?: (_: typeof yup) => yup.GetSchema<TReqDataRequired>;
160
160
  /**
161
161
  * 请求数据验证结构(vae)
162
162
  */
163
- requestDataSchemaVae?: vae.VaeSchemaOf<TReqData> | ((_: vae.VaeSchemaBuilder<TReqData>) => vae.VaeSchemaOf<TReqData> | vae.VaeObjectSchemaShapeOf<TReqData>);
163
+ requestDataSchemaVae?: vae.VaeSchemaOf<TReqDataRequired> | ((_: vae.VaeSchemaBuilder<TReqDataRequired>) => vae.VaeSchemaOf<TReqDataRequired> | vae.VaeObjectSchemaShapeOf<TReqDataRequired>);
164
164
  /**
165
165
  * 是否使用异步上下文
166
166
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.106.5",
3
+ "version": "2.106.6",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",