repzo 1.0.289 → 1.0.290
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 +5 -0
- package/lib/index.d.ts +19 -2
- package/lib/index.js +37 -0
- package/lib/types/index.d.ts +149 -2
- package/package.json +1 -1
- package/src/index.ts +84 -0
- package/src/oas/bulk-export.yaml +272 -0
- package/src/oas/geo-zone.yaml +349 -0
- package/src/oas/rep.yaml +45 -0
- package/src/oas/settings.yaml +60 -0
- package/src/types/index.ts +210 -0
package/changelog.md
CHANGED
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
- add: apps-management, reset-company-namespace & test-reset-company-namespace @maramalshen
|
|
19
19
|
- add: `rep_can_edit_invoice_discount` & `rep_can_edit_sales_order_discount` to RepPermissions and the Rep find-params filters — gate the header discount overwrite (`overwriteDeductionFixed`/`overwriteDeductionRatio`) on invoices and Sales Orders @mkhamis
|
|
20
20
|
- add: header total `total_before_deduction_and_tax` (+ `pre_`/`return_` legs) on FullInvoice, Proforma and Cart (Schema, CreateBody, UpdateBody) — `total_before_tax + totalDeductionBeforeTax`, i.e. the net-of-tax subtotal before the cart (header) deduction; net of tax for inclusive-tax lines too, unlike `taxable_subtotal`. The Proforma types were also missing the `total_before_tax` / `pre_` / `return_` trio the backend has stored all along, so those are added alongside @mkhamis
|
|
21
|
+
- add: geo-zone (GeoZone) service and types — `find`/`get`/`create`/`update`/`remove`, `inject_assigned_reps` on find/get, GeoJSON `Polygon` (`{ type: "Polygon"; coordinates }`) with server-side ring validation, soft-delete via `disabled`, and the server-stamped `editor` audit object; `NotificationsCenter.Command` gains `update-geo-zone`; OAS `geo-zone.yaml`
|
|
22
|
+
- add: Rep `assigned_geo_zones` (RepSchema, RepBody, find-params filter, populated keys, RepWithPopulatedKeysSchema) — links a rep to geo zone(s) (currently at most one); OAS `rep.yaml`
|
|
23
|
+
- add: `rep_can_start_visit_out_of_geofence` & `rep_can_create_approval_request_to_start_visit_out_of_geofence` to RepPermissions and the Rep find-params filters — gate starting a visit while outside the geofence / assigned geo zone
|
|
24
|
+
- add: Settings geo-zone enforcement fields — `start_day_outside_active_zone_action` / `start_visit_outside_active_zone_action` / `work_outside_active_zone_action` (`monitor`/`warning`/`block`), `no_active_zone_action` (`allow`/`block`), `use_accuracy_radius_near_zone_boundary`, `zone_boundary_grace_minutes` (Settings.Data + UpdateBody); OAS `settings.yaml`
|
|
25
|
+
- add: bulkExport (BulkExport) service + types — `find` (list export jobs) and `create` (start an Excel/Parquet export job for ~50 entity types, keyed by `type`); mirrors `bulkImport` (the backend rejects get/update/patch/remove with 400); OAS `bulk-export.yaml`
|
|
21
26
|
|
|
22
27
|
### Changed
|
|
23
28
|
|
package/lib/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare const end_points: {
|
|
|
22
22
|
readonly TAG: "tag";
|
|
23
23
|
readonly WAREHOUSE: "warehouse";
|
|
24
24
|
readonly ROUTE: "route";
|
|
25
|
+
readonly GEO_ZONE: "geo-zone";
|
|
25
26
|
readonly PRODUCT_MODIFIERS_GROUP: "product-modifiers-group";
|
|
26
27
|
readonly CHANNEL: "client-channel";
|
|
27
28
|
readonly SPECIALITY: "speciality";
|
|
@@ -145,11 +146,12 @@ export declare const end_points: {
|
|
|
145
146
|
readonly CALENDAR: "calendar";
|
|
146
147
|
readonly LINE_TARGET: "line-target";
|
|
147
148
|
readonly BULK_IMPORT: "bulk-import";
|
|
149
|
+
readonly BULK_EXPORT: "bulk-export";
|
|
148
150
|
readonly DELIVERY_NOTE: "delivery-note";
|
|
149
151
|
readonly RESERVATION: "reservation";
|
|
150
152
|
};
|
|
151
153
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
152
|
-
export declare const availableService: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "itemStatusType", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason", "targetRule", "plan", "calendar", "lineTarget", "bulkImport"];
|
|
154
|
+
export declare const availableService: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "geoZone", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "itemStatusType", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason", "targetRule", "plan", "calendar", "lineTarget", "bulkImport", "bulkExport"];
|
|
153
155
|
export type AvailableService = (typeof availableService)[number];
|
|
154
156
|
export default class Repzo {
|
|
155
157
|
private svAPIEndpoint;
|
|
@@ -184,6 +186,7 @@ export default class Repzo {
|
|
|
184
186
|
readonly TAG: "tag";
|
|
185
187
|
readonly WAREHOUSE: "warehouse";
|
|
186
188
|
readonly ROUTE: "route";
|
|
189
|
+
readonly GEO_ZONE: "geo-zone";
|
|
187
190
|
readonly PRODUCT_MODIFIERS_GROUP: "product-modifiers-group";
|
|
188
191
|
readonly CHANNEL: "client-channel";
|
|
189
192
|
readonly SPECIALITY: "speciality";
|
|
@@ -307,6 +310,7 @@ export default class Repzo {
|
|
|
307
310
|
readonly CALENDAR: "calendar";
|
|
308
311
|
readonly LINE_TARGET: "line-target";
|
|
309
312
|
readonly BULK_IMPORT: "bulk-import";
|
|
313
|
+
readonly BULK_EXPORT: "bulk-export";
|
|
310
314
|
readonly DELIVERY_NOTE: "delivery-note";
|
|
311
315
|
readonly RESERVATION: "reservation";
|
|
312
316
|
};
|
|
@@ -316,7 +320,7 @@ export default class Repzo {
|
|
|
316
320
|
private _update;
|
|
317
321
|
private _patch;
|
|
318
322
|
private _delete;
|
|
319
|
-
available_services: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "itemStatusType", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason", "targetRule", "plan", "calendar", "lineTarget", "bulkImport"];
|
|
323
|
+
available_services: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "geoZone", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "itemStatusType", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason", "targetRule", "plan", "calendar", "lineTarget", "bulkImport", "bulkExport"];
|
|
320
324
|
generateUUID: ({ prefix, suffix, length, }: {
|
|
321
325
|
prefix?: string;
|
|
322
326
|
suffix?: string;
|
|
@@ -481,6 +485,14 @@ export default class Repzo {
|
|
|
481
485
|
update: (id: Service.Route.Update.ID, body: Service.Route.Update.Body) => Promise<Service.Route.Update.Result>;
|
|
482
486
|
remove: (id: Service.Route.Remove.ID) => Promise<Service.Route.Remove.Result>;
|
|
483
487
|
};
|
|
488
|
+
geoZone: {
|
|
489
|
+
_path: "geo-zone";
|
|
490
|
+
find: (params?: Service.GeoZone.Find.Params) => Promise<Service.GeoZone.Find.Result>;
|
|
491
|
+
get: (id: Service.GeoZone.Get.ID, params?: Service.GeoZone.Get.Params) => Promise<Service.GeoZone.Get.Result>;
|
|
492
|
+
create: (body: Service.GeoZone.Create.Body) => Promise<Service.GeoZone.Create.Result>;
|
|
493
|
+
update: (id: Service.GeoZone.Update.ID, body: Service.GeoZone.Update.Body) => Promise<Service.GeoZone.Update.Result>;
|
|
494
|
+
remove: (id: Service.GeoZone.Remove.ID) => Promise<Service.GeoZone.Remove.Result>;
|
|
495
|
+
};
|
|
484
496
|
productModifiersGroup: {
|
|
485
497
|
_path: "product-modifiers-group";
|
|
486
498
|
find: (params?: Service.ProductModifiersGroup.Find.Params) => Promise<Service.ProductModifiersGroup.Find.Result>;
|
|
@@ -1420,6 +1432,11 @@ export default class Repzo {
|
|
|
1420
1432
|
create: (params: Service.BulkImport.Create.Params, body: Service.BulkImport.Create.Body) => Promise<Service.BulkImport.Create.Result>;
|
|
1421
1433
|
update: (id: Service.BulkImport.Update.ID) => Promise<Service.BulkImport.Update.Result>;
|
|
1422
1434
|
};
|
|
1435
|
+
bulkExport: {
|
|
1436
|
+
_path: "bulk-export";
|
|
1437
|
+
find: (params?: Service.BulkExport.Find.Params) => Promise<Service.BulkExport.Find.Result>;
|
|
1438
|
+
create: (params: Service.BulkExport.Create.Params, body: Service.BulkExport.Create.Body) => Promise<Service.BulkExport.Create.Result>;
|
|
1439
|
+
};
|
|
1423
1440
|
deliveryNote: {
|
|
1424
1441
|
_path: "delivery-note";
|
|
1425
1442
|
find: (params?: Service.DeliveryNote.Find.Params) => Promise<Service.DeliveryNote.Find.Result>;
|
package/lib/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export const end_points = {
|
|
|
24
24
|
TAG: "tag",
|
|
25
25
|
WAREHOUSE: "warehouse",
|
|
26
26
|
ROUTE: "route",
|
|
27
|
+
GEO_ZONE: "geo-zone",
|
|
27
28
|
PRODUCT_MODIFIERS_GROUP: "product-modifiers-group",
|
|
28
29
|
CHANNEL: "client-channel",
|
|
29
30
|
SPECIALITY: "speciality",
|
|
@@ -147,6 +148,7 @@ export const end_points = {
|
|
|
147
148
|
CALENDAR: "calendar",
|
|
148
149
|
LINE_TARGET: "line-target",
|
|
149
150
|
BULK_IMPORT: "bulk-import",
|
|
151
|
+
BULK_EXPORT: "bulk-export",
|
|
150
152
|
DELIVERY_NOTE: "delivery-note",
|
|
151
153
|
RESERVATION: "reservation",
|
|
152
154
|
};
|
|
@@ -170,6 +172,7 @@ export const availableService = [
|
|
|
170
172
|
"tag",
|
|
171
173
|
"warehouse",
|
|
172
174
|
"route",
|
|
175
|
+
"geoZone",
|
|
173
176
|
"productModifiersGroup",
|
|
174
177
|
"channel",
|
|
175
178
|
"speciality",
|
|
@@ -253,6 +256,7 @@ export const availableService = [
|
|
|
253
256
|
"calendar",
|
|
254
257
|
"lineTarget",
|
|
255
258
|
"bulkImport",
|
|
259
|
+
"bulkExport",
|
|
256
260
|
];
|
|
257
261
|
class Repzo {
|
|
258
262
|
constructor(apiKey, options) {
|
|
@@ -712,6 +716,28 @@ class Repzo {
|
|
|
712
716
|
return res;
|
|
713
717
|
},
|
|
714
718
|
};
|
|
719
|
+
this.geoZone = {
|
|
720
|
+
_path: Repzo._end_points.GEO_ZONE,
|
|
721
|
+
find: async (params) => {
|
|
722
|
+
let res = await this._fetch(this.svAPIEndpoint, this.geoZone._path, params);
|
|
723
|
+
return res;
|
|
724
|
+
},
|
|
725
|
+
get: async (id, params) => {
|
|
726
|
+
return await this._fetch(this.svAPIEndpoint, this.geoZone._path + `/${id}`, params);
|
|
727
|
+
},
|
|
728
|
+
create: async (body) => {
|
|
729
|
+
let res = await this._create(this.svAPIEndpoint, this.geoZone._path, body);
|
|
730
|
+
return res;
|
|
731
|
+
},
|
|
732
|
+
update: async (id, body) => {
|
|
733
|
+
let res = await this._update(this.svAPIEndpoint, this.geoZone._path + `/${id}`, body);
|
|
734
|
+
return res;
|
|
735
|
+
},
|
|
736
|
+
remove: async (id) => {
|
|
737
|
+
let res = await this._delete(this.svAPIEndpoint, this.geoZone._path + `/${id}`);
|
|
738
|
+
return res;
|
|
739
|
+
},
|
|
740
|
+
};
|
|
715
741
|
this.productModifiersGroup = {
|
|
716
742
|
_path: Repzo._end_points.PRODUCT_MODIFIERS_GROUP,
|
|
717
743
|
find: async (params) => {
|
|
@@ -2955,6 +2981,17 @@ class Repzo {
|
|
|
2955
2981
|
return res;
|
|
2956
2982
|
},
|
|
2957
2983
|
};
|
|
2984
|
+
this.bulkExport = {
|
|
2985
|
+
_path: Repzo._end_points.BULK_EXPORT,
|
|
2986
|
+
find: async (params) => {
|
|
2987
|
+
let res = await this._fetch(this.svAPIEndpoint, this.bulkExport._path, params);
|
|
2988
|
+
return res;
|
|
2989
|
+
},
|
|
2990
|
+
create: async (params, body) => {
|
|
2991
|
+
let res = await this._create(this.svAPIEndpoint, this.bulkExport._path, body, params);
|
|
2992
|
+
return res;
|
|
2993
|
+
},
|
|
2994
|
+
};
|
|
2958
2995
|
this.deliveryNote = {
|
|
2959
2996
|
_path: Repzo._end_points.DELIVERY_NOTE,
|
|
2960
2997
|
find: async (params) => {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2466,6 +2466,78 @@ export declare namespace Service {
|
|
|
2466
2466
|
type Result = TeamSchema;
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
2469
|
+
namespace GeoZone {
|
|
2470
|
+
interface Polygon {
|
|
2471
|
+
type: "Polygon";
|
|
2472
|
+
coordinates: [number, number][][];
|
|
2473
|
+
}
|
|
2474
|
+
interface AssignedRep {
|
|
2475
|
+
_id: StringId;
|
|
2476
|
+
name: string;
|
|
2477
|
+
}
|
|
2478
|
+
interface Data {
|
|
2479
|
+
_id: StringId;
|
|
2480
|
+
name: string;
|
|
2481
|
+
description?: string;
|
|
2482
|
+
polygon: Polygon;
|
|
2483
|
+
disabled: boolean;
|
|
2484
|
+
editor: AdminOrRepOrTenantOrClient;
|
|
2485
|
+
assigned_reps?: AssignedRep[];
|
|
2486
|
+
company_namespace: string[];
|
|
2487
|
+
createdAt: string;
|
|
2488
|
+
updatedAt: string;
|
|
2489
|
+
__v: number;
|
|
2490
|
+
}
|
|
2491
|
+
interface CreateBody {
|
|
2492
|
+
name: string;
|
|
2493
|
+
description?: string;
|
|
2494
|
+
polygon: Polygon;
|
|
2495
|
+
company_namespace?: string[];
|
|
2496
|
+
}
|
|
2497
|
+
interface UpdateBody {
|
|
2498
|
+
name?: string;
|
|
2499
|
+
description?: string;
|
|
2500
|
+
polygon?: Polygon;
|
|
2501
|
+
disabled?: boolean;
|
|
2502
|
+
editor?: AdminOrRepOrTenantOrClient;
|
|
2503
|
+
}
|
|
2504
|
+
namespace Find {
|
|
2505
|
+
type Params = DefaultPaginationQueryParams & {
|
|
2506
|
+
_id?: StringId | StringId[];
|
|
2507
|
+
name?: string | string[];
|
|
2508
|
+
search?: string;
|
|
2509
|
+
disabled?: boolean;
|
|
2510
|
+
inject_assigned_reps?: boolean;
|
|
2511
|
+
from_updatedAt?: number;
|
|
2512
|
+
to_updatedAt?: number;
|
|
2513
|
+
from_createdAt?: number;
|
|
2514
|
+
to_createdAt?: number;
|
|
2515
|
+
};
|
|
2516
|
+
interface Result extends DefaultPaginationResult {
|
|
2517
|
+
data: Data[];
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
namespace Get {
|
|
2521
|
+
type ID = StringId;
|
|
2522
|
+
type Params = {
|
|
2523
|
+
inject_assigned_reps?: boolean;
|
|
2524
|
+
};
|
|
2525
|
+
type Result = Data;
|
|
2526
|
+
}
|
|
2527
|
+
namespace Create {
|
|
2528
|
+
type Body = CreateBody;
|
|
2529
|
+
type Result = Data;
|
|
2530
|
+
}
|
|
2531
|
+
namespace Update {
|
|
2532
|
+
type ID = StringId;
|
|
2533
|
+
type Body = UpdateBody;
|
|
2534
|
+
type Result = Data;
|
|
2535
|
+
}
|
|
2536
|
+
namespace Remove {
|
|
2537
|
+
type ID = StringId;
|
|
2538
|
+
type Result = Data;
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2469
2541
|
namespace Rep {
|
|
2470
2542
|
interface RepPermissions {
|
|
2471
2543
|
rep_can_print_payment_after_allowance_period?: boolean;
|
|
@@ -2558,6 +2630,8 @@ export declare namespace Service {
|
|
|
2558
2630
|
rep_can_create_client_line_approval_request?: boolean;
|
|
2559
2631
|
rep_can_enter_client_code_at_create_client?: boolean;
|
|
2560
2632
|
rep_can_edit_client_location_at_create_client?: boolean;
|
|
2633
|
+
rep_can_start_visit_out_of_geofence?: boolean;
|
|
2634
|
+
rep_can_create_approval_request_to_start_visit_out_of_geofence?: boolean;
|
|
2561
2635
|
}
|
|
2562
2636
|
interface TargetResults {
|
|
2563
2637
|
totalPoints: number;
|
|
@@ -2621,6 +2695,7 @@ export declare namespace Service {
|
|
|
2621
2695
|
};
|
|
2622
2696
|
force_online_connectivity?: boolean;
|
|
2623
2697
|
assigned_targets?: string[];
|
|
2698
|
+
assigned_geo_zones?: (string | GeoZone.Data)[];
|
|
2624
2699
|
lines?: string[];
|
|
2625
2700
|
targetResults?: TargetResults;
|
|
2626
2701
|
previously_assigned_clients?: string[];
|
|
@@ -2681,6 +2756,7 @@ export declare namespace Service {
|
|
|
2681
2756
|
};
|
|
2682
2757
|
force_online_connectivity?: boolean;
|
|
2683
2758
|
assigned_targets?: string[];
|
|
2759
|
+
assigned_geo_zones?: string[] | null;
|
|
2684
2760
|
lines?: string[];
|
|
2685
2761
|
targetResults?: TargetResults;
|
|
2686
2762
|
previously_assigned_clients?: string[];
|
|
@@ -2705,13 +2781,14 @@ export declare namespace Service {
|
|
|
2705
2781
|
handle_credit_limit?: boolean;
|
|
2706
2782
|
credit_limit?: number;
|
|
2707
2783
|
}
|
|
2708
|
-
type PopulatedKeys = "line" | "lines" | "job_category" | "teams" | "assigned_forms_v2" | "job_category" | "cover_photo" | "assigned_plan" | "assigned_retail_execution_templates" | "assigned_clm_presentations" | "warehouse";
|
|
2784
|
+
type PopulatedKeys = "line" | "lines" | "job_category" | "teams" | "assigned_forms_v2" | "job_category" | "cover_photo" | "assigned_plan" | "assigned_retail_execution_templates" | "assigned_clm_presentations" | "assigned_geo_zones" | "warehouse";
|
|
2709
2785
|
export type RepWithPopulatedKeysSchema = RepSchema & {
|
|
2710
2786
|
lines?: string[] | Line.LineSchema[];
|
|
2711
2787
|
job_category?: string[] | JobCategory.JobCategorySchema[];
|
|
2712
2788
|
teams?: string[] | Team.TeamSchema[];
|
|
2713
2789
|
assigned_warehouse?: string | Pick<Warehouse.WarehouseSchema, "_id" | "name" | "code" | "type" | "integration_meta">;
|
|
2714
2790
|
assigned_main_warehouse?: string | Pick<Warehouse.WarehouseSchema, "_id" | "name" | "code" | "type" | "integration_meta">;
|
|
2791
|
+
assigned_geo_zones?: (string | GeoZone.Data)[];
|
|
2715
2792
|
};
|
|
2716
2793
|
export namespace Find {
|
|
2717
2794
|
type Params = DefaultPaginationQueryParams & {
|
|
@@ -2733,6 +2810,7 @@ export declare namespace Service {
|
|
|
2733
2810
|
assigned_plan?: string | string[];
|
|
2734
2811
|
force_online_connectivity?: boolean;
|
|
2735
2812
|
assigned_targets?: string | string[];
|
|
2813
|
+
assigned_geo_zones?: string | string[];
|
|
2736
2814
|
lines?: string | string[];
|
|
2737
2815
|
job_option?: JobOption | JobOption[];
|
|
2738
2816
|
"permissions.rep_can_add_client"?: boolean;
|
|
@@ -2821,6 +2899,8 @@ export declare namespace Service {
|
|
|
2821
2899
|
"permissions.rep_can_create_client_line_approval_request"?: boolean;
|
|
2822
2900
|
"permissions.rep_can_enter_client_code_at_create_client"?: boolean;
|
|
2823
2901
|
"permissions.rep_can_edit_client_location_at_create_client"?: boolean;
|
|
2902
|
+
"permissions.rep_can_start_visit_out_of_geofence"?: boolean;
|
|
2903
|
+
"permissions.rep_can_create_approval_request_to_start_visit_out_of_geofence"?: boolean;
|
|
2824
2904
|
"permissions.rep_can_view_stock_on_transfers"?: boolean;
|
|
2825
2905
|
"permissions.rep_must_invoice_items_from_cross_inventory_and_msl"?: boolean;
|
|
2826
2906
|
"settings.rep_must_end_day_after"?: `${number}:${number}`;
|
|
@@ -12746,6 +12826,12 @@ export declare namespace Service {
|
|
|
12746
12826
|
enable_whatsapp_mfa: boolean;
|
|
12747
12827
|
enable_authenticator_mfa: boolean;
|
|
12748
12828
|
minimum_accepted_mfa: number;
|
|
12829
|
+
start_day_outside_active_zone_action: "monitor" | "warning" | "block";
|
|
12830
|
+
start_visit_outside_active_zone_action: "monitor" | "warning" | "block";
|
|
12831
|
+
work_outside_active_zone_action: "monitor" | "warning" | "block";
|
|
12832
|
+
no_active_zone_action: "allow" | "block";
|
|
12833
|
+
use_accuracy_radius_near_zone_boundary: boolean;
|
|
12834
|
+
zone_boundary_grace_minutes: number;
|
|
12749
12835
|
createdAt: Date;
|
|
12750
12836
|
updatedAt: Date;
|
|
12751
12837
|
}
|
|
@@ -12938,6 +13024,12 @@ export declare namespace Service {
|
|
|
12938
13024
|
enable_whatsapp_mfa: boolean;
|
|
12939
13025
|
enable_authenticator_mfa: boolean;
|
|
12940
13026
|
minimum_accepted_mfa: number;
|
|
13027
|
+
start_day_outside_active_zone_action?: "monitor" | "warning" | "block";
|
|
13028
|
+
start_visit_outside_active_zone_action?: "monitor" | "warning" | "block";
|
|
13029
|
+
work_outside_active_zone_action?: "monitor" | "warning" | "block";
|
|
13030
|
+
no_active_zone_action?: "allow" | "block";
|
|
13031
|
+
use_accuracy_radius_near_zone_boundary?: boolean;
|
|
13032
|
+
zone_boundary_grace_minutes?: number;
|
|
12941
13033
|
}
|
|
12942
13034
|
namespace Update {
|
|
12943
13035
|
type ID = StringId;
|
|
@@ -16232,7 +16324,7 @@ export declare namespace Service {
|
|
|
16232
16324
|
export {};
|
|
16233
16325
|
}
|
|
16234
16326
|
namespace NotificationsCenter {
|
|
16235
|
-
export type Command = "update-categories" | "update-clients" | "bulk-update-clients" | "update-inventory" | "update-measureunitFamilies" | "update-measureunits" | "update-pricelistItems" | "update-pricelists" | "update-products" | "update-rep" | "update-salesmsl" | "update-settings" | "update-tags" | "update-taxes" | "update-transfer" | "update-warehouses" | "update-jobCategories" | "update-plans" | "update-workorders" | "update-commentsThread" | "update-approval-request" | "update-variant-batch" | "update-asset-part-type" | "update-asset-part" | "update-asset-part-unit" | "update-custom-status" | "update-module-custom-validator" | "update-feedback-options" | "update-customfields" | "update-speciality" | "update-clm-presentation" | "update-clm-sequence" | "update-clm-slide" | "update-promotions" | "ai-chat-navigate" | "ai-chat-api-call" | "ai-chat-message-update" | "ai-chat-message-amend" | "update-delivery-note" | "update-item-status-type";
|
|
16327
|
+
export type Command = "update-categories" | "update-clients" | "bulk-update-clients" | "update-inventory" | "update-measureunitFamilies" | "update-measureunits" | "update-pricelistItems" | "update-pricelists" | "update-products" | "update-rep" | "update-salesmsl" | "update-settings" | "update-geo-zone" | "update-tags" | "update-taxes" | "update-transfer" | "update-warehouses" | "update-jobCategories" | "update-plans" | "update-workorders" | "update-commentsThread" | "update-approval-request" | "update-variant-batch" | "update-asset-part-type" | "update-asset-part" | "update-asset-part-unit" | "update-custom-status" | "update-module-custom-validator" | "update-feedback-options" | "update-customfields" | "update-speciality" | "update-clm-presentation" | "update-clm-sequence" | "update-clm-slide" | "update-promotions" | "ai-chat-navigate" | "ai-chat-api-call" | "ai-chat-message-update" | "ai-chat-message-amend" | "update-delivery-note" | "update-item-status-type";
|
|
16236
16328
|
export interface Data {
|
|
16237
16329
|
_id: StringId;
|
|
16238
16330
|
command: Command;
|
|
@@ -19998,6 +20090,61 @@ export declare namespace Service {
|
|
|
19998
20090
|
}
|
|
19999
20091
|
export {};
|
|
20000
20092
|
}
|
|
20093
|
+
namespace BulkExport {
|
|
20094
|
+
type BulkExportType = "clients" | "products" | "variants" | "categories" | "subCategories" | "availabilityMsl" | "availabilityMslWithProducts" | "reps" | "mslWithVariants" | "jobCategories" | "jobs" | "tags" | "routes" | "routesWithClients" | "plans" | "planWithRules" | "targetRulesWithClients" | "rulesWithRoutes" | "targetRulesWithReps" | "adjustAccount" | "rules" | "warehouses" | "productGroups" | "priceListItems" | "measureunit" | "measureunitFamily" | "lineTarget" | "clientLineClassification" | "retailExecutionPresets" | "promotions" | "customListItems" | "assets" | "assetUnits" | "speciality" | "clientLocation" | "reminders" | "admins" | "companyGroup" | "company" | "variantBatch" | "banksList" | "clientUblInfo" | "supplier" | "contractInstallment" | "targetRule" | "contracts" | "assetPartTypes" | "assetParts" | "clientUblInfo_JO" | "clientUblInfo_SA" | "nameSpaceFreshnessWindowCodes";
|
|
20095
|
+
interface Data {
|
|
20096
|
+
_id: StringId;
|
|
20097
|
+
creator: AdminOrRepOrTenantOrClient;
|
|
20098
|
+
type: BulkExportType;
|
|
20099
|
+
status: "processing" | "success" | "fail";
|
|
20100
|
+
messages: any[];
|
|
20101
|
+
_errors: any[];
|
|
20102
|
+
start_time: number;
|
|
20103
|
+
end_time?: number;
|
|
20104
|
+
bucket_name?: string;
|
|
20105
|
+
region?: string;
|
|
20106
|
+
key?: string;
|
|
20107
|
+
link?: string;
|
|
20108
|
+
media?: StringId[];
|
|
20109
|
+
teams: string[];
|
|
20110
|
+
export_type: "excel" | "parquet";
|
|
20111
|
+
row_count?: number;
|
|
20112
|
+
company_namespace: string[];
|
|
20113
|
+
createdAt: Date;
|
|
20114
|
+
updatedAt: Date;
|
|
20115
|
+
}
|
|
20116
|
+
interface CreateBody {
|
|
20117
|
+
export_type?: "excel" | "parquet";
|
|
20118
|
+
columns?: {
|
|
20119
|
+
[key: string]: any;
|
|
20120
|
+
};
|
|
20121
|
+
name?: string;
|
|
20122
|
+
creator?: AdminOrRepOrTenantOrClient;
|
|
20123
|
+
company_namespace?: string[];
|
|
20124
|
+
}
|
|
20125
|
+
namespace Find {
|
|
20126
|
+
type Params = DefaultPaginationQueryParams & {
|
|
20127
|
+
_id?: StringId | StringId[];
|
|
20128
|
+
type?: BulkExportType;
|
|
20129
|
+
status?: Data["status"] | Data["status"][];
|
|
20130
|
+
export?: boolean;
|
|
20131
|
+
export_type?: "excel" | "parquet";
|
|
20132
|
+
from_updatedAt?: number;
|
|
20133
|
+
to_updatedAt?: number;
|
|
20134
|
+
};
|
|
20135
|
+
interface Result extends DefaultPaginationResult {
|
|
20136
|
+
data: Data[];
|
|
20137
|
+
}
|
|
20138
|
+
}
|
|
20139
|
+
namespace Create {
|
|
20140
|
+
type Params = {
|
|
20141
|
+
type: BulkExportType;
|
|
20142
|
+
[key: string]: any;
|
|
20143
|
+
};
|
|
20144
|
+
type Body = CreateBody;
|
|
20145
|
+
type Result = Data;
|
|
20146
|
+
}
|
|
20147
|
+
}
|
|
20001
20148
|
namespace DeliveryNote {
|
|
20002
20149
|
interface User {
|
|
20003
20150
|
_id: string;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ export const end_points = {
|
|
|
34
34
|
TAG: "tag",
|
|
35
35
|
WAREHOUSE: "warehouse",
|
|
36
36
|
ROUTE: "route",
|
|
37
|
+
GEO_ZONE: "geo-zone",
|
|
37
38
|
PRODUCT_MODIFIERS_GROUP: "product-modifiers-group",
|
|
38
39
|
CHANNEL: "client-channel",
|
|
39
40
|
SPECIALITY: "speciality",
|
|
@@ -157,6 +158,7 @@ export const end_points = {
|
|
|
157
158
|
CALENDAR: "calendar",
|
|
158
159
|
LINE_TARGET: "line-target",
|
|
159
160
|
BULK_IMPORT: "bulk-import",
|
|
161
|
+
BULK_EXPORT: "bulk-export",
|
|
160
162
|
DELIVERY_NOTE: "delivery-note",
|
|
161
163
|
RESERVATION: "reservation",
|
|
162
164
|
} as const;
|
|
@@ -182,6 +184,7 @@ export const availableService = [
|
|
|
182
184
|
"tag",
|
|
183
185
|
"warehouse",
|
|
184
186
|
"route",
|
|
187
|
+
"geoZone",
|
|
185
188
|
"productModifiersGroup",
|
|
186
189
|
"channel",
|
|
187
190
|
"speciality",
|
|
@@ -265,6 +268,7 @@ export const availableService = [
|
|
|
265
268
|
"calendar",
|
|
266
269
|
"lineTarget",
|
|
267
270
|
"bulkImport",
|
|
271
|
+
"bulkExport",
|
|
268
272
|
] as const;
|
|
269
273
|
export type AvailableService = (typeof availableService)[number];
|
|
270
274
|
|
|
@@ -1485,6 +1489,60 @@ export default class Repzo {
|
|
|
1485
1489
|
},
|
|
1486
1490
|
};
|
|
1487
1491
|
|
|
1492
|
+
geoZone = {
|
|
1493
|
+
_path: Repzo._end_points.GEO_ZONE,
|
|
1494
|
+
find: async (
|
|
1495
|
+
params?: Service.GeoZone.Find.Params,
|
|
1496
|
+
): Promise<Service.GeoZone.Find.Result> => {
|
|
1497
|
+
let res: Service.GeoZone.Find.Result = await this._fetch(
|
|
1498
|
+
this.svAPIEndpoint,
|
|
1499
|
+
this.geoZone._path,
|
|
1500
|
+
params,
|
|
1501
|
+
);
|
|
1502
|
+
return res;
|
|
1503
|
+
},
|
|
1504
|
+
get: async (
|
|
1505
|
+
id: Service.GeoZone.Get.ID,
|
|
1506
|
+
params?: Service.GeoZone.Get.Params,
|
|
1507
|
+
): Promise<Service.GeoZone.Get.Result> => {
|
|
1508
|
+
return await this._fetch(
|
|
1509
|
+
this.svAPIEndpoint,
|
|
1510
|
+
this.geoZone._path + `/${id}`,
|
|
1511
|
+
params,
|
|
1512
|
+
);
|
|
1513
|
+
},
|
|
1514
|
+
create: async (
|
|
1515
|
+
body: Service.GeoZone.Create.Body,
|
|
1516
|
+
): Promise<Service.GeoZone.Create.Result> => {
|
|
1517
|
+
let res = await this._create(
|
|
1518
|
+
this.svAPIEndpoint,
|
|
1519
|
+
this.geoZone._path,
|
|
1520
|
+
body,
|
|
1521
|
+
);
|
|
1522
|
+
return res;
|
|
1523
|
+
},
|
|
1524
|
+
update: async (
|
|
1525
|
+
id: Service.GeoZone.Update.ID,
|
|
1526
|
+
body: Service.GeoZone.Update.Body,
|
|
1527
|
+
): Promise<Service.GeoZone.Update.Result> => {
|
|
1528
|
+
let res: Service.GeoZone.Update.Result = await this._update(
|
|
1529
|
+
this.svAPIEndpoint,
|
|
1530
|
+
this.geoZone._path + `/${id}`,
|
|
1531
|
+
body,
|
|
1532
|
+
);
|
|
1533
|
+
return res;
|
|
1534
|
+
},
|
|
1535
|
+
remove: async (
|
|
1536
|
+
id: Service.GeoZone.Remove.ID,
|
|
1537
|
+
): Promise<Service.GeoZone.Remove.Result> => {
|
|
1538
|
+
let res: Service.GeoZone.Remove.Result = await this._delete(
|
|
1539
|
+
this.svAPIEndpoint,
|
|
1540
|
+
this.geoZone._path + `/${id}`,
|
|
1541
|
+
);
|
|
1542
|
+
return res;
|
|
1543
|
+
},
|
|
1544
|
+
};
|
|
1545
|
+
|
|
1488
1546
|
productModifiersGroup = {
|
|
1489
1547
|
_path: Repzo._end_points.PRODUCT_MODIFIERS_GROUP,
|
|
1490
1548
|
find: async (
|
|
@@ -7374,6 +7432,32 @@ export default class Repzo {
|
|
|
7374
7432
|
},
|
|
7375
7433
|
};
|
|
7376
7434
|
|
|
7435
|
+
bulkExport = {
|
|
7436
|
+
_path: Repzo._end_points.BULK_EXPORT,
|
|
7437
|
+
find: async (
|
|
7438
|
+
params?: Service.BulkExport.Find.Params,
|
|
7439
|
+
): Promise<Service.BulkExport.Find.Result> => {
|
|
7440
|
+
let res: Service.BulkExport.Find.Result = await this._fetch(
|
|
7441
|
+
this.svAPIEndpoint,
|
|
7442
|
+
this.bulkExport._path,
|
|
7443
|
+
params,
|
|
7444
|
+
);
|
|
7445
|
+
return res;
|
|
7446
|
+
},
|
|
7447
|
+
create: async (
|
|
7448
|
+
params: Service.BulkExport.Create.Params,
|
|
7449
|
+
body: Service.BulkExport.Create.Body,
|
|
7450
|
+
): Promise<Service.BulkExport.Create.Result> => {
|
|
7451
|
+
let res = await this._create(
|
|
7452
|
+
this.svAPIEndpoint,
|
|
7453
|
+
this.bulkExport._path,
|
|
7454
|
+
body,
|
|
7455
|
+
params,
|
|
7456
|
+
);
|
|
7457
|
+
return res;
|
|
7458
|
+
},
|
|
7459
|
+
};
|
|
7460
|
+
|
|
7377
7461
|
deliveryNote = {
|
|
7378
7462
|
_path: Repzo._end_points.DELIVERY_NOTE,
|
|
7379
7463
|
find: async (
|