repzo 1.0.184 → 1.0.186
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/lib/index.d.ts +16 -4
- package/lib/index.js +17 -0
- package/lib/types/index.d.ts +119 -4
- package/lib/types/index.js +31 -0
- package/package.json +1 -1
- package/src/index.ts +31 -0
- package/src/types/index.ts +142 -0
package/lib/index.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ export declare const end_points: {
|
|
|
93
93
|
readonly RESET_COMPANY_NAMESPACE: "reset-company-namespace";
|
|
94
94
|
readonly TEST_RESET_COMPANY_NAMESPACE: "test-reset-company-namespace";
|
|
95
95
|
readonly TIMELINE_TIME_LIST: "timeline-time-list";
|
|
96
|
+
readonly SALES_ANALYTICS_REPORT: "sales-analytics-report";
|
|
96
97
|
readonly WORKORDER_AGENDA: "workorder-agenda";
|
|
97
98
|
readonly MODULE_CUSTOM_VALIDATOR: "module-custom-validator";
|
|
98
99
|
readonly NOTIFICATIONS_CENTER: "notifications-center";
|
|
@@ -100,10 +101,11 @@ export declare const end_points: {
|
|
|
100
101
|
readonly REPORT_COLUMN: "report-column";
|
|
101
102
|
readonly REPORT_SORT: "report-sort";
|
|
102
103
|
readonly REPORT_FILTER: "report-filter";
|
|
104
|
+
readonly SAFE_CRUD: "safe-crud";
|
|
103
105
|
};
|
|
104
|
-
export type EndPoints =
|
|
105
|
-
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", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "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"];
|
|
106
|
-
export type AvailableService =
|
|
106
|
+
export type EndPoints = typeof end_points[keyof typeof end_points];
|
|
107
|
+
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", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "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"];
|
|
108
|
+
export type AvailableService = typeof availableService[number];
|
|
107
109
|
export default class Repzo {
|
|
108
110
|
private svAPIEndpoint;
|
|
109
111
|
headers: Headers;
|
|
@@ -204,6 +206,7 @@ export default class Repzo {
|
|
|
204
206
|
readonly RESET_COMPANY_NAMESPACE: "reset-company-namespace";
|
|
205
207
|
readonly TEST_RESET_COMPANY_NAMESPACE: "test-reset-company-namespace";
|
|
206
208
|
readonly TIMELINE_TIME_LIST: "timeline-time-list";
|
|
209
|
+
readonly SALES_ANALYTICS_REPORT: "sales-analytics-report";
|
|
207
210
|
readonly WORKORDER_AGENDA: "workorder-agenda";
|
|
208
211
|
readonly MODULE_CUSTOM_VALIDATOR: "module-custom-validator";
|
|
209
212
|
readonly NOTIFICATIONS_CENTER: "notifications-center";
|
|
@@ -211,13 +214,14 @@ export default class Repzo {
|
|
|
211
214
|
readonly REPORT_COLUMN: "report-column";
|
|
212
215
|
readonly REPORT_SORT: "report-sort";
|
|
213
216
|
readonly REPORT_FILTER: "report-filter";
|
|
217
|
+
readonly SAFE_CRUD: "safe-crud";
|
|
214
218
|
};
|
|
215
219
|
private _fetch;
|
|
216
220
|
private _create;
|
|
217
221
|
private _update;
|
|
218
222
|
private _patch;
|
|
219
223
|
private _delete;
|
|
220
|
-
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", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "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"];
|
|
224
|
+
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", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "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"];
|
|
221
225
|
client: {
|
|
222
226
|
_path: "client";
|
|
223
227
|
find: (params?: Service.Client.Find.Params) => Promise<Service.Client.Find.Result>;
|
|
@@ -958,6 +962,10 @@ export default class Repzo {
|
|
|
958
962
|
_path: "timeline-time-list";
|
|
959
963
|
find: (params?: Service.TimelineTimeList.Find.Params) => Promise<Service.TimelineTimeList.Find.Result>;
|
|
960
964
|
};
|
|
965
|
+
salesAnalyticsReport: {
|
|
966
|
+
_path: "sales-analytics-report";
|
|
967
|
+
find: (params?: Service.SalesAnalyticsReport.Find.Params) => Promise<Service.SalesAnalyticsReport.Find.Result>;
|
|
968
|
+
};
|
|
961
969
|
workorderAgenda: {
|
|
962
970
|
_path: "workorder-agenda";
|
|
963
971
|
find: (params: Service.WorkorderAgenda.Find.Params) => Promise<Service.WorkorderAgenda.Find.Result>;
|
|
@@ -1010,4 +1018,8 @@ export default class Repzo {
|
|
|
1010
1018
|
create: (body: Service.ReportFilter.Create.Body) => Promise<Service.ReportFilter.Create.Result>;
|
|
1011
1019
|
update: (id: Service.ReportFilter.Update.ID, body: Service.ReportFilter.Update.Body) => Promise<Service.ReportFilter.Update.Result>;
|
|
1012
1020
|
};
|
|
1021
|
+
safeCrud: {
|
|
1022
|
+
_path: "safe-crud";
|
|
1023
|
+
create: (body: Service.SafeCrud.Create.Body) => Promise<Service.SafeCrud.Create.Result>;
|
|
1024
|
+
};
|
|
1013
1025
|
}
|
package/lib/index.js
CHANGED
|
@@ -94,6 +94,7 @@ export const end_points = {
|
|
|
94
94
|
RESET_COMPANY_NAMESPACE: "reset-company-namespace",
|
|
95
95
|
TEST_RESET_COMPANY_NAMESPACE: "test-reset-company-namespace",
|
|
96
96
|
TIMELINE_TIME_LIST: "timeline-time-list",
|
|
97
|
+
SALES_ANALYTICS_REPORT: "sales-analytics-report",
|
|
97
98
|
WORKORDER_AGENDA: "workorder-agenda",
|
|
98
99
|
MODULE_CUSTOM_VALIDATOR: "module-custom-validator",
|
|
99
100
|
NOTIFICATIONS_CENTER: "notifications-center",
|
|
@@ -101,6 +102,7 @@ export const end_points = {
|
|
|
101
102
|
REPORT_COLUMN: "report-column",
|
|
102
103
|
REPORT_SORT: "report-sort",
|
|
103
104
|
REPORT_FILTER: "report-filter",
|
|
105
|
+
SAFE_CRUD: "safe-crud",
|
|
104
106
|
};
|
|
105
107
|
export const availableService = [
|
|
106
108
|
"client",
|
|
@@ -190,6 +192,7 @@ export const availableService = [
|
|
|
190
192
|
"repBalanceSummary",
|
|
191
193
|
"workorderPortalLink",
|
|
192
194
|
"customField",
|
|
195
|
+
"salesAnalyticsReport",
|
|
193
196
|
];
|
|
194
197
|
class Repzo {
|
|
195
198
|
constructor(apiKey, options) {
|
|
@@ -1940,6 +1943,13 @@ class Repzo {
|
|
|
1940
1943
|
return res;
|
|
1941
1944
|
},
|
|
1942
1945
|
};
|
|
1946
|
+
this.salesAnalyticsReport = {
|
|
1947
|
+
_path: Repzo._end_points.SALES_ANALYTICS_REPORT,
|
|
1948
|
+
find: async (params) => {
|
|
1949
|
+
let res = await this._fetch(this.svAPIEndpoint, this.salesAnalyticsReport._path, params);
|
|
1950
|
+
return res;
|
|
1951
|
+
},
|
|
1952
|
+
};
|
|
1943
1953
|
this.workorderAgenda = {
|
|
1944
1954
|
_path: Repzo._end_points.WORKORDER_AGENDA,
|
|
1945
1955
|
find: async (params) => {
|
|
@@ -2079,6 +2089,13 @@ class Repzo {
|
|
|
2079
2089
|
return res;
|
|
2080
2090
|
},
|
|
2081
2091
|
};
|
|
2092
|
+
this.safeCrud = {
|
|
2093
|
+
_path: Repzo._end_points.SAFE_CRUD,
|
|
2094
|
+
create: async (body) => {
|
|
2095
|
+
let res = await this._create(this.svAPIEndpoint, this.safeCrud._path, body);
|
|
2096
|
+
return res;
|
|
2097
|
+
},
|
|
2098
|
+
};
|
|
2082
2099
|
this.svAPIEndpoint =
|
|
2083
2100
|
!options?.env || options?.env == "production"
|
|
2084
2101
|
? "https://sv.api.repzo.me"
|
package/lib/types/index.d.ts
CHANGED
|
@@ -14072,7 +14072,7 @@ export declare namespace Service {
|
|
|
14072
14072
|
}[];
|
|
14073
14073
|
}
|
|
14074
14074
|
export const fieldType_enums: readonly ["Text", "String", "Phone", "Email", "Date", "Number", "List", "Separator", "Heading", "Media", "Signature", "DateTime", "YesNo", "ProductBarcodeScan", "BarcodeScan", "GeoPoint"];
|
|
14075
|
-
export type FormV2FieldType =
|
|
14075
|
+
export type FormV2FieldType = typeof fieldType_enums[number];
|
|
14076
14076
|
interface FieldPrintSettings {
|
|
14077
14077
|
three_inch: {
|
|
14078
14078
|
grid_column?: 1 | 2;
|
|
@@ -14214,7 +14214,7 @@ export declare namespace Service {
|
|
|
14214
14214
|
}
|
|
14215
14215
|
namespace ActivityFormV2Result {
|
|
14216
14216
|
const fieldType_enums: readonly ["Text", "String", "Phone", "Email", "Date", "Number", "List", "Separator", "Heading", "Media", "Signature", "DateTime", "YesNo", "ProductBarcodeScan", "BarcodeScan", "GeoPoint"];
|
|
14217
|
-
type FormV2FieldType =
|
|
14217
|
+
type FormV2FieldType = typeof fieldType_enums[number];
|
|
14218
14218
|
interface FieldResult {
|
|
14219
14219
|
_id?: string;
|
|
14220
14220
|
field_id: string;
|
|
@@ -14489,7 +14489,7 @@ export declare namespace Service {
|
|
|
14489
14489
|
}
|
|
14490
14490
|
namespace TimelineReport {
|
|
14491
14491
|
export const activity_types: readonly ["day", "client", "visit", "payment", "activity-photo", "activity-audit", "activity-availability", "activity-checkout-display", "activity-feedback", "activity-form-result", "activity-form-v2-result", "activity-item-status", "activity-note", "activity-planogram", "activity-secondary-display", "activity-shelfshare", "activity-storecheck", "activity-task", "approval-request", "asset-part-receival", "asset-part-transfer", "asset", "asset-part", "asset-unit", "reminders", "return-asset-part-unit", "store-asset-part-unit", "refund", "settlement", "convert-proforma", "transfer", "proforma", "receiving-material", "void-invoice", "fullinvoices", "workorder", "workorder-request", "return-whole-invoice", "cycle"];
|
|
14492
|
-
type ActivityType =
|
|
14492
|
+
type ActivityType = typeof activity_types[number];
|
|
14493
14493
|
export interface Data {
|
|
14494
14494
|
_id: StringId;
|
|
14495
14495
|
company_namespace: string[];
|
|
@@ -15195,7 +15195,7 @@ export declare namespace Service {
|
|
|
15195
15195
|
}
|
|
15196
15196
|
namespace TimelineTimeList {
|
|
15197
15197
|
export const activity_types: readonly ["day", "client", "visit", "payment", "activity-photo", "activity-audit", "activity-availability", "activity-checkout-display", "activity-feedback", "activity-form-result", "activity-form-v2-result", "activity-item-status", "activity-note", "activity-planogram", "activity-secondary-display", "activity-shelfshare", "activity-storecheck", "activity-task", "approval-request", "asset-part-receival", "asset-part-transfer", "asset", "asset-part", "asset-unit", "reminders", "return-asset-part-unit", "store-asset-part-unit", "refund", "settlement", "convert-proforma", "transfer", "proforma", "receiving-material", "void-invoice", "fullinvoices", "workorder", "workorder-request", "return-whole-invoice", "cycle"];
|
|
15198
|
-
type ActivityType =
|
|
15198
|
+
type ActivityType = typeof activity_types[number];
|
|
15199
15199
|
export interface Data {
|
|
15200
15200
|
_id: StringId;
|
|
15201
15201
|
company_namespace: string[];
|
|
@@ -15654,6 +15654,94 @@ export declare namespace Service {
|
|
|
15654
15654
|
}
|
|
15655
15655
|
export {};
|
|
15656
15656
|
}
|
|
15657
|
+
namespace SalesAnalyticsReport {
|
|
15658
|
+
const groupBy_options: readonly ["client", "rep", "issue_date", "due_date", "serial_number", "product", "variant", "brand", "category", "status", "promotion_type", "class", "measureunit", "promotion", "chain", "channel", "city", "region", "country", "route", "teams"];
|
|
15659
|
+
type GroupByOption = typeof groupBy_options[number];
|
|
15660
|
+
const promotion_type_options: readonly ["get", "buy"];
|
|
15661
|
+
type PromotionTypeOption = typeof promotion_type_options[number];
|
|
15662
|
+
const class_options: readonly ["invoice", "return"];
|
|
15663
|
+
type ClassOption = typeof class_options[number];
|
|
15664
|
+
const status_options: readonly ["unpaid", "partially_paid", "paid"];
|
|
15665
|
+
type StatusOption = typeof status_options[number];
|
|
15666
|
+
const sortBy_field_options: readonly ["_id", "time"];
|
|
15667
|
+
type SortByFieldOption = typeof sortBy_field_options[number];
|
|
15668
|
+
const sortBy_type_options: readonly ["asc", "desc"];
|
|
15669
|
+
type SortByTypeOption = typeof sortBy_type_options[number];
|
|
15670
|
+
interface SortByOption {
|
|
15671
|
+
field: SortByFieldOption;
|
|
15672
|
+
type: SortByTypeOption;
|
|
15673
|
+
}
|
|
15674
|
+
interface Data {
|
|
15675
|
+
_id?: string;
|
|
15676
|
+
[key: string]: any;
|
|
15677
|
+
}
|
|
15678
|
+
namespace Find {
|
|
15679
|
+
type Params = DefaultPaginationQueryParams & {
|
|
15680
|
+
from_issue_date?: string;
|
|
15681
|
+
to_issue_date?: string;
|
|
15682
|
+
from_due_date?: string;
|
|
15683
|
+
to_due_date?: string;
|
|
15684
|
+
from_createdAt?: string;
|
|
15685
|
+
to_createdAt?: string;
|
|
15686
|
+
from_updatedAt?: string;
|
|
15687
|
+
to_updatedAt?: string;
|
|
15688
|
+
client?: StringId | StringId[];
|
|
15689
|
+
rep?: StringId | StringId[];
|
|
15690
|
+
creator?: StringId | StringId[];
|
|
15691
|
+
teams?: StringId | StringId[];
|
|
15692
|
+
status?: StatusOption | StatusOption[];
|
|
15693
|
+
promotion?: StringId | StringId[];
|
|
15694
|
+
product?: StringId | StringId[];
|
|
15695
|
+
variant?: StringId | StringId[];
|
|
15696
|
+
category?: StringId | StringId[];
|
|
15697
|
+
sub_category?: StringId | StringId[];
|
|
15698
|
+
brand?: StringId | StringId[];
|
|
15699
|
+
product_groups?: StringId | StringId[];
|
|
15700
|
+
class?: ClassOption | ClassOption[];
|
|
15701
|
+
with_brand?: boolean;
|
|
15702
|
+
with_category?: boolean;
|
|
15703
|
+
with_product_groups?: boolean;
|
|
15704
|
+
with_sub_category?: boolean;
|
|
15705
|
+
with_product_details?: boolean;
|
|
15706
|
+
with_variant_details?: boolean;
|
|
15707
|
+
with_teams?: boolean;
|
|
15708
|
+
with_promotions?: boolean;
|
|
15709
|
+
promotion_type?: PromotionTypeOption;
|
|
15710
|
+
with_balance?: boolean;
|
|
15711
|
+
groupBy?: GroupByOption | GroupByOption[];
|
|
15712
|
+
from_price?: number;
|
|
15713
|
+
to_price?: number;
|
|
15714
|
+
export?: string;
|
|
15715
|
+
chain?: StringId | StringId[];
|
|
15716
|
+
channel?: StringId | StringId[];
|
|
15717
|
+
CLIENT_TAGS?: StringId | StringId[];
|
|
15718
|
+
AREA_TAGS?: StringId | StringId[];
|
|
15719
|
+
tags?: StringId | StringId[];
|
|
15720
|
+
country?: string | string[];
|
|
15721
|
+
state?: string | string[];
|
|
15722
|
+
city?: string | string[];
|
|
15723
|
+
with_chain?: boolean;
|
|
15724
|
+
with_channel?: boolean;
|
|
15725
|
+
with_tags?: boolean;
|
|
15726
|
+
with_client_details?: boolean;
|
|
15727
|
+
admin?: StringId | StringId[];
|
|
15728
|
+
tax?: StringId | StringId[];
|
|
15729
|
+
with_original_price?: boolean;
|
|
15730
|
+
with_route?: boolean;
|
|
15731
|
+
route?: StringId | StringId[];
|
|
15732
|
+
with_external_serial_number?: boolean;
|
|
15733
|
+
with_workorder?: boolean;
|
|
15734
|
+
with_client_customFields?: boolean;
|
|
15735
|
+
with_rep_details?: boolean;
|
|
15736
|
+
with_rep_customFields?: boolean;
|
|
15737
|
+
sortBy?: SortByOption[];
|
|
15738
|
+
includeDocumentsCount?: boolean;
|
|
15739
|
+
};
|
|
15740
|
+
interface Result extends DefaultPaginationResult {
|
|
15741
|
+
data: Data[];
|
|
15742
|
+
}
|
|
15743
|
+
}
|
|
15744
|
+
}
|
|
15657
15745
|
namespace WorkorderAgenda {
|
|
15658
15746
|
interface Workorder {
|
|
15659
15747
|
name: string;
|
|
@@ -16288,6 +16376,33 @@ export declare namespace Service {
|
|
|
16288
16376
|
type Result = Data;
|
|
16289
16377
|
}
|
|
16290
16378
|
}
|
|
16379
|
+
namespace SafeCrud {
|
|
16380
|
+
interface Body {
|
|
16381
|
+
collection: "company";
|
|
16382
|
+
filters?: {
|
|
16383
|
+
[key: string]: any;
|
|
16384
|
+
};
|
|
16385
|
+
}
|
|
16386
|
+
interface CompanyBody extends Body {
|
|
16387
|
+
collection: "company";
|
|
16388
|
+
filters?: {
|
|
16389
|
+
name_space?: string | string[];
|
|
16390
|
+
};
|
|
16391
|
+
}
|
|
16392
|
+
interface CompanyResult {
|
|
16393
|
+
_id: StringId;
|
|
16394
|
+
name_space: string;
|
|
16395
|
+
allow_treating_invoice_as_proforma_for_etax?: boolean;
|
|
16396
|
+
}
|
|
16397
|
+
type Data = CompanyResult;
|
|
16398
|
+
export namespace Create {
|
|
16399
|
+
type Body = CompanyBody;
|
|
16400
|
+
interface Result extends DefaultPaginationResult {
|
|
16401
|
+
data: Data[];
|
|
16402
|
+
}
|
|
16403
|
+
}
|
|
16404
|
+
export {};
|
|
16405
|
+
}
|
|
16291
16406
|
}
|
|
16292
16407
|
export type StringId = string;
|
|
16293
16408
|
export type NameSpaces = string[];
|
package/lib/types/index.js
CHANGED
|
@@ -133,4 +133,35 @@ export var Service;
|
|
|
133
133
|
"cycle",
|
|
134
134
|
];
|
|
135
135
|
})(TimelineTimeList = Service.TimelineTimeList || (Service.TimelineTimeList = {}));
|
|
136
|
+
let SalesAnalyticsReport;
|
|
137
|
+
(function (SalesAnalyticsReport) {
|
|
138
|
+
SalesAnalyticsReport.groupBy_options = [
|
|
139
|
+
"client",
|
|
140
|
+
"rep",
|
|
141
|
+
"issue_date",
|
|
142
|
+
"due_date",
|
|
143
|
+
"serial_number",
|
|
144
|
+
"product",
|
|
145
|
+
"variant",
|
|
146
|
+
"brand",
|
|
147
|
+
"category",
|
|
148
|
+
"status",
|
|
149
|
+
"promotion_type",
|
|
150
|
+
"class",
|
|
151
|
+
"measureunit",
|
|
152
|
+
"promotion",
|
|
153
|
+
"chain",
|
|
154
|
+
"channel",
|
|
155
|
+
"city",
|
|
156
|
+
"region",
|
|
157
|
+
"country",
|
|
158
|
+
"route",
|
|
159
|
+
"teams",
|
|
160
|
+
];
|
|
161
|
+
SalesAnalyticsReport.promotion_type_options = ["get", "buy"];
|
|
162
|
+
SalesAnalyticsReport.class_options = ["invoice", "return"];
|
|
163
|
+
SalesAnalyticsReport.status_options = ["unpaid", "partially_paid", "paid"];
|
|
164
|
+
SalesAnalyticsReport.sortBy_field_options = ["_id", "time"];
|
|
165
|
+
SalesAnalyticsReport.sortBy_type_options = ["asc", "desc"];
|
|
166
|
+
})(SalesAnalyticsReport = Service.SalesAnalyticsReport || (Service.SalesAnalyticsReport = {}));
|
|
136
167
|
})(Service || (Service = {}));
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -104,6 +104,7 @@ export const end_points = {
|
|
|
104
104
|
RESET_COMPANY_NAMESPACE: "reset-company-namespace",
|
|
105
105
|
TEST_RESET_COMPANY_NAMESPACE: "test-reset-company-namespace",
|
|
106
106
|
TIMELINE_TIME_LIST: "timeline-time-list",
|
|
107
|
+
SALES_ANALYTICS_REPORT: "sales-analytics-report",
|
|
107
108
|
WORKORDER_AGENDA: "workorder-agenda",
|
|
108
109
|
MODULE_CUSTOM_VALIDATOR: "module-custom-validator",
|
|
109
110
|
NOTIFICATIONS_CENTER: "notifications-center",
|
|
@@ -111,6 +112,7 @@ export const end_points = {
|
|
|
111
112
|
REPORT_COLUMN: "report-column",
|
|
112
113
|
REPORT_SORT: "report-sort",
|
|
113
114
|
REPORT_FILTER: "report-filter",
|
|
115
|
+
SAFE_CRUD: "safe-crud",
|
|
114
116
|
} as const;
|
|
115
117
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
116
118
|
|
|
@@ -202,6 +204,7 @@ export const availableService = [
|
|
|
202
204
|
"repBalanceSummary",
|
|
203
205
|
"workorderPortalLink",
|
|
204
206
|
"customField",
|
|
207
|
+
"salesAnalyticsReport",
|
|
205
208
|
] as const;
|
|
206
209
|
export type AvailableService = (typeof availableService)[number];
|
|
207
210
|
|
|
@@ -4943,6 +4946,20 @@ export default class Repzo {
|
|
|
4943
4946
|
},
|
|
4944
4947
|
};
|
|
4945
4948
|
|
|
4949
|
+
salesAnalyticsReport = {
|
|
4950
|
+
_path: Repzo._end_points.SALES_ANALYTICS_REPORT,
|
|
4951
|
+
find: async (
|
|
4952
|
+
params?: Service.SalesAnalyticsReport.Find.Params,
|
|
4953
|
+
): Promise<Service.SalesAnalyticsReport.Find.Result> => {
|
|
4954
|
+
let res: Service.SalesAnalyticsReport.Find.Result = await this._fetch(
|
|
4955
|
+
this.svAPIEndpoint,
|
|
4956
|
+
this.salesAnalyticsReport._path,
|
|
4957
|
+
params,
|
|
4958
|
+
);
|
|
4959
|
+
return res;
|
|
4960
|
+
},
|
|
4961
|
+
};
|
|
4962
|
+
|
|
4946
4963
|
workorderAgenda = {
|
|
4947
4964
|
_path: Repzo._end_points.WORKORDER_AGENDA,
|
|
4948
4965
|
find: async (
|
|
@@ -5311,6 +5328,20 @@ export default class Repzo {
|
|
|
5311
5328
|
return res;
|
|
5312
5329
|
},
|
|
5313
5330
|
};
|
|
5331
|
+
|
|
5332
|
+
safeCrud = {
|
|
5333
|
+
_path: Repzo._end_points.SAFE_CRUD,
|
|
5334
|
+
create: async (
|
|
5335
|
+
body: Service.SafeCrud.Create.Body,
|
|
5336
|
+
): Promise<Service.SafeCrud.Create.Result> => {
|
|
5337
|
+
let res = await this._create(
|
|
5338
|
+
this.svAPIEndpoint,
|
|
5339
|
+
this.safeCrud._path,
|
|
5340
|
+
body,
|
|
5341
|
+
);
|
|
5342
|
+
return res;
|
|
5343
|
+
},
|
|
5344
|
+
};
|
|
5314
5345
|
}
|
|
5315
5346
|
|
|
5316
5347
|
function normalizeParams(params: Params): { [key: string]: any } {
|
package/src/types/index.ts
CHANGED
|
@@ -17674,6 +17674,125 @@ export namespace Service {
|
|
|
17674
17674
|
}
|
|
17675
17675
|
}
|
|
17676
17676
|
|
|
17677
|
+
export namespace SalesAnalyticsReport {
|
|
17678
|
+
export const groupBy_options = [
|
|
17679
|
+
"client",
|
|
17680
|
+
"rep",
|
|
17681
|
+
"issue_date",
|
|
17682
|
+
"due_date",
|
|
17683
|
+
"serial_number",
|
|
17684
|
+
"product",
|
|
17685
|
+
"variant",
|
|
17686
|
+
"brand",
|
|
17687
|
+
"category",
|
|
17688
|
+
"status",
|
|
17689
|
+
"promotion_type",
|
|
17690
|
+
"class",
|
|
17691
|
+
"measureunit",
|
|
17692
|
+
"promotion",
|
|
17693
|
+
"chain",
|
|
17694
|
+
"channel",
|
|
17695
|
+
"city",
|
|
17696
|
+
"region",
|
|
17697
|
+
"country",
|
|
17698
|
+
"route",
|
|
17699
|
+
"teams",
|
|
17700
|
+
] as const;
|
|
17701
|
+
export type GroupByOption = (typeof groupBy_options)[number];
|
|
17702
|
+
|
|
17703
|
+
export const promotion_type_options = ["get", "buy"] as const;
|
|
17704
|
+
export type PromotionTypeOption = (typeof promotion_type_options)[number];
|
|
17705
|
+
|
|
17706
|
+
export const class_options = ["invoice", "return"] as const;
|
|
17707
|
+
export type ClassOption = (typeof class_options)[number];
|
|
17708
|
+
|
|
17709
|
+
export const status_options = ["unpaid", "partially_paid", "paid"] as const;
|
|
17710
|
+
export type StatusOption = (typeof status_options)[number];
|
|
17711
|
+
|
|
17712
|
+
export const sortBy_field_options = ["_id", "time"] as const;
|
|
17713
|
+
export type SortByFieldOption = (typeof sortBy_field_options)[number];
|
|
17714
|
+
|
|
17715
|
+
export const sortBy_type_options = ["asc", "desc"] as const;
|
|
17716
|
+
export type SortByTypeOption = (typeof sortBy_type_options)[number];
|
|
17717
|
+
|
|
17718
|
+
export interface SortByOption {
|
|
17719
|
+
field: SortByFieldOption;
|
|
17720
|
+
type: SortByTypeOption;
|
|
17721
|
+
}
|
|
17722
|
+
|
|
17723
|
+
export interface Data {
|
|
17724
|
+
_id?: string;
|
|
17725
|
+
[key: string]: any;
|
|
17726
|
+
}
|
|
17727
|
+
|
|
17728
|
+
export namespace Find {
|
|
17729
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
17730
|
+
from_issue_date?: string;
|
|
17731
|
+
to_issue_date?: string;
|
|
17732
|
+
from_due_date?: string;
|
|
17733
|
+
to_due_date?: string;
|
|
17734
|
+
from_createdAt?: string;
|
|
17735
|
+
to_createdAt?: string;
|
|
17736
|
+
from_updatedAt?: string;
|
|
17737
|
+
to_updatedAt?: string;
|
|
17738
|
+
client?: StringId | StringId[];
|
|
17739
|
+
rep?: StringId | StringId[];
|
|
17740
|
+
creator?: StringId | StringId[];
|
|
17741
|
+
teams?: StringId | StringId[];
|
|
17742
|
+
status?: StatusOption | StatusOption[];
|
|
17743
|
+
promotion?: StringId | StringId[];
|
|
17744
|
+
product?: StringId | StringId[];
|
|
17745
|
+
variant?: StringId | StringId[];
|
|
17746
|
+
category?: StringId | StringId[];
|
|
17747
|
+
sub_category?: StringId | StringId[];
|
|
17748
|
+
brand?: StringId | StringId[];
|
|
17749
|
+
product_groups?: StringId | StringId[];
|
|
17750
|
+
class?: ClassOption | ClassOption[];
|
|
17751
|
+
with_brand?: boolean;
|
|
17752
|
+
with_category?: boolean;
|
|
17753
|
+
with_product_groups?: boolean;
|
|
17754
|
+
with_sub_category?: boolean;
|
|
17755
|
+
with_product_details?: boolean;
|
|
17756
|
+
with_variant_details?: boolean;
|
|
17757
|
+
with_teams?: boolean;
|
|
17758
|
+
with_promotions?: boolean;
|
|
17759
|
+
promotion_type?: PromotionTypeOption;
|
|
17760
|
+
with_balance?: boolean;
|
|
17761
|
+
groupBy?: GroupByOption | GroupByOption[];
|
|
17762
|
+
from_price?: number;
|
|
17763
|
+
to_price?: number;
|
|
17764
|
+
export?: string;
|
|
17765
|
+
chain?: StringId | StringId[];
|
|
17766
|
+
channel?: StringId | StringId[];
|
|
17767
|
+
CLIENT_TAGS?: StringId | StringId[];
|
|
17768
|
+
AREA_TAGS?: StringId | StringId[];
|
|
17769
|
+
tags?: StringId | StringId[];
|
|
17770
|
+
country?: string | string[];
|
|
17771
|
+
state?: string | string[];
|
|
17772
|
+
city?: string | string[];
|
|
17773
|
+
with_chain?: boolean;
|
|
17774
|
+
with_channel?: boolean;
|
|
17775
|
+
with_tags?: boolean;
|
|
17776
|
+
with_client_details?: boolean;
|
|
17777
|
+
admin?: StringId | StringId[];
|
|
17778
|
+
tax?: StringId | StringId[];
|
|
17779
|
+
with_original_price?: boolean;
|
|
17780
|
+
with_route?: boolean;
|
|
17781
|
+
route?: StringId | StringId[];
|
|
17782
|
+
with_external_serial_number?: boolean;
|
|
17783
|
+
with_workorder?: boolean;
|
|
17784
|
+
with_client_customFields?: boolean;
|
|
17785
|
+
with_rep_details?: boolean;
|
|
17786
|
+
with_rep_customFields?: boolean;
|
|
17787
|
+
sortBy?: SortByOption[];
|
|
17788
|
+
includeDocumentsCount?: boolean;
|
|
17789
|
+
};
|
|
17790
|
+
export interface Result extends DefaultPaginationResult {
|
|
17791
|
+
data: Data[];
|
|
17792
|
+
}
|
|
17793
|
+
}
|
|
17794
|
+
}
|
|
17795
|
+
|
|
17677
17796
|
export namespace WorkorderAgenda {
|
|
17678
17797
|
export interface Workorder {
|
|
17679
17798
|
name: string;
|
|
@@ -18422,6 +18541,29 @@ export namespace Service {
|
|
|
18422
18541
|
export type Result = Data;
|
|
18423
18542
|
}
|
|
18424
18543
|
}
|
|
18544
|
+
|
|
18545
|
+
export namespace SafeCrud {
|
|
18546
|
+
interface Body {
|
|
18547
|
+
collection: "company";
|
|
18548
|
+
filters?: { [key: string]: any };
|
|
18549
|
+
}
|
|
18550
|
+
interface CompanyBody extends Body {
|
|
18551
|
+
collection: "company";
|
|
18552
|
+
filters?: { name_space?: string | string[] };
|
|
18553
|
+
}
|
|
18554
|
+
interface CompanyResult {
|
|
18555
|
+
_id: StringId;
|
|
18556
|
+
name_space: string;
|
|
18557
|
+
allow_treating_invoice_as_proforma_for_etax?: boolean;
|
|
18558
|
+
}
|
|
18559
|
+
type Data = CompanyResult;
|
|
18560
|
+
export namespace Create {
|
|
18561
|
+
export type Body = CompanyBody;
|
|
18562
|
+
export interface Result extends DefaultPaginationResult {
|
|
18563
|
+
data: Data[];
|
|
18564
|
+
}
|
|
18565
|
+
}
|
|
18566
|
+
}
|
|
18425
18567
|
}
|
|
18426
18568
|
|
|
18427
18569
|
export type StringId = string;
|