@go-avro/avro-js 0.0.2-beta.9 → 0.0.2-beta.91
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 +4 -0
- package/dist/auth/AuthManager.js +18 -2
- package/dist/client/QueryClient.d.ts +349 -15
- package/dist/client/QueryClient.js +303 -195
- package/dist/client/core/fetch.d.ts +1 -0
- package/dist/client/core/fetch.js +62 -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 +84 -0
- package/dist/client/hooks/analytics.d.ts +1 -0
- package/dist/client/hooks/analytics.js +10 -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 +141 -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 +79 -0
- package/dist/client/hooks/events.d.ts +1 -0
- package/dist/client/hooks/events.js +307 -0
- package/dist/client/hooks/jobs.d.ts +1 -0
- package/dist/client/hooks/jobs.js +185 -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 +92 -0
- package/dist/client/hooks/plans.d.ts +1 -0
- package/dist/client/hooks/plans.js +9 -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 +123 -0
- package/dist/client/hooks/sessions.d.ts +1 -0
- package/dist/client/hooks/sessions.js +154 -0
- package/dist/client/hooks/teams.d.ts +1 -0
- package/dist/client/hooks/teams.js +117 -0
- package/dist/client/hooks/users.d.ts +1 -0
- package/dist/client/hooks/users.js +104 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +19 -0
- package/dist/types/api.d.ts +118 -29
- package/dist/types/api.js +10 -1
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ This SDK provides:
|
|
|
10
10
|
- Typed API interfaces for Avro entities (users, jobs, teams, etc.)
|
|
11
11
|
- Pluggable token storage (in-memory, localStorage, SecureStore, etc.)
|
|
12
12
|
- XHR-based requests for compatibility with React Native WebViews and older environments
|
|
13
|
+
- Mutation and Data Hooks for easy plug-in use in React and React Native projects.
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
@@ -2,6 +2,8 @@ import { TokenStorage, Tokens } from '../types/auth';
|
|
|
2
2
|
export declare class AuthManager {
|
|
3
3
|
private storages;
|
|
4
4
|
private baseUrl;
|
|
5
|
+
private tokenRefreshedCallbacks;
|
|
6
|
+
private tokenRefreshFailedCallbacks;
|
|
5
7
|
constructor({ baseUrl, storage, }: {
|
|
6
8
|
baseUrl: string;
|
|
7
9
|
storage: TokenStorage | TokenStorage[];
|
|
@@ -9,6 +11,8 @@ export declare class AuthManager {
|
|
|
9
11
|
isAuthenticated(): Promise<boolean>;
|
|
10
12
|
fetchNewTokens(): Promise<Tokens>;
|
|
11
13
|
accessToken(): Promise<string | undefined>;
|
|
14
|
+
onTokenRefreshed(callback: (accessToken: string) => void): void;
|
|
15
|
+
onTokenRefreshFailed(callback: () => void): void;
|
|
12
16
|
refreshTokens(): Promise<Tokens | null>;
|
|
13
17
|
setTokens(tokens: Tokens): Promise<void>;
|
|
14
18
|
clearTokens(): Promise<void>;
|
package/dist/auth/AuthManager.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { StandardError } from '../types/error';
|
|
1
2
|
export class AuthManager {
|
|
2
3
|
constructor({ baseUrl, storage, }) {
|
|
4
|
+
this.tokenRefreshedCallbacks = [];
|
|
5
|
+
this.tokenRefreshFailedCallbacks = [];
|
|
3
6
|
this.storages = Array.isArray(storage) ? storage : [storage];
|
|
4
7
|
if (this.storages.length === 0) {
|
|
5
8
|
throw new Error('At least one token storage must be provided');
|
|
@@ -74,7 +77,7 @@ export class AuthManager {
|
|
|
74
77
|
storage.clear();
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
|
-
throw new
|
|
80
|
+
throw new StandardError(410, 'Failed to refresh tokens from all storages');
|
|
78
81
|
}
|
|
79
82
|
async accessToken() {
|
|
80
83
|
if (!this.storages.length) {
|
|
@@ -88,14 +91,27 @@ export class AuthManager {
|
|
|
88
91
|
const newToken = await this.refreshTokens();
|
|
89
92
|
return newToken?.access_token;
|
|
90
93
|
}
|
|
94
|
+
onTokenRefreshed(callback) {
|
|
95
|
+
this.tokenRefreshedCallbacks.push(callback);
|
|
96
|
+
}
|
|
97
|
+
onTokenRefreshFailed(callback) {
|
|
98
|
+
this.tokenRefreshFailedCallbacks.push(callback);
|
|
99
|
+
}
|
|
91
100
|
async refreshTokens() {
|
|
92
101
|
try {
|
|
93
102
|
const newToken = await this.fetchNewTokens();
|
|
94
103
|
await Promise.all(this.storages.map(s => s.set(newToken)));
|
|
104
|
+
this.tokenRefreshedCallbacks.forEach(cb => {
|
|
105
|
+
if (newToken?.access_token)
|
|
106
|
+
cb(newToken.access_token);
|
|
107
|
+
});
|
|
95
108
|
return newToken;
|
|
96
109
|
}
|
|
97
110
|
catch (error) {
|
|
98
|
-
|
|
111
|
+
this.tokenRefreshFailedCallbacks.forEach(cb => cb());
|
|
112
|
+
if (error?.status !== 410) {
|
|
113
|
+
console.error('Failed to refresh tokens:', error);
|
|
114
|
+
}
|
|
99
115
|
return null;
|
|
100
116
|
}
|
|
101
117
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { Socket } from 'socket.io-client';
|
|
2
|
+
import { InfiniteData, UseInfiniteQueryResult, useMutation, UseQueryResult } from '@tanstack/react-query';
|
|
1
3
|
import { AuthManager } from '../auth/AuthManager';
|
|
4
|
+
import { _Event, ApiInfo, Avro, Bill, Break, Chat, Company, Job, LineItem, LoginResponse, Message, Plan, Route, ServiceMonth, Session, Team, User, UserCompanyAssociation } from '../types/api';
|
|
5
|
+
import { Tokens } from '../types/auth';
|
|
2
6
|
import { CancelToken, RetryStrategy } from '../types/client';
|
|
7
|
+
import { StandardError } from '../types/error';
|
|
3
8
|
export interface AvroQueryClientConfig {
|
|
4
9
|
baseUrl: string;
|
|
5
10
|
authManager: AuthManager;
|
|
@@ -7,22 +12,351 @@ export interface AvroQueryClientConfig {
|
|
|
7
12
|
retryStrategy?: RetryStrategy;
|
|
8
13
|
timeout?: number;
|
|
9
14
|
}
|
|
15
|
+
declare module '../client/QueryClient' {
|
|
16
|
+
interface AvroQueryClient {
|
|
17
|
+
_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>;
|
|
18
|
+
_fetch<T>(method: string, path: string, body: any, cancelToken?: CancelToken, headers?: Record<string, string>, isIdempotent?: boolean, retryCount?: number): Promise<T>;
|
|
19
|
+
getDelay(strategy: RetryStrategy, attempt: number): number;
|
|
20
|
+
sleep(ms: number): Promise<void>;
|
|
21
|
+
useGetRoot(): UseQueryResult<ApiInfo, StandardError>;
|
|
22
|
+
useGetJobs(companyGuid: string, body: {
|
|
23
|
+
amt?: number;
|
|
24
|
+
query?: string;
|
|
25
|
+
routeId?: string;
|
|
26
|
+
}, total: number, onProgress?: (fraction: number) => void, isMainLoad?: boolean): UseQueryResult<Job[], StandardError>;
|
|
27
|
+
useGetRoutes(companyGuid: string, body: {
|
|
28
|
+
amt?: number;
|
|
29
|
+
query?: string;
|
|
30
|
+
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Route[], StandardError>;
|
|
31
|
+
useGetTeams(companyGuid: string, body: {
|
|
32
|
+
amt?: number;
|
|
33
|
+
query?: string;
|
|
34
|
+
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Team[], StandardError>;
|
|
35
|
+
useGetEvents(companyGuid: string, body: {
|
|
36
|
+
amt?: number;
|
|
37
|
+
known_ids?: string[];
|
|
38
|
+
unknown_ids?: string[];
|
|
39
|
+
query?: string;
|
|
40
|
+
unbilled?: boolean;
|
|
41
|
+
billed?: boolean;
|
|
42
|
+
paid?: boolean;
|
|
43
|
+
jobId?: string;
|
|
44
|
+
}): UseInfiniteQueryResult<InfiniteData<_Event[], unknown>, StandardError>;
|
|
45
|
+
useGetChats(companyGuid: string, body: {
|
|
46
|
+
amt?: number;
|
|
47
|
+
known_ids?: string[];
|
|
48
|
+
unknown_ids?: string[];
|
|
49
|
+
query?: string;
|
|
50
|
+
}): UseInfiniteQueryResult<InfiniteData<Chat[], unknown>, StandardError>;
|
|
51
|
+
useGetMessages(chatGuid: string, body: {
|
|
52
|
+
amt?: number;
|
|
53
|
+
known_ids?: string[];
|
|
54
|
+
unknown_ids?: string[];
|
|
55
|
+
query?: string;
|
|
56
|
+
unbilled?: boolean;
|
|
57
|
+
billed?: boolean;
|
|
58
|
+
paid?: boolean;
|
|
59
|
+
jobId?: string;
|
|
60
|
+
}): UseInfiniteQueryResult<InfiniteData<Message[], unknown>, StandardError>;
|
|
61
|
+
useGetMonths(companyGuid: string, body: {
|
|
62
|
+
amt?: number;
|
|
63
|
+
known_ids?: string[];
|
|
64
|
+
unknown_ids?: string[];
|
|
65
|
+
query?: string;
|
|
66
|
+
unbilled?: boolean;
|
|
67
|
+
billed?: boolean;
|
|
68
|
+
paid?: boolean;
|
|
69
|
+
jobId?: string;
|
|
70
|
+
}): UseInfiniteQueryResult<InfiniteData<ServiceMonth[], unknown>, StandardError>;
|
|
71
|
+
useGetBills(companyGuid: string, body: {
|
|
72
|
+
amt?: number;
|
|
73
|
+
known_ids?: string[];
|
|
74
|
+
unknown_ids?: string[];
|
|
75
|
+
query?: string;
|
|
76
|
+
paid?: boolean;
|
|
77
|
+
}): UseInfiniteQueryResult<InfiniteData<Bill[], unknown>, StandardError>;
|
|
78
|
+
useGetPlans(code: string): UseQueryResult<Plan[], StandardError>;
|
|
79
|
+
useGetCompanies(options?: {}): UseQueryResult<{
|
|
80
|
+
name: string;
|
|
81
|
+
id: string;
|
|
82
|
+
}[], StandardError>;
|
|
83
|
+
useGetAnalytics(): UseQueryResult<any, StandardError>;
|
|
84
|
+
useGetCompany(companyId: string): UseQueryResult<Company, StandardError>;
|
|
85
|
+
useGetJob(jobId: string): UseQueryResult<Job, StandardError>;
|
|
86
|
+
useGetEvent(eventId: string): UseQueryResult<_Event, StandardError>;
|
|
87
|
+
useGetUser(userId: string): UseQueryResult<User, StandardError>;
|
|
88
|
+
useGetSelf(): UseQueryResult<User, StandardError>;
|
|
89
|
+
useGetBill(billId: string): UseQueryResult<Bill, StandardError>;
|
|
90
|
+
useGetRoute(routeId: string): UseQueryResult<Route, StandardError>;
|
|
91
|
+
useGetChat(chatId: string): UseQueryResult<Chat, StandardError>;
|
|
92
|
+
useGetUserSessions(): UseQueryResult<Session[], StandardError>;
|
|
93
|
+
useGetAvro(): UseQueryResult<Avro, StandardError>;
|
|
94
|
+
useSearchUsers(searchUsername: string): UseQueryResult<User[], StandardError>;
|
|
95
|
+
useCreateEvent(): ReturnType<typeof useMutation<{
|
|
96
|
+
id: string;
|
|
97
|
+
}, StandardError, {
|
|
98
|
+
companyId: string;
|
|
99
|
+
eventData: Partial<_Event>;
|
|
100
|
+
}>>;
|
|
101
|
+
useCreateUserSession(): ReturnType<typeof useMutation<{
|
|
102
|
+
id: string;
|
|
103
|
+
}, StandardError, {
|
|
104
|
+
companyId: string;
|
|
105
|
+
sessionData: Partial<Session>;
|
|
106
|
+
}>>;
|
|
107
|
+
useCreateBill(): ReturnType<typeof useMutation<{
|
|
108
|
+
id: string;
|
|
109
|
+
invoice_id: number;
|
|
110
|
+
}, StandardError, {
|
|
111
|
+
companyId: string;
|
|
112
|
+
data: {
|
|
113
|
+
line_items: LineItem[];
|
|
114
|
+
due_date: number;
|
|
115
|
+
users: string[];
|
|
116
|
+
custom_emails: [string, string][];
|
|
117
|
+
};
|
|
118
|
+
}>>;
|
|
119
|
+
useCreateJob(): ReturnType<typeof useMutation<{
|
|
120
|
+
id: string;
|
|
121
|
+
}, StandardError, {
|
|
122
|
+
companyId: string;
|
|
123
|
+
jobData: Partial<Job>;
|
|
124
|
+
}>>;
|
|
125
|
+
useCreateSelf(): ReturnType<typeof useMutation<{
|
|
126
|
+
msg: string;
|
|
127
|
+
}, StandardError, {
|
|
128
|
+
username: string;
|
|
129
|
+
name: string;
|
|
130
|
+
email: string;
|
|
131
|
+
password: string;
|
|
132
|
+
phone_number: string;
|
|
133
|
+
code?: string;
|
|
134
|
+
invite_token?: string;
|
|
135
|
+
}>>;
|
|
136
|
+
useCreateSessionBreak(): ReturnType<typeof useMutation<{
|
|
137
|
+
id: string;
|
|
138
|
+
}, StandardError, {
|
|
139
|
+
sessionId: string;
|
|
140
|
+
breakData: Partial<Break>;
|
|
141
|
+
}>>;
|
|
142
|
+
useUpdateEvent(): ReturnType<typeof useMutation<{
|
|
143
|
+
msg: string;
|
|
144
|
+
}, StandardError, {
|
|
145
|
+
eventId: string;
|
|
146
|
+
updates: Partial<_Event>;
|
|
147
|
+
}>>;
|
|
148
|
+
useUpdateUserSession(): ReturnType<typeof useMutation<{
|
|
149
|
+
msg: string;
|
|
150
|
+
}, StandardError, {
|
|
151
|
+
sessionId: string;
|
|
152
|
+
updates: Partial<Session>;
|
|
153
|
+
}>>;
|
|
154
|
+
useUpdateJob(): ReturnType<typeof useMutation<{
|
|
155
|
+
msg: string;
|
|
156
|
+
}, StandardError, {
|
|
157
|
+
jobId: string;
|
|
158
|
+
updates: Partial<Job>;
|
|
159
|
+
}>>;
|
|
160
|
+
useUpdateBill(): ReturnType<typeof useMutation<{
|
|
161
|
+
msg: string;
|
|
162
|
+
}, StandardError, {
|
|
163
|
+
billId: string;
|
|
164
|
+
updates: Partial<Bill>;
|
|
165
|
+
}>>;
|
|
166
|
+
useUpdateRoute(): ReturnType<typeof useMutation<{
|
|
167
|
+
msg: string;
|
|
168
|
+
}, StandardError, {
|
|
169
|
+
routeId: string;
|
|
170
|
+
updates: Partial<Route>;
|
|
171
|
+
}>>;
|
|
172
|
+
useUpdateEvents(): ReturnType<typeof useMutation<void, StandardError, {
|
|
173
|
+
companyId: string;
|
|
174
|
+
events: (_Event & {
|
|
175
|
+
page?: number;
|
|
176
|
+
})[];
|
|
177
|
+
action: "billed" | "paid";
|
|
178
|
+
}>>;
|
|
179
|
+
useUpdateTeam(): ReturnType<typeof useMutation<{
|
|
180
|
+
msg: string;
|
|
181
|
+
}, StandardError, {
|
|
182
|
+
teamId: string;
|
|
183
|
+
teamData: Partial<Team>;
|
|
184
|
+
}>>;
|
|
185
|
+
useUpdateMonths(): ReturnType<typeof useMutation<void, StandardError, {
|
|
186
|
+
companyId: string;
|
|
187
|
+
months: (ServiceMonth & {
|
|
188
|
+
page?: number;
|
|
189
|
+
})[];
|
|
190
|
+
action: "billed" | "paid";
|
|
191
|
+
}>>;
|
|
192
|
+
useUpdateUserCompany(): ReturnType<typeof useMutation<{
|
|
193
|
+
msg: string;
|
|
194
|
+
}, StandardError, {
|
|
195
|
+
company_id: string;
|
|
196
|
+
user_id: string;
|
|
197
|
+
data: Partial<UserCompanyAssociation>;
|
|
198
|
+
}>>;
|
|
199
|
+
useUpdateSessionBreak(): ReturnType<typeof useMutation<{
|
|
200
|
+
msg: string;
|
|
201
|
+
}, StandardError, {
|
|
202
|
+
breakId: string;
|
|
203
|
+
updates: Partial<Break>;
|
|
204
|
+
}>>;
|
|
205
|
+
useDeleteJob(): ReturnType<typeof useMutation<{
|
|
206
|
+
msg: string;
|
|
207
|
+
}, StandardError, {
|
|
208
|
+
jobId: string;
|
|
209
|
+
}>>;
|
|
210
|
+
useUpdateCompany(): ReturnType<typeof useMutation<{
|
|
211
|
+
msg: string;
|
|
212
|
+
}, StandardError, {
|
|
213
|
+
companyId: string;
|
|
214
|
+
companyData: Partial<Company | {
|
|
215
|
+
logo: File | null;
|
|
216
|
+
}>;
|
|
217
|
+
}>>;
|
|
218
|
+
useDeleteEvent(): ReturnType<typeof useMutation<{
|
|
219
|
+
msg: string;
|
|
220
|
+
}, StandardError, {
|
|
221
|
+
eventId: string;
|
|
222
|
+
}>>;
|
|
223
|
+
useDeleteBill(): ReturnType<typeof useMutation<{
|
|
224
|
+
msg: string;
|
|
225
|
+
}, StandardError, {
|
|
226
|
+
billId: string;
|
|
227
|
+
}>>;
|
|
228
|
+
useDeleteRoute(): ReturnType<typeof useMutation<{
|
|
229
|
+
msg: string;
|
|
230
|
+
}, StandardError, {
|
|
231
|
+
routeId: string;
|
|
232
|
+
}>>;
|
|
233
|
+
useDeleteSelf(): ReturnType<typeof useMutation<{
|
|
234
|
+
msg: string;
|
|
235
|
+
}, StandardError, void>>;
|
|
236
|
+
useDeleteCompany(): ReturnType<typeof useMutation<{
|
|
237
|
+
msg: string;
|
|
238
|
+
}, StandardError, {
|
|
239
|
+
companyId: string;
|
|
240
|
+
}>>;
|
|
241
|
+
useDeleteTeam(): ReturnType<typeof useMutation<{
|
|
242
|
+
msg: string;
|
|
243
|
+
}, StandardError, {
|
|
244
|
+
teamId: string;
|
|
245
|
+
}>>;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
10
248
|
export declare class AvroQueryClient {
|
|
11
|
-
|
|
249
|
+
protected config: Required<AvroQueryClientConfig>;
|
|
250
|
+
readonly socket: Socket;
|
|
251
|
+
_isAuthenticated: boolean;
|
|
12
252
|
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
|
-
|
|
253
|
+
emit(eventName: string, data: unknown): void;
|
|
254
|
+
on<T>(eventName: string, callback: (data: T) => void): void;
|
|
255
|
+
off(eventName: string, callback?: Function): void;
|
|
256
|
+
get<T>(path: string, cancelToken?: CancelToken, headers?: Record<string, string>, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<T>;
|
|
257
|
+
post<T>(path: string, data: any, cancelToken?: CancelToken, headers?: Record<string, string>, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<T>;
|
|
258
|
+
put<T>(path: string, data: any, cancelToken?: CancelToken, headers?: Record<string, string>, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<T>;
|
|
259
|
+
delete<T>(path: string, cancelToken?: CancelToken, headers?: Record<string, string>, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<T>;
|
|
260
|
+
useLogin(): ReturnType<typeof useMutation<LoginResponse, StandardError, {
|
|
21
261
|
username: string;
|
|
22
|
-
password
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
262
|
+
password?: string;
|
|
263
|
+
code?: string;
|
|
264
|
+
cancelToken?: CancelToken;
|
|
265
|
+
}>>;
|
|
266
|
+
useRequestCode(): ReturnType<typeof useMutation<{
|
|
267
|
+
msg: string;
|
|
268
|
+
}, StandardError, {
|
|
269
|
+
username?: string;
|
|
270
|
+
email?: string;
|
|
271
|
+
cancelToken?: CancelToken;
|
|
272
|
+
}>>;
|
|
273
|
+
useUpdatePassword(): ReturnType<typeof useMutation<void, StandardError, {
|
|
274
|
+
username?: string;
|
|
275
|
+
email?: string;
|
|
276
|
+
code: string;
|
|
277
|
+
newPassword: string;
|
|
278
|
+
cancelToken?: CancelToken;
|
|
279
|
+
}>>;
|
|
280
|
+
useGoogleLogin(): ReturnType<typeof useMutation<LoginResponse, StandardError, {
|
|
281
|
+
token: string;
|
|
282
|
+
cancelToken?: CancelToken;
|
|
283
|
+
}>>;
|
|
284
|
+
setTokens(tokens: Tokens): Promise<void>;
|
|
285
|
+
clearTokens(): Promise<void>;
|
|
286
|
+
isAuthenticated(): boolean;
|
|
287
|
+
isAuthenticatedAsync(): Promise<boolean>;
|
|
288
|
+
useLogout(): ReturnType<typeof useMutation<void, StandardError, CancelToken | undefined>>;
|
|
289
|
+
fetchJobs(companyGuid: string, body?: {
|
|
290
|
+
amt?: number;
|
|
291
|
+
known_ids?: string[];
|
|
292
|
+
unknown_ids?: string[];
|
|
293
|
+
query?: string;
|
|
294
|
+
offset?: number;
|
|
295
|
+
route_id?: string;
|
|
296
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
297
|
+
fetchChats(companyGuid: string, body?: {
|
|
298
|
+
amt?: number;
|
|
299
|
+
known_ids?: string[];
|
|
300
|
+
unknown_ids?: string[];
|
|
301
|
+
query?: string;
|
|
302
|
+
offset?: number;
|
|
303
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
304
|
+
fetchMessages(chatGuid: string, body?: {
|
|
305
|
+
amt?: number;
|
|
306
|
+
known_ids?: string[];
|
|
307
|
+
unknown_ids?: string[];
|
|
308
|
+
query?: string;
|
|
309
|
+
offset?: number;
|
|
310
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
311
|
+
fetchEvents(companyGuid: string, body?: {
|
|
312
|
+
amt?: number;
|
|
313
|
+
known_ids?: string[];
|
|
314
|
+
unknown_ids?: string[];
|
|
315
|
+
query?: string;
|
|
316
|
+
offset?: number;
|
|
317
|
+
unbilled?: boolean;
|
|
318
|
+
billed?: boolean;
|
|
319
|
+
paid?: boolean;
|
|
320
|
+
jobId?: string | null;
|
|
321
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
322
|
+
fetchMonths(companyGuid: string, body?: {
|
|
323
|
+
amt?: number;
|
|
324
|
+
known_ids?: string[];
|
|
325
|
+
unknown_ids?: string[];
|
|
326
|
+
query?: string;
|
|
327
|
+
offset?: number;
|
|
328
|
+
unbilled?: boolean;
|
|
329
|
+
billed?: boolean;
|
|
330
|
+
paid?: boolean;
|
|
331
|
+
jobId?: string | null;
|
|
332
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
333
|
+
fetchBills(companyGuid: string, body?: {
|
|
334
|
+
amt?: number;
|
|
335
|
+
known_ids?: string[];
|
|
336
|
+
unknown_ids?: string[];
|
|
337
|
+
query?: string;
|
|
338
|
+
offset?: number;
|
|
339
|
+
paid?: boolean;
|
|
340
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
341
|
+
fetchRoutes(companyGuid: string, body?: {
|
|
342
|
+
amt?: number;
|
|
343
|
+
known_ids?: string[];
|
|
344
|
+
unknown_ids?: string[];
|
|
345
|
+
query?: string;
|
|
346
|
+
offset?: number;
|
|
347
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
348
|
+
fetchTeams(companyGuid: string, body?: {
|
|
349
|
+
amt?: number;
|
|
350
|
+
known_ids?: string[];
|
|
351
|
+
unknown_ids?: string[];
|
|
352
|
+
query?: string;
|
|
353
|
+
offset?: number;
|
|
354
|
+
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
355
|
+
sendEmail(emailId: string, formData: FormData, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<void>;
|
|
356
|
+
createBill(companyGuid: string, data: {
|
|
357
|
+
line_items: LineItem[];
|
|
358
|
+
due_date: number;
|
|
359
|
+
users: string[];
|
|
360
|
+
custom_emails: [string, string][];
|
|
361
|
+
}, cancelToken?: CancelToken): Promise<any>;
|
|
28
362
|
}
|