repzo 1.0.155 → 1.0.156

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 (90) hide show
  1. package/package.json +2 -2
  2. package/src/index.ts +4890 -0
  3. package/src/oas/activity-ai-sales-order.yaml +623 -0
  4. package/src/oas/activity-feedback-v2.yaml +753 -0
  5. package/src/oas/activity-feedback.yaml +645 -0
  6. package/src/oas/activity-storecheck.yaml +379 -0
  7. package/src/oas/adjust-account.yaml +241 -0
  8. package/src/oas/adjust-inventory.yaml +133 -0
  9. package/src/oas/approval-request.yaml +211 -0
  10. package/src/oas/approvals.yaml +176 -0
  11. package/src/oas/asset-part-receival.yaml +591 -0
  12. package/src/oas/asset-part-transfer.yaml +618 -0
  13. package/src/oas/asset-part-type.yaml +383 -0
  14. package/src/oas/asset-part-unit.yaml +722 -0
  15. package/src/oas/asset-part.yaml +485 -0
  16. package/src/oas/asset-type.yaml +180 -0
  17. package/src/oas/asset-unit.yaml +705 -0
  18. package/src/oas/asset.yaml +204 -0
  19. package/src/oas/banks.yaml +168 -0
  20. package/src/oas/bankslists.yaml +168 -0
  21. package/src/oas/brand.yaml +246 -0
  22. package/src/oas/category.yaml +285 -0
  23. package/src/oas/checks.yaml +247 -0
  24. package/src/oas/client-channel.yaml +480 -0
  25. package/src/oas/client-contact.yaml +665 -0
  26. package/src/oas/client-location.yaml +687 -0
  27. package/src/oas/client.yaml +669 -0
  28. package/src/oas/contract-installment.yaml +740 -0
  29. package/src/oas/contract.yaml +210 -0
  30. package/src/oas/custom-list-item.yaml +168 -0
  31. package/src/oas/custom-list.yaml +168 -0
  32. package/src/oas/custom-status.yaml +168 -0
  33. package/src/oas/day.yaml +246 -0
  34. package/src/oas/feedback-options.yaml +802 -0
  35. package/src/oas/fullinvoices.yaml +584 -0
  36. package/src/oas/integration-action-log.yaml +361 -0
  37. package/src/oas/integration-app.yaml +303 -0
  38. package/src/oas/integration-command-log.yaml +381 -0
  39. package/src/oas/inventory-adjustment-reason.yaml +165 -0
  40. package/src/oas/inventory.yaml +64 -0
  41. package/src/oas/mail-unsubscribe.yaml +463 -0
  42. package/src/oas/measureunit-family.yaml +354 -0
  43. package/src/oas/measureunit.yaml +366 -0
  44. package/src/oas/media-storage.yaml +329 -0
  45. package/src/oas/media.yaml +472 -0
  46. package/src/oas/msl-products.yaml +180 -0
  47. package/src/oas/msl.yaml +186 -0
  48. package/src/oas/ocr-invoice-job-group.yaml +528 -0
  49. package/src/oas/ocr-invoice-job-page.yaml +602 -0
  50. package/src/oas/ocr-invoice-job-template.yaml +628 -0
  51. package/src/oas/ocr-invoice-job.yaml +603 -0
  52. package/src/oas/patch-action.yaml +421 -0
  53. package/src/oas/payment-terms.yaml +235 -0
  54. package/src/oas/payments.yaml +536 -0
  55. package/src/oas/pricelist-item.yaml +369 -0
  56. package/src/oas/pricelist.yaml +287 -0
  57. package/src/oas/product-group.yaml +278 -0
  58. package/src/oas/product-modifiers-group.yaml +524 -0
  59. package/src/oas/product.yaml +578 -0
  60. package/src/oas/proforma.yaml +180 -0
  61. package/src/oas/quick-convert-to-pdf.yaml +95 -0
  62. package/src/oas/receiving-material.yaml +336 -0
  63. package/src/oas/refund.yaml +281 -0
  64. package/src/oas/rep-balance-summary.yaml +135 -0
  65. package/src/oas/rep.yaml +1824 -0
  66. package/src/oas/return-asset-part-unit.yaml +573 -0
  67. package/src/oas/return-reason.yaml +286 -0
  68. package/src/oas/route.yaml +337 -0
  69. package/src/oas/safe-invoice-serial-counter.yaml +525 -0
  70. package/src/oas/settings.yaml +123 -0
  71. package/src/oas/settlement.yaml +505 -0
  72. package/src/oas/speciality.yaml +447 -0
  73. package/src/oas/store-asset-part-unit.yaml +658 -0
  74. package/src/oas/storecheck-template.yaml +415 -0
  75. package/src/oas/subcategory.yaml +355 -0
  76. package/src/oas/supplier.yaml +183 -0
  77. package/src/oas/svix-integration.yaml +335 -0
  78. package/src/oas/tag.yaml +272 -0
  79. package/src/oas/tax.yaml +303 -0
  80. package/src/oas/team.yaml +268 -0
  81. package/src/oas/transfer.yaml +347 -0
  82. package/src/oas/update-integration-meta.yaml +387 -0
  83. package/src/oas/variant.yaml +569 -0
  84. package/src/oas/visit.yaml +174 -0
  85. package/src/oas/warehouse.yaml +311 -0
  86. package/src/oas/workorder-category.yaml +751 -0
  87. package/src/oas/workorder-portal-link.yaml +811 -0
  88. package/src/oas/workorder-portal.yaml +650 -0
  89. package/src/oas/workorder-request.yaml +193 -0
  90. package/src/oas/workorder.yaml +204 -0
package/src/index.ts ADDED
@@ -0,0 +1,4890 @@
1
+ import axios from "axios";
2
+ import { v4 as uuid } from "uuid";
3
+ import type {
4
+ Params,
5
+ Data,
6
+ Service,
7
+ Options,
8
+ Headers,
9
+ StringId,
10
+ NameSpaces,
11
+ } from "./types/index";
12
+
13
+ export const end_points = {
14
+ CLIENT: "client",
15
+ PRODUCT: "product",
16
+ VARIANT: "variant",
17
+ CATEGORY: "product-category",
18
+ SUB_CATEGORY: "product-sub-category",
19
+ BRAND: "product-brand",
20
+ PRODUCT_GROUP: "product-group",
21
+ TAX: "tax",
22
+ MEASUREUNIT: "measureunits",
23
+ MEASUREUNIT_FAMILY: "measureunit-family",
24
+ MEDIA: "media",
25
+ PRICELIST: "pricelists",
26
+ PRICELIST_ITEM: "pricelistsitems",
27
+ TEAM: "teams",
28
+ RETURN_REASON: "return-reason",
29
+ REP: "rep",
30
+ REP_BALANCE_SUMMARY: "rep-balance-summary",
31
+ TAG: "tag",
32
+ WAREHOUSE: "warehouse",
33
+ ROUTE: "route",
34
+ PRODUCT_MODIFIERS_GROUP: "product-modifiers-group",
35
+ CHANNEL: "client-channel",
36
+ SPECIALITY: "speciality",
37
+ CLIENT_CONTACT: "client-contact",
38
+ PAYMENT_TERM: "paymentterms",
39
+ BANK: "banks",
40
+ BANK_LIST: "bankslists",
41
+ CUSTOM_STATUS: "custom-status",
42
+ CUSTOM_LIST: "custom-list",
43
+ CUSTOM_LIST_ITEM: "custom-list-item",
44
+ INVENTORY_ADJUSTMENT_REASON: "inventory-adjustment-reason",
45
+ WORKORDER: "workorder",
46
+ WORKORDER_REQUEST: "workorder-request",
47
+ SUPPLIER: "supplier",
48
+ QUICK_CONVERT_TO_PDF: "quick-convert-to-pdf",
49
+ VISIT: "visit",
50
+ INVOICE: "fullinvoices",
51
+ PROFORMA: "proforma",
52
+ PAYMENT: "payments",
53
+ REFUND: "refund",
54
+ SETTLEMENT: "settlement",
55
+ CHECK: "checks",
56
+ DAY: "day",
57
+ RECEIVING_MATERIAL: "receiving-material",
58
+ ADJUST_ACCOUNT: "adjust-account",
59
+ TRANSFER: "transfer",
60
+ MSL: "msl",
61
+ MSL_PRODUCT: "msl-products",
62
+ MEDIA_STORAGE: "media-storage",
63
+ STORECHECK_TEMPLATE: "storecheck-template",
64
+ ACTIVITY_STORECHECK: "activity-storecheck",
65
+ ADJUST_INVENTORY: "adjust-inventory",
66
+ INVENTORY: "inventory",
67
+ INTEGRATION_APP: "integration-app",
68
+ JOIN_ACTIONS_WEBHOOK: "svix-integration",
69
+ INTEGRATION_ACTION_LOG: "integration-action-log",
70
+ INTEGRATION_COMMAND_LOG: "integration-command-log",
71
+ PATCH_ACTION: "patch-action",
72
+ UPDATE_INTEGRATION_META: "update-integration-meta",
73
+ ASSET_PART_TYPE: "asset-part-type",
74
+ ASSET_PART: "asset-part",
75
+ ASSET_PART_UNIT: "asset-part-unit",
76
+ ASSET_PART_RECEIVAL: "asset-part-receival",
77
+ ASSET_PART_TRANSFER: "asset-part-transfer",
78
+ RETURN_ASSET_PART_UNIT: "return-asset-part-unit",
79
+ STORE_ASSET_PART_UNIT: "store-asset-part-unit",
80
+ OCR_INVOICE_JOB_TEMPLATE: "ocr-invoice-job-template",
81
+ OCR_INVOICE_JOB_GROUP: "ocr-invoice-job-group",
82
+ ACTIVITY_AI_SALES_ORDER: "activity-ai-sales-order",
83
+ OCR_INVOICE_JOB: "ocr-invoice-job",
84
+ OCR_INVOICE_JOB_PAGE: "ocr-invoice-job-page",
85
+ SETTINGS: "settings",
86
+ MAIL_UNSUBSCRIBE: "mail-unsubscribe",
87
+ APPROVAL_REQUEST: "approval-request",
88
+ SAFE_INVOICE_SERIAL_COUNTER: "safe-invoice-serial-counter",
89
+ CLIENT_LOCATION: "client-location",
90
+ ASSET_TYPE: "asset-type",
91
+ ASSET: "asset",
92
+ ASSET_UNIT: "asset-unit",
93
+ WORKORDER_PORTAL: "workorder-portal",
94
+ APPROVAL: "approvals",
95
+ ACTIVITY_FEEDBACK: "activity-feedback",
96
+ ACTIVITY_FEEDBACKV2: "activity-feedback-v2",
97
+ FEEDBACK_OPTION: "feedback-options",
98
+ WORKORDER_CATEGORY: "workorder-category",
99
+ CONTRACT: "contract",
100
+ CONTRACT_INSTALLMENT: "contract-installment",
101
+ WORKORDER_PORTAL_LINK: "workorder-portal-link",
102
+ CUSTOM_FIELD: "customfields",
103
+ TIMELINE_REPORT: "timeline-report",
104
+ RESET_COMPANY_NAMESPACE: "reset-company-namespace",
105
+ TEST_RESET_COMPANY_NAMESPACE: "test-reset-company-namespace",
106
+ } as const;
107
+ export type EndPoints = (typeof end_points)[keyof typeof end_points];
108
+
109
+ const availableService = [
110
+ "client",
111
+ "product",
112
+ "variant",
113
+ "category",
114
+ "sub_category",
115
+ "brand",
116
+ "product_group",
117
+ "tax",
118
+ "measureunit",
119
+ "measureunitFamily",
120
+ "media",
121
+ "priceList",
122
+ "priceListItem",
123
+ "team",
124
+ "returnReason",
125
+ "rep",
126
+ "tag",
127
+ "warehouse",
128
+ "route",
129
+ "productModifiersGroup",
130
+ "channel",
131
+ "speciality",
132
+ "clientContact",
133
+ "paymentTerm",
134
+ "bank",
135
+ "bank_list",
136
+ "customStatus",
137
+ "customList",
138
+ "customListItem",
139
+ "inventoryAdjustmentReason",
140
+ "workorder",
141
+ "workorderRequest",
142
+ "supplier",
143
+ "quickConvertToPdf",
144
+ "visit",
145
+ "activityFeedback",
146
+ "activityFeedbackV2",
147
+ "feedbackOption",
148
+ "invoice",
149
+ "proforma",
150
+ "payment",
151
+ "refund",
152
+ "settlement",
153
+ "check",
154
+ "day",
155
+ "receivingMaterial",
156
+ "adjustAccount",
157
+ "transfer",
158
+ "msl",
159
+ "mslProduct",
160
+ "mediaStorage",
161
+ "storecheckTemplate",
162
+ "activityStorecheck",
163
+ "adjustInventory",
164
+ "inventory",
165
+ "integrationApp",
166
+ "joinActionsWebHook",
167
+ "patchAction",
168
+ "updateIntegrationMeta",
169
+ "assetPartType",
170
+ "assetPart",
171
+ "assetPartUnit",
172
+ "assetPartReceival",
173
+ "assetPartTransfer",
174
+ "returnAssetPartUnit",
175
+ "storeAssetPartUnit",
176
+ "ocrInvoiceJobTemplate",
177
+ "ocrInvoiceJobGroup",
178
+ "activityAiSalesOrder",
179
+ "ocrInvoiceJob",
180
+ "ocrInvoiceJobPage",
181
+ "settings",
182
+ "mailUnsubscribe",
183
+ "approvalRequest",
184
+ "safeInvoiceSerialCounter",
185
+ "clientLocation",
186
+ "assetType",
187
+ "asset",
188
+ "assetUnit",
189
+ "workorderPortal",
190
+ "approval",
191
+ "workorderCategory",
192
+ "contract",
193
+ "contractInstallment",
194
+ "repBalanceSummary",
195
+ "workorderPortalLink",
196
+ "customField",
197
+ ] as const;
198
+ export type AvailableService = (typeof availableService)[number];
199
+
200
+ export default class Repzo {
201
+ private svAPIEndpoint: string;
202
+ headers: Headers;
203
+ private timeout: number;
204
+ constructor(apiKey: string, options?: Options) {
205
+ this.svAPIEndpoint =
206
+ !options?.env || options?.env == "production"
207
+ ? "https://sv.api.repzo.me"
208
+ : options?.env == "staging"
209
+ ? "https://staging.sv.api.repzo.me"
210
+ : options?.env == "local"
211
+ ? "http://localhost:3030"
212
+ : "";
213
+
214
+ this.headers = {
215
+ "api-key": apiKey,
216
+ "Content-Type": "application/json",
217
+ Accept: "application/json",
218
+ };
219
+ if (options?.headers) Object.assign(this.headers, options.headers);
220
+ if (options?.timeout) {
221
+ this.timeout = options.timeout;
222
+ } else {
223
+ this.timeout = 180000;
224
+ }
225
+ }
226
+
227
+ private static _end_points = end_points;
228
+ public static get END_POINTS() {
229
+ return Repzo._end_points;
230
+ }
231
+ private async _fetch(baseUrl: string, path: string, params?: Params) {
232
+ if (params) {
233
+ params = normalizeParams(params);
234
+ }
235
+ let res = await axios.get(`${baseUrl}/${path}`, {
236
+ params,
237
+ headers: this.headers,
238
+ timeout: this.timeout,
239
+ });
240
+ return res.data;
241
+ }
242
+
243
+ private async _create(
244
+ baseUrl: string,
245
+ path: string,
246
+ body: Data,
247
+ params?: Params,
248
+ ) {
249
+ let res = await axios.post(`${baseUrl}/${path}`, body, {
250
+ params,
251
+ headers: this.headers,
252
+ timeout: this.timeout,
253
+ });
254
+ return res.data;
255
+ }
256
+
257
+ private async _update(
258
+ baseUrl: string,
259
+ path: string,
260
+ body: Data,
261
+ params?: Params,
262
+ ) {
263
+ let res = await axios.put(`${baseUrl}/${path}`, body, {
264
+ params,
265
+ headers: this.headers,
266
+ timeout: this.timeout,
267
+ });
268
+ return res.data;
269
+ }
270
+
271
+ private async _patch(
272
+ baseUrl: string,
273
+ path: string,
274
+ body: Data,
275
+ params?: Params,
276
+ ) {
277
+ let res = await axios.put(`${baseUrl}/${path}`, body, {
278
+ params,
279
+ headers: this.headers,
280
+ timeout: this.timeout,
281
+ });
282
+ return res.data;
283
+ }
284
+
285
+ private async _delete(baseUrl: string, path: string, params?: Params) {
286
+ let res = await axios.delete(`${baseUrl}/${path}`, {
287
+ params,
288
+ headers: this.headers,
289
+ timeout: this.timeout,
290
+ });
291
+ return res.data;
292
+ }
293
+
294
+ available_services = availableService;
295
+
296
+ client = {
297
+ _path: Repzo._end_points.CLIENT,
298
+ find: async (
299
+ params?: Service.Client.Find.Params,
300
+ ): Promise<Service.Client.Find.Result> => {
301
+ let res: Service.Client.Find.Result = await this._fetch(
302
+ this.svAPIEndpoint,
303
+ this.client._path,
304
+ params,
305
+ );
306
+ return res;
307
+ },
308
+
309
+ get: async (
310
+ id: Service.Client.Get.ID,
311
+ params?: Service.Client.Get.Params,
312
+ ): Promise<Service.Client.Get.Result> => {
313
+ return await this._fetch(
314
+ this.svAPIEndpoint,
315
+ this.client._path + `/${id}`,
316
+ params,
317
+ );
318
+ },
319
+
320
+ create: async (
321
+ body: Service.Client.Create.Body,
322
+ ): Promise<Service.Client.Create.Result> => {
323
+ let res = await this._create(this.svAPIEndpoint, this.client._path, body);
324
+ return res;
325
+ },
326
+
327
+ update: async (
328
+ id: Service.Client.Update.ID,
329
+ body: Service.Client.Update.Body,
330
+ ): Promise<Service.Client.Update.Result> => {
331
+ let res: Service.Client.Update.Result = await this._update(
332
+ this.svAPIEndpoint,
333
+ this.client._path + `/${id}`,
334
+ body,
335
+ );
336
+ return res;
337
+ },
338
+
339
+ remove: async (
340
+ id: Service.Client.Remove.ID,
341
+ ): Promise<Service.Client.Remove.Result> => {
342
+ let res: Service.Client.Remove.Result = await this._delete(
343
+ this.svAPIEndpoint,
344
+ this.client._path + `/${id}`,
345
+ );
346
+ return res;
347
+ },
348
+ };
349
+
350
+ product = {
351
+ _path: Repzo._end_points.PRODUCT,
352
+ find: async (
353
+ params?: Service.Product.Find.Params,
354
+ ): Promise<Service.Product.Find.Result> => {
355
+ let res: Service.Product.Find.Result = await this._fetch(
356
+ this.svAPIEndpoint,
357
+ this.product._path,
358
+ params,
359
+ );
360
+ return res;
361
+ },
362
+
363
+ get: async (
364
+ id: Service.Product.Get.ID,
365
+ params?: Service.Product.Get.Params,
366
+ ): Promise<Service.Product.Get.Result> => {
367
+ return await this._fetch(
368
+ this.svAPIEndpoint,
369
+ this.product._path + `/${id}`,
370
+ params,
371
+ );
372
+ },
373
+
374
+ create: async (
375
+ body: Service.Product.Create.Body,
376
+ ): Promise<Service.Product.Create.Result> => {
377
+ let res = await this._create(
378
+ this.svAPIEndpoint,
379
+ this.product._path,
380
+ body,
381
+ );
382
+ return res;
383
+ },
384
+
385
+ update: async (
386
+ id: Service.Product.Update.ID,
387
+ body: Service.Product.Update.Body,
388
+ ): Promise<Service.Product.Update.Result> => {
389
+ let res: Service.Product.Update.Result = await this._update(
390
+ this.svAPIEndpoint,
391
+ this.product._path + `/${id}`,
392
+ body,
393
+ );
394
+ return res;
395
+ },
396
+
397
+ remove: async (
398
+ id: Service.Product.Remove.ID,
399
+ ): Promise<Service.Product.Remove.Result> => {
400
+ let res: Service.Product.Remove.Result = await this._delete(
401
+ this.svAPIEndpoint,
402
+ this.product._path + `/${id}`,
403
+ );
404
+ return res;
405
+ },
406
+ };
407
+
408
+ variant = {
409
+ _path: Repzo._end_points.VARIANT,
410
+ find: async (
411
+ params?: Service.Variant.Find.Params,
412
+ ): Promise<Service.Variant.Find.Result> => {
413
+ let res: Service.Variant.Find.Result = await this._fetch(
414
+ this.svAPIEndpoint,
415
+ this.variant._path,
416
+ params,
417
+ );
418
+ return res;
419
+ },
420
+
421
+ get: async (
422
+ id: Service.Variant.Get.ID,
423
+ params?: Service.Variant.Get.Params,
424
+ ): Promise<Service.Variant.Get.Result> => {
425
+ return await this._fetch(
426
+ this.svAPIEndpoint,
427
+ this.variant._path + `/${id}`,
428
+ params,
429
+ );
430
+ },
431
+
432
+ create: async (
433
+ body: Service.Variant.Create.Body,
434
+ ): Promise<Service.Variant.Create.Result> => {
435
+ let res = await this._create(
436
+ this.svAPIEndpoint,
437
+ this.variant._path,
438
+ body,
439
+ );
440
+ return res;
441
+ },
442
+
443
+ update: async (
444
+ id: Service.Variant.Update.ID,
445
+ body: Service.Variant.Update.Body,
446
+ ): Promise<Service.Variant.Update.Result> => {
447
+ let res: Service.Variant.Update.Result = await this._update(
448
+ this.svAPIEndpoint,
449
+ this.variant._path + `/${id}`,
450
+ body,
451
+ );
452
+ return res;
453
+ },
454
+
455
+ remove: async (
456
+ id: Service.Variant.Remove.ID,
457
+ ): Promise<Service.Variant.Remove.Result> => {
458
+ let res: Service.Variant.Remove.Result = await this._delete(
459
+ this.svAPIEndpoint,
460
+ this.variant._path + `/${id}`,
461
+ );
462
+ return res;
463
+ },
464
+ };
465
+
466
+ category = {
467
+ _path: Repzo._end_points.CATEGORY,
468
+ find: async (
469
+ params?: Service.Category.Find.Params,
470
+ ): Promise<Service.Category.Find.Result> => {
471
+ let res: Service.Category.Find.Result = await this._fetch(
472
+ this.svAPIEndpoint,
473
+ this.category._path,
474
+ params,
475
+ );
476
+ return res;
477
+ },
478
+
479
+ get: async (
480
+ id: Service.Category.Get.ID,
481
+ ): Promise<Service.Category.Get.Result> => {
482
+ return await this._fetch(
483
+ this.svAPIEndpoint,
484
+ this.category._path + `/${id}`,
485
+ );
486
+ },
487
+
488
+ create: async (
489
+ body: Service.Category.Create.Body,
490
+ ): Promise<Service.Category.Create.Result> => {
491
+ let res = await this._create(
492
+ this.svAPIEndpoint,
493
+ this.category._path,
494
+ body,
495
+ );
496
+ return res;
497
+ },
498
+
499
+ update: async (
500
+ id: Service.Category.Update.ID,
501
+ body: Service.Category.Update.Body,
502
+ ): Promise<Service.Category.Update.Result> => {
503
+ let res: Service.Category.Update.Result = await this._update(
504
+ this.svAPIEndpoint,
505
+ this.category._path + `/${id}`,
506
+ body,
507
+ );
508
+ return res;
509
+ },
510
+
511
+ remove: async (
512
+ id: Service.Category.Remove.ID,
513
+ ): Promise<Service.Category.Remove.Result> => {
514
+ let res: Service.Category.Remove.Result = await this._delete(
515
+ this.svAPIEndpoint,
516
+ this.category._path + `/${id}`,
517
+ );
518
+ return res;
519
+ },
520
+ };
521
+
522
+ sub_category = {
523
+ _path: Repzo._end_points.SUB_CATEGORY,
524
+ find: async (
525
+ params?: Service.SubCategory.Find.Params,
526
+ ): Promise<Service.SubCategory.Find.Result> => {
527
+ let res: Service.SubCategory.Find.Result = await this._fetch(
528
+ this.svAPIEndpoint,
529
+ this.sub_category._path,
530
+ params,
531
+ );
532
+ return res;
533
+ },
534
+
535
+ get: async (
536
+ id: Service.SubCategory.Get.ID,
537
+ params?: Service.SubCategory.Get.Params,
538
+ ): Promise<Service.SubCategory.Get.Result> => {
539
+ return await this._fetch(
540
+ this.svAPIEndpoint,
541
+ this.sub_category._path + `/${id}`,
542
+ params,
543
+ );
544
+ },
545
+
546
+ create: async (
547
+ body: Service.SubCategory.Create.Body,
548
+ ): Promise<Service.SubCategory.Create.Result> => {
549
+ let res = await this._create(
550
+ this.svAPIEndpoint,
551
+ this.sub_category._path,
552
+ body,
553
+ );
554
+ return res;
555
+ },
556
+
557
+ update: async (
558
+ id: Service.SubCategory.Update.ID,
559
+ body: Service.SubCategory.Update.Body,
560
+ ): Promise<Service.SubCategory.Update.Result> => {
561
+ let res: Service.SubCategory.Update.Result = await this._update(
562
+ this.svAPIEndpoint,
563
+ this.sub_category._path + `/${id}`,
564
+ body,
565
+ );
566
+ return res;
567
+ },
568
+
569
+ remove: async (
570
+ id: Service.SubCategory.Remove.ID,
571
+ ): Promise<Service.SubCategory.Remove.Result> => {
572
+ let res: Service.SubCategory.Remove.Result = await this._delete(
573
+ this.svAPIEndpoint,
574
+ this.sub_category._path + `/${id}`,
575
+ );
576
+ return res;
577
+ },
578
+ };
579
+
580
+ brand = {
581
+ _path: Repzo._end_points.BRAND,
582
+ find: async (
583
+ params?: Service.Brand.Find.Params,
584
+ ): Promise<Service.Brand.Find.Result> => {
585
+ let res: Service.Brand.Find.Result = await this._fetch(
586
+ this.svAPIEndpoint,
587
+ this.brand._path,
588
+ params,
589
+ );
590
+ return res;
591
+ },
592
+
593
+ get: async (
594
+ id: Service.Brand.Get.ID,
595
+ ): Promise<Service.Brand.Get.Result> => {
596
+ return await this._fetch(this.svAPIEndpoint, this.brand._path + `/${id}`);
597
+ },
598
+
599
+ create: async (
600
+ body: Service.Brand.Create.Body,
601
+ ): Promise<Service.Brand.Create.Result> => {
602
+ let res = await this._create(this.svAPIEndpoint, this.brand._path, body);
603
+ return res;
604
+ },
605
+
606
+ update: async (
607
+ id: Service.Brand.Update.ID,
608
+ body: Service.Brand.Update.Body,
609
+ ): Promise<Service.Brand.Update.Result> => {
610
+ let res: Service.Brand.Update.Result = await this._update(
611
+ this.svAPIEndpoint,
612
+ this.brand._path + `/${id}`,
613
+ body,
614
+ );
615
+ return res;
616
+ },
617
+
618
+ remove: async (
619
+ id: Service.Brand.Remove.ID,
620
+ ): Promise<Service.Brand.Remove.Result> => {
621
+ let res: Service.Brand.Remove.Result = await this._delete(
622
+ this.svAPIEndpoint,
623
+ this.brand._path + `/${id}`,
624
+ );
625
+ return res;
626
+ },
627
+ };
628
+
629
+ product_group = {
630
+ _path: Repzo._end_points.PRODUCT_GROUP,
631
+ find: async (
632
+ params?: Service.ProductGroup.Find.Params,
633
+ ): Promise<Service.ProductGroup.Find.Result> => {
634
+ let res: Service.ProductGroup.Find.Result = await this._fetch(
635
+ this.svAPIEndpoint,
636
+ this.product_group._path,
637
+ params,
638
+ );
639
+ return res;
640
+ },
641
+
642
+ get: async (
643
+ id: Service.ProductGroup.Get.ID,
644
+ ): Promise<Service.ProductGroup.Get.Result> => {
645
+ return await this._fetch(
646
+ this.svAPIEndpoint,
647
+ this.product_group._path + `/${id}`,
648
+ );
649
+ },
650
+
651
+ create: async (
652
+ body: Service.ProductGroup.Create.Body,
653
+ ): Promise<Service.ProductGroup.Create.Result> => {
654
+ let res = await this._create(
655
+ this.svAPIEndpoint,
656
+ this.product_group._path,
657
+ body,
658
+ );
659
+ return res;
660
+ },
661
+
662
+ update: async (
663
+ id: Service.ProductGroup.Update.ID,
664
+ body: Service.ProductGroup.Update.Body,
665
+ ): Promise<Service.ProductGroup.Update.Result> => {
666
+ let res: Service.ProductGroup.Update.Result = await this._update(
667
+ this.svAPIEndpoint,
668
+ this.product_group._path + `/${id}`,
669
+ body,
670
+ );
671
+ return res;
672
+ },
673
+
674
+ remove: async (
675
+ id: Service.ProductGroup.Remove.ID,
676
+ ): Promise<Service.ProductGroup.Remove.Result> => {
677
+ let res: Service.ProductGroup.Remove.Result = await this._delete(
678
+ this.svAPIEndpoint,
679
+ this.product_group._path + `/${id}`,
680
+ );
681
+ return res;
682
+ },
683
+ };
684
+
685
+ tax = {
686
+ _path: Repzo._end_points.TAX,
687
+ find: async (
688
+ params?: Service.Tax.Find.Params,
689
+ ): Promise<Service.Tax.Find.Result> => {
690
+ let res: Service.Tax.Find.Result = await this._fetch(
691
+ this.svAPIEndpoint,
692
+ this.tax._path,
693
+ params,
694
+ );
695
+ return res;
696
+ },
697
+
698
+ get: async (id: Service.Tax.Get.ID): Promise<Service.Tax.Get.Result> => {
699
+ return await this._fetch(this.svAPIEndpoint, this.tax._path + `/${id}`);
700
+ },
701
+
702
+ create: async (
703
+ body: Service.Tax.Create.Body,
704
+ ): Promise<Service.Tax.Create.Result> => {
705
+ let res = await this._create(this.svAPIEndpoint, this.tax._path, body);
706
+ return res;
707
+ },
708
+
709
+ update: async (
710
+ id: Service.Tax.Update.ID,
711
+ body: Service.Tax.Update.Body,
712
+ ): Promise<Service.Tax.Update.Result> => {
713
+ let res: Service.Tax.Update.Result = await this._update(
714
+ this.svAPIEndpoint,
715
+ this.tax._path + `/${id}`,
716
+ body,
717
+ );
718
+ return res;
719
+ },
720
+
721
+ remove: async (
722
+ id: Service.Tax.Remove.ID,
723
+ ): Promise<Service.Tax.Remove.Result> => {
724
+ let res: Service.Tax.Remove.Result = await this._delete(
725
+ this.svAPIEndpoint,
726
+ this.tax._path + `/${id}`,
727
+ );
728
+ return res;
729
+ },
730
+ };
731
+
732
+ measureunit = {
733
+ _path: Repzo._end_points.MEASUREUNIT,
734
+ find: async (
735
+ params?: Service.MeasureUnit.Find.Params,
736
+ ): Promise<Service.MeasureUnit.Find.Result> => {
737
+ let res: Service.MeasureUnit.Find.Result = await this._fetch(
738
+ this.svAPIEndpoint,
739
+ this.measureunit._path,
740
+ params,
741
+ );
742
+ return res;
743
+ },
744
+
745
+ get: async (
746
+ id: Service.MeasureUnit.Get.ID,
747
+ ): Promise<Service.MeasureUnit.Get.Result> => {
748
+ return await this._fetch(
749
+ this.svAPIEndpoint,
750
+ this.measureunit._path + `/${id}`,
751
+ );
752
+ },
753
+
754
+ create: async (
755
+ body: Service.MeasureUnit.Create.Body,
756
+ ): Promise<Service.MeasureUnit.Create.Result> => {
757
+ let res = await this._create(
758
+ this.svAPIEndpoint,
759
+ this.measureunit._path,
760
+ body,
761
+ );
762
+ return res;
763
+ },
764
+
765
+ update: async (
766
+ id: Service.MeasureUnit.Update.ID,
767
+ body: Service.MeasureUnit.Update.Body,
768
+ ): Promise<Service.MeasureUnit.Update.Result> => {
769
+ let res: Service.MeasureUnit.Update.Result = await this._update(
770
+ this.svAPIEndpoint,
771
+ this.measureunit._path + `/${id}`,
772
+ body,
773
+ );
774
+ return res;
775
+ },
776
+
777
+ remove: async (
778
+ id: Service.MeasureUnit.Remove.ID,
779
+ ): Promise<Service.MeasureUnit.Remove.Result> => {
780
+ let res: Service.MeasureUnit.Remove.Result = await this._delete(
781
+ this.svAPIEndpoint,
782
+ this.measureunit._path + `/${id}`,
783
+ );
784
+ return res;
785
+ },
786
+ };
787
+
788
+ measureunitFamily = {
789
+ _path: Repzo._end_points.MEASUREUNIT_FAMILY,
790
+ find: async (
791
+ params?: Service.MeasureUnitFamily.Find.Params,
792
+ ): Promise<Service.MeasureUnitFamily.Find.Result> => {
793
+ let res: Service.MeasureUnitFamily.Find.Result = await this._fetch(
794
+ this.svAPIEndpoint,
795
+ this.measureunitFamily._path,
796
+ params,
797
+ );
798
+ return res;
799
+ },
800
+
801
+ get: async (
802
+ id: Service.MeasureUnitFamily.Get.ID,
803
+ ): Promise<Service.MeasureUnitFamily.Get.Result> => {
804
+ return await this._fetch(
805
+ this.svAPIEndpoint,
806
+ this.measureunitFamily._path + `/${id}`,
807
+ );
808
+ },
809
+
810
+ create: async (
811
+ body: Service.MeasureUnitFamily.Create.Body,
812
+ ): Promise<Service.MeasureUnitFamily.Create.Result> => {
813
+ let res = await this._create(
814
+ this.svAPIEndpoint,
815
+ this.measureunitFamily._path,
816
+ body,
817
+ );
818
+ return res;
819
+ },
820
+
821
+ update: async (
822
+ id: Service.MeasureUnitFamily.Update.ID,
823
+ body: Service.MeasureUnitFamily.Update.Body,
824
+ ): Promise<Service.MeasureUnitFamily.Update.Result> => {
825
+ let res: Service.MeasureUnitFamily.Update.Result = await this._update(
826
+ this.svAPIEndpoint,
827
+ this.measureunitFamily._path + `/${id}`,
828
+ body,
829
+ );
830
+ return res;
831
+ },
832
+
833
+ remove: async (
834
+ id: Service.MeasureUnitFamily.Remove.ID,
835
+ ): Promise<Service.MeasureUnitFamily.Remove.Result> => {
836
+ let res: Service.MeasureUnitFamily.Remove.Result = await this._delete(
837
+ this.svAPIEndpoint,
838
+ this.measureunitFamily._path + `/${id}`,
839
+ );
840
+ return res;
841
+ },
842
+ };
843
+
844
+ media = {
845
+ _path: Repzo._end_points.MEDIA,
846
+ find: async (
847
+ params?: Service.Media.Find.Params,
848
+ ): Promise<Service.Media.Find.Result> => {
849
+ let res: Service.Media.Find.Result = await this._fetch(
850
+ this.svAPIEndpoint,
851
+ this.media._path,
852
+ params,
853
+ );
854
+ return res;
855
+ },
856
+
857
+ get: async (
858
+ id: Service.Media.Get.ID,
859
+ ): Promise<Service.Media.Get.Result> => {
860
+ return await this._fetch(this.svAPIEndpoint, this.media._path + `/${id}`);
861
+ },
862
+
863
+ create: async (
864
+ body: Service.Media.Create.Body,
865
+ ): Promise<Service.Media.Create.Result> => {
866
+ let res = await this._create(this.svAPIEndpoint, this.media._path, body);
867
+ return res;
868
+ },
869
+
870
+ update: async (
871
+ id: Service.Media.Update.ID,
872
+ body: Service.Media.Update.Body,
873
+ ): Promise<Service.Media.Update.Result> => {
874
+ let res: Service.Media.Update.Result = await this._update(
875
+ this.svAPIEndpoint,
876
+ this.media._path + `/${id}`,
877
+ body,
878
+ );
879
+ return res;
880
+ },
881
+
882
+ remove: async (
883
+ id: Service.Media.Remove.ID,
884
+ ): Promise<Service.Media.Remove.Result> => {
885
+ let res: Service.Media.Remove.Result = await this._delete(
886
+ this.svAPIEndpoint,
887
+ this.media._path + `/${id}`,
888
+ );
889
+ return res;
890
+ },
891
+ };
892
+
893
+ priceList = {
894
+ _path: Repzo._end_points.PRICELIST,
895
+ find: async (
896
+ params?: Service.PriceList.Find.Params,
897
+ ): Promise<Service.PriceList.Find.Result> => {
898
+ let res: Service.PriceList.Find.Result = await this._fetch(
899
+ this.svAPIEndpoint,
900
+ this.priceList._path,
901
+ params,
902
+ );
903
+ return res;
904
+ },
905
+
906
+ get: async (
907
+ id: Service.PriceList.Get.ID,
908
+ ): Promise<Service.PriceList.Get.Result> => {
909
+ return await this._fetch(
910
+ this.svAPIEndpoint,
911
+ this.priceList._path + `/${id}`,
912
+ );
913
+ },
914
+
915
+ create: async (
916
+ body: Service.PriceList.Create.Body,
917
+ ): Promise<Service.PriceList.Create.Result> => {
918
+ let res = await this._create(
919
+ this.svAPIEndpoint,
920
+ this.priceList._path,
921
+ body,
922
+ );
923
+ return res;
924
+ },
925
+
926
+ update: async (
927
+ id: Service.PriceList.Update.ID,
928
+ body: Service.PriceList.Update.Body,
929
+ ): Promise<Service.PriceList.Update.Result> => {
930
+ let res: Service.PriceList.Update.Result = await this._update(
931
+ this.svAPIEndpoint,
932
+ this.priceList._path + `/${id}`,
933
+ body,
934
+ );
935
+ return res;
936
+ },
937
+
938
+ remove: async (
939
+ id: Service.PriceList.Remove.ID,
940
+ ): Promise<Service.PriceList.Remove.Result> => {
941
+ let res: Service.PriceList.Remove.Result = await this._delete(
942
+ this.svAPIEndpoint,
943
+ this.priceList._path + `/${id}`,
944
+ );
945
+ return res;
946
+ },
947
+ };
948
+
949
+ priceListItem = {
950
+ _path: Repzo._end_points.PRICELIST_ITEM,
951
+ find: async (
952
+ params?: Service.PriceListItem.Find.Params,
953
+ ): Promise<Service.PriceListItem.Find.Result> => {
954
+ let res: Service.PriceListItem.Find.Result = await this._fetch(
955
+ this.svAPIEndpoint,
956
+ this.priceListItem._path,
957
+ params,
958
+ );
959
+ return res;
960
+ },
961
+
962
+ get: async (
963
+ id: Service.PriceListItem.Get.ID,
964
+ ): Promise<Service.PriceListItem.Get.Result> => {
965
+ return await this._fetch(
966
+ this.svAPIEndpoint,
967
+ this.priceListItem._path + `/${id}`,
968
+ );
969
+ },
970
+
971
+ create: async (
972
+ body: Service.PriceListItem.Create.Body,
973
+ ): Promise<Service.PriceListItem.Create.Result> => {
974
+ let res = await this._create(
975
+ this.svAPIEndpoint,
976
+ this.priceListItem._path,
977
+ body,
978
+ );
979
+ return res;
980
+ },
981
+
982
+ update: async (
983
+ id: Service.PriceListItem.Update.ID,
984
+ body: Service.PriceListItem.Update.Body,
985
+ ): Promise<Service.PriceListItem.Update.Result> => {
986
+ let res: Service.PriceListItem.Update.Result = await this._update(
987
+ this.svAPIEndpoint,
988
+ this.priceListItem._path + `/${id}`,
989
+ body,
990
+ );
991
+ return res;
992
+ },
993
+
994
+ remove: async (
995
+ id: Service.PriceListItem.Remove.ID,
996
+ ): Promise<Service.PriceListItem.Remove.Result> => {
997
+ let res: Service.PriceListItem.Remove.Result = await this._delete(
998
+ this.svAPIEndpoint,
999
+ this.priceListItem._path + `/${id}`,
1000
+ );
1001
+ return res;
1002
+ },
1003
+ };
1004
+
1005
+ team = {
1006
+ _path: Repzo._end_points.TEAM,
1007
+ find: async (
1008
+ params?: Service.Team.Find.Params,
1009
+ ): Promise<Service.Team.Find.Result> => {
1010
+ let res: Service.Team.Find.Result = await this._fetch(
1011
+ this.svAPIEndpoint,
1012
+ this.team._path,
1013
+ params,
1014
+ );
1015
+ return res;
1016
+ },
1017
+
1018
+ get: async (id: Service.Team.Get.ID): Promise<Service.Team.Get.Result> => {
1019
+ return await this._fetch(this.svAPIEndpoint, this.team._path + `/${id}`);
1020
+ },
1021
+
1022
+ create: async (
1023
+ body: Service.Team.Create.Body,
1024
+ ): Promise<Service.Team.Create.Result> => {
1025
+ let res = await this._create(this.svAPIEndpoint, this.team._path, body);
1026
+ return res;
1027
+ },
1028
+
1029
+ update: async (
1030
+ id: Service.Team.Update.ID,
1031
+ body: Service.Team.Update.Body,
1032
+ ): Promise<Service.Team.Update.Result> => {
1033
+ let res: Service.Team.Update.Result = await this._update(
1034
+ this.svAPIEndpoint,
1035
+ this.team._path + `/${id}`,
1036
+ body,
1037
+ );
1038
+ return res;
1039
+ },
1040
+
1041
+ remove: async (
1042
+ id: Service.Team.Remove.ID,
1043
+ ): Promise<Service.Team.Remove.Result> => {
1044
+ let res: Service.Team.Remove.Result = await this._delete(
1045
+ this.svAPIEndpoint,
1046
+ this.team._path + `/${id}`,
1047
+ );
1048
+ return res;
1049
+ },
1050
+ };
1051
+
1052
+ returnReason = {
1053
+ _path: Repzo._end_points.RETURN_REASON,
1054
+ find: async (
1055
+ params?: Service.ReturnReason.Find.Params,
1056
+ ): Promise<Service.ReturnReason.Find.Result> => {
1057
+ let res: Service.ReturnReason.Find.Result = await this._fetch(
1058
+ this.svAPIEndpoint,
1059
+ this.returnReason._path,
1060
+ params,
1061
+ );
1062
+ return res;
1063
+ },
1064
+
1065
+ get: async (
1066
+ id: Service.ReturnReason.Get.ID,
1067
+ ): Promise<Service.ReturnReason.Get.Result> => {
1068
+ return await this._fetch(
1069
+ this.svAPIEndpoint,
1070
+ this.returnReason._path + `/${id}`,
1071
+ );
1072
+ },
1073
+ create: async (
1074
+ body: Service.ReturnReason.Create.Body,
1075
+ ): Promise<Service.ReturnReason.Create.Result> => {
1076
+ let res = await this._create(
1077
+ this.svAPIEndpoint,
1078
+ this.returnReason._path,
1079
+ body,
1080
+ );
1081
+ return res;
1082
+ },
1083
+
1084
+ update: async (
1085
+ id: Service.ReturnReason.Update.ID,
1086
+ body: Service.ReturnReason.Update.Body,
1087
+ ): Promise<Service.ReturnReason.Update.Result> => {
1088
+ let res: Service.ReturnReason.Update.Result = await this._update(
1089
+ this.svAPIEndpoint,
1090
+ this.returnReason._path + `/${id}`,
1091
+ body,
1092
+ );
1093
+ return res;
1094
+ },
1095
+
1096
+ remove: async (
1097
+ id: Service.ReturnReason.Remove.ID,
1098
+ ): Promise<Service.ReturnReason.Remove.Result> => {
1099
+ let res: Service.ReturnReason.Remove.Result = await this._delete(
1100
+ this.svAPIEndpoint,
1101
+ this.returnReason._path + `/${id}`,
1102
+ );
1103
+ return res;
1104
+ },
1105
+ };
1106
+
1107
+ rep = {
1108
+ _path: Repzo._end_points.REP,
1109
+ find: async (
1110
+ params?: Service.Rep.Find.Params,
1111
+ ): Promise<Service.Rep.Find.Result> => {
1112
+ let res: Service.Rep.Find.Result = await this._fetch(
1113
+ this.svAPIEndpoint,
1114
+ this.rep._path,
1115
+ params,
1116
+ );
1117
+ return res;
1118
+ },
1119
+
1120
+ get: async (
1121
+ id: Service.Rep.Get.ID,
1122
+ params?: Service.Rep.Get.Params,
1123
+ ): Promise<Service.Rep.Get.Result> => {
1124
+ return await this._fetch(
1125
+ this.svAPIEndpoint,
1126
+ this.rep._path + `/${id}`,
1127
+ params,
1128
+ );
1129
+ },
1130
+
1131
+ create: async (
1132
+ body: Service.Rep.Create.Body,
1133
+ ): Promise<Service.Rep.Create.Result> => {
1134
+ let res = await this._create(this.svAPIEndpoint, this.rep._path, body);
1135
+ return res;
1136
+ },
1137
+
1138
+ update: async (
1139
+ id: Service.Rep.Update.ID,
1140
+ body: Service.Rep.Update.Body,
1141
+ ): Promise<Service.Rep.Update.Result> => {
1142
+ let res: Service.Rep.Update.Result = await this._update(
1143
+ this.svAPIEndpoint,
1144
+ this.rep._path + `/${id}`,
1145
+ body,
1146
+ );
1147
+ return res;
1148
+ },
1149
+
1150
+ remove: async (
1151
+ id: Service.Rep.Remove.ID,
1152
+ ): Promise<Service.Rep.Remove.Result> => {
1153
+ let res: Service.Rep.Remove.Result = await this._delete(
1154
+ this.svAPIEndpoint,
1155
+ this.rep._path + `/${id}`,
1156
+ );
1157
+ return res;
1158
+ },
1159
+ };
1160
+
1161
+ tag = {
1162
+ _path: Repzo._end_points.TAG,
1163
+ find: async (
1164
+ params?: Service.Tag.Find.Params,
1165
+ ): Promise<Service.Tag.Find.Result> => {
1166
+ let res: Service.Tag.Find.Result = await this._fetch(
1167
+ this.svAPIEndpoint,
1168
+ this.tag._path,
1169
+ params,
1170
+ );
1171
+ return res;
1172
+ },
1173
+
1174
+ get: async (id: Service.Tag.Get.ID): Promise<Service.Tag.Get.Result> => {
1175
+ return await this._fetch(this.svAPIEndpoint, this.tag._path + `/${id}`);
1176
+ },
1177
+
1178
+ create: async (
1179
+ body: Service.Tag.Create.Body,
1180
+ ): Promise<Service.Tag.Create.Result> => {
1181
+ let res = await this._create(this.svAPIEndpoint, this.tag._path, body);
1182
+ return res;
1183
+ },
1184
+
1185
+ update: async (
1186
+ id: Service.Tag.Update.ID,
1187
+ body: Service.Tag.Update.Body,
1188
+ ): Promise<Service.Tag.Update.Result> => {
1189
+ let res: Service.Tag.Update.Result = await this._update(
1190
+ this.svAPIEndpoint,
1191
+ this.tag._path + `/${id}`,
1192
+ body,
1193
+ );
1194
+ return res;
1195
+ },
1196
+
1197
+ remove: async (
1198
+ id: Service.Tag.Remove.ID,
1199
+ ): Promise<Service.Tag.Remove.Result> => {
1200
+ let res: Service.Tag.Remove.Result = await this._delete(
1201
+ this.svAPIEndpoint,
1202
+ this.tag._path + `/${id}`,
1203
+ );
1204
+ return res;
1205
+ },
1206
+ };
1207
+
1208
+ warehouse = {
1209
+ _path: Repzo._end_points.WAREHOUSE,
1210
+ find: async (
1211
+ params?: Service.Warehouse.Find.Params,
1212
+ ): Promise<Service.Warehouse.Find.Result> => {
1213
+ let res: Service.Warehouse.Find.Result = await this._fetch(
1214
+ this.svAPIEndpoint,
1215
+ this.warehouse._path,
1216
+ params,
1217
+ );
1218
+ return res;
1219
+ },
1220
+
1221
+ get: async (
1222
+ id: Service.Warehouse.Get.ID,
1223
+ ): Promise<Service.Warehouse.Get.Result> => {
1224
+ return await this._fetch(
1225
+ this.svAPIEndpoint,
1226
+ this.warehouse._path + `/${id}`,
1227
+ );
1228
+ },
1229
+
1230
+ create: async (
1231
+ body: Service.Warehouse.Create.Body,
1232
+ ): Promise<Service.Warehouse.Create.Result> => {
1233
+ let res = await this._create(
1234
+ this.svAPIEndpoint,
1235
+ this.warehouse._path,
1236
+ body,
1237
+ );
1238
+ return res;
1239
+ },
1240
+
1241
+ update: async (
1242
+ id: Service.Warehouse.Update.ID,
1243
+ body: Service.Warehouse.Update.Body,
1244
+ ): Promise<Service.Warehouse.Update.Result> => {
1245
+ let res: Service.Warehouse.Update.Result = await this._update(
1246
+ this.svAPIEndpoint,
1247
+ this.warehouse._path + `/${id}`,
1248
+ body,
1249
+ );
1250
+ return res;
1251
+ },
1252
+
1253
+ remove: async (
1254
+ id: Service.Warehouse.Remove.ID,
1255
+ ): Promise<Service.Warehouse.Remove.Result> => {
1256
+ let res: Service.Warehouse.Remove.Result = await this._delete(
1257
+ this.svAPIEndpoint,
1258
+ this.warehouse._path + `/${id}`,
1259
+ );
1260
+ return res;
1261
+ },
1262
+ };
1263
+
1264
+ route = {
1265
+ _path: Repzo._end_points.ROUTE,
1266
+ find: async (
1267
+ params?: Service.Route.Find.Params,
1268
+ ): Promise<Service.Route.Find.Result> => {
1269
+ let res: Service.Route.Find.Result = await this._fetch(
1270
+ this.svAPIEndpoint,
1271
+ this.route._path,
1272
+ params,
1273
+ );
1274
+ return res;
1275
+ },
1276
+ get: async (
1277
+ id: Service.Route.Get.ID,
1278
+ ): Promise<Service.Route.Get.Result> => {
1279
+ return await this._fetch(this.svAPIEndpoint, this.route._path + `/${id}`);
1280
+ },
1281
+ create: async (
1282
+ body: Service.Route.Create.Body,
1283
+ ): Promise<Service.Route.Create.Result> => {
1284
+ let res = await this._create(this.svAPIEndpoint, this.route._path, body);
1285
+ return res;
1286
+ },
1287
+ update: async (
1288
+ id: Service.Route.Update.ID,
1289
+ body: Service.Route.Update.Body,
1290
+ ): Promise<Service.Route.Update.Result> => {
1291
+ let res: Service.Route.Update.Result = await this._update(
1292
+ this.svAPIEndpoint,
1293
+ this.route._path + `/${id}`,
1294
+ body,
1295
+ );
1296
+ return res;
1297
+ },
1298
+ remove: async (
1299
+ id: Service.Route.Remove.ID,
1300
+ ): Promise<Service.Route.Remove.Result> => {
1301
+ let res: Service.Route.Remove.Result = await this._delete(
1302
+ this.svAPIEndpoint,
1303
+ this.route._path + `/${id}`,
1304
+ );
1305
+ return res;
1306
+ },
1307
+ };
1308
+
1309
+ productModifiersGroup = {
1310
+ _path: Repzo._end_points.PRODUCT_MODIFIERS_GROUP,
1311
+ find: async (
1312
+ params?: Service.ProductModifiersGroup.Find.Params,
1313
+ ): Promise<Service.ProductModifiersGroup.Find.Result> => {
1314
+ let res: Service.ProductModifiersGroup.Find.Result = await this._fetch(
1315
+ this.svAPIEndpoint,
1316
+ this.productModifiersGroup._path,
1317
+ params,
1318
+ );
1319
+ return res;
1320
+ },
1321
+ get: async (
1322
+ id: Service.ProductModifiersGroup.Get.ID,
1323
+ ): Promise<Service.ProductModifiersGroup.Get.Result> => {
1324
+ return await this._fetch(
1325
+ this.svAPIEndpoint,
1326
+ this.productModifiersGroup._path + `/${id}`,
1327
+ );
1328
+ },
1329
+ create: async (
1330
+ body: Service.ProductModifiersGroup.Create.Body,
1331
+ ): Promise<Service.ProductModifiersGroup.Create.Result> => {
1332
+ let res = await this._create(
1333
+ this.svAPIEndpoint,
1334
+ this.productModifiersGroup._path,
1335
+ body,
1336
+ );
1337
+ return res;
1338
+ },
1339
+ update: async (
1340
+ id: Service.ProductModifiersGroup.Update.ID,
1341
+ body: Service.ProductModifiersGroup.Update.Body,
1342
+ ): Promise<Service.ProductModifiersGroup.Update.Result> => {
1343
+ let res: Service.ProductModifiersGroup.Update.Result = await this._update(
1344
+ this.svAPIEndpoint,
1345
+ this.productModifiersGroup._path + `/${id}`,
1346
+ body,
1347
+ );
1348
+ return res;
1349
+ },
1350
+ remove: async (
1351
+ id: Service.ProductModifiersGroup.Remove.ID,
1352
+ ): Promise<Service.ProductModifiersGroup.Remove.Result> => {
1353
+ let res: Service.ProductModifiersGroup.Remove.Result = await this._delete(
1354
+ this.svAPIEndpoint,
1355
+ this.productModifiersGroup._path + `/${id}`,
1356
+ );
1357
+ return res;
1358
+ },
1359
+ };
1360
+
1361
+ channel = {
1362
+ _path: Repzo._end_points.CHANNEL,
1363
+ find: async (
1364
+ params?: Service.Channel.Find.Params,
1365
+ ): Promise<Service.Channel.Find.Result> => {
1366
+ let res: Service.Channel.Find.Result = await this._fetch(
1367
+ this.svAPIEndpoint,
1368
+ this.channel._path,
1369
+ params,
1370
+ );
1371
+ return res;
1372
+ },
1373
+
1374
+ get: async (
1375
+ id: Service.Channel.Get.ID,
1376
+ ): Promise<Service.Channel.Get.Result> => {
1377
+ return await this._fetch(
1378
+ this.svAPIEndpoint,
1379
+ this.channel._path + `/${id}`,
1380
+ );
1381
+ },
1382
+
1383
+ create: async (
1384
+ body: Service.Channel.Create.Body,
1385
+ ): Promise<Service.Channel.Create.Result> => {
1386
+ let res = await this._create(
1387
+ this.svAPIEndpoint,
1388
+ this.channel._path,
1389
+ body,
1390
+ );
1391
+ return res;
1392
+ },
1393
+
1394
+ update: async (
1395
+ id: Service.Channel.Update.ID,
1396
+ body: Service.Channel.Update.Body,
1397
+ ): Promise<Service.Channel.Update.Result> => {
1398
+ let res: Service.Channel.Update.Result = await this._update(
1399
+ this.svAPIEndpoint,
1400
+ this.channel._path + `/${id}`,
1401
+ body,
1402
+ );
1403
+ return res;
1404
+ },
1405
+
1406
+ remove: async (
1407
+ id: Service.Channel.Remove.ID,
1408
+ ): Promise<Service.Channel.Remove.Result> => {
1409
+ let res: Service.Channel.Remove.Result = await this._delete(
1410
+ this.svAPIEndpoint,
1411
+ this.channel._path + `/${id}`,
1412
+ );
1413
+ return res;
1414
+ },
1415
+ };
1416
+ speciality = {
1417
+ _path: Repzo._end_points.SPECIALITY,
1418
+ find: async (
1419
+ params?: Service.Speciality.Find.Params,
1420
+ ): Promise<Service.Speciality.Find.Result> => {
1421
+ let res: Service.Speciality.Find.Result = await this._fetch(
1422
+ this.svAPIEndpoint,
1423
+ this.speciality._path,
1424
+ params,
1425
+ );
1426
+ return res;
1427
+ },
1428
+
1429
+ get: async (
1430
+ id: Service.Speciality.Get.ID,
1431
+ ): Promise<Service.Speciality.Get.Result> => {
1432
+ return await this._fetch(
1433
+ this.svAPIEndpoint,
1434
+ this.speciality._path + `/${id}`,
1435
+ );
1436
+ },
1437
+
1438
+ create: async (
1439
+ body: Service.Speciality.Create.Body,
1440
+ ): Promise<Service.Speciality.Create.Result> => {
1441
+ let res = await this._create(
1442
+ this.svAPIEndpoint,
1443
+ this.speciality._path,
1444
+ body,
1445
+ );
1446
+ return res;
1447
+ },
1448
+
1449
+ update: async (
1450
+ id: Service.Speciality.Update.ID,
1451
+ body: Service.Speciality.Update.Body,
1452
+ ): Promise<Service.Speciality.Update.Result> => {
1453
+ let res: Service.Speciality.Update.Result = await this._update(
1454
+ this.svAPIEndpoint,
1455
+ this.speciality._path + `/${id}`,
1456
+ body,
1457
+ );
1458
+ return res;
1459
+ },
1460
+
1461
+ remove: async (
1462
+ id: Service.Speciality.Remove.ID,
1463
+ ): Promise<Service.Speciality.Remove.Result> => {
1464
+ let res: Service.Speciality.Remove.Result = await this._delete(
1465
+ this.svAPIEndpoint,
1466
+ this.speciality._path + `/${id}`,
1467
+ );
1468
+ return res;
1469
+ },
1470
+ };
1471
+ clientContact = {
1472
+ _path: Repzo._end_points.CLIENT_CONTACT,
1473
+ find: async (
1474
+ params?: Service.ClientContact.Find.Params,
1475
+ ): Promise<Service.ClientContact.Find.Result> => {
1476
+ let res: Service.ClientContact.Find.Result = await this._fetch(
1477
+ this.svAPIEndpoint,
1478
+ this.clientContact._path,
1479
+ params,
1480
+ );
1481
+ return res;
1482
+ },
1483
+
1484
+ get: async (
1485
+ id: Service.ClientContact.Get.ID,
1486
+ ): Promise<Service.ClientContact.Get.Result> => {
1487
+ return await this._fetch(
1488
+ this.svAPIEndpoint,
1489
+ this.clientContact._path + `/${id}`,
1490
+ );
1491
+ },
1492
+
1493
+ create: async (
1494
+ body: Service.ClientContact.Create.Body,
1495
+ ): Promise<Service.ClientContact.Create.Result> => {
1496
+ let res = await this._create(
1497
+ this.svAPIEndpoint,
1498
+ this.clientContact._path,
1499
+ body,
1500
+ );
1501
+ return res;
1502
+ },
1503
+
1504
+ update: async (
1505
+ id: Service.ClientContact.Update.ID,
1506
+ body: Service.ClientContact.Update.Body,
1507
+ ): Promise<Service.ClientContact.Update.Result> => {
1508
+ let res: Service.ClientContact.Update.Result = await this._update(
1509
+ this.svAPIEndpoint,
1510
+ this.clientContact._path + `/${id}`,
1511
+ body,
1512
+ );
1513
+ return res;
1514
+ },
1515
+
1516
+ remove: async (
1517
+ id: Service.ClientContact.Remove.ID,
1518
+ ): Promise<Service.ClientContact.Remove.Result> => {
1519
+ let res: Service.ClientContact.Remove.Result = await this._delete(
1520
+ this.svAPIEndpoint,
1521
+ this.clientContact._path + `/${id}`,
1522
+ );
1523
+ return res;
1524
+ },
1525
+ };
1526
+ paymentTerm = {
1527
+ _path: Repzo._end_points.PAYMENT_TERM,
1528
+ find: async (
1529
+ params?: Service.PaymentTerm.Find.Params,
1530
+ ): Promise<Service.PaymentTerm.Find.Result> => {
1531
+ let res: Service.PaymentTerm.Find.Result = await this._fetch(
1532
+ this.svAPIEndpoint,
1533
+ this.paymentTerm._path,
1534
+ params,
1535
+ );
1536
+ return res;
1537
+ },
1538
+
1539
+ get: async (
1540
+ id: Service.PaymentTerm.Get.ID,
1541
+ ): Promise<Service.PaymentTerm.Get.Result> => {
1542
+ return await this._fetch(
1543
+ this.svAPIEndpoint,
1544
+ this.paymentTerm._path + `/${id}`,
1545
+ );
1546
+ },
1547
+
1548
+ create: async (
1549
+ body: Service.PaymentTerm.Create.Body,
1550
+ ): Promise<Service.PaymentTerm.Create.Result> => {
1551
+ let res = await this._create(
1552
+ this.svAPIEndpoint,
1553
+ this.paymentTerm._path,
1554
+ body,
1555
+ );
1556
+ return res;
1557
+ },
1558
+
1559
+ update: async (
1560
+ id: Service.PaymentTerm.Update.ID,
1561
+ body: Service.PaymentTerm.Update.Body,
1562
+ ): Promise<Service.PaymentTerm.Update.Result> => {
1563
+ let res: Service.PaymentTerm.Update.Result = await this._update(
1564
+ this.svAPIEndpoint,
1565
+ this.paymentTerm._path + `/${id}`,
1566
+ body,
1567
+ );
1568
+ return res;
1569
+ },
1570
+
1571
+ remove: async (
1572
+ id: Service.PaymentTerm.Remove.ID,
1573
+ ): Promise<Service.PaymentTerm.Remove.Result> => {
1574
+ let res: Service.PaymentTerm.Remove.Result = await this._delete(
1575
+ this.svAPIEndpoint,
1576
+ this.paymentTerm._path + `/${id}`,
1577
+ );
1578
+ return res;
1579
+ },
1580
+ };
1581
+
1582
+ bank = {
1583
+ _path: Repzo._end_points.BANK,
1584
+ find: async (
1585
+ params?: Service.Bank.Find.Params,
1586
+ ): Promise<Service.Bank.Find.Result> => {
1587
+ let res: Service.Bank.Find.Result = await this._fetch(
1588
+ this.svAPIEndpoint,
1589
+ this.bank._path,
1590
+ params,
1591
+ );
1592
+ return res;
1593
+ },
1594
+
1595
+ get: async (id: Service.Bank.Get.ID): Promise<Service.Bank.Get.Result> => {
1596
+ return await this._fetch(this.svAPIEndpoint, this.bank._path + `/${id}`);
1597
+ },
1598
+
1599
+ create: async (
1600
+ body: Service.Bank.Create.Body,
1601
+ ): Promise<Service.Bank.Create.Result> => {
1602
+ let res = await this._create(this.svAPIEndpoint, this.bank._path, body);
1603
+ return res;
1604
+ },
1605
+
1606
+ update: async (
1607
+ id: Service.Bank.Update.ID,
1608
+ body: Service.Bank.Update.Body,
1609
+ ): Promise<Service.Bank.Update.Result> => {
1610
+ let res: Service.Bank.Update.Result = await this._update(
1611
+ this.svAPIEndpoint,
1612
+ this.bank._path + `/${id}`,
1613
+ body,
1614
+ );
1615
+ return res;
1616
+ },
1617
+ };
1618
+
1619
+ bank_list = {
1620
+ _path: Repzo._end_points.BANK_LIST,
1621
+ find: async (
1622
+ params?: Service.BankList.Find.Params,
1623
+ ): Promise<Service.BankList.Find.Result> => {
1624
+ let res: Service.BankList.Find.Result = await this._fetch(
1625
+ this.svAPIEndpoint,
1626
+ this.bank_list._path,
1627
+ params,
1628
+ );
1629
+ return res;
1630
+ },
1631
+
1632
+ get: async (
1633
+ id: Service.BankList.Get.ID,
1634
+ ): Promise<Service.BankList.Get.Result> => {
1635
+ return await this._fetch(
1636
+ this.svAPIEndpoint,
1637
+ this.bank_list._path + `/${id}`,
1638
+ );
1639
+ },
1640
+
1641
+ create: async (
1642
+ body: Service.BankList.Create.Body,
1643
+ ): Promise<Service.BankList.Create.Result> => {
1644
+ let res = await this._create(
1645
+ this.svAPIEndpoint,
1646
+ this.bank_list._path,
1647
+ body,
1648
+ );
1649
+ return res;
1650
+ },
1651
+
1652
+ update: async (
1653
+ id: Service.BankList.Update.ID,
1654
+ body: Service.BankList.Update.Body,
1655
+ ): Promise<Service.BankList.Update.Result> => {
1656
+ let res: Service.BankList.Update.Result = await this._update(
1657
+ this.svAPIEndpoint,
1658
+ this.bank_list._path + `/${id}`,
1659
+ body,
1660
+ );
1661
+ return res;
1662
+ },
1663
+ };
1664
+
1665
+ customStatus = {
1666
+ _path: Repzo._end_points.CUSTOM_STATUS,
1667
+ find: async (
1668
+ params?: Service.CustomStatus.Find.Params,
1669
+ ): Promise<Service.CustomStatus.Find.Result> => {
1670
+ let res: Service.CustomStatus.Find.Result = await this._fetch(
1671
+ this.svAPIEndpoint,
1672
+ this.customStatus._path,
1673
+ params,
1674
+ );
1675
+ return res;
1676
+ },
1677
+
1678
+ get: async (
1679
+ id: Service.CustomStatus.Get.ID,
1680
+ ): Promise<Service.CustomStatus.Get.Result> => {
1681
+ return await this._fetch(
1682
+ this.svAPIEndpoint,
1683
+ this.customStatus._path + `/${id}`,
1684
+ );
1685
+ },
1686
+
1687
+ create: async (
1688
+ body: Service.CustomStatus.Create.Body,
1689
+ ): Promise<Service.CustomStatus.Create.Result> => {
1690
+ let res = await this._create(
1691
+ this.svAPIEndpoint,
1692
+ this.customStatus._path,
1693
+ body,
1694
+ );
1695
+ return res;
1696
+ },
1697
+
1698
+ update: async (
1699
+ id: Service.CustomStatus.Update.ID,
1700
+ body: Service.CustomStatus.Update.Body,
1701
+ ): Promise<Service.CustomStatus.Update.Result> => {
1702
+ let res: Service.CustomStatus.Update.Result = await this._update(
1703
+ this.svAPIEndpoint,
1704
+ this.customStatus._path + `/${id}`,
1705
+ body,
1706
+ );
1707
+ return res;
1708
+ },
1709
+
1710
+ remove: async (
1711
+ id: Service.CustomStatus.Remove.ID,
1712
+ ): Promise<Service.CustomStatus.Remove.Result> => {
1713
+ let res: Service.CustomStatus.Remove.Result = await this._delete(
1714
+ this.svAPIEndpoint,
1715
+ this.customStatus._path + `/${id}`,
1716
+ );
1717
+ return res;
1718
+ },
1719
+ };
1720
+
1721
+ customList = {
1722
+ _path: Repzo._end_points.CUSTOM_LIST,
1723
+ find: async (
1724
+ params?: Service.CustomList.Find.Params,
1725
+ ): Promise<Service.CustomList.Find.Result> => {
1726
+ let res: Service.CustomList.Find.Result = await this._fetch(
1727
+ this.svAPIEndpoint,
1728
+ this.customList._path,
1729
+ params,
1730
+ );
1731
+ return res;
1732
+ },
1733
+
1734
+ get: async (
1735
+ id: Service.CustomList.Get.ID,
1736
+ params?: Service.CustomList.Get.Params,
1737
+ ): Promise<Service.CustomList.Get.Result> => {
1738
+ return await this._fetch(
1739
+ this.svAPIEndpoint,
1740
+ this.customList._path + `/${id}`,
1741
+ params,
1742
+ );
1743
+ },
1744
+
1745
+ create: async (
1746
+ body: Service.CustomList.Create.Body,
1747
+ ): Promise<Service.CustomList.Create.Result> => {
1748
+ let res = await this._create(
1749
+ this.svAPIEndpoint,
1750
+ this.customList._path,
1751
+ body,
1752
+ );
1753
+ return res;
1754
+ },
1755
+
1756
+ update: async (
1757
+ id: Service.CustomList.Update.ID,
1758
+ body: Service.CustomList.Update.Body,
1759
+ ): Promise<Service.CustomList.Update.Result> => {
1760
+ let res: Service.CustomList.Update.Result = await this._update(
1761
+ this.svAPIEndpoint,
1762
+ this.customList._path + `/${id}`,
1763
+ body,
1764
+ );
1765
+ return res;
1766
+ },
1767
+ remove: async (
1768
+ id: Service.CustomList.Remove.ID,
1769
+ ): Promise<Service.CustomList.Remove.Result> => {
1770
+ let res: Service.CustomList.Remove.Result = await this._delete(
1771
+ this.svAPIEndpoint,
1772
+ this.customList._path + `/${id}`,
1773
+ );
1774
+ return res;
1775
+ },
1776
+ };
1777
+
1778
+ customListItem = {
1779
+ _path: Repzo._end_points.CUSTOM_LIST_ITEM,
1780
+ find: async (
1781
+ params?: Service.CustomListItem.Find.Params,
1782
+ ): Promise<Service.CustomListItem.Find.Result> => {
1783
+ let res: Service.CustomListItem.Find.Result = await this._fetch(
1784
+ this.svAPIEndpoint,
1785
+ this.customListItem._path,
1786
+ params,
1787
+ );
1788
+ return res;
1789
+ },
1790
+
1791
+ get: async (
1792
+ id: Service.CustomListItem.Get.ID,
1793
+ params?: Service.CustomListItem.Get.Params,
1794
+ ): Promise<Service.CustomListItem.Get.Result> => {
1795
+ return await this._fetch(
1796
+ this.svAPIEndpoint,
1797
+ this.customListItem._path + `/${id}`,
1798
+ params,
1799
+ );
1800
+ },
1801
+
1802
+ create: async (
1803
+ body: Service.CustomListItem.Create.Body,
1804
+ ): Promise<Service.CustomListItem.Create.Result> => {
1805
+ let res = await this._create(
1806
+ this.svAPIEndpoint,
1807
+ this.customListItem._path,
1808
+ body,
1809
+ );
1810
+ return res;
1811
+ },
1812
+
1813
+ update: async (
1814
+ id: Service.CustomListItem.Update.ID,
1815
+ body: Service.CustomListItem.Update.Body,
1816
+ ): Promise<Service.CustomListItem.Update.Result> => {
1817
+ let res: Service.CustomListItem.Update.Result = await this._update(
1818
+ this.svAPIEndpoint,
1819
+ this.customListItem._path + `/${id}`,
1820
+ body,
1821
+ );
1822
+ return res;
1823
+ },
1824
+ remove: async (
1825
+ id: Service.CustomListItem.Remove.ID,
1826
+ ): Promise<Service.CustomListItem.Remove.Result> => {
1827
+ let res: Service.CustomListItem.Remove.Result = await this._delete(
1828
+ this.svAPIEndpoint,
1829
+ this.customListItem._path + `/${id}`,
1830
+ );
1831
+ return res;
1832
+ },
1833
+ };
1834
+
1835
+ inventoryAdjustmentReason = {
1836
+ _path: Repzo._end_points.INVENTORY_ADJUSTMENT_REASON,
1837
+ find: async (
1838
+ params?: Service.InventoryAdjustmentReason.Find.Params,
1839
+ ): Promise<Service.InventoryAdjustmentReason.Find.Result> => {
1840
+ let res: Service.InventoryAdjustmentReason.Find.Result =
1841
+ await this._fetch(
1842
+ this.svAPIEndpoint,
1843
+ this.inventoryAdjustmentReason._path,
1844
+ params,
1845
+ );
1846
+ return res;
1847
+ },
1848
+
1849
+ get: async (
1850
+ id: Service.InventoryAdjustmentReason.Get.ID,
1851
+ ): Promise<Service.InventoryAdjustmentReason.Get.Result> => {
1852
+ return await this._fetch(
1853
+ this.svAPIEndpoint,
1854
+ this.inventoryAdjustmentReason._path + `/${id}`,
1855
+ );
1856
+ },
1857
+
1858
+ create: async (
1859
+ body: Service.InventoryAdjustmentReason.Create.Body,
1860
+ ): Promise<Service.InventoryAdjustmentReason.Create.Result> => {
1861
+ let res = await this._create(
1862
+ this.svAPIEndpoint,
1863
+ this.inventoryAdjustmentReason._path,
1864
+ body,
1865
+ );
1866
+ return res;
1867
+ },
1868
+ update: async (
1869
+ id: Service.InventoryAdjustmentReason.Update.ID,
1870
+ body: Service.InventoryAdjustmentReason.Update.Body,
1871
+ ): Promise<Service.InventoryAdjustmentReason.Update.Result> => {
1872
+ let res: Service.InventoryAdjustmentReason.Update.Result =
1873
+ await this._update(
1874
+ this.svAPIEndpoint,
1875
+ this.customListItem._path + `/${id}`,
1876
+ body,
1877
+ );
1878
+ return res;
1879
+ },
1880
+ remove: async (
1881
+ id: Service.InventoryAdjustmentReason.Remove.ID,
1882
+ ): Promise<Service.InventoryAdjustmentReason.Remove.Result> => {
1883
+ let res: Service.InventoryAdjustmentReason.Remove.Result =
1884
+ await this._delete(
1885
+ this.svAPIEndpoint,
1886
+ this.inventoryAdjustmentReason._path + `/${id}`,
1887
+ );
1888
+ return res;
1889
+ },
1890
+ };
1891
+
1892
+ workorder = {
1893
+ _path: Repzo._end_points.WORKORDER,
1894
+ find: async (
1895
+ params?: Service.Workorder.Find.Params,
1896
+ ): Promise<Service.Workorder.Find.Result> => {
1897
+ let res: Service.Workorder.Find.Result = await this._fetch(
1898
+ this.svAPIEndpoint,
1899
+ this.workorder._path,
1900
+ params,
1901
+ );
1902
+ return res;
1903
+ },
1904
+ get: async (
1905
+ id: Service.Workorder.Get.ID,
1906
+ params?: Service.Workorder.Get.Params,
1907
+ ): Promise<Service.Workorder.Get.Result> => {
1908
+ return await this._fetch(
1909
+ this.svAPIEndpoint,
1910
+ this.workorder._path + `/${id}`,
1911
+ params,
1912
+ );
1913
+ },
1914
+ create: async (
1915
+ body: Service.Workorder.Create.Body,
1916
+ ): Promise<Service.Workorder.Create.Result> => {
1917
+ let res = await this._create(
1918
+ this.svAPIEndpoint,
1919
+ this.workorder._path,
1920
+ body,
1921
+ );
1922
+ return res;
1923
+ },
1924
+ update: async (
1925
+ id: Service.Workorder.Update.ID,
1926
+ body: Service.Workorder.Update.Body,
1927
+ ): Promise<Service.Workorder.Update.Result> => {
1928
+ let res: Service.Workorder.Update.Result = await this._update(
1929
+ this.svAPIEndpoint,
1930
+ this.workorder._path + `/${id}`,
1931
+ body,
1932
+ );
1933
+ return res;
1934
+ },
1935
+ remove: async (
1936
+ id: Service.Workorder.Remove.ID,
1937
+ ): Promise<Service.Workorder.Remove.Result> => {
1938
+ let res: Service.Workorder.Remove.Result = await this._delete(
1939
+ this.svAPIEndpoint,
1940
+ this.workorder._path + `/${id}`,
1941
+ );
1942
+ return res;
1943
+ },
1944
+ };
1945
+
1946
+ workorderRequest = {
1947
+ _path: Repzo._end_points.WORKORDER_REQUEST,
1948
+ find: async (
1949
+ params?: Service.WorkorderRequest.Find.Params,
1950
+ ): Promise<Service.WorkorderRequest.Find.Result> => {
1951
+ let res: Service.WorkorderRequest.Find.Result = await this._fetch(
1952
+ this.svAPIEndpoint,
1953
+ this.workorderRequest._path,
1954
+ params,
1955
+ );
1956
+ return res;
1957
+ },
1958
+ get: async (
1959
+ id: Service.WorkorderRequest.Get.ID,
1960
+ params?: Service.WorkorderRequest.Get.Params,
1961
+ ): Promise<Service.WorkorderRequest.Get.Result> => {
1962
+ return await this._fetch(
1963
+ this.svAPIEndpoint,
1964
+ this.workorderRequest._path + `/${id}`,
1965
+ params,
1966
+ );
1967
+ },
1968
+ create: async (
1969
+ body: Service.WorkorderRequest.Create.Body,
1970
+ ): Promise<Service.WorkorderRequest.Create.Result> => {
1971
+ let res = await this._create(
1972
+ this.svAPIEndpoint,
1973
+ this.workorderRequest._path,
1974
+ body,
1975
+ );
1976
+ return res;
1977
+ },
1978
+ update: async (
1979
+ id: Service.WorkorderRequest.Update.ID,
1980
+ body: Service.WorkorderRequest.Update.Body,
1981
+ ): Promise<Service.WorkorderRequest.Update.Result> => {
1982
+ let res: Service.WorkorderRequest.Update.Result = await this._update(
1983
+ this.svAPIEndpoint,
1984
+ this.workorderRequest._path + `/${id}`,
1985
+ body,
1986
+ );
1987
+ return res;
1988
+ },
1989
+ remove: async (
1990
+ id: Service.WorkorderRequest.Remove.ID,
1991
+ ): Promise<Service.WorkorderRequest.Remove.Result> => {
1992
+ let res: Service.WorkorderRequest.Remove.Result = await this._delete(
1993
+ this.svAPIEndpoint,
1994
+ this.workorderRequest._path + `/${id}`,
1995
+ );
1996
+ return res;
1997
+ },
1998
+ };
1999
+
2000
+ supplier = {
2001
+ _path: Repzo._end_points.SUPPLIER,
2002
+ find: async (
2003
+ params?: Service.Supplier.Find.Params,
2004
+ ): Promise<Service.Supplier.Find.Result> => {
2005
+ let res: Service.Supplier.Find.Result = await this._fetch(
2006
+ this.svAPIEndpoint,
2007
+ this.supplier._path,
2008
+ params,
2009
+ );
2010
+ return res;
2011
+ },
2012
+ get: async (
2013
+ id: Service.Supplier.Get.ID,
2014
+ params?: Service.Supplier.Get.Params,
2015
+ ): Promise<Service.Supplier.Get.Result> => {
2016
+ return await this._fetch(
2017
+ this.svAPIEndpoint,
2018
+ this.supplier._path + `/${id}`,
2019
+ params,
2020
+ );
2021
+ },
2022
+ create: async (
2023
+ body: Service.Supplier.Create.Body,
2024
+ ): Promise<Service.Supplier.Create.Result> => {
2025
+ let res = await this._create(
2026
+ this.svAPIEndpoint,
2027
+ this.supplier._path,
2028
+ body,
2029
+ );
2030
+ return res;
2031
+ },
2032
+
2033
+ update: async (
2034
+ id: Service.Supplier.Update.ID,
2035
+ body: Service.Supplier.Update.Body,
2036
+ ): Promise<Service.Supplier.Update.Result> => {
2037
+ let res: Service.Supplier.Update.Result = await this._update(
2038
+ this.svAPIEndpoint,
2039
+ this.supplier._path + `/${id}`,
2040
+ body,
2041
+ );
2042
+ return res;
2043
+ },
2044
+ };
2045
+
2046
+ quickConvertToPdf = {
2047
+ _path: Repzo._end_points.QUICK_CONVERT_TO_PDF,
2048
+ find: async (
2049
+ params?: Service.QuickConvertToPdf.Find.Params,
2050
+ ): Promise<Service.QuickConvertToPdf.Find.Result> => {
2051
+ let res: Service.QuickConvertToPdf.Find.Result = await this._fetch(
2052
+ this.svAPIEndpoint,
2053
+ this.quickConvertToPdf._path,
2054
+ params,
2055
+ );
2056
+ return res;
2057
+ },
2058
+ get: async (
2059
+ id: Service.QuickConvertToPdf.Get.ID,
2060
+ params?: Service.QuickConvertToPdf.Get.Params,
2061
+ ): Promise<Service.QuickConvertToPdf.Get.Result> => {
2062
+ return await this._fetch(
2063
+ this.svAPIEndpoint,
2064
+ this.quickConvertToPdf._path + `/${id}`,
2065
+ params,
2066
+ );
2067
+ },
2068
+ create: async (
2069
+ body: Service.QuickConvertToPdf.Create.Body,
2070
+ ): Promise<Service.QuickConvertToPdf.Create.Result> => {
2071
+ let res = await this._create(
2072
+ this.svAPIEndpoint,
2073
+ this.quickConvertToPdf._path,
2074
+ body,
2075
+ );
2076
+ return res;
2077
+ },
2078
+ remove: async (
2079
+ id: Service.QuickConvertToPdf.Remove.ID,
2080
+ ): Promise<Service.QuickConvertToPdf.Remove.Result> => {
2081
+ let res: Service.QuickConvertToPdf.Remove.Result = await this._delete(
2082
+ this.svAPIEndpoint,
2083
+ this.quickConvertToPdf._path + `/${id}`,
2084
+ );
2085
+ return res;
2086
+ },
2087
+ };
2088
+ visit = {
2089
+ _path: Repzo._end_points.VISIT,
2090
+ find: async (
2091
+ params?: Service.Visit.Find.Params,
2092
+ ): Promise<Service.Visit.Find.Result> => {
2093
+ let res: Service.Visit.Find.Result = await this._fetch(
2094
+ this.svAPIEndpoint,
2095
+ this.visit._path,
2096
+ params,
2097
+ );
2098
+ return res;
2099
+ },
2100
+ get: async (
2101
+ id: Service.Visit.Get.ID,
2102
+ params?: Service.Visit.Get.Params,
2103
+ ): Promise<Service.Visit.Get.Result> => {
2104
+ return await this._fetch(
2105
+ this.svAPIEndpoint,
2106
+ this.visit._path + `/${id}`,
2107
+ params,
2108
+ );
2109
+ },
2110
+ create: async (
2111
+ body: Service.Visit.Create.Body,
2112
+ ): Promise<Service.Visit.Create.Result> => {
2113
+ let res = await this._create(this.svAPIEndpoint, this.visit._path, body);
2114
+ return res;
2115
+ },
2116
+
2117
+ update: async (
2118
+ id: Service.Visit.Update.ID,
2119
+ body: Service.Visit.Update.Body,
2120
+ ): Promise<Service.Visit.Update.Result> => {
2121
+ let res: Service.Visit.Update.Result = await this._update(
2122
+ this.svAPIEndpoint,
2123
+ this.visit._path + `/${id}`,
2124
+ body,
2125
+ );
2126
+ return res;
2127
+ },
2128
+ };
2129
+
2130
+ activityFeedback = {
2131
+ _path: Repzo._end_points.ACTIVITY_FEEDBACK,
2132
+ find: async (
2133
+ params?: Service.ActivityFeedback.Find.Params,
2134
+ ): Promise<Service.ActivityFeedback.Find.Result> => {
2135
+ let res: Service.ActivityFeedback.Find.Result = await this._fetch(
2136
+ this.svAPIEndpoint,
2137
+ this.activityFeedback._path,
2138
+ params,
2139
+ );
2140
+ return res;
2141
+ },
2142
+ get: async (
2143
+ id: Service.ActivityFeedback.Get.ID,
2144
+ params?: Service.ActivityFeedback.Get.Params,
2145
+ ): Promise<Service.ActivityFeedback.Get.Result> => {
2146
+ return await this._fetch(
2147
+ this.svAPIEndpoint,
2148
+ this.activityFeedback._path + `/${id}`,
2149
+ params,
2150
+ );
2151
+ },
2152
+ create: async (
2153
+ body: Service.ActivityFeedback.Create.Body,
2154
+ ): Promise<Service.ActivityFeedback.Create.Result> => {
2155
+ let res = await this._create(
2156
+ this.svAPIEndpoint,
2157
+ this.activityFeedback._path,
2158
+ body,
2159
+ );
2160
+ return res;
2161
+ },
2162
+
2163
+ update: async (
2164
+ id: Service.ActivityFeedback.Update.ID,
2165
+ body: Service.ActivityFeedback.Update.Body,
2166
+ ): Promise<Service.ActivityFeedback.Update.Result> => {
2167
+ let res: Service.ActivityFeedback.Update.Result = await this._update(
2168
+ this.svAPIEndpoint,
2169
+ this.activityFeedback._path + `/${id}`,
2170
+ body,
2171
+ );
2172
+ return res;
2173
+ },
2174
+ };
2175
+
2176
+ activityFeedbackV2 = {
2177
+ _path: Repzo._end_points.ACTIVITY_FEEDBACKV2,
2178
+ find: async (
2179
+ params?: Service.ActivityFeedbackV2.Find.Params,
2180
+ ): Promise<Service.ActivityFeedbackV2.Find.Result> => {
2181
+ let res: Service.ActivityFeedbackV2.Find.Result = await this._fetch(
2182
+ this.svAPIEndpoint,
2183
+ this.activityFeedbackV2._path,
2184
+ params,
2185
+ );
2186
+ return res;
2187
+ },
2188
+ get: async (
2189
+ id: Service.ActivityFeedbackV2.Get.ID,
2190
+ params?: Service.ActivityFeedbackV2.Get.Params,
2191
+ ): Promise<Service.ActivityFeedbackV2.Get.Result> => {
2192
+ return await this._fetch(
2193
+ this.svAPIEndpoint,
2194
+ this.activityFeedbackV2._path + `/${id}`,
2195
+ params,
2196
+ );
2197
+ },
2198
+ create: async (
2199
+ body: Service.ActivityFeedbackV2.Create.Body,
2200
+ ): Promise<Service.ActivityFeedbackV2.Create.Result> => {
2201
+ let res = await this._create(
2202
+ this.svAPIEndpoint,
2203
+ this.activityFeedbackV2._path,
2204
+ body,
2205
+ );
2206
+ return res;
2207
+ },
2208
+
2209
+ update: async (
2210
+ id: Service.ActivityFeedbackV2.Update.ID,
2211
+ body: Service.ActivityFeedbackV2.Update.Body,
2212
+ ): Promise<Service.ActivityFeedbackV2.Update.Result> => {
2213
+ let res: Service.ActivityFeedbackV2.Update.Result = await this._update(
2214
+ this.svAPIEndpoint,
2215
+ this.activityFeedbackV2._path + `/${id}`,
2216
+ body,
2217
+ );
2218
+ return res;
2219
+ },
2220
+ };
2221
+
2222
+ feedbackOption = {
2223
+ _path: Repzo._end_points.FEEDBACK_OPTION,
2224
+ find: async (
2225
+ params?: Service.FeedbackOption.Find.Params,
2226
+ ): Promise<Service.FeedbackOption.Find.Result> => {
2227
+ let res: Service.FeedbackOption.Find.Result = await this._fetch(
2228
+ this.svAPIEndpoint,
2229
+ this.feedbackOption._path,
2230
+ params,
2231
+ );
2232
+ return res;
2233
+ },
2234
+ get: async (
2235
+ id: Service.FeedbackOption.Get.ID,
2236
+ params?: Service.FeedbackOption.Get.Params,
2237
+ ): Promise<Service.FeedbackOption.Get.Result> => {
2238
+ return await this._fetch(
2239
+ this.svAPIEndpoint,
2240
+ this.feedbackOption._path + `/${id}`,
2241
+ params,
2242
+ );
2243
+ },
2244
+ create: async (
2245
+ body: Service.FeedbackOption.Create.Body,
2246
+ ): Promise<Service.FeedbackOption.Create.Result> => {
2247
+ let res = await this._create(
2248
+ this.svAPIEndpoint,
2249
+ this.feedbackOption._path,
2250
+ body,
2251
+ );
2252
+ return res;
2253
+ },
2254
+
2255
+ update: async (
2256
+ id: Service.FeedbackOption.Update.ID,
2257
+ body: Service.FeedbackOption.Update.Body,
2258
+ ): Promise<Service.FeedbackOption.Update.Result> => {
2259
+ let res: Service.FeedbackOption.Update.Result = await this._update(
2260
+ this.svAPIEndpoint,
2261
+ this.feedbackOption._path + `/${id}`,
2262
+ body,
2263
+ );
2264
+ return res;
2265
+ },
2266
+ };
2267
+
2268
+ invoice = {
2269
+ _path: Repzo._end_points.INVOICE,
2270
+ find: async (
2271
+ params?: Service.FullInvoice.Find.Params,
2272
+ ): Promise<Service.FullInvoice.Find.Result> => {
2273
+ let res: Service.FullInvoice.Find.Result = await this._fetch(
2274
+ this.svAPIEndpoint,
2275
+ this.invoice._path,
2276
+ params,
2277
+ );
2278
+ return res;
2279
+ },
2280
+
2281
+ get: async (
2282
+ id: Service.FullInvoice.Get.ID,
2283
+ params?: Service.FullInvoice.Get.Params,
2284
+ ): Promise<Service.FullInvoice.Get.Result> => {
2285
+ return await this._fetch(
2286
+ this.svAPIEndpoint,
2287
+ this.invoice._path + `/${id}`,
2288
+ params,
2289
+ );
2290
+ },
2291
+
2292
+ create: async (
2293
+ body: Service.FullInvoice.Create.Body,
2294
+ ): Promise<Service.FullInvoice.Create.Result> => {
2295
+ let res = await this._create(
2296
+ this.svAPIEndpoint,
2297
+ this.invoice._path,
2298
+ body,
2299
+ );
2300
+ return res;
2301
+ },
2302
+
2303
+ update: async (
2304
+ id: Service.FullInvoice.Update.ID,
2305
+ body: Service.FullInvoice.Update.Body,
2306
+ ): Promise<Service.FullInvoice.Update.Result> => {
2307
+ let res: Service.FullInvoice.Update.Result = await this._update(
2308
+ this.svAPIEndpoint,
2309
+ this.invoice._path + `/${id}`,
2310
+ body,
2311
+ );
2312
+ return res;
2313
+ },
2314
+ };
2315
+
2316
+ proforma = {
2317
+ _path: Repzo._end_points.PROFORMA,
2318
+ find: async (
2319
+ params?: Service.Proforma.Find.Params,
2320
+ ): Promise<Service.Proforma.Find.Result> => {
2321
+ let res: Service.Proforma.Find.Result = await this._fetch(
2322
+ this.svAPIEndpoint,
2323
+ this.proforma._path,
2324
+ params,
2325
+ );
2326
+ return res;
2327
+ },
2328
+
2329
+ get: async (
2330
+ id: Service.Proforma.Get.ID,
2331
+ params?: Service.Proforma.Get.Params,
2332
+ ): Promise<Service.Proforma.Get.Result> => {
2333
+ return await this._fetch(
2334
+ this.svAPIEndpoint,
2335
+ this.proforma._path + `/${id}`,
2336
+ params,
2337
+ );
2338
+ },
2339
+
2340
+ create: async (
2341
+ body: Service.Proforma.Create.Body,
2342
+ ): Promise<Service.Proforma.Create.Result> => {
2343
+ let res = await this._create(
2344
+ this.svAPIEndpoint,
2345
+ this.proforma._path,
2346
+ body,
2347
+ );
2348
+ return res;
2349
+ },
2350
+
2351
+ update: async (
2352
+ id: Service.Proforma.Update.ID,
2353
+ body: Service.Proforma.Update.Body,
2354
+ ): Promise<Service.Proforma.Update.Result> => {
2355
+ let res: Service.Proforma.Update.Result = await this._update(
2356
+ this.svAPIEndpoint,
2357
+ this.proforma._path + `/${id}`,
2358
+ body,
2359
+ );
2360
+ return res;
2361
+ },
2362
+ };
2363
+
2364
+ payment = {
2365
+ _path: Repzo._end_points.PAYMENT,
2366
+ find: async (
2367
+ params?: Service.Payment.Find.Params,
2368
+ ): Promise<Service.Payment.Find.Result> => {
2369
+ let res: Service.Payment.Find.Result = await this._fetch(
2370
+ this.svAPIEndpoint,
2371
+ this.payment._path,
2372
+ params,
2373
+ );
2374
+ return res;
2375
+ },
2376
+
2377
+ get: async (
2378
+ id: Service.Payment.Get.ID,
2379
+ params?: Service.Payment.Get.Params,
2380
+ ): Promise<Service.Payment.Get.Result> => {
2381
+ return await this._fetch(
2382
+ this.svAPIEndpoint,
2383
+ this.payment._path + `/${id}`,
2384
+ params,
2385
+ );
2386
+ },
2387
+
2388
+ create: async (
2389
+ body: Service.Payment.Create.Body,
2390
+ ): Promise<Service.Payment.Create.Result> => {
2391
+ let res = await this._create(
2392
+ this.svAPIEndpoint,
2393
+ this.payment._path,
2394
+ body,
2395
+ );
2396
+ return res;
2397
+ },
2398
+
2399
+ update: async (
2400
+ id: Service.Payment.Update.ID,
2401
+ body: Service.Payment.Update.Body,
2402
+ ): Promise<Service.Payment.Update.Result> => {
2403
+ let res: Service.Payment.Update.Result = await this._update(
2404
+ this.svAPIEndpoint,
2405
+ this.payment._path + `/${id}`,
2406
+ body,
2407
+ );
2408
+ return res;
2409
+ },
2410
+ };
2411
+
2412
+ refund = {
2413
+ _path: Repzo._end_points.REFUND,
2414
+ find: async (
2415
+ params?: Service.Refund.Find.Params,
2416
+ ): Promise<Service.Refund.Find.Result> => {
2417
+ let res: Service.Refund.Find.Result = await this._fetch(
2418
+ this.svAPIEndpoint,
2419
+ this.refund._path,
2420
+ params,
2421
+ );
2422
+ return res;
2423
+ },
2424
+
2425
+ get: async (
2426
+ id: Service.Refund.Get.ID,
2427
+ params?: Service.Refund.Get.Params,
2428
+ ): Promise<Service.Refund.Get.Result> => {
2429
+ return await this._fetch(
2430
+ this.svAPIEndpoint,
2431
+ this.refund._path + `/${id}`,
2432
+ params,
2433
+ );
2434
+ },
2435
+
2436
+ create: async (
2437
+ body: Service.Refund.Create.Body,
2438
+ ): Promise<Service.Refund.Create.Result> => {
2439
+ let res = await this._create(this.svAPIEndpoint, this.refund._path, body);
2440
+ return res;
2441
+ },
2442
+
2443
+ update: async (
2444
+ id: Service.Refund.Update.ID,
2445
+ body: Service.Refund.Update.Body,
2446
+ ): Promise<Service.Refund.Update.Result> => {
2447
+ let res: Service.Refund.Update.Result = await this._update(
2448
+ this.svAPIEndpoint,
2449
+ this.refund._path + `/${id}`,
2450
+ body,
2451
+ );
2452
+ return res;
2453
+ },
2454
+ };
2455
+
2456
+ settlement = {
2457
+ _path: Repzo._end_points.SETTLEMENT,
2458
+
2459
+ find: async (
2460
+ params?: Service.Settlement.Find.Params,
2461
+ ): Promise<Service.Settlement.Find.Result> => {
2462
+ let res: Service.Settlement.Find.Result = await this._fetch(
2463
+ this.svAPIEndpoint,
2464
+ this.settlement._path,
2465
+ params,
2466
+ );
2467
+ return res;
2468
+ },
2469
+
2470
+ get: async (
2471
+ id: Service.Settlement.Get.ID,
2472
+ params?: Service.Settlement.Get.Params,
2473
+ ): Promise<Service.Settlement.Get.Result> => {
2474
+ return await this._fetch(
2475
+ this.svAPIEndpoint,
2476
+ this.settlement._path + `/${id}`,
2477
+ params,
2478
+ );
2479
+ },
2480
+
2481
+ create: async (
2482
+ body: Service.Settlement.Create.Body,
2483
+ ): Promise<Service.Settlement.Create.Result> => {
2484
+ let res = await this._create(
2485
+ this.svAPIEndpoint,
2486
+ this.settlement._path,
2487
+ body,
2488
+ );
2489
+ return res;
2490
+ },
2491
+ };
2492
+
2493
+ check = {
2494
+ _path: Repzo._end_points.CHECK,
2495
+
2496
+ find: async (
2497
+ params?: Service.Check.Find.Params,
2498
+ ): Promise<Service.Check.Find.Result> => {
2499
+ let res: Service.Check.Find.Result = await this._fetch(
2500
+ this.svAPIEndpoint,
2501
+ this.check._path,
2502
+ params,
2503
+ );
2504
+ return res;
2505
+ },
2506
+
2507
+ get: async (
2508
+ id: Service.Check.Get.ID,
2509
+ params?: Service.Check.Get.Params,
2510
+ ): Promise<Service.Check.Get.Result> => {
2511
+ return await this._fetch(
2512
+ this.svAPIEndpoint,
2513
+ this.check._path + `/${id}`,
2514
+ params,
2515
+ );
2516
+ },
2517
+
2518
+ create: async (
2519
+ body: Service.Check.Create.Body,
2520
+ ): Promise<Service.Check.Create.Result> => {
2521
+ let res = await this._create(this.svAPIEndpoint, this.check._path, body);
2522
+ return res;
2523
+ },
2524
+ };
2525
+
2526
+ day = {
2527
+ _path: Repzo._end_points.DAY,
2528
+
2529
+ find: async (
2530
+ params?: Service.Day.Find.Params,
2531
+ ): Promise<Service.Day.Find.Result> => {
2532
+ let res: Service.Day.Find.Result = await this._fetch(
2533
+ this.svAPIEndpoint,
2534
+ this.day._path,
2535
+ params,
2536
+ );
2537
+ return res;
2538
+ },
2539
+
2540
+ get: async (
2541
+ id: Service.Day.Get.ID,
2542
+ params?: Service.Day.Get.Params,
2543
+ ): Promise<Service.Day.Get.Result> => {
2544
+ return await this._fetch(
2545
+ this.svAPIEndpoint,
2546
+ this.day._path + `/${id}`,
2547
+ params,
2548
+ );
2549
+ },
2550
+
2551
+ create: async (
2552
+ body: Service.Day.Create.Body,
2553
+ ): Promise<Service.Day.Create.Result> => {
2554
+ let res = await this._create(this.svAPIEndpoint, this.day._path, body);
2555
+ return res;
2556
+ },
2557
+ };
2558
+
2559
+ receivingMaterial = {
2560
+ _path: Repzo._end_points.RECEIVING_MATERIAL,
2561
+
2562
+ find: async (
2563
+ params?: Service.ReceivingMaterial.Find.Params,
2564
+ ): Promise<Service.ReceivingMaterial.Find.Result> => {
2565
+ let res: Service.ReceivingMaterial.Find.Result = await this._fetch(
2566
+ this.svAPIEndpoint,
2567
+ this.receivingMaterial._path,
2568
+ params,
2569
+ );
2570
+ return res;
2571
+ },
2572
+
2573
+ get: async (
2574
+ id: Service.ReceivingMaterial.Get.ID,
2575
+ params?: Service.ReceivingMaterial.Get.Params,
2576
+ ): Promise<Service.ReceivingMaterial.Get.Result> => {
2577
+ return await this._fetch(
2578
+ this.svAPIEndpoint,
2579
+ this.receivingMaterial._path + `/${id}`,
2580
+ params,
2581
+ );
2582
+ },
2583
+
2584
+ create: async (
2585
+ body: Service.ReceivingMaterial.Create.Body,
2586
+ ): Promise<Service.ReceivingMaterial.Create.Result> => {
2587
+ let res = await this._create(
2588
+ this.svAPIEndpoint,
2589
+ this.receivingMaterial._path,
2590
+ body,
2591
+ );
2592
+ return res;
2593
+ },
2594
+
2595
+ update: async (
2596
+ id: Service.ReceivingMaterial.Update.ID,
2597
+ body: Service.ReceivingMaterial.Update.Body,
2598
+ ): Promise<Service.ReceivingMaterial.Update.Result> => {
2599
+ let res: Service.ReceivingMaterial.Update.Result = await this._update(
2600
+ this.svAPIEndpoint,
2601
+ this.receivingMaterial._path + `/${id}`,
2602
+ body,
2603
+ );
2604
+ return res;
2605
+ },
2606
+ };
2607
+
2608
+ adjustAccount = {
2609
+ _path: Repzo._end_points.ADJUST_ACCOUNT,
2610
+ find: async (
2611
+ params?: Service.AdjustAccount.Find.Params,
2612
+ ): Promise<Service.AdjustAccount.Find.Result> => {
2613
+ let res: Service.AdjustAccount.Find.Result = await this._fetch(
2614
+ this.svAPIEndpoint,
2615
+ this.adjustAccount._path,
2616
+ params,
2617
+ );
2618
+ return res;
2619
+ },
2620
+
2621
+ get: async (
2622
+ id: Service.AdjustAccount.Get.ID,
2623
+ params?: Service.AdjustAccount.Get.Params,
2624
+ ): Promise<Service.AdjustAccount.Get.Result> => {
2625
+ return await this._fetch(
2626
+ this.svAPIEndpoint,
2627
+ this.adjustAccount._path + `/${id}`,
2628
+ params,
2629
+ );
2630
+ },
2631
+
2632
+ create: async (
2633
+ body: Service.AdjustAccount.Create.Body,
2634
+ ): Promise<Service.AdjustAccount.Create.Result> => {
2635
+ let res = await this._create(
2636
+ this.svAPIEndpoint,
2637
+ this.adjustAccount._path,
2638
+ body,
2639
+ );
2640
+ return res;
2641
+ },
2642
+ };
2643
+
2644
+ transfer = {
2645
+ _path: Repzo._end_points.TRANSFER,
2646
+ find: async (
2647
+ params?: Service.Transfer.Find.Params,
2648
+ ): Promise<Service.Transfer.Find.Result> => {
2649
+ let res: Service.Transfer.Find.Result = await this._fetch(
2650
+ this.svAPIEndpoint,
2651
+ this.transfer._path,
2652
+ params,
2653
+ );
2654
+ return res;
2655
+ },
2656
+
2657
+ get: async (
2658
+ id: Service.Transfer.Get.ID,
2659
+ params?: Service.Transfer.Get.Params,
2660
+ ): Promise<Service.Transfer.Get.Result> => {
2661
+ return await this._fetch(
2662
+ this.svAPIEndpoint,
2663
+ this.transfer._path + `/${id}`,
2664
+ params,
2665
+ );
2666
+ },
2667
+
2668
+ create: async (
2669
+ body: Service.Transfer.Create.Body,
2670
+ ): Promise<Service.Transfer.Create.Result> => {
2671
+ let res = await this._create(
2672
+ this.svAPIEndpoint,
2673
+ this.transfer._path,
2674
+ body,
2675
+ );
2676
+ return res;
2677
+ },
2678
+
2679
+ update: async (
2680
+ id: Service.Transfer.Update.ID,
2681
+ body: Service.Transfer.Update.Body,
2682
+ ): Promise<Service.Transfer.Update.Result> => {
2683
+ let res: Service.Transfer.Update.Result = await this._update(
2684
+ this.svAPIEndpoint,
2685
+ this.transfer._path + `/${id}`,
2686
+ body,
2687
+ );
2688
+ return res;
2689
+ },
2690
+ };
2691
+
2692
+ msl = {
2693
+ _path: Repzo._end_points.MSL,
2694
+ find: async (
2695
+ params?: Service.Msl.Find.Params,
2696
+ ): Promise<Service.Msl.Find.Result> => {
2697
+ let res: Service.Msl.Find.Result = await this._fetch(
2698
+ this.svAPIEndpoint,
2699
+ this.msl._path,
2700
+ params,
2701
+ );
2702
+ return res;
2703
+ },
2704
+
2705
+ get: async (
2706
+ id: Service.Msl.Get.ID,
2707
+ params?: Service.Msl.Get.Params,
2708
+ ): Promise<Service.Msl.Get.Result> => {
2709
+ return await this._fetch(
2710
+ this.svAPIEndpoint,
2711
+ this.msl._path + `/${id}`,
2712
+ params,
2713
+ );
2714
+ },
2715
+
2716
+ create: async (
2717
+ body: Service.Msl.Create.Body,
2718
+ ): Promise<Service.Msl.Create.Result> => {
2719
+ let res = await this._create(this.svAPIEndpoint, this.msl._path, body);
2720
+ return res;
2721
+ },
2722
+
2723
+ update: async (
2724
+ id: Service.Msl.Update.ID,
2725
+ body: Service.Msl.Update.Body,
2726
+ ): Promise<Service.Msl.Update.Result> => {
2727
+ let res: Service.Msl.Update.Result = await this._update(
2728
+ this.svAPIEndpoint,
2729
+ this.msl._path + `/${id}`,
2730
+ body,
2731
+ );
2732
+ return res;
2733
+ },
2734
+
2735
+ remove: async (
2736
+ id: Service.Msl.Remove.ID,
2737
+ ): Promise<Service.Msl.Remove.Result> => {
2738
+ let res: Service.Msl.Remove.Result = await this._delete(
2739
+ this.svAPIEndpoint,
2740
+ this.msl._path + `/${id}`,
2741
+ );
2742
+ return res;
2743
+ },
2744
+ };
2745
+
2746
+ mslProduct = {
2747
+ _path: Repzo._end_points.MSL_PRODUCT,
2748
+ find: async (
2749
+ params?: Service.MslProduct.Find.Params,
2750
+ ): Promise<Service.MslProduct.Find.Result> => {
2751
+ let res: Service.MslProduct.Find.Result = await this._fetch(
2752
+ this.svAPIEndpoint,
2753
+ this.mslProduct._path,
2754
+ params,
2755
+ );
2756
+ return res;
2757
+ },
2758
+
2759
+ get: async (
2760
+ id: Service.MslProduct.Get.ID,
2761
+ params?: Service.MslProduct.Get.Params,
2762
+ ): Promise<Service.MslProduct.Get.Result> => {
2763
+ return await this._fetch(
2764
+ this.svAPIEndpoint,
2765
+ this.mslProduct._path + `/${id}`,
2766
+ params,
2767
+ );
2768
+ },
2769
+
2770
+ create: async (
2771
+ body: Service.MslProduct.Create.Body,
2772
+ ): Promise<Service.MslProduct.Create.Result> => {
2773
+ let res = await this._create(
2774
+ this.svAPIEndpoint,
2775
+ this.mslProduct._path,
2776
+ body,
2777
+ );
2778
+ return res;
2779
+ },
2780
+
2781
+ update: async (
2782
+ id: Service.MslProduct.Update.ID,
2783
+ body: Service.MslProduct.Update.Body,
2784
+ ): Promise<Service.MslProduct.Update.Result> => {
2785
+ let res: Service.MslProduct.Update.Result = await this._update(
2786
+ this.svAPIEndpoint,
2787
+ this.mslProduct._path + `/${id}`,
2788
+ body,
2789
+ );
2790
+ return res;
2791
+ },
2792
+
2793
+ remove: async (
2794
+ id: Service.MslProduct.Remove.ID,
2795
+ ): Promise<Service.MslProduct.Remove.Result> => {
2796
+ let res: Service.MslProduct.Remove.Result = await this._delete(
2797
+ this.svAPIEndpoint,
2798
+ this.mslProduct._path + `/${id}`,
2799
+ );
2800
+ return res;
2801
+ },
2802
+ };
2803
+
2804
+ mediaStorage = {
2805
+ _path: Repzo._end_points.MEDIA_STORAGE,
2806
+ find: async (
2807
+ params?: Service.MediaStorage.Find.Params,
2808
+ ): Promise<Service.MediaStorage.Find.Result> => {
2809
+ let res: Service.MediaStorage.Find.Result = await this._fetch(
2810
+ this.svAPIEndpoint,
2811
+ this.mediaStorage._path,
2812
+ params,
2813
+ );
2814
+ return res;
2815
+ },
2816
+
2817
+ get: async (
2818
+ id: Service.MediaStorage.Get.ID,
2819
+ params?: Service.MediaStorage.Get.Params,
2820
+ ): Promise<Service.MediaStorage.Get.Result> => {
2821
+ return await this._fetch(
2822
+ this.svAPIEndpoint,
2823
+ this.mediaStorage._path + `/${id}`,
2824
+ params,
2825
+ );
2826
+ },
2827
+
2828
+ create: async (
2829
+ body: Service.MediaStorage.Create.Body,
2830
+ ): Promise<Service.MediaStorage.Create.Result> => {
2831
+ let res = await this._create(
2832
+ this.svAPIEndpoint,
2833
+ this.mediaStorage._path,
2834
+ body,
2835
+ );
2836
+ return res;
2837
+ },
2838
+
2839
+ update: async (
2840
+ id: Service.MediaStorage.Update.ID,
2841
+ body: Service.MediaStorage.Update.Body,
2842
+ ): Promise<Service.MediaStorage.Update.Result> => {
2843
+ let res: Service.MediaStorage.Update.Result = await this._update(
2844
+ this.svAPIEndpoint,
2845
+ this.mediaStorage._path + `/${id}`,
2846
+ body,
2847
+ );
2848
+ return res;
2849
+ },
2850
+
2851
+ remove: async (
2852
+ id: Service.MediaStorage.Remove.ID,
2853
+ ): Promise<Service.MediaStorage.Remove.Result> => {
2854
+ let res: Service.MediaStorage.Remove.Result = await this._delete(
2855
+ this.svAPIEndpoint,
2856
+ this.mediaStorage._path + `/${id}`,
2857
+ );
2858
+ return res;
2859
+ },
2860
+ };
2861
+
2862
+ storecheckTemplate = {
2863
+ _path: Repzo._end_points.STORECHECK_TEMPLATE,
2864
+ find: async (
2865
+ params?: Service.StorecheckTemplate.Find.Params,
2866
+ ): Promise<Service.StorecheckTemplate.Find.Result> => {
2867
+ let res: Service.StorecheckTemplate.Find.Result = await this._fetch(
2868
+ this.svAPIEndpoint,
2869
+ this.storecheckTemplate._path,
2870
+ params,
2871
+ );
2872
+ return res;
2873
+ },
2874
+
2875
+ get: async (
2876
+ id: Service.StorecheckTemplate.Get.ID,
2877
+ params?: Service.StorecheckTemplate.Get.Params,
2878
+ ): Promise<Service.StorecheckTemplate.Get.Result> => {
2879
+ return await this._fetch(
2880
+ this.svAPIEndpoint,
2881
+ this.storecheckTemplate._path + `/${id}`,
2882
+ params,
2883
+ );
2884
+ },
2885
+
2886
+ create: async (
2887
+ body: Service.StorecheckTemplate.Create.Body,
2888
+ ): Promise<Service.StorecheckTemplate.Create.Result> => {
2889
+ let res = await this._create(
2890
+ this.svAPIEndpoint,
2891
+ this.storecheckTemplate._path,
2892
+ body,
2893
+ );
2894
+ return res;
2895
+ },
2896
+
2897
+ update: async (
2898
+ id: Service.StorecheckTemplate.Update.ID,
2899
+ body: Service.StorecheckTemplate.Update.Body,
2900
+ ): Promise<Service.StorecheckTemplate.Update.Result> => {
2901
+ let res: Service.StorecheckTemplate.Update.Result = await this._update(
2902
+ this.svAPIEndpoint,
2903
+ this.storecheckTemplate._path + `/${id}`,
2904
+ body,
2905
+ );
2906
+ return res;
2907
+ },
2908
+
2909
+ remove: async (
2910
+ id: Service.StorecheckTemplate.Remove.ID,
2911
+ ): Promise<Service.StorecheckTemplate.Remove.Result> => {
2912
+ let res: Service.StorecheckTemplate.Remove.Result = await this._delete(
2913
+ this.svAPIEndpoint,
2914
+ this.storecheckTemplate._path + `/${id}`,
2915
+ );
2916
+ return res;
2917
+ },
2918
+ };
2919
+
2920
+ activityStorecheck = {
2921
+ _path: Repzo._end_points.ACTIVITY_STORECHECK,
2922
+ find: async (
2923
+ params?: Service.ActivityStorecheck.Find.Params,
2924
+ ): Promise<Service.ActivityStorecheck.Find.Result> => {
2925
+ let res: Service.ActivityStorecheck.Find.Result = await this._fetch(
2926
+ this.svAPIEndpoint,
2927
+ this.activityStorecheck._path,
2928
+ params,
2929
+ );
2930
+ return res;
2931
+ },
2932
+
2933
+ get: async (
2934
+ id: Service.ActivityStorecheck.Get.ID,
2935
+ params?: Service.ActivityStorecheck.Get.Params,
2936
+ ): Promise<Service.ActivityStorecheck.Get.Result> => {
2937
+ return await this._fetch(
2938
+ this.svAPIEndpoint,
2939
+ this.activityStorecheck._path + `/${id}`,
2940
+ params,
2941
+ );
2942
+ },
2943
+
2944
+ create: async (
2945
+ body: Service.ActivityStorecheck.Create.Body,
2946
+ ): Promise<Service.ActivityStorecheck.Create.Result> => {
2947
+ let res = await this._create(
2948
+ this.svAPIEndpoint,
2949
+ this.activityStorecheck._path,
2950
+ body,
2951
+ );
2952
+ return res;
2953
+ },
2954
+
2955
+ update: async (
2956
+ id: Service.ActivityStorecheck.Update.ID,
2957
+ body: Service.ActivityStorecheck.Update.Body,
2958
+ ): Promise<Service.ActivityStorecheck.Update.Result> => {
2959
+ let res: Service.ActivityStorecheck.Update.Result = await this._update(
2960
+ this.svAPIEndpoint,
2961
+ this.activityStorecheck._path + `/${id}`,
2962
+ body,
2963
+ );
2964
+ return res;
2965
+ },
2966
+ };
2967
+
2968
+ adjustInventory = {
2969
+ _path: Repzo._end_points.ADJUST_INVENTORY,
2970
+ find: async (
2971
+ params?: Service.AdjustInventory.Find.Params,
2972
+ ): Promise<Service.AdjustInventory.Find.Result> => {
2973
+ let res: Service.AdjustInventory.Find.Result = await this._fetch(
2974
+ this.svAPIEndpoint,
2975
+ this.adjustInventory._path,
2976
+ params,
2977
+ );
2978
+ return res;
2979
+ },
2980
+
2981
+ get: async (
2982
+ id: Service.AdjustInventory.Get.ID,
2983
+ params?: Service.AdjustInventory.Get.Params,
2984
+ ): Promise<Service.AdjustInventory.Get.Result> => {
2985
+ return await this._fetch(
2986
+ this.svAPIEndpoint,
2987
+ this.adjustInventory._path + `/${id}`,
2988
+ params,
2989
+ );
2990
+ },
2991
+
2992
+ create: async (
2993
+ body: Service.AdjustInventory.Create.Body,
2994
+ ): Promise<Service.AdjustInventory.Create.Result> => {
2995
+ let res = await this._create(
2996
+ this.svAPIEndpoint,
2997
+ this.adjustInventory._path,
2998
+ body,
2999
+ );
3000
+ return res;
3001
+ },
3002
+ };
3003
+
3004
+ inventory = {
3005
+ _path: Repzo._end_points.INVENTORY,
3006
+ find: async (
3007
+ params?: Service.Inventory.Find.Params,
3008
+ ): Promise<Service.Inventory.Find.Result> => {
3009
+ let res: Service.Inventory.Find.Result = await this._fetch(
3010
+ this.svAPIEndpoint,
3011
+ this.inventory._path,
3012
+ params,
3013
+ );
3014
+ return res;
3015
+ },
3016
+ };
3017
+
3018
+ integrationApp = {
3019
+ _path: Repzo._end_points.INTEGRATION_APP,
3020
+ find: async (
3021
+ params?: Service.App.Find.Params,
3022
+ ): Promise<Service.App.Find.Result> => {
3023
+ let res: Service.App.Find.Result = await this._fetch(
3024
+ this.svAPIEndpoint,
3025
+ this.integrationApp._path,
3026
+ params,
3027
+ );
3028
+ return res;
3029
+ },
3030
+
3031
+ get: async (
3032
+ id: Service.App.Get.ID,
3033
+ params?: Service.App.Find.Params,
3034
+ ): Promise<Service.App.Get.Result> => {
3035
+ return await this._fetch(
3036
+ this.svAPIEndpoint,
3037
+ this.integrationApp._path + `/${id}`,
3038
+ params,
3039
+ );
3040
+ },
3041
+
3042
+ create: async (
3043
+ body: Service.App.Create.Body,
3044
+ ): Promise<Service.App.Create.Result> => {
3045
+ let res = await this._create(
3046
+ this.svAPIEndpoint,
3047
+ this.integrationApp._path,
3048
+ body,
3049
+ );
3050
+ return res;
3051
+ },
3052
+
3053
+ update: async (
3054
+ id: Service.App.Update.ID,
3055
+ body: Service.App.Update.Body,
3056
+ ): Promise<Service.App.Update.Result> => {
3057
+ let res: Service.App.Update.Result = await this._update(
3058
+ this.svAPIEndpoint,
3059
+ this.integrationApp._path + `/${id}`,
3060
+ body,
3061
+ );
3062
+ return res;
3063
+ },
3064
+ };
3065
+
3066
+ joinActionsWebHook = {
3067
+ _path: Repzo._end_points.JOIN_ACTIONS_WEBHOOK,
3068
+ update: async (
3069
+ id: null,
3070
+ body: Service.JoinActionsWeHook.Data,
3071
+ ): Promise<Service.JoinActionsWeHook.Result> => {
3072
+ let res: Service.JoinActionsWeHook.Result = await this._update(
3073
+ this.svAPIEndpoint,
3074
+ this.joinActionsWebHook._path,
3075
+ body,
3076
+ );
3077
+ return res;
3078
+ },
3079
+ };
3080
+
3081
+ static ActionLogs = class {
3082
+ _path: string = "integration-action-log";
3083
+ available_app_name: string = "";
3084
+ available_app_id: StringId = "";
3085
+ app_id: StringId = "";
3086
+ action: string = "";
3087
+ status: Service.ActionLogs.Status;
3088
+ error?: any;
3089
+ start_time: number;
3090
+ end_time?: number;
3091
+ total_time?: number;
3092
+ company_namespace?: NameSpaces;
3093
+ body?: any;
3094
+ meta?: any;
3095
+ message: string;
3096
+ details: Service.ActionLogs.Detail[];
3097
+ sync_id: string;
3098
+ isOld: boolean;
3099
+ constructor(
3100
+ public superThis: Repzo,
3101
+ sync_id: string,
3102
+ ) {
3103
+ this.start_time = Date.now();
3104
+ this.status = "processing";
3105
+ this.message = "Log Created";
3106
+ this.details = [];
3107
+ this.sync_id = sync_id;
3108
+ this.isOld = true;
3109
+ }
3110
+ async load(sync_id: string) {
3111
+ const params: Service.ActionLogs.Find.Params = { sync_id: sync_id };
3112
+ const res: Service.ActionLogs.Find.Result = await this.superThis._fetch(
3113
+ this.superThis.svAPIEndpoint,
3114
+ this._path,
3115
+ params,
3116
+ );
3117
+ if (!res?.data?.length)
3118
+ throw new Error(`Action Log Not found, sync_id: ${sync_id}`);
3119
+ const action_log: Service.ActionLogs.Schema = res.data[0];
3120
+ this.sync_id = sync_id;
3121
+ this.details = action_log.details;
3122
+ this.status = action_log.status;
3123
+ this.error = action_log.error;
3124
+ this.start_time = action_log.start_time;
3125
+ this.body = action_log.body;
3126
+ this.meta = action_log.meta;
3127
+ this.message = action_log.message;
3128
+ this.app_id = action_log.app_id;
3129
+ this.available_app_id = action_log.available_app_id;
3130
+ this.available_app_name = action_log.available_app_name;
3131
+ this.company_namespace = action_log.company_namespace;
3132
+ this.action = action_log.action;
3133
+ this.isOld = true;
3134
+
3135
+ return this;
3136
+ }
3137
+ setStatus(status: Service.ActionLogs.Status, error?: any) {
3138
+ this.details.push({
3139
+ timestamp: Date.now(),
3140
+ content: `status was changed from ${this.status} to ${status}`,
3141
+ });
3142
+ this.status = status;
3143
+ if (error) {
3144
+ if (typeof error == "string") {
3145
+ this.error = { message: error };
3146
+ } else if (error.message || error.response?.data) {
3147
+ this.error = {
3148
+ // json: error.toJSON ? error.toJSON() : undefined,
3149
+ message: error.message,
3150
+ responseData: error.response?.data,
3151
+ };
3152
+ } else {
3153
+ this.error = error;
3154
+ }
3155
+ return this;
3156
+ }
3157
+ return this;
3158
+ }
3159
+ setBody(body: any) {
3160
+ this.body = body;
3161
+ return this;
3162
+ }
3163
+ setMeta(meta: any) {
3164
+ this.meta = meta;
3165
+ return this;
3166
+ }
3167
+ async commit() {
3168
+ let doc: Service.ActionLogs.Create.Body = {
3169
+ available_app_name: this.available_app_name,
3170
+ available_app_id: this.available_app_id,
3171
+ app_id: this.app_id,
3172
+ action: this.action,
3173
+ company_namespace: this.company_namespace,
3174
+ status: this.status,
3175
+ error: this.error ? this.error : undefined,
3176
+ start_time: this.start_time,
3177
+ end_time: Date.now(),
3178
+ total_time: Date.now() - this.start_time,
3179
+ body: this.body,
3180
+ meta: this.meta,
3181
+ message: this.message,
3182
+ details: this.details,
3183
+ sync_id: this.sync_id,
3184
+ };
3185
+ try {
3186
+ const res: Service.ActionLogs.Create.Result =
3187
+ await this.superThis._create(
3188
+ this.superThis.svAPIEndpoint,
3189
+ this._path,
3190
+ doc,
3191
+ );
3192
+ } catch (e) {
3193
+ console.error(e);
3194
+ }
3195
+ return this;
3196
+ }
3197
+ addDetail(detail: string, meta?: any) {
3198
+ let d: Service.ActionLogs.Detail = {
3199
+ timestamp: Date.now(),
3200
+ content: detail,
3201
+ };
3202
+ this.message = detail;
3203
+ if (meta) d.meta = meta;
3204
+ this.details.push(d);
3205
+ return this;
3206
+ }
3207
+ };
3208
+
3209
+ static CommandLog = class {
3210
+ _path: string = "integration-command-log";
3211
+ available_app_name: string;
3212
+ available_app_id: StringId;
3213
+ app_id: StringId;
3214
+ command: string;
3215
+ status: Service.CommandLog.Status;
3216
+ error?: any;
3217
+ start_time: number;
3218
+ end_time?: number;
3219
+ total_time?: number;
3220
+ company_namespace: NameSpaces;
3221
+ body?: any;
3222
+ sync_details: { timestamp: number; body: { [key: string]: any } }[];
3223
+ error_details: { timestamp: number; error: { [key: string]: any } }[];
3224
+ meta?: any;
3225
+ message: string;
3226
+ details: Service.CommandLog.Detail[];
3227
+ sync_id: string;
3228
+ isOld: boolean;
3229
+ priority?: number;
3230
+ isPrioritized: boolean;
3231
+ retries: number;
3232
+ queuedAt?: Date;
3233
+ failedAt?: Date;
3234
+ succeededAt?: Date;
3235
+ skippedAt?: Date;
3236
+ receivedAt?: Date;
3237
+ processedAt?: Date;
3238
+ onGoing: boolean;
3239
+ trigger?: string;
3240
+ constructor(
3241
+ public superThis: Repzo,
3242
+ app: Service.App.Schema_with_populated_AvailableApp,
3243
+ command: string,
3244
+ trigger?: string,
3245
+ ) {
3246
+ this.app_id = app._id;
3247
+ this.available_app_id = app.available_app._id;
3248
+ this.available_app_name = app.available_app.name;
3249
+ this.company_namespace = app.company_namespace;
3250
+ this.start_time = Date.now();
3251
+ this.status = "received";
3252
+ this.message = "Request received";
3253
+ this.command = command;
3254
+ this.details = [{ timestamp: Date.now(), content: "Request received" }];
3255
+ this.sync_id = uuid();
3256
+ this.isOld = false;
3257
+ this.isPrioritized = false;
3258
+ this.retries = 1;
3259
+ this.trigger = trigger;
3260
+ this.onGoing = true;
3261
+ this.sync_details = [];
3262
+ this.error_details = [];
3263
+ }
3264
+ async load(sync_id?: string, retries?: number) {
3265
+ if (sync_id) {
3266
+ const params: Service.CommandLog.Find.Params = { sync_id: sync_id };
3267
+ const res: Service.CommandLog.Find.Result = await this.superThis._fetch(
3268
+ this.superThis.svAPIEndpoint,
3269
+ this._path,
3270
+ params,
3271
+ );
3272
+ if (!res?.data?.length)
3273
+ throw new Error(`Command Log Not found, sync_id: ${sync_id}`);
3274
+ const command_log: Service.CommandLog.Schema = res.data[0];
3275
+
3276
+ if (command_log) {
3277
+ this.sync_id = sync_id;
3278
+ this.details = command_log.details;
3279
+ this.status = command_log.status;
3280
+ this.error = command_log.error;
3281
+ this.start_time = command_log.start_time;
3282
+ this.body = command_log.body;
3283
+ this.meta = command_log.meta;
3284
+ this.message = command_log.message;
3285
+ this.retries =
3286
+ retries !== undefined
3287
+ ? retries
3288
+ : command_log.retries || this.retries; // retries !== undefined ? retries : command_log.retries;
3289
+ this.isOld = true;
3290
+ this.failedAt = command_log.failedAt;
3291
+ this.succeededAt = command_log.succeededAt;
3292
+ this.skippedAt = command_log.skippedAt;
3293
+ this.receivedAt = command_log.receivedAt;
3294
+ this.processedAt = command_log.processedAt;
3295
+ this.onGoing = command_log.onGoing || false;
3296
+ this.trigger = command_log.trigger;
3297
+ this.sync_details = command_log.sync_details;
3298
+ this.error_details = command_log.error_details;
3299
+ // this.priority = command_log.priority
3300
+ // ? command_log.priority
3301
+ // : this.priority
3302
+ // ? this.priority
3303
+ // : undefined;
3304
+ }
3305
+ }
3306
+ return this;
3307
+ }
3308
+ setStatus(status: Service.CommandLog.Status, error?: any) {
3309
+ this.addDetail(`status was changed from ${this.status} to ${status}`);
3310
+ this.status = status;
3311
+ if (error) {
3312
+ if (!this.error_details) this.error_details = [];
3313
+ if (typeof error == "string") {
3314
+ this.error = { message: error };
3315
+ } else if (error.message || error.response?.data) {
3316
+ this.error = {
3317
+ // json: error.toJSON ? error.toJSON() : undefined,
3318
+ message: error.message,
3319
+ responseData: error.response?.data,
3320
+ };
3321
+ } else {
3322
+ this.error = error;
3323
+ }
3324
+ this.error_details = [
3325
+ {
3326
+ timestamp: Date.now(),
3327
+ error: this.error,
3328
+ },
3329
+ ];
3330
+
3331
+ return this;
3332
+ }
3333
+ switch (status) {
3334
+ case "fail":
3335
+ this.failedAt = new Date();
3336
+ this.onGoing = false;
3337
+ break;
3338
+ case "processing":
3339
+ this.processedAt = new Date();
3340
+ this.onGoing = true;
3341
+ break;
3342
+ case "queued":
3343
+ this.queuedAt = new Date();
3344
+ this.onGoing = true;
3345
+ break;
3346
+ case "received":
3347
+ this.receivedAt = new Date();
3348
+ this.onGoing = true;
3349
+ break;
3350
+ case "skipped":
3351
+ this.skippedAt = new Date();
3352
+ this.onGoing = false;
3353
+ break;
3354
+ case "success":
3355
+ this.succeededAt = new Date();
3356
+ this.onGoing = false;
3357
+ break;
3358
+ }
3359
+ return this;
3360
+ }
3361
+ setBody(body: any) {
3362
+ this.body = body;
3363
+ if (!this.sync_details) this.sync_details = [];
3364
+ this.sync_details = [
3365
+ {
3366
+ timestamp: Date.now(),
3367
+ body: this.body,
3368
+ },
3369
+ ];
3370
+ return this;
3371
+ }
3372
+ setMeta(meta: any) {
3373
+ this.meta = meta;
3374
+ return this;
3375
+ }
3376
+ async commit() {
3377
+ let doc: Service.CommandLog.Create.Body = {
3378
+ available_app_name: this.available_app_name,
3379
+ available_app_id: this.available_app_id,
3380
+ app_id: this.app_id,
3381
+ command: this.command,
3382
+ status: this.status,
3383
+ error: this.error ? this.error : undefined,
3384
+ start_time: this.start_time,
3385
+ end_time: Date.now(),
3386
+ total_time: Date.now() - this.start_time,
3387
+ company_namespace: this.company_namespace,
3388
+ body: this.body,
3389
+ meta: this.meta,
3390
+ message: this.message,
3391
+ details: this.details,
3392
+ sync_id: this.sync_id,
3393
+ // priority: this.priority ? this.priority : undefined,
3394
+ queuedAt: this.queuedAt ? this.queuedAt : undefined,
3395
+ failedAt: this.failedAt ? this.failedAt : undefined,
3396
+ succeededAt: this.succeededAt ? this.succeededAt : undefined,
3397
+ skippedAt: this.skippedAt ? this.skippedAt : undefined,
3398
+ receivedAt: this.receivedAt ? this.receivedAt : undefined,
3399
+ processedAt: this.processedAt ? this.processedAt : undefined,
3400
+ onGoing: this.onGoing !== undefined ? this.onGoing : undefined,
3401
+ retries: this.retries !== undefined ? this.retries : undefined,
3402
+ trigger: this.trigger,
3403
+ sync_details: this.sync_details,
3404
+ error_details: this.error_details,
3405
+ };
3406
+ try {
3407
+ const res: Service.CommandLog.Create.Result =
3408
+ await this.superThis._create(
3409
+ this.superThis.svAPIEndpoint,
3410
+ this._path,
3411
+ doc,
3412
+ );
3413
+ this.isOld = true;
3414
+ } catch (e) {
3415
+ console.error(e);
3416
+ }
3417
+ return this;
3418
+ }
3419
+ addDetail(detail: string, meta?: any) {
3420
+ if (!this.details) this.details = [];
3421
+ this.details = [
3422
+ {
3423
+ timestamp: Date.now(),
3424
+ content: detail,
3425
+ meta,
3426
+ },
3427
+ ];
3428
+ this.message = detail;
3429
+ return this;
3430
+ }
3431
+ };
3432
+
3433
+ patchAction = {
3434
+ _path: Repzo._end_points.PATCH_ACTION,
3435
+ create: async (
3436
+ body: Service.PatchAction.Create.Body,
3437
+ params?: Service.PatchAction.Create.Params,
3438
+ ): Promise<Service.PatchAction.Create.Result> => {
3439
+ const res: Service.PatchAction.Create.Result = await this._create(
3440
+ this.svAPIEndpoint,
3441
+ this.patchAction._path,
3442
+ body,
3443
+ params,
3444
+ );
3445
+ return res;
3446
+ },
3447
+
3448
+ update: async (
3449
+ body: Service.PatchAction.Update.Body,
3450
+ ): Promise<Service.PatchAction.Update.Result> => {
3451
+ const res: Service.PatchAction.Update.Result = await this._update(
3452
+ this.svAPIEndpoint,
3453
+ this.patchAction._path,
3454
+ body,
3455
+ );
3456
+ return res;
3457
+ },
3458
+ };
3459
+
3460
+ updateIntegrationMeta = {
3461
+ _path: Repzo._end_points.UPDATE_INTEGRATION_META,
3462
+ create: async (
3463
+ body: Service.UpdateIntegrationMeta.Create.Body,
3464
+ params?: Service.UpdateIntegrationMeta.Create.Params,
3465
+ ): Promise<Service.UpdateIntegrationMeta.Create.Result> => {
3466
+ let res = await this._create(
3467
+ this.svAPIEndpoint,
3468
+ this.updateIntegrationMeta._path,
3469
+ body,
3470
+ params,
3471
+ );
3472
+ return res;
3473
+ },
3474
+ };
3475
+
3476
+ assetPartType = {
3477
+ _path: Repzo._end_points.ASSET_PART_TYPE,
3478
+ find: async (
3479
+ params?: Service.AssetPartType.Find.Params,
3480
+ ): Promise<Service.AssetPartType.Find.Result> => {
3481
+ let res: Service.AssetPartType.Find.Result = await this._fetch(
3482
+ this.svAPIEndpoint,
3483
+ this.assetPartType._path,
3484
+ params,
3485
+ );
3486
+ return res;
3487
+ },
3488
+ get: async (
3489
+ id: Service.AssetPartType.Get.ID,
3490
+ ): Promise<Service.AssetPartType.Get.Result> => {
3491
+ return await this._fetch(
3492
+ this.svAPIEndpoint,
3493
+ this.assetPartType._path + `/${id}`,
3494
+ );
3495
+ },
3496
+ create: async (
3497
+ body: Service.AssetPartType.Create.Body,
3498
+ ): Promise<Service.AssetPartType.Create.Result> => {
3499
+ let res = await this._create(
3500
+ this.svAPIEndpoint,
3501
+ this.assetPartType._path,
3502
+ body,
3503
+ );
3504
+ return res;
3505
+ },
3506
+ update: async (
3507
+ id: Service.AssetPartType.Update.ID,
3508
+ body: Service.AssetPartType.Update.Body,
3509
+ ): Promise<Service.AssetPartType.Update.Result> => {
3510
+ let res: Service.AssetPartType.Update.Result = await this._update(
3511
+ this.svAPIEndpoint,
3512
+ this.assetPartType._path + `/${id}`,
3513
+ body,
3514
+ );
3515
+ return res;
3516
+ },
3517
+ remove: async (
3518
+ id: Service.AssetPartType.Remove.ID,
3519
+ ): Promise<Service.AssetPartType.Remove.Result> => {
3520
+ let res: Service.AssetPartType.Remove.Result = await this._delete(
3521
+ this.svAPIEndpoint,
3522
+ this.assetPartType._path + `/${id}`,
3523
+ );
3524
+ return res;
3525
+ },
3526
+ };
3527
+
3528
+ assetPart = {
3529
+ _path: Repzo._end_points.ASSET_PART,
3530
+ find: async (
3531
+ params?: Service.AssetPart.Find.Params,
3532
+ ): Promise<Service.AssetPart.Find.Result> => {
3533
+ let res: Service.AssetPart.Find.Result = await this._fetch(
3534
+ this.svAPIEndpoint,
3535
+ this.assetPart._path,
3536
+ params,
3537
+ );
3538
+ return res;
3539
+ },
3540
+ get: async (
3541
+ id: Service.AssetPart.Get.ID,
3542
+ params?: Service.AssetPart.Get.Params,
3543
+ ): Promise<Service.AssetPart.Get.Result> => {
3544
+ return await this._fetch(
3545
+ this.svAPIEndpoint,
3546
+ this.assetPart._path + `/${id}`,
3547
+ params,
3548
+ );
3549
+ },
3550
+ create: async (
3551
+ body: Service.AssetPart.Create.Body,
3552
+ ): Promise<Service.AssetPart.Create.Result> => {
3553
+ let res = await this._create(
3554
+ this.svAPIEndpoint,
3555
+ this.assetPart._path,
3556
+ body,
3557
+ );
3558
+ return res;
3559
+ },
3560
+ update: async (
3561
+ id: Service.AssetPart.Update.ID,
3562
+ body: Service.AssetPart.Update.Body,
3563
+ ): Promise<Service.AssetPart.Update.Result> => {
3564
+ let res: Service.AssetPart.Update.Result = await this._update(
3565
+ this.svAPIEndpoint,
3566
+ this.assetPart._path + `/${id}`,
3567
+ body,
3568
+ );
3569
+ return res;
3570
+ },
3571
+ remove: async (
3572
+ id: Service.AssetPart.Remove.ID,
3573
+ ): Promise<Service.AssetPart.Remove.Result> => {
3574
+ let res: Service.AssetPart.Remove.Result = await this._delete(
3575
+ this.svAPIEndpoint,
3576
+ this.assetPart._path + `/${id}`,
3577
+ );
3578
+ return res;
3579
+ },
3580
+ };
3581
+
3582
+ assetPartUnit = {
3583
+ _path: Repzo._end_points.ASSET_PART_UNIT,
3584
+ find: async (
3585
+ params?: Service.AssetPartUnit.Find.Params,
3586
+ ): Promise<Service.AssetPartUnit.Find.Result> => {
3587
+ let res: Service.AssetPartUnit.Find.Result = await this._fetch(
3588
+ this.svAPIEndpoint,
3589
+ this.assetPartUnit._path,
3590
+ params,
3591
+ );
3592
+ return res;
3593
+ },
3594
+ get: async (
3595
+ id: Service.AssetPartUnit.Get.ID,
3596
+ params?: Service.AssetPartUnit.Get.Params,
3597
+ ): Promise<Service.AssetPartUnit.Get.Result> => {
3598
+ return await this._fetch(
3599
+ this.svAPIEndpoint,
3600
+ this.assetPartUnit._path + `/${id}`,
3601
+ params,
3602
+ );
3603
+ },
3604
+ update: async (
3605
+ id: Service.AssetPartUnit.Update.ID,
3606
+ body: Service.AssetPartUnit.Update.Body,
3607
+ ): Promise<Service.AssetPartUnit.Update.Result> => {
3608
+ let res: Service.AssetPartUnit.Update.Result = await this._update(
3609
+ this.svAPIEndpoint,
3610
+ this.assetPartUnit._path + `/${id}`,
3611
+ body,
3612
+ );
3613
+ return res;
3614
+ },
3615
+ };
3616
+
3617
+ assetPartReceival = {
3618
+ _path: Repzo._end_points.ASSET_PART_RECEIVAL,
3619
+ find: async (
3620
+ params?: Service.AssetPartReceival.Find.Params,
3621
+ ): Promise<Service.AssetPartReceival.Find.Result> => {
3622
+ let res: Service.AssetPartReceival.Find.Result = await this._fetch(
3623
+ this.svAPIEndpoint,
3624
+ this.assetPartReceival._path,
3625
+ params,
3626
+ );
3627
+ return res;
3628
+ },
3629
+ get: async (
3630
+ id: Service.AssetPartReceival.Get.ID,
3631
+ params?: Service.AssetPartReceival.Get.Params,
3632
+ ): Promise<Service.AssetPartReceival.Get.Result> => {
3633
+ return await this._fetch(
3634
+ this.svAPIEndpoint,
3635
+ this.assetPartReceival._path + `/${id}`,
3636
+ params,
3637
+ );
3638
+ },
3639
+ create: async (
3640
+ body: Service.AssetPartReceival.Create.Body,
3641
+ ): Promise<Service.AssetPartReceival.Create.Result> => {
3642
+ let res = await this._create(
3643
+ this.svAPIEndpoint,
3644
+ this.assetPartReceival._path,
3645
+ body,
3646
+ );
3647
+ return res;
3648
+ },
3649
+ update: async (
3650
+ id: Service.AssetPartReceival.Update.ID,
3651
+ body: Service.AssetPartReceival.Update.Body,
3652
+ ): Promise<Service.AssetPartReceival.Update.Result> => {
3653
+ let res: Service.AssetPartReceival.Update.Result = await this._update(
3654
+ this.svAPIEndpoint,
3655
+ this.assetPartReceival._path + `/${id}`,
3656
+ body,
3657
+ );
3658
+ return res;
3659
+ },
3660
+ patch: async (
3661
+ params: Service.AssetPartReceival.Patch.Params,
3662
+ body: Service.AssetPartReceival.Patch.Body,
3663
+ ): Promise<Service.AssetPartReceival.Patch.Result> => {
3664
+ let res: Service.AssetPartReceival.Patch.Result = await this._patch(
3665
+ this.svAPIEndpoint,
3666
+ this.assetPartReceival._path,
3667
+ body,
3668
+ params,
3669
+ );
3670
+ return res;
3671
+ },
3672
+ };
3673
+
3674
+ assetPartTransfer = {
3675
+ _path: Repzo._end_points.ASSET_PART_TRANSFER,
3676
+ find: async (
3677
+ params?: Service.AssetPartTransfer.Find.Params,
3678
+ ): Promise<Service.AssetPartTransfer.Find.Result> => {
3679
+ let res: Service.AssetPartTransfer.Find.Result = await this._fetch(
3680
+ this.svAPIEndpoint,
3681
+ this.assetPartTransfer._path,
3682
+ params,
3683
+ );
3684
+ return res;
3685
+ },
3686
+ get: async (
3687
+ id: Service.AssetPartTransfer.Get.ID,
3688
+ params?: Service.AssetPartTransfer.Get.Params,
3689
+ ): Promise<Service.AssetPartTransfer.Get.Result> => {
3690
+ return await this._fetch(
3691
+ this.svAPIEndpoint,
3692
+ this.assetPartTransfer._path + `/${id}`,
3693
+ params,
3694
+ );
3695
+ },
3696
+ create: async (
3697
+ body: Service.AssetPartTransfer.Create.Body,
3698
+ ): Promise<Service.AssetPartTransfer.Create.Result> => {
3699
+ let res = await this._create(
3700
+ this.svAPIEndpoint,
3701
+ this.assetPartTransfer._path,
3702
+ body,
3703
+ );
3704
+ return res;
3705
+ },
3706
+ update: async (
3707
+ id: Service.AssetPartTransfer.Update.ID,
3708
+ body: Service.AssetPartTransfer.Update.Body,
3709
+ ): Promise<Service.AssetPartTransfer.Update.Result> => {
3710
+ let res: Service.AssetPartTransfer.Update.Result = await this._update(
3711
+ this.svAPIEndpoint,
3712
+ this.assetPartTransfer._path + `/${id}`,
3713
+ body,
3714
+ );
3715
+ return res;
3716
+ },
3717
+ patch: async (
3718
+ params: Service.AssetPartTransfer.Patch.Params,
3719
+ body: Service.AssetPartTransfer.Patch.Body,
3720
+ ): Promise<Service.AssetPartTransfer.Patch.Result> => {
3721
+ let res: Service.AssetPartTransfer.Patch.Result = await this._patch(
3722
+ this.svAPIEndpoint,
3723
+ this.assetPartTransfer._path,
3724
+ body,
3725
+ params,
3726
+ );
3727
+ return res;
3728
+ },
3729
+ };
3730
+
3731
+ returnAssetPartUnit = {
3732
+ _path: Repzo._end_points.RETURN_ASSET_PART_UNIT,
3733
+ find: async (
3734
+ params?: Service.ReturnAssetPartUnit.Find.Params,
3735
+ ): Promise<Service.ReturnAssetPartUnit.Find.Result> => {
3736
+ let res: Service.ReturnAssetPartUnit.Find.Result = await this._fetch(
3737
+ this.svAPIEndpoint,
3738
+ this.returnAssetPartUnit._path,
3739
+ params,
3740
+ );
3741
+ return res;
3742
+ },
3743
+ get: async (
3744
+ id: Service.ReturnAssetPartUnit.Get.ID,
3745
+ params?: Service.ReturnAssetPartUnit.Get.Params,
3746
+ ): Promise<Service.ReturnAssetPartUnit.Get.Result> => {
3747
+ return await this._fetch(
3748
+ this.svAPIEndpoint,
3749
+ this.returnAssetPartUnit._path + `/${id}`,
3750
+ params,
3751
+ );
3752
+ },
3753
+ create: async (
3754
+ body: Service.ReturnAssetPartUnit.Create.Body,
3755
+ ): Promise<Service.ReturnAssetPartUnit.Create.Result> => {
3756
+ let res = await this._create(
3757
+ this.svAPIEndpoint,
3758
+ this.returnAssetPartUnit._path,
3759
+ body,
3760
+ );
3761
+ return res;
3762
+ },
3763
+ update: async (
3764
+ id: Service.ReturnAssetPartUnit.Update.ID,
3765
+ body: Service.ReturnAssetPartUnit.Update.Body,
3766
+ ): Promise<Service.ReturnAssetPartUnit.Update.Result> => {
3767
+ let res: Service.ReturnAssetPartUnit.Update.Result = await this._update(
3768
+ this.svAPIEndpoint,
3769
+ this.returnAssetPartUnit._path + `/${id}`,
3770
+ body,
3771
+ );
3772
+ return res;
3773
+ },
3774
+ patch: async (
3775
+ params: Service.ReturnAssetPartUnit.Patch.Params,
3776
+ body: Service.ReturnAssetPartUnit.Patch.Body,
3777
+ ): Promise<Service.ReturnAssetPartUnit.Patch.Result> => {
3778
+ let res: Service.ReturnAssetPartUnit.Patch.Result = await this._patch(
3779
+ this.svAPIEndpoint,
3780
+ this.returnAssetPartUnit._path,
3781
+ body,
3782
+ params,
3783
+ );
3784
+ return res;
3785
+ },
3786
+ };
3787
+
3788
+ storeAssetPartUnit = {
3789
+ _path: Repzo._end_points.STORE_ASSET_PART_UNIT,
3790
+ find: async (
3791
+ params?: Service.StoreAssetPartUnit.Find.Params,
3792
+ ): Promise<Service.StoreAssetPartUnit.Find.Result> => {
3793
+ let res: Service.StoreAssetPartUnit.Find.Result = await this._fetch(
3794
+ this.svAPIEndpoint,
3795
+ this.storeAssetPartUnit._path,
3796
+ params,
3797
+ );
3798
+ return res;
3799
+ },
3800
+ get: async (
3801
+ id: Service.StoreAssetPartUnit.Get.ID,
3802
+ params?: Service.StoreAssetPartUnit.Get.Params,
3803
+ ): Promise<Service.StoreAssetPartUnit.Get.Result> => {
3804
+ return await this._fetch(
3805
+ this.svAPIEndpoint,
3806
+ this.storeAssetPartUnit._path + `/${id}`,
3807
+ params,
3808
+ );
3809
+ },
3810
+ create: async (
3811
+ body: Service.StoreAssetPartUnit.Create.Body,
3812
+ ): Promise<Service.StoreAssetPartUnit.Create.Result> => {
3813
+ let res = await this._create(
3814
+ this.svAPIEndpoint,
3815
+ this.storeAssetPartUnit._path,
3816
+ body,
3817
+ );
3818
+ return res;
3819
+ },
3820
+ update: async (
3821
+ id: Service.StoreAssetPartUnit.Update.ID,
3822
+ body: Service.StoreAssetPartUnit.Update.Body,
3823
+ ): Promise<Service.StoreAssetPartUnit.Update.Result> => {
3824
+ let res: Service.StoreAssetPartUnit.Update.Result = await this._update(
3825
+ this.svAPIEndpoint,
3826
+ this.storeAssetPartUnit._path + `/${id}`,
3827
+ body,
3828
+ );
3829
+ return res;
3830
+ },
3831
+ patch: async (
3832
+ params: Service.StoreAssetPartUnit.Patch.Params,
3833
+ body: Service.StoreAssetPartUnit.Patch.Body,
3834
+ ): Promise<Service.StoreAssetPartUnit.Patch.Result> => {
3835
+ let res: Service.StoreAssetPartUnit.Patch.Result = await this._patch(
3836
+ this.svAPIEndpoint,
3837
+ this.storeAssetPartUnit._path,
3838
+ body,
3839
+ params,
3840
+ );
3841
+ return res;
3842
+ },
3843
+ };
3844
+
3845
+ ocrInvoiceJobTemplate = {
3846
+ _path: Repzo._end_points.OCR_INVOICE_JOB_TEMPLATE,
3847
+ find: async (
3848
+ params?: Service.OcrInvoiceJobTemplate.Find.Params,
3849
+ ): Promise<Service.OcrInvoiceJobTemplate.Find.Result> => {
3850
+ let res: Service.OcrInvoiceJobTemplate.Find.Result = await this._fetch(
3851
+ this.svAPIEndpoint,
3852
+ this.ocrInvoiceJobTemplate._path,
3853
+ params,
3854
+ );
3855
+ return res;
3856
+ },
3857
+ get: async (
3858
+ id: Service.OcrInvoiceJobTemplate.Get.ID,
3859
+ ): Promise<Service.OcrInvoiceJobTemplate.Get.Result> => {
3860
+ return await this._fetch(
3861
+ this.svAPIEndpoint,
3862
+ this.ocrInvoiceJobTemplate._path + `/${id}`,
3863
+ );
3864
+ },
3865
+ create: async (
3866
+ body: Service.OcrInvoiceJobTemplate.Create.Body,
3867
+ ): Promise<Service.OcrInvoiceJobTemplate.Create.Result> => {
3868
+ let res = await this._create(
3869
+ this.svAPIEndpoint,
3870
+ this.ocrInvoiceJobTemplate._path,
3871
+ body,
3872
+ );
3873
+ return res;
3874
+ },
3875
+ update: async (
3876
+ id: Service.OcrInvoiceJobTemplate.Update.ID,
3877
+ body: Service.OcrInvoiceJobTemplate.Update.Body,
3878
+ ): Promise<Service.OcrInvoiceJobTemplate.Update.Result> => {
3879
+ let res: Service.OcrInvoiceJobTemplate.Update.Result = await this._update(
3880
+ this.svAPIEndpoint,
3881
+ this.ocrInvoiceJobTemplate._path + `/${id}`,
3882
+ body,
3883
+ );
3884
+ return res;
3885
+ },
3886
+ };
3887
+
3888
+ ocrInvoiceJobGroup = {
3889
+ _path: Repzo._end_points.OCR_INVOICE_JOB_GROUP,
3890
+ find: async (
3891
+ params?: Service.OcrInvoiceJobGroup.Find.Params,
3892
+ ): Promise<Service.OcrInvoiceJobGroup.Find.Result> => {
3893
+ let res: Service.OcrInvoiceJobGroup.Find.Result = await this._fetch(
3894
+ this.svAPIEndpoint,
3895
+ this.ocrInvoiceJobGroup._path,
3896
+ params,
3897
+ );
3898
+ return res;
3899
+ },
3900
+ get: async (
3901
+ id: Service.OcrInvoiceJobGroup.Get.ID,
3902
+ ): Promise<Service.OcrInvoiceJobGroup.Get.Result> => {
3903
+ return await this._fetch(
3904
+ this.svAPIEndpoint,
3905
+ this.ocrInvoiceJobGroup._path + `/${id}`,
3906
+ );
3907
+ },
3908
+ create: async (
3909
+ body: Service.OcrInvoiceJobGroup.Create.Body,
3910
+ ): Promise<Service.OcrInvoiceJobGroup.Create.Result> => {
3911
+ let res = await this._create(
3912
+ this.svAPIEndpoint,
3913
+ this.ocrInvoiceJobGroup._path,
3914
+ body,
3915
+ );
3916
+ return res;
3917
+ },
3918
+ };
3919
+
3920
+ activityAiSalesOrder = {
3921
+ _path: Repzo._end_points.ACTIVITY_AI_SALES_ORDER,
3922
+ find: async (
3923
+ params?: Service.ActivityAiSalesOrder.Find.Params,
3924
+ ): Promise<Service.ActivityAiSalesOrder.Find.Result> => {
3925
+ let res: Service.ActivityAiSalesOrder.Find.Result = await this._fetch(
3926
+ this.svAPIEndpoint,
3927
+ this.activityAiSalesOrder._path,
3928
+ params,
3929
+ );
3930
+ return res;
3931
+ },
3932
+ get: async (
3933
+ id: Service.ActivityAiSalesOrder.Get.ID,
3934
+ ): Promise<Service.ActivityAiSalesOrder.Get.Result> => {
3935
+ return await this._fetch(
3936
+ this.svAPIEndpoint,
3937
+ this.activityAiSalesOrder._path + `/${id}`,
3938
+ );
3939
+ },
3940
+ create: async (
3941
+ body: Service.ActivityAiSalesOrder.Create.Body,
3942
+ ): Promise<Service.ActivityAiSalesOrder.Create.Result> => {
3943
+ let res = await this._create(
3944
+ this.svAPIEndpoint,
3945
+ this.activityAiSalesOrder._path,
3946
+ body,
3947
+ );
3948
+ return res;
3949
+ },
3950
+ };
3951
+
3952
+ ocrInvoiceJob = {
3953
+ _path: Repzo._end_points.OCR_INVOICE_JOB,
3954
+ find: async (
3955
+ params?: Service.OcrInvoiceJob.Find.Params,
3956
+ ): Promise<Service.OcrInvoiceJob.Find.Result> => {
3957
+ let res: Service.OcrInvoiceJob.Find.Result = await this._fetch(
3958
+ this.svAPIEndpoint,
3959
+ this.ocrInvoiceJob._path,
3960
+ params,
3961
+ );
3962
+ return res;
3963
+ },
3964
+ get: async (
3965
+ id: Service.OcrInvoiceJob.Get.ID,
3966
+ ): Promise<Service.OcrInvoiceJob.Get.Result> => {
3967
+ return await this._fetch(
3968
+ this.svAPIEndpoint,
3969
+ this.ocrInvoiceJob._path + `/${id}`,
3970
+ );
3971
+ },
3972
+ };
3973
+
3974
+ ocrInvoiceJobPage = {
3975
+ _path: Repzo._end_points.OCR_INVOICE_JOB_PAGE,
3976
+ find: async (
3977
+ params?: Service.OcrInvoiceJobPage.Find.Params,
3978
+ ): Promise<Service.OcrInvoiceJobPage.Find.Result> => {
3979
+ let res: Service.OcrInvoiceJobPage.Find.Result = await this._fetch(
3980
+ this.svAPIEndpoint,
3981
+ this.ocrInvoiceJobPage._path,
3982
+ params,
3983
+ );
3984
+ return res;
3985
+ },
3986
+ get: async (
3987
+ id: Service.OcrInvoiceJobPage.Get.ID,
3988
+ ): Promise<Service.OcrInvoiceJobPage.Get.Result> => {
3989
+ return await this._fetch(
3990
+ this.svAPIEndpoint,
3991
+ this.ocrInvoiceJobPage._path + `/${id}`,
3992
+ );
3993
+ },
3994
+ update: async (
3995
+ id: Service.OcrInvoiceJobPage.Update.ID,
3996
+ body: Service.OcrInvoiceJobPage.Update.Body,
3997
+ ): Promise<Service.OcrInvoiceJobPage.Update.Result> => {
3998
+ let res: Service.OcrInvoiceJobPage.Update.Result = await this._update(
3999
+ this.svAPIEndpoint,
4000
+ this.ocrInvoiceJobPage._path + `/${id}`,
4001
+ body,
4002
+ );
4003
+ return res;
4004
+ },
4005
+ };
4006
+
4007
+ settings = {
4008
+ _path: Repzo._end_points.SETTINGS,
4009
+ find: async (
4010
+ params?: Service.Settings.Find.Params,
4011
+ ): Promise<Service.Settings.Find.Result> => {
4012
+ let res: Service.Settings.Find.Result = await this._fetch(
4013
+ this.svAPIEndpoint,
4014
+ this.settings._path,
4015
+ params,
4016
+ );
4017
+ return res;
4018
+ },
4019
+ get: async (
4020
+ id: Service.Settings.Get.ID,
4021
+ ): Promise<Service.Settings.Get.Result> => {
4022
+ return await this._fetch(
4023
+ this.svAPIEndpoint,
4024
+ this.settings._path + `/${id}`,
4025
+ );
4026
+ },
4027
+ update: async (
4028
+ id: Service.Settings.Update.ID,
4029
+ body: Service.Settings.Update.Body,
4030
+ ): Promise<Service.Settings.Update.Result> => {
4031
+ let res: Service.Settings.Update.Result = await this._update(
4032
+ this.svAPIEndpoint,
4033
+ this.settings._path + `/${id}`,
4034
+ body,
4035
+ );
4036
+ return res;
4037
+ },
4038
+ };
4039
+
4040
+ mailUnsubscribe = {
4041
+ _path: Repzo._end_points.MAIL_UNSUBSCRIBE,
4042
+
4043
+ get: async (
4044
+ id: Service.MailUnsubsrcibe.Get.ID,
4045
+ ): Promise<Service.MailUnsubsrcibe.Get.Result> => {
4046
+ return await this._fetch(
4047
+ this.svAPIEndpoint,
4048
+ this.ocrInvoiceJobPage._path + `/${id}`,
4049
+ );
4050
+ },
4051
+
4052
+ create: async (
4053
+ params: Service.MailUnsubsrcibe.Create.Params,
4054
+ ): Promise<Service.MailUnsubsrcibe.Create.Result> => {
4055
+ let res = await this._create(
4056
+ this.svAPIEndpoint,
4057
+ this.activityAiSalesOrder._path,
4058
+ {},
4059
+ params,
4060
+ );
4061
+ return res;
4062
+ },
4063
+ };
4064
+
4065
+ approvalRequest = {
4066
+ _path: Repzo._end_points.APPROVAL_REQUEST,
4067
+ find: async (
4068
+ params?: Service.ApprovalRequest.Find.Params,
4069
+ ): Promise<Service.ApprovalRequest.Find.Result> => {
4070
+ let res: Service.ApprovalRequest.Find.Result = await this._fetch(
4071
+ this.svAPIEndpoint,
4072
+ this.approvalRequest._path,
4073
+ params,
4074
+ );
4075
+ return res;
4076
+ },
4077
+ get: async (
4078
+ id: Service.ApprovalRequest.Get.ID,
4079
+ params?: Service.ApprovalRequest.Get.Params,
4080
+ ): Promise<Service.ApprovalRequest.Get.Result> => {
4081
+ return await this._fetch(
4082
+ this.svAPIEndpoint,
4083
+ this.approvalRequest._path + `/${id}`,
4084
+ params,
4085
+ );
4086
+ },
4087
+ create: async (
4088
+ body: Service.ApprovalRequest.Create.Body,
4089
+ ): Promise<Service.ApprovalRequest.Create.Result> => {
4090
+ let res = await this._create(
4091
+ this.svAPIEndpoint,
4092
+ this.approvalRequest._path,
4093
+ body,
4094
+ );
4095
+ return res;
4096
+ },
4097
+ update: async (
4098
+ id: Service.ApprovalRequest.Update.ID,
4099
+ body: Service.ApprovalRequest.Update.Body,
4100
+ ): Promise<Service.ApprovalRequest.Update.Result> => {
4101
+ let res: Service.ApprovalRequest.Update.Result = await this._update(
4102
+ this.svAPIEndpoint,
4103
+ this.approvalRequest._path + `/${id}`,
4104
+ body,
4105
+ );
4106
+ return res;
4107
+ },
4108
+ remove: async (
4109
+ id: Service.ApprovalRequest.Update.ID,
4110
+ params: Service.ApprovalRequest.Remove.Params,
4111
+ ): Promise<Service.ApprovalRequest.Remove.Result> => {
4112
+ let res: Service.ApprovalRequest.Remove.Result = await this._delete(
4113
+ this.svAPIEndpoint,
4114
+ this.approvalRequest._path + `/${id}`,
4115
+ params,
4116
+ );
4117
+ return res;
4118
+ },
4119
+ };
4120
+
4121
+ safeInvoiceSerialCounter = {
4122
+ _path: Repzo._end_points.SAFE_INVOICE_SERIAL_COUNTER,
4123
+
4124
+ update: async (
4125
+ id: Service.SafeInvoiceSerialCounter.Update.ID,
4126
+ body: Service.SafeInvoiceSerialCounter.Update.Body,
4127
+ ): Promise<Service.SafeInvoiceSerialCounter.Update.Result> => {
4128
+ let res: Service.SafeInvoiceSerialCounter.Update.Result =
4129
+ await this._update(
4130
+ this.svAPIEndpoint,
4131
+ this.safeInvoiceSerialCounter._path + `/${id}`,
4132
+ body,
4133
+ );
4134
+ return res;
4135
+ },
4136
+ };
4137
+
4138
+ clientLocation = {
4139
+ _path: Repzo._end_points.CLIENT_LOCATION,
4140
+ find: async (
4141
+ params?: Service.ClientLocation.Find.Params,
4142
+ ): Promise<Service.ClientLocation.Find.Result> => {
4143
+ let res: Service.ClientLocation.Find.Result = await this._fetch(
4144
+ this.svAPIEndpoint,
4145
+ this.clientLocation._path,
4146
+ params,
4147
+ );
4148
+ return res;
4149
+ },
4150
+ get: async (
4151
+ id: Service.ClientLocation.Get.ID,
4152
+ params?: Service.ClientLocation.Get.Params,
4153
+ ): Promise<Service.ClientLocation.Get.Result> => {
4154
+ return await this._fetch(
4155
+ this.svAPIEndpoint,
4156
+ this.clientLocation._path + `/${id}`,
4157
+ params,
4158
+ );
4159
+ },
4160
+ create: async (
4161
+ body: Service.ClientLocation.Create.Body,
4162
+ ): Promise<Service.ClientLocation.Create.Result> => {
4163
+ let res = await this._create(
4164
+ this.svAPIEndpoint,
4165
+ this.clientLocation._path,
4166
+ body,
4167
+ );
4168
+ return res;
4169
+ },
4170
+ update: async (
4171
+ id: Service.ClientLocation.Update.ID,
4172
+ body: Service.ClientLocation.Update.Body,
4173
+ ): Promise<Service.ClientLocation.Update.Result> => {
4174
+ let res: Service.ClientLocation.Update.Result = await this._update(
4175
+ this.svAPIEndpoint,
4176
+ this.clientLocation._path + `/${id}`,
4177
+ body,
4178
+ );
4179
+ return res;
4180
+ },
4181
+ remove: async (
4182
+ id: Service.ClientLocation.Update.ID,
4183
+ params: Service.ClientLocation.Remove.Params,
4184
+ ): Promise<Service.ClientLocation.Remove.Result> => {
4185
+ let res: Service.ClientLocation.Remove.Result = await this._delete(
4186
+ this.svAPIEndpoint,
4187
+ this.clientLocation._path + `/${id}`,
4188
+ params,
4189
+ );
4190
+ return res;
4191
+ },
4192
+ };
4193
+
4194
+ assetType = {
4195
+ _path: Repzo._end_points.ASSET_TYPE,
4196
+ find: async (
4197
+ params?: Service.AssetType.Find.Params,
4198
+ ): Promise<Service.AssetType.Find.Result> => {
4199
+ let res: Service.AssetType.Find.Result = await this._fetch(
4200
+ this.svAPIEndpoint,
4201
+ this.assetType._path,
4202
+ params,
4203
+ );
4204
+ return res;
4205
+ },
4206
+ get: async (
4207
+ id: Service.AssetType.Get.ID,
4208
+ ): Promise<Service.AssetType.Get.Result> => {
4209
+ return await this._fetch(
4210
+ this.svAPIEndpoint,
4211
+ this.assetType._path + `/${id}`,
4212
+ );
4213
+ },
4214
+ create: async (
4215
+ body: Service.AssetType.Create.Body,
4216
+ ): Promise<Service.AssetType.Create.Result> => {
4217
+ let res = await this._create(
4218
+ this.svAPIEndpoint,
4219
+ this.assetType._path,
4220
+ body,
4221
+ );
4222
+ return res;
4223
+ },
4224
+ update: async (
4225
+ id: Service.AssetType.Update.ID,
4226
+ body: Service.AssetType.Update.Body,
4227
+ ): Promise<Service.AssetType.Update.Result> => {
4228
+ let res: Service.AssetType.Update.Result = await this._update(
4229
+ this.svAPIEndpoint,
4230
+ this.assetType._path + `/${id}`,
4231
+ body,
4232
+ );
4233
+ return res;
4234
+ },
4235
+ remove: async (
4236
+ id: Service.AssetType.Update.ID,
4237
+ params: Service.AssetType.Remove.Params,
4238
+ ): Promise<Service.AssetType.Remove.Result> => {
4239
+ let res: Service.AssetType.Remove.Result = await this._delete(
4240
+ this.svAPIEndpoint,
4241
+ this.assetType._path + `/${id}`,
4242
+ params,
4243
+ );
4244
+ return res;
4245
+ },
4246
+ };
4247
+
4248
+ asset = {
4249
+ _path: Repzo._end_points.ASSET,
4250
+ find: async (
4251
+ params?: Service.Asset.Find.Params,
4252
+ ): Promise<Service.Asset.Find.Result> => {
4253
+ let res: Service.Asset.Find.Result = await this._fetch(
4254
+ this.svAPIEndpoint,
4255
+ this.asset._path,
4256
+ params,
4257
+ );
4258
+ return res;
4259
+ },
4260
+ get: async (
4261
+ id: Service.Asset.Get.ID,
4262
+ params?: Service.Asset.Get.Params,
4263
+ ): Promise<Service.Asset.Get.Result> => {
4264
+ return await this._fetch(
4265
+ this.svAPIEndpoint,
4266
+ this.asset._path + `/${id}`,
4267
+ params,
4268
+ );
4269
+ },
4270
+ create: async (
4271
+ body: Service.Asset.Create.Body,
4272
+ ): Promise<Service.Asset.Create.Result> => {
4273
+ let res = await this._create(this.svAPIEndpoint, this.asset._path, body);
4274
+ return res;
4275
+ },
4276
+ update: async (
4277
+ id: Service.Asset.Update.ID,
4278
+ body: Service.Asset.Update.Body,
4279
+ ): Promise<Service.Asset.Update.Result> => {
4280
+ let res: Service.Asset.Update.Result = await this._update(
4281
+ this.svAPIEndpoint,
4282
+ this.asset._path + `/${id}`,
4283
+ body,
4284
+ );
4285
+ return res;
4286
+ },
4287
+ remove: async (
4288
+ id: Service.Asset.Update.ID,
4289
+ params: Service.Asset.Remove.Params,
4290
+ ): Promise<Service.Asset.Remove.Result> => {
4291
+ let res: Service.Asset.Remove.Result = await this._delete(
4292
+ this.svAPIEndpoint,
4293
+ this.asset._path + `/${id}`,
4294
+ params,
4295
+ );
4296
+ return res;
4297
+ },
4298
+ };
4299
+
4300
+ assetUnit = {
4301
+ _path: Repzo._end_points.ASSET_UNIT,
4302
+ find: async (
4303
+ params?: Service.AssetUnit.Find.Params,
4304
+ ): Promise<Service.AssetUnit.Find.Result> => {
4305
+ let res: Service.AssetUnit.Find.Result = await this._fetch(
4306
+ this.svAPIEndpoint,
4307
+ this.assetUnit._path,
4308
+ params,
4309
+ );
4310
+ return res;
4311
+ },
4312
+ get: async (
4313
+ id: Service.AssetUnit.Get.ID,
4314
+ params?: Service.AssetUnit.Get.Params,
4315
+ ): Promise<Service.AssetUnit.Get.Result> => {
4316
+ return await this._fetch(
4317
+ this.svAPIEndpoint,
4318
+ this.assetUnit._path + `/${id}`,
4319
+ params,
4320
+ );
4321
+ },
4322
+ create: async (
4323
+ body: Service.AssetUnit.Create.Body,
4324
+ ): Promise<Service.AssetUnit.Create.Result> => {
4325
+ let res = await this._create(
4326
+ this.svAPIEndpoint,
4327
+ this.assetUnit._path,
4328
+ body,
4329
+ );
4330
+ return res;
4331
+ },
4332
+ update: async (
4333
+ id: Service.AssetUnit.Update.ID,
4334
+ body: Service.AssetUnit.Update.Body,
4335
+ ): Promise<Service.AssetUnit.Update.Result> => {
4336
+ let res: Service.AssetUnit.Update.Result = await this._update(
4337
+ this.svAPIEndpoint,
4338
+ this.assetUnit._path + `/${id}`,
4339
+ body,
4340
+ );
4341
+ return res;
4342
+ },
4343
+ remove: async (
4344
+ id: Service.AssetUnit.Update.ID,
4345
+ params: Service.AssetUnit.Remove.Params,
4346
+ ): Promise<Service.AssetUnit.Remove.Result> => {
4347
+ let res: Service.AssetUnit.Remove.Result = await this._delete(
4348
+ this.svAPIEndpoint,
4349
+ this.assetUnit._path + `/${id}`,
4350
+ params,
4351
+ );
4352
+ return res;
4353
+ },
4354
+ };
4355
+
4356
+ workorderPortal = {
4357
+ _path: Repzo._end_points.WORKORDER_PORTAL,
4358
+ find: async (
4359
+ params?: Service.WorkorderPortal.Find.Params,
4360
+ ): Promise<Service.WorkorderPortal.Find.Result> => {
4361
+ let res: Service.WorkorderPortal.Find.Result = await this._fetch(
4362
+ this.svAPIEndpoint,
4363
+ this.workorderPortal._path,
4364
+ params,
4365
+ );
4366
+ return res;
4367
+ },
4368
+ get: async (
4369
+ id: Service.WorkorderPortal.Get.ID,
4370
+ params?: Service.WorkorderPortal.Get.Params,
4371
+ ): Promise<Service.WorkorderPortal.Get.Result> => {
4372
+ return await this._fetch(
4373
+ this.svAPIEndpoint,
4374
+ this.workorderPortal._path + `/${id}`,
4375
+ params,
4376
+ );
4377
+ },
4378
+ create: async (
4379
+ body: Service.WorkorderPortal.Create.Body,
4380
+ ): Promise<Service.WorkorderPortal.Create.Result> => {
4381
+ let res = await this._create(
4382
+ this.svAPIEndpoint,
4383
+ this.workorderPortal._path,
4384
+ body,
4385
+ );
4386
+ return res;
4387
+ },
4388
+ update: async (
4389
+ id: Service.WorkorderPortal.Update.ID,
4390
+ body: Service.WorkorderPortal.Update.Body,
4391
+ ): Promise<Service.WorkorderPortal.Update.Result> => {
4392
+ let res: Service.WorkorderPortal.Update.Result = await this._update(
4393
+ this.svAPIEndpoint,
4394
+ this.workorderPortal._path + `/${id}`,
4395
+ body,
4396
+ );
4397
+ return res;
4398
+ },
4399
+ remove: async (
4400
+ id: Service.WorkorderPortal.Update.ID,
4401
+ ): Promise<Service.WorkorderPortal.Remove.Result> => {
4402
+ let res: Service.WorkorderPortal.Remove.Result = await this._delete(
4403
+ this.svAPIEndpoint,
4404
+ this.workorderPortal._path + `/${id}`,
4405
+ );
4406
+ return res;
4407
+ },
4408
+ };
4409
+
4410
+ approval = {
4411
+ _path: Repzo._end_points.APPROVAL,
4412
+ find: async (
4413
+ params?: Service.Approval.Find.Params,
4414
+ ): Promise<Service.Approval.Find.Result> => {
4415
+ let res: Service.Approval.Find.Result = await this._fetch(
4416
+ this.svAPIEndpoint,
4417
+ this.approval._path,
4418
+ params,
4419
+ );
4420
+ return res;
4421
+ },
4422
+ get: async (
4423
+ id: Service.Approval.Get.ID,
4424
+ params?: Service.Approval.Get.Params,
4425
+ ): Promise<Service.Approval.Get.Result> => {
4426
+ return await this._fetch(
4427
+ this.svAPIEndpoint,
4428
+ this.approval._path + `/${id}`,
4429
+ params,
4430
+ );
4431
+ },
4432
+ create: async (
4433
+ body: Service.Approval.Create.Body,
4434
+ ): Promise<Service.Approval.Create.Result> => {
4435
+ let res = await this._create(
4436
+ this.svAPIEndpoint,
4437
+ this.approval._path,
4438
+ body,
4439
+ );
4440
+ return res;
4441
+ },
4442
+ update: async (
4443
+ id: Service.Approval.Update.ID,
4444
+ body: Service.Approval.Update.Body,
4445
+ ): Promise<Service.Approval.Update.Result> => {
4446
+ let res: Service.Approval.Update.Result = await this._update(
4447
+ this.svAPIEndpoint,
4448
+ this.approval._path + `/${id}`,
4449
+ body,
4450
+ );
4451
+ return res;
4452
+ },
4453
+ remove: async (
4454
+ id: Service.Approval.Remove.ID,
4455
+ ): Promise<Service.Approval.Remove.Result> => {
4456
+ let res: Service.Approval.Remove.Result = await this._delete(
4457
+ this.svAPIEndpoint,
4458
+ this.approval._path + `/${id}`,
4459
+ );
4460
+ return res;
4461
+ },
4462
+ };
4463
+
4464
+ workorderCategory = {
4465
+ _path: Repzo._end_points.WORKORDER_CATEGORY,
4466
+ find: async (
4467
+ params?: Service.WorkorderCategory.Find.Params,
4468
+ ): Promise<Service.WorkorderCategory.Find.Result> => {
4469
+ let res: Service.WorkorderCategory.Find.Result = await this._fetch(
4470
+ this.svAPIEndpoint,
4471
+ this.workorderCategory._path,
4472
+ params,
4473
+ );
4474
+ return res;
4475
+ },
4476
+ get: async (
4477
+ id: Service.WorkorderCategory.Get.ID,
4478
+ params?: Service.WorkorderCategory.Get.Params,
4479
+ ): Promise<Service.WorkorderCategory.Get.Result> => {
4480
+ return await this._fetch(
4481
+ this.svAPIEndpoint,
4482
+ this.workorderCategory._path + `/${id}`,
4483
+ params,
4484
+ );
4485
+ },
4486
+ create: async (
4487
+ body: Service.WorkorderCategory.Create.Body,
4488
+ ): Promise<Service.WorkorderCategory.Create.Result> => {
4489
+ let res = await this._create(
4490
+ this.svAPIEndpoint,
4491
+ this.workorderCategory._path,
4492
+ body,
4493
+ );
4494
+ return res;
4495
+ },
4496
+ update: async (
4497
+ id: Service.WorkorderCategory.Update.ID,
4498
+ body: Service.WorkorderCategory.Update.Body,
4499
+ ): Promise<Service.WorkorderCategory.Update.Result> => {
4500
+ let res: Service.WorkorderCategory.Update.Result = await this._update(
4501
+ this.svAPIEndpoint,
4502
+ this.workorderCategory._path + `/${id}`,
4503
+ body,
4504
+ );
4505
+ return res;
4506
+ },
4507
+ remove: async (
4508
+ id: Service.WorkorderCategory.Remove.ID,
4509
+ ): Promise<Service.WorkorderCategory.Remove.Result> => {
4510
+ let res: Service.WorkorderCategory.Remove.Result = await this._delete(
4511
+ this.svAPIEndpoint,
4512
+ this.workorderCategory._path + `/${id}`,
4513
+ );
4514
+ return res;
4515
+ },
4516
+ };
4517
+
4518
+ contract = {
4519
+ _path: Repzo._end_points.CONTRACT,
4520
+ find: async (
4521
+ params?: Service.Contract.Find.Params,
4522
+ ): Promise<Service.Contract.Find.Result> => {
4523
+ let res: Service.Contract.Find.Result = await this._fetch(
4524
+ this.svAPIEndpoint,
4525
+ this.contract._path,
4526
+ params,
4527
+ );
4528
+ return res;
4529
+ },
4530
+ get: async (
4531
+ id: Service.Contract.Get.ID,
4532
+ params?: Service.Contract.Get.Params,
4533
+ ): Promise<Service.Contract.Get.Result> => {
4534
+ return await this._fetch(
4535
+ this.svAPIEndpoint,
4536
+ this.contract._path + `/${id}`,
4537
+ params,
4538
+ );
4539
+ },
4540
+ create: async (
4541
+ body: Service.Contract.Create.Body,
4542
+ ): Promise<Service.Contract.Create.Result> => {
4543
+ let res = await this._create(
4544
+ this.svAPIEndpoint,
4545
+ this.contract._path,
4546
+ body,
4547
+ );
4548
+ return res;
4549
+ },
4550
+ update: async (
4551
+ id: Service.Contract.Update.ID,
4552
+ body: Service.Contract.Update.Body,
4553
+ ): Promise<Service.Contract.Update.Result> => {
4554
+ let res: Service.Contract.Update.Result = await this._update(
4555
+ this.svAPIEndpoint,
4556
+ this.contract._path + `/${id}`,
4557
+ body,
4558
+ );
4559
+ return res;
4560
+ },
4561
+ remove: async (
4562
+ id: Service.Contract.Remove.ID,
4563
+ ): Promise<Service.Contract.Remove.Result> => {
4564
+ let res: Service.Contract.Remove.Result = await this._delete(
4565
+ this.svAPIEndpoint,
4566
+ this.contract._path + `/${id}`,
4567
+ );
4568
+ return res;
4569
+ },
4570
+ };
4571
+
4572
+ contractInstallment = {
4573
+ _path: Repzo._end_points.CONTRACT_INSTALLMENT,
4574
+ find: async (
4575
+ params?: Service.ContractInstallment.Find.Params,
4576
+ ): Promise<Service.ContractInstallment.Find.Result> => {
4577
+ let res: Service.ContractInstallment.Find.Result = await this._fetch(
4578
+ this.svAPIEndpoint,
4579
+ this.contractInstallment._path,
4580
+ params,
4581
+ );
4582
+ return res;
4583
+ },
4584
+ get: async (
4585
+ id: Service.ContractInstallment.Get.ID,
4586
+ params?: Service.ContractInstallment.Get.Params,
4587
+ ): Promise<Service.ContractInstallment.Get.Result> => {
4588
+ return await this._fetch(
4589
+ this.svAPIEndpoint,
4590
+ this.contractInstallment._path + `/${id}`,
4591
+ params,
4592
+ );
4593
+ },
4594
+ create: async (
4595
+ body: Service.ContractInstallment.Create.Body,
4596
+ ): Promise<Service.ContractInstallment.Create.Result> => {
4597
+ let res = await this._create(
4598
+ this.svAPIEndpoint,
4599
+ this.contractInstallment._path,
4600
+ body,
4601
+ );
4602
+ return res;
4603
+ },
4604
+ update: async (
4605
+ id: Service.ContractInstallment.Update.ID,
4606
+ body: Service.ContractInstallment.Update.Body,
4607
+ ): Promise<Service.ContractInstallment.Update.Result> => {
4608
+ let res: Service.ContractInstallment.Update.Result = await this._update(
4609
+ this.svAPIEndpoint,
4610
+ this.contractInstallment._path + `/${id}`,
4611
+ body,
4612
+ );
4613
+ return res;
4614
+ },
4615
+ remove: async (
4616
+ id: Service.ContractInstallment.Remove.ID,
4617
+ ): Promise<Service.ContractInstallment.Remove.Result> => {
4618
+ let res: Service.ContractInstallment.Remove.Result = await this._delete(
4619
+ this.svAPIEndpoint,
4620
+ this.contractInstallment._path + `/${id}`,
4621
+ );
4622
+ return res;
4623
+ },
4624
+ };
4625
+
4626
+ repBalanceSummary = {
4627
+ _path: Repzo._end_points.REP_BALANCE_SUMMARY,
4628
+ find: async (
4629
+ params: Service.RepBalanceSummary.Find.Params,
4630
+ ): Promise<Service.RepBalanceSummary.Find.Result> => {
4631
+ let res: Service.RepBalanceSummary.Find.Result = await this._fetch(
4632
+ this.svAPIEndpoint,
4633
+ this.repBalanceSummary._path,
4634
+ params,
4635
+ );
4636
+ return res;
4637
+ },
4638
+ };
4639
+
4640
+ workorderPortalLink = {
4641
+ _path: Repzo._end_points.WORKORDER_PORTAL_LINK,
4642
+ find: async (
4643
+ params?: Service.WorkorderPortalLink.Find.Params,
4644
+ ): Promise<Service.WorkorderPortalLink.Find.Result> => {
4645
+ let res: Service.WorkorderPortalLink.Find.Result = await this._fetch(
4646
+ this.svAPIEndpoint,
4647
+ this.workorderPortalLink._path,
4648
+ params,
4649
+ );
4650
+ return res;
4651
+ },
4652
+ get: async (
4653
+ id: Service.WorkorderPortalLink.Get.ID,
4654
+ params?: Service.WorkorderPortalLink.Get.Params,
4655
+ ): Promise<Service.WorkorderPortalLink.Get.Result> => {
4656
+ return await this._fetch(
4657
+ this.svAPIEndpoint,
4658
+ this.workorderPortalLink._path + `/${id}`,
4659
+ params,
4660
+ );
4661
+ },
4662
+
4663
+ create: async (
4664
+ body: Service.WorkorderPortalLink.Create.Body,
4665
+ ): Promise<Service.WorkorderPortalLink.Create.Result> => {
4666
+ let res = await this._create(
4667
+ this.svAPIEndpoint,
4668
+ this.workorderPortalLink._path,
4669
+ body,
4670
+ );
4671
+ return res;
4672
+ },
4673
+
4674
+ update: async (
4675
+ id: Service.WorkorderPortalLink.Update.ID,
4676
+ body: Service.WorkorderPortalLink.Update.Body,
4677
+ ): Promise<Service.WorkorderPortalLink.Update.Result> => {
4678
+ let res: Service.WorkorderPortalLink.Update.Result = await this._update(
4679
+ this.svAPIEndpoint,
4680
+ this.workorderPortalLink._path + `/${id}`,
4681
+ body,
4682
+ );
4683
+ return res;
4684
+ },
4685
+
4686
+ patch: async (
4687
+ id: Service.WorkorderPortalLink.Patch.ID,
4688
+ body: Service.WorkorderPortalLink.Patch.Body,
4689
+ ): Promise<Service.WorkorderPortalLink.Patch.Result> => {
4690
+ let res: Service.WorkorderPortalLink.Patch.Result = await this._patch(
4691
+ this.svAPIEndpoint,
4692
+ this.workorderPortalLink._path + `/${id}`,
4693
+ body,
4694
+ );
4695
+ return res;
4696
+ },
4697
+
4698
+ remove: async (
4699
+ id: Service.WorkorderPortalLink.Remove.ID,
4700
+ ): Promise<Service.WorkorderPortalLink.Remove.Result> => {
4701
+ let res: Service.WorkorderPortalLink.Remove.Result = await this._delete(
4702
+ this.svAPIEndpoint,
4703
+ this.workorderPortalLink._path + `/${id}`,
4704
+ );
4705
+ return res;
4706
+ },
4707
+ };
4708
+
4709
+ customField = {
4710
+ _path: Repzo._end_points.CUSTOM_FIELD,
4711
+ find: async (
4712
+ params?: Service.CustomField.Find.Params,
4713
+ ): Promise<Service.CustomField.Find.Result> => {
4714
+ let res: Service.CustomField.Find.Result = await this._fetch(
4715
+ this.svAPIEndpoint,
4716
+ this.customField._path,
4717
+ params,
4718
+ );
4719
+ return res;
4720
+ },
4721
+ get: async (
4722
+ id: Service.CustomField.Get.ID,
4723
+ params?: Service.CustomField.Get.Params,
4724
+ ): Promise<Service.CustomField.Get.Result> => {
4725
+ return await this._fetch(
4726
+ this.svAPIEndpoint,
4727
+ this.customField._path + `/${id}`,
4728
+ params,
4729
+ );
4730
+ },
4731
+ create: async (
4732
+ body: Service.CustomField.Create.Body,
4733
+ ): Promise<Service.CustomField.Create.Result> => {
4734
+ let res = await this._create(
4735
+ this.svAPIEndpoint,
4736
+ this.customField._path,
4737
+ body,
4738
+ );
4739
+ return res;
4740
+ },
4741
+ update: async (
4742
+ id: Service.CustomField.Update.ID,
4743
+ body: Service.CustomField.Update.Body,
4744
+ ): Promise<Service.CustomField.Update.Result> => {
4745
+ let res: Service.CustomField.Update.Result = await this._update(
4746
+ this.svAPIEndpoint,
4747
+ this.customField._path + `/${id}`,
4748
+ body,
4749
+ );
4750
+ return res;
4751
+ },
4752
+ remove: async (
4753
+ id: Service.CustomField.Update.ID,
4754
+ params: Service.CustomField.Remove.Params,
4755
+ ): Promise<Service.CustomField.Remove.Result> => {
4756
+ let res: Service.CustomField.Remove.Result = await this._delete(
4757
+ this.svAPIEndpoint,
4758
+ this.customField._path + `/${id}`,
4759
+ params,
4760
+ );
4761
+ return res;
4762
+ },
4763
+ };
4764
+
4765
+ timelineReport = {
4766
+ _path: Repzo._end_points.TIMELINE_REPORT,
4767
+ find: async (
4768
+ params?: Service.TimelineReport.Find.Params,
4769
+ ): Promise<Service.TimelineReport.Find.Result> => {
4770
+ let res: Service.TimelineReport.Find.Result = await this._fetch(
4771
+ this.svAPIEndpoint,
4772
+ this.timelineReport._path,
4773
+ params,
4774
+ );
4775
+ return res;
4776
+ },
4777
+ };
4778
+
4779
+ resetCompanyNamespace = {
4780
+ _path: Repzo._end_points.RESET_COMPANY_NAMESPACE,
4781
+ find: async (
4782
+ params?: Service.ResetCompanyNamespace.Find.Params,
4783
+ ): Promise<Service.ResetCompanyNamespace.Find.Result> => {
4784
+ let res: Service.ResetCompanyNamespace.Find.Result = await this._fetch(
4785
+ this.svAPIEndpoint,
4786
+ this.resetCompanyNamespace._path,
4787
+ params,
4788
+ );
4789
+ return res;
4790
+ },
4791
+ get: async (
4792
+ id: Service.ResetCompanyNamespace.Get.ID,
4793
+ params?: Service.ResetCompanyNamespace.Get.Params,
4794
+ ): Promise<Service.ResetCompanyNamespace.Get.Result> => {
4795
+ return await this._fetch(
4796
+ this.svAPIEndpoint,
4797
+ this.resetCompanyNamespace._path + `/${id}`,
4798
+ params,
4799
+ );
4800
+ },
4801
+ create: async (
4802
+ body: Service.ResetCompanyNamespace.Create.Body,
4803
+ ): Promise<Service.ResetCompanyNamespace.Create.Result> => {
4804
+ let res = await this._create(
4805
+ this.svAPIEndpoint,
4806
+ this.resetCompanyNamespace._path,
4807
+ body,
4808
+ );
4809
+ return res;
4810
+ },
4811
+ update: async (
4812
+ id: Service.ResetCompanyNamespace.Update.ID,
4813
+ ): Promise<Service.ResetCompanyNamespace.Update.Result> => {
4814
+ let res: Service.ResetCompanyNamespace.Update.Result = await this._update(
4815
+ this.svAPIEndpoint,
4816
+ this.resetCompanyNamespace._path + `/${id}`,
4817
+ {},
4818
+ );
4819
+ return res;
4820
+ },
4821
+ };
4822
+
4823
+ testResetCompanyNamespace = {
4824
+ _path: Repzo._end_points.TEST_RESET_COMPANY_NAMESPACE,
4825
+ find: async (
4826
+ params?: Service.TestResetCompanyNamespace.Find.Params,
4827
+ ): Promise<Service.TestResetCompanyNamespace.Find.Result> => {
4828
+ let res: Service.TestResetCompanyNamespace.Find.Result =
4829
+ await this._fetch(
4830
+ this.svAPIEndpoint,
4831
+ this.testResetCompanyNamespace._path,
4832
+ params,
4833
+ );
4834
+ return res;
4835
+ },
4836
+ get: async (
4837
+ id: Service.TestResetCompanyNamespace.Get.ID,
4838
+ params?: Service.TestResetCompanyNamespace.Get.Params,
4839
+ ): Promise<Service.TestResetCompanyNamespace.Get.Result> => {
4840
+ return await this._fetch(
4841
+ this.svAPIEndpoint,
4842
+ this.testResetCompanyNamespace._path + `/${id}`,
4843
+ params,
4844
+ );
4845
+ },
4846
+ create: async (
4847
+ body: Service.TestResetCompanyNamespace.Create.Body,
4848
+ ): Promise<Service.TestResetCompanyNamespace.Create.Result> => {
4849
+ let res = await this._create(
4850
+ this.svAPIEndpoint,
4851
+ this.testResetCompanyNamespace._path,
4852
+ body,
4853
+ );
4854
+ return res;
4855
+ },
4856
+ update: async (
4857
+ id: Service.TestResetCompanyNamespace.Update.ID,
4858
+ ): Promise<Service.TestResetCompanyNamespace.Update.Result> => {
4859
+ let res: Service.TestResetCompanyNamespace.Update.Result =
4860
+ await this._update(
4861
+ this.svAPIEndpoint,
4862
+ this.testResetCompanyNamespace._path + `/${id}`,
4863
+ {},
4864
+ );
4865
+ return res;
4866
+ },
4867
+ };
4868
+ }
4869
+
4870
+ function normalizeParams(params: Params): { [key: string]: any } {
4871
+ const normalized: Record<string, any> = {};
4872
+
4873
+ for (const key in params) {
4874
+ const value = params[key];
4875
+
4876
+ if (value === undefined || value === null) continue;
4877
+
4878
+ if (
4879
+ typeof value === "object" &&
4880
+ !(value instanceof Date) &&
4881
+ !(value instanceof String)
4882
+ ) {
4883
+ normalized[key] = JSON.stringify(value);
4884
+ } else {
4885
+ normalized[key] = value;
4886
+ }
4887
+ }
4888
+
4889
+ return normalized;
4890
+ }