vovk 3.0.0-draft.108 → 3.0.0-draft.109

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.
@@ -27,10 +27,10 @@ const fetcher = async ({ httpMethod, getEndpoint, validate, defaultHandler, defa
27
27
  }
28
28
  const init = {
29
29
  method: httpMethod,
30
- ...options,
30
+ ...options.init,
31
31
  headers: {
32
- ...options.headers,
33
32
  accept: 'application/jsonl, application/json',
33
+ ...options.init?.headers,
34
34
  },
35
35
  };
36
36
  if (body instanceof FormData) {
@@ -80,7 +80,7 @@ export type VovkClientFetcher<OPTS extends Record<string, KnownAny> = Record<str
80
80
  [key: string]: string;
81
81
  };
82
82
  } & OPTS) => KnownAny;
83
- export interface VovkDefaultFetcherOptions extends Omit<RequestInit, 'body' | 'method'> {
83
+ export interface VovkDefaultFetcherOptions {
84
84
  reactNative?: {
85
85
  textStreaming: boolean;
86
86
  };
@@ -90,6 +90,11 @@ export interface VovkDefaultFetcherOptions extends Omit<RequestInit, 'body' | 'm
90
90
  validateOnClient?: VovkValidateOnClient;
91
91
  fetcher?: VovkClientFetcher;
92
92
  interpretAs?: string;
93
+ init?: Omit<RequestInit, 'body'> & {
94
+ reactNative?: {
95
+ textStreaming: boolean;
96
+ };
97
+ };
93
98
  }
94
99
  export type VovkValidateOnClient = (input: {
95
100
  body?: unknown;
package/dist/types.d.ts CHANGED
@@ -126,9 +126,11 @@ export type VovkConfig = {
126
126
  emitConfig?: boolean | (keyof VovkStrictConfig)[];
127
127
  clientOutDir?: string;
128
128
  schemaOutDir?: string;
129
- fetcherImport?: string | string[];
130
- validateOnClientImport?: string | string[] | null;
131
- createRPCImport?: string | string[];
129
+ imports?: {
130
+ fetcher?: string | [string, string] | [string];
131
+ validateOnClient?: string | [string, string] | [string];
132
+ createRPC?: string | [string, string] | [string];
133
+ };
132
134
  modulesDir?: string;
133
135
  rootEntry?: string;
134
136
  origin?: string;
@@ -144,11 +146,13 @@ export type VovkConfig = {
144
146
  };
145
147
  libs?: Record<string, KnownAny>;
146
148
  };
147
- export type VovkStrictConfig = Required<Omit<VovkConfig, 'emitConfig' | 'validateOnClientImport' | 'fetcherImport' | 'createRPCImport' | 'generateFrom' | 'libs'>> & {
149
+ export type VovkStrictConfig = Required<Omit<VovkConfig, 'emitConfig' | 'generateFrom' | 'libs' | 'imports'>> & {
148
150
  emitConfig: (keyof VovkStrictConfig)[];
149
- validateOnClientImport: string[] | null;
150
- fetcherImport: string[];
151
- createRPCImport: string[];
151
+ imports: {
152
+ fetcher: [string, string] | [string];
153
+ validateOnClient: [string, string] | [string] | null;
154
+ createRPC: [string, string] | [string];
155
+ };
152
156
  generateFrom: GenerateFrom;
153
157
  libs: Record<string, KnownAny>;
154
158
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "3.0.0-draft.108",
3
+ "version": "3.0.0-draft.109",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "description": "RESTful RPC for Next.js - Transforms Next.js into a powerful REST API platform with RPC capabilities.",