vovk 3.0.0-draft.6 → 3.0.0-draft.8

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/client/types.d.ts CHANGED
@@ -41,9 +41,7 @@ type OmitNever<T> = {
41
41
  type _VovkClientWithNever<T, OPTS extends {
42
42
  [key: string]: KnownAny;
43
43
  }> = {
44
- [K in keyof T]: T[K] extends (...args: KnownAny) => KnownAny ? ClientMethod<T[K], OPTS> & {
45
- __isClientMethod: boolean;
46
- } : never;
44
+ [K in keyof T]: T[K] extends (...args: KnownAny) => KnownAny ? ClientMethod<T[K], OPTS> : never;
47
45
  };
48
46
  export type _VovkClient<T, OPTS extends {
49
47
  [key: string]: KnownAny;
package/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { _createSegment as createSegment } from './createSegment';
2
- import { type _VovkErrorResponse as VovkErrorResponse, type _VovkRequest as VovkRequest, type _VovkBody as VovkBody, type _VovkQuery as VovkQuery, type _VovkParams as VovkParams, type _VovkReturnType as VovkReturnType, type _VovkYieldType as VovkYieldType, type _VovkSchema as VovkSchema, _HttpStatus as HttpStatus, _HttpMethod as HttpMethod } from './types';
2
+ import { type _VovkErrorResponse as VovkErrorResponse, type _VovkRequest as VovkRequest, type _VovkBody as VovkBody, type _VovkQuery as VovkQuery, type _VovkParams as VovkParams, type _VovkReturnType as VovkReturnType, type _VovkYieldType as VovkYieldType, type _VovkControllerBody as VovkControllerBody, type _VovkControllerQuery as VovkControllerQuery, type _VovkControllerParams as VovkControllerParams, type _VovkControllerReturnType as VovkControllerReturnType, type _VovkControllerYieldType as VovkControllerYieldType, type _VovkSchema as VovkSchema, _HttpStatus as HttpStatus, _HttpMethod as HttpMethod } from './types';
3
3
  import type { _VovkClientOptions as VovkClientOptions, _VovkClientFetcher as VovkClientFetcher, _VovkDefaultFetcherOptions as VovkDefaultFetcherOptions, _VovkValidateOnClient as VovkValidateOnClient } from './client/types';
4
4
  import { _HttpException as HttpException } from './HttpException';
5
5
  import { _createDecorator as createDecorator } from './createDecorator';
6
6
  import { _StreamResponse as StreamResponse } from './StreamResponse';
7
7
  import { worker } from './worker';
8
8
  import { _generateStaticAPI as generateStaticAPI } from './generateStaticAPI';
9
- export { type VovkClientFetcher, type VovkDefaultFetcherOptions, type VovkValidateOnClient, type VovkSchema, type VovkErrorResponse, type VovkRequest, type VovkBody, type VovkQuery, type VovkParams, type VovkReturnType, type VovkYieldType, type VovkClientOptions, StreamResponse, HttpException, HttpStatus, HttpMethod, createSegment, createDecorator, worker, generateStaticAPI, };
9
+ export { type VovkClientFetcher, type VovkDefaultFetcherOptions, type VovkValidateOnClient, type VovkSchema, type VovkErrorResponse, type VovkRequest, type VovkBody, type VovkQuery, type VovkParams, type VovkReturnType, type VovkYieldType, type VovkControllerBody, type VovkControllerQuery, type VovkControllerParams, type VovkControllerReturnType, type VovkControllerYieldType, type VovkClientOptions, StreamResponse, HttpException, HttpStatus, HttpMethod, createSegment, createDecorator, worker, generateStaticAPI, };
10
10
  export declare const get: {
11
11
  (givenPath?: string | undefined, options?: import("./types")._DecoratorOptions | undefined): ReturnType<(givenPath?: string, options?: import("./types")._DecoratorOptions) => (givenTarget: import("./types")._KnownAny, propertyKey: string) => void>;
12
12
  auto: (options?: import("./types")._DecoratorOptions) => (givenTarget: import("./types")._KnownAny, propertyKey: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "3.0.0-draft.6",
3
+ "version": "3.0.0-draft.8",
4
4
  "description": "RESTful RPC for Next.js - Transforms Next.js into a powerful REST API platform with RPC capabilities.",
5
5
  "repository": {
6
6
  "type": "git",
package/types.d.ts CHANGED
@@ -89,7 +89,7 @@ export type _VovkControllerParams<T extends _ControllerStaticMethod<REQ, PARAMS>
89
89
  export type _VovkControllerReturnType<T extends _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
90
90
  [key: string]: string;
91
91
  } = _KnownAny> = Awaited<ReturnType<T>>;
92
- export type _VovkControlerYieldType<T extends _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
92
+ export type _VovkControllerYieldType<T extends _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
93
93
  [key: string]: string;
94
94
  } = _KnownAny> = T extends (...args: _KnownAny[]) => AsyncGenerator<infer Y, _KnownAny, _KnownAny> ? Y : T extends (...args: _KnownAny[]) => Generator<infer Y, _KnownAny, _KnownAny> ? Y : T extends (...args: _KnownAny[]) => Promise<StreamResponse<infer Y>> | StreamResponse<infer Y> ? Y : never;
95
95
  export type _VovkClientBody<T extends (options: OPTIONS) => _KnownAny, OPTIONS extends {
@@ -106,24 +106,20 @@ export type _VovkClientParams<T extends (options: OPTIONS) => _KnownAny, OPTIONS
106
106
  } = Parameters<T>[0], P = _KnownAny> = Parameters<T>[0]['params'];
107
107
  export type _VovkClientYieldType<T extends (...args: _KnownAny[]) => unknown> = T extends (...args: _KnownAny[]) => Promise<StreamAsyncIterator<infer Y>> ? Y : never;
108
108
  export type _VovkClientReturnType<T extends (...args: _KnownAny) => unknown> = Awaited<ReturnType<T>>;
109
- type ClientStaticMethod = ((...args: _KnownAny[]) => _KnownAny) & {
110
- __isClientMethod: boolean;
111
- };
112
- export type _VovkBody<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
113
- [key: string]: string;
114
- } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientBody<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControllerBody<T, REQ, PARAMS> : never;
115
- export type _VovkQuery<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
116
- [key: string]: string;
117
- } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientQuery<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControllerQuery<T, REQ, PARAMS> : never;
118
- export type _VovkParams<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
119
- [key: string]: string;
120
- } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientParams<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControllerParams<T, REQ, PARAMS> : never;
121
- export type _VovkYieldType<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
122
- [key: string]: string;
123
- } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientYieldType<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControlerYieldType<T, REQ, PARAMS> : never;
124
- export type _VovkReturnType<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
125
- [key: string]: string;
126
- } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientReturnType<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControllerReturnType<T, REQ, PARAMS> : never;
109
+ export type _VovkBody<T extends (options: OPTIONS) => _KnownAny, OPTIONS extends {
110
+ body: B;
111
+ [key: string]: _KnownAny;
112
+ } = Parameters<T>[0], B = _KnownAny> = _VovkClientBody<T, OPTIONS, B>;
113
+ export type _VovkQuery<T extends (options: OPTIONS) => _KnownAny, OPTIONS extends {
114
+ query: Q;
115
+ [key: string]: _KnownAny;
116
+ } = Parameters<T>[0], Q = _KnownAny> = _VovkClientQuery<T, OPTIONS, Q>;
117
+ export type _VovkParams<T extends (options: OPTIONS) => _KnownAny, OPTIONS extends {
118
+ params: P;
119
+ [key: string]: _KnownAny;
120
+ } = Parameters<T>[0], P = _KnownAny> = _VovkClientParams<T, OPTIONS, P>;
121
+ export type _VovkReturnType<T extends (...args: _KnownAny) => unknown> = _VovkClientReturnType<T>;
122
+ export type _VovkYieldType<T extends (...args: _KnownAny) => unknown> = _VovkClientYieldType<T>;
127
123
  export type _StreamAbortMessage = {
128
124
  isError: true;
129
125
  reason: _KnownAny;
@@ -188,4 +184,3 @@ export declare enum _HttpStatus {
188
184
  GATEWAY_TIMEOUT = 504,
189
185
  HTTP_VERSION_NOT_SUPPORTED = 505
190
186
  }
191
- export {};