@go-avro/avro-js 0.0.2-beta.10 → 0.0.2-beta.100
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 +11 -3
- package/dist/auth/AuthManager.js +45 -12
- package/dist/auth/storage.d.ts +8 -8
- package/dist/auth/storage.js +12 -10
- package/dist/client/QueryClient.d.ts +371 -15
- package/dist/client/QueryClient.js +335 -197
- 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 +90 -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 +178 -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 +168 -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 +116 -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 +121 -29
- 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;
|
|
@@ -163,10 +176,14 @@ export interface Plan {
|
|
|
163
176
|
trial_period_days: number;
|
|
164
177
|
time_created: number;
|
|
165
178
|
time_updated: number;
|
|
179
|
+
available_to_new_companies?: boolean;
|
|
180
|
+
available_to?: string[];
|
|
166
181
|
}
|
|
167
182
|
export interface BillPayment {
|
|
168
183
|
id: string;
|
|
169
184
|
amount: number;
|
|
185
|
+
avro_fees: number;
|
|
186
|
+
stripe_fees: number;
|
|
170
187
|
stripe_pi_id: string;
|
|
171
188
|
bill_user_id: string;
|
|
172
189
|
status: "created" | "processing" | "succeeded" | "failed" | "canceled" | "requires_action";
|
|
@@ -193,14 +210,15 @@ export interface User {
|
|
|
193
210
|
companies: UserCompanyAssociation[] | null;
|
|
194
211
|
email: string | null;
|
|
195
212
|
phone_number: string | null;
|
|
196
|
-
time_created:
|
|
197
|
-
time_updated:
|
|
213
|
+
time_created: number;
|
|
214
|
+
time_updated: number | null;
|
|
198
215
|
can_send_emails: boolean | null;
|
|
199
216
|
payment_methods: PaymentMethod[];
|
|
200
217
|
autopay_payment_types: string[];
|
|
201
218
|
autopay: boolean | null;
|
|
202
219
|
chats: Chat[];
|
|
203
220
|
bills: BillUser[];
|
|
221
|
+
is_root: boolean;
|
|
204
222
|
}
|
|
205
223
|
export interface Break {
|
|
206
224
|
id: string;
|
|
@@ -209,20 +227,20 @@ export interface Break {
|
|
|
209
227
|
company_billable: boolean;
|
|
210
228
|
client_billable: boolean;
|
|
211
229
|
}
|
|
212
|
-
export interface ServiceMonth {
|
|
213
|
-
|
|
230
|
+
export interface ServiceMonth extends LineItem {
|
|
231
|
+
line_item_type: "SERVICE_MONTH";
|
|
214
232
|
job_name: string;
|
|
215
233
|
job_id: string | null;
|
|
234
|
+
job_address: string;
|
|
235
|
+
job_labels: string[];
|
|
216
236
|
bill_id: string | null;
|
|
217
|
-
cost: number;
|
|
218
237
|
billed: boolean;
|
|
219
238
|
paid: boolean;
|
|
220
|
-
|
|
221
|
-
time_created: number;
|
|
239
|
+
tasks: string[];
|
|
222
240
|
time_updated: number | null;
|
|
223
241
|
}
|
|
224
242
|
export interface Session {
|
|
225
|
-
|
|
243
|
+
id: string;
|
|
226
244
|
user_id: string;
|
|
227
245
|
company_id: string;
|
|
228
246
|
time_started: number;
|
|
@@ -230,7 +248,7 @@ export interface Session {
|
|
|
230
248
|
break_id: string;
|
|
231
249
|
is_paused: boolean;
|
|
232
250
|
team_id: string;
|
|
233
|
-
|
|
251
|
+
route_id: string;
|
|
234
252
|
breaks: Break[];
|
|
235
253
|
}
|
|
236
254
|
export interface Group {
|
|
@@ -244,6 +262,18 @@ export interface Group {
|
|
|
244
262
|
time_created: number;
|
|
245
263
|
time_updated: number;
|
|
246
264
|
}
|
|
265
|
+
export declare const NotificationLevel: {
|
|
266
|
+
readonly IN_APP: 0;
|
|
267
|
+
readonly EMAIL: 1;
|
|
268
|
+
readonly SMS: 2;
|
|
269
|
+
readonly PUSH: 3;
|
|
270
|
+
};
|
|
271
|
+
export type NotificationLevel = typeof NotificationLevel[keyof typeof NotificationLevel];
|
|
272
|
+
export declare const LoginResponse: {
|
|
273
|
+
readonly SUCCESS: "SUCCESS";
|
|
274
|
+
readonly NEEDS_TOTP: "NEEDS_TOTP";
|
|
275
|
+
};
|
|
276
|
+
export type LoginResponse = typeof LoginResponse[keyof typeof LoginResponse];
|
|
247
277
|
export interface UserCompanyAssociation {
|
|
248
278
|
id: string;
|
|
249
279
|
user: User;
|
|
@@ -252,9 +282,9 @@ export interface UserCompanyAssociation {
|
|
|
252
282
|
effective_permissions: string[];
|
|
253
283
|
time_created: number | null;
|
|
254
284
|
time_updated: number | null;
|
|
255
|
-
notification_setting:
|
|
285
|
+
notification_setting: NotificationLevel[];
|
|
256
286
|
share_email_company_wide: boolean;
|
|
257
|
-
notifications:
|
|
287
|
+
notifications: Notification[];
|
|
258
288
|
groups: string[];
|
|
259
289
|
}
|
|
260
290
|
export interface Email {
|
|
@@ -294,6 +324,7 @@ export interface Bill {
|
|
|
294
324
|
customer_email: string | null;
|
|
295
325
|
manual_emails: string[][];
|
|
296
326
|
users: BillUser[];
|
|
327
|
+
paid: boolean;
|
|
297
328
|
paid_at: number;
|
|
298
329
|
time_created: number;
|
|
299
330
|
time_updated: number;
|
|
@@ -301,7 +332,7 @@ export interface Bill {
|
|
|
301
332
|
intent_created_at: number;
|
|
302
333
|
intent_last_created_at: number;
|
|
303
334
|
payment: BillPayment | null;
|
|
304
|
-
line_items:
|
|
335
|
+
line_items: CustomLineItem[];
|
|
305
336
|
months: string[];
|
|
306
337
|
due_date: number;
|
|
307
338
|
}
|
|
@@ -323,18 +354,13 @@ export interface PlanPayment {
|
|
|
323
354
|
time_updated: number;
|
|
324
355
|
}
|
|
325
356
|
export interface Company {
|
|
326
|
-
events: _Event[];
|
|
327
|
-
months: ServiceMonth[];
|
|
328
357
|
id: string;
|
|
329
|
-
jobs: Job[];
|
|
330
358
|
name: string;
|
|
331
359
|
email: string;
|
|
332
|
-
routes: Route[];
|
|
333
|
-
teams: Team[];
|
|
334
360
|
emails: Email[];
|
|
335
361
|
skills: Skill[];
|
|
336
|
-
time_created:
|
|
337
|
-
time_updated:
|
|
362
|
+
time_created: number;
|
|
363
|
+
time_updated: number | null;
|
|
338
364
|
users: UserCompanyAssociation[];
|
|
339
365
|
use_client_side_customer_start_billing: boolean;
|
|
340
366
|
use_client_side_customer_stop_billing: boolean;
|
|
@@ -353,6 +379,8 @@ export interface Company {
|
|
|
353
379
|
billing_email_id: string;
|
|
354
380
|
num_events: number;
|
|
355
381
|
num_jobs: number;
|
|
382
|
+
num_routes: number;
|
|
383
|
+
num_teams: number;
|
|
356
384
|
bills: Bill[];
|
|
357
385
|
enabled_payment_methods: string[];
|
|
358
386
|
sessions: Session[];
|
|
@@ -416,6 +444,7 @@ export interface Job {
|
|
|
416
444
|
routes: RouteJob[];
|
|
417
445
|
subscribers: Subscription[];
|
|
418
446
|
manual_emails: string[][];
|
|
447
|
+
overdue_time: number;
|
|
419
448
|
last_completed_event: _Event | null;
|
|
420
449
|
last_event: _Event | null;
|
|
421
450
|
labels: string[];
|
|
@@ -438,6 +467,7 @@ export interface Task {
|
|
|
438
467
|
created_by: UserCompanyAssociation | null;
|
|
439
468
|
overdueness: number | null;
|
|
440
469
|
overdue_time: number;
|
|
470
|
+
last_completed_event: _Event | null;
|
|
441
471
|
last_event: _Event | null;
|
|
442
472
|
delay: number;
|
|
443
473
|
skills: string[];
|
|
@@ -450,6 +480,7 @@ export interface Task {
|
|
|
450
480
|
services_prepaid: number;
|
|
451
481
|
months_prepaid: number;
|
|
452
482
|
priority: boolean;
|
|
483
|
+
route_ids: string[];
|
|
453
484
|
}
|
|
454
485
|
export interface TaskWrapper {
|
|
455
486
|
latestEvent: number;
|
|
@@ -471,22 +502,17 @@ export interface taskEndInfo {
|
|
|
471
502
|
internal_notes: string;
|
|
472
503
|
external_notes: string;
|
|
473
504
|
}
|
|
474
|
-
export interface AdditionalCharge {
|
|
475
|
-
|
|
476
|
-
time_created: number;
|
|
505
|
+
export interface AdditionalCharge extends LineItem {
|
|
506
|
+
line_item_type: "ADDITIONAL_CHARGE";
|
|
477
507
|
time_updated: number | null;
|
|
478
|
-
name: string;
|
|
479
|
-
amount: number;
|
|
480
508
|
}
|
|
481
|
-
export interface _Event {
|
|
509
|
+
export interface _Event extends LineItem {
|
|
482
510
|
breaks: string[];
|
|
483
|
-
|
|
484
|
-
name: string;
|
|
511
|
+
line_item_type: "EVENT";
|
|
485
512
|
internal_notes: string;
|
|
486
513
|
external_notes: string;
|
|
487
514
|
proofs: string[];
|
|
488
515
|
tasks: string[];
|
|
489
|
-
time_created: number;
|
|
490
516
|
time_ended: number;
|
|
491
517
|
time_started: number;
|
|
492
518
|
time_updated: number | null;
|
|
@@ -498,9 +524,75 @@ export interface _Event {
|
|
|
498
524
|
additional_charges: AdditionalCharge[];
|
|
499
525
|
user_id: string;
|
|
500
526
|
team_id: string;
|
|
501
|
-
cost: number;
|
|
502
527
|
billed: boolean;
|
|
503
528
|
paid: boolean;
|
|
504
529
|
autostart: boolean;
|
|
505
530
|
job_labels: string[];
|
|
506
531
|
}
|
|
532
|
+
export interface FinancialInsightData {
|
|
533
|
+
start: number;
|
|
534
|
+
end: number;
|
|
535
|
+
unbilled: {
|
|
536
|
+
events: {
|
|
537
|
+
count: number;
|
|
538
|
+
amount: number;
|
|
539
|
+
};
|
|
540
|
+
service_months: {
|
|
541
|
+
count: number;
|
|
542
|
+
amount: number;
|
|
543
|
+
};
|
|
544
|
+
total: number;
|
|
545
|
+
};
|
|
546
|
+
billed_unbilled: {
|
|
547
|
+
events: {
|
|
548
|
+
count: number;
|
|
549
|
+
amount: number;
|
|
550
|
+
};
|
|
551
|
+
service_months: {
|
|
552
|
+
count: number;
|
|
553
|
+
amount: number;
|
|
554
|
+
};
|
|
555
|
+
total: number;
|
|
556
|
+
};
|
|
557
|
+
paid_unbilled: {
|
|
558
|
+
events: {
|
|
559
|
+
count: number;
|
|
560
|
+
amount: number;
|
|
561
|
+
};
|
|
562
|
+
service_months: {
|
|
563
|
+
count: number;
|
|
564
|
+
amount: number;
|
|
565
|
+
};
|
|
566
|
+
total: number;
|
|
567
|
+
};
|
|
568
|
+
prepaid: {
|
|
569
|
+
events: {
|
|
570
|
+
count: number;
|
|
571
|
+
amount: number;
|
|
572
|
+
};
|
|
573
|
+
service_months: {
|
|
574
|
+
count: number;
|
|
575
|
+
amount: number;
|
|
576
|
+
};
|
|
577
|
+
total: number;
|
|
578
|
+
};
|
|
579
|
+
accounts_receivable: {
|
|
580
|
+
overdue: number;
|
|
581
|
+
not_overdue: number;
|
|
582
|
+
};
|
|
583
|
+
cash: number;
|
|
584
|
+
}
|
|
585
|
+
export interface EventInsightData {
|
|
586
|
+
start: number;
|
|
587
|
+
end: number;
|
|
588
|
+
events_per_job: {
|
|
589
|
+
id: string;
|
|
590
|
+
name: string;
|
|
591
|
+
event_count: number;
|
|
592
|
+
}[];
|
|
593
|
+
events_per_team: {
|
|
594
|
+
team_id: string;
|
|
595
|
+
event_count: number;
|
|
596
|
+
}[];
|
|
597
|
+
total_events: number;
|
|
598
|
+
}
|
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.100",
|
|
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
|
}
|