@go-avro/avro-js 0.0.2-beta.12 → 0.0.2-beta.120
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 +12 -3
- package/dist/auth/AuthManager.js +56 -12
- package/dist/auth/storage.d.ts +8 -8
- package/dist/auth/storage.js +12 -10
- package/dist/client/QueryClient.d.ts +385 -15
- package/dist/client/QueryClient.js +323 -203
- 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 +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 +164 -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 +138 -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 +219 -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 +8 -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/teams.d.ts +1 -0
- package/dist/client/hooks/teams.js +127 -0
- package/dist/client/hooks/users.d.ts +1 -0
- package/dist/client/hooks/users.js +104 -0
- package/dist/index.d.ts +21 -1
- package/dist/index.js +21 -1
- package/dist/types/api.d.ts +123 -32
- package/dist/types/api.js +10 -1
- package/dist/types/auth.d.ts +0 -5
- package/dist/types/cache.d.ts +9 -0
- package/dist/types/cache.js +1 -0
- package/package.json +6 -4
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;
|
|
@@ -147,7 +160,6 @@ export interface Team {
|
|
|
147
160
|
export interface Subscription {
|
|
148
161
|
time_created: number;
|
|
149
162
|
time_updated: string;
|
|
150
|
-
user: User;
|
|
151
163
|
user_company_id: string;
|
|
152
164
|
job_id: string;
|
|
153
165
|
id: string;
|
|
@@ -163,10 +175,14 @@ export interface Plan {
|
|
|
163
175
|
trial_period_days: number;
|
|
164
176
|
time_created: number;
|
|
165
177
|
time_updated: number;
|
|
178
|
+
available_to_new_companies?: boolean;
|
|
179
|
+
available_to?: string[];
|
|
166
180
|
}
|
|
167
181
|
export interface BillPayment {
|
|
168
182
|
id: string;
|
|
169
183
|
amount: number;
|
|
184
|
+
avro_fees: number;
|
|
185
|
+
stripe_fees: number;
|
|
170
186
|
stripe_pi_id: string;
|
|
171
187
|
bill_user_id: string;
|
|
172
188
|
status: "created" | "processing" | "succeeded" | "failed" | "canceled" | "requires_action";
|
|
@@ -193,14 +209,15 @@ export interface User {
|
|
|
193
209
|
companies: UserCompanyAssociation[] | null;
|
|
194
210
|
email: string | null;
|
|
195
211
|
phone_number: string | null;
|
|
196
|
-
time_created:
|
|
197
|
-
time_updated:
|
|
212
|
+
time_created: number;
|
|
213
|
+
time_updated: number | null;
|
|
198
214
|
can_send_emails: boolean | null;
|
|
199
215
|
payment_methods: PaymentMethod[];
|
|
200
216
|
autopay_payment_types: string[];
|
|
201
217
|
autopay: boolean | null;
|
|
202
218
|
chats: Chat[];
|
|
203
219
|
bills: BillUser[];
|
|
220
|
+
is_root: boolean;
|
|
204
221
|
}
|
|
205
222
|
export interface Break {
|
|
206
223
|
id: string;
|
|
@@ -209,20 +226,20 @@ export interface Break {
|
|
|
209
226
|
company_billable: boolean;
|
|
210
227
|
client_billable: boolean;
|
|
211
228
|
}
|
|
212
|
-
export interface ServiceMonth {
|
|
213
|
-
|
|
229
|
+
export interface ServiceMonth extends LineItem {
|
|
230
|
+
line_item_type: "SERVICE_MONTH";
|
|
214
231
|
job_name: string;
|
|
215
232
|
job_id: string | null;
|
|
233
|
+
job_address: string;
|
|
234
|
+
job_labels: string[];
|
|
216
235
|
bill_id: string | null;
|
|
217
|
-
cost: number;
|
|
218
236
|
billed: boolean;
|
|
219
237
|
paid: boolean;
|
|
220
|
-
|
|
221
|
-
time_created: number;
|
|
238
|
+
tasks: string[];
|
|
222
239
|
time_updated: number | null;
|
|
223
240
|
}
|
|
224
241
|
export interface Session {
|
|
225
|
-
|
|
242
|
+
id: string;
|
|
226
243
|
user_id: string;
|
|
227
244
|
company_id: string;
|
|
228
245
|
time_started: number;
|
|
@@ -230,7 +247,7 @@ export interface Session {
|
|
|
230
247
|
break_id: string;
|
|
231
248
|
is_paused: boolean;
|
|
232
249
|
team_id: string;
|
|
233
|
-
|
|
250
|
+
route_id: string;
|
|
234
251
|
breaks: Break[];
|
|
235
252
|
}
|
|
236
253
|
export interface Group {
|
|
@@ -244,6 +261,18 @@ export interface Group {
|
|
|
244
261
|
time_created: number;
|
|
245
262
|
time_updated: number;
|
|
246
263
|
}
|
|
264
|
+
export declare const NotificationLevel: {
|
|
265
|
+
readonly IN_APP: 0;
|
|
266
|
+
readonly EMAIL: 1;
|
|
267
|
+
readonly SMS: 2;
|
|
268
|
+
readonly PUSH: 3;
|
|
269
|
+
};
|
|
270
|
+
export type NotificationLevel = typeof NotificationLevel[keyof typeof NotificationLevel];
|
|
271
|
+
export declare const LoginResponse: {
|
|
272
|
+
readonly SUCCESS: "SUCCESS";
|
|
273
|
+
readonly NEEDS_TOTP: "NEEDS_TOTP";
|
|
274
|
+
};
|
|
275
|
+
export type LoginResponse = typeof LoginResponse[keyof typeof LoginResponse];
|
|
247
276
|
export interface UserCompanyAssociation {
|
|
248
277
|
id: string;
|
|
249
278
|
user: User;
|
|
@@ -252,9 +281,9 @@ export interface UserCompanyAssociation {
|
|
|
252
281
|
effective_permissions: string[];
|
|
253
282
|
time_created: number | null;
|
|
254
283
|
time_updated: number | null;
|
|
255
|
-
notification_setting:
|
|
284
|
+
notification_setting: NotificationLevel[];
|
|
256
285
|
share_email_company_wide: boolean;
|
|
257
|
-
notifications:
|
|
286
|
+
notifications: Notification[];
|
|
258
287
|
groups: string[];
|
|
259
288
|
}
|
|
260
289
|
export interface Email {
|
|
@@ -294,6 +323,7 @@ export interface Bill {
|
|
|
294
323
|
customer_email: string | null;
|
|
295
324
|
manual_emails: string[][];
|
|
296
325
|
users: BillUser[];
|
|
326
|
+
paid: boolean;
|
|
297
327
|
paid_at: number;
|
|
298
328
|
time_created: number;
|
|
299
329
|
time_updated: number;
|
|
@@ -301,7 +331,7 @@ export interface Bill {
|
|
|
301
331
|
intent_created_at: number;
|
|
302
332
|
intent_last_created_at: number;
|
|
303
333
|
payment: BillPayment | null;
|
|
304
|
-
line_items:
|
|
334
|
+
line_items: CustomLineItem[];
|
|
305
335
|
months: string[];
|
|
306
336
|
due_date: number;
|
|
307
337
|
}
|
|
@@ -323,18 +353,13 @@ export interface PlanPayment {
|
|
|
323
353
|
time_updated: number;
|
|
324
354
|
}
|
|
325
355
|
export interface Company {
|
|
326
|
-
events: _Event[];
|
|
327
|
-
months: ServiceMonth[];
|
|
328
356
|
id: string;
|
|
329
|
-
jobs: Job[];
|
|
330
357
|
name: string;
|
|
331
358
|
email: string;
|
|
332
|
-
routes: Route[];
|
|
333
|
-
teams: Team[];
|
|
334
359
|
emails: Email[];
|
|
335
360
|
skills: Skill[];
|
|
336
|
-
time_created:
|
|
337
|
-
time_updated:
|
|
361
|
+
time_created: number;
|
|
362
|
+
time_updated: number | null;
|
|
338
363
|
users: UserCompanyAssociation[];
|
|
339
364
|
use_client_side_customer_start_billing: boolean;
|
|
340
365
|
use_client_side_customer_stop_billing: boolean;
|
|
@@ -353,6 +378,8 @@ export interface Company {
|
|
|
353
378
|
billing_email_id: string;
|
|
354
379
|
num_events: number;
|
|
355
380
|
num_jobs: number;
|
|
381
|
+
num_routes: number;
|
|
382
|
+
num_teams: number;
|
|
356
383
|
bills: Bill[];
|
|
357
384
|
enabled_payment_methods: string[];
|
|
358
385
|
sessions: Session[];
|
|
@@ -416,8 +443,9 @@ export interface Job {
|
|
|
416
443
|
routes: RouteJob[];
|
|
417
444
|
subscribers: Subscription[];
|
|
418
445
|
manual_emails: string[][];
|
|
446
|
+
overdue_time: number;
|
|
419
447
|
last_completed_event: _Event | null;
|
|
420
|
-
|
|
448
|
+
current_event: _Event | null;
|
|
421
449
|
labels: string[];
|
|
422
450
|
owner: string;
|
|
423
451
|
}
|
|
@@ -438,7 +466,8 @@ export interface Task {
|
|
|
438
466
|
created_by: UserCompanyAssociation | null;
|
|
439
467
|
overdueness: number | null;
|
|
440
468
|
overdue_time: number;
|
|
441
|
-
|
|
469
|
+
last_completed_event: _Event | null;
|
|
470
|
+
current_event: _Event | null;
|
|
442
471
|
delay: number;
|
|
443
472
|
skills: string[];
|
|
444
473
|
service: number;
|
|
@@ -450,6 +479,7 @@ export interface Task {
|
|
|
450
479
|
services_prepaid: number;
|
|
451
480
|
months_prepaid: number;
|
|
452
481
|
priority: boolean;
|
|
482
|
+
route_ids: string[];
|
|
453
483
|
}
|
|
454
484
|
export interface TaskWrapper {
|
|
455
485
|
latestEvent: number;
|
|
@@ -471,22 +501,17 @@ export interface taskEndInfo {
|
|
|
471
501
|
internal_notes: string;
|
|
472
502
|
external_notes: string;
|
|
473
503
|
}
|
|
474
|
-
export interface AdditionalCharge {
|
|
475
|
-
|
|
476
|
-
time_created: number;
|
|
504
|
+
export interface AdditionalCharge extends LineItem {
|
|
505
|
+
line_item_type: "ADDITIONAL_CHARGE";
|
|
477
506
|
time_updated: number | null;
|
|
478
|
-
name: string;
|
|
479
|
-
amount: number;
|
|
480
507
|
}
|
|
481
|
-
export interface _Event {
|
|
508
|
+
export interface _Event extends LineItem {
|
|
482
509
|
breaks: string[];
|
|
483
|
-
|
|
484
|
-
name: string;
|
|
510
|
+
line_item_type: "EVENT";
|
|
485
511
|
internal_notes: string;
|
|
486
512
|
external_notes: string;
|
|
487
513
|
proofs: string[];
|
|
488
514
|
tasks: string[];
|
|
489
|
-
time_created: number;
|
|
490
515
|
time_ended: number;
|
|
491
516
|
time_started: number;
|
|
492
517
|
time_updated: number | null;
|
|
@@ -498,9 +523,75 @@ export interface _Event {
|
|
|
498
523
|
additional_charges: AdditionalCharge[];
|
|
499
524
|
user_id: string;
|
|
500
525
|
team_id: string;
|
|
501
|
-
cost: number;
|
|
502
526
|
billed: boolean;
|
|
503
527
|
paid: boolean;
|
|
504
528
|
autostart: boolean;
|
|
505
529
|
job_labels: string[];
|
|
506
530
|
}
|
|
531
|
+
export interface FinancialInsightData {
|
|
532
|
+
start: number;
|
|
533
|
+
end: number;
|
|
534
|
+
unbilled: {
|
|
535
|
+
events: {
|
|
536
|
+
count: number;
|
|
537
|
+
amount: number;
|
|
538
|
+
};
|
|
539
|
+
service_months: {
|
|
540
|
+
count: number;
|
|
541
|
+
amount: number;
|
|
542
|
+
};
|
|
543
|
+
total: number;
|
|
544
|
+
};
|
|
545
|
+
billed_unbilled: {
|
|
546
|
+
events: {
|
|
547
|
+
count: number;
|
|
548
|
+
amount: number;
|
|
549
|
+
};
|
|
550
|
+
service_months: {
|
|
551
|
+
count: number;
|
|
552
|
+
amount: number;
|
|
553
|
+
};
|
|
554
|
+
total: number;
|
|
555
|
+
};
|
|
556
|
+
paid_unbilled: {
|
|
557
|
+
events: {
|
|
558
|
+
count: number;
|
|
559
|
+
amount: number;
|
|
560
|
+
};
|
|
561
|
+
service_months: {
|
|
562
|
+
count: number;
|
|
563
|
+
amount: number;
|
|
564
|
+
};
|
|
565
|
+
total: number;
|
|
566
|
+
};
|
|
567
|
+
prepaid: {
|
|
568
|
+
events: {
|
|
569
|
+
count: number;
|
|
570
|
+
amount: number;
|
|
571
|
+
};
|
|
572
|
+
service_months: {
|
|
573
|
+
count: number;
|
|
574
|
+
amount: number;
|
|
575
|
+
};
|
|
576
|
+
total: number;
|
|
577
|
+
};
|
|
578
|
+
accounts_receivable: {
|
|
579
|
+
overdue: number;
|
|
580
|
+
not_overdue: number;
|
|
581
|
+
};
|
|
582
|
+
cash: number;
|
|
583
|
+
}
|
|
584
|
+
export interface EventInsightData {
|
|
585
|
+
start: number;
|
|
586
|
+
end: number;
|
|
587
|
+
events_per_job: {
|
|
588
|
+
id: string;
|
|
589
|
+
name: string;
|
|
590
|
+
event_count: number;
|
|
591
|
+
}[];
|
|
592
|
+
events_per_team: {
|
|
593
|
+
team_id: string;
|
|
594
|
+
event_count: number;
|
|
595
|
+
}[];
|
|
596
|
+
total_events: number;
|
|
597
|
+
}
|
package/dist/types/api.js
CHANGED
package/dist/types/auth.d.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Tokens } from "../types/auth";
|
|
2
|
+
export interface CacheData extends Tokens {
|
|
3
|
+
companyId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Cache {
|
|
6
|
+
get(key?: keyof CacheData): Promise<CacheData | string | null>;
|
|
7
|
+
set(data: Partial<CacheData>): Promise<void>;
|
|
8
|
+
clear(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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.120",
|
|
4
4
|
"description": "JS client for Avro backend integration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,15 +32,13 @@
|
|
|
32
32
|
"author": "Avro <info@goavro.com>",
|
|
33
33
|
"license": "CC-BY-SA-4.0",
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@types/
|
|
35
|
+
"@types/react": "^19.2.2",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
37
37
|
"@typescript-eslint/parser": "^8.38.0",
|
|
38
38
|
"eslint": "^8.57.1",
|
|
39
39
|
"eslint-plugin-import": "^2.32.0",
|
|
40
40
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
41
41
|
"eslint-plugin-react": "^7.37.5",
|
|
42
|
-
"jest": "^29.0.0",
|
|
43
|
-
"ts-jest": "^29.0.0",
|
|
44
42
|
"tsc-alias": "^1.8.16",
|
|
45
43
|
"typescript": "^5.8.3",
|
|
46
44
|
"typescript-eslint": "^8.38.0"
|
|
@@ -50,5 +48,9 @@
|
|
|
50
48
|
],
|
|
51
49
|
"publishConfig": {
|
|
52
50
|
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@tanstack/react-query": "^5.90.2",
|
|
54
|
+
"socket.io-client": "^4.8.1"
|
|
53
55
|
}
|
|
54
56
|
}
|