@go-avro/avro-js 1.6.5 → 1.6.6-rc1
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 +122 -63
- package/dist/client/QueryClient.js +144 -24
- package/dist/client/core/xhr.js +2 -1
- package/dist/client/hooks/audit.js +4 -2
- package/dist/client/hooks/avro.js +6 -2
- package/dist/client/hooks/bills.d.ts +1 -1
- package/dist/client/hooks/bills.js +26 -13
- package/dist/client/hooks/catalog_items.js +4 -1
- 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 +1 -1
- package/dist/client/hooks/timecards.js +2 -1
- package/dist/client/hooks/users.js +8 -3
- package/dist/client/realtime.d.ts +6 -0
- package/dist/client/realtime.js +16 -5
- package/dist/client/requests.d.ts +470 -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 +33 -28
- 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 +9 -6
- package/dist/types/api/Chat.d.ts +3 -5
- package/dist/types/api/Company.d.ts +39 -13
- 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/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, Plan, Route, ServiceMonth, Session, Team, User, UserCompanyAssociation, UserMergeSummary, Skill, Group, Label, RouteScheduleConfig, RouteWritePayload, 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, IntuitImportResult, 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;
|
|
@@ -285,14 +289,17 @@ declare module './QueryClient.js' {
|
|
|
285
289
|
useReviewProposal(proposal_id: string): ReturnType<typeof useMutation<{
|
|
286
290
|
msg: string;
|
|
287
291
|
bill_id?: string;
|
|
292
|
+
}, StandardError, ProposalReviewPayload>>;
|
|
293
|
+
useCreateChat(): ReturnType<typeof useMutation<{
|
|
294
|
+
msg?: string;
|
|
295
|
+
id: string;
|
|
288
296
|
}, StandardError, {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
pay_in_cash?: boolean;
|
|
297
|
+
name: string;
|
|
298
|
+
users: string[];
|
|
299
|
+
message?: {
|
|
300
|
+
content: string;
|
|
301
|
+
time_sent?: number;
|
|
302
|
+
};
|
|
296
303
|
}>>;
|
|
297
304
|
useCreateMessage(chatId: string): ReturnType<typeof useMutation<{
|
|
298
305
|
msg?: string;
|
|
@@ -303,36 +310,47 @@ declare module './QueryClient.js' {
|
|
|
303
310
|
id?: string;
|
|
304
311
|
}>>;
|
|
305
312
|
useCreateProposal(): ReturnType<typeof useMutation<{
|
|
313
|
+
msg: string;
|
|
306
314
|
id: string;
|
|
307
315
|
}, StandardError, {
|
|
308
316
|
job_id: string;
|
|
309
|
-
data:
|
|
317
|
+
data: ProposalWritePayload;
|
|
310
318
|
}>>;
|
|
311
319
|
useCreateGroup(): ReturnType<typeof useMutation<{
|
|
320
|
+
msg: string;
|
|
312
321
|
id: string;
|
|
313
322
|
}, StandardError, {
|
|
314
|
-
groupData: Partial<Group
|
|
323
|
+
groupData: Partial<Group> & {
|
|
324
|
+
name: string;
|
|
325
|
+
};
|
|
315
326
|
}>>;
|
|
316
327
|
useCreateWaiver(): ReturnType<typeof useMutation<{
|
|
328
|
+
msg: string;
|
|
317
329
|
id: string;
|
|
318
330
|
}, StandardError, {
|
|
319
|
-
waiverData: Partial<Waiver
|
|
331
|
+
waiverData: Partial<Waiver> & {
|
|
332
|
+
name: string;
|
|
333
|
+
};
|
|
320
334
|
}>>;
|
|
321
335
|
useCreateLabel(): ReturnType<typeof useMutation<{
|
|
336
|
+
msg: string;
|
|
322
337
|
id: string;
|
|
323
338
|
}, StandardError, {
|
|
324
|
-
labelData: Partial<Label
|
|
339
|
+
labelData: Partial<Label> & {
|
|
340
|
+
name: string;
|
|
341
|
+
};
|
|
325
342
|
}>>;
|
|
326
343
|
useCreateSkill(): ReturnType<typeof useMutation<{
|
|
344
|
+
msg: string;
|
|
327
345
|
id: string;
|
|
328
346
|
}, StandardError, {
|
|
329
|
-
skillData:
|
|
347
|
+
skillData: SkillCreatePayload;
|
|
330
348
|
}>>;
|
|
331
349
|
useCreateEvent(): ReturnType<typeof useMutation<{
|
|
332
350
|
id: string;
|
|
333
351
|
msg: string;
|
|
334
352
|
}, StandardError, {
|
|
335
|
-
eventData:
|
|
353
|
+
eventData: EventCreatePayload;
|
|
336
354
|
}>>;
|
|
337
355
|
useCreateDelayEvent(): ReturnType<typeof useMutation<{
|
|
338
356
|
id: string;
|
|
@@ -341,9 +359,10 @@ declare module './QueryClient.js' {
|
|
|
341
359
|
delayData: DelayEventCreatePayload;
|
|
342
360
|
}>>;
|
|
343
361
|
useCreateUserSession(): ReturnType<typeof useMutation<{
|
|
344
|
-
|
|
362
|
+
msg: string;
|
|
363
|
+
id: string | null;
|
|
345
364
|
}, StandardError, {
|
|
346
|
-
sessionData:
|
|
365
|
+
sessionData: SessionCreatePayload;
|
|
347
366
|
}>>;
|
|
348
367
|
useCreateTimecard(): ReturnType<typeof useMutation<{
|
|
349
368
|
msg: string;
|
|
@@ -358,65 +377,62 @@ declare module './QueryClient.js' {
|
|
|
358
377
|
};
|
|
359
378
|
}>>;
|
|
360
379
|
useCreateBill(): ReturnType<typeof useMutation<{
|
|
380
|
+
msg: string;
|
|
361
381
|
id: string;
|
|
362
382
|
invoice_id: number;
|
|
363
383
|
}, StandardError, {
|
|
364
|
-
data:
|
|
384
|
+
data: BillWritePayload;
|
|
365
385
|
}>>;
|
|
366
386
|
useCreateCompany(): ReturnType<typeof useMutation<{
|
|
387
|
+
msg: string;
|
|
367
388
|
id: string;
|
|
368
389
|
}, StandardError, {
|
|
369
|
-
companyData:
|
|
370
|
-
logo: File | null;
|
|
371
|
-
}>;
|
|
390
|
+
companyData: CompanyCreatePayload;
|
|
372
391
|
}>>;
|
|
373
392
|
useCreateCatalogItem(): ReturnType<typeof useMutation<{
|
|
393
|
+
msg: string;
|
|
374
394
|
id: string;
|
|
375
395
|
}, StandardError, {
|
|
376
|
-
data:
|
|
396
|
+
data: CatalogItemCreatePayload;
|
|
377
397
|
}>>;
|
|
378
398
|
useCreateJob(): ReturnType<typeof useMutation<{
|
|
399
|
+
msg: string;
|
|
379
400
|
id: string;
|
|
380
401
|
}, StandardError, {
|
|
381
|
-
jobData:
|
|
402
|
+
jobData: JobUpdate;
|
|
382
403
|
}>>;
|
|
383
404
|
useCreateRoute(): ReturnType<typeof useMutation<{
|
|
405
|
+
msg: string;
|
|
384
406
|
id: string;
|
|
385
407
|
}, StandardError, {
|
|
386
408
|
routeData: RouteWritePayload;
|
|
387
409
|
}>>;
|
|
388
410
|
useCreateTeam(): ReturnType<typeof useMutation<{
|
|
411
|
+
msg: string;
|
|
389
412
|
id: string;
|
|
390
413
|
}, StandardError, {
|
|
391
|
-
teamData:
|
|
414
|
+
teamData: TeamWritePayload & {
|
|
415
|
+
name: string;
|
|
416
|
+
};
|
|
392
417
|
}>>;
|
|
393
418
|
useCreateSelf(): ReturnType<typeof useMutation<{
|
|
394
419
|
msg: string;
|
|
395
420
|
id?: string;
|
|
396
421
|
access_token?: string;
|
|
397
422
|
refresh_token?: string;
|
|
398
|
-
}, StandardError,
|
|
399
|
-
code?: string;
|
|
400
|
-
invite_token?: string;
|
|
401
|
-
password?: string;
|
|
402
|
-
company_id?: string;
|
|
403
|
-
}>>;
|
|
423
|
+
}, StandardError, UserCreatePayload>>;
|
|
404
424
|
useCreateUser(): ReturnType<typeof useMutation<{
|
|
405
425
|
msg: string;
|
|
406
426
|
id?: string;
|
|
407
427
|
access_token?: string;
|
|
408
428
|
refresh_token?: string;
|
|
409
|
-
}, StandardError,
|
|
410
|
-
code?: string;
|
|
411
|
-
invite_token?: string;
|
|
412
|
-
password?: string;
|
|
413
|
-
company_id?: string;
|
|
414
|
-
}>>;
|
|
429
|
+
}, StandardError, UserCreatePayload>>;
|
|
415
430
|
useCreateSessionBreak(): ReturnType<typeof useMutation<{
|
|
431
|
+
msg: string;
|
|
416
432
|
id: string;
|
|
417
433
|
}, StandardError, {
|
|
418
434
|
sessionId: string;
|
|
419
|
-
breakData:
|
|
435
|
+
breakData: BreakWritePayload;
|
|
420
436
|
}>>;
|
|
421
437
|
useManageJobs(): ReturnType<typeof useMutation<void, StandardError, {
|
|
422
438
|
jobs: JobUpdate[];
|
|
@@ -446,7 +462,7 @@ declare module './QueryClient.js' {
|
|
|
446
462
|
}>>;
|
|
447
463
|
useCheckOut(): ReturnType<typeof useMutation<{
|
|
448
464
|
msg: string;
|
|
449
|
-
id: string;
|
|
465
|
+
id: string | null;
|
|
450
466
|
job_id: string | null;
|
|
451
467
|
}, StandardError, {
|
|
452
468
|
checkinId: string;
|
|
@@ -458,14 +474,10 @@ declare module './QueryClient.js' {
|
|
|
458
474
|
}>;
|
|
459
475
|
checkOut(checkinId: string): Promise<{
|
|
460
476
|
msg: string;
|
|
461
|
-
id: string;
|
|
477
|
+
id: string | null;
|
|
462
478
|
job_id: string | null;
|
|
463
479
|
}>;
|
|
464
|
-
useImportBillsFromIntuit(): ReturnType<typeof useMutation<
|
|
465
|
-
msg: string;
|
|
466
|
-
imported: number;
|
|
467
|
-
skipped: number;
|
|
468
|
-
}, StandardError, void>>;
|
|
480
|
+
useImportBillsFromIntuit(): ReturnType<typeof useMutation<IntuitImportResult, StandardError, void>>;
|
|
469
481
|
useSyncBillToIntuit(): ReturnType<typeof useMutation<{
|
|
470
482
|
msg: string;
|
|
471
483
|
}, StandardError, {
|
|
@@ -481,7 +493,7 @@ declare module './QueryClient.js' {
|
|
|
481
493
|
msg: string;
|
|
482
494
|
}, StandardError, {
|
|
483
495
|
sessionId: string;
|
|
484
|
-
updates:
|
|
496
|
+
updates: SessionUpdatePayload;
|
|
485
497
|
}>>;
|
|
486
498
|
useUpdateTimecard(): ReturnType<typeof useMutation<{
|
|
487
499
|
msg: string;
|
|
@@ -518,7 +530,7 @@ declare module './QueryClient.js' {
|
|
|
518
530
|
msg: string;
|
|
519
531
|
}, StandardError, {
|
|
520
532
|
catalogItemId: string;
|
|
521
|
-
data:
|
|
533
|
+
data: CatalogItemUpdatePayload;
|
|
522
534
|
}>>;
|
|
523
535
|
useUpdateJob(): ReturnType<typeof useMutation<{
|
|
524
536
|
msg: string;
|
|
@@ -530,13 +542,13 @@ declare module './QueryClient.js' {
|
|
|
530
542
|
msg: string;
|
|
531
543
|
}, StandardError, {
|
|
532
544
|
skillId: string;
|
|
533
|
-
updates:
|
|
545
|
+
updates: SkillUpdatePayload;
|
|
534
546
|
}>>;
|
|
535
547
|
useUpdateBill(): ReturnType<typeof useMutation<{
|
|
536
548
|
msg: string;
|
|
537
549
|
}, StandardError, {
|
|
538
550
|
billId: string;
|
|
539
|
-
updates:
|
|
551
|
+
updates: BillWritePayload;
|
|
540
552
|
}>>;
|
|
541
553
|
useUpdateBillLineItemStatus(): ReturnType<typeof useMutation<{
|
|
542
554
|
msg: string;
|
|
@@ -561,7 +573,7 @@ declare module './QueryClient.js' {
|
|
|
561
573
|
msg: string;
|
|
562
574
|
}, StandardError, {
|
|
563
575
|
teamId: string;
|
|
564
|
-
teamData:
|
|
576
|
+
teamData: TeamWritePayload;
|
|
565
577
|
}>>;
|
|
566
578
|
useUpdateMonth(): ReturnType<typeof useMutation<{
|
|
567
579
|
msg: string;
|
|
@@ -585,7 +597,7 @@ declare module './QueryClient.js' {
|
|
|
585
597
|
msg: string;
|
|
586
598
|
}, StandardError, {
|
|
587
599
|
user_id: string;
|
|
588
|
-
data:
|
|
600
|
+
data: MemberUpdatePayload;
|
|
589
601
|
}>>;
|
|
590
602
|
useDevices(): UseQueryResult<Device[], StandardError>;
|
|
591
603
|
useGetCompanyUsers(body?: {
|
|
@@ -610,13 +622,13 @@ declare module './QueryClient.js' {
|
|
|
610
622
|
msg: string;
|
|
611
623
|
}, StandardError, {
|
|
612
624
|
breakId: string;
|
|
613
|
-
updates:
|
|
625
|
+
updates: BreakWritePayload;
|
|
614
626
|
}>>;
|
|
615
627
|
useUpdateCompanySession(): ReturnType<typeof useMutation<{
|
|
616
628
|
msg: string;
|
|
617
629
|
}, StandardError, {
|
|
618
630
|
sessionId: string;
|
|
619
|
-
updates:
|
|
631
|
+
updates: SessionUpdatePayload;
|
|
620
632
|
companyId?: string;
|
|
621
633
|
}>>;
|
|
622
634
|
useDeleteCompanySession(): ReturnType<typeof useMutation<{
|
|
@@ -627,7 +639,7 @@ declare module './QueryClient.js' {
|
|
|
627
639
|
}>>;
|
|
628
640
|
useUpdateUser(userId: string): ReturnType<typeof useMutation<{
|
|
629
641
|
msg: string;
|
|
630
|
-
}, StandardError,
|
|
642
|
+
}, StandardError, UserUpdatePayload>>;
|
|
631
643
|
useDeleteJobs(): ReturnType<typeof useMutation<{
|
|
632
644
|
msg: string;
|
|
633
645
|
}, StandardError, {
|
|
@@ -642,15 +654,21 @@ declare module './QueryClient.js' {
|
|
|
642
654
|
msg: string;
|
|
643
655
|
}, StandardError, {
|
|
644
656
|
companyId: string;
|
|
645
|
-
companyData:
|
|
646
|
-
logo: File | null;
|
|
647
|
-
}>;
|
|
657
|
+
companyData: CompanyUpdatePayload;
|
|
648
658
|
}>>;
|
|
649
659
|
useCreateUserCompany(): ReturnType<typeof useMutation<{
|
|
650
660
|
id: string;
|
|
651
661
|
}, StandardError, {
|
|
652
662
|
user_id: string;
|
|
653
|
-
data:
|
|
663
|
+
data: MemberAddPayload;
|
|
664
|
+
}>>;
|
|
665
|
+
useAddUserCompany(): ReturnType<typeof useMutation<{
|
|
666
|
+
msg: string;
|
|
667
|
+
id: string;
|
|
668
|
+
}, StandardError, {
|
|
669
|
+
userId: string;
|
|
670
|
+
groupId?: string;
|
|
671
|
+
companyId?: string;
|
|
654
672
|
}>>;
|
|
655
673
|
useRemoveUserCompany(): ReturnType<typeof useMutation<{
|
|
656
674
|
msg: string;
|
|
@@ -798,7 +816,7 @@ export declare class AvroQueryClient {
|
|
|
798
816
|
* Fire-and-forget: never throws, so it is safe inside error handlers.
|
|
799
817
|
*/
|
|
800
818
|
reportClientError(report: ClientErrorReport): Promise<void>;
|
|
801
|
-
post<T>({ path, data, cancelToken, headers, progressUpdateCallback, maxRetries, idempotent, }: {
|
|
819
|
+
post<T>({ path, data, cancelToken, headers, progressUpdateCallback, maxRetries, idempotent, refreshOnUnauthorized, }: {
|
|
802
820
|
path: string;
|
|
803
821
|
data?: any;
|
|
804
822
|
cancelToken?: CancelToken;
|
|
@@ -811,6 +829,12 @@ export declare class AvroQueryClient {
|
|
|
811
829
|
* reached the server is never replayed.
|
|
812
830
|
*/
|
|
813
831
|
idempotent?: boolean;
|
|
832
|
+
/**
|
|
833
|
+
* Refresh the session and replay once on a 401 (default true).
|
|
834
|
+
* Turn off for requests whose 401 is an answer, not an expired
|
|
835
|
+
* token, and that can't be replayed (one-time handles).
|
|
836
|
+
*/
|
|
837
|
+
refreshOnUnauthorized?: boolean;
|
|
814
838
|
}): Promise<T>;
|
|
815
839
|
put<T>({ path, data, cancelToken, headers, progressUpdateCallback, }: {
|
|
816
840
|
path: string;
|
|
@@ -891,6 +915,37 @@ export declare class AvroQueryClient {
|
|
|
891
915
|
useAppleUnlink(): ReturnType<typeof useMutation<{
|
|
892
916
|
msg: string;
|
|
893
917
|
}, StandardError, void>>;
|
|
918
|
+
/**
|
|
919
|
+
* Sign in with a Microsoft authorization code (`code` + the `uri` it was
|
|
920
|
+
* issued for). With no account for the identity yet this resolves
|
|
921
|
+
* `NEEDS_ACCOUNT` (rather than failing) carrying the handle for
|
|
922
|
+
* `useMicrosoftLink`. A 401 means the matching account is linked to
|
|
923
|
+
* another Microsoft identity.
|
|
924
|
+
*/
|
|
925
|
+
useMicrosoftLogin(): ReturnType<typeof useMutation<MicrosoftLoginResult, StandardError, {
|
|
926
|
+
code: string;
|
|
927
|
+
uri: string;
|
|
928
|
+
cancelToken?: CancelToken;
|
|
929
|
+
}>>;
|
|
930
|
+
/**
|
|
931
|
+
* Finish a `NEEDS_ACCOUNT` Microsoft sign-in with its `microsoft_token`
|
|
932
|
+
* once the account exists, then sign in with the returned tokens.
|
|
933
|
+
*
|
|
934
|
+
* When the 404 carried an `email`, the handle signs in to the account
|
|
935
|
+
* with that address and no session is needed. When `email` was null,
|
|
936
|
+
* the identity is linked to the account this client is signed in to:
|
|
937
|
+
* sign in to the new account first (e.g. `loginSuccess` with the tokens
|
|
938
|
+
* `POST /user` returned, or a code login when it answered
|
|
939
|
+
* `TOTP required`); the request carries the current session's token.
|
|
940
|
+
* 401s: `Sign in to link this Microsoft account` (no session; the
|
|
941
|
+
* handle stays valid for a retry within 10 min), `This Microsoft
|
|
942
|
+
* account is linked to another account`, `This account is linked to
|
|
943
|
+
* another Microsoft account`. 400: the handle is invalid or expired.
|
|
944
|
+
*/
|
|
945
|
+
useMicrosoftLink(): ReturnType<typeof useMutation<LoginResponse, StandardError, {
|
|
946
|
+
microsoftToken: string;
|
|
947
|
+
cancelToken?: CancelToken;
|
|
948
|
+
}>>;
|
|
894
949
|
setTokens(tokens: Tokens): Promise<void>;
|
|
895
950
|
setCache(data: Partial<CacheData> | Object): Promise<void>;
|
|
896
951
|
getCache(key?: keyof CacheData | string): Promise<CacheData[keyof CacheData] | Object | string | null>;
|
|
@@ -995,9 +1050,12 @@ export declare class AvroQueryClient {
|
|
|
995
1050
|
billed?: boolean;
|
|
996
1051
|
paid?: boolean;
|
|
997
1052
|
job_id?: string | null;
|
|
1053
|
+
task_id?: string | null;
|
|
998
1054
|
sort_by?: 'date' | 'amount' | 'name';
|
|
999
1055
|
direction?: 'asc' | 'desc';
|
|
1000
1056
|
line_item_types?: LineItemType[];
|
|
1057
|
+
created_from?: number;
|
|
1058
|
+
created_to?: number;
|
|
1001
1059
|
}, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
1002
1060
|
fetchMonths(body?: {
|
|
1003
1061
|
amt?: number;
|
|
@@ -1034,7 +1092,7 @@ export declare class AvroQueryClient {
|
|
|
1034
1092
|
fetchPayouts(body?: {
|
|
1035
1093
|
amt?: number;
|
|
1036
1094
|
query?: string;
|
|
1037
|
-
status?:
|
|
1095
|
+
status?: PayoutStatusFilter | '';
|
|
1038
1096
|
known_ids?: string[];
|
|
1039
1097
|
unknown_ids?: string[];
|
|
1040
1098
|
offset?: number;
|
|
@@ -1104,7 +1162,8 @@ export declare class AvroQueryClient {
|
|
|
1104
1162
|
sendEmail(emailId: string, formData: FormData, progressUpdateCallback?: (loaded: number, total: number) => void): Promise<void>;
|
|
1105
1163
|
sendBillEmail(billId: string, body?: {
|
|
1106
1164
|
subject?: string;
|
|
1107
|
-
|
|
1165
|
+
/** `[name, email]` pairs; omitted: the bill's own recipients. */
|
|
1166
|
+
recipients?: [string, string][];
|
|
1108
1167
|
base_url?: string;
|
|
1109
1168
|
request_id?: string;
|
|
1110
1169
|
}): Promise<void>;
|