@go-avro/avro-js 0.0.2-beta.6 → 0.0.2-beta.61
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 +2 -0
- package/dist/auth/AuthManager.js +8 -0
- package/dist/client/QueryClient.d.ts +256 -10
- package/dist/client/QueryClient.js +167 -174
- package/dist/client/core/fetch.d.ts +1 -0
- package/dist/client/core/fetch.js +67 -0
- package/dist/client/core/utils.d.ts +1 -0
- package/dist/client/core/utils.js +13 -0
- package/dist/client/core/xhr.d.ts +1 -0
- package/dist/client/core/xhr.js +87 -0
- package/dist/client/hooks/bills.d.ts +1 -0
- package/dist/client/hooks/bills.js +141 -0
- package/dist/client/hooks/companies.d.ts +1 -0
- package/dist/client/hooks/companies.js +51 -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 +184 -0
- package/dist/client/hooks/months.d.ts +1 -0
- package/dist/client/hooks/months.js +92 -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 +127 -0
- package/dist/client/hooks/sessions.d.ts +1 -0
- package/dist/client/hooks/sessions.js +154 -0
- package/dist/client/hooks/users.d.ts +1 -0
- package/dist/client/hooks/users.js +93 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/dist/types/api.d.ts +106 -23
- package/dist/types/api.js +6 -1
- package/package.json +6 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
export { AvroQueryClientConfig, AvroQueryClient } from './client/QueryClient';
|
|
2
2
|
export { AuthManager } from './auth/AuthManager';
|
|
3
3
|
export { MemoryStorage, LocalStorage } from './auth/storage';
|
|
4
|
+
import './client/core/xhr';
|
|
5
|
+
import './client/core/fetch';
|
|
6
|
+
import './client/core/utils';
|
|
7
|
+
import './client/hooks/root';
|
|
8
|
+
import './client/hooks/jobs';
|
|
9
|
+
import './client/hooks/routes';
|
|
10
|
+
import './client/hooks/events';
|
|
11
|
+
import './client/hooks/months';
|
|
12
|
+
import './client/hooks/bills';
|
|
13
|
+
import './client/hooks/companies';
|
|
14
|
+
import './client/hooks/users';
|
|
15
|
+
import './client/hooks/sessions';
|
|
4
16
|
export * from './types/api';
|
|
17
|
+
export * from './types/auth';
|
|
5
18
|
export * from './types/error';
|
|
6
19
|
export * from './types/client';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
export { AvroQueryClient } from './client/QueryClient';
|
|
2
2
|
export { AuthManager } from './auth/AuthManager';
|
|
3
3
|
export { MemoryStorage, LocalStorage } from './auth/storage';
|
|
4
|
+
import './client/core/xhr';
|
|
5
|
+
import './client/core/fetch';
|
|
6
|
+
import './client/core/utils';
|
|
7
|
+
import './client/hooks/root';
|
|
8
|
+
import './client/hooks/jobs';
|
|
9
|
+
import './client/hooks/routes';
|
|
10
|
+
import './client/hooks/events';
|
|
11
|
+
import './client/hooks/months';
|
|
12
|
+
import './client/hooks/bills';
|
|
13
|
+
import './client/hooks/companies';
|
|
14
|
+
import './client/hooks/users';
|
|
15
|
+
import './client/hooks/sessions';
|
|
4
16
|
export * from './types/api';
|
|
17
|
+
export * from './types/auth';
|
|
5
18
|
export * from './types/error';
|
|
6
19
|
export * from './types/client';
|
package/dist/types/api.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export interface ApiInfo {
|
|
2
|
+
app_semver: string;
|
|
3
|
+
db_healthy: boolean;
|
|
4
|
+
logged_in_as: string;
|
|
5
|
+
ors_healthy: string;
|
|
6
|
+
pelias_healthy: boolean;
|
|
7
|
+
version: string;
|
|
8
|
+
vroom_healthy: boolean;
|
|
9
|
+
}
|
|
1
10
|
export interface PaymentMethod {
|
|
2
11
|
allow_redisplay: string;
|
|
3
12
|
autopay: boolean;
|
|
@@ -68,12 +77,16 @@ export interface MemberState {
|
|
|
68
77
|
}
|
|
69
78
|
export interface LineItem {
|
|
70
79
|
id: string;
|
|
80
|
+
line_item_type: "CUSTOM" | "ADDITIONAL_CHARGE" | "EVENT" | "SERVICE_MONTH";
|
|
71
81
|
name: string;
|
|
72
82
|
description: string;
|
|
73
83
|
cost: number | null;
|
|
74
84
|
amount: number | null;
|
|
75
85
|
time_created: number;
|
|
76
86
|
}
|
|
87
|
+
export interface CustomLineItem extends LineItem {
|
|
88
|
+
line_item_type: "CUSTOM";
|
|
89
|
+
}
|
|
77
90
|
export interface Reaction {
|
|
78
91
|
id: string;
|
|
79
92
|
message_id: string;
|
|
@@ -193,8 +206,8 @@ export interface User {
|
|
|
193
206
|
companies: UserCompanyAssociation[] | null;
|
|
194
207
|
email: string | null;
|
|
195
208
|
phone_number: string | null;
|
|
196
|
-
time_created:
|
|
197
|
-
time_updated:
|
|
209
|
+
time_created: number;
|
|
210
|
+
time_updated: number | null;
|
|
198
211
|
can_send_emails: boolean | null;
|
|
199
212
|
payment_methods: PaymentMethod[];
|
|
200
213
|
autopay_payment_types: string[];
|
|
@@ -209,20 +222,20 @@ export interface Break {
|
|
|
209
222
|
company_billable: boolean;
|
|
210
223
|
client_billable: boolean;
|
|
211
224
|
}
|
|
212
|
-
export interface ServiceMonth {
|
|
213
|
-
|
|
225
|
+
export interface ServiceMonth extends LineItem {
|
|
226
|
+
line_item_type: "SERVICE_MONTH";
|
|
214
227
|
job_name: string;
|
|
215
228
|
job_id: string | null;
|
|
229
|
+
job_address: string;
|
|
230
|
+
job_labels: string[];
|
|
216
231
|
bill_id: string | null;
|
|
217
|
-
cost: number;
|
|
218
232
|
billed: boolean;
|
|
219
233
|
paid: boolean;
|
|
220
|
-
|
|
221
|
-
time_created: number;
|
|
234
|
+
tasks: string[];
|
|
222
235
|
time_updated: number | null;
|
|
223
236
|
}
|
|
224
237
|
export interface Session {
|
|
225
|
-
|
|
238
|
+
id: string;
|
|
226
239
|
user_id: string;
|
|
227
240
|
company_id: string;
|
|
228
241
|
time_started: number;
|
|
@@ -230,7 +243,7 @@ export interface Session {
|
|
|
230
243
|
break_id: string;
|
|
231
244
|
is_paused: boolean;
|
|
232
245
|
team_id: string;
|
|
233
|
-
|
|
246
|
+
route_id: string;
|
|
234
247
|
breaks: Break[];
|
|
235
248
|
}
|
|
236
249
|
export interface Group {
|
|
@@ -244,6 +257,12 @@ export interface Group {
|
|
|
244
257
|
time_created: number;
|
|
245
258
|
time_updated: number;
|
|
246
259
|
}
|
|
260
|
+
export declare const NotificationLevel: Readonly<{
|
|
261
|
+
IN_APP: 0;
|
|
262
|
+
EMAIL: 1;
|
|
263
|
+
SMS: 2;
|
|
264
|
+
PUSH: 3;
|
|
265
|
+
}>;
|
|
247
266
|
export interface UserCompanyAssociation {
|
|
248
267
|
id: string;
|
|
249
268
|
user: User;
|
|
@@ -254,7 +273,7 @@ export interface UserCompanyAssociation {
|
|
|
254
273
|
time_updated: number | null;
|
|
255
274
|
notification_setting: number[];
|
|
256
275
|
share_email_company_wide: boolean;
|
|
257
|
-
notifications:
|
|
276
|
+
notifications: Notification[];
|
|
258
277
|
groups: string[];
|
|
259
278
|
}
|
|
260
279
|
export interface Email {
|
|
@@ -294,6 +313,7 @@ export interface Bill {
|
|
|
294
313
|
customer_email: string | null;
|
|
295
314
|
manual_emails: string[][];
|
|
296
315
|
users: BillUser[];
|
|
316
|
+
paid: boolean;
|
|
297
317
|
paid_at: number;
|
|
298
318
|
time_created: number;
|
|
299
319
|
time_updated: number;
|
|
@@ -301,7 +321,7 @@ export interface Bill {
|
|
|
301
321
|
intent_created_at: number;
|
|
302
322
|
intent_last_created_at: number;
|
|
303
323
|
payment: BillPayment | null;
|
|
304
|
-
line_items:
|
|
324
|
+
line_items: CustomLineItem[];
|
|
305
325
|
months: string[];
|
|
306
326
|
due_date: number;
|
|
307
327
|
}
|
|
@@ -333,8 +353,8 @@ export interface Company {
|
|
|
333
353
|
teams: Team[];
|
|
334
354
|
emails: Email[];
|
|
335
355
|
skills: Skill[];
|
|
336
|
-
time_created:
|
|
337
|
-
time_updated:
|
|
356
|
+
time_created: number;
|
|
357
|
+
time_updated: number | null;
|
|
338
358
|
users: UserCompanyAssociation[];
|
|
339
359
|
use_client_side_customer_start_billing: boolean;
|
|
340
360
|
use_client_side_customer_stop_billing: boolean;
|
|
@@ -416,6 +436,7 @@ export interface Job {
|
|
|
416
436
|
routes: RouteJob[];
|
|
417
437
|
subscribers: Subscription[];
|
|
418
438
|
manual_emails: string[][];
|
|
439
|
+
overdue_time: number;
|
|
419
440
|
last_completed_event: _Event | null;
|
|
420
441
|
last_event: _Event | null;
|
|
421
442
|
labels: string[];
|
|
@@ -438,6 +459,7 @@ export interface Task {
|
|
|
438
459
|
created_by: UserCompanyAssociation | null;
|
|
439
460
|
overdueness: number | null;
|
|
440
461
|
overdue_time: number;
|
|
462
|
+
last_completed_event: _Event | null;
|
|
441
463
|
last_event: _Event | null;
|
|
442
464
|
delay: number;
|
|
443
465
|
skills: string[];
|
|
@@ -471,22 +493,17 @@ export interface taskEndInfo {
|
|
|
471
493
|
internal_notes: string;
|
|
472
494
|
external_notes: string;
|
|
473
495
|
}
|
|
474
|
-
export interface AdditionalCharge {
|
|
475
|
-
|
|
476
|
-
time_created: number;
|
|
496
|
+
export interface AdditionalCharge extends LineItem {
|
|
497
|
+
line_item_type: "ADDITIONAL_CHARGE";
|
|
477
498
|
time_updated: number | null;
|
|
478
|
-
name: string;
|
|
479
|
-
amount: number;
|
|
480
499
|
}
|
|
481
|
-
export interface _Event {
|
|
500
|
+
export interface _Event extends LineItem {
|
|
482
501
|
breaks: string[];
|
|
483
|
-
|
|
484
|
-
name: string;
|
|
502
|
+
line_item_type: "EVENT";
|
|
485
503
|
internal_notes: string;
|
|
486
504
|
external_notes: string;
|
|
487
505
|
proofs: string[];
|
|
488
506
|
tasks: string[];
|
|
489
|
-
time_created: number;
|
|
490
507
|
time_ended: number;
|
|
491
508
|
time_started: number;
|
|
492
509
|
time_updated: number | null;
|
|
@@ -498,9 +515,75 @@ export interface _Event {
|
|
|
498
515
|
additional_charges: AdditionalCharge[];
|
|
499
516
|
user_id: string;
|
|
500
517
|
team_id: string;
|
|
501
|
-
cost: number;
|
|
502
518
|
billed: boolean;
|
|
503
519
|
paid: boolean;
|
|
504
520
|
autostart: boolean;
|
|
505
521
|
job_labels: string[];
|
|
506
522
|
}
|
|
523
|
+
export interface FinancialInsightData {
|
|
524
|
+
start: number;
|
|
525
|
+
end: number;
|
|
526
|
+
unbilled: {
|
|
527
|
+
events: {
|
|
528
|
+
count: number;
|
|
529
|
+
amount: number;
|
|
530
|
+
};
|
|
531
|
+
service_months: {
|
|
532
|
+
count: number;
|
|
533
|
+
amount: number;
|
|
534
|
+
};
|
|
535
|
+
total: number;
|
|
536
|
+
};
|
|
537
|
+
billed_unbilled: {
|
|
538
|
+
events: {
|
|
539
|
+
count: number;
|
|
540
|
+
amount: number;
|
|
541
|
+
};
|
|
542
|
+
service_months: {
|
|
543
|
+
count: number;
|
|
544
|
+
amount: number;
|
|
545
|
+
};
|
|
546
|
+
total: number;
|
|
547
|
+
};
|
|
548
|
+
paid_unbilled: {
|
|
549
|
+
events: {
|
|
550
|
+
count: number;
|
|
551
|
+
amount: number;
|
|
552
|
+
};
|
|
553
|
+
service_months: {
|
|
554
|
+
count: number;
|
|
555
|
+
amount: number;
|
|
556
|
+
};
|
|
557
|
+
total: number;
|
|
558
|
+
};
|
|
559
|
+
prepaid: {
|
|
560
|
+
events: {
|
|
561
|
+
count: number;
|
|
562
|
+
amount: number;
|
|
563
|
+
};
|
|
564
|
+
service_months: {
|
|
565
|
+
count: number;
|
|
566
|
+
amount: number;
|
|
567
|
+
};
|
|
568
|
+
total: number;
|
|
569
|
+
};
|
|
570
|
+
accounts_receivable: {
|
|
571
|
+
overdue: number;
|
|
572
|
+
not_overdue: number;
|
|
573
|
+
};
|
|
574
|
+
cash: number;
|
|
575
|
+
}
|
|
576
|
+
export interface EventInsightData {
|
|
577
|
+
start: number;
|
|
578
|
+
end: number;
|
|
579
|
+
events_per_job: {
|
|
580
|
+
id: string;
|
|
581
|
+
name: string;
|
|
582
|
+
event_count: number;
|
|
583
|
+
}[];
|
|
584
|
+
events_per_team: {
|
|
585
|
+
team_id: string;
|
|
586
|
+
event_count: number;
|
|
587
|
+
}[];
|
|
588
|
+
total_events: number;
|
|
589
|
+
}
|
package/dist/types/api.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@go-avro/avro-js",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.61",
|
|
4
4
|
"description": "JS client for Avro backend integration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"license": "CC-BY-SA-4.0",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jest": "^29.0.0",
|
|
36
|
+
"@types/react": "^19.2.2",
|
|
36
37
|
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
37
38
|
"@typescript-eslint/parser": "^8.38.0",
|
|
38
39
|
"eslint": "^8.57.1",
|
|
@@ -50,5 +51,9 @@
|
|
|
50
51
|
],
|
|
51
52
|
"publishConfig": {
|
|
52
53
|
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@tanstack/react-query": "^5.90.2",
|
|
57
|
+
"socket.io-client": "^4.8.1"
|
|
53
58
|
}
|
|
54
59
|
}
|