vovk 3.0.0-draft.69 → 3.0.0-draft.70

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.
@@ -40,7 +40,7 @@ const createRPC = (controllerSchema, segmentName, options) => {
40
40
  };
41
41
  const internalOptions = {
42
42
  name: staticMethodName,
43
- httpMethod,
43
+ httpMethod: httpMethod,
44
44
  getEndpoint,
45
45
  validate,
46
46
  defaultHandler: defaultHandler_1.defaultHandler,
@@ -51,7 +51,7 @@ export type VovkClient<T, OPTS extends {
51
51
  }> = OmitNever<VovkClientWithNever<T, OPTS>>;
52
52
  export type VovkClientFetcher<OPTS extends Record<string, KnownAny> = Record<string, never>, T = KnownAny> = (options: {
53
53
  name: keyof T;
54
- httpMethod: `${HttpMethod}`;
54
+ httpMethod: HttpMethod;
55
55
  getEndpoint: (data: {
56
56
  apiRoot: string;
57
57
  params: {
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export type KnownAny = any;
6
6
  export type StaticClass = Function;
7
7
  export type VovkHandlerSchema = {
8
8
  path: string;
9
- httpMethod: `${HttpMethod}`;
9
+ httpMethod: string;
10
10
  validation?: {
11
11
  query?: KnownAny;
12
12
  body?: KnownAny;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "3.0.0-draft.69",
3
+ "version": "3.0.0-draft.70",
4
4
  "main": "dist/index.js",
5
5
  "description": "RESTful RPC for Next.js - Transforms Next.js into a powerful REST API platform with RPC capabilities.",
6
6
  "repository": {
@@ -4,6 +4,7 @@ import {
4
4
  type VovkControllerParams,
5
5
  type VovkControllerQuery,
6
6
  type KnownAny,
7
+ type HttpMethod,
7
8
  } from '../types';
8
9
  import { type VovkClientOptions, type VovkClient, type VovkDefaultFetcherOptions, VovkValidateOnClient } from './types';
9
10
 
@@ -77,7 +78,7 @@ const createRPC = <T, OPTS extends Record<string, KnownAny> = VovkDefaultFetcher
77
78
 
78
79
  const internalOptions: Parameters<typeof fetcher>[0] = {
79
80
  name: staticMethodName as keyof T,
80
- httpMethod,
81
+ httpMethod: httpMethod as HttpMethod,
81
82
  getEndpoint,
82
83
  validate,
83
84
  defaultHandler,
@@ -81,7 +81,7 @@ export type VovkClient<T, OPTS extends { [key: string]: KnownAny }> = OmitNever<
81
81
  export type VovkClientFetcher<OPTS extends Record<string, KnownAny> = Record<string, never>, T = KnownAny> = (
82
82
  options: {
83
83
  name: keyof T;
84
- httpMethod: `${HttpMethod}`;
84
+ httpMethod: HttpMethod;
85
85
  getEndpoint: (data: {
86
86
  apiRoot: string;
87
87
  params: { [key: string]: string };
package/src/types.ts CHANGED
@@ -9,7 +9,7 @@ export type StaticClass = Function; // eslint-disable-line @typescript-eslint/no
9
9
 
10
10
  export type VovkHandlerSchema = {
11
11
  path: string;
12
- httpMethod: `${HttpMethod}`;
12
+ httpMethod: string; // HttpMethod type makes JSON incompatible with VovkHandlerSchema type
13
13
  validation?: { query?: KnownAny; body?: KnownAny };
14
14
  openapi?: OperationObject;
15
15
  custom?: Record<string, KnownAny>;