@go-avro/avro-js 0.0.2-beta.15 → 0.0.2-beta.151
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/README.md +1 -0
- package/dist/auth/AuthManager.d.ts +14 -5
- package/dist/auth/AuthManager.js +59 -23
- package/dist/auth/storage.d.ts +8 -8
- package/dist/auth/storage.js +19 -14
- package/dist/client/AvroQueryClientProvider.d.ts +14 -0
- package/dist/client/AvroQueryClientProvider.js +32 -0
- package/dist/client/QueryClient.d.ts +492 -16
- package/dist/client/QueryClient.js +396 -214
- package/dist/client/core/fetch.d.ts +1 -0
- package/dist/client/core/fetch.js +64 -0
- package/dist/client/core/utils.d.ts +1 -0
- package/dist/client/core/utils.js +14 -0
- package/dist/client/core/xhr.d.ts +1 -0
- package/dist/client/core/xhr.js +90 -0
- package/dist/client/hooks/analytics.d.ts +1 -0
- package/dist/client/hooks/analytics.js +26 -0
- package/dist/client/hooks/avro.d.ts +1 -0
- package/dist/client/hooks/avro.js +9 -0
- package/dist/client/hooks/bills.d.ts +1 -0
- package/dist/client/hooks/bills.js +165 -0
- package/dist/client/hooks/chats.d.ts +1 -0
- package/dist/client/hooks/chats.js +37 -0
- package/dist/client/hooks/companies.d.ts +1 -0
- package/dist/client/hooks/companies.js +152 -0
- package/dist/client/hooks/events.d.ts +1 -0
- package/dist/client/hooks/events.js +308 -0
- package/dist/client/hooks/groups.d.ts +1 -0
- package/dist/client/hooks/groups.js +130 -0
- package/dist/client/hooks/jobs.d.ts +1 -0
- package/dist/client/hooks/jobs.js +213 -0
- package/dist/client/hooks/labels.d.ts +1 -0
- package/dist/client/hooks/labels.js +130 -0
- package/dist/client/hooks/messages.d.ts +1 -0
- package/dist/client/hooks/messages.js +30 -0
- package/dist/client/hooks/months.d.ts +1 -0
- package/dist/client/hooks/months.js +93 -0
- package/dist/client/hooks/plans.d.ts +1 -0
- package/dist/client/hooks/plans.js +8 -0
- package/dist/client/hooks/proposal.d.ts +1 -0
- package/dist/client/hooks/proposal.js +22 -0
- package/dist/client/hooks/root.d.ts +1 -0
- package/dist/client/hooks/root.js +8 -0
- package/dist/client/hooks/routes.d.ts +1 -0
- package/dist/client/hooks/routes.js +167 -0
- package/dist/client/hooks/sessions.d.ts +1 -0
- package/dist/client/hooks/sessions.js +175 -0
- package/dist/client/hooks/skills.d.ts +1 -0
- package/dist/client/hooks/skills.js +123 -0
- package/dist/client/hooks/teams.d.ts +1 -0
- package/dist/client/hooks/teams.js +128 -0
- package/dist/client/hooks/users.d.ts +1 -0
- package/dist/client/hooks/users.js +118 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.js +26 -1
- package/dist/types/api.d.ts +146 -38
- package/dist/types/api.js +10 -1
- package/dist/types/auth.d.ts +6 -5
- package/dist/types/auth.js +5 -1
- package/dist/types/cache.d.ts +9 -0
- package/dist/types/cache.js +1 -0
- package/package.json +6 -4
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { Socket } from 'socket.io-client';
|
|
2
|
+
import { InfiniteData, QueryClient, UseInfiniteQueryResult, useMutation, UseQueryResult } from '@tanstack/react-query';
|
|
1
3
|
import { AuthManager } from '../auth/AuthManager';
|
|
4
|
+
import { _Event, ApiInfo, Avro, Bill, Break, Chat, Company, FinancialInsightData, Job, EventInsightData, LoginResponse, Message, Plan, Route, ServiceMonth, Session, Team, User, UserCompanyAssociation, Skill, Group, Label } from '../types/api';
|
|
5
|
+
import { AuthState, Tokens } from '../types/auth';
|
|
2
6
|
import { CancelToken, RetryStrategy } from '../types/client';
|
|
7
|
+
import { StandardError } from '../types/error';
|
|
8
|
+
import { CacheData } from '../types/cache';
|
|
3
9
|
export interface AvroQueryClientConfig {
|
|
4
10
|
baseUrl: string;
|
|
5
11
|
authManager: AuthManager;
|
|
@@ -7,23 +13,493 @@ export interface AvroQueryClientConfig {
|
|
|
7
13
|
retryStrategy?: RetryStrategy;
|
|
8
14
|
timeout?: number;
|
|
9
15
|
}
|
|
16
|
+
declare module '../client/QueryClient' {
|
|
17
|
+
interface AvroQueryClient {
|
|
18
|
+
_xhr<T>(method: string, path: string, body: any, cancelToken?: CancelToken, headers?: Record<string, string>, isIdempotent?: boolean, retryCount?: number, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<T>;
|
|
19
|
+
_fetch<T>(method: string, path: string, body: any, cancelToken?: CancelToken, headers?: Record<string, string>, isIdempotent?: boolean, retryCount?: number): Promise<T>;
|
|
20
|
+
getDelay(strategy: RetryStrategy, attempt: number): number;
|
|
21
|
+
sleep(ms: number): Promise<void>;
|
|
22
|
+
useGetRoot(): UseQueryResult<ApiInfo, StandardError>;
|
|
23
|
+
useGetJobs(onProgress?: (fraction: number) => void): UseQueryResult<Job[], StandardError>;
|
|
24
|
+
getJobsFromCache(queryClient?: QueryClient): Job[];
|
|
25
|
+
useGetInfiniteJobs(body: {
|
|
26
|
+
amt?: number;
|
|
27
|
+
query?: string;
|
|
28
|
+
routeId?: string;
|
|
29
|
+
}): UseInfiniteQueryResult<InfiniteData<Job[], unknown>, StandardError>;
|
|
30
|
+
useGetRoutes(body: {
|
|
31
|
+
amt?: number;
|
|
32
|
+
query?: string;
|
|
33
|
+
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Route[], StandardError>;
|
|
34
|
+
useGetTeams(body: {
|
|
35
|
+
amt?: number;
|
|
36
|
+
query?: string;
|
|
37
|
+
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Team[], StandardError>;
|
|
38
|
+
useGetSkills(body: {
|
|
39
|
+
amt?: number;
|
|
40
|
+
query?: string;
|
|
41
|
+
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Skill[], StandardError>;
|
|
42
|
+
useGetEvents(body: {
|
|
43
|
+
amt?: number;
|
|
44
|
+
known_ids?: string[];
|
|
45
|
+
unknown_ids?: string[];
|
|
46
|
+
query?: string;
|
|
47
|
+
unbilled?: boolean;
|
|
48
|
+
billed?: boolean;
|
|
49
|
+
paid?: boolean;
|
|
50
|
+
jobId?: string;
|
|
51
|
+
}): UseInfiniteQueryResult<InfiniteData<_Event[], unknown>, StandardError>;
|
|
52
|
+
useGetSessions(body: {
|
|
53
|
+
amt?: number;
|
|
54
|
+
query?: string;
|
|
55
|
+
}): UseInfiniteQueryResult<InfiniteData<Session[], unknown>, StandardError>;
|
|
56
|
+
useGetChats(body: {
|
|
57
|
+
amt?: number;
|
|
58
|
+
known_ids?: string[];
|
|
59
|
+
unknown_ids?: string[];
|
|
60
|
+
query?: string;
|
|
61
|
+
}): UseInfiniteQueryResult<InfiniteData<Chat[], unknown>, StandardError>;
|
|
62
|
+
useGetMessages(chatId: string, body: {
|
|
63
|
+
amt?: number;
|
|
64
|
+
known_ids?: string[];
|
|
65
|
+
unknown_ids?: string[];
|
|
66
|
+
query?: string;
|
|
67
|
+
unbilled?: boolean;
|
|
68
|
+
billed?: boolean;
|
|
69
|
+
paid?: boolean;
|
|
70
|
+
jobId?: string;
|
|
71
|
+
}): UseInfiniteQueryResult<InfiniteData<Message[], unknown>, StandardError>;
|
|
72
|
+
useGetMonths(body: {
|
|
73
|
+
amt?: number;
|
|
74
|
+
known_ids?: string[];
|
|
75
|
+
unknown_ids?: string[];
|
|
76
|
+
query?: string;
|
|
77
|
+
unbilled?: boolean;
|
|
78
|
+
billed?: boolean;
|
|
79
|
+
paid?: boolean;
|
|
80
|
+
jobId?: string;
|
|
81
|
+
}): UseInfiniteQueryResult<InfiniteData<ServiceMonth[], unknown>, StandardError>;
|
|
82
|
+
useGetBills(body: {
|
|
83
|
+
amt?: number;
|
|
84
|
+
known_ids?: string[];
|
|
85
|
+
unknown_ids?: string[];
|
|
86
|
+
query?: string;
|
|
87
|
+
paid?: boolean;
|
|
88
|
+
}): UseInfiniteQueryResult<InfiniteData<Bill[], unknown>, StandardError>;
|
|
89
|
+
useGetLabels(body: {
|
|
90
|
+
amt?: number;
|
|
91
|
+
known_ids?: string[];
|
|
92
|
+
unknown_ids?: string[];
|
|
93
|
+
query?: string;
|
|
94
|
+
offset?: number;
|
|
95
|
+
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Label[], StandardError>;
|
|
96
|
+
useGetGroups(body: {
|
|
97
|
+
amt?: number;
|
|
98
|
+
known_ids?: string[];
|
|
99
|
+
unknown_ids?: string[];
|
|
100
|
+
query?: string;
|
|
101
|
+
offset?: number;
|
|
102
|
+
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Group[], StandardError>;
|
|
103
|
+
useGetPlans(code: string): UseQueryResult<Plan[], StandardError>;
|
|
104
|
+
useGetCompanies(options?: {}): UseQueryResult<Company[], StandardError>;
|
|
105
|
+
useGetProposal(proposal_id: string): UseQueryResult<any, StandardError>;
|
|
106
|
+
useGetAnalytics(): UseQueryResult<any, StandardError>;
|
|
107
|
+
useFinanceAnalytics({ periods, cumulative }: {
|
|
108
|
+
periods: number[][];
|
|
109
|
+
cumulative: boolean;
|
|
110
|
+
}): UseQueryResult<FinancialInsightData[], StandardError>;
|
|
111
|
+
useEventAnalytics({ periods }: {
|
|
112
|
+
periods: number[][];
|
|
113
|
+
}): UseQueryResult<EventInsightData[], StandardError>;
|
|
114
|
+
useGetCompany(companyId: string): UseQueryResult<Company, StandardError>;
|
|
115
|
+
useGetCurrentCompany(): UseQueryResult<Company, StandardError>;
|
|
116
|
+
useGetJob(jobId: string): UseQueryResult<Job, StandardError>;
|
|
117
|
+
useGetEvent(eventId: string): UseQueryResult<_Event, StandardError>;
|
|
118
|
+
useGetUser(userId: string): UseQueryResult<User, StandardError>;
|
|
119
|
+
useGetSelf(): UseQueryResult<User, StandardError>;
|
|
120
|
+
useGetBill(billId: string): UseQueryResult<Bill, StandardError>;
|
|
121
|
+
useGetRoute(routeId: string): UseQueryResult<Route, StandardError>;
|
|
122
|
+
useGetChat(chatId: string): UseQueryResult<Chat, StandardError>;
|
|
123
|
+
useGetUserSessions(): UseQueryResult<Session[], StandardError>;
|
|
124
|
+
useGetAvro(): UseQueryResult<Avro, StandardError>;
|
|
125
|
+
useSearchUsers(searchUsername: string): UseQueryResult<User[], StandardError>;
|
|
126
|
+
useAcceptProposal(proposal_id: string): ReturnType<typeof useMutation<{
|
|
127
|
+
msg: string;
|
|
128
|
+
}, StandardError, {
|
|
129
|
+
tasks: {
|
|
130
|
+
id: string;
|
|
131
|
+
status: string;
|
|
132
|
+
}[];
|
|
133
|
+
}>>;
|
|
134
|
+
useCreateProposal(): ReturnType<typeof useMutation<{
|
|
135
|
+
id: string;
|
|
136
|
+
}, StandardError, {
|
|
137
|
+
job_id: string;
|
|
138
|
+
data: Record<string, any>;
|
|
139
|
+
}>>;
|
|
140
|
+
useCreateGroup(): ReturnType<typeof useMutation<{
|
|
141
|
+
id: string;
|
|
142
|
+
}, StandardError, {
|
|
143
|
+
groupData: Partial<Group>;
|
|
144
|
+
}>>;
|
|
145
|
+
useCreateLabel(): ReturnType<typeof useMutation<{
|
|
146
|
+
id: string;
|
|
147
|
+
}, StandardError, {
|
|
148
|
+
labelData: Partial<Label>;
|
|
149
|
+
}>>;
|
|
150
|
+
useCreateSkill(): ReturnType<typeof useMutation<{
|
|
151
|
+
id: string;
|
|
152
|
+
}, StandardError, {
|
|
153
|
+
skillData: Partial<Skill>;
|
|
154
|
+
}>>;
|
|
155
|
+
useCreateEvent(): ReturnType<typeof useMutation<{
|
|
156
|
+
id: string;
|
|
157
|
+
msg: string;
|
|
158
|
+
}, StandardError, {
|
|
159
|
+
eventData: Partial<_Event>;
|
|
160
|
+
}>>;
|
|
161
|
+
useCreateUserSession(): ReturnType<typeof useMutation<{
|
|
162
|
+
id: string;
|
|
163
|
+
}, StandardError, {
|
|
164
|
+
sessionData: Partial<Session>;
|
|
165
|
+
}>>;
|
|
166
|
+
useCreateBill(): ReturnType<typeof useMutation<{
|
|
167
|
+
id: string;
|
|
168
|
+
invoice_id: number;
|
|
169
|
+
}, StandardError, {
|
|
170
|
+
data: Partial<Bill>;
|
|
171
|
+
}>>;
|
|
172
|
+
useCreateCompany(): ReturnType<typeof useMutation<{
|
|
173
|
+
id: string;
|
|
174
|
+
}, StandardError, {
|
|
175
|
+
companyData: Partial<Company | {
|
|
176
|
+
logo: File | null;
|
|
177
|
+
}>;
|
|
178
|
+
}>>;
|
|
179
|
+
useCreateJob(): ReturnType<typeof useMutation<{
|
|
180
|
+
id: string;
|
|
181
|
+
}, StandardError, {
|
|
182
|
+
jobData: Partial<Job>;
|
|
183
|
+
}>>;
|
|
184
|
+
useCreateRoute(): ReturnType<typeof useMutation<{
|
|
185
|
+
id: string;
|
|
186
|
+
}, StandardError, {
|
|
187
|
+
routeData: Partial<Route>;
|
|
188
|
+
}>>;
|
|
189
|
+
useCreateTeam(): ReturnType<typeof useMutation<{
|
|
190
|
+
id: string;
|
|
191
|
+
}, StandardError, {
|
|
192
|
+
teamData: Partial<Team>;
|
|
193
|
+
}>>;
|
|
194
|
+
useCreateSelf(): ReturnType<typeof useMutation<{
|
|
195
|
+
msg: string;
|
|
196
|
+
}, StandardError, {
|
|
197
|
+
username: string;
|
|
198
|
+
name: string;
|
|
199
|
+
email: string;
|
|
200
|
+
password: string;
|
|
201
|
+
phone_number: string;
|
|
202
|
+
code?: string;
|
|
203
|
+
invite_token?: string;
|
|
204
|
+
}>>;
|
|
205
|
+
useCreateSessionBreak(): ReturnType<typeof useMutation<{
|
|
206
|
+
id: string;
|
|
207
|
+
}, StandardError, {
|
|
208
|
+
sessionId: string;
|
|
209
|
+
breakData: Partial<Break>;
|
|
210
|
+
}>>;
|
|
211
|
+
useUpdateEvent(): ReturnType<typeof useMutation<{
|
|
212
|
+
msg: string;
|
|
213
|
+
}, StandardError, {
|
|
214
|
+
eventId: string;
|
|
215
|
+
updates: Partial<_Event>;
|
|
216
|
+
}>>;
|
|
217
|
+
useSyncBillToIntuit(): ReturnType<typeof useMutation<{
|
|
218
|
+
msg: string;
|
|
219
|
+
}, StandardError, {
|
|
220
|
+
billId: string;
|
|
221
|
+
}>>;
|
|
222
|
+
useUpdateUserSession(): ReturnType<typeof useMutation<{
|
|
223
|
+
msg: string;
|
|
224
|
+
}, StandardError, {
|
|
225
|
+
sessionId: string;
|
|
226
|
+
updates: Partial<Session>;
|
|
227
|
+
}>>;
|
|
228
|
+
useUpdateGroup(): ReturnType<typeof useMutation<{
|
|
229
|
+
msg: string;
|
|
230
|
+
}, StandardError, {
|
|
231
|
+
groupId: string;
|
|
232
|
+
groupData: Partial<Group>;
|
|
233
|
+
}>>;
|
|
234
|
+
useUpdateLabel(): ReturnType<typeof useMutation<{
|
|
235
|
+
msg: string;
|
|
236
|
+
}, StandardError, {
|
|
237
|
+
labelId: string;
|
|
238
|
+
labelData: Partial<Label>;
|
|
239
|
+
}>>;
|
|
240
|
+
useUpdateJob(): ReturnType<typeof useMutation<{
|
|
241
|
+
msg: string;
|
|
242
|
+
}, StandardError, {
|
|
243
|
+
jobId: string;
|
|
244
|
+
updates: Partial<Job>;
|
|
245
|
+
}>>;
|
|
246
|
+
useUpdateSkill(): ReturnType<typeof useMutation<{
|
|
247
|
+
msg: string;
|
|
248
|
+
}, StandardError, {
|
|
249
|
+
skillId: string;
|
|
250
|
+
updates: Partial<Skill>;
|
|
251
|
+
}>>;
|
|
252
|
+
useUpdateBill(): ReturnType<typeof useMutation<{
|
|
253
|
+
msg: string;
|
|
254
|
+
}, StandardError, {
|
|
255
|
+
billId: string;
|
|
256
|
+
updates: Partial<Bill>;
|
|
257
|
+
}>>;
|
|
258
|
+
useUpdateRoute(): ReturnType<typeof useMutation<{
|
|
259
|
+
msg: string;
|
|
260
|
+
}, StandardError, {
|
|
261
|
+
routeId: string;
|
|
262
|
+
updates: Partial<Route>;
|
|
263
|
+
}>>;
|
|
264
|
+
useUpdateEvents(): ReturnType<typeof useMutation<void, StandardError, {
|
|
265
|
+
events: (_Event & {
|
|
266
|
+
page?: number;
|
|
267
|
+
})[];
|
|
268
|
+
action: "billed" | "paid";
|
|
269
|
+
}>>;
|
|
270
|
+
useUpdateTeam(): ReturnType<typeof useMutation<{
|
|
271
|
+
msg: string;
|
|
272
|
+
}, StandardError, {
|
|
273
|
+
teamId: string;
|
|
274
|
+
teamData: Partial<Team>;
|
|
275
|
+
}>>;
|
|
276
|
+
useUpdateMonths(): ReturnType<typeof useMutation<void, StandardError, {
|
|
277
|
+
months: (ServiceMonth & {
|
|
278
|
+
page?: number;
|
|
279
|
+
})[];
|
|
280
|
+
action: "billed" | "paid";
|
|
281
|
+
}>>;
|
|
282
|
+
useUpdateUserCompany(): ReturnType<typeof useMutation<{
|
|
283
|
+
msg: string;
|
|
284
|
+
}, StandardError, {
|
|
285
|
+
user_id: string;
|
|
286
|
+
data: Partial<UserCompanyAssociation>;
|
|
287
|
+
}>>;
|
|
288
|
+
useUpdateSessionBreak(): ReturnType<typeof useMutation<{
|
|
289
|
+
msg: string;
|
|
290
|
+
}, StandardError, {
|
|
291
|
+
breakId: string;
|
|
292
|
+
updates: Partial<Break>;
|
|
293
|
+
}>>;
|
|
294
|
+
useUpdateSelf(): ReturnType<typeof useMutation<{
|
|
295
|
+
msg: string;
|
|
296
|
+
}, StandardError, Partial<User>>>;
|
|
297
|
+
useDeleteJob(): ReturnType<typeof useMutation<{
|
|
298
|
+
msg: string;
|
|
299
|
+
}, StandardError, {
|
|
300
|
+
jobId: string;
|
|
301
|
+
}>>;
|
|
302
|
+
useUpdateCompany(): ReturnType<typeof useMutation<{
|
|
303
|
+
msg: string;
|
|
304
|
+
}, StandardError, {
|
|
305
|
+
companyId: string;
|
|
306
|
+
companyData: Partial<Company | {
|
|
307
|
+
logo: File | null;
|
|
308
|
+
}>;
|
|
309
|
+
}>>;
|
|
310
|
+
useRemoveUserCompany(): ReturnType<typeof useMutation<{
|
|
311
|
+
msg: string;
|
|
312
|
+
}, StandardError, {
|
|
313
|
+
userId: string;
|
|
314
|
+
}>>;
|
|
315
|
+
useDeleteGroup(): ReturnType<typeof useMutation<{
|
|
316
|
+
msg: string;
|
|
317
|
+
}, StandardError, {
|
|
318
|
+
groupId: string;
|
|
319
|
+
}>>;
|
|
320
|
+
useDeleteLabel(): ReturnType<typeof useMutation<{
|
|
321
|
+
msg: string;
|
|
322
|
+
}, StandardError, {
|
|
323
|
+
labelId: string;
|
|
324
|
+
}>>;
|
|
325
|
+
useDeleteEvent(): ReturnType<typeof useMutation<{
|
|
326
|
+
msg: string;
|
|
327
|
+
}, StandardError, {
|
|
328
|
+
eventId: string;
|
|
329
|
+
}>>;
|
|
330
|
+
useDeleteBill(): ReturnType<typeof useMutation<{
|
|
331
|
+
msg: string;
|
|
332
|
+
}, StandardError, {
|
|
333
|
+
billId: string;
|
|
334
|
+
}>>;
|
|
335
|
+
useDeleteRoute(): ReturnType<typeof useMutation<{
|
|
336
|
+
msg: string;
|
|
337
|
+
}, StandardError, {
|
|
338
|
+
routeId: string;
|
|
339
|
+
}>>;
|
|
340
|
+
useDeleteSkill(): ReturnType<typeof useMutation<{
|
|
341
|
+
msg: string;
|
|
342
|
+
}, StandardError, {
|
|
343
|
+
skillId: string;
|
|
344
|
+
}>>;
|
|
345
|
+
useDeleteSelf(): ReturnType<typeof useMutation<{
|
|
346
|
+
msg: string;
|
|
347
|
+
}, StandardError, void>>;
|
|
348
|
+
useDeleteCompany(): ReturnType<typeof useMutation<{
|
|
349
|
+
msg: string;
|
|
350
|
+
}, StandardError, {
|
|
351
|
+
companyId: string;
|
|
352
|
+
}>>;
|
|
353
|
+
useDeleteTeam(): ReturnType<typeof useMutation<{
|
|
354
|
+
msg: string;
|
|
355
|
+
}, StandardError, {
|
|
356
|
+
teamId: string;
|
|
357
|
+
}>>;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
10
360
|
export declare class AvroQueryClient {
|
|
11
|
-
|
|
361
|
+
protected config: Required<AvroQueryClientConfig>;
|
|
362
|
+
readonly socket: Socket;
|
|
363
|
+
_authState: AuthState;
|
|
364
|
+
companyId: string | null;
|
|
365
|
+
company: Company | null;
|
|
366
|
+
private authStateListeners;
|
|
12
367
|
constructor(config: AvroQueryClientConfig);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
get<T>(path: string, cancelToken?: CancelToken, headers?: Record<string, string
|
|
17
|
-
post<T>(path: string, data: any, cancelToken?: CancelToken, headers?: Record<string, string
|
|
18
|
-
put<T>(path: string, data: any, cancelToken?: CancelToken, headers?: Record<string, string
|
|
19
|
-
delete<T>(path: string, cancelToken?: CancelToken, headers?: Record<string, string
|
|
20
|
-
|
|
368
|
+
emit(eventName: string, data: unknown): void;
|
|
369
|
+
on<T>(eventName: string, callback: (data: T) => void): void;
|
|
370
|
+
off(eventName: string, callback?: Function): void;
|
|
371
|
+
get<T>(path: string, cancelToken?: CancelToken, headers?: Record<string, string>, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<T>;
|
|
372
|
+
post<T>(path: string, data: any, cancelToken?: CancelToken, headers?: Record<string, string>, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<T>;
|
|
373
|
+
put<T>(path: string, data: any, cancelToken?: CancelToken, headers?: Record<string, string>, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<T>;
|
|
374
|
+
delete<T>(path: string, cancelToken?: CancelToken, headers?: Record<string, string>, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<T>;
|
|
375
|
+
useLogin(): ReturnType<typeof useMutation<LoginResponse, StandardError, {
|
|
21
376
|
username: string;
|
|
22
|
-
password
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
377
|
+
password?: string;
|
|
378
|
+
code?: string;
|
|
379
|
+
cancelToken?: CancelToken;
|
|
380
|
+
}>>;
|
|
381
|
+
useRequestCode(): ReturnType<typeof useMutation<{
|
|
382
|
+
msg: string;
|
|
383
|
+
}, StandardError, {
|
|
384
|
+
username?: string;
|
|
385
|
+
email?: string;
|
|
386
|
+
cancelToken?: CancelToken;
|
|
387
|
+
}>>;
|
|
388
|
+
useUpdatePassword(): ReturnType<typeof useMutation<void, StandardError, {
|
|
389
|
+
username?: string;
|
|
390
|
+
email?: string;
|
|
391
|
+
code: string;
|
|
392
|
+
newPassword: string;
|
|
393
|
+
cancelToken?: CancelToken;
|
|
394
|
+
}>>;
|
|
395
|
+
useGoogleLogin(): ReturnType<typeof useMutation<LoginResponse, StandardError, {
|
|
396
|
+
token: string;
|
|
397
|
+
cancelToken?: CancelToken;
|
|
398
|
+
}>>;
|
|
399
|
+
setTokens(tokens: Tokens): Promise<void>;
|
|
400
|
+
setCache(data: Partial<CacheData>): Promise<void>;
|
|
401
|
+
getCache(key?: keyof CacheData | undefined): Promise<CacheData | string | null>;
|
|
402
|
+
setCompanyId(companyId: string): Promise<void[]>;
|
|
403
|
+
getCompanyId(): Promise<string | null>;
|
|
404
|
+
clearCache(): Promise<void>;
|
|
405
|
+
onAuthStateChange(cb: (v: AuthState) => void): () => void;
|
|
406
|
+
offAuthStateChange(cb: (v: AuthState) => void): void;
|
|
407
|
+
setAuthState(state: AuthState): void;
|
|
408
|
+
getAuthState(): AuthState;
|
|
409
|
+
getAuthStateAsync(): Promise<AuthState>;
|
|
410
|
+
getQueryClient(): QueryClient;
|
|
411
|
+
useLogout(): ReturnType<typeof useMutation<void, StandardError, CancelToken | undefined>>;
|
|
412
|
+
fetchJobs(body?: {
|
|
413
|
+
amt?: number;
|
|
414
|
+
known_ids?: string[];
|
|
415
|
+
unknown_ids?: string[];
|
|
416
|
+
query?: string;
|
|
417
|
+
offset?: number;
|
|
418
|
+
route_id?: string;
|
|
419
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
420
|
+
fetchChats(body?: {
|
|
421
|
+
amt?: number;
|
|
422
|
+
known_ids?: string[];
|
|
423
|
+
unknown_ids?: string[];
|
|
424
|
+
query?: string;
|
|
425
|
+
offset?: number;
|
|
426
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
427
|
+
fetchMessages(chatId: string, body?: {
|
|
428
|
+
amt?: number;
|
|
429
|
+
known_ids?: string[];
|
|
430
|
+
unknown_ids?: string[];
|
|
431
|
+
query?: string;
|
|
432
|
+
offset?: number;
|
|
433
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
434
|
+
fetchEvents(body?: {
|
|
435
|
+
amt?: number;
|
|
436
|
+
known_ids?: string[];
|
|
437
|
+
unknown_ids?: string[];
|
|
438
|
+
query?: string;
|
|
439
|
+
offset?: number;
|
|
440
|
+
unbilled?: boolean;
|
|
441
|
+
billed?: boolean;
|
|
442
|
+
paid?: boolean;
|
|
443
|
+
jobId?: string | null;
|
|
444
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
445
|
+
fetchMonths(body?: {
|
|
446
|
+
amt?: number;
|
|
447
|
+
known_ids?: string[];
|
|
448
|
+
unknown_ids?: string[];
|
|
449
|
+
query?: string;
|
|
450
|
+
offset?: number;
|
|
451
|
+
unbilled?: boolean;
|
|
452
|
+
billed?: boolean;
|
|
453
|
+
paid?: boolean;
|
|
454
|
+
jobId?: string | null;
|
|
455
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
456
|
+
fetchBills(body?: {
|
|
457
|
+
amt?: number;
|
|
458
|
+
known_ids?: string[];
|
|
459
|
+
unknown_ids?: string[];
|
|
460
|
+
query?: string;
|
|
461
|
+
offset?: number;
|
|
462
|
+
paid?: boolean;
|
|
463
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
464
|
+
fetchRoutes(body?: {
|
|
465
|
+
amt?: number;
|
|
466
|
+
known_ids?: string[];
|
|
467
|
+
unknown_ids?: string[];
|
|
468
|
+
query?: string;
|
|
469
|
+
offset?: number;
|
|
470
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
471
|
+
fetchTeams(body?: {
|
|
472
|
+
amt?: number;
|
|
473
|
+
known_ids?: string[];
|
|
474
|
+
unknown_ids?: string[];
|
|
475
|
+
query?: string;
|
|
476
|
+
offset?: number;
|
|
477
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
478
|
+
fetchLabels(body?: {
|
|
479
|
+
amt?: number;
|
|
480
|
+
known_ids?: string[];
|
|
481
|
+
unknown_ids?: string[];
|
|
482
|
+
query?: string;
|
|
483
|
+
offset?: number;
|
|
484
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
485
|
+
fetchGroups(body?: {
|
|
486
|
+
amt?: number;
|
|
487
|
+
known_ids?: string[];
|
|
488
|
+
unknown_ids?: string[];
|
|
489
|
+
query?: string;
|
|
490
|
+
offset?: number;
|
|
491
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
492
|
+
fetchSkills(body?: {
|
|
493
|
+
amt?: number;
|
|
494
|
+
known_ids?: string[];
|
|
495
|
+
unknown_ids?: string[];
|
|
496
|
+
query?: string;
|
|
497
|
+
offset?: number;
|
|
498
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
499
|
+
fetchSessions(body?: {
|
|
500
|
+
amt?: number;
|
|
501
|
+
query?: string;
|
|
502
|
+
offset?: number;
|
|
503
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
504
|
+
sendEmail(emailId: string, formData: FormData, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<void>;
|
|
29
505
|
}
|