@go-avro/avro-js 1.6.4-rc2 → 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.
Files changed (67) hide show
  1. package/dist/client/QueryClient.d.ts +57 -52
  2. package/dist/client/QueryClient.js +45 -22
  3. package/dist/client/hooks/audit.js +4 -2
  4. package/dist/client/hooks/avro.js +6 -2
  5. package/dist/client/hooks/bills.d.ts +1 -1
  6. package/dist/client/hooks/bills.js +23 -3
  7. package/dist/client/hooks/catalog_items.js +4 -1
  8. package/dist/client/hooks/companies.js +4 -2
  9. package/dist/client/hooks/events.js +7 -5
  10. package/dist/client/hooks/jobs.js +26 -3
  11. package/dist/client/hooks/messages.js +6 -2
  12. package/dist/client/hooks/plans.js +1 -1
  13. package/dist/client/hooks/routes.js +31 -1
  14. package/dist/client/hooks/sessions.js +10 -3
  15. package/dist/client/hooks/skills.js +1 -1
  16. package/dist/client/hooks/timecards.js +2 -1
  17. package/dist/client/hooks/users.js +5 -2
  18. package/dist/client/realtime.js +8 -3
  19. package/dist/client/requests.d.ts +221 -0
  20. package/dist/client/requests.js +5 -0
  21. package/dist/client/wire.d.ts +7 -0
  22. package/dist/client/wire.js +14 -0
  23. package/dist/index.d.ts +1 -0
  24. package/dist/types/api/AdditionalCharge.d.ts +2 -1
  25. package/dist/types/api/Avro.d.ts +33 -28
  26. package/dist/types/api/Bill.d.ts +7 -5
  27. package/dist/types/api/BillPayment.d.ts +8 -4
  28. package/dist/types/api/BillUser.d.ts +3 -2
  29. package/dist/types/api/CatalogItem.d.ts +9 -6
  30. package/dist/types/api/Chat.d.ts +3 -5
  31. package/dist/types/api/Company.d.ts +39 -13
  32. package/dist/types/api/DelayEvent.d.ts +5 -2
  33. package/dist/types/api/Email.d.ts +14 -3
  34. package/dist/types/api/Friendship.d.ts +8 -0
  35. package/dist/types/api/Group.d.ts +3 -2
  36. package/dist/types/api/Job.d.ts +24 -3
  37. package/dist/types/api/LineItem.d.ts +3 -2
  38. package/dist/types/api/MemberState.d.ts +2 -1
  39. package/dist/types/api/Message.d.ts +4 -3
  40. package/dist/types/api/Notification.d.ts +26 -0
  41. package/dist/types/api/PaymentMethod.d.ts +7 -2
  42. package/dist/types/api/PaymentOption.d.ts +6 -4
  43. package/dist/types/api/Payout.d.ts +1 -1
  44. package/dist/types/api/Plan.d.ts +5 -4
  45. package/dist/types/api/PlanPayment.d.ts +5 -3
  46. package/dist/types/api/Prepayment.d.ts +2 -1
  47. package/dist/types/api/Reaction.d.ts +3 -3
  48. package/dist/types/api/Refund.d.ts +1 -1
  49. package/dist/types/api/Route.d.ts +11 -10
  50. package/dist/types/api/Route.js +5 -0
  51. package/dist/types/api/RouteJob.d.ts +1 -1
  52. package/dist/types/api/ServiceMonth.d.ts +2 -2
  53. package/dist/types/api/Session.d.ts +5 -2
  54. package/dist/types/api/Skill.d.ts +2 -2
  55. package/dist/types/api/Subscription.d.ts +5 -3
  56. package/dist/types/api/Task.d.ts +10 -9
  57. package/dist/types/api/Task.js +3 -1
  58. package/dist/types/api/TimecardAction.d.ts +2 -2
  59. package/dist/types/api/User.d.ts +11 -9
  60. package/dist/types/api/UserCompanyAssociation.d.ts +7 -1
  61. package/dist/types/api/UserMerge.d.ts +3 -3
  62. package/dist/types/api/_Event.d.ts +20 -4
  63. package/dist/types/api/_Event.js +1 -0
  64. package/dist/types/api.d.ts +45 -28
  65. package/dist/version.d.ts +1 -1
  66. package/dist/version.js +1 -1
  67. package/package.json +1 -1
@@ -1,16 +1,20 @@
1
1
  export interface BillPayment {
2
2
  id: string;
3
3
  amount: number;
4
- avro_fees: number;
5
- stripe_fees: number;
6
- stripe_pi_id: string;
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
- invoice_id: string;
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: string;
8
- price_format: string;
9
+ industry: CatalogIndustry;
10
+ price_format: CatalogPriceFormat;
9
11
  payment_options: PaymentOption[];
10
- recommended_frequency?: number | null;
11
- recommended_activate_on?: number | null;
12
- recommended_expire_on?: number | null;
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
  }
@@ -3,10 +3,8 @@ import { MemberState } from './MemberState.js';
3
3
  export interface Chat {
4
4
  id: string;
5
5
  name: string;
6
- company_id: string;
7
- time_created: number;
8
- time_updated: number;
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
- use_client_side_customer_start_billing: boolean;
23
- use_client_side_customer_stop_billing: boolean;
24
- use_client_side_employee_start_billing: boolean;
25
- use_client_side_employee_stop_billing: boolean;
26
- logo_url: string;
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
- bills: Bill[];
49
+ /** Legacy key, always empty. */
50
+ bills: never[];
45
51
  enabled_payment_methods: PaymentType[];
46
- sessions: Session[];
47
- num_sessions: number;
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
- /** Seconds after it was logged that this delay holds its tasks off. */
6
- delay_seconds: number;
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
- import { User } from './User.js';
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
- mail_api_key: string;
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: User[];
21
+ users: EmailUser[];
11
22
  type: 'OUTLOOK' | 'GMAIL';
12
23
  /**
13
24
  * False when the account's grant was revoked or expired: sends fail
@@ -1,2 +1,10 @@
1
+ /** A friendship between two users. */
1
2
  export interface Friendship {
3
+ id: string;
4
+ user_id_a: string;
5
+ user_id_b: string;
6
+ time_created: number | null;
7
+ time_updated: number | null;
8
+ user_a_opted_in: boolean;
9
+ user_b_opted_in: boolean;
2
10
  }
@@ -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
  }
@@ -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: unknown[];
22
+ time_windows: TimeWindow[];
23
+ /** Empty unless the viewer can read tasks or is subscribed. */
21
24
  tasks: Partial<Task>[];
22
- time_created: number;
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
- cache_version?: string;
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
- company_id: string;
35
- time_created: number;
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: string;
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: boolean;
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?: number;
7
+ price_under_prepay: number | null;
6
8
  price: number;
7
- recommended_prepay_count?: number;
8
- mode: 'MONTH' | 'SERVICE';
9
+ recommended_prepay_count: number | null;
10
+ mode: 'NONE' | 'MONTH' | 'SERVICE';
9
11
  }
@@ -15,6 +15,6 @@ export interface Payout {
15
15
  company_id: string;
16
16
  arrival_date: number | null;
17
17
  payments: BillPayment[];
18
- time_created: number;
18
+ time_created: number | null;
19
19
  time_updated: number | null;
20
20
  }
@@ -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?: boolean;
12
- available_to?: string[];
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
- time_updated: number | null;
10
+ /** Same as `type`. */
11
+ prepayment_type: 'SERVICE' | 'MONTH';
11
12
  num_events: number;
12
13
  num_service_months: number;
13
14
  }
@@ -2,7 +2,7 @@ export interface Reaction {
2
2
  id: string;
3
3
  message_id: string;
4
4
  sender_id: string;
5
- reaction: string;
6
- time_created: number;
7
- time_updated: number;
5
+ reaction: number;
6
+ time_created: number | null;
7
+ time_updated: number | null;
8
8
  }
@@ -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
- is_internal: boolean;
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: (typeof FrequencyType)[keyof typeof FrequencyType];
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 {
@@ -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;
@@ -1,6 +1,6 @@
1
1
  declare module './RouteJob.js' {
2
2
  interface RouteJob {
3
- time_created: number;
3
+ time_created: number | null;
4
4
  route_id: string;
5
5
  job_id: string;
6
6
  id: string;
@@ -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
- tasks: string[];
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?: string | null;
16
+ current_route_id: string | null;
14
17
  breaks: Break[];
15
18
  }
16
19
  }
@@ -2,6 +2,6 @@ export interface Skill {
2
2
  id: string;
3
3
  name: string;
4
4
  company_id: string;
5
- time_created: number;
6
- time_updated: number;
5
+ time_created: number | null;
6
+ time_updated: number | null;
7
7
  }
@@ -1,8 +1,10 @@
1
+ import type { NotificationLevel } from './UserCompanyAssociation.js';
1
2
  export interface Subscription {
2
- time_created: number;
3
- time_updated: string;
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: number;
9
+ notifications: NotificationLevel[];
8
10
  }
@@ -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
- events: _Event[];
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`. It grows with time while nothing
50
- * in the database changes, so no realtime event refreshes it:
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 | null;
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
  /**