@go-avro/avro-js 1.6.5 → 1.6.6-rc10
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 +150 -60
- package/dist/client/QueryClient.js +175 -27
- package/dist/client/core/xhr.js +2 -1
- package/dist/client/hooks/audit.js +4 -2
- package/dist/client/hooks/avro.js +19 -2
- package/dist/client/hooks/bills.d.ts +1 -1
- package/dist/client/hooks/bills.js +54 -16
- package/dist/client/hooks/catalog_items.js +20 -5
- 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 +5 -2
- package/dist/client/hooks/timecards.js +2 -1
- package/dist/client/hooks/users.js +21 -3
- package/dist/client/realtime.d.ts +13 -0
- package/dist/client/realtime.js +41 -8
- package/dist/client/requests.d.ts +503 -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 +72 -21
- 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 +11 -6
- package/dist/types/api/Chat.d.ts +3 -5
- package/dist/types/api/Company.d.ts +41 -15
- 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/Proposal.d.ts +1 -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
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
|
}
|
|
@@ -88,11 +88,55 @@ export interface PerformanceSample {
|
|
|
88
88
|
memory_percent: number;
|
|
89
89
|
}[];
|
|
90
90
|
}
|
|
91
|
+
/** A live scheduler process (`avro scheduler-worker`). */
|
|
92
|
+
export interface SchedulerWorker {
|
|
93
|
+
/** `<hostname>:<pid>` of the scheduler process. */
|
|
94
|
+
worker: string;
|
|
95
|
+
/** Unix seconds of the last heartbeat. */
|
|
96
|
+
time: number;
|
|
97
|
+
/** Unix seconds when the process started its scheduler. */
|
|
98
|
+
started_at: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Latest run state of a scheduled job. `pending` until its first run since
|
|
102
|
+
* the worker started; `locked` when the last run skipped because another
|
|
103
|
+
* process held the job's Redis lock. A run skipped because the previous one
|
|
104
|
+
* is still going leaves it `running` and sets `last_skipped`.
|
|
105
|
+
*/
|
|
106
|
+
export type SchedulerJobStatus = 'pending' | 'running' | 'ok' | 'error' | 'missed' | 'locked';
|
|
107
|
+
/** A scheduled job and its latest run (times are Unix seconds). */
|
|
108
|
+
export interface SchedulerJob {
|
|
109
|
+
/** The job's function name, e.g. `update_routes`. */
|
|
110
|
+
id: string;
|
|
111
|
+
/** E.g. `cron[hour='1', minute='0', second='0']`. */
|
|
112
|
+
trigger: string | null;
|
|
113
|
+
status: SchedulerJobStatus | null;
|
|
114
|
+
next_run_time: number | null;
|
|
115
|
+
last_started: number | null;
|
|
116
|
+
last_finished: number | null;
|
|
117
|
+
last_success: number | null;
|
|
118
|
+
last_skipped: number | null;
|
|
119
|
+
/** Last run skipped because another process held the job's lock. */
|
|
120
|
+
last_locked: number | null;
|
|
121
|
+
/** The Redis lock that was held on the last `locked` run. */
|
|
122
|
+
lock_name: string | null;
|
|
123
|
+
/** Of the last finished run. */
|
|
124
|
+
duration_seconds: number | null;
|
|
125
|
+
last_error: string | null;
|
|
126
|
+
last_error_time: number | null;
|
|
127
|
+
}
|
|
128
|
+
/** Scheduler health: live processes and every job's latest run. */
|
|
129
|
+
export interface PerformanceScheduler {
|
|
130
|
+
/** Empty when no scheduler process is alive. */
|
|
131
|
+
workers: SchedulerWorker[];
|
|
132
|
+
jobs: SchedulerJob[];
|
|
133
|
+
}
|
|
91
134
|
/** Response of GET /avro/performance (root only). */
|
|
92
135
|
export interface PerformanceMetrics {
|
|
93
136
|
current: {
|
|
94
137
|
database: PerformanceDatabase;
|
|
95
138
|
fleet: PerformanceFleet;
|
|
139
|
+
scheduler: PerformanceScheduler;
|
|
96
140
|
};
|
|
97
141
|
/** Oldest first. */
|
|
98
142
|
samples: PerformanceSample[];
|
|
@@ -108,22 +152,27 @@ export interface ClientErrorReport {
|
|
|
108
152
|
route?: string;
|
|
109
153
|
extra?: Record<string, unknown>;
|
|
110
154
|
}
|
|
111
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* One entry in the admin error log (backend errors, client crashes and
|
|
157
|
+
* scheduler job failures). Scheduler entries carry no request context:
|
|
158
|
+
* `endpoint` is the job id and the request fields are absent.
|
|
159
|
+
*/
|
|
112
160
|
export interface ErrorLogEntry {
|
|
113
161
|
id: string;
|
|
114
162
|
time: number;
|
|
115
|
-
source: 'backend' | 'app' | 'web' |
|
|
116
|
-
status
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
163
|
+
source: 'backend' | 'app' | 'web' | 'scheduler';
|
|
164
|
+
/** HTTP status; absent from client reports. */
|
|
165
|
+
status?: number | null;
|
|
166
|
+
message: string | null;
|
|
167
|
+
traceback?: string | null;
|
|
168
|
+
stack?: string | null;
|
|
169
|
+
fatal?: boolean | null;
|
|
170
|
+
platform?: string | null;
|
|
171
|
+
app_version?: string | null;
|
|
172
|
+
update_id?: string | null;
|
|
173
|
+
route?: string | null;
|
|
174
|
+
method?: string | null;
|
|
175
|
+
path?: string | null;
|
|
127
176
|
endpoint?: string | null;
|
|
128
177
|
client_id?: string | null;
|
|
129
178
|
client_version?: string | null;
|
|
@@ -131,9 +180,11 @@ export interface ErrorLogEntry {
|
|
|
131
180
|
user_agent?: string | null;
|
|
132
181
|
remote_addr?: string | null;
|
|
133
182
|
forwarded_for?: string | null;
|
|
183
|
+
source_ip?: string | null;
|
|
134
184
|
user?: {
|
|
135
185
|
id: string;
|
|
136
186
|
username: string;
|
|
137
|
-
|
|
138
|
-
|
|
187
|
+
is_paying?: boolean | null;
|
|
188
|
+
} | string | null;
|
|
189
|
+
extra?: Record<string, unknown> | string | null;
|
|
139
190
|
}
|
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,21 @@
|
|
|
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;
|
|
11
|
+
/** Hidden from new proposals and the public catalog; kept for tasks. */
|
|
12
|
+
archived: boolean;
|
|
9
13
|
payment_options: PaymentOption[];
|
|
10
|
-
recommended_frequency
|
|
11
|
-
recommended_activate_on
|
|
12
|
-
recommended_expire_on
|
|
13
|
-
time_created: number;
|
|
14
|
+
recommended_frequency: number | null;
|
|
15
|
+
recommended_activate_on: number | null;
|
|
16
|
+
recommended_expire_on: number | null;
|
|
17
|
+
time_created: number | null;
|
|
14
18
|
time_updated: number | null;
|
|
15
19
|
skills: string[];
|
|
20
|
+
terms: string[];
|
|
16
21
|
}
|
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,9 +5,7 @@ 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
|
-
import { CatalogItem } from './CatalogItem.js';
|
|
12
9
|
export interface Company {
|
|
13
10
|
id: string;
|
|
14
11
|
name: string;
|
|
@@ -16,14 +13,18 @@ export interface Company {
|
|
|
16
13
|
address: string;
|
|
17
14
|
emails: Email[];
|
|
18
15
|
skills: Skill[];
|
|
19
|
-
|
|
20
|
-
time_created: number;
|
|
16
|
+
time_created: number | null;
|
|
21
17
|
time_updated: number | null;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
/** Null without `can_read_company`. */
|
|
19
|
+
use_client_side_customer_start_billing: boolean | null;
|
|
20
|
+
/** Null without `can_read_company`. */
|
|
21
|
+
use_client_side_customer_stop_billing: boolean | null;
|
|
22
|
+
/** Null without `can_read_company`. */
|
|
23
|
+
use_client_side_employee_start_billing: boolean | null;
|
|
24
|
+
/** Null without `can_read_company`. */
|
|
25
|
+
use_client_side_employee_stop_billing: boolean | null;
|
|
26
|
+
/** Presigned S3 URL; null for incognito companies. */
|
|
27
|
+
logo_url: string | null;
|
|
27
28
|
delay_scalar: number;
|
|
28
29
|
payments: PlanPayment[];
|
|
29
30
|
overdue_threshold: number;
|
|
@@ -32,26 +33,43 @@ export interface Company {
|
|
|
32
33
|
disabled_reason: string;
|
|
33
34
|
completed_onboarding: boolean;
|
|
34
35
|
restricted_soon: boolean;
|
|
36
|
+
/** Empty when unset. */
|
|
35
37
|
service_email_id: string;
|
|
38
|
+
/** Empty when unset. */
|
|
36
39
|
billing_email_id: string;
|
|
37
40
|
num_events: number;
|
|
38
41
|
num_jobs: number;
|
|
39
42
|
num_routes: number;
|
|
40
43
|
schedule_locked: boolean;
|
|
41
44
|
schedule_locked_since: number | null;
|
|
45
|
+
/** A QuickBooks sync is running; another can't start until it ends. */
|
|
46
|
+
intuit_sync_locked: boolean;
|
|
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
|
/**
|
|
@@ -9,10 +9,11 @@ export type DevicePlatform = (typeof DevicePlatform)[keyof typeof DevicePlatform
|
|
|
9
9
|
export interface DeviceInfo {
|
|
10
10
|
device_key: string;
|
|
11
11
|
platform: DevicePlatform;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/** Omitted details are unchanged; null clears one. */
|
|
13
|
+
name?: string | null;
|
|
14
|
+
model?: string | null;
|
|
15
|
+
os?: string | null;
|
|
16
|
+
app_version?: string | null;
|
|
16
17
|
foreground?: boolean;
|
|
17
18
|
headless?: boolean;
|
|
18
19
|
}
|
|
@@ -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
|
@@ -4,6 +4,7 @@ import type { CheckIn } from '../api.js';
|
|
|
4
4
|
import { RouteJob } from './RouteJob.js';
|
|
5
5
|
import { Subscription } from './Subscription.js';
|
|
6
6
|
import { Route } from './Route.js';
|
|
7
|
+
import type { TaskWritePayload } from '../../client/requests.js';
|
|
7
8
|
declare module './Job.js' {
|
|
8
9
|
interface Job {
|
|
9
10
|
address: string;
|
|
@@ -11,15 +12,20 @@ declare module './Job.js' {
|
|
|
11
12
|
description: string;
|
|
12
13
|
id: string;
|
|
13
14
|
checkin_radius: number;
|
|
15
|
+
/** Legacy alias of `checkin_radius`. */
|
|
16
|
+
autostart_radius: number;
|
|
14
17
|
latitude: number;
|
|
15
18
|
longitude: number;
|
|
16
19
|
name: string;
|
|
17
20
|
internal_notes: string;
|
|
18
21
|
external_notes: string;
|
|
19
22
|
serviced_by: number;
|
|
20
|
-
time_windows:
|
|
23
|
+
time_windows: TimeWindow[];
|
|
24
|
+
/** Empty unless the viewer can read tasks or is subscribed. */
|
|
21
25
|
tasks: Partial<Task>[];
|
|
22
|
-
|
|
26
|
+
/** Legacy key; always empty. */
|
|
27
|
+
events: never[];
|
|
28
|
+
time_created: number | null;
|
|
23
29
|
time_updated: number | null;
|
|
24
30
|
routes: RouteJob[];
|
|
25
31
|
subscribers: Subscription[];
|
|
@@ -29,12 +35,56 @@ declare module './Job.js' {
|
|
|
29
35
|
current_checkins: CheckIn[];
|
|
30
36
|
labels: string[];
|
|
31
37
|
owner: string | null;
|
|
32
|
-
|
|
38
|
+
/** The job's cache version; clients refetch only jobs whose version moved. */
|
|
39
|
+
cache_version: string;
|
|
33
40
|
}
|
|
34
41
|
}
|
|
35
|
-
|
|
42
|
+
/** A recurring service window on a job. */
|
|
43
|
+
export interface TimeWindow {
|
|
44
|
+
id: string;
|
|
45
|
+
/** Unix time of the first occurrence. */
|
|
46
|
+
first_instance: number;
|
|
47
|
+
start: number;
|
|
48
|
+
end: number;
|
|
49
|
+
is_active: boolean;
|
|
50
|
+
/** Next occurrence; null for a one-off window already in the past. */
|
|
51
|
+
next_service: number | null;
|
|
52
|
+
/** Days between occurrences; <= 0 means the window happens once. */
|
|
53
|
+
frequency: number;
|
|
54
|
+
time_created: number | null;
|
|
55
|
+
time_updated: number | null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Body of a job write (backend `UpdateJob` / `CreateJob` / `ManagedJob`).
|
|
59
|
+
* Omitted fields are unchanged; `owner_id: null` removes the owner and null
|
|
60
|
+
* on any other field is a 400. `''` clears text, `[]` clears lists. `id`
|
|
61
|
+
* (bulk writes only) and `owner_id` may be `''`, which the SDK omits.
|
|
62
|
+
* Send only the fields that changed, never a cached `Job` back.
|
|
63
|
+
*/
|
|
64
|
+
export interface JobUpdate {
|
|
65
|
+
/** Bulk writes (`useManageJobs`): the job to update; omit to create one. */
|
|
66
|
+
id?: string;
|
|
67
|
+
/** Required unless the job already has one. */
|
|
68
|
+
name?: string;
|
|
69
|
+
/** Applied only together with `longitude`; a new job needs both. */
|
|
70
|
+
latitude?: number;
|
|
71
|
+
longitude?: number;
|
|
72
|
+
address?: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
internal_notes?: string;
|
|
75
|
+
external_notes?: string;
|
|
76
|
+
serviced_by?: number;
|
|
77
|
+
/** Member (user-company) or user GUIDs; replaces the subscriptions. */
|
|
36
78
|
subscribers?: string[];
|
|
37
|
-
|
|
79
|
+
/** Extra notification recipients as `[name, email]` pairs. */
|
|
80
|
+
manual_emails?: [string, string][];
|
|
81
|
+
/** Replaces the job's tasks: listed ones are upserted, unlisted deleted. */
|
|
82
|
+
tasks?: TaskWritePayload[];
|
|
83
|
+
/** Label GUIDs or names; replaces the job's labels. */
|
|
84
|
+
labels?: string[];
|
|
85
|
+
/** User GUID of the owner (a company member); null removes the owner. */
|
|
86
|
+
owner_id?: string | null;
|
|
87
|
+
}
|
|
38
88
|
export declare class Job {
|
|
39
89
|
constructor(init?: Partial<Job>);
|
|
40
90
|
isOverdue: () => boolean;
|
|
@@ -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
|
}
|