@go-avro/avro-js 1.6.5 → 1.6.6-rc10
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/dist/client/QueryClient.d.ts +150 -60
- package/dist/client/QueryClient.js +175 -27
- package/dist/client/core/xhr.js +2 -1
- package/dist/client/hooks/audit.js +4 -2
- package/dist/client/hooks/avro.js +19 -2
- package/dist/client/hooks/bills.d.ts +1 -1
- package/dist/client/hooks/bills.js +54 -16
- package/dist/client/hooks/catalog_items.js +20 -5
- package/dist/client/hooks/chats.js +33 -1
- package/dist/client/hooks/companies.js +38 -4
- package/dist/client/hooks/events.js +13 -9
- package/dist/client/hooks/jobs.js +29 -3
- package/dist/client/hooks/messages.js +6 -2
- package/dist/client/hooks/plans.js +1 -1
- package/dist/client/hooks/routes.js +55 -5
- package/dist/client/hooks/sessions.js +39 -11
- package/dist/client/hooks/skills.js +1 -1
- package/dist/client/hooks/teams.js +5 -2
- package/dist/client/hooks/timecards.js +2 -1
- package/dist/client/hooks/users.js +21 -3
- package/dist/client/realtime.d.ts +13 -0
- package/dist/client/realtime.js +41 -8
- package/dist/client/requests.d.ts +503 -0
- package/dist/client/requests.js +5 -0
- package/dist/client/wire.d.ts +7 -0
- package/dist/client/wire.js +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/types/api/AdditionalCharge.d.ts +2 -1
- package/dist/types/api/Avro.d.ts +72 -21
- package/dist/types/api/Bill.d.ts +7 -5
- package/dist/types/api/BillPayment.d.ts +8 -4
- package/dist/types/api/BillUser.d.ts +3 -2
- package/dist/types/api/CatalogItem.d.ts +11 -6
- package/dist/types/api/Chat.d.ts +3 -5
- package/dist/types/api/Company.d.ts +41 -15
- package/dist/types/api/DelayEvent.d.ts +5 -2
- package/dist/types/api/Device.d.ts +5 -4
- package/dist/types/api/Email.d.ts +14 -3
- package/dist/types/api/Friendship.d.ts +8 -0
- package/dist/types/api/Group.d.ts +3 -2
- package/dist/types/api/Job.d.ts +55 -5
- package/dist/types/api/LineItem.d.ts +3 -2
- package/dist/types/api/MemberState.d.ts +2 -1
- package/dist/types/api/Message.d.ts +4 -3
- package/dist/types/api/Notification.d.ts +26 -0
- package/dist/types/api/PaymentMethod.d.ts +7 -2
- package/dist/types/api/PaymentOption.d.ts +6 -4
- package/dist/types/api/Payout.d.ts +1 -1
- package/dist/types/api/Plan.d.ts +5 -4
- package/dist/types/api/PlanPayment.d.ts +5 -3
- package/dist/types/api/Prepayment.d.ts +2 -1
- package/dist/types/api/Proposal.d.ts +1 -1
- package/dist/types/api/Reaction.d.ts +3 -3
- package/dist/types/api/Refund.d.ts +1 -1
- package/dist/types/api/Route.d.ts +11 -10
- package/dist/types/api/Route.js +5 -0
- package/dist/types/api/RouteJob.d.ts +1 -1
- package/dist/types/api/ServiceMonth.d.ts +2 -2
- package/dist/types/api/Session.d.ts +5 -2
- package/dist/types/api/Skill.d.ts +2 -2
- package/dist/types/api/Subscription.d.ts +5 -3
- package/dist/types/api/Task.d.ts +10 -9
- package/dist/types/api/Task.js +3 -1
- package/dist/types/api/TimecardAction.d.ts +2 -2
- package/dist/types/api/User.d.ts +11 -9
- package/dist/types/api/UserCompanyAssociation.d.ts +7 -1
- package/dist/types/api/UserMerge.d.ts +3 -3
- package/dist/types/api/_Event.d.ts +20 -4
- package/dist/types/api/_Event.js +1 -0
- package/dist/types/api.d.ts +156 -39
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Socket } from 'socket.io-client';
|
|
2
2
|
import { InfiniteData, QueryClient, UseInfiniteQueryResult, useMutation, UseQueryResult } from '@tanstack/react-query';
|
|
3
3
|
import { AuthManager } from '../auth/AuthManager.js';
|
|
4
|
-
import { _Event, ActiveSessionSummary, AddressFeatureCollection, ApiInfo, Avro, StorageAnalytics, ClientErrorReport, ErrorLogEntry, PerformanceMetrics, AuditLogEntry, AuditQueryParams, Bill, BillInsightData, BillLineItemStatusUpdate, BillStatus,
|
|
4
|
+
import { _Event, ActiveSessionSummary, AddressFeatureCollection, ApiInfo, Avro, StorageAnalytics, ClientErrorReport, ErrorLogEntry, PerformanceMetrics, AuditLogEntry, AuditQueryParams, Bill, BillInsightData, BillLineItemStatusUpdate, BillStatus, Chat, CheckIn, Company, CompanySummary, DelayEventCreatePayload, EventUpdatePayload, LineItemType, FinancialInsightData, RevenueInsightData, Job, JobUpdate, EventInsightData, AppleLinkProof, AppleLoginResult, MicrosoftLoginResult, LoginResponse, Message, Permission, Plan, Route, ServiceMonth, Session, Team, User, UserCompanyAssociation, UserMergeSummary, Skill, Group, Label, RouteScheduleConfig, RouteWritePayload, CatalogIndustry, CatalogItem, Device, DeviceInfo, LocationServicesStatus, Payout, Prepayment, Timecard, TimecardActionType, TimecardStatus } from '../types/api.js';
|
|
5
5
|
import { AuthState, Tokens } from '../types/auth.js';
|
|
6
6
|
import { CancelToken, ClientId, RetryStrategy } from '../types/client.js';
|
|
7
7
|
import { StandardError } from '../types/error.js';
|
|
@@ -11,6 +11,7 @@ import { Proposal } from '../types/api/Proposal.js';
|
|
|
11
11
|
import { ProposalTerms } from '../types/api/ProposalTerms.js';
|
|
12
12
|
import type { EmailSucceededPayload, EmailFailedPayload, EmailType } from '../types/api/EmailNotification.js';
|
|
13
13
|
import type { BulkDeleteBillsResponse, BulkEmailBillsResponse } from './hooks/bills.js';
|
|
14
|
+
import type { BillWritePayload, BreakWritePayload, CatalogItemCreatePayload, CatalogItemUpdatePayload, CompanyCreatePayload, CompanyUpdatePayload, EventCreatePayload, IntuitSyncStatus, MemberAddPayload, MemberUpdatePayload, PayoutStatusFilter, ProposalReviewPayload, ProposalWritePayload, SessionCreatePayload, SessionUpdatePayload, SkillCreatePayload, SkillUpdatePayload, TeamWritePayload, UserCreatePayload, UserUpdatePayload } from './requests.js';
|
|
14
15
|
import { type QueryPersistOptions } from './persist.js';
|
|
15
16
|
export interface TrackEmailOptions {
|
|
16
17
|
emailType?: EmailType;
|
|
@@ -34,7 +35,7 @@ export interface AvroQueryClientConfig {
|
|
|
34
35
|
}
|
|
35
36
|
declare module './QueryClient.js' {
|
|
36
37
|
interface AvroQueryClient {
|
|
37
|
-
_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>;
|
|
38
|
+
_xhr<T>(method: string, path: string, body: any, cancelToken?: CancelToken, headers?: Record<string, string>, isIdempotent?: boolean, retryCount?: number, progressUpdateCallback?: (loaded: number, total: number) => void, refreshOnUnauthorized?: boolean): Promise<T>;
|
|
38
39
|
_fetch<T>(method: string, path: string, body: any, cancelToken?: CancelToken, headers?: Record<string, string>, isIdempotent?: boolean, retryCount?: number): Promise<T>;
|
|
39
40
|
getDelay(strategy: RetryStrategy, attempt: number): number;
|
|
40
41
|
sleep(ms: number): Promise<void>;
|
|
@@ -146,7 +147,7 @@ declare module './QueryClient.js' {
|
|
|
146
147
|
useGetPayouts(body: {
|
|
147
148
|
amt?: number;
|
|
148
149
|
query?: string;
|
|
149
|
-
status?:
|
|
150
|
+
status?: PayoutStatusFilter | '';
|
|
150
151
|
known_ids?: string[];
|
|
151
152
|
unknown_ids?: string[];
|
|
152
153
|
created_from?: number;
|
|
@@ -178,14 +179,15 @@ declare module './QueryClient.js' {
|
|
|
178
179
|
offset?: number;
|
|
179
180
|
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Group[], StandardError>;
|
|
180
181
|
useGetPlans(code: string): UseQueryResult<Plan[], StandardError>;
|
|
181
|
-
useGetCompanies(options?: {}): UseQueryResult<
|
|
182
|
+
useGetCompanies(options?: {}): UseQueryResult<CompanySummary[], StandardError>;
|
|
182
183
|
generatePDFFromBackend({ billId }: {
|
|
183
184
|
billId: string;
|
|
184
185
|
}): Promise<Blob>;
|
|
185
186
|
sendBillingEmail(options: {
|
|
186
187
|
billId: string;
|
|
187
188
|
subject?: string;
|
|
188
|
-
|
|
189
|
+
/** `[name, email]` pairs; omitted: the bill's own recipients. */
|
|
190
|
+
recipients?: [string, string][];
|
|
189
191
|
request_id?: string;
|
|
190
192
|
}): Promise<{
|
|
191
193
|
msg: string;
|
|
@@ -193,10 +195,12 @@ declare module './QueryClient.js' {
|
|
|
193
195
|
useGetProposal(proposal_id: string): UseQueryResult<Proposal, StandardError>;
|
|
194
196
|
useGetProposalTerms(): UseQueryResult<ProposalTerms[], StandardError>;
|
|
195
197
|
useCreateProposalTerms(): ReturnType<typeof useMutation<{
|
|
198
|
+
msg: string;
|
|
196
199
|
id: string;
|
|
197
200
|
}, StandardError, {
|
|
198
201
|
name: string;
|
|
199
202
|
body: string;
|
|
203
|
+
archived?: boolean;
|
|
200
204
|
}>>;
|
|
201
205
|
useUpdateProposalTerms(): ReturnType<typeof useMutation<{
|
|
202
206
|
msg: string;
|
|
@@ -248,6 +252,12 @@ declare module './QueryClient.js' {
|
|
|
248
252
|
useGetRoute(routeId: string): UseQueryResult<Route, StandardError>;
|
|
249
253
|
useGetChat(chatId: string): UseQueryResult<Chat, StandardError>;
|
|
250
254
|
useGetCatalogItem(catalogItemId: string): UseQueryResult<CatalogItem, StandardError>;
|
|
255
|
+
useGetCatalogItems(body?: {
|
|
256
|
+
query?: string;
|
|
257
|
+
industry?: CatalogIndustry;
|
|
258
|
+
archived?: boolean;
|
|
259
|
+
companyId?: string;
|
|
260
|
+
}): UseQueryResult<CatalogItem[], StandardError>;
|
|
251
261
|
useGetUserSessions(): UseQueryResult<Session[], StandardError>;
|
|
252
262
|
useGetCompanySessionsByIds(sessionIds: string[], params?: {
|
|
253
263
|
companyId?: string;
|
|
@@ -276,6 +286,15 @@ declare module './QueryClient.js' {
|
|
|
276
286
|
msg: string;
|
|
277
287
|
cleared: number;
|
|
278
288
|
}, StandardError, void>>;
|
|
289
|
+
/**
|
|
290
|
+
* Root only: run scheduled jobs now (all of them when called with no
|
|
291
|
+
* ids). The scheduler starts them within a few seconds; watch their
|
|
292
|
+
* status in `useGetPerformanceMetrics`.
|
|
293
|
+
*/
|
|
294
|
+
useRunSchedulerJobs(): ReturnType<typeof useMutation<{
|
|
295
|
+
msg: string;
|
|
296
|
+
jobs: string[];
|
|
297
|
+
}, StandardError, string[] | void>>;
|
|
279
298
|
useSearchUsers(searchUsername: string): UseQueryResult<User[], StandardError>;
|
|
280
299
|
useMergeUsersPreview(keepId: string, duplicateId: string): UseQueryResult<UserMergeSummary, StandardError>;
|
|
281
300
|
useMergeUsers(): ReturnType<typeof useMutation<UserMergeSummary, StandardError, {
|
|
@@ -285,14 +304,17 @@ declare module './QueryClient.js' {
|
|
|
285
304
|
useReviewProposal(proposal_id: string): ReturnType<typeof useMutation<{
|
|
286
305
|
msg: string;
|
|
287
306
|
bill_id?: string;
|
|
307
|
+
}, StandardError, ProposalReviewPayload>>;
|
|
308
|
+
useCreateChat(): ReturnType<typeof useMutation<{
|
|
309
|
+
msg?: string;
|
|
310
|
+
id: string;
|
|
288
311
|
}, StandardError, {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
pay_in_cash?: boolean;
|
|
312
|
+
name: string;
|
|
313
|
+
users: string[];
|
|
314
|
+
message?: {
|
|
315
|
+
content: string;
|
|
316
|
+
time_sent?: number;
|
|
317
|
+
};
|
|
296
318
|
}>>;
|
|
297
319
|
useCreateMessage(chatId: string): ReturnType<typeof useMutation<{
|
|
298
320
|
msg?: string;
|
|
@@ -303,36 +325,47 @@ declare module './QueryClient.js' {
|
|
|
303
325
|
id?: string;
|
|
304
326
|
}>>;
|
|
305
327
|
useCreateProposal(): ReturnType<typeof useMutation<{
|
|
328
|
+
msg: string;
|
|
306
329
|
id: string;
|
|
307
330
|
}, StandardError, {
|
|
308
331
|
job_id: string;
|
|
309
|
-
data:
|
|
332
|
+
data: ProposalWritePayload;
|
|
310
333
|
}>>;
|
|
311
334
|
useCreateGroup(): ReturnType<typeof useMutation<{
|
|
335
|
+
msg: string;
|
|
312
336
|
id: string;
|
|
313
337
|
}, StandardError, {
|
|
314
|
-
groupData: Partial<Group
|
|
338
|
+
groupData: Partial<Group> & {
|
|
339
|
+
name: string;
|
|
340
|
+
};
|
|
315
341
|
}>>;
|
|
316
342
|
useCreateWaiver(): ReturnType<typeof useMutation<{
|
|
343
|
+
msg: string;
|
|
317
344
|
id: string;
|
|
318
345
|
}, StandardError, {
|
|
319
|
-
waiverData: Partial<Waiver
|
|
346
|
+
waiverData: Partial<Waiver> & {
|
|
347
|
+
name: string;
|
|
348
|
+
};
|
|
320
349
|
}>>;
|
|
321
350
|
useCreateLabel(): ReturnType<typeof useMutation<{
|
|
351
|
+
msg: string;
|
|
322
352
|
id: string;
|
|
323
353
|
}, StandardError, {
|
|
324
|
-
labelData: Partial<Label
|
|
354
|
+
labelData: Partial<Label> & {
|
|
355
|
+
name: string;
|
|
356
|
+
};
|
|
325
357
|
}>>;
|
|
326
358
|
useCreateSkill(): ReturnType<typeof useMutation<{
|
|
359
|
+
msg: string;
|
|
327
360
|
id: string;
|
|
328
361
|
}, StandardError, {
|
|
329
|
-
skillData:
|
|
362
|
+
skillData: SkillCreatePayload;
|
|
330
363
|
}>>;
|
|
331
364
|
useCreateEvent(): ReturnType<typeof useMutation<{
|
|
332
365
|
id: string;
|
|
333
366
|
msg: string;
|
|
334
367
|
}, StandardError, {
|
|
335
|
-
eventData:
|
|
368
|
+
eventData: EventCreatePayload;
|
|
336
369
|
}>>;
|
|
337
370
|
useCreateDelayEvent(): ReturnType<typeof useMutation<{
|
|
338
371
|
id: string;
|
|
@@ -341,9 +374,10 @@ declare module './QueryClient.js' {
|
|
|
341
374
|
delayData: DelayEventCreatePayload;
|
|
342
375
|
}>>;
|
|
343
376
|
useCreateUserSession(): ReturnType<typeof useMutation<{
|
|
344
|
-
|
|
377
|
+
msg: string;
|
|
378
|
+
id: string | null;
|
|
345
379
|
}, StandardError, {
|
|
346
|
-
sessionData:
|
|
380
|
+
sessionData: SessionCreatePayload;
|
|
347
381
|
}>>;
|
|
348
382
|
useCreateTimecard(): ReturnType<typeof useMutation<{
|
|
349
383
|
msg: string;
|
|
@@ -358,65 +392,62 @@ declare module './QueryClient.js' {
|
|
|
358
392
|
};
|
|
359
393
|
}>>;
|
|
360
394
|
useCreateBill(): ReturnType<typeof useMutation<{
|
|
395
|
+
msg: string;
|
|
361
396
|
id: string;
|
|
362
397
|
invoice_id: number;
|
|
363
398
|
}, StandardError, {
|
|
364
|
-
data:
|
|
399
|
+
data: BillWritePayload;
|
|
365
400
|
}>>;
|
|
366
401
|
useCreateCompany(): ReturnType<typeof useMutation<{
|
|
402
|
+
msg: string;
|
|
367
403
|
id: string;
|
|
368
404
|
}, StandardError, {
|
|
369
|
-
companyData:
|
|
370
|
-
logo: File | null;
|
|
371
|
-
}>;
|
|
405
|
+
companyData: CompanyCreatePayload;
|
|
372
406
|
}>>;
|
|
373
407
|
useCreateCatalogItem(): ReturnType<typeof useMutation<{
|
|
408
|
+
msg: string;
|
|
374
409
|
id: string;
|
|
375
410
|
}, StandardError, {
|
|
376
|
-
data:
|
|
411
|
+
data: CatalogItemCreatePayload;
|
|
377
412
|
}>>;
|
|
378
413
|
useCreateJob(): ReturnType<typeof useMutation<{
|
|
414
|
+
msg: string;
|
|
379
415
|
id: string;
|
|
380
416
|
}, StandardError, {
|
|
381
|
-
jobData:
|
|
417
|
+
jobData: JobUpdate;
|
|
382
418
|
}>>;
|
|
383
419
|
useCreateRoute(): ReturnType<typeof useMutation<{
|
|
420
|
+
msg: string;
|
|
384
421
|
id: string;
|
|
385
422
|
}, StandardError, {
|
|
386
423
|
routeData: RouteWritePayload;
|
|
387
424
|
}>>;
|
|
388
425
|
useCreateTeam(): ReturnType<typeof useMutation<{
|
|
426
|
+
msg: string;
|
|
389
427
|
id: string;
|
|
390
428
|
}, StandardError, {
|
|
391
|
-
teamData:
|
|
429
|
+
teamData: TeamWritePayload & {
|
|
430
|
+
name: string;
|
|
431
|
+
};
|
|
392
432
|
}>>;
|
|
393
433
|
useCreateSelf(): ReturnType<typeof useMutation<{
|
|
394
434
|
msg: string;
|
|
395
435
|
id?: string;
|
|
396
436
|
access_token?: string;
|
|
397
437
|
refresh_token?: string;
|
|
398
|
-
}, StandardError,
|
|
399
|
-
code?: string;
|
|
400
|
-
invite_token?: string;
|
|
401
|
-
password?: string;
|
|
402
|
-
company_id?: string;
|
|
403
|
-
}>>;
|
|
438
|
+
}, StandardError, UserCreatePayload>>;
|
|
404
439
|
useCreateUser(): ReturnType<typeof useMutation<{
|
|
405
440
|
msg: string;
|
|
406
441
|
id?: string;
|
|
407
442
|
access_token?: string;
|
|
408
443
|
refresh_token?: string;
|
|
409
|
-
}, StandardError,
|
|
410
|
-
code?: string;
|
|
411
|
-
invite_token?: string;
|
|
412
|
-
password?: string;
|
|
413
|
-
company_id?: string;
|
|
414
|
-
}>>;
|
|
444
|
+
}, StandardError, UserCreatePayload>>;
|
|
415
445
|
useCreateSessionBreak(): ReturnType<typeof useMutation<{
|
|
446
|
+
msg: string;
|
|
416
447
|
id: string;
|
|
417
448
|
}, StandardError, {
|
|
418
449
|
sessionId: string;
|
|
419
|
-
breakData:
|
|
450
|
+
breakData: BreakWritePayload;
|
|
420
451
|
}>>;
|
|
421
452
|
useManageJobs(): ReturnType<typeof useMutation<void, StandardError, {
|
|
422
453
|
jobs: JobUpdate[];
|
|
@@ -446,7 +477,7 @@ declare module './QueryClient.js' {
|
|
|
446
477
|
}>>;
|
|
447
478
|
useCheckOut(): ReturnType<typeof useMutation<{
|
|
448
479
|
msg: string;
|
|
449
|
-
id: string;
|
|
480
|
+
id: string | null;
|
|
450
481
|
job_id: string | null;
|
|
451
482
|
}, StandardError, {
|
|
452
483
|
checkinId: string;
|
|
@@ -458,14 +489,14 @@ declare module './QueryClient.js' {
|
|
|
458
489
|
}>;
|
|
459
490
|
checkOut(checkinId: string): Promise<{
|
|
460
491
|
msg: string;
|
|
461
|
-
id: string;
|
|
492
|
+
id: string | null;
|
|
462
493
|
job_id: string | null;
|
|
463
494
|
}>;
|
|
464
495
|
useImportBillsFromIntuit(): ReturnType<typeof useMutation<{
|
|
465
496
|
msg: string;
|
|
466
|
-
imported: number;
|
|
467
|
-
skipped: number;
|
|
468
497
|
}, StandardError, void>>;
|
|
498
|
+
/** The company's QuickBooks sync as its socket events report it. */
|
|
499
|
+
useIntuitSyncStatus(): IntuitSyncStatus;
|
|
469
500
|
useSyncBillToIntuit(): ReturnType<typeof useMutation<{
|
|
470
501
|
msg: string;
|
|
471
502
|
}, StandardError, {
|
|
@@ -481,7 +512,7 @@ declare module './QueryClient.js' {
|
|
|
481
512
|
msg: string;
|
|
482
513
|
}, StandardError, {
|
|
483
514
|
sessionId: string;
|
|
484
|
-
updates:
|
|
515
|
+
updates: SessionUpdatePayload;
|
|
485
516
|
}>>;
|
|
486
517
|
useUpdateTimecard(): ReturnType<typeof useMutation<{
|
|
487
518
|
msg: string;
|
|
@@ -518,7 +549,7 @@ declare module './QueryClient.js' {
|
|
|
518
549
|
msg: string;
|
|
519
550
|
}, StandardError, {
|
|
520
551
|
catalogItemId: string;
|
|
521
|
-
data:
|
|
552
|
+
data: CatalogItemUpdatePayload;
|
|
522
553
|
}>>;
|
|
523
554
|
useUpdateJob(): ReturnType<typeof useMutation<{
|
|
524
555
|
msg: string;
|
|
@@ -530,13 +561,13 @@ declare module './QueryClient.js' {
|
|
|
530
561
|
msg: string;
|
|
531
562
|
}, StandardError, {
|
|
532
563
|
skillId: string;
|
|
533
|
-
updates:
|
|
564
|
+
updates: SkillUpdatePayload;
|
|
534
565
|
}>>;
|
|
535
566
|
useUpdateBill(): ReturnType<typeof useMutation<{
|
|
536
567
|
msg: string;
|
|
537
568
|
}, StandardError, {
|
|
538
569
|
billId: string;
|
|
539
|
-
updates:
|
|
570
|
+
updates: BillWritePayload;
|
|
540
571
|
}>>;
|
|
541
572
|
useUpdateBillLineItemStatus(): ReturnType<typeof useMutation<{
|
|
542
573
|
msg: string;
|
|
@@ -561,7 +592,7 @@ declare module './QueryClient.js' {
|
|
|
561
592
|
msg: string;
|
|
562
593
|
}, StandardError, {
|
|
563
594
|
teamId: string;
|
|
564
|
-
teamData:
|
|
595
|
+
teamData: TeamWritePayload;
|
|
565
596
|
}>>;
|
|
566
597
|
useUpdateMonth(): ReturnType<typeof useMutation<{
|
|
567
598
|
msg: string;
|
|
@@ -585,7 +616,7 @@ declare module './QueryClient.js' {
|
|
|
585
616
|
msg: string;
|
|
586
617
|
}, StandardError, {
|
|
587
618
|
user_id: string;
|
|
588
|
-
data:
|
|
619
|
+
data: MemberUpdatePayload;
|
|
589
620
|
}>>;
|
|
590
621
|
useDevices(): UseQueryResult<Device[], StandardError>;
|
|
591
622
|
useGetCompanyUsers(body?: {
|
|
@@ -593,6 +624,8 @@ declare module './QueryClient.js' {
|
|
|
593
624
|
user_ids?: string[];
|
|
594
625
|
enabled?: boolean;
|
|
595
626
|
}): UseQueryResult<UserCompanyAssociation[], StandardError>;
|
|
627
|
+
/** Whether the viewer's membership grants `permission`; undefined until known. */
|
|
628
|
+
useHasPermission(permission: Permission): boolean | undefined;
|
|
596
629
|
useReportDevice(): ReturnType<typeof useMutation<Device, StandardError, DeviceInfo & {
|
|
597
630
|
location_status?: LocationServicesStatus;
|
|
598
631
|
}>>;
|
|
@@ -610,13 +643,13 @@ declare module './QueryClient.js' {
|
|
|
610
643
|
msg: string;
|
|
611
644
|
}, StandardError, {
|
|
612
645
|
breakId: string;
|
|
613
|
-
updates:
|
|
646
|
+
updates: BreakWritePayload;
|
|
614
647
|
}>>;
|
|
615
648
|
useUpdateCompanySession(): ReturnType<typeof useMutation<{
|
|
616
649
|
msg: string;
|
|
617
650
|
}, StandardError, {
|
|
618
651
|
sessionId: string;
|
|
619
|
-
updates:
|
|
652
|
+
updates: SessionUpdatePayload;
|
|
620
653
|
companyId?: string;
|
|
621
654
|
}>>;
|
|
622
655
|
useDeleteCompanySession(): ReturnType<typeof useMutation<{
|
|
@@ -627,7 +660,7 @@ declare module './QueryClient.js' {
|
|
|
627
660
|
}>>;
|
|
628
661
|
useUpdateUser(userId: string): ReturnType<typeof useMutation<{
|
|
629
662
|
msg: string;
|
|
630
|
-
}, StandardError,
|
|
663
|
+
}, StandardError, UserUpdatePayload>>;
|
|
631
664
|
useDeleteJobs(): ReturnType<typeof useMutation<{
|
|
632
665
|
msg: string;
|
|
633
666
|
}, StandardError, {
|
|
@@ -642,15 +675,21 @@ declare module './QueryClient.js' {
|
|
|
642
675
|
msg: string;
|
|
643
676
|
}, StandardError, {
|
|
644
677
|
companyId: string;
|
|
645
|
-
companyData:
|
|
646
|
-
logo: File | null;
|
|
647
|
-
}>;
|
|
678
|
+
companyData: CompanyUpdatePayload;
|
|
648
679
|
}>>;
|
|
649
680
|
useCreateUserCompany(): ReturnType<typeof useMutation<{
|
|
650
681
|
id: string;
|
|
651
682
|
}, StandardError, {
|
|
652
683
|
user_id: string;
|
|
653
|
-
data:
|
|
684
|
+
data: MemberAddPayload;
|
|
685
|
+
}>>;
|
|
686
|
+
useAddUserCompany(): ReturnType<typeof useMutation<{
|
|
687
|
+
msg: string;
|
|
688
|
+
id: string;
|
|
689
|
+
}, StandardError, {
|
|
690
|
+
userId: string;
|
|
691
|
+
groupId?: string;
|
|
692
|
+
companyId?: string;
|
|
654
693
|
}>>;
|
|
655
694
|
useRemoveUserCompany(): ReturnType<typeof useMutation<{
|
|
656
695
|
msg: string;
|
|
@@ -798,7 +837,7 @@ export declare class AvroQueryClient {
|
|
|
798
837
|
* Fire-and-forget: never throws, so it is safe inside error handlers.
|
|
799
838
|
*/
|
|
800
839
|
reportClientError(report: ClientErrorReport): Promise<void>;
|
|
801
|
-
post<T>({ path, data, cancelToken, headers, progressUpdateCallback, maxRetries, idempotent, }: {
|
|
840
|
+
post<T>({ path, data, cancelToken, headers, progressUpdateCallback, maxRetries, idempotent, refreshOnUnauthorized, }: {
|
|
802
841
|
path: string;
|
|
803
842
|
data?: any;
|
|
804
843
|
cancelToken?: CancelToken;
|
|
@@ -811,6 +850,12 @@ export declare class AvroQueryClient {
|
|
|
811
850
|
* reached the server is never replayed.
|
|
812
851
|
*/
|
|
813
852
|
idempotent?: boolean;
|
|
853
|
+
/**
|
|
854
|
+
* Refresh the session and replay once on a 401 (default true).
|
|
855
|
+
* Turn off for requests whose 401 is an answer, not an expired
|
|
856
|
+
* token, and that can't be replayed (one-time handles).
|
|
857
|
+
*/
|
|
858
|
+
refreshOnUnauthorized?: boolean;
|
|
814
859
|
}): Promise<T>;
|
|
815
860
|
put<T>({ path, data, cancelToken, headers, progressUpdateCallback, }: {
|
|
816
861
|
path: string;
|
|
@@ -891,6 +936,37 @@ export declare class AvroQueryClient {
|
|
|
891
936
|
useAppleUnlink(): ReturnType<typeof useMutation<{
|
|
892
937
|
msg: string;
|
|
893
938
|
}, StandardError, void>>;
|
|
939
|
+
/**
|
|
940
|
+
* Sign in with a Microsoft authorization code (`code` + the `uri` it was
|
|
941
|
+
* issued for). With no account for the identity yet this resolves
|
|
942
|
+
* `NEEDS_ACCOUNT` (rather than failing) carrying the handle for
|
|
943
|
+
* `useMicrosoftLink`. A 401 means the matching account is linked to
|
|
944
|
+
* another Microsoft identity.
|
|
945
|
+
*/
|
|
946
|
+
useMicrosoftLogin(): ReturnType<typeof useMutation<MicrosoftLoginResult, StandardError, {
|
|
947
|
+
code: string;
|
|
948
|
+
uri: string;
|
|
949
|
+
cancelToken?: CancelToken;
|
|
950
|
+
}>>;
|
|
951
|
+
/**
|
|
952
|
+
* Finish a `NEEDS_ACCOUNT` Microsoft sign-in with its `microsoft_token`
|
|
953
|
+
* once the account exists, then sign in with the returned tokens.
|
|
954
|
+
*
|
|
955
|
+
* When the 404 carried an `email`, the handle signs in to the account
|
|
956
|
+
* with that address and no session is needed. When `email` was null,
|
|
957
|
+
* the identity is linked to the account this client is signed in to:
|
|
958
|
+
* sign in to the new account first (e.g. `loginSuccess` with the tokens
|
|
959
|
+
* `POST /user` returned, or a code login when it answered
|
|
960
|
+
* `TOTP required`); the request carries the current session's token.
|
|
961
|
+
* 401s: `Sign in to link this Microsoft account` (no session; the
|
|
962
|
+
* handle stays valid for a retry within 10 min), `This Microsoft
|
|
963
|
+
* account is linked to another account`, `This account is linked to
|
|
964
|
+
* another Microsoft account`. 400: the handle is invalid or expired.
|
|
965
|
+
*/
|
|
966
|
+
useMicrosoftLink(): ReturnType<typeof useMutation<LoginResponse, StandardError, {
|
|
967
|
+
microsoftToken: string;
|
|
968
|
+
cancelToken?: CancelToken;
|
|
969
|
+
}>>;
|
|
894
970
|
setTokens(tokens: Tokens): Promise<void>;
|
|
895
971
|
setCache(data: Partial<CacheData> | Object): Promise<void>;
|
|
896
972
|
getCache(key?: keyof CacheData | string): Promise<CacheData[keyof CacheData] | Object | string | null>;
|
|
@@ -995,9 +1071,12 @@ export declare class AvroQueryClient {
|
|
|
995
1071
|
billed?: boolean;
|
|
996
1072
|
paid?: boolean;
|
|
997
1073
|
job_id?: string | null;
|
|
1074
|
+
task_id?: string | null;
|
|
998
1075
|
sort_by?: 'date' | 'amount' | 'name';
|
|
999
1076
|
direction?: 'asc' | 'desc';
|
|
1000
1077
|
line_item_types?: LineItemType[];
|
|
1078
|
+
created_from?: number;
|
|
1079
|
+
created_to?: number;
|
|
1001
1080
|
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
1002
1081
|
fetchMonths(body?: {
|
|
1003
1082
|
amt?: number;
|
|
@@ -1034,7 +1113,7 @@ export declare class AvroQueryClient {
|
|
|
1034
1113
|
fetchPayouts(body?: {
|
|
1035
1114
|
amt?: number;
|
|
1036
1115
|
query?: string;
|
|
1037
|
-
status?:
|
|
1116
|
+
status?: PayoutStatusFilter | '';
|
|
1038
1117
|
known_ids?: string[];
|
|
1039
1118
|
unknown_ids?: string[];
|
|
1040
1119
|
offset?: number;
|
|
@@ -1083,6 +1162,16 @@ export declare class AvroQueryClient {
|
|
|
1083
1162
|
query?: string;
|
|
1084
1163
|
offset?: number;
|
|
1085
1164
|
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
1165
|
+
/** Any signed-in user may list a company's catalog (`companyId`). */
|
|
1166
|
+
fetchCatalogItems(body?: {
|
|
1167
|
+
amt?: number;
|
|
1168
|
+
unknown_ids?: string[];
|
|
1169
|
+
query?: string;
|
|
1170
|
+
offset?: number;
|
|
1171
|
+
industry?: CatalogIndustry;
|
|
1172
|
+
/** Only archived (`true`) or active (`false`) items; both if unset. */
|
|
1173
|
+
archived?: boolean;
|
|
1174
|
+
}, companyId?: string | undefined, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<CatalogItem[]>;
|
|
1086
1175
|
fetchSkills(body?: {
|
|
1087
1176
|
amt?: number;
|
|
1088
1177
|
known_ids?: string[];
|
|
@@ -1104,7 +1193,8 @@ export declare class AvroQueryClient {
|
|
|
1104
1193
|
sendEmail(emailId: string, formData: FormData, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<void>;
|
|
1105
1194
|
sendBillEmail(billId: string, body?: {
|
|
1106
1195
|
subject?: string;
|
|
1107
|
-
|
|
1196
|
+
/** `[name, email]` pairs; omitted: the bill's own recipients. */
|
|
1197
|
+
recipients?: [string, string][];
|
|
1108
1198
|
base_url?: string;
|
|
1109
1199
|
request_id?: string;
|
|
1110
1200
|
}): Promise<void>;
|