@go-avro/avro-js 1.6.4-rc2 → 1.6.4-rc4
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 +105 -65
- 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/companies.js +20 -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 +37 -9
- 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.js +8 -3
- 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
|
@@ -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
|
/**
|
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -5,7 +5,7 @@ export interface ServiceMonth extends LineItem {
|
|
|
5
5
|
job_name: string;
|
|
6
6
|
job_address: string;
|
|
7
7
|
bill_id: string | null;
|
|
8
|
-
|
|
8
|
+
/** Task GUIDs; null where the task was deleted. */
|
|
9
|
+
tasks: (string | null)[];
|
|
9
10
|
task_names: string[];
|
|
10
|
-
time_updated: number | null;
|
|
11
11
|
}
|
|
@@ -2,15 +2,18 @@ import { Break } from './Break.js';
|
|
|
2
2
|
declare module './Session.js' {
|
|
3
3
|
interface Session {
|
|
4
4
|
id: string;
|
|
5
|
+
/** Same as `id`. */
|
|
6
|
+
session_id: string;
|
|
5
7
|
user_id: string;
|
|
6
8
|
company_id: string;
|
|
7
|
-
time_started: number;
|
|
9
|
+
time_started: number | null;
|
|
8
10
|
time_ended: number | null;
|
|
9
11
|
break_id: string | null;
|
|
10
12
|
is_paused: boolean;
|
|
11
13
|
team_id: string | null;
|
|
14
|
+
/** Same as `current_route_id`. */
|
|
12
15
|
route_id: string | null;
|
|
13
|
-
current_route_id
|
|
16
|
+
current_route_id: string | null;
|
|
14
17
|
breaks: Break[];
|
|
15
18
|
}
|
|
16
19
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { NotificationLevel } from './UserCompanyAssociation.js';
|
|
1
2
|
export interface Subscription {
|
|
2
|
-
time_created: number;
|
|
3
|
-
time_updated:
|
|
3
|
+
time_created: number | null;
|
|
4
|
+
time_updated: number | null;
|
|
5
|
+
/** The subscribed membership; the string "None" for a group subscription. */
|
|
4
6
|
user_company_id: string;
|
|
5
7
|
job_id: string;
|
|
6
8
|
id: string;
|
|
7
|
-
notifications:
|
|
9
|
+
notifications: NotificationLevel[];
|
|
8
10
|
}
|