repzo 1.0.23 → 1.0.25
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/changelog.md +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +17 -0
- package/lib/types/index.d.ts +228 -0
- package/package.json +1 -1
- package/src/index.ts +39 -1
- package/src/types/index.ts +354 -1
package/changelog.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -181,6 +181,11 @@ export default class Repzo {
|
|
|
181
181
|
update: (id: Service.CustomStatus.Update.ID, body: Service.CustomStatus.Update.Body) => Promise<Service.CustomStatus.Update.Result>;
|
|
182
182
|
remove: (id: Service.CustomStatus.Remove.ID) => Promise<Service.CustomStatus.Remove.Result>;
|
|
183
183
|
};
|
|
184
|
+
workorder: {
|
|
185
|
+
_path: string;
|
|
186
|
+
find: (params?: Service.Workorder.Find.Params) => Promise<Service.Workorder.Find.Result>;
|
|
187
|
+
get: (id: Service.Workorder.Get.ID, params?: Service.Workorder.Get.Params) => Promise<Service.Workorder.Get.Result>;
|
|
188
|
+
};
|
|
184
189
|
invoice: {
|
|
185
190
|
_path: string;
|
|
186
191
|
find: (params?: Service.FullInvoice.Find.Params) => Promise<Service.FullInvoice.Find.Result>;
|
|
@@ -309,4 +314,8 @@ export default class Repzo {
|
|
|
309
314
|
create: (body: Service.PatchAction.Create.Body, params?: Service.PatchAction.Create.Params) => Promise<Service.PatchAction.Create.Result>;
|
|
310
315
|
update: (body: Service.PatchAction.Update.Body) => Promise<Service.PatchAction.Update.Result>;
|
|
311
316
|
};
|
|
317
|
+
updateIntegrationMeta: {
|
|
318
|
+
_path: string;
|
|
319
|
+
create: (body: Service.UpdateIntegrationMeta.Create.Body, params?: Service.UpdateIntegrationMeta.Create.Params) => Promise<Service.UpdateIntegrationMeta.Create.Result>;
|
|
320
|
+
};
|
|
312
321
|
}
|
package/lib/index.js
CHANGED
|
@@ -478,6 +478,16 @@ export default class Repzo {
|
|
|
478
478
|
return res;
|
|
479
479
|
},
|
|
480
480
|
};
|
|
481
|
+
this.workorder = {
|
|
482
|
+
_path: "/workorder",
|
|
483
|
+
find: async (params) => {
|
|
484
|
+
let res = await this._fetch(this.svAPIEndpoint, this.workorder._path, params);
|
|
485
|
+
return res;
|
|
486
|
+
},
|
|
487
|
+
get: async (id, params) => {
|
|
488
|
+
return await this._fetch(this.svAPIEndpoint, this.workorder._path + `/${id}`, params);
|
|
489
|
+
},
|
|
490
|
+
};
|
|
481
491
|
this.invoice = {
|
|
482
492
|
_path: "/fullinvoices",
|
|
483
493
|
find: async (params) => {
|
|
@@ -625,6 +635,13 @@ export default class Repzo {
|
|
|
625
635
|
return res;
|
|
626
636
|
},
|
|
627
637
|
};
|
|
638
|
+
this.updateIntegrationMeta = {
|
|
639
|
+
_path: "/update-integration-meta",
|
|
640
|
+
create: async (body, params) => {
|
|
641
|
+
let res = await this._create(this.svAPIEndpoint, this.updateIntegrationMeta._path, body, params);
|
|
642
|
+
return res;
|
|
643
|
+
},
|
|
644
|
+
};
|
|
628
645
|
this.svAPIEndpoint =
|
|
629
646
|
!options?.env || options?.env == "production"
|
|
630
647
|
? "https://sv.api.repzo.me"
|
package/lib/types/index.d.ts
CHANGED
|
@@ -71,12 +71,57 @@ interface Check {
|
|
|
71
71
|
};
|
|
72
72
|
disabled?: boolean;
|
|
73
73
|
}
|
|
74
|
+
interface AssetUnitsPopulated {
|
|
75
|
+
name: string;
|
|
76
|
+
cover_photo: MediaPopulated;
|
|
77
|
+
}
|
|
78
|
+
interface AssetsPopulated {
|
|
79
|
+
name: string;
|
|
80
|
+
cover_photo: MediaPopulated;
|
|
81
|
+
}
|
|
82
|
+
interface RepresentativesPopulated {
|
|
83
|
+
name: string;
|
|
84
|
+
_id: string;
|
|
85
|
+
}
|
|
86
|
+
interface ClientLocationPopulated {
|
|
87
|
+
name: string;
|
|
88
|
+
}
|
|
89
|
+
interface FormPopulated {
|
|
90
|
+
name: string;
|
|
91
|
+
}
|
|
92
|
+
interface thumbnailStoragePopulated {
|
|
93
|
+
_id: string;
|
|
94
|
+
createdAt: string;
|
|
95
|
+
ContentType: string;
|
|
96
|
+
mime_type: string;
|
|
97
|
+
publicUrl: string;
|
|
98
|
+
type_name: "FileAttachment" | "ImageAttachment";
|
|
99
|
+
file_name: string;
|
|
100
|
+
media_id: string;
|
|
101
|
+
media_type: "csv" | "json" | "image" | "pdf" | " ppt" | "pptx" | "xls" | "xlsx" | "doc" | "docx" | " images" | "zip";
|
|
102
|
+
}
|
|
103
|
+
interface MediaPopulated {
|
|
104
|
+
_id: string;
|
|
105
|
+
media_type: "csv" | "json" | "image" | "pdf" | " ppt" | "pptx" | "xls" | "xlsx" | "doc" | "docx" | " images" | "zip";
|
|
106
|
+
mime_type: string;
|
|
107
|
+
publicUrl: string;
|
|
108
|
+
file_name: string;
|
|
109
|
+
type_name: "FileAttachment" | "ImageAttachment";
|
|
110
|
+
media_id: string;
|
|
111
|
+
ContentType: string;
|
|
112
|
+
createdAt: string;
|
|
113
|
+
updatedAt: string;
|
|
114
|
+
thumbnails: thumbnailStoragePopulated;
|
|
115
|
+
}
|
|
74
116
|
export interface DefaultPaginationQueryParams {
|
|
75
117
|
per_page?: number;
|
|
76
118
|
page?: number;
|
|
77
119
|
sort?: string;
|
|
78
120
|
sortPageOrder?: "asc" | "dsc";
|
|
79
121
|
}
|
|
122
|
+
interface WorkorderCategoryPopulated {
|
|
123
|
+
name: string;
|
|
124
|
+
}
|
|
80
125
|
export interface DefaultPaginationResult {
|
|
81
126
|
total_result: number;
|
|
82
127
|
current_count: number;
|
|
@@ -90,6 +135,64 @@ export interface DefaultPaginationResult {
|
|
|
90
135
|
path: string;
|
|
91
136
|
data: any[];
|
|
92
137
|
}
|
|
138
|
+
export interface List {
|
|
139
|
+
client: string | {
|
|
140
|
+
_id: string;
|
|
141
|
+
};
|
|
142
|
+
note?: string;
|
|
143
|
+
route?: string;
|
|
144
|
+
calendar: string;
|
|
145
|
+
}
|
|
146
|
+
export interface Build {
|
|
147
|
+
day: string;
|
|
148
|
+
list: List[];
|
|
149
|
+
start_date?: number | undefined;
|
|
150
|
+
}
|
|
151
|
+
export type Calendar = CalendarWeekly | CalendarWeeklyGroup;
|
|
152
|
+
export interface Route {
|
|
153
|
+
disabled: boolean;
|
|
154
|
+
list: List[];
|
|
155
|
+
_id: string;
|
|
156
|
+
}
|
|
157
|
+
export type Priority = 0 | 1 | 2 | 3;
|
|
158
|
+
export type WorkorderStatus = "open" | "done" | "cancelled" | "inprogress" | "onhold";
|
|
159
|
+
export type Priority_human = "none" | "low" | "medium" | "high";
|
|
160
|
+
export type Day = "Sun" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | string;
|
|
161
|
+
export interface WeeklyDetails {
|
|
162
|
+
every: number;
|
|
163
|
+
days: Day[];
|
|
164
|
+
}
|
|
165
|
+
export interface CalendarWeekly {
|
|
166
|
+
type: "weekly";
|
|
167
|
+
disabled: boolean;
|
|
168
|
+
startsAt: string;
|
|
169
|
+
endsAt: string;
|
|
170
|
+
details: WeeklyDetails;
|
|
171
|
+
occurrences: number;
|
|
172
|
+
routes: Route[];
|
|
173
|
+
clients: string[] | string;
|
|
174
|
+
note?: string;
|
|
175
|
+
_id: string;
|
|
176
|
+
}
|
|
177
|
+
export interface DaysGroup {
|
|
178
|
+
days: Day[];
|
|
179
|
+
}
|
|
180
|
+
export interface WeeklyGroupDetails {
|
|
181
|
+
daysGroups: DaysGroup[];
|
|
182
|
+
groupSize: number;
|
|
183
|
+
}
|
|
184
|
+
export interface CalendarWeeklyGroup {
|
|
185
|
+
type: "weeklyGroup";
|
|
186
|
+
disabled: boolean;
|
|
187
|
+
startsAt: string;
|
|
188
|
+
endsAt: string;
|
|
189
|
+
details: WeeklyGroupDetails;
|
|
190
|
+
occurrences: number;
|
|
191
|
+
routes: Route[];
|
|
192
|
+
clients: string[] | string;
|
|
193
|
+
note?: string;
|
|
194
|
+
_id: string;
|
|
195
|
+
}
|
|
93
196
|
export declare namespace Service {
|
|
94
197
|
namespace Client {
|
|
95
198
|
interface Financials {
|
|
@@ -2331,6 +2434,111 @@ export declare namespace Service {
|
|
|
2331
2434
|
}
|
|
2332
2435
|
export {};
|
|
2333
2436
|
}
|
|
2437
|
+
namespace Workorder {
|
|
2438
|
+
export interface WorkorderSchema {
|
|
2439
|
+
_id: string;
|
|
2440
|
+
creator?: AdminCreator | RepCreator | ClientCreator;
|
|
2441
|
+
editor?: AdminCreator | RepCreator | ClientCreator;
|
|
2442
|
+
name?: string;
|
|
2443
|
+
local_name?: string;
|
|
2444
|
+
description?: string;
|
|
2445
|
+
disabled: boolean;
|
|
2446
|
+
integration_meta?: {
|
|
2447
|
+
[key: string]: any;
|
|
2448
|
+
};
|
|
2449
|
+
status: WorkorderStatus;
|
|
2450
|
+
assets?: string[];
|
|
2451
|
+
asset_units?: string[];
|
|
2452
|
+
workorder_categories: string[];
|
|
2453
|
+
due_date?: number;
|
|
2454
|
+
start_date?: number;
|
|
2455
|
+
client_location: string;
|
|
2456
|
+
priority?: Priority;
|
|
2457
|
+
priority_human?: Priority_human;
|
|
2458
|
+
client: string;
|
|
2459
|
+
client_name: string;
|
|
2460
|
+
workorder_request?: string;
|
|
2461
|
+
createdAt?: Date;
|
|
2462
|
+
updatedAt?: Date;
|
|
2463
|
+
company_namespace: string[];
|
|
2464
|
+
serial_number?: SerialNumber;
|
|
2465
|
+
assigned_to?: string[];
|
|
2466
|
+
forms?: string[];
|
|
2467
|
+
time: number;
|
|
2468
|
+
is_overdue: boolean;
|
|
2469
|
+
opened_at: number;
|
|
2470
|
+
done_at: number;
|
|
2471
|
+
cancelled_at: number;
|
|
2472
|
+
inprogress_at: number;
|
|
2473
|
+
done_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2474
|
+
cancelled_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2475
|
+
opened_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2476
|
+
inprogress_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2477
|
+
build: Build[];
|
|
2478
|
+
calendars: Calendar[];
|
|
2479
|
+
builtAt: number;
|
|
2480
|
+
due_date_day: string;
|
|
2481
|
+
last_done_at: number;
|
|
2482
|
+
last_done_by: AdminCreator | RepCreator | ClientCreator;
|
|
2483
|
+
resolve_time: number;
|
|
2484
|
+
sync_id: string;
|
|
2485
|
+
startsAt: string;
|
|
2486
|
+
endsAt: string;
|
|
2487
|
+
teams_populated?: Pick<Team.TeamSchema, "name">;
|
|
2488
|
+
client_populated?: Pick<Client.ClientSchema, "client_code" | "name">;
|
|
2489
|
+
asset_units_populated?: AssetUnitsPopulated[];
|
|
2490
|
+
assets_populated?: AssetsPopulated[];
|
|
2491
|
+
assigned_to_populated?: RepresentativesPopulated;
|
|
2492
|
+
client_location_populated?: ClientLocationPopulated;
|
|
2493
|
+
workorder_categories_populated?: WorkorderCategoryPopulated[];
|
|
2494
|
+
forms_populated?: FormPopulated[];
|
|
2495
|
+
media_populated?: MediaPopulated;
|
|
2496
|
+
cover_photo_populated?: MediaPopulated;
|
|
2497
|
+
}
|
|
2498
|
+
type SortingKeys = "due_date" | "priority" | "updatedAt" | "createdAt" | "from_updatedAt" | "to_updatedAt" | "_id";
|
|
2499
|
+
type PopulatedKeys = "client" | "asset_units" | "assets" | "assigned_to" | "client_location" | "workorder_categories" | "forms" | "media" | "cover_photo" | "teams";
|
|
2500
|
+
export namespace Find {
|
|
2501
|
+
type Params = DefaultPaginationQueryParams & {
|
|
2502
|
+
name?: string;
|
|
2503
|
+
_id?: string;
|
|
2504
|
+
assigned_to?: string[];
|
|
2505
|
+
priority?: Priority;
|
|
2506
|
+
priority_human?: Priority_human;
|
|
2507
|
+
status?: WorkorderStatus;
|
|
2508
|
+
workorder_categories?: string[];
|
|
2509
|
+
client_location?: string;
|
|
2510
|
+
client?: string;
|
|
2511
|
+
assets?: string[];
|
|
2512
|
+
asset_units?: string[];
|
|
2513
|
+
due_date?: number;
|
|
2514
|
+
start_date?: number;
|
|
2515
|
+
forms?: string[];
|
|
2516
|
+
from_createdAt?: number;
|
|
2517
|
+
to_createdAt?: number;
|
|
2518
|
+
from_updatedAt?: number;
|
|
2519
|
+
to_updatedAt?: number;
|
|
2520
|
+
from_start_date?: number;
|
|
2521
|
+
to_start_date?: number;
|
|
2522
|
+
from_due_date?: number;
|
|
2523
|
+
to_due_date?: number;
|
|
2524
|
+
teams?: string[];
|
|
2525
|
+
};
|
|
2526
|
+
interface Result extends DefaultPaginationResult {
|
|
2527
|
+
data: WorkorderSchema[];
|
|
2528
|
+
absolute_total: number;
|
|
2529
|
+
page_total: number;
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
export namespace Get {
|
|
2533
|
+
type ID = string;
|
|
2534
|
+
interface Params {
|
|
2535
|
+
populatedKeys?: PopulatedKeys[];
|
|
2536
|
+
sortPage?: SortingKeys;
|
|
2537
|
+
}
|
|
2538
|
+
type Result = WorkorderSchema;
|
|
2539
|
+
}
|
|
2540
|
+
export {};
|
|
2541
|
+
}
|
|
2334
2542
|
namespace FullInvoice {
|
|
2335
2543
|
export interface InvoiceSchema {
|
|
2336
2544
|
_id: string;
|
|
@@ -4346,6 +4554,26 @@ export declare namespace Service {
|
|
|
4346
4554
|
}
|
|
4347
4555
|
export {};
|
|
4348
4556
|
}
|
|
4557
|
+
namespace UpdateIntegrationMeta {
|
|
4558
|
+
namespace Create {
|
|
4559
|
+
type Params = DefaultPaginationQueryParams & {
|
|
4560
|
+
_id: string;
|
|
4561
|
+
type: string;
|
|
4562
|
+
};
|
|
4563
|
+
type Body = {
|
|
4564
|
+
key: string;
|
|
4565
|
+
value: any;
|
|
4566
|
+
}[] | {
|
|
4567
|
+
integration_meta_keys: {
|
|
4568
|
+
key: string;
|
|
4569
|
+
value: any;
|
|
4570
|
+
}[];
|
|
4571
|
+
};
|
|
4572
|
+
interface Result {
|
|
4573
|
+
[key: string]: any;
|
|
4574
|
+
}
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
4349
4577
|
}
|
|
4350
4578
|
export type StringId = string;
|
|
4351
4579
|
export type NameSpaces = string[];
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1236,7 +1236,29 @@ export default class Repzo {
|
|
|
1236
1236
|
return res;
|
|
1237
1237
|
},
|
|
1238
1238
|
};
|
|
1239
|
-
|
|
1239
|
+
workorder = {
|
|
1240
|
+
_path: "/workorder",
|
|
1241
|
+
find: async (
|
|
1242
|
+
params?: Service.Workorder.Find.Params
|
|
1243
|
+
): Promise<Service.Workorder.Find.Result> => {
|
|
1244
|
+
let res: Service.Workorder.Find.Result = await this._fetch(
|
|
1245
|
+
this.svAPIEndpoint,
|
|
1246
|
+
this.workorder._path,
|
|
1247
|
+
params
|
|
1248
|
+
);
|
|
1249
|
+
return res;
|
|
1250
|
+
},
|
|
1251
|
+
get: async (
|
|
1252
|
+
id: Service.Workorder.Get.ID,
|
|
1253
|
+
params?: Service.Workorder.Get.Params
|
|
1254
|
+
): Promise<Service.Workorder.Get.Result> => {
|
|
1255
|
+
return await this._fetch(
|
|
1256
|
+
this.svAPIEndpoint,
|
|
1257
|
+
this.workorder._path + `/${id}`,
|
|
1258
|
+
params
|
|
1259
|
+
);
|
|
1260
|
+
},
|
|
1261
|
+
};
|
|
1240
1262
|
invoice = {
|
|
1241
1263
|
_path: "/fullinvoices",
|
|
1242
1264
|
find: async (
|
|
@@ -1934,4 +1956,20 @@ export default class Repzo {
|
|
|
1934
1956
|
return res;
|
|
1935
1957
|
},
|
|
1936
1958
|
};
|
|
1959
|
+
|
|
1960
|
+
updateIntegrationMeta = {
|
|
1961
|
+
_path: "/update-integration-meta",
|
|
1962
|
+
create: async (
|
|
1963
|
+
body: Service.UpdateIntegrationMeta.Create.Body,
|
|
1964
|
+
params?: Service.UpdateIntegrationMeta.Create.Params
|
|
1965
|
+
): Promise<Service.UpdateIntegrationMeta.Create.Result> => {
|
|
1966
|
+
let res = await this._create(
|
|
1967
|
+
this.svAPIEndpoint,
|
|
1968
|
+
this.updateIntegrationMeta._path,
|
|
1969
|
+
body,
|
|
1970
|
+
params
|
|
1971
|
+
);
|
|
1972
|
+
return res;
|
|
1973
|
+
},
|
|
1974
|
+
};
|
|
1937
1975
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -72,13 +72,82 @@ interface Check {
|
|
|
72
72
|
disabled?: boolean;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
interface AssetUnitsPopulated {
|
|
76
|
+
name: string;
|
|
77
|
+
cover_photo: MediaPopulated;
|
|
78
|
+
}
|
|
79
|
+
interface AssetsPopulated {
|
|
80
|
+
name: string;
|
|
81
|
+
cover_photo: MediaPopulated;
|
|
82
|
+
}
|
|
83
|
+
interface RepresentativesPopulated {
|
|
84
|
+
name: string;
|
|
85
|
+
_id: string;
|
|
86
|
+
}
|
|
87
|
+
interface ClientLocationPopulated {
|
|
88
|
+
name: string;
|
|
89
|
+
}
|
|
90
|
+
interface FormPopulated {
|
|
91
|
+
name: string;
|
|
92
|
+
}
|
|
93
|
+
interface thumbnailStoragePopulated {
|
|
94
|
+
_id: string;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
ContentType: string;
|
|
97
|
+
mime_type: string;
|
|
98
|
+
publicUrl: string;
|
|
99
|
+
type_name: "FileAttachment" | "ImageAttachment";
|
|
100
|
+
file_name: string;
|
|
101
|
+
media_id: string;
|
|
102
|
+
media_type:
|
|
103
|
+
| "csv"
|
|
104
|
+
| "json"
|
|
105
|
+
| "image"
|
|
106
|
+
| "pdf"
|
|
107
|
+
| " ppt"
|
|
108
|
+
| "pptx"
|
|
109
|
+
| "xls"
|
|
110
|
+
| "xlsx"
|
|
111
|
+
| "doc"
|
|
112
|
+
| "docx"
|
|
113
|
+
| " images"
|
|
114
|
+
| "zip";
|
|
115
|
+
}
|
|
116
|
+
interface MediaPopulated {
|
|
117
|
+
_id: string;
|
|
118
|
+
media_type:
|
|
119
|
+
| "csv"
|
|
120
|
+
| "json"
|
|
121
|
+
| "image"
|
|
122
|
+
| "pdf"
|
|
123
|
+
| " ppt"
|
|
124
|
+
| "pptx"
|
|
125
|
+
| "xls"
|
|
126
|
+
| "xlsx"
|
|
127
|
+
| "doc"
|
|
128
|
+
| "docx"
|
|
129
|
+
| " images"
|
|
130
|
+
| "zip";
|
|
131
|
+
mime_type: string;
|
|
132
|
+
publicUrl: string;
|
|
133
|
+
file_name: string;
|
|
134
|
+
type_name: "FileAttachment" | "ImageAttachment";
|
|
135
|
+
media_id: string;
|
|
136
|
+
ContentType: string;
|
|
137
|
+
createdAt: string;
|
|
138
|
+
updatedAt: string;
|
|
139
|
+
thumbnails: thumbnailStoragePopulated;
|
|
140
|
+
}
|
|
141
|
+
|
|
75
142
|
export interface DefaultPaginationQueryParams {
|
|
76
143
|
per_page?: number;
|
|
77
144
|
page?: number;
|
|
78
145
|
sort?: string;
|
|
79
146
|
sortPageOrder?: "asc" | "dsc";
|
|
80
147
|
}
|
|
81
|
-
|
|
148
|
+
interface WorkorderCategoryPopulated {
|
|
149
|
+
name: string;
|
|
150
|
+
}
|
|
82
151
|
export interface DefaultPaginationResult {
|
|
83
152
|
total_result: number;
|
|
84
153
|
current_count: number;
|
|
@@ -92,6 +161,76 @@ export interface DefaultPaginationResult {
|
|
|
92
161
|
path: string;
|
|
93
162
|
data: any[];
|
|
94
163
|
}
|
|
164
|
+
export interface List {
|
|
165
|
+
client: string | { _id: string };
|
|
166
|
+
note?: string;
|
|
167
|
+
route?: string;
|
|
168
|
+
calendar: string;
|
|
169
|
+
}
|
|
170
|
+
export interface Build {
|
|
171
|
+
day: string;
|
|
172
|
+
list: List[];
|
|
173
|
+
start_date?: number | undefined;
|
|
174
|
+
}
|
|
175
|
+
export type Calendar = CalendarWeekly | CalendarWeeklyGroup;
|
|
176
|
+
export interface Route {
|
|
177
|
+
disabled: boolean;
|
|
178
|
+
list: List[];
|
|
179
|
+
_id: string;
|
|
180
|
+
}
|
|
181
|
+
export type Priority = 0 | 1 | 2 | 3;
|
|
182
|
+
export type WorkorderStatus =
|
|
183
|
+
| "open"
|
|
184
|
+
| "done"
|
|
185
|
+
| "cancelled"
|
|
186
|
+
| "inprogress"
|
|
187
|
+
| "onhold";
|
|
188
|
+
|
|
189
|
+
export type Priority_human = "none" | "low" | "medium" | "high";
|
|
190
|
+
export type Day =
|
|
191
|
+
| "Sun"
|
|
192
|
+
| "Mon"
|
|
193
|
+
| "Tue"
|
|
194
|
+
| "Wed"
|
|
195
|
+
| "Thu"
|
|
196
|
+
| "Fri"
|
|
197
|
+
| "Sat"
|
|
198
|
+
| string;
|
|
199
|
+
export interface WeeklyDetails {
|
|
200
|
+
every: number;
|
|
201
|
+
days: Day[];
|
|
202
|
+
}
|
|
203
|
+
export interface CalendarWeekly {
|
|
204
|
+
type: "weekly";
|
|
205
|
+
disabled: boolean;
|
|
206
|
+
startsAt: string;
|
|
207
|
+
endsAt: string;
|
|
208
|
+
details: WeeklyDetails;
|
|
209
|
+
occurrences: number;
|
|
210
|
+
routes: Route[];
|
|
211
|
+
clients: string[] | string;
|
|
212
|
+
note?: string;
|
|
213
|
+
_id: string;
|
|
214
|
+
}
|
|
215
|
+
export interface DaysGroup {
|
|
216
|
+
days: Day[];
|
|
217
|
+
}
|
|
218
|
+
export interface WeeklyGroupDetails {
|
|
219
|
+
daysGroups: DaysGroup[];
|
|
220
|
+
groupSize: number;
|
|
221
|
+
}
|
|
222
|
+
export interface CalendarWeeklyGroup {
|
|
223
|
+
type: "weeklyGroup";
|
|
224
|
+
disabled: boolean;
|
|
225
|
+
startsAt: string;
|
|
226
|
+
endsAt: string;
|
|
227
|
+
details: WeeklyGroupDetails;
|
|
228
|
+
occurrences: number;
|
|
229
|
+
routes: Route[];
|
|
230
|
+
clients: string[] | string;
|
|
231
|
+
note?: string;
|
|
232
|
+
_id: string;
|
|
233
|
+
}
|
|
95
234
|
|
|
96
235
|
// <reference path = "vehicle.ts" />
|
|
97
236
|
export namespace Service {
|
|
@@ -2459,6 +2598,205 @@ export namespace Service {
|
|
|
2459
2598
|
}
|
|
2460
2599
|
}
|
|
2461
2600
|
|
|
2601
|
+
export namespace Workorder {
|
|
2602
|
+
export interface WorkorderSchema {
|
|
2603
|
+
_id: string;
|
|
2604
|
+
creator?: AdminCreator | RepCreator | ClientCreator;
|
|
2605
|
+
editor?: AdminCreator | RepCreator | ClientCreator;
|
|
2606
|
+
name?: string;
|
|
2607
|
+
local_name?: string;
|
|
2608
|
+
description?: string;
|
|
2609
|
+
disabled: boolean;
|
|
2610
|
+
integration_meta?: { [key: string]: any };
|
|
2611
|
+
status: WorkorderStatus;
|
|
2612
|
+
assets?: string[];
|
|
2613
|
+
asset_units?: string[];
|
|
2614
|
+
workorder_categories: string[];
|
|
2615
|
+
due_date?: number;
|
|
2616
|
+
start_date?: number;
|
|
2617
|
+
client_location: string;
|
|
2618
|
+
priority?: Priority;
|
|
2619
|
+
priority_human?: Priority_human;
|
|
2620
|
+
client: string;
|
|
2621
|
+
client_name: string;
|
|
2622
|
+
workorder_request?: string;
|
|
2623
|
+
createdAt?: Date;
|
|
2624
|
+
updatedAt?: Date;
|
|
2625
|
+
company_namespace: string[];
|
|
2626
|
+
serial_number?: SerialNumber;
|
|
2627
|
+
assigned_to?: string[];
|
|
2628
|
+
forms?: string[];
|
|
2629
|
+
time: number;
|
|
2630
|
+
is_overdue: boolean;
|
|
2631
|
+
opened_at: number;
|
|
2632
|
+
done_at: number;
|
|
2633
|
+
cancelled_at: number;
|
|
2634
|
+
inprogress_at: number;
|
|
2635
|
+
done_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2636
|
+
cancelled_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2637
|
+
opened_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2638
|
+
inprogress_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2639
|
+
build: Build[];
|
|
2640
|
+
calendars: Calendar[];
|
|
2641
|
+
builtAt: number;
|
|
2642
|
+
due_date_day: string;
|
|
2643
|
+
last_done_at: number;
|
|
2644
|
+
last_done_by: AdminCreator | RepCreator | ClientCreator;
|
|
2645
|
+
resolve_time: number;
|
|
2646
|
+
sync_id: string;
|
|
2647
|
+
startsAt: string;
|
|
2648
|
+
endsAt: string;
|
|
2649
|
+
teams_populated?: Pick<Team.TeamSchema, "name">;
|
|
2650
|
+
client_populated?: Pick<Client.ClientSchema, "client_code" | "name">;
|
|
2651
|
+
asset_units_populated?: AssetUnitsPopulated[];
|
|
2652
|
+
assets_populated?: AssetsPopulated[];
|
|
2653
|
+
assigned_to_populated?: RepresentativesPopulated;
|
|
2654
|
+
client_location_populated?: ClientLocationPopulated;
|
|
2655
|
+
workorder_categories_populated?: WorkorderCategoryPopulated[];
|
|
2656
|
+
forms_populated?: FormPopulated[];
|
|
2657
|
+
media_populated?: MediaPopulated;
|
|
2658
|
+
cover_photo_populated?: MediaPopulated;
|
|
2659
|
+
}
|
|
2660
|
+
interface CreateBody {
|
|
2661
|
+
company_namespace: string[];
|
|
2662
|
+
creator?: AdminCreator | RepCreator | ClientCreator;
|
|
2663
|
+
name: string;
|
|
2664
|
+
local_name?: string;
|
|
2665
|
+
description?: string;
|
|
2666
|
+
disabled?: boolean;
|
|
2667
|
+
integration_meta?: { [key: string]: any };
|
|
2668
|
+
status: WorkorderStatus;
|
|
2669
|
+
assets?: string[];
|
|
2670
|
+
asset_units?: string[];
|
|
2671
|
+
workorder_categories: string[];
|
|
2672
|
+
due_date?: number;
|
|
2673
|
+
start_date?: number;
|
|
2674
|
+
client_location: string;
|
|
2675
|
+
priority?: Priority;
|
|
2676
|
+
priority_human?: Priority_human;
|
|
2677
|
+
client: string;
|
|
2678
|
+
client_name?: string;
|
|
2679
|
+
serial_number?: SerialNumber;
|
|
2680
|
+
workorder_request?: string;
|
|
2681
|
+
assigned_to?: string[];
|
|
2682
|
+
forms?: string[];
|
|
2683
|
+
calendars: Calendar[];
|
|
2684
|
+
parent_repeating_workorder?: string;
|
|
2685
|
+
due_date_day?: string;
|
|
2686
|
+
last_done_at: number;
|
|
2687
|
+
last_done_by: AdminCreator | RepCreator | ClientCreator;
|
|
2688
|
+
resolve_time: number;
|
|
2689
|
+
sync_id: string;
|
|
2690
|
+
opened_at: number;
|
|
2691
|
+
time: number;
|
|
2692
|
+
opened_by: AdminCreator | RepCreator | ClientCreator;
|
|
2693
|
+
}
|
|
2694
|
+
interface UpdateBody {
|
|
2695
|
+
company_namespace: string[];
|
|
2696
|
+
_id?: string;
|
|
2697
|
+
creator?: AdminCreator | RepCreator | ClientCreator;
|
|
2698
|
+
editor?: AdminCreator | RepCreator | ClientCreator;
|
|
2699
|
+
name?: string;
|
|
2700
|
+
local_name?: string;
|
|
2701
|
+
description?: string;
|
|
2702
|
+
disabled?: boolean;
|
|
2703
|
+
integration_meta?: { [key: string]: any };
|
|
2704
|
+
status: WorkorderStatus;
|
|
2705
|
+
assets?: string[];
|
|
2706
|
+
asset_units?: string[];
|
|
2707
|
+
workorder_categories: string[];
|
|
2708
|
+
due_date?: number;
|
|
2709
|
+
start_date?: number;
|
|
2710
|
+
client_location: string;
|
|
2711
|
+
priority?: Priority;
|
|
2712
|
+
priority_human?: Priority_human;
|
|
2713
|
+
client: string;
|
|
2714
|
+
client_name?: string;
|
|
2715
|
+
workorder_request?: string;
|
|
2716
|
+
createdAt?: Date;
|
|
2717
|
+
updatedAt?: Date;
|
|
2718
|
+
serial_number?: SerialNumber;
|
|
2719
|
+
assigned_to?: string[];
|
|
2720
|
+
forms?: string[];
|
|
2721
|
+
time: number;
|
|
2722
|
+
is_overdue: boolean;
|
|
2723
|
+
opened_at: number;
|
|
2724
|
+
done_at: number;
|
|
2725
|
+
cancelled_at: number;
|
|
2726
|
+
inprogress_at: number;
|
|
2727
|
+
done_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2728
|
+
cancelled_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2729
|
+
opened_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2730
|
+
inprogress_by?: AdminCreator | RepCreator | ClientCreator;
|
|
2731
|
+
calendars: Calendar[];
|
|
2732
|
+
parent_repeating_workorder?: string;
|
|
2733
|
+
due_date_day?: string;
|
|
2734
|
+
last_done_at: number;
|
|
2735
|
+
last_done_by: AdminCreator | RepCreator | ClientCreator;
|
|
2736
|
+
resolve_time: number;
|
|
2737
|
+
sync_id?: string;
|
|
2738
|
+
}
|
|
2739
|
+
type SortingKeys =
|
|
2740
|
+
| "due_date"
|
|
2741
|
+
| "priority"
|
|
2742
|
+
| "updatedAt"
|
|
2743
|
+
| "createdAt"
|
|
2744
|
+
| "from_updatedAt"
|
|
2745
|
+
| "to_updatedAt"
|
|
2746
|
+
| "_id";
|
|
2747
|
+
type PopulatedKeys =
|
|
2748
|
+
| "client"
|
|
2749
|
+
| "asset_units"
|
|
2750
|
+
| "assets"
|
|
2751
|
+
| "assigned_to"
|
|
2752
|
+
| "client_location"
|
|
2753
|
+
| "workorder_categories"
|
|
2754
|
+
| "forms"
|
|
2755
|
+
| "media"
|
|
2756
|
+
| "cover_photo"
|
|
2757
|
+
| "teams";
|
|
2758
|
+
export namespace Find {
|
|
2759
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
2760
|
+
name?: string;
|
|
2761
|
+
_id?: string;
|
|
2762
|
+
assigned_to?: string[];
|
|
2763
|
+
priority?: Priority;
|
|
2764
|
+
priority_human?: Priority_human;
|
|
2765
|
+
status?: WorkorderStatus;
|
|
2766
|
+
workorder_categories?: string[];
|
|
2767
|
+
client_location?: string;
|
|
2768
|
+
client?: string;
|
|
2769
|
+
assets?: string[];
|
|
2770
|
+
asset_units?: string[];
|
|
2771
|
+
due_date?: number;
|
|
2772
|
+
start_date?: number;
|
|
2773
|
+
forms?: string[];
|
|
2774
|
+
from_createdAt?: number;
|
|
2775
|
+
to_createdAt?: number;
|
|
2776
|
+
from_updatedAt?: number;
|
|
2777
|
+
to_updatedAt?: number;
|
|
2778
|
+
from_start_date?: number;
|
|
2779
|
+
to_start_date?: number;
|
|
2780
|
+
from_due_date?: number;
|
|
2781
|
+
to_due_date?: number;
|
|
2782
|
+
teams?: string[];
|
|
2783
|
+
};
|
|
2784
|
+
export interface Result extends DefaultPaginationResult {
|
|
2785
|
+
data: WorkorderSchema[];
|
|
2786
|
+
absolute_total: number;
|
|
2787
|
+
page_total: number;
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
export namespace Get {
|
|
2791
|
+
export type ID = string;
|
|
2792
|
+
export interface Params {
|
|
2793
|
+
populatedKeys?: PopulatedKeys[];
|
|
2794
|
+
sortPage?: SortingKeys;
|
|
2795
|
+
}
|
|
2796
|
+
export type Result = WorkorderSchema;
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2462
2800
|
export namespace FullInvoice {
|
|
2463
2801
|
export interface InvoiceSchema {
|
|
2464
2802
|
_id: string;
|
|
@@ -4459,6 +4797,21 @@ export namespace Service {
|
|
|
4459
4797
|
};
|
|
4460
4798
|
}
|
|
4461
4799
|
}
|
|
4800
|
+
|
|
4801
|
+
export namespace UpdateIntegrationMeta {
|
|
4802
|
+
export namespace Create {
|
|
4803
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
4804
|
+
_id: string;
|
|
4805
|
+
type: string;
|
|
4806
|
+
};
|
|
4807
|
+
export type Body =
|
|
4808
|
+
| { key: string; value: any }[]
|
|
4809
|
+
| { integration_meta_keys: { key: string; value: any }[] };
|
|
4810
|
+
export interface Result {
|
|
4811
|
+
[key: string]: any;
|
|
4812
|
+
}
|
|
4813
|
+
}
|
|
4814
|
+
}
|
|
4462
4815
|
}
|
|
4463
4816
|
|
|
4464
4817
|
export type StringId = string;
|