@go-avro/avro-js 0.0.42 → 0.0.44

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 (83) hide show
  1. package/dist/auth/AuthManager.d.ts +3 -3
  2. package/dist/auth/AuthManager.js +24 -24
  3. package/dist/auth/storage.d.ts +1 -1
  4. package/dist/auth/storage.js +3 -3
  5. package/dist/client/AvroQueryClientProvider.d.ts +4 -4
  6. package/dist/client/AvroQueryClientProvider.js +3 -3
  7. package/dist/client/QueryClient.d.ts +15 -15
  8. package/dist/client/QueryClient.js +239 -259
  9. package/dist/client/core/fetch.js +9 -9
  10. package/dist/client/core/utils.js +4 -4
  11. package/dist/client/core/xhr.js +21 -21
  12. package/dist/client/hooks/analytics.js +12 -12
  13. package/dist/client/hooks/avro.js +4 -4
  14. package/dist/client/hooks/bills.js +36 -39
  15. package/dist/client/hooks/catalog_items.js +25 -31
  16. package/dist/client/hooks/chats.js +6 -6
  17. package/dist/client/hooks/companies.js +45 -57
  18. package/dist/client/hooks/email.d.ts +3 -3
  19. package/dist/client/hooks/email.js +5 -5
  20. package/dist/client/hooks/events.js +71 -81
  21. package/dist/client/hooks/groups.js +25 -31
  22. package/dist/client/hooks/jobs.js +29 -34
  23. package/dist/client/hooks/labels.js +25 -31
  24. package/dist/client/hooks/messages.js +7 -7
  25. package/dist/client/hooks/months.js +21 -21
  26. package/dist/client/hooks/plans.js +4 -4
  27. package/dist/client/hooks/prepayments.js +21 -21
  28. package/dist/client/hooks/proposal.js +11 -11
  29. package/dist/client/hooks/root.js +4 -4
  30. package/dist/client/hooks/routes.js +42 -53
  31. package/dist/client/hooks/sessions.js +33 -45
  32. package/dist/client/hooks/skills.js +22 -28
  33. package/dist/client/hooks/teams.js +26 -32
  34. package/dist/client/hooks/timecards.js +13 -13
  35. package/dist/client/hooks/users.js +39 -42
  36. package/dist/client/hooks/waivers.js +23 -23
  37. package/dist/index.d.ts +38 -38
  38. package/dist/index.js +37 -37
  39. package/dist/types/api/AdditionalCharge.d.ts +2 -2
  40. package/dist/types/api/Avro.d.ts +1 -1
  41. package/dist/types/api/Bill.d.ts +4 -4
  42. package/dist/types/api/Bill.js +4 -4
  43. package/dist/types/api/BillPayment.d.ts +2 -2
  44. package/dist/types/api/BillUser.d.ts +1 -1
  45. package/dist/types/api/CatalogItem.d.ts +1 -1
  46. package/dist/types/api/Chat.d.ts +2 -2
  47. package/dist/types/api/Company.d.ts +12 -12
  48. package/dist/types/api/CustomLineItem.d.ts +2 -2
  49. package/dist/types/api/Email.d.ts +2 -2
  50. package/dist/types/api/EmailNotification.d.ts +2 -2
  51. package/dist/types/api/Group.d.ts +1 -1
  52. package/dist/types/api/Job.d.ts +6 -6
  53. package/dist/types/api/Job.js +12 -12
  54. package/dist/types/api/LineItem.d.ts +1 -1
  55. package/dist/types/api/LineItem.js +12 -12
  56. package/dist/types/api/MemberState.d.ts +1 -1
  57. package/dist/types/api/Message.d.ts +1 -1
  58. package/dist/types/api/PaymentMethod.d.ts +1 -1
  59. package/dist/types/api/PaymentOption.d.ts +1 -1
  60. package/dist/types/api/PaymentType.js +2 -2
  61. package/dist/types/api/PlanPayment.d.ts +1 -1
  62. package/dist/types/api/Prepayment.d.ts +4 -4
  63. package/dist/types/api/Prepayment.js +1 -1
  64. package/dist/types/api/Route.d.ts +2 -2
  65. package/dist/types/api/Route.js +7 -7
  66. package/dist/types/api/RouteJob.d.ts +1 -1
  67. package/dist/types/api/ServiceMonth.d.ts +2 -2
  68. package/dist/types/api/Session.d.ts +2 -2
  69. package/dist/types/api/Task.d.ts +7 -7
  70. package/dist/types/api/Task.js +20 -22
  71. package/dist/types/api/Timecard.d.ts +1 -1
  72. package/dist/types/api/Timecard.js +4 -4
  73. package/dist/types/api/TimecardAction.js +6 -6
  74. package/dist/types/api/User.d.ts +4 -4
  75. package/dist/types/api/UserCompanyAssociation.d.ts +2 -2
  76. package/dist/types/api/UserCompanyAssociation.js +45 -45
  77. package/dist/types/api/_Event.d.ts +5 -5
  78. package/dist/types/api/_Event.js +1 -1
  79. package/dist/types/api.d.ts +44 -44
  80. package/dist/types/api.js +42 -42
  81. package/dist/types/cache.d.ts +1 -1
  82. package/dist/types/client.d.ts +1 -1
  83. package/package.json +2 -1
@@ -1,15 +1,15 @@
1
- import { Bill } from "../../types/api/Bill";
2
- import { Email } from "../../types/api/Email";
3
- import { Group } from "../../types/api/Group";
4
- import { Label } from "../../types/api/Label";
5
- import { PaymentMethod } from "../../types/api/PaymentMethod";
6
- import { PaymentType } from "../../types/api/PaymentType";
7
- import { Plan } from "../../types/api/Plan";
8
- import { PlanPayment } from "../../types/api/PlanPayment";
9
- import { Session } from "../../types/api/Session";
10
- import { Skill } from "../../types/api/Skill";
11
- import { UserCompanyAssociation } from "../../types/api/UserCompanyAssociation";
12
- import { CatalogItem } from "../../types/api/CatalogItem";
1
+ import { Bill } from '../../types/api/Bill';
2
+ import { Email } from '../../types/api/Email';
3
+ import { Group } from '../../types/api/Group';
4
+ import { Label } from '../../types/api/Label';
5
+ import { PaymentMethod } from '../../types/api/PaymentMethod';
6
+ import { PaymentType } from '../../types/api/PaymentType';
7
+ import { Plan } from '../../types/api/Plan';
8
+ import { PlanPayment } from '../../types/api/PlanPayment';
9
+ import { Session } from '../../types/api/Session';
10
+ import { Skill } from '../../types/api/Skill';
11
+ import { UserCompanyAssociation } from '../../types/api/UserCompanyAssociation';
12
+ import { CatalogItem } from '../../types/api/CatalogItem';
13
13
  export interface Company {
14
14
  id: string;
15
15
  name: string;
@@ -1,4 +1,4 @@
1
- import { LineItem } from "../../types/api/LineItem";
1
+ import { LineItem } from '../../types/api/LineItem';
2
2
  export interface CustomLineItem extends LineItem {
3
- line_item_type: "CUSTOM";
3
+ line_item_type: 'CUSTOM';
4
4
  }
@@ -1,4 +1,4 @@
1
- import { User } from "../../types/api/User";
1
+ import { User } from '../../types/api/User';
2
2
  export interface Email {
3
3
  id: string;
4
4
  company_id: string;
@@ -13,7 +13,7 @@ export interface Email {
13
13
  mail_api_key: string;
14
14
  is_company_wide: boolean;
15
15
  users: User[];
16
- type: "OUTLOOK" | "SMTP" | "GMAIL";
16
+ type: 'OUTLOOK' | 'SMTP' | 'GMAIL';
17
17
  access_token?: string;
18
18
  access_token_expiry?: number;
19
19
  refresh_token?: string;
@@ -9,9 +9,9 @@
9
9
  export interface EmailError {
10
10
  code: string;
11
11
  message: string;
12
- provider: "outlook" | "gmail" | "smtp";
12
+ provider: 'outlook' | 'gmail' | 'smtp';
13
13
  }
14
- export type EmailType = "bill" | "proposal" | "job" | "generic";
14
+ export type EmailType = 'bill' | 'proposal' | 'job' | 'generic';
15
15
  export interface EmailSucceededPayload {
16
16
  request_id: string;
17
17
  email_type: EmailType;
@@ -1,4 +1,4 @@
1
- import { Permission } from "../../types/api/UserCompanyAssociation";
1
+ import { Permission } from '../../types/api/UserCompanyAssociation';
2
2
  export interface Group {
3
3
  id: string;
4
4
  name: string;
@@ -1,9 +1,9 @@
1
- import { Task } from "../../types/api/Task";
2
- import { _Event } from "../../types/api/_Event";
3
- import { RouteJob } from "../../types/api/RouteJob";
4
- import { Subscription } from "../../types/api/Subscription";
5
- import { Route } from "../../types/api/Route";
6
- declare module "../../types/api/Job" {
1
+ import { Task } from '../../types/api/Task';
2
+ import { _Event } from '../../types/api/_Event';
3
+ import { RouteJob } from '../../types/api/RouteJob';
4
+ import { Subscription } from '../../types/api/Subscription';
5
+ import { Route } from '../../types/api/Route';
6
+ declare module '../../types/api/Job' {
7
7
  interface Job {
8
8
  address: string;
9
9
  company: string;
@@ -1,5 +1,5 @@
1
- import { Task, TaskStatus } from "../../types/api/Task";
2
- import { RouteJob } from "../../types/api/RouteJob";
1
+ import { Task, TaskStatus } from '../../types/api/Task';
2
+ import { RouteJob } from '../../types/api/RouteJob';
3
3
  export class Job {
4
4
  constructor(init) {
5
5
  this.isOverdue = () => {
@@ -8,7 +8,7 @@ export class Job {
8
8
  this.getOverdueLabel = () => {
9
9
  const activeTasks = this.tasks.filter((t) => t.status === TaskStatus.ACTIVE);
10
10
  if (activeTasks.length === 0) {
11
- return "N/A";
11
+ return 'N/A';
12
12
  }
13
13
  const mostOverdueTask = activeTasks.reduce((mostOverdue, t) => {
14
14
  if (!t.overdueness || t.overdueness <= 0) {
@@ -19,7 +19,7 @@ export class Job {
19
19
  }
20
20
  return mostOverdue;
21
21
  }, activeTasks[0]);
22
- return mostOverdueTask.getOverdueLabel?.() ?? "N/A";
22
+ return mostOverdueTask.getOverdueLabel?.() ?? 'N/A';
23
23
  };
24
24
  this.portionDone = (route) => {
25
25
  if (!this.tasks || this.tasks.length === 0) {
@@ -33,7 +33,7 @@ export class Job {
33
33
  if (contextTasks.length === 0) {
34
34
  return 0;
35
35
  }
36
- return (contextTasks.filter((t) => t.isDone?.(route)).length / contextTasks.length);
36
+ return contextTasks.filter((t) => t.isDone?.(route)).length / contextTasks.length;
37
37
  };
38
38
  this.isDone = (route) => {
39
39
  return this.portionDone(route) === 1;
@@ -73,19 +73,19 @@ export class Job {
73
73
  const status = this.getStatus();
74
74
  switch (status) {
75
75
  case TaskStatus.ACTIVE:
76
- return "Active";
76
+ return 'Active';
77
77
  case TaskStatus.ARCHIVED:
78
- return "Archived";
78
+ return 'Archived';
79
79
  case TaskStatus.PENDING_CUSTOMER:
80
- return "Customer Approval";
80
+ return 'Customer Approval';
81
81
  case TaskStatus.PENDING_COMPANY:
82
- return "Company Approval";
82
+ return 'Company Approval';
83
83
  case TaskStatus.PENDING_PAYMENT:
84
- return "Awaiting Payment";
84
+ return 'Awaiting Payment';
85
85
  case TaskStatus.PENDING_ACTIVATION:
86
- return "Pending Activation";
86
+ return 'Pending Activation';
87
87
  default:
88
- return "Draft";
88
+ return 'Draft';
89
89
  }
90
90
  }
91
91
  }
@@ -16,7 +16,7 @@ export declare const LineItemType: {
16
16
  readonly PREPAYMENT: "PREPAYMENT";
17
17
  };
18
18
  export type LineItemType = (typeof LineItemType)[keyof typeof LineItemType];
19
- declare module "../../types/api/LineItem" {
19
+ declare module '../../types/api/LineItem' {
20
20
  interface LineItem {
21
21
  id: string;
22
22
  line_item_type: LineItemType;
@@ -1,18 +1,18 @@
1
1
  export const LineItemStatus = {
2
- CREATED: "CREATED",
3
- EXTERNALLY_BILLED: "EXTERNALLY_BILLED",
4
- BILLED: "BILLED",
5
- PROCESSING: "PROCESSING",
6
- EXTERNALLY_PAID: "EXTERNALLY_PAID",
7
- PREPAID: "PREPAID",
8
- PAID: "PAID",
2
+ CREATED: 'CREATED',
3
+ EXTERNALLY_BILLED: 'EXTERNALLY_BILLED',
4
+ BILLED: 'BILLED',
5
+ PROCESSING: 'PROCESSING',
6
+ EXTERNALLY_PAID: 'EXTERNALLY_PAID',
7
+ PREPAID: 'PREPAID',
8
+ PAID: 'PAID',
9
9
  };
10
10
  export const LineItemType = {
11
- CUSTOM: "CUSTOM",
12
- ADDITIONAL_CHARGE: "ADDITIONAL_CHARGE",
13
- EVENT: "EVENT",
14
- SERVICE_MONTH: "SERVICE_MONTH",
15
- PREPAYMENT: "PREPAYMENT",
11
+ CUSTOM: 'CUSTOM',
12
+ ADDITIONAL_CHARGE: 'ADDITIONAL_CHARGE',
13
+ EVENT: 'EVENT',
14
+ SERVICE_MONTH: 'SERVICE_MONTH',
15
+ PREPAYMENT: 'PREPAYMENT',
16
16
  };
17
17
  export class LineItem {
18
18
  constructor(init) {
@@ -1,4 +1,4 @@
1
- import { Friendship } from "../../types/api/Friendship";
1
+ import { Friendship } from '../../types/api/Friendship';
2
2
  export interface MemberState {
3
3
  id: string;
4
4
  state: string;
@@ -1,4 +1,4 @@
1
- import { Reaction } from "../../types/api/Reaction";
1
+ import { Reaction } from '../../types/api/Reaction';
2
2
  export interface Message {
3
3
  id: string;
4
4
  chat_id: string;
@@ -1,4 +1,4 @@
1
- import { PaymentType } from "../../types/api/PaymentType";
1
+ import { PaymentType } from '../../types/api/PaymentType';
2
2
  export interface PaymentMethod {
3
3
  allow_redisplay: string;
4
4
  autopay: boolean;
@@ -5,5 +5,5 @@ export interface PaymentOption {
5
5
  price_under_prepay?: number;
6
6
  price: number;
7
7
  recommended_prepay_count?: number;
8
- mode: "MONTH" | "SERVICE";
8
+ mode: 'MONTH' | 'SERVICE';
9
9
  }
@@ -1,5 +1,5 @@
1
1
  // eslint-disable-next-line no-redeclare
2
2
  export const PaymentType = {
3
- US_BANK_ACCOUNT: "us_bank_account",
4
- CARD: "card",
3
+ US_BANK_ACCOUNT: 'us_bank_account',
4
+ CARD: 'card',
5
5
  };
@@ -4,7 +4,7 @@ export interface PlanPayment {
4
4
  stripe_pi_id: string;
5
5
  company_id: string;
6
6
  plan_id: string;
7
- status: "created" | "processing" | "succeeded" | "failed" | "canceled";
7
+ status: 'created' | 'processing' | 'succeeded' | 'failed' | 'canceled';
8
8
  time_created: number;
9
9
  time_updated: number;
10
10
  }
@@ -1,10 +1,10 @@
1
- import { LineItem } from "../../types/api/LineItem";
2
- declare module "../../types/api/Prepayment" {
1
+ import { LineItem } from '../../types/api/LineItem';
2
+ declare module '../../types/api/Prepayment' {
3
3
  interface Prepayment extends LineItem {
4
4
  id: string;
5
5
  task_id: string | null;
6
- line_item_type: "PREPAYMENT";
7
- type: "SERVICE" | "MONTH";
6
+ line_item_type: 'PREPAYMENT';
7
+ type: 'SERVICE' | 'MONTH';
8
8
  time_updated: number | null;
9
9
  num_events: number;
10
10
  num_service_months: number;
@@ -1,4 +1,4 @@
1
- import { LineItem } from "../../types/api/LineItem";
1
+ import { LineItem } from '../../types/api/LineItem';
2
2
  export class Prepayment extends LineItem {
3
3
  constructor(init) {
4
4
  super(init);
@@ -1,4 +1,4 @@
1
- import { RouteJob } from "../../types/api/RouteJob";
1
+ import { RouteJob } from '../../types/api/RouteJob';
2
2
  export declare const FrequencyType: {
3
3
  readonly ONCE: "ONCE";
4
4
  readonly DAILY: "DAILY";
@@ -8,7 +8,7 @@ export declare const FrequencyType: {
8
8
  readonly YEARLY: "YEARLY";
9
9
  };
10
10
  export type FrequencyType = (typeof FrequencyType)[keyof typeof FrequencyType];
11
- declare module "../../types/api/Route" {
11
+ declare module '../../types/api/Route' {
12
12
  interface Route {
13
13
  company: string;
14
14
  id: string;
@@ -1,11 +1,11 @@
1
- import { RouteJob } from "../../types/api/RouteJob";
1
+ import { RouteJob } from '../../types/api/RouteJob';
2
2
  export const FrequencyType = {
3
- ONCE: "ONCE",
4
- DAILY: "DAILY",
5
- WEEKLY: "WEEKLY",
6
- BIWEEKLY: "BIWEEKLY",
7
- MONTHLY: "MONTHLY",
8
- YEARLY: "YEARLY",
3
+ ONCE: 'ONCE',
4
+ DAILY: 'DAILY',
5
+ WEEKLY: 'WEEKLY',
6
+ BIWEEKLY: 'BIWEEKLY',
7
+ MONTHLY: 'MONTHLY',
8
+ YEARLY: 'YEARLY',
9
9
  };
10
10
  export class Route {
11
11
  constructor(init) {
@@ -1,4 +1,4 @@
1
- declare module "../../types/api/RouteJob" {
1
+ declare module '../../types/api/RouteJob' {
2
2
  interface RouteJob {
3
3
  time_created: number;
4
4
  route_id: string;
@@ -1,6 +1,6 @@
1
- import { LineItem } from "../../types/api/LineItem";
1
+ import { LineItem } from '../../types/api/LineItem';
2
2
  export interface ServiceMonth extends LineItem {
3
- line_item_type: "SERVICE_MONTH";
3
+ line_item_type: 'SERVICE_MONTH';
4
4
  bill_id: string | null;
5
5
  tasks: string[];
6
6
  task_names: string[];
@@ -1,5 +1,5 @@
1
- import { Break } from "../../types/api/Break";
2
- declare module "../../types/api/Session" {
1
+ import { Break } from '../../types/api/Break';
2
+ declare module '../../types/api/Session' {
3
3
  interface Session {
4
4
  id: string;
5
5
  user_id: string;
@@ -1,8 +1,8 @@
1
- import { UserCompanyAssociation } from "../../types/api/UserCompanyAssociation";
2
- import { Prepayment } from "../../types/api/Prepayment";
3
- import { PaymentOption } from "../../types/api/PaymentOption";
4
- import { _Event } from "../../types/api/_Event";
5
- import { Route } from "../../types/api/Route";
1
+ import { UserCompanyAssociation } from '../../types/api/UserCompanyAssociation';
2
+ import { Prepayment } from '../../types/api/Prepayment';
3
+ import { PaymentOption } from '../../types/api/PaymentOption';
4
+ import { _Event } from '../../types/api/_Event';
5
+ import { Route } from '../../types/api/Route';
6
6
  export declare const TaskStatus: {
7
7
  readonly PENDING_CUSTOMER: "PENDING_CUSTOMER";
8
8
  readonly PENDING_COMPANY: "PENDING_COMPANY";
@@ -13,7 +13,7 @@ export declare const TaskStatus: {
13
13
  readonly PENDING_ACTIVATION: "PENDING_ACTIVATION";
14
14
  };
15
15
  export type TaskStatus = (typeof TaskStatus)[keyof typeof TaskStatus];
16
- declare module "../../types/api/Task" {
16
+ declare module '../../types/api/Task' {
17
17
  interface Task {
18
18
  enforce_proof_amount: boolean;
19
19
  events: _Event[];
@@ -37,7 +37,7 @@ declare module "../../types/api/Task" {
37
37
  delay: number;
38
38
  skills: string[];
39
39
  service: number;
40
- bill_mode: "MONTH" | "SERVICE" | "NONE";
40
+ bill_mode: 'MONTH' | 'SERVICE' | 'NONE';
41
41
  autobill: boolean;
42
42
  price: number;
43
43
  services_remaining: number;
@@ -1,31 +1,31 @@
1
- import { Prepayment } from "../../types/api/Prepayment";
1
+ import { Prepayment } from '../../types/api/Prepayment';
2
2
  export const TaskStatus = {
3
- PENDING_CUSTOMER: "PENDING_CUSTOMER",
4
- PENDING_COMPANY: "PENDING_COMPANY",
5
- ACTIVE: "ACTIVE",
6
- ARCHIVED: "ARCHIVED",
7
- DRAFT: "DRAFT",
8
- PENDING_PAYMENT: "PENDING_PAYMENT",
9
- PENDING_ACTIVATION: "PENDING_ACTIVATION",
3
+ PENDING_CUSTOMER: 'PENDING_CUSTOMER',
4
+ PENDING_COMPANY: 'PENDING_COMPANY',
5
+ ACTIVE: 'ACTIVE',
6
+ ARCHIVED: 'ARCHIVED',
7
+ DRAFT: 'DRAFT',
8
+ PENDING_PAYMENT: 'PENDING_PAYMENT',
9
+ PENDING_ACTIVATION: 'PENDING_ACTIVATION',
10
10
  };
11
11
  export class Task {
12
12
  constructor(init) {
13
13
  this.getStatusLabel = () => {
14
14
  switch (this.status) {
15
15
  case TaskStatus.ACTIVE:
16
- return "Active";
16
+ return 'Active';
17
17
  case TaskStatus.DRAFT:
18
- return "Draft";
18
+ return 'Draft';
19
19
  case TaskStatus.ARCHIVED:
20
- return "Archived";
20
+ return 'Archived';
21
21
  case TaskStatus.PENDING_CUSTOMER:
22
- return "Pending Customer Approval";
22
+ return 'Pending Customer Approval';
23
23
  case TaskStatus.PENDING_COMPANY:
24
- return "Pending Company Approval";
24
+ return 'Pending Company Approval';
25
25
  case TaskStatus.PENDING_PAYMENT:
26
- return "Pending Payment";
26
+ return 'Pending Payment';
27
27
  case TaskStatus.PENDING_ACTIVATION:
28
- return "Pending Activation";
28
+ return 'Pending Activation';
29
29
  default:
30
30
  return this.status;
31
31
  }
@@ -43,7 +43,7 @@ export class Task {
43
43
  return `In ${Math.abs(Math.round(this.overdue_time / 86400))}d`;
44
44
  }
45
45
  else if (this.overdue_time < 86400) {
46
- return "< 1d overdue";
46
+ return '< 1d overdue';
47
47
  }
48
48
  else {
49
49
  return `${Math.floor(this.overdue_time / 86400)}d overdue`;
@@ -51,15 +51,13 @@ export class Task {
51
51
  };
52
52
  this.getNextDue = () => {
53
53
  if (this.frequency > 0 && this.status === TaskStatus.ACTIVE) {
54
- const lastEventTime = this.last_completed_event?.time_ended ??
55
- this.activate_on ??
56
- this.time_created;
54
+ const lastEventTime = this.last_completed_event?.time_ended ?? this.activate_on ?? this.time_created;
57
55
  return lastEventTime + this.delay + this.frequency;
58
56
  }
59
57
  return null;
60
58
  };
61
59
  this.computeNextTaskState = (isCustomer, action) => {
62
- if (action === "accept") {
60
+ if (action === 'accept') {
63
61
  if (this.status === TaskStatus.PENDING_CUSTOMER ||
64
62
  this.status === TaskStatus.PENDING_COMPANY) {
65
63
  if (this.prepayments.filter((p) => !p.isPaid()).length > 0) {
@@ -71,10 +69,10 @@ export class Task {
71
69
  return TaskStatus.ACTIVE;
72
70
  }
73
71
  }
74
- else if (action === "reject") {
72
+ else if (action === 'reject') {
75
73
  return TaskStatus.ARCHIVED;
76
74
  }
77
- else if (action === "modify") {
75
+ else if (action === 'modify') {
78
76
  if (this.status === TaskStatus.PENDING_CUSTOMER && isCustomer) {
79
77
  return TaskStatus.PENDING_COMPANY;
80
78
  }
@@ -1,4 +1,4 @@
1
- import { TimecardAction } from "../../types/api/TimecardAction";
1
+ import { TimecardAction } from '../../types/api/TimecardAction';
2
2
  export declare const TimecardStatus: {
3
3
  readonly OPEN: "open";
4
4
  readonly PENDING: "pending";
@@ -1,6 +1,6 @@
1
1
  export const TimecardStatus = {
2
- OPEN: "open",
3
- PENDING: "pending",
4
- APPROVED: "approved",
5
- REJECTED: "rejected",
2
+ OPEN: 'open',
3
+ PENDING: 'pending',
4
+ APPROVED: 'approved',
5
+ REJECTED: 'rejected',
6
6
  };
@@ -1,8 +1,8 @@
1
1
  export const TimecardActionType = {
2
- CREATED: "created",
3
- SUBMITTED: "submitted",
4
- COMMENTED: "commented",
5
- APPROVED: "approved",
6
- REJECTED: "rejected",
7
- EDITED: "edited",
2
+ CREATED: 'created',
3
+ SUBMITTED: 'submitted',
4
+ COMMENTED: 'commented',
5
+ APPROVED: 'approved',
6
+ REJECTED: 'rejected',
7
+ EDITED: 'edited',
8
8
  };
@@ -1,7 +1,7 @@
1
- import { BillUser } from "../../types/api/BillUser";
2
- import { Chat } from "../../types/api/Chat";
3
- import { PaymentMethod } from "../../types/api/PaymentMethod";
4
- import { PaymentType } from "../../types/api/PaymentType";
1
+ import { BillUser } from '../../types/api/BillUser';
2
+ import { Chat } from '../../types/api/Chat';
3
+ import { PaymentMethod } from '../../types/api/PaymentMethod';
4
+ import { PaymentType } from '../../types/api/PaymentType';
5
5
  export interface User {
6
6
  id: string;
7
7
  username: string;
@@ -1,5 +1,5 @@
1
- import { User } from "../../types/api/User";
2
- import { Location } from "../../types/api";
1
+ import { User } from '../../types/api/User';
2
+ import { Location } from '../../types/api';
3
3
  export declare const Permission: {
4
4
  readonly CAN_WRITE_COMPANY: "can_write_company";
5
5
  readonly CAN_READ_GROUPS: "can_read_groups";
@@ -1,49 +1,49 @@
1
1
  export const Permission = {
2
- CAN_WRITE_COMPANY: "can_write_company",
3
- CAN_READ_GROUPS: "can_read_groups",
4
- CAN_WRITE_PROPOSALS: "can_write_proposals",
5
- CAN_READ_PROPOSALS: "can_read_proposals",
6
- CAN_WRITE_GROUPS: "can_write_groups",
7
- CAN_WRITE_ROUTES: "can_write_routes",
8
- CAN_WRITE_SUBSCRIPTIONS: "can_write_subscriptions",
9
- CAN_READ_SUBSCRIPTIONS: "can_read_subscriptions",
10
- CAN_WRITE_TEAMS: "can_write_teams",
11
- CAN_WRITE_JOBS: "can_write_jobs",
12
- CAN_WRITE_TASKS: "can_write_tasks",
13
- CAN_WRITE_ITEMS: "can_write_items",
14
- CAN_WRITE_SKILLS: "can_write_skills",
15
- CAN_WRITE_EMAILS: "can_write_emails",
16
- CAN_WRITE_OTHERS_SESSIONS: "can_write_others_sessions",
17
- CAN_READ_OTHERS_SESSIONS: "can_read_others_sessions",
18
- CAN_READ_SESSIONS: "can_read_sessions",
19
- CAN_WRITE_LABELS: "can_write_labels",
20
- CAN_READ_LABELS: "can_read_labels",
21
- CAN_READ_ROUTES: "can_read_routes",
22
- CAN_READ_TEAMS: "can_read_teams",
23
- CAN_READ_JOBS: "can_read_jobs",
24
- CAN_WRITE_EVENTS: "can_write_events",
25
- CAN_READ_TASKS: "can_read_tasks",
26
- CAN_READ_ITEMS: "can_read_items",
27
- CAN_READ_SKILLS: "can_read_skills",
28
- CAN_WRITE_SESSIONS: "can_write_sessions",
29
- CAN_READ_EMAILS: "can_read_emails",
30
- CAN_WRITE_SMS: "can_write_sms",
31
- CAN_READ_SMS: "can_read_sms",
32
- CAN_WRITE_NOTIFICATIONS: "can_write_notifications",
33
- CAN_READ_EVENTS: "can_read_events",
34
- CAN_READ_MONTHS: "can_read_months",
35
- CAN_WRITE_MONTHS: "can_write_months",
36
- CAN_WRITE_BILLS: "can_write_bills",
37
- CAN_READ_BILLS: "can_read_bills",
38
- CAN_OPTIMIZE: "can_optimize",
39
- CAN_READ_COMPANY: "can_read_company",
40
- CAN_WRITE_OTHERS_TIMECARDS: "can_write_others_timecards",
41
- CAN_READ_OTHERS_TIMECARDS: "can_read_others_timecards",
42
- CAN_WRITE_TIMECARDS: "can_write_timecards",
43
- CAN_READ_TIMECARDS: "can_read_timecards",
44
- CAN_APPROVE_TIME_OFF: "can_approve_time_off",
45
- IS_ROOT: "is_root",
46
- IS_CUSTOMER: "is_customer",
2
+ CAN_WRITE_COMPANY: 'can_write_company',
3
+ CAN_READ_GROUPS: 'can_read_groups',
4
+ CAN_WRITE_PROPOSALS: 'can_write_proposals',
5
+ CAN_READ_PROPOSALS: 'can_read_proposals',
6
+ CAN_WRITE_GROUPS: 'can_write_groups',
7
+ CAN_WRITE_ROUTES: 'can_write_routes',
8
+ CAN_WRITE_SUBSCRIPTIONS: 'can_write_subscriptions',
9
+ CAN_READ_SUBSCRIPTIONS: 'can_read_subscriptions',
10
+ CAN_WRITE_TEAMS: 'can_write_teams',
11
+ CAN_WRITE_JOBS: 'can_write_jobs',
12
+ CAN_WRITE_TASKS: 'can_write_tasks',
13
+ CAN_WRITE_ITEMS: 'can_write_items',
14
+ CAN_WRITE_SKILLS: 'can_write_skills',
15
+ CAN_WRITE_EMAILS: 'can_write_emails',
16
+ CAN_WRITE_OTHERS_SESSIONS: 'can_write_others_sessions',
17
+ CAN_READ_OTHERS_SESSIONS: 'can_read_others_sessions',
18
+ CAN_READ_SESSIONS: 'can_read_sessions',
19
+ CAN_WRITE_LABELS: 'can_write_labels',
20
+ CAN_READ_LABELS: 'can_read_labels',
21
+ CAN_READ_ROUTES: 'can_read_routes',
22
+ CAN_READ_TEAMS: 'can_read_teams',
23
+ CAN_READ_JOBS: 'can_read_jobs',
24
+ CAN_WRITE_EVENTS: 'can_write_events',
25
+ CAN_READ_TASKS: 'can_read_tasks',
26
+ CAN_READ_ITEMS: 'can_read_items',
27
+ CAN_READ_SKILLS: 'can_read_skills',
28
+ CAN_WRITE_SESSIONS: 'can_write_sessions',
29
+ CAN_READ_EMAILS: 'can_read_emails',
30
+ CAN_WRITE_SMS: 'can_write_sms',
31
+ CAN_READ_SMS: 'can_read_sms',
32
+ CAN_WRITE_NOTIFICATIONS: 'can_write_notifications',
33
+ CAN_READ_EVENTS: 'can_read_events',
34
+ CAN_READ_MONTHS: 'can_read_months',
35
+ CAN_WRITE_MONTHS: 'can_write_months',
36
+ CAN_WRITE_BILLS: 'can_write_bills',
37
+ CAN_READ_BILLS: 'can_read_bills',
38
+ CAN_OPTIMIZE: 'can_optimize',
39
+ CAN_READ_COMPANY: 'can_read_company',
40
+ CAN_WRITE_OTHERS_TIMECARDS: 'can_write_others_timecards',
41
+ CAN_READ_OTHERS_TIMECARDS: 'can_read_others_timecards',
42
+ CAN_WRITE_TIMECARDS: 'can_write_timecards',
43
+ CAN_READ_TIMECARDS: 'can_read_timecards',
44
+ CAN_APPROVE_TIME_OFF: 'can_approve_time_off',
45
+ IS_ROOT: 'is_root',
46
+ IS_CUSTOMER: 'is_customer',
47
47
  };
48
48
  export const NotificationLevel = {
49
49
  IN_APP: 0,
@@ -1,10 +1,10 @@
1
- import { LineItem } from "../../types/api/LineItem";
2
- import { AdditionalCharge } from "../../types/api/AdditionalCharge";
3
- import { UserEvent } from "../../types/api/UserEvent";
4
- declare module "../../types/api/_Event" {
1
+ import { LineItem } from '../../types/api/LineItem';
2
+ import { AdditionalCharge } from '../../types/api/AdditionalCharge';
3
+ import { UserEvent } from '../../types/api/UserEvent';
4
+ declare module '../../types/api/_Event' {
5
5
  interface _Event extends LineItem {
6
6
  breaks: string[];
7
- line_item_type: "EVENT";
7
+ line_item_type: 'EVENT';
8
8
  internal_notes: string;
9
9
  external_notes: string;
10
10
  proofs: string[];