repzo 1.0.119 → 1.0.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +1 -0
- package/lib/index.d.ts +108 -0
- package/lib/index.js +213 -0
- package/lib/types/index.d.ts +698 -0
- package/package.json +1 -1
- package/src/index.ts +277 -0
- package/src/types/index.ts +666 -0
package/changelog.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export default class Repzo {
|
|
|
45
45
|
readonly CUSTOM_LIST_ITEM: "custom-list-item";
|
|
46
46
|
readonly INVENTORY_ADJUSTMENT_REASON: "inventory-adjustment-reason";
|
|
47
47
|
readonly WORKORDER: "workorder";
|
|
48
|
+
readonly WORKORDER_REQUEST: "workorder-request";
|
|
48
49
|
readonly SUPPLIER: "supplier";
|
|
49
50
|
readonly QUICK_CONVERT_TO_PDF: "quick-convert-to-pdf";
|
|
50
51
|
readonly VISIT: "visit";
|
|
@@ -87,6 +88,10 @@ export default class Repzo {
|
|
|
87
88
|
readonly MAIL_UNSUBSCRIBE: "mail-unsubscribe";
|
|
88
89
|
readonly APPROVAL_REQUEST: "approval-request";
|
|
89
90
|
readonly SAFE_INVOICE_SERIAL_COUNTER: "safe-invoice-serial-counter";
|
|
91
|
+
readonly CLIENT_LOCATION: "client-location";
|
|
92
|
+
readonly ASSET_TYPE: "asset-type";
|
|
93
|
+
readonly ASSET: "asset";
|
|
94
|
+
readonly ASSET_UNIT: "asset-unit";
|
|
90
95
|
};
|
|
91
96
|
private _fetch;
|
|
92
97
|
private _create;
|
|
@@ -656,6 +661,26 @@ export default class Repzo {
|
|
|
656
661
|
id: Service.Workorder.Remove.ID
|
|
657
662
|
) => Promise<Service.Workorder.Remove.Result>;
|
|
658
663
|
};
|
|
664
|
+
workorderRequest: {
|
|
665
|
+
_path: "workorder-request";
|
|
666
|
+
find: (
|
|
667
|
+
params?: Service.WorkorderRequest.Find.Params
|
|
668
|
+
) => Promise<Service.WorkorderRequest.Find.Result>;
|
|
669
|
+
get: (
|
|
670
|
+
id: Service.WorkorderRequest.Get.ID,
|
|
671
|
+
params?: Service.WorkorderRequest.Get.Params
|
|
672
|
+
) => Promise<Service.WorkorderRequest.Get.Result>;
|
|
673
|
+
create: (
|
|
674
|
+
body: Service.WorkorderRequest.Create.Body
|
|
675
|
+
) => Promise<Service.WorkorderRequest.Create.Result>;
|
|
676
|
+
update: (
|
|
677
|
+
id: Service.WorkorderRequest.Update.ID,
|
|
678
|
+
body: Service.WorkorderRequest.Update.Body
|
|
679
|
+
) => Promise<Service.WorkorderRequest.Update.Result>;
|
|
680
|
+
remove: (
|
|
681
|
+
id: Service.WorkorderRequest.Remove.ID
|
|
682
|
+
) => Promise<Service.WorkorderRequest.Remove.Result>;
|
|
683
|
+
};
|
|
659
684
|
supplier: {
|
|
660
685
|
_path: "supplier";
|
|
661
686
|
find: (
|
|
@@ -1346,4 +1371,87 @@ export default class Repzo {
|
|
|
1346
1371
|
body: Service.SafeInvoiceSerialCounter.Update.Body
|
|
1347
1372
|
) => Promise<Service.SafeInvoiceSerialCounter.Update.Result>;
|
|
1348
1373
|
};
|
|
1374
|
+
clientLocation: {
|
|
1375
|
+
_path: "client-location";
|
|
1376
|
+
find: (
|
|
1377
|
+
params?: Service.ClientLocation.Find.Params
|
|
1378
|
+
) => Promise<Service.ClientLocation.Find.Result>;
|
|
1379
|
+
get: (
|
|
1380
|
+
id: Service.ClientLocation.Get.ID,
|
|
1381
|
+
params?: Service.ClientLocation.Get.Params
|
|
1382
|
+
) => Promise<Service.ClientLocation.Get.Result>;
|
|
1383
|
+
create: (
|
|
1384
|
+
body: Service.ClientLocation.Create.Body
|
|
1385
|
+
) => Promise<Service.ClientLocation.Create.Result>;
|
|
1386
|
+
update: (
|
|
1387
|
+
id: Service.ClientLocation.Update.ID,
|
|
1388
|
+
body: Service.ClientLocation.Update.Body
|
|
1389
|
+
) => Promise<Service.ClientLocation.Update.Result>;
|
|
1390
|
+
remove: (
|
|
1391
|
+
id: Service.ClientLocation.Update.ID,
|
|
1392
|
+
params: Service.ClientLocation.Remove.Params
|
|
1393
|
+
) => Promise<Service.ClientLocation.Remove.Result>;
|
|
1394
|
+
};
|
|
1395
|
+
assetType: {
|
|
1396
|
+
_path: "asset-type";
|
|
1397
|
+
find: (
|
|
1398
|
+
params?: Service.AssetType.Find.Params
|
|
1399
|
+
) => Promise<Service.AssetType.Find.Result>;
|
|
1400
|
+
get: (
|
|
1401
|
+
id: Service.AssetType.Get.ID
|
|
1402
|
+
) => Promise<Service.AssetType.Get.Result>;
|
|
1403
|
+
create: (
|
|
1404
|
+
body: Service.AssetType.Create.Body
|
|
1405
|
+
) => Promise<Service.AssetType.Create.Result>;
|
|
1406
|
+
update: (
|
|
1407
|
+
id: Service.AssetType.Update.ID,
|
|
1408
|
+
body: Service.AssetType.Update.Body
|
|
1409
|
+
) => Promise<Service.AssetType.Update.Result>;
|
|
1410
|
+
remove: (
|
|
1411
|
+
id: Service.AssetType.Update.ID,
|
|
1412
|
+
params: Service.AssetType.Remove.Params
|
|
1413
|
+
) => Promise<Service.AssetType.Remove.Result>;
|
|
1414
|
+
};
|
|
1415
|
+
asset: {
|
|
1416
|
+
_path: "asset";
|
|
1417
|
+
find: (
|
|
1418
|
+
params?: Service.Asset.Find.Params
|
|
1419
|
+
) => Promise<Service.Asset.Find.Result>;
|
|
1420
|
+
get: (
|
|
1421
|
+
id: Service.Asset.Get.ID,
|
|
1422
|
+
params?: Service.Asset.Get.Params
|
|
1423
|
+
) => Promise<Service.Asset.Get.Result>;
|
|
1424
|
+
create: (
|
|
1425
|
+
body: Service.Asset.Create.Body
|
|
1426
|
+
) => Promise<Service.Asset.Create.Result>;
|
|
1427
|
+
update: (
|
|
1428
|
+
id: Service.Asset.Update.ID,
|
|
1429
|
+
body: Service.Asset.Update.Body
|
|
1430
|
+
) => Promise<Service.Asset.Update.Result>;
|
|
1431
|
+
remove: (
|
|
1432
|
+
id: Service.Asset.Update.ID,
|
|
1433
|
+
params: Service.Asset.Remove.Params
|
|
1434
|
+
) => Promise<Service.Asset.Remove.Result>;
|
|
1435
|
+
};
|
|
1436
|
+
assetUnit: {
|
|
1437
|
+
_path: "asset-unit";
|
|
1438
|
+
find: (
|
|
1439
|
+
params?: Service.AssetUnit.Find.Params
|
|
1440
|
+
) => Promise<Service.AssetUnit.Find.Result>;
|
|
1441
|
+
get: (
|
|
1442
|
+
id: Service.AssetUnit.Get.ID,
|
|
1443
|
+
params?: Service.AssetUnit.Get.Params
|
|
1444
|
+
) => Promise<Service.AssetUnit.Get.Result>;
|
|
1445
|
+
create: (
|
|
1446
|
+
body: Service.AssetUnit.Create.Body
|
|
1447
|
+
) => Promise<Service.AssetUnit.Create.Result>;
|
|
1448
|
+
update: (
|
|
1449
|
+
id: Service.AssetUnit.Update.ID,
|
|
1450
|
+
body: Service.AssetUnit.Update.Body
|
|
1451
|
+
) => Promise<Service.AssetUnit.Update.Result>;
|
|
1452
|
+
remove: (
|
|
1453
|
+
id: Service.AssetUnit.Update.ID,
|
|
1454
|
+
params: Service.AssetUnit.Remove.Params
|
|
1455
|
+
) => Promise<Service.AssetUnit.Remove.Result>;
|
|
1456
|
+
};
|
|
1349
1457
|
}
|
package/lib/index.js
CHANGED
|
@@ -34,6 +34,7 @@ export default class Repzo {
|
|
|
34
34
|
CUSTOM_LIST_ITEM: "custom-list-item",
|
|
35
35
|
INVENTORY_ADJUSTMENT_REASON: "inventory-adjustment-reason",
|
|
36
36
|
WORKORDER: "workorder",
|
|
37
|
+
WORKORDER_REQUEST: "workorder-request",
|
|
37
38
|
SUPPLIER: "supplier",
|
|
38
39
|
QUICK_CONVERT_TO_PDF: "quick-convert-to-pdf",
|
|
39
40
|
VISIT: "visit",
|
|
@@ -76,6 +77,10 @@ export default class Repzo {
|
|
|
76
77
|
MAIL_UNSUBSCRIBE: "mail-unsubscribe",
|
|
77
78
|
APPROVAL_REQUEST: "approval-request",
|
|
78
79
|
SAFE_INVOICE_SERIAL_COUNTER: "safe-invoice-serial-counter",
|
|
80
|
+
CLIENT_LOCATION: "client-location",
|
|
81
|
+
ASSET_TYPE: "asset-type",
|
|
82
|
+
ASSET: "asset",
|
|
83
|
+
ASSET_UNIT: "asset-unit",
|
|
79
84
|
};
|
|
80
85
|
this.END_POINTS = this._end_points;
|
|
81
86
|
this.client = {
|
|
@@ -1274,6 +1279,47 @@ export default class Repzo {
|
|
|
1274
1279
|
return res;
|
|
1275
1280
|
},
|
|
1276
1281
|
};
|
|
1282
|
+
this.workorderRequest = {
|
|
1283
|
+
_path: this._end_points.WORKORDER_REQUEST,
|
|
1284
|
+
find: async (params) => {
|
|
1285
|
+
let res = await this._fetch(
|
|
1286
|
+
this.svAPIEndpoint,
|
|
1287
|
+
this.workorderRequest._path,
|
|
1288
|
+
params
|
|
1289
|
+
);
|
|
1290
|
+
return res;
|
|
1291
|
+
},
|
|
1292
|
+
get: async (id, params) => {
|
|
1293
|
+
return await this._fetch(
|
|
1294
|
+
this.svAPIEndpoint,
|
|
1295
|
+
this.workorderRequest._path + `/${id}`,
|
|
1296
|
+
params
|
|
1297
|
+
);
|
|
1298
|
+
},
|
|
1299
|
+
create: async (body) => {
|
|
1300
|
+
let res = await this._create(
|
|
1301
|
+
this.svAPIEndpoint,
|
|
1302
|
+
this.workorderRequest._path,
|
|
1303
|
+
body
|
|
1304
|
+
);
|
|
1305
|
+
return res;
|
|
1306
|
+
},
|
|
1307
|
+
update: async (id, body) => {
|
|
1308
|
+
let res = await this._update(
|
|
1309
|
+
this.svAPIEndpoint,
|
|
1310
|
+
this.workorderRequest._path + `/${id}`,
|
|
1311
|
+
body
|
|
1312
|
+
);
|
|
1313
|
+
return res;
|
|
1314
|
+
},
|
|
1315
|
+
remove: async (id) => {
|
|
1316
|
+
let res = await this._delete(
|
|
1317
|
+
this.svAPIEndpoint,
|
|
1318
|
+
this.workorderRequest._path + `/${id}`
|
|
1319
|
+
);
|
|
1320
|
+
return res;
|
|
1321
|
+
},
|
|
1322
|
+
};
|
|
1277
1323
|
this.supplier = {
|
|
1278
1324
|
_path: this._end_points.SUPPLIER,
|
|
1279
1325
|
find: async (params) => {
|
|
@@ -2479,6 +2525,173 @@ export default class Repzo {
|
|
|
2479
2525
|
return res;
|
|
2480
2526
|
},
|
|
2481
2527
|
};
|
|
2528
|
+
this.clientLocation = {
|
|
2529
|
+
_path: this._end_points.CLIENT_LOCATION,
|
|
2530
|
+
find: async (params) => {
|
|
2531
|
+
let res = await this._fetch(
|
|
2532
|
+
this.svAPIEndpoint,
|
|
2533
|
+
this.clientLocation._path,
|
|
2534
|
+
params
|
|
2535
|
+
);
|
|
2536
|
+
return res;
|
|
2537
|
+
},
|
|
2538
|
+
get: async (id, params) => {
|
|
2539
|
+
return await this._fetch(
|
|
2540
|
+
this.svAPIEndpoint,
|
|
2541
|
+
this.clientLocation._path + `/${id}`,
|
|
2542
|
+
params
|
|
2543
|
+
);
|
|
2544
|
+
},
|
|
2545
|
+
create: async (body) => {
|
|
2546
|
+
let res = await this._create(
|
|
2547
|
+
this.svAPIEndpoint,
|
|
2548
|
+
this.clientLocation._path,
|
|
2549
|
+
body
|
|
2550
|
+
);
|
|
2551
|
+
return res;
|
|
2552
|
+
},
|
|
2553
|
+
update: async (id, body) => {
|
|
2554
|
+
let res = await this._update(
|
|
2555
|
+
this.svAPIEndpoint,
|
|
2556
|
+
this.clientLocation._path + `/${id}`,
|
|
2557
|
+
body
|
|
2558
|
+
);
|
|
2559
|
+
return res;
|
|
2560
|
+
},
|
|
2561
|
+
remove: async (id, params) => {
|
|
2562
|
+
let res = await this._delete(
|
|
2563
|
+
this.svAPIEndpoint,
|
|
2564
|
+
this.clientLocation._path + `/${id}`,
|
|
2565
|
+
params
|
|
2566
|
+
);
|
|
2567
|
+
return res;
|
|
2568
|
+
},
|
|
2569
|
+
};
|
|
2570
|
+
this.assetType = {
|
|
2571
|
+
_path: this._end_points.ASSET_TYPE,
|
|
2572
|
+
find: async (params) => {
|
|
2573
|
+
let res = await this._fetch(
|
|
2574
|
+
this.svAPIEndpoint,
|
|
2575
|
+
this.assetType._path,
|
|
2576
|
+
params
|
|
2577
|
+
);
|
|
2578
|
+
return res;
|
|
2579
|
+
},
|
|
2580
|
+
get: async (id) => {
|
|
2581
|
+
return await this._fetch(
|
|
2582
|
+
this.svAPIEndpoint,
|
|
2583
|
+
this.assetType._path + `/${id}`
|
|
2584
|
+
);
|
|
2585
|
+
},
|
|
2586
|
+
create: async (body) => {
|
|
2587
|
+
let res = await this._create(
|
|
2588
|
+
this.svAPIEndpoint,
|
|
2589
|
+
this.assetType._path,
|
|
2590
|
+
body
|
|
2591
|
+
);
|
|
2592
|
+
return res;
|
|
2593
|
+
},
|
|
2594
|
+
update: async (id, body) => {
|
|
2595
|
+
let res = await this._update(
|
|
2596
|
+
this.svAPIEndpoint,
|
|
2597
|
+
this.assetType._path + `/${id}`,
|
|
2598
|
+
body
|
|
2599
|
+
);
|
|
2600
|
+
return res;
|
|
2601
|
+
},
|
|
2602
|
+
remove: async (id, params) => {
|
|
2603
|
+
let res = await this._delete(
|
|
2604
|
+
this.svAPIEndpoint,
|
|
2605
|
+
this.assetType._path + `/${id}`,
|
|
2606
|
+
params
|
|
2607
|
+
);
|
|
2608
|
+
return res;
|
|
2609
|
+
},
|
|
2610
|
+
};
|
|
2611
|
+
this.asset = {
|
|
2612
|
+
_path: this._end_points.ASSET,
|
|
2613
|
+
find: async (params) => {
|
|
2614
|
+
let res = await this._fetch(
|
|
2615
|
+
this.svAPIEndpoint,
|
|
2616
|
+
this.asset._path,
|
|
2617
|
+
params
|
|
2618
|
+
);
|
|
2619
|
+
return res;
|
|
2620
|
+
},
|
|
2621
|
+
get: async (id, params) => {
|
|
2622
|
+
return await this._fetch(
|
|
2623
|
+
this.svAPIEndpoint,
|
|
2624
|
+
this.asset._path + `/${id}`,
|
|
2625
|
+
params
|
|
2626
|
+
);
|
|
2627
|
+
},
|
|
2628
|
+
create: async (body) => {
|
|
2629
|
+
let res = await this._create(
|
|
2630
|
+
this.svAPIEndpoint,
|
|
2631
|
+
this.asset._path,
|
|
2632
|
+
body
|
|
2633
|
+
);
|
|
2634
|
+
return res;
|
|
2635
|
+
},
|
|
2636
|
+
update: async (id, body) => {
|
|
2637
|
+
let res = await this._update(
|
|
2638
|
+
this.svAPIEndpoint,
|
|
2639
|
+
this.asset._path + `/${id}`,
|
|
2640
|
+
body
|
|
2641
|
+
);
|
|
2642
|
+
return res;
|
|
2643
|
+
},
|
|
2644
|
+
remove: async (id, params) => {
|
|
2645
|
+
let res = await this._delete(
|
|
2646
|
+
this.svAPIEndpoint,
|
|
2647
|
+
this.asset._path + `/${id}`,
|
|
2648
|
+
params
|
|
2649
|
+
);
|
|
2650
|
+
return res;
|
|
2651
|
+
},
|
|
2652
|
+
};
|
|
2653
|
+
this.assetUnit = {
|
|
2654
|
+
_path: this._end_points.ASSET_UNIT,
|
|
2655
|
+
find: async (params) => {
|
|
2656
|
+
let res = await this._fetch(
|
|
2657
|
+
this.svAPIEndpoint,
|
|
2658
|
+
this.assetUnit._path,
|
|
2659
|
+
params
|
|
2660
|
+
);
|
|
2661
|
+
return res;
|
|
2662
|
+
},
|
|
2663
|
+
get: async (id, params) => {
|
|
2664
|
+
return await this._fetch(
|
|
2665
|
+
this.svAPIEndpoint,
|
|
2666
|
+
this.assetUnit._path + `/${id}`,
|
|
2667
|
+
params
|
|
2668
|
+
);
|
|
2669
|
+
},
|
|
2670
|
+
create: async (body) => {
|
|
2671
|
+
let res = await this._create(
|
|
2672
|
+
this.svAPIEndpoint,
|
|
2673
|
+
this.assetUnit._path,
|
|
2674
|
+
body
|
|
2675
|
+
);
|
|
2676
|
+
return res;
|
|
2677
|
+
},
|
|
2678
|
+
update: async (id, body) => {
|
|
2679
|
+
let res = await this._update(
|
|
2680
|
+
this.svAPIEndpoint,
|
|
2681
|
+
this.assetUnit._path + `/${id}`,
|
|
2682
|
+
body
|
|
2683
|
+
);
|
|
2684
|
+
return res;
|
|
2685
|
+
},
|
|
2686
|
+
remove: async (id, params) => {
|
|
2687
|
+
let res = await this._delete(
|
|
2688
|
+
this.svAPIEndpoint,
|
|
2689
|
+
this.assetUnit._path + `/${id}`,
|
|
2690
|
+
params
|
|
2691
|
+
);
|
|
2692
|
+
return res;
|
|
2693
|
+
},
|
|
2694
|
+
};
|
|
2482
2695
|
this.svAPIEndpoint =
|
|
2483
2696
|
!options?.env || options?.env == "production"
|
|
2484
2697
|
? "https://sv.api.repzo.me"
|