@go-avro/avro-js 1.6.5 → 1.6.6-rc1
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 +122 -63
- package/dist/client/QueryClient.js +144 -24
- package/dist/client/core/xhr.js +2 -1
- 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 +26 -13
- package/dist/client/hooks/catalog_items.js +4 -1
- 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 +1 -1
- package/dist/client/hooks/timecards.js +2 -1
- package/dist/client/hooks/users.js +8 -3
- package/dist/client/realtime.d.ts +6 -0
- package/dist/client/realtime.js +16 -5
- package/dist/client/requests.d.ts +470 -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/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/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/Task.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { UserCompanyAssociation } from './UserCompanyAssociation.js';
|
|
2
1
|
import { Prepayment } from './Prepayment.js';
|
|
3
2
|
import { PaymentOption } from './PaymentOption.js';
|
|
4
3
|
import { _Event } from './_Event.js';
|
|
@@ -30,8 +29,9 @@ export type UnroutedReason = (typeof UnroutedReason)[keyof typeof UnroutedReason
|
|
|
30
29
|
export declare const UNROUTED_REASON_LABELS: Record<UnroutedReason, string>;
|
|
31
30
|
declare module './Task.js' {
|
|
32
31
|
interface Task {
|
|
33
|
-
enforce_image_amount: boolean;
|
|
34
|
-
|
|
32
|
+
enforce_image_amount: boolean | null;
|
|
33
|
+
/** Legacy key; always empty. */
|
|
34
|
+
events: never[];
|
|
35
35
|
payment_options: PaymentOption[];
|
|
36
36
|
frequency: number;
|
|
37
37
|
id: string;
|
|
@@ -41,16 +41,15 @@ declare module './Task.js' {
|
|
|
41
41
|
external_notes: string;
|
|
42
42
|
image_amt: number;
|
|
43
43
|
images: string[];
|
|
44
|
-
time_created: number;
|
|
44
|
+
time_created: number | null;
|
|
45
45
|
time_updated: number | null;
|
|
46
46
|
status: TaskStatus;
|
|
47
|
-
created_by: UserCompanyAssociation | null;
|
|
48
47
|
/**
|
|
49
|
-
* Overdueness as of `overdue_at
|
|
50
|
-
* in the database changes, so no
|
|
51
|
-
* prefer `getOverdueness()`.
|
|
48
|
+
* Overdueness as of `overdue_at` (-1 when the task isn't active). It
|
|
49
|
+
* grows with time while nothing in the database changes, so no
|
|
50
|
+
* realtime event refreshes it: prefer `getOverdueness()`.
|
|
52
51
|
*/
|
|
53
|
-
overdueness: number
|
|
52
|
+
overdueness: number;
|
|
54
53
|
/** Seconds overdue as of `overdue_at`; prefer `getOverdueTime()`. */
|
|
55
54
|
overdue_time: number;
|
|
56
55
|
/**
|
|
@@ -86,6 +85,8 @@ declare module './Task.js' {
|
|
|
86
85
|
pay_in_cash: boolean;
|
|
87
86
|
priority: boolean;
|
|
88
87
|
route_ids: string[];
|
|
88
|
+
/** Fraction of routing runs that put the task on a route. */
|
|
89
|
+
favorability: number;
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
/**
|
package/dist/types/api/Task.js
CHANGED
|
@@ -123,6 +123,8 @@ export class Task {
|
|
|
123
123
|
this.getNextDue = () => {
|
|
124
124
|
if (this.frequency > 0 && this.status === TaskStatus.ACTIVE) {
|
|
125
125
|
const lastEventTime = this.last_completed_event?.time_ended ?? this.activate_on ?? this.time_created;
|
|
126
|
+
if (lastEventTime == null)
|
|
127
|
+
return null;
|
|
126
128
|
const due = lastEventTime + this.frequency;
|
|
127
129
|
// A delay holds the task off until it ends, then lapses.
|
|
128
130
|
return Math.max(due, this.getDelayUntil() ?? due);
|
|
@@ -180,7 +182,7 @@ export class Task {
|
|
|
180
182
|
// an early-started visit that finishes a few minutes before
|
|
181
183
|
// route.start_time) while still rejecting stale events from previous
|
|
182
184
|
// occurrences. Applies to both recurring and one-shot tasks.
|
|
183
|
-
const routeDay = new Date(route.start_time * 1000);
|
|
185
|
+
const routeDay = new Date((route.start_time ?? 0) * 1000);
|
|
184
186
|
routeDay.setHours(0, 0, 0, 0);
|
|
185
187
|
const cutoff = Math.floor(routeDay.getTime() / 1000);
|
|
186
188
|
return (this.last_completed_event?.time_ended ?? 0) >= cutoff;
|
|
@@ -10,8 +10,8 @@ export type TimecardActionType = (typeof TimecardActionType)[keyof typeof Timeca
|
|
|
10
10
|
export interface TimecardAction {
|
|
11
11
|
id: string;
|
|
12
12
|
action_type: TimecardActionType;
|
|
13
|
-
first_name: string
|
|
14
|
-
last_name: string
|
|
13
|
+
first_name: string;
|
|
14
|
+
last_name: string;
|
|
15
15
|
details: string | null;
|
|
16
16
|
time_created: number | null;
|
|
17
17
|
time_updated: number | null;
|
package/dist/types/api/User.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BillUser } from './BillUser.js';
|
|
2
2
|
import { Device } from './Device.js';
|
|
3
3
|
import { Chat } from './Chat.js';
|
|
4
|
+
import { Friendship } from './Friendship.js';
|
|
4
5
|
import { PaymentMethod } from './PaymentMethod.js';
|
|
5
6
|
import { PaymentType } from './PaymentType.js';
|
|
6
7
|
import { NotificationLevel } from './UserCompanyAssociation.js';
|
|
@@ -13,18 +14,19 @@ export interface User {
|
|
|
13
14
|
verified: boolean;
|
|
14
15
|
email: string | null;
|
|
15
16
|
phone_number: string | null;
|
|
16
|
-
time_created: number;
|
|
17
|
+
time_created: number | null;
|
|
17
18
|
time_updated: number | null;
|
|
18
|
-
share_location: boolean;
|
|
19
|
+
share_location: boolean | null;
|
|
19
20
|
devices: Device[] | null;
|
|
20
21
|
notification_setting: NotificationLevel[] | null;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
friends: Friendship[] | null;
|
|
23
|
+
autopay_payment_types: PaymentType[] | null;
|
|
24
|
+
payment_methods: PaymentMethod[] | null;
|
|
25
|
+
chats: Chat[] | null;
|
|
26
|
+
bills: BillUser[] | null;
|
|
27
|
+
/** Legacy key, always empty. */
|
|
28
|
+
companies: never[];
|
|
29
|
+
is_root: boolean | null;
|
|
28
30
|
apple: {
|
|
29
31
|
linked: boolean;
|
|
30
32
|
email_forwarding: boolean | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { User } from './User.js';
|
|
2
2
|
import { Location } from '../api.js';
|
|
3
|
+
import { NotificationUserCompany } from './Notification.js';
|
|
3
4
|
export declare const Permission: {
|
|
4
5
|
readonly CAN_WRITE_COMPANY: "can_write_company";
|
|
5
6
|
readonly CAN_READ_GROUPS: "can_read_groups";
|
|
@@ -70,7 +71,12 @@ export declare const LocationServicesStatus: {
|
|
|
70
71
|
export type LocationServicesStatus = (typeof LocationServicesStatus)[keyof typeof LocationServicesStatus];
|
|
71
72
|
export interface UserCompanyAssociation {
|
|
72
73
|
id: string;
|
|
74
|
+
/**
|
|
75
|
+
* The member's user. The backend's schema also allows their internal
|
|
76
|
+
* integer id (serialized without `recurse`), but no endpoint sends that.
|
|
77
|
+
*/
|
|
73
78
|
user: User;
|
|
79
|
+
/** The viewer's company id. */
|
|
74
80
|
company: string;
|
|
75
81
|
hourly_rate: number;
|
|
76
82
|
salary_rate: number;
|
|
@@ -87,7 +93,7 @@ export interface UserCompanyAssociation {
|
|
|
87
93
|
time_updated: number | null;
|
|
88
94
|
notification_setting: NotificationLevel[];
|
|
89
95
|
share_email_company_wide: boolean;
|
|
90
|
-
notifications:
|
|
96
|
+
notifications: NotificationUserCompany[];
|
|
91
97
|
groups: string[];
|
|
92
98
|
last_location: Location | null;
|
|
93
99
|
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* /user/{keepId}/merge`). The same shape answers the dry-run preview.
|
|
4
4
|
*/
|
|
5
5
|
export interface UserMergeSummary {
|
|
6
|
-
msg:
|
|
6
|
+
msg: 'Users merged' | 'Merge preview';
|
|
7
7
|
/** Rows moved per table, keyed by table name; tables with none are left out. */
|
|
8
8
|
rows: Record<string, number>;
|
|
9
|
-
/**
|
|
9
|
+
/** Names of companies only the duplicate belonged to; the kept account joins them. */
|
|
10
10
|
companies_moved: string[];
|
|
11
|
-
/**
|
|
11
|
+
/** Names of companies both belonged to; the duplicate's membership is folded in. */
|
|
12
12
|
companies_folded: string[];
|
|
13
13
|
/** Saved payment methods removed with the duplicate's Stripe customer. */
|
|
14
14
|
payment_methods_dropped: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LineItem } from './LineItem.js';
|
|
2
2
|
import { AdditionalCharge } from './AdditionalCharge.js';
|
|
3
3
|
import { UserEvent } from './UserEvent.js';
|
|
4
|
+
import type { NotificationLevel } from './UserCompanyAssociation.js';
|
|
4
5
|
declare module './_Event.js' {
|
|
5
6
|
interface _Event extends LineItem {
|
|
6
7
|
breaks: string[];
|
|
@@ -14,16 +15,31 @@ declare module './_Event.js' {
|
|
|
14
15
|
tasks: string[];
|
|
15
16
|
task_names: string[];
|
|
16
17
|
time_ended: number | null;
|
|
17
|
-
time_started: number;
|
|
18
|
-
|
|
19
|
-
bill_id: string;
|
|
20
|
-
billed_amount: number;
|
|
18
|
+
time_started: number | null;
|
|
19
|
+
bill_id: string | null;
|
|
21
20
|
earned_revenue: number;
|
|
22
21
|
additional_charges: AdditionalCharge[];
|
|
23
22
|
users: UserEvent[];
|
|
24
23
|
team_id: string | null;
|
|
24
|
+
team_name: string | null;
|
|
25
|
+
/** Notifications sent about this event. */
|
|
26
|
+
alerts: EventAlert[];
|
|
25
27
|
}
|
|
26
28
|
}
|
|
29
|
+
/** A notification attached to an event (`_Event.alerts`). */
|
|
30
|
+
export interface EventAlert {
|
|
31
|
+
id: string;
|
|
32
|
+
subject: string;
|
|
33
|
+
body: string;
|
|
34
|
+
is_offer: boolean;
|
|
35
|
+
offer_amt: number;
|
|
36
|
+
accepted: boolean;
|
|
37
|
+
/** Event GUID; the string "None" when not tied to an event. */
|
|
38
|
+
event_id: string;
|
|
39
|
+
notification_levels: NotificationLevel[];
|
|
40
|
+
time_created: number | null;
|
|
41
|
+
time_updated: number | null;
|
|
42
|
+
}
|
|
27
43
|
export declare class _Event extends LineItem {
|
|
28
44
|
constructor(init?: Partial<_Event>);
|
|
29
45
|
getCost: () => number;
|
package/dist/types/api/_Event.js
CHANGED
package/dist/types/api.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FrequencyType } from '..';
|
|
2
|
-
import {
|
|
3
|
-
import { Route } from './api/Route.js';
|
|
2
|
+
import type { LineItemStatus } from './api/LineItem.js';
|
|
4
3
|
export * from './api/_Event.js';
|
|
5
4
|
export * from './api/AdditionalCharge.js';
|
|
6
5
|
export * from './api/DelayEvent.js';
|
|
@@ -70,6 +69,24 @@ export type AppleLoginResult = {
|
|
|
70
69
|
email: string | null;
|
|
71
70
|
is_private_email: boolean;
|
|
72
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Outcome of `useMicrosoftLogin`. With no account for the Microsoft identity
|
|
74
|
+
* yet this is `NEEDS_ACCOUNT` (the backend's 404 `MicrosoftUserNotFound`):
|
|
75
|
+
* create the account (`POST /user`), then pass `microsoft_token` (a
|
|
76
|
+
* one-time handle, valid 10 min) to `useMicrosoftLink`. `email` is the
|
|
77
|
+
* verified sign-in address, or null when Microsoft gave none (e.g. a
|
|
78
|
+
* phone-number account): then ask the user for an address, and the link
|
|
79
|
+
* call must carry the new account's session.
|
|
80
|
+
*/
|
|
81
|
+
export type MicrosoftLoginResult = {
|
|
82
|
+
status: typeof LoginResponse.SUCCESS;
|
|
83
|
+
} | {
|
|
84
|
+
status: 'NEEDS_ACCOUNT';
|
|
85
|
+
microsoft_token: string;
|
|
86
|
+
email: string | null;
|
|
87
|
+
first_name: string;
|
|
88
|
+
last_name: string;
|
|
89
|
+
};
|
|
73
90
|
/**
|
|
74
91
|
* Proof of the Apple ID `useAppleLink` attaches: a fresh identity token and
|
|
75
92
|
* its raw nonce, or the `apple_token` handle from a `NEEDS_ACCOUNT` sign-in.
|
|
@@ -82,52 +99,63 @@ export type AppleLinkProof = {
|
|
|
82
99
|
appleToken: string;
|
|
83
100
|
authorizationCode?: string | null;
|
|
84
101
|
};
|
|
102
|
+
/** Health of one backend dependency, as `GET /` reports it. */
|
|
103
|
+
export type ServiceStatusValue = 'ready' | 'starting' | 'dead' | 'unknown';
|
|
85
104
|
export interface ApiInfo {
|
|
105
|
+
/** App versions this backend supports, e.g. `>=1.5.0`. */
|
|
86
106
|
app_semver: string;
|
|
87
107
|
build_time: string;
|
|
88
108
|
commit: string;
|
|
89
|
-
db_status:
|
|
109
|
+
db_status: ServiceStatusValue;
|
|
110
|
+
/** The caller's full name, or `anonymous user`. */
|
|
90
111
|
logged_in_as: string;
|
|
91
112
|
max_images: number;
|
|
92
|
-
ors_status:
|
|
93
|
-
pelias_status:
|
|
113
|
+
ors_status: ServiceStatusValue;
|
|
114
|
+
pelias_status: ServiceStatusValue;
|
|
94
115
|
version: string;
|
|
95
|
-
vroom_status:
|
|
116
|
+
vroom_status: ServiceStatusValue;
|
|
96
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* One stop of a team's schedule (`POST /company/<id>/schedule`).
|
|
120
|
+
* `location` is `[latitude, longitude]`; `time_window` is a
|
|
121
|
+
* `[start, end]` pair of integer Unix seconds (fractions are rejected).
|
|
122
|
+
*/
|
|
97
123
|
export type ScheduleItem = {
|
|
98
124
|
type: 'location';
|
|
99
125
|
location: [number, number];
|
|
100
126
|
time_window: [number, number];
|
|
101
|
-
} | {
|
|
102
|
-
type: 'break';
|
|
103
|
-
start: [number, number];
|
|
104
|
-
time_window: [number, number];
|
|
105
127
|
} | {
|
|
106
128
|
type: 'job';
|
|
107
|
-
|
|
129
|
+
/** Echoed back in `schedule_adjustments`; not read. */
|
|
130
|
+
job_id?: string | null;
|
|
108
131
|
task_ids: string[];
|
|
109
132
|
location: [number, number];
|
|
110
133
|
time_window: [number, number];
|
|
111
134
|
};
|
|
112
135
|
export type TeamSchedule = {
|
|
113
136
|
team_id: string;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
137
|
+
/** Ordered by start time; defaults to `[]`. */
|
|
138
|
+
schedule?: ScheduleItem[];
|
|
139
|
+
/** 1–255 characters; omit for `Route for <team name>` (null is a 400). */
|
|
140
|
+
name?: string;
|
|
141
|
+
/** Defaults to true. */
|
|
142
|
+
optimize?: boolean;
|
|
143
|
+
/** Upper-case `FrequencyType`; defaults to `ONCE`. */
|
|
144
|
+
frequency?: FrequencyType;
|
|
118
145
|
};
|
|
119
146
|
export type RouteScheduleConfig = {
|
|
120
|
-
schedules
|
|
121
|
-
whitelist
|
|
122
|
-
blacklist
|
|
123
|
-
|
|
147
|
+
schedules?: TeamSchedule[];
|
|
148
|
+
whitelist?: string[];
|
|
149
|
+
blacklist?: string[];
|
|
150
|
+
/** Task ids, or `{task, depends_on}` entries. */
|
|
151
|
+
tasks?: (string | {
|
|
124
152
|
task: string;
|
|
125
|
-
depends_on
|
|
126
|
-
}[];
|
|
153
|
+
depends_on?: string[];
|
|
154
|
+
})[];
|
|
127
155
|
};
|
|
128
156
|
export interface Location {
|
|
129
|
-
accuracy: number;
|
|
130
|
-
heading: number;
|
|
157
|
+
accuracy: number | null;
|
|
158
|
+
heading: number | null;
|
|
131
159
|
id: string;
|
|
132
160
|
team_id: string | null;
|
|
133
161
|
user_company_id: string;
|
|
@@ -136,30 +164,29 @@ export interface Location {
|
|
|
136
164
|
version: string | null;
|
|
137
165
|
latitude: number;
|
|
138
166
|
longitude: number;
|
|
139
|
-
time_collected: number;
|
|
140
|
-
time_created: number;
|
|
167
|
+
time_collected: number | null;
|
|
168
|
+
time_created: number | null;
|
|
141
169
|
time_updated: number | null;
|
|
142
170
|
}
|
|
143
171
|
export interface Team {
|
|
144
172
|
autoconfigure: boolean;
|
|
145
|
-
company_id: string;
|
|
146
173
|
description: string;
|
|
147
|
-
end: number[];
|
|
148
174
|
end_time: number;
|
|
149
175
|
fixed_cost: number;
|
|
150
176
|
hourly_cost: number;
|
|
151
177
|
id: string;
|
|
152
|
-
items: string[];
|
|
153
178
|
km_cost: number;
|
|
154
179
|
max_distance: number;
|
|
155
180
|
max_jobs: number;
|
|
156
181
|
max_travel_time: number;
|
|
157
182
|
color: string;
|
|
158
183
|
name: string;
|
|
159
|
-
|
|
184
|
+
/** Route ids; empty unless the viewer can read routes. */
|
|
160
185
|
routes: string[];
|
|
186
|
+
/** Skill ids; empty unless the viewer can read skills. */
|
|
161
187
|
skills: string[];
|
|
162
188
|
speed_factor: number;
|
|
189
|
+
/** 0 when the team has no start point. */
|
|
163
190
|
start_latitude: number;
|
|
164
191
|
start_longitude: number;
|
|
165
192
|
end_latitude: number;
|
|
@@ -169,6 +196,8 @@ export interface Team {
|
|
|
169
196
|
current_location: Location | null;
|
|
170
197
|
start_address: string;
|
|
171
198
|
end_address: string;
|
|
199
|
+
time_created: number | null;
|
|
200
|
+
time_updated: number | null;
|
|
172
201
|
}
|
|
173
202
|
export interface taskStartInfo {
|
|
174
203
|
name: string;
|
|
@@ -225,29 +254,112 @@ export interface CheckIn {
|
|
|
225
254
|
team_id: string | null;
|
|
226
255
|
company_id: string;
|
|
227
256
|
event_id: string | null;
|
|
228
|
-
time_checked_in: number;
|
|
257
|
+
time_checked_in: number | null;
|
|
229
258
|
time_checked_out: number | null;
|
|
230
259
|
time_created: number | null;
|
|
231
260
|
time_updated: number | null;
|
|
232
261
|
}
|
|
233
|
-
/**
|
|
262
|
+
/**
|
|
263
|
+
* Wire shape for per-participant entries on an event update. Null
|
|
264
|
+
* `time_started` resets it to the event's start; null `time_ended` clears it.
|
|
265
|
+
*/
|
|
234
266
|
export interface EventUserUpdate {
|
|
235
267
|
user_id: string;
|
|
236
268
|
time_started?: number | null;
|
|
237
269
|
time_ended?: number | null;
|
|
238
270
|
}
|
|
271
|
+
/** A task done at a route stop, with its in-route dependencies. */
|
|
272
|
+
export interface RouteStopTaskInput {
|
|
273
|
+
id: string;
|
|
274
|
+
/** Tasks that must be done first. */
|
|
275
|
+
depends_on?: string[];
|
|
276
|
+
}
|
|
277
|
+
/** One job stop of a route write (backend `RouteStop`), in route order. */
|
|
278
|
+
export interface RouteStopInput {
|
|
279
|
+
job_id: string;
|
|
280
|
+
/** The stop's tasks, as ids or `{id, depends_on}`; omitted means none. */
|
|
281
|
+
tasks?: (string | RouteStopTaskInput)[];
|
|
282
|
+
/** Pinned arrival (Unix seconds); -1 (the default) means not pinned. */
|
|
283
|
+
scheduled_arrival_time?: number;
|
|
284
|
+
/** Estimated arrival (Unix seconds); -1 (the default) means unknown. */
|
|
285
|
+
estimated_arrival_time?: number;
|
|
286
|
+
}
|
|
239
287
|
/**
|
|
240
|
-
* Route create/update payload
|
|
241
|
-
*
|
|
242
|
-
*
|
|
288
|
+
* Route create/update payload (backend `CreateRoute` / `UpdateRoute`);
|
|
289
|
+
* omitted fields are unchanged. Null is accepted only for the endpoint
|
|
290
|
+
* coordinates, and only for both halves of an endpoint together (it clears
|
|
291
|
+
* that endpoint); `start_time`/`end_time` are unset with -1. `optimize`
|
|
292
|
+
* explicitly requests an optimizer run on this save; `is_optimized` itself
|
|
293
|
+
* is server-owned (true only when the current order came from the
|
|
294
|
+
* optimizer).
|
|
243
295
|
*/
|
|
244
|
-
export
|
|
296
|
+
export interface RouteWritePayload {
|
|
297
|
+
/** 1–255 characters; required on create. */
|
|
298
|
+
name?: string;
|
|
299
|
+
start_latitude?: number | null;
|
|
300
|
+
start_longitude?: number | null;
|
|
301
|
+
end_latitude?: number | null;
|
|
302
|
+
end_longitude?: number | null;
|
|
303
|
+
/** Unix seconds; -1 unsets it. */
|
|
304
|
+
start_time?: number;
|
|
305
|
+
/** Unix seconds; -1 unsets it. */
|
|
306
|
+
end_time?: number;
|
|
307
|
+
frequency?: FrequencyType;
|
|
308
|
+
/** Team GUIDs; replaces the route's teams (`[]` removes them). */
|
|
309
|
+
teams?: string[];
|
|
310
|
+
/** Replaces the route's stops (`[]` removes them). */
|
|
311
|
+
jobs?: RouteStopInput[];
|
|
245
312
|
optimize?: boolean;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
export
|
|
313
|
+
}
|
|
314
|
+
/** An additional charge on an event write (backend `EventCharge`), upserted by `id`. */
|
|
315
|
+
export interface EventChargeInput {
|
|
316
|
+
/** An existing charge's id; omit (or null) to create a new charge. */
|
|
317
|
+
id?: string | null;
|
|
318
|
+
name?: string;
|
|
319
|
+
description?: string;
|
|
320
|
+
/** Unit price in integer cents. */
|
|
321
|
+
cost?: number;
|
|
322
|
+
/** Quantity (at least 1). */
|
|
323
|
+
amount?: number;
|
|
324
|
+
earned_revenue?: number;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Event create/update payload (backend `UpdateEvent`); omitted fields are
|
|
328
|
+
* unchanged. Only `team_id` is nullable (null clears the team; `''` is
|
|
329
|
+
* omitted by the SDK); null on any other field is a 400 (an ended event
|
|
330
|
+
* can't be re-opened). On a delay only the descriptive fields may be sent.
|
|
331
|
+
*/
|
|
332
|
+
export interface EventUpdatePayload {
|
|
333
|
+
/** 1–254 characters. */
|
|
334
|
+
name?: string;
|
|
335
|
+
internal_notes?: string;
|
|
336
|
+
external_notes?: string;
|
|
337
|
+
description?: string;
|
|
338
|
+
/** Names of existing images to copy onto the event. */
|
|
339
|
+
images?: string[];
|
|
340
|
+
team_id?: string | null;
|
|
341
|
+
status?: LineItemStatus;
|
|
342
|
+
/** Alias of `time_started`; wins when both are sent. */
|
|
343
|
+
start?: number;
|
|
344
|
+
/** Restarts the event (at this time when client start times are trusted). */
|
|
345
|
+
time_started?: number;
|
|
346
|
+
/** Alias of `time_ended`; wins when both are sent. */
|
|
347
|
+
end?: number;
|
|
348
|
+
/** Ends the event (at this time when client stop times are trusted). */
|
|
349
|
+
time_ended?: number;
|
|
350
|
+
task_names?: string[];
|
|
351
|
+
/** Task GUIDs; replaces the event's tasks. */
|
|
352
|
+
tasks?: string[];
|
|
353
|
+
/** Unit price in integer cents. */
|
|
354
|
+
cost?: number;
|
|
355
|
+
/** Quantity (at least 1). */
|
|
356
|
+
amount?: number;
|
|
357
|
+
earned_revenue?: number;
|
|
358
|
+
/** Replaces the event's charges (upserting by `id`). */
|
|
359
|
+
additional_charges?: EventChargeInput[];
|
|
360
|
+
/** Replaces the event's participants. */
|
|
249
361
|
users?: EventUserUpdate[];
|
|
250
|
-
}
|
|
362
|
+
}
|
|
251
363
|
/**
|
|
252
364
|
* Wire payload for logging a delay (POST /job/{job_id}/delay).
|
|
253
365
|
*
|
|
@@ -259,11 +371,15 @@ export interface DelayEventCreatePayload {
|
|
|
259
371
|
job_id: string;
|
|
260
372
|
/** Task ids (guids) whose schedule this delay pushes back. */
|
|
261
373
|
tasks: string[];
|
|
374
|
+
/** Whole seconds, 1 to 366 days. */
|
|
262
375
|
delay_seconds: number;
|
|
376
|
+
/** 1–254 characters when sent. */
|
|
263
377
|
name?: string;
|
|
264
378
|
internal_notes?: string;
|
|
265
379
|
external_notes?: string;
|
|
266
380
|
description?: string;
|
|
381
|
+
/** Names of existing images to copy onto the delay. */
|
|
382
|
+
images?: string[];
|
|
267
383
|
}
|
|
268
384
|
export interface EventInsightData {
|
|
269
385
|
start: number;
|
|
@@ -273,6 +389,7 @@ export interface EventInsightData {
|
|
|
273
389
|
name: string;
|
|
274
390
|
event_count: number;
|
|
275
391
|
}[];
|
|
392
|
+
/** `team_id` is the string `"None"` for sessions without a team. */
|
|
276
393
|
events_per_team: {
|
|
277
394
|
team_id: string;
|
|
278
395
|
event_count: number;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AVRO_JS_VERSION = "1.6.
|
|
1
|
+
export declare const AVRO_JS_VERSION = "1.6.6-rc1";
|
package/dist/version.js
CHANGED