vovk 3.0.0-draft.66 → 3.0.0-draft.69

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.
@@ -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: {
@@ -1,6 +1,9 @@
1
1
  import type { OperationObject } from 'openapi3-ts/oas31';
2
2
  import { fromSchema } from './fromSchema';
3
- declare const openapiDecorator: (openAPIOperationObject?: OperationObject | undefined) => (target: import("..").KnownAny, propertyKey: string) => void;
3
+ type OperationObjectWithCustomProperties = OperationObject & {
4
+ [key in `${'x' | 'X'}-${string}`]: any;
5
+ };
6
+ declare const openapiDecorator: (openAPIOperationObject?: OperationObjectWithCustomProperties | undefined) => (target: import("..").KnownAny, propertyKey: string) => void;
4
7
  export declare const openapi: typeof openapiDecorator & {
5
8
  fromSchema: typeof fromSchema;
6
9
  };
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: `${HttpMethod}`;
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.66",
3
+ "version": "3.0.0-draft.69",
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": {
@@ -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 };
@@ -2,7 +2,11 @@ import type { OperationObject } from 'openapi3-ts/oas31';
2
2
  import { createDecorator } from '../createDecorator';
3
3
  import { fromSchema } from './fromSchema';
4
4
 
5
- const openapiDecorator = createDecorator(null, (openAPIOperationObject: OperationObject = {}) => {
5
+ type OperationObjectWithCustomProperties = OperationObject & {
6
+ [key in `${'x' | 'X'}-${string}`]: any;
7
+ }
8
+
9
+ const openapiDecorator = createDecorator(null, (openAPIOperationObject: OperationObjectWithCustomProperties = {}) => {
6
10
  return (handlerSchema) => ({
7
11
  ...handlerSchema,
8
12
  openapi: {
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: `${HttpMethod}`;
13
13
  validation?: { query?: KnownAny; body?: KnownAny };
14
14
  openapi?: OperationObject;
15
15
  custom?: Record<string, KnownAny>;