Skip to content

Commit 5853afb

Browse files
committed
fix: typecheck
1 parent 665cd5e commit 5853afb

File tree

4 files changed

+11
-24
lines changed

4 files changed

+11
-24
lines changed

packages/core/tests/client.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ test.group('Client | Chained', () => {
322322
.matchHeader('content-type', /multipart\/form-data/)
323323

324324
await tuyau.api.auth.login({
325-
body: { email: 'foo@ok.com', data: { nested: { deep: { file: new File(['hello'], 'hello.txt') } } } },
325+
body: { email: 'foo@ok.com', password: 'foo', data: { nested: { deep: { file: new File(['hello'], 'hello.txt') } } } },
326326
})
327327
})
328328

@@ -335,7 +335,7 @@ test.group('Client | Chained', () => {
335335
.matchHeader('content-type', /multipart\/form-data/)
336336

337337
await tuyau.api.auth.login({
338-
body: { email: 'foo@ok.com', attachments: [{ file: new File(['doc'], 'doc.pdf') }] },
338+
body: { email: 'foo@ok.com', password: 'foo', attachments: [{ file: new File(['doc'], 'doc.pdf') }] },
339339
})
340340
})
341341

packages/core/tests/fixtures/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const routes = {
1111
pattern: '/auth/login',
1212
tokens: [{ old: '/auth/login', type: 0, val: 'auth/login', end: '' }],
1313
types: placeholder as {
14-
body: { email: string; password: string; file?: any }
14+
body: { email: string; password: string; file?: any; profile?: any; data?: any; attachments?: any }
1515
paramsTuple: [string, string]
1616
params: { 'user-id'?: string; 'user-token'?: string }
1717
query: { foo?: string }

packages/core/tests/typings.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ test.group('Client | Typings', (group) => {
580580
expectTypeOf<PostAuthResponse>().toEqualTypeOf<{ token: string }>()
581581
expectTypeOf<PostAuthParams>().toEqualTypeOf<{ 'user-id'?: string; 'user-token'?: string }>()
582582
expectTypeOf<PostAuthQuery>().toEqualTypeOf<{ foo?: string }>()
583-
expectTypeOf<PostAuthBody>().toEqualTypeOf<{ email: string; password: string; file?: any }>()
583+
expectTypeOf<PostAuthBody>().toEqualTypeOf<{ email: string; password: string; file?: any; profile?: any; data?: any; attachments?: any }>()
584584

585585
// Test GET route with params
586586
type GetUsersShowResponse = PathWithRegistry.Response<typeof routes, 'GET', '/users/:id'>
@@ -641,7 +641,7 @@ test.group('Client | Typings', (group) => {
641641

642642
expectTypeOf<AuthLoginResponse>().toEqualTypeOf<{ token: string }>()
643643
expectTypeOf<AuthLoginParams>().toEqualTypeOf<{ 'user-id'?: string; 'user-token'?: string }>()
644-
expectTypeOf<AuthLoginBody>().toEqualTypeOf<{ email: string; password: string; file?: any }>()
644+
expectTypeOf<AuthLoginBody>().toEqualTypeOf<{ email: string; password: string; file?: any; profile?: any; data?: any; attachments?: any }>()
645645

646646
// Test route with required params
647647
type PostDetailResponse = RouteWithRegistry.Response<

packages/query-core/src/index.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1-
export { isObject, invoke, buildKey, extractKyOptions } from './utils.ts'
2-
export { toSnakeCase, segmentsToRouteName } from './helpers.ts'
3-
export { createQueryFn } from './query_fn.ts'
4-
export type { CreateQueryFnOptions } from './query_fn.ts'
5-
export { createInfiniteQueryFn } from './infinite_query_fn.ts'
6-
export type { CreateInfiniteQueryFnOptions } from './infinite_query_fn.ts'
7-
export { getMutationKeyInternal, createMutationFn } from './mutation_fn.ts'
8-
export type { CreateMutationFnOptions } from './mutation_fn.ts'
9-
export type {
10-
Fn,
11-
QueryType,
12-
TuyauQueryKey,
13-
TuyauMutationKey,
14-
TuyauRequestOptions,
15-
TuyauQueryBaseOptions,
16-
DecorateRouterKeyable,
17-
DistributiveOmit,
18-
WithRequired,
19-
} from './types.ts'
1+
export * from './utils.ts'
2+
export * from './helpers.ts'
3+
export * from './query_fn.ts'
4+
export * from './infinite_query_fn.ts'
5+
export * from './mutation_fn.ts'
6+
export * from './types.ts'

0 commit comments

Comments
 (0)