@go-avro/avro-js 1.6.3 → 1.6.4-rc3
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 +71 -56
- package/dist/client/QueryClient.js +50 -26
- 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 +23 -3
- package/dist/client/hooks/catalog_items.js +4 -1
- package/dist/client/hooks/companies.js +22 -2
- package/dist/client/hooks/events.js +7 -5
- package/dist/client/hooks/jobs.js +26 -3
- package/dist/client/hooks/messages.js +6 -2
- package/dist/client/hooks/plans.js +1 -1
- package/dist/client/hooks/routes.js +31 -1
- package/dist/client/hooks/sessions.js +10 -3
- package/dist/client/hooks/skills.js +1 -1
- package/dist/client/hooks/timecards.js +2 -1
- package/dist/client/hooks/users.js +34 -2
- package/dist/client/realtime.js +8 -3
- package/dist/client/requests.d.ts +221 -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/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 +24 -3
- 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 +18 -0
- package/dist/types/api/UserMerge.js +1 -0
- package/dist/types/api/_Event.d.ts +20 -4
- package/dist/types/api/_Event.js +1 -0
- package/dist/types/api.d.ts +60 -29
- package/dist/types/api.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/types/api/Avro.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { Email } from './Email.js';
|
|
|
2
2
|
export interface Avro {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
|
-
time_created: number;
|
|
6
|
-
time_updated: number;
|
|
5
|
+
time_created: number | null;
|
|
6
|
+
time_updated: number | null;
|
|
7
7
|
emails: Email[];
|
|
8
|
-
totp_email_id: string;
|
|
9
|
-
billing_email_id: string;
|
|
10
|
-
join_email_id: string;
|
|
8
|
+
totp_email_id: string | null;
|
|
9
|
+
billing_email_id: string | null;
|
|
10
|
+
join_email_id: string | null;
|
|
11
11
|
}
|
|
12
12
|
export interface StorageByType {
|
|
13
|
-
type:
|
|
13
|
+
type: 'TASK' | 'EVENT' | 'NOTIFICATION' | 'COMPANY_LOGO' | 'USER_PROFILE';
|
|
14
14
|
count: number;
|
|
15
15
|
bytes: number;
|
|
16
16
|
}
|
|
@@ -112,28 +112,33 @@ export interface ClientErrorReport {
|
|
|
112
112
|
export interface ErrorLogEntry {
|
|
113
113
|
id: string;
|
|
114
114
|
time: number;
|
|
115
|
-
source: 'backend' | 'app' | 'web'
|
|
116
|
-
status
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
115
|
+
source: 'backend' | 'app' | 'web';
|
|
116
|
+
/** HTTP status; absent from client reports. */
|
|
117
|
+
status?: number | null;
|
|
118
|
+
message: string | null;
|
|
119
|
+
traceback?: string | null;
|
|
120
|
+
stack?: string | null;
|
|
121
|
+
fatal?: boolean | null;
|
|
122
|
+
platform?: string | null;
|
|
123
|
+
app_version?: string | null;
|
|
124
|
+
update_id?: string | null;
|
|
125
|
+
route?: string | null;
|
|
126
|
+
method: string;
|
|
127
|
+
path: string;
|
|
128
|
+
endpoint: string | null;
|
|
129
|
+
client_id: string | null;
|
|
130
|
+
client_version: string | null;
|
|
131
|
+
js_version: string | null;
|
|
132
|
+
user_agent: string | null;
|
|
133
|
+
remote_addr: string | null;
|
|
134
|
+
forwarded_for: string | null;
|
|
135
|
+
source_ip: string | null;
|
|
136
|
+
/** A string when the stored value was too long and was truncated to its JSON text. */
|
|
137
|
+
user: {
|
|
135
138
|
id: string;
|
|
136
139
|
username: string;
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
is_paying?: boolean | null;
|
|
141
|
+
} | string | null;
|
|
142
|
+
/** A string when the stored value was too long and was truncated to its JSON text. */
|
|
143
|
+
extra?: Record<string, unknown> | string | null;
|
|
139
144
|
}
|
package/dist/types/api/Bill.d.ts
CHANGED
|
@@ -18,24 +18,26 @@ declare module './Bill.js' {
|
|
|
18
18
|
id: string;
|
|
19
19
|
invoice_id: number;
|
|
20
20
|
intuit_id: string | null;
|
|
21
|
-
name: string;
|
|
21
|
+
name: string | null;
|
|
22
|
+
/** Creator's user GUID; the string "None" for automatically created bills. */
|
|
22
23
|
billed_by: string;
|
|
23
|
-
customer_email: string | null;
|
|
24
24
|
manual_emails: string[][];
|
|
25
25
|
users: BillUser[];
|
|
26
26
|
status: BillStatus;
|
|
27
27
|
enabled_payment_methods: PaymentType[];
|
|
28
|
-
time_created: number;
|
|
29
|
-
time_updated: number;
|
|
28
|
+
time_created: number | null;
|
|
29
|
+
time_updated: number | null;
|
|
30
30
|
events: string[];
|
|
31
|
+
/** Unix time of the first PaymentIntent; -1 when none. */
|
|
31
32
|
intent_created_at: number;
|
|
33
|
+
/** Unix time of the latest PaymentIntent; -1 when none. */
|
|
32
34
|
intent_last_created_at: number;
|
|
33
35
|
payments: BillPayment[];
|
|
34
36
|
refunds: Refund[];
|
|
35
37
|
line_items: LineItem[];
|
|
36
38
|
prepayments: string[];
|
|
37
39
|
months: string[];
|
|
38
|
-
due_date: number;
|
|
40
|
+
due_date: number | null;
|
|
39
41
|
pass_on_fees: boolean;
|
|
40
42
|
}
|
|
41
43
|
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
export interface BillPayment {
|
|
2
2
|
id: string;
|
|
3
3
|
amount: number;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/** Set once the charge settles. */
|
|
5
|
+
avro_fees: number | null;
|
|
6
|
+
/** Set once the charge settles. */
|
|
7
|
+
stripe_fees: number | null;
|
|
8
|
+
/** Null for payments recorded outside Stripe. */
|
|
9
|
+
stripe_pi_id: string | null;
|
|
7
10
|
payout_id: string | null;
|
|
11
|
+
/** Payer's bill-user GUID; the string "None" when there is none. */
|
|
8
12
|
bill_user_id: string;
|
|
9
13
|
status: 'created' | 'processing' | 'succeeded' | 'failed' | 'canceled' | 'requires_action' | 'in_transit' | 'deposited';
|
|
10
14
|
type: 'us_bank_account' | 'card';
|
|
11
15
|
email_paid_by: string;
|
|
12
16
|
name_paid_by: string;
|
|
13
17
|
action_required_at: number | null;
|
|
14
|
-
time_created: number;
|
|
18
|
+
time_created: number | null;
|
|
15
19
|
time_updated: number | null;
|
|
16
20
|
}
|
|
@@ -3,9 +3,10 @@ export interface BillUser {
|
|
|
3
3
|
id: string;
|
|
4
4
|
user_id: string;
|
|
5
5
|
bill_id: string;
|
|
6
|
-
|
|
6
|
+
/** The bill's public invoice number. */
|
|
7
|
+
invoice_id: number;
|
|
7
8
|
payment_attempts: BillPayment[];
|
|
8
|
-
time_created: number;
|
|
9
|
+
time_created: number | null;
|
|
9
10
|
time_updated: number | null;
|
|
10
11
|
amount: number;
|
|
11
12
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { PaymentOption } from './PaymentOption.js';
|
|
2
|
+
export type CatalogIndustry = 'LAWNCARE' | 'SNOW_REMOVAL' | 'CLEANING' | 'OTHER';
|
|
3
|
+
export type CatalogPriceFormat = 'FLAT_RATE' | 'PER_SQFT';
|
|
2
4
|
export interface CatalogItem {
|
|
3
5
|
id: string;
|
|
4
6
|
name: string;
|
|
5
7
|
company_id: string;
|
|
6
8
|
description: string;
|
|
7
|
-
industry:
|
|
8
|
-
price_format:
|
|
9
|
+
industry: CatalogIndustry;
|
|
10
|
+
price_format: CatalogPriceFormat;
|
|
9
11
|
payment_options: PaymentOption[];
|
|
10
|
-
recommended_frequency
|
|
11
|
-
recommended_activate_on
|
|
12
|
-
recommended_expire_on
|
|
13
|
-
time_created: number;
|
|
12
|
+
recommended_frequency: number | null;
|
|
13
|
+
recommended_activate_on: number | null;
|
|
14
|
+
recommended_expire_on: number | null;
|
|
15
|
+
time_created: number | null;
|
|
14
16
|
time_updated: number | null;
|
|
17
|
+
/** Skill GUIDs. */
|
|
15
18
|
skills: string[];
|
|
16
19
|
}
|
package/dist/types/api/Chat.d.ts
CHANGED
|
@@ -3,10 +3,8 @@ import { MemberState } from './MemberState.js';
|
|
|
3
3
|
export interface Chat {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
last_message: Message;
|
|
6
|
+
time_created: number | null;
|
|
7
|
+
time_updated: number | null;
|
|
8
|
+
last_message: Message | null;
|
|
10
9
|
user_state: MemberState[];
|
|
11
|
-
messages: Message[];
|
|
12
10
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Bill } from './Bill.js';
|
|
2
1
|
import { Email } from './Email.js';
|
|
3
2
|
import { Group } from './Group.js';
|
|
4
3
|
import { Label } from './Label.js';
|
|
@@ -6,7 +5,6 @@ import { PaymentMethod } from './PaymentMethod.js';
|
|
|
6
5
|
import { PaymentType } from './PaymentType.js';
|
|
7
6
|
import { Plan } from './Plan.js';
|
|
8
7
|
import { PlanPayment } from './PlanPayment.js';
|
|
9
|
-
import { Session } from './Session.js';
|
|
10
8
|
import { Skill } from './Skill.js';
|
|
11
9
|
import { CatalogItem } from './CatalogItem.js';
|
|
12
10
|
export interface Company {
|
|
@@ -17,13 +15,18 @@ export interface Company {
|
|
|
17
15
|
emails: Email[];
|
|
18
16
|
skills: Skill[];
|
|
19
17
|
catalog_items: CatalogItem[];
|
|
20
|
-
time_created: number;
|
|
18
|
+
time_created: number | null;
|
|
21
19
|
time_updated: number | null;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
/** Null without `can_read_company`. */
|
|
21
|
+
use_client_side_customer_start_billing: boolean | null;
|
|
22
|
+
/** Null without `can_read_company`. */
|
|
23
|
+
use_client_side_customer_stop_billing: boolean | null;
|
|
24
|
+
/** Null without `can_read_company`. */
|
|
25
|
+
use_client_side_employee_start_billing: boolean | null;
|
|
26
|
+
/** Null without `can_read_company`. */
|
|
27
|
+
use_client_side_employee_stop_billing: boolean | null;
|
|
28
|
+
/** Presigned S3 URL; null for incognito companies. */
|
|
29
|
+
logo_url: string | null;
|
|
27
30
|
delay_scalar: number;
|
|
28
31
|
payments: PlanPayment[];
|
|
29
32
|
overdue_threshold: number;
|
|
@@ -32,7 +35,9 @@ export interface Company {
|
|
|
32
35
|
disabled_reason: string;
|
|
33
36
|
completed_onboarding: boolean;
|
|
34
37
|
restricted_soon: boolean;
|
|
38
|
+
/** Empty when unset. */
|
|
35
39
|
service_email_id: string;
|
|
40
|
+
/** Empty when unset. */
|
|
36
41
|
billing_email_id: string;
|
|
37
42
|
num_events: number;
|
|
38
43
|
num_jobs: number;
|
|
@@ -41,17 +46,30 @@ export interface Company {
|
|
|
41
46
|
schedule_locked_since: number | null;
|
|
42
47
|
num_teams: number;
|
|
43
48
|
num_skills: number;
|
|
44
|
-
|
|
49
|
+
/** Legacy key, always empty. */
|
|
50
|
+
bills: never[];
|
|
45
51
|
enabled_payment_methods: PaymentType[];
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
/** Legacy key, always empty. */
|
|
53
|
+
sessions: never[];
|
|
54
|
+
/** Legacy key, always empty. */
|
|
55
|
+
routes: never[];
|
|
56
|
+
/** Legacy key, always empty. */
|
|
57
|
+
teams: never[];
|
|
58
|
+
/** Legacy key, always empty. */
|
|
59
|
+
jobs: never[];
|
|
60
|
+
/** Legacy key, always empty. */
|
|
61
|
+
events: never[];
|
|
62
|
+
/** Legacy key, always empty. */
|
|
63
|
+
months: never[];
|
|
48
64
|
labels: Label[];
|
|
49
65
|
groups: Group[];
|
|
50
66
|
indicator_lifetime: number;
|
|
51
67
|
available_plans: Plan[];
|
|
52
|
-
last_payment: number;
|
|
53
|
-
last_charged: number;
|
|
68
|
+
last_payment: number | null;
|
|
69
|
+
last_charged: number | null;
|
|
70
|
+
/** In cents. */
|
|
54
71
|
balance: number;
|
|
72
|
+
/** Empty when no plan or without `can_read_company`. */
|
|
55
73
|
plan_id: string;
|
|
56
74
|
payment_methods: PaymentMethod[];
|
|
57
75
|
intuit_connected: boolean;
|
|
@@ -64,3 +82,11 @@ export interface Company {
|
|
|
64
82
|
/** IANA zone (e.g. `America/Chicago`) for route recurrence and bill days. */
|
|
65
83
|
timezone: string;
|
|
66
84
|
}
|
|
85
|
+
/** One of the caller's companies, as listed by `GET /company/list`. */
|
|
86
|
+
export interface CompanySummary {
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
plan_id: string | null;
|
|
90
|
+
/** In cents; null unless the caller is root. */
|
|
91
|
+
balance: number | null;
|
|
92
|
+
}
|
|
@@ -2,8 +2,11 @@ import { _Event } from './_Event.js';
|
|
|
2
2
|
declare module './DelayEvent.js' {
|
|
3
3
|
interface DelayEvent extends _Event {
|
|
4
4
|
line_item_type: 'DELAY';
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Seconds after it was logged that this delay holds its tasks off.
|
|
7
|
+
* Null on the wire means no hold; the constructor normalizes it to 0.
|
|
8
|
+
*/
|
|
9
|
+
delay_seconds: number | null;
|
|
7
10
|
}
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/** A member linked to an email account. */
|
|
2
|
+
export interface EmailUser {
|
|
3
|
+
/** The user's id. */
|
|
4
|
+
id: string;
|
|
5
|
+
username: string;
|
|
6
|
+
/** `"<first> <last>"`. */
|
|
7
|
+
name: string;
|
|
8
|
+
can_send_emails: boolean;
|
|
9
|
+
}
|
|
2
10
|
export interface Email {
|
|
3
11
|
id: string;
|
|
12
|
+
/** `"None"` for platform (Avro) accounts. */
|
|
4
13
|
company_id: string;
|
|
5
14
|
name: string;
|
|
6
15
|
mail_username: string;
|
|
7
16
|
mail_default_sender: string;
|
|
8
|
-
|
|
17
|
+
/** Write-only; always empty in responses. */
|
|
18
|
+
mail_api_key: '';
|
|
19
|
+
mail_api_key_set: boolean;
|
|
9
20
|
is_company_wide: boolean;
|
|
10
|
-
users:
|
|
21
|
+
users: EmailUser[];
|
|
11
22
|
type: 'OUTLOOK' | 'GMAIL';
|
|
12
23
|
/**
|
|
13
24
|
* False when the account's grant was revoked or expired: sends fail
|
|
@@ -4,9 +4,10 @@ export interface Group {
|
|
|
4
4
|
name: string;
|
|
5
5
|
is_active: boolean;
|
|
6
6
|
is_user_type: boolean;
|
|
7
|
+
/** Member user ids, excluding root users. */
|
|
7
8
|
users: string[];
|
|
8
9
|
permissions: Permission[];
|
|
9
10
|
company_id: string;
|
|
10
|
-
time_created: number;
|
|
11
|
-
time_updated: number;
|
|
11
|
+
time_created: number | null;
|
|
12
|
+
time_updated: number | null;
|
|
12
13
|
}
|
package/dist/types/api/Job.d.ts
CHANGED
|
@@ -11,15 +11,20 @@ declare module './Job.js' {
|
|
|
11
11
|
description: string;
|
|
12
12
|
id: string;
|
|
13
13
|
checkin_radius: number;
|
|
14
|
+
/** Legacy alias of `checkin_radius`. */
|
|
15
|
+
autostart_radius: number;
|
|
14
16
|
latitude: number;
|
|
15
17
|
longitude: number;
|
|
16
18
|
name: string;
|
|
17
19
|
internal_notes: string;
|
|
18
20
|
external_notes: string;
|
|
19
21
|
serviced_by: number;
|
|
20
|
-
time_windows:
|
|
22
|
+
time_windows: TimeWindow[];
|
|
23
|
+
/** Empty unless the viewer can read tasks or is subscribed. */
|
|
21
24
|
tasks: Partial<Task>[];
|
|
22
|
-
|
|
25
|
+
/** Legacy key; always empty. */
|
|
26
|
+
events: never[];
|
|
27
|
+
time_created: number | null;
|
|
23
28
|
time_updated: number | null;
|
|
24
29
|
routes: RouteJob[];
|
|
25
30
|
subscribers: Subscription[];
|
|
@@ -29,9 +34,25 @@ declare module './Job.js' {
|
|
|
29
34
|
current_checkins: CheckIn[];
|
|
30
35
|
labels: string[];
|
|
31
36
|
owner: string | null;
|
|
32
|
-
|
|
37
|
+
/** The job's cache version; clients refetch only jobs whose version moved. */
|
|
38
|
+
cache_version: string;
|
|
33
39
|
}
|
|
34
40
|
}
|
|
41
|
+
/** A recurring service window on a job. */
|
|
42
|
+
export interface TimeWindow {
|
|
43
|
+
id: string;
|
|
44
|
+
/** Unix time of the first occurrence. */
|
|
45
|
+
first_instance: number;
|
|
46
|
+
start: number;
|
|
47
|
+
end: number;
|
|
48
|
+
is_active: boolean;
|
|
49
|
+
/** Next occurrence; null for a one-off window already in the past. */
|
|
50
|
+
next_service: number | null;
|
|
51
|
+
/** Days between occurrences; <= 0 means the window happens once. */
|
|
52
|
+
frequency: number;
|
|
53
|
+
time_created: number | null;
|
|
54
|
+
time_updated: number | null;
|
|
55
|
+
}
|
|
35
56
|
export type JobUpdate = Partial<Omit<Job, 'subscribers'>> & {
|
|
36
57
|
subscribers?: string[];
|
|
37
58
|
};
|
|
@@ -29,10 +29,11 @@ declare module './LineItem.js' {
|
|
|
29
29
|
amount: number;
|
|
30
30
|
status: LineItemStatus;
|
|
31
31
|
job_labels: string[];
|
|
32
|
+
/** Invoice number of the bill the item is on; null when unbilled. */
|
|
32
33
|
bill_pub_id: number | null;
|
|
33
34
|
parent_id: string | null;
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
time_created: number | null;
|
|
36
|
+
time_updated: number | null;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
export declare class LineItem {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Friendship } from './Friendship.js';
|
|
2
2
|
export interface MemberState {
|
|
3
|
+
/** The participant's user id. */
|
|
3
4
|
id: string;
|
|
4
|
-
state:
|
|
5
|
+
state: 'pending' | 'rejected' | 'typing' | 'present' | 'absent';
|
|
5
6
|
friendship: Friendship | null;
|
|
6
7
|
last_message_read_at: number | null;
|
|
7
8
|
}
|
|
@@ -3,11 +3,12 @@ export interface Message {
|
|
|
3
3
|
id: string;
|
|
4
4
|
chat_id: string;
|
|
5
5
|
sender_id: string;
|
|
6
|
+
/** The string `"None"` when not a reply. */
|
|
6
7
|
reply_to_id: string;
|
|
7
8
|
content: string;
|
|
8
9
|
reactions: Reaction[];
|
|
9
|
-
time_created: number;
|
|
10
|
-
time_updated: number;
|
|
10
|
+
time_created: number | null;
|
|
11
|
+
time_updated: number | null;
|
|
12
|
+
/** Client-reported send time; -1 when unknown. */
|
|
11
13
|
time_sent: number;
|
|
12
|
-
message: string;
|
|
13
14
|
}
|
|
@@ -15,3 +15,29 @@ export interface NotificationCreated {
|
|
|
15
15
|
id: string;
|
|
16
16
|
email_errors: NotificationEmailError[];
|
|
17
17
|
}
|
|
18
|
+
/** A notification sent within a company (`GET /notification/<id>`). */
|
|
19
|
+
export interface CompanyNotification {
|
|
20
|
+
id: string;
|
|
21
|
+
subject: string;
|
|
22
|
+
body: string;
|
|
23
|
+
is_offer: boolean;
|
|
24
|
+
/** In cents. */
|
|
25
|
+
offer_amt: number;
|
|
26
|
+
accepted: boolean;
|
|
27
|
+
/** The string `"None"` when not tied to an event. */
|
|
28
|
+
event_id: string;
|
|
29
|
+
/** Never written by the backend, so always empty. */
|
|
30
|
+
notification_levels: never[];
|
|
31
|
+
time_created: number | null;
|
|
32
|
+
time_updated: number | null;
|
|
33
|
+
}
|
|
34
|
+
/** A member's copy of a notification (`UserCompanyAssociation.notifications`). */
|
|
35
|
+
export interface NotificationUserCompany {
|
|
36
|
+
id: string;
|
|
37
|
+
user_company_id: string;
|
|
38
|
+
notification_id: string;
|
|
39
|
+
dismissed: boolean;
|
|
40
|
+
read: boolean;
|
|
41
|
+
time_created: number | null;
|
|
42
|
+
time_updated: number | null;
|
|
43
|
+
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { PaymentType } from './PaymentType.js';
|
|
2
2
|
export interface PaymentMethod {
|
|
3
3
|
allow_redisplay: string;
|
|
4
|
-
autopay
|
|
4
|
+
/** Avro's autopay flag; absent when the method has no Avro settings row. */
|
|
5
|
+
autopay?: boolean | null;
|
|
6
|
+
/** Absent when the method has no Avro settings row. */
|
|
7
|
+
time_created?: number | null;
|
|
8
|
+
/** Absent when the method has no Avro settings row. */
|
|
9
|
+
time_updated?: number | null;
|
|
5
10
|
billing_details: {
|
|
6
11
|
email: string;
|
|
7
12
|
name: string;
|
|
8
13
|
};
|
|
9
14
|
created: number;
|
|
10
|
-
customer: string;
|
|
15
|
+
customer: string | null;
|
|
11
16
|
id: string;
|
|
12
17
|
type: PaymentType;
|
|
13
18
|
us_bank_account: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export interface PaymentOption {
|
|
2
|
-
name: string;
|
|
3
2
|
id: string;
|
|
3
|
+
/** Catalog item GUID; the string "None" for a task's payment option. */
|
|
4
|
+
catalog_item_id: string;
|
|
5
|
+
name: string;
|
|
4
6
|
is_prepay: boolean;
|
|
5
|
-
price_under_prepay
|
|
7
|
+
price_under_prepay: number | null;
|
|
6
8
|
price: number;
|
|
7
|
-
recommended_prepay_count
|
|
8
|
-
mode: 'MONTH' | 'SERVICE';
|
|
9
|
+
recommended_prepay_count: number | null;
|
|
10
|
+
mode: 'NONE' | 'MONTH' | 'SERVICE';
|
|
9
11
|
}
|
package/dist/types/api/Plan.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ export interface Plan {
|
|
|
6
6
|
description: string;
|
|
7
7
|
referral_codes: string[];
|
|
8
8
|
trial_period_days: number;
|
|
9
|
-
time_created: number;
|
|
10
|
-
time_updated: number;
|
|
11
|
-
available_to_new_companies
|
|
12
|
-
|
|
9
|
+
time_created: number | null;
|
|
10
|
+
time_updated: number | null;
|
|
11
|
+
available_to_new_companies: boolean;
|
|
12
|
+
/** GUIDs of companies offered the plan; empty unless the viewer is root. */
|
|
13
|
+
available_to: string[];
|
|
13
14
|
}
|
|
@@ -2,9 +2,11 @@ export interface PlanPayment {
|
|
|
2
2
|
id: string;
|
|
3
3
|
amount: number;
|
|
4
4
|
stripe_pi_id: string;
|
|
5
|
+
/** The string "None" once the company is deleted. */
|
|
5
6
|
company_id: string;
|
|
7
|
+
/** The string "None" once the plan is deleted. */
|
|
6
8
|
plan_id: string;
|
|
7
|
-
status: 'created' | 'processing' | 'succeeded' | 'failed' | 'canceled';
|
|
8
|
-
time_created: number;
|
|
9
|
-
time_updated: number;
|
|
9
|
+
status: 'created' | 'processing' | 'in_transit' | 'deposited' | 'succeeded' | 'failed' | 'canceled' | 'requires_action';
|
|
10
|
+
time_created: number | null;
|
|
11
|
+
time_updated: number | null;
|
|
10
12
|
}
|
|
@@ -7,7 +7,8 @@ declare module './Prepayment.js' {
|
|
|
7
7
|
job_name: string;
|
|
8
8
|
job_address: string;
|
|
9
9
|
type: 'SERVICE' | 'MONTH';
|
|
10
|
-
|
|
10
|
+
/** Same as `type`. */
|
|
11
|
+
prepayment_type: 'SERVICE' | 'MONTH';
|
|
11
12
|
num_events: number;
|
|
12
13
|
num_service_months: number;
|
|
13
14
|
}
|
|
@@ -8,6 +8,6 @@ export interface Refund {
|
|
|
8
8
|
amount: number;
|
|
9
9
|
stripe_pi_id: string;
|
|
10
10
|
status: 'created' | 'processing' | 'succeeded' | 'failed' | 'canceled' | 'requires_action' | 'in_transit' | 'deposited';
|
|
11
|
-
time_created: number;
|
|
11
|
+
time_created: number | null;
|
|
12
12
|
time_updated: number | null;
|
|
13
13
|
}
|
|
@@ -13,21 +13,22 @@ declare module './Route.js' {
|
|
|
13
13
|
interface Route {
|
|
14
14
|
company: string;
|
|
15
15
|
id: string;
|
|
16
|
-
|
|
16
|
+
/** Empty unless the viewer can read jobs. */
|
|
17
17
|
jobs: RouteJob[];
|
|
18
18
|
name: string;
|
|
19
|
-
time_created: number;
|
|
19
|
+
time_created: number | null;
|
|
20
20
|
time_updated: number | null;
|
|
21
|
+
/** Team GUIDs. */
|
|
21
22
|
teams: string[];
|
|
22
|
-
polyline: string;
|
|
23
|
+
polyline: string | null;
|
|
23
24
|
is_optimized: boolean;
|
|
24
|
-
start_time: number;
|
|
25
|
-
end_time: number;
|
|
26
|
-
start_latitude: number;
|
|
27
|
-
start_longitude: number;
|
|
28
|
-
end_latitude: number;
|
|
29
|
-
end_longitude: number;
|
|
30
|
-
frequency:
|
|
25
|
+
start_time: number | null;
|
|
26
|
+
end_time: number | null;
|
|
27
|
+
start_latitude: number | null;
|
|
28
|
+
start_longitude: number | null;
|
|
29
|
+
end_latitude: number | null;
|
|
30
|
+
end_longitude: number | null;
|
|
31
|
+
frequency: FrequencyType | null;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
export declare class Route {
|
package/dist/types/api/Route.js
CHANGED
|
@@ -29,6 +29,8 @@ export class Route {
|
|
|
29
29
|
return next_occurrences;
|
|
30
30
|
};
|
|
31
31
|
this.getNextOccurrence = (after = new Date()) => {
|
|
32
|
+
if (this.start_time == null)
|
|
33
|
+
return null;
|
|
32
34
|
let next_occurrence = new Date(this.start_time * 1000);
|
|
33
35
|
while (next_occurrence <= after) {
|
|
34
36
|
switch (this.frequency) {
|
|
@@ -49,6 +51,9 @@ export class Route {
|
|
|
49
51
|
case FrequencyType.YEARLY:
|
|
50
52
|
next_occurrence.setFullYear(next_occurrence.getFullYear() + 1);
|
|
51
53
|
break;
|
|
54
|
+
default:
|
|
55
|
+
// No frequency: a one-off route that has already started.
|
|
56
|
+
return null;
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
59
|
return next_occurrence;
|